From 3ddcffd38c4901ddabd85258a8a9866b0c8dc4cf Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Fri, 29 Mar 2024 12:39:02 -0600 Subject: [PATCH] chore: add prettier-config --- website/docusaurus.config.ts | 112 +++++++++++++-------------- website/sidebars.ts | 108 ++++++++++++-------------- website/src/pages/index.js | 145 +++++++++++++---------------------- yarn.lock | 4 + 4 files changed, 159 insertions(+), 210 deletions(-) diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index 137b8330..34b23648 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -1,61 +1,59 @@ -import type { Config } from "@docusaurus/types"; +import type {Config} from '@docusaurus/types' export default async function createConfigAsync() { return { - title: "oclif: The Open CLI Framework", - tagline: "Create command line tools your users love", - url: "https://oclif.github.io", - baseUrl: "/", - organizationName: "oclif", - projectName: "oclif.github.io", - deploymentBranch: "main", - scripts: ["https://buttons.github.io/buttons.js"], - stylesheets: [ - "https://fonts.googleapis.com/css?family=Roboto:400,700|Roboto+Mono", - ], - favicon: "img/oclif_rev.svg", + title: 'oclif: The Open CLI Framework', + tagline: 'Create command line tools your users love', + url: 'https://oclif.github.io', + baseUrl: '/', + organizationName: 'oclif', + projectName: 'oclif.github.io', + deploymentBranch: 'main', + scripts: ['https://buttons.github.io/buttons.js'], + stylesheets: ['https://fonts.googleapis.com/css?family=Roboto:400,700|Roboto+Mono'], + favicon: 'img/oclif_rev.svg', customFields: { disableHeaderTitle: true, fonts: { - myFont: ["Roboto", "sans-serif"], - myOtherFont: ["-apple-system", "system-ui"], + myFont: ['Roboto', 'sans-serif'], + myOtherFont: ['-apple-system', 'system-ui'], }, - repoUrl: "https://github.com/oclif/oclif", + repoUrl: 'https://github.com/oclif/oclif', presets: [ [ - "@docusaurus/preset-classic", + '@docusaurus/preset-classic', { blog: { feedOptions: { - type: "all", - title: "oclif.io Blog", - description: "The oclif.io Blog Feed", - copyright: "Copyright © 2023 Salesforce", + type: 'all', + title: 'oclif.io Blog', + description: 'The oclif.io Blog Feed', + copyright: 'Copyright © 2023 Salesforce', }, }, }, ], ], - blogSidebarCount: "ALL", + blogSidebarCount: 'ALL', }, - onBrokenLinks: "log", - onBrokenMarkdownLinks: "log", + onBrokenLinks: 'log', + onBrokenMarkdownLinks: 'log', presets: [ [ - "@docusaurus/preset-classic", + '@docusaurus/preset-classic', { docs: { showLastUpdateAuthor: true, showLastUpdateTime: true, - editUrl: "https://github.com/oclif/oclif.github.io/tree/docs/docs/", - path: "../docs", - sidebarPath: "../website/sidebars.ts", + editUrl: 'https://github.com/oclif/oclif.github.io/tree/docs/docs/', + path: '../docs', + sidebarPath: '../website/sidebars.ts', }, blog: { - path: "blog", + path: 'blog', }, theme: { - customCss: "../website/src/css/custom.css", + customCss: '../website/src/css/custom.css', }, }, ], @@ -64,57 +62,57 @@ export default async function createConfigAsync() { themeConfig: { navbar: { logo: { - src: "img/oclif.svg", - srcDark: "img/oclif_rev.svg", - alt: "oclif", - href: "/", - target: "_self", + src: 'img/oclif.svg', + srcDark: 'img/oclif_rev.svg', + alt: 'oclif', + href: '/', + target: '_self', }, items: [ { - to: "docs/introduction", - label: "Getting Started", - position: "right", + to: 'docs/introduction', + label: 'Getting Started', + position: 'right', }, { - to: "docs/api_reference", - label: "API Reference", - position: "right", + to: 'docs/api_reference', + label: 'API Reference', + position: 'right', }, { - to: "blog", - label: "Blog", - position: "right", + to: 'blog', + label: 'Blog', + position: 'right', }, { - href: "https://github.com/oclif/oclif", - className: "header-github-link", - "aria-label": "GitHub repository", - position: "right", + href: 'https://github.com/oclif/oclif', + className: 'header-github-link', + 'aria-label': 'GitHub repository', + position: 'right', }, ], }, announcementBar: { - id: "announcementBar-1", // Increment on change (otherwise new announcements won't show up for users who have already dismissed old ones) + id: 'announcementBar-1', // Increment on change (otherwise new announcements won't show up for users who have already dismissed old ones) content: `@oclif/core v3.0 is now out! 🥳️`, }, footer: { links: [], - copyright: "Copyright © 2023 Salesforce", + copyright: 'Copyright © 2023 Salesforce', logo: { - src: "img/salesforce-logo.svg", - alt: "Salesforce", - href: "https://developer.salesforce.com", + src: 'img/salesforce-logo.svg', + alt: 'Salesforce', + href: 'https://developer.salesforce.com', width: 160, height: 51, }, }, algolia: { - apiKey: "6032dd3bbb99cdcfacc285354871966c", - indexName: "oclifio", - appId: "Q04FC8Q6OZ", + apiKey: '6032dd3bbb99cdcfacc285354871966c', + indexName: 'oclifio', + appId: 'Q04FC8Q6OZ', contextualSearch: true, }, }, - } satisfies Config; + } satisfies Config } diff --git a/website/sidebars.ts b/website/sidebars.ts index c8a510c0..c3393e39 100644 --- a/website/sidebars.ts +++ b/website/sidebars.ts @@ -1,87 +1,75 @@ -import type { SidebarsConfig } from "@docusaurus/plugin-content-docs"; +import type {SidebarsConfig} from '@docusaurus/plugin-content-docs' const sidebars: SidebarsConfig = { docs: [ { - label: "Getting Started", - type: "category", + label: 'Getting Started', + type: 'category', collapsed: false, - items: [ - "introduction", - "features", - "faqs", - "generator_commands", - "templates", - ], + items: ['introduction', 'features', 'faqs', 'generator_commands', 'templates'], }, { - label: "Guides", - type: "category", + label: 'Guides', + type: 'category', collapsed: true, link: { - type: "generated-index", - slug: "guides", + type: 'generated-index', + slug: 'guides', }, items: [ - "aliases", - "base_class", - "configuring_your_cli", - "debugging", - "error_handling", - "esm", - "flag_inheritance", - "flexible_taxonomy", - "jit_plugins", - "json", - "nsis-installer_customization", - "releasing", - "running_programmatically", - "single_command_cli", - "testing", - "themes", - "user_experience", + 'aliases', + 'base_class', + 'configuring_your_cli', + 'debugging', + 'error_handling', + 'esm', + 'flag_inheritance', + 'flexible_taxonomy', + 'jit_plugins', + 'json', + 'nsis-installer_customization', + 'releasing', + 'running_programmatically', + 'single_command_cli', + 'testing', + 'themes', + 'user_experience', ], }, { - label: "API Reference", - type: "category", + label: 'API Reference', + type: 'category', collapsed: true, link: { - type: "generated-index", - slug: "api_reference", + type: 'generated-index', + slug: 'api_reference', }, items: [ - "commands", - "args", - "flags", - "config", - "command_discovery_strategies", - "topics", - "topic_separator", - "hooks", - "plugins", - "help_classes", - "performance", + 'commands', + 'args', + 'flags', + 'config', + 'command_discovery_strategies', + 'topics', + 'topic_separator', + 'hooks', + 'plugins', + 'help_classes', + 'performance', ], }, { - label: "Architecture", - type: "category", + label: 'Architecture', + type: 'category', collapsed: true, - items: ["command_execution", "plugin_loading"], + items: ['command_execution', 'plugin_loading'], }, { - label: "Also See", - type: "category", + label: 'Also See', + type: 'category', collapsed: true, - items: [ - "examples", - "external_links", - "related_repos", - "how_we_work", - "feedback", - ], + items: ['examples', 'external_links', 'related_repos', 'how_we_work', 'feedback'], }, ], -}; +} -export default sidebars; +export default sidebars diff --git a/website/src/pages/index.js b/website/src/pages/index.js index f249eed0..5a0d554c 100644 --- a/website/src/pages/index.js +++ b/website/src/pages/index.js @@ -1,71 +1,61 @@ -import Layout from "@theme/Layout"; -import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; -import React from "react"; +import Layout from '@theme/Layout' +import useDocusaurusContext from '@docusaurus/useDocusaurusContext' +import React from 'react' -import { useColorMode } from "@docusaurus/theme-common"; +import {useColorMode} from '@docusaurus/theme-common' function docUrl(doc, language) { - const { siteConfig } = useDocusaurusContext(); - return siteConfig.baseUrl + "docs/" + (language ? language + "/" : "") + doc; + const {siteConfig} = useDocusaurusContext() + return siteConfig.baseUrl + 'docs/' + (language ? language + '/' : '') + doc } function toTitleCase(str) { return str - .split(" ") + .split(' ') .map((w) => w[0].toUpperCase() + w.substring(1).toLowerCase()) - .join(" "); + .join(' ') } -const ImageSwitcher = ({ lightImageSrc, darkImageSrc, width, className }) => { +const ImageSwitcher = ({lightImageSrc, darkImageSrc, width, className}) => { return ( oclif - ); -}; + ) +} const Example = () => { return ( -
+    
       
         
           $ npx oclif generate mynewcli
         
-        
-          ? npm package name (mynewcli): mynewcli
-        
+        ? npm package name (mynewcli): mynewcli
         
           $ cd mynewcli
         
         
           $ ./bin/run.js hello world
         
-        
-          hello world! (./src/commands/hello/world.ts)
-        
+        hello world! (./src/commands/hello/world.ts)
       
     
- ); -}; + ) +} -const CompanyLogo = ({ width, viewBox, href, company }) => { - const alt = `${toTitleCase(company)} CLI`; - const src = `img/${company}-logo.svg`; +const CompanyLogo = ({width, viewBox, href, company}) => { + const alt = `${toTitleCase(company)} CLI` + const src = `img/${company}-logo.svg` return ( {alt} - ); -}; + ) +} export default (props) => { return ( @@ -74,24 +64,15 @@ export default (props) => {
- -

- The Open CLI Framework -

-

- Create command line tools your users love -

+ +

The Open CLI Framework

+

Create command line tools your users love

- oclif is an open source framework for building a command - line interface (CLI) in Node.js and Typescript. Create CLIs - with a few flags or advanced CLIs that have subcommands. - oclif makes it easy for you to build CLIs for your company, - service, or your own development needs. + oclif is an open source framework for building a command line interface (CLI) in Node.js and + Typescript. Create CLIs with a few flags or advanced CLIs that have subcommands. oclif makes it easy + for you to build CLIs for your company, service, or your own development needs.

@@ -100,7 +81,7 @@ export default (props) => { Get Started → @@ -116,10 +97,9 @@ export default (props) => { Ready to go

- Scaffold a fully functional CLI to get started quickly. - oclif packages our years of experience into out-of-the-box - functionality for argument parsing, command testing, and - auto-documentation of CLI features. + Scaffold a fully functional CLI to get started quickly. oclif packages our years of experience into + out-of-the-box functionality for argument parsing, command testing, and auto-documentation of + CLI features.

@@ -127,12 +107,8 @@ export default (props) => { 👐Open source

- oclif is{" "} - - open source - {" "} - and free to use or modify. We think you’ll love it too and - you can also help make it better. + oclif is open source and free to use + or modify. We think you’ll love it too and you can also help make it better.

@@ -140,9 +116,8 @@ export default (props) => { Extendable

- You or your users can easily extend your CLI functionality - to meet custom needs using plugins. Plugins are modular and - shareable, encouraging reuse. + You or your users can easily extend your CLI functionality to meet custom needs using plugins. + Plugins are modular and shareable, encouraging reuse.

@@ -150,22 +125,15 @@ export default (props) => { 🔒Trusted

- oclif is actively used to build the{" "} - + oclif is actively used to build the{' '} + Heroku - {" "} - and{" "} - + {' '} + and{' '} + Salesforce CLIs - , powering millions of interactions for - developers every day. + , powering millions of interactions for developers every day.

@@ -178,18 +146,17 @@ export default (props) => {

- CLIs built using{" "} + CLIs built using{' '}

- With oclif you can build command line tools for your - business, open source project, or your own development - workflow. Check out what others have built. + With oclif you can build command line tools for your business, open source project, or your own + development workflow. Check out what others have built.

@@ -202,17 +169,9 @@ export default (props) => { width="96" viewBox="16 16 0 0" /> - + - + @@ -220,5 +179,5 @@ export default (props) => {
- ); -}; + ) +} diff --git a/yarn.lock b/yarn.lock index fb57ccd1..6703c963 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,3 +2,7 @@ # yarn lockfile v1 +"@oclif/prettier-config@^0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@oclif/prettier-config/-/prettier-config-0.2.1.tgz#1def9f38134f9bfb229257f48a35f7d0d183dc78" + integrity sha512-XB8kwQj8zynXjIIWRm+6gO/r8Qft2xKtwBMSmq1JRqtA6TpwpqECqiu8LosBCyg2JBXuUy2lU23/L98KIR7FrQ==