Skip to content

Commit

Permalink
feat: upgrade docusaurus
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Mar 19, 2024
1 parent 52958bb commit 8e6388e
Show file tree
Hide file tree
Showing 6 changed files with 3,327 additions and 1,701 deletions.
13 changes: 11 additions & 2 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,16 @@ It can be multiline.

## Command Methods

<AUTOGENERATED_TABLE_OF_CONTENTS>
- [Command Methods](#command-methods)
- [`this.log(message: string)`](#thislogmessage-string)
- [`this.warn(message: string | Error)`](#thiswarnmessage-string--error)
- [`this.error(message: string | Error, options?: {code?: string, exit?: number, ref?: string; suggestions?: string[];})`](#thiserrormessage-string--error-options-code-string-exit-number-ref-string-suggestions-string)
- [`this.exit(code: number = 0)`](#thisexitcode-number--0)
- [`this.logToStderr(message: string)`](#thislogtostderrmessage-string)
- [`this.jsonEnabled()`](#thisjsonenabled)
- [`this.toSuccessJson(result: unknown)`](#thistosuccessjsonresult-unknown)
- [`this.toErrorJson(result: unknown)`](#thistoerrorjsonresult-unknown)


The following assumes you are in the `run()` method of an oclif [command](commands.md).

Expand Down Expand Up @@ -140,7 +149,7 @@ The options object has the following options:

The `message`, `code`, `suggestions`, `ref` properties will be displayed when an error is shown. Reusable `Error` classes can be created that display the optional outputs above by implementing the `PrettyPrintableError` interface from the `Errors` namespace from `@oclif/core` and `this.error` will handle them appropriately.

These errors are friendly and won't show a traceback unless debugging is enabled with `DEBUG=*` or `CLI_NAME_DEBUG=1`.
These errors are friendly and won't show a traceback unless debugging is enabled with `DEBUG=*`.

```typescript
import {CLIError} from '@oclif/errors'
Expand Down
2 changes: 1 addition & 1 deletion docs/feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
title: Feedback
---

If you have any suggestions or just want to let us know what you think of oclif, send us a message at <[email protected]> or file an issue in [our repos](https://github.com/oclif).
If you have any suggestions or just want to let us know what you think of oclif, send us a message at [email protected] or file an issue in [our repos](https://github.com/oclif).
8 changes: 4 additions & 4 deletions website/blog/2021-03-01-introducing-oclif-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ The oclif team

| | oclif "v1" | oclif "Core" |
| - | - | -|
| Utility CLIs | oclif@<2<br/>@oclif/dev-cli@<2 | oclif@>=2
| Main packages | @oclif/core@<2<br/>@oclif/config@<2<br/>@oclif/errors@<2<br/>@oclif/parser@<4<br/>@oclif/plugin-help@<4<br/> | @oclif/core@>=1
| Utility CLIs | oclif@\<2<br/>@oclif/dev-cli@\<2 | oclif@>=2
| Main packages | @oclif/core@\<2<br/>@oclif/config@\<2<br/>@oclif/errors@\<2<br/>@oclif/parser@\<4<br/>@oclif/plugin-help@\<4<br/> | @oclif/core@>=1
| Node LTS | Node v8-14 | Node v12+ |
| TypeScript | typescript@<4 | typescript@>=4 |
| Main plugins | @oclif/plugin-autocomplete@<1<br/>@oclif/plugin-commands@<2<br/>@oclif/plugin-help@<4<br/>@oclif/plugin-not-found@<2<br/>@oclif/plugin-plugins@<2<br/>@oclif/plugin-update@<2<br/>plugin-warn-if-update-available@<2<br/>plugin-which@<2<br/> | @oclif/plugin-autocomplete@>=2<br/>@oclif/plugin-commands@>=2<br/>@oclif/plugin-help@>=4<br/>@oclif/plugin-not-found@>=2<br/>@oclif/plugin-plugins@>=2<br/>@oclif/plugin-update@>=2<br/>@oclif/plugin-warn-if-update-available@>=2<br/>@oclif/plugin-which@>=2<br/> |
| TypeScript | typescript@\<4 | typescript@>=4 |
| Main plugins | @oclif/plugin-autocomplete@\<1<br/>@oclif/plugin-commands@\<2<br/>@oclif/plugin-help@\<4<br/>@oclif/plugin-not-found@\<2<br/>@oclif/plugin-plugins@\<2<br/>@oclif/plugin-update@\<2<br/>plugin-warn-if-update-available@\<2<br/>plugin-which@\<2<br/> | @oclif/plugin-autocomplete@>=2<br/>@oclif/plugin-commands@>=2<br/>@oclif/plugin-help@>=4<br/>@oclif/plugin-not-found@>=2<br/>@oclif/plugin-plugins@>=2<br/>@oclif/plugin-update@>=2<br/>@oclif/plugin-warn-if-update-available@>=2<br/>@oclif/plugin-which@>=2<br/> |
10 changes: 5 additions & 5 deletions website/blog/2022-01-12-announcing-oclif-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ We’ve revamped the way command help is outputted to the terminal, making it bo
</tr>
</table>

Notice that there are new sections for flags and global flags, examples are displayed with better spacing, and there is a section at the bottom called Configuration Variables. This Configuration Variables section is not part of the new help by default. But we've added support for custom help sections, which is what the `sf` CLI uses to create the new section.
Notice that there are new sections for flags and global flags, examples are displayed with better spacing, and there is a section at the bottom called Configuration Variables. This Configuration Variables section is not part of the new help by default. But we've added support for custom help sections, which is what the `sf` CLI uses to create the new section.

### Async Command Parsing

Expand All @@ -88,7 +88,7 @@ The oclif team

<br/>

### Reference material
### Reference material

#### Migration Guide

Expand All @@ -102,8 +102,8 @@ The following matrix shows how the v1 libraries and plugins relate to the new v2

| | oclif "v1" | oclif "v2" |
| - | - | -|
| Utility CLIs | oclif@<2<br/>@oclif/dev-cli@<2 | oclif@>=2
| Utility CLIs | oclif@\<2<br/>@oclif/dev-cli@\<2 | oclif@>=2
| Main packages | @oclif/command<br/>@oclif/config<br/>@oclif/errors<br/>@oclif/parser<br/>@oclif/plugin-help<br/> | @oclif/core@>=1
| Node LTS | Node v8-14 | Node v12+ (at time of writing) |
| TypeScript | typescript@<4 | typescript@>=4 |
| Main plugins | @oclif/plugin-autocomplete@<1<br/>@oclif/plugin-commands@<2<br/>@oclif/plugin-help@<4<br/>@oclif/plugin-not-found@<2<br/>@oclif/plugin-plugins@<2<br/>@oclif/plugin-update@<2<br/>plugin-warn-if-update-available@<2<br/>plugin-which@<2<br/> | @oclif/plugin-autocomplete@>=1<br/>@oclif/plugin-commands@>=2<br/>@oclif/plugin-help@>=4<br/>@oclif/plugin-not-found@>=2<br/>@oclif/plugin-plugins@>=2<br/>@oclif/plugin-update@>=2<br/>@oclif/plugin-warn-if-update-available@>=2<br/>@oclif/plugin-which@>=2<br/> |
| TypeScript | typescript@\<4 | typescript@>=4 |
| Main plugins | @oclif/plugin-autocomplete@\<1<br/>@oclif/plugin-commands@\<2<br/>@oclif/plugin-help@\<4<br/>@oclif/plugin-not-found@\<2<br/>@oclif/plugin-plugins@\<2<br/>@oclif/plugin-update@\<2<br/>plugin-warn-if-update-available@\<2<br/>plugin-which@\<2<br/> | @oclif/plugin-autocomplete@>=1<br/>@oclif/plugin-commands@>=2<br/>@oclif/plugin-help@>=4<br/>@oclif/plugin-not-found@>=2<br/>@oclif/plugin-plugins@>=2<br/>@oclif/plugin-update@>=2<br/>@oclif/plugin-warn-if-update-available@>=2<br/>@oclif/plugin-which@>=2<br/> |
11 changes: 7 additions & 4 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
"docusaurus": "docusaurus"
},
"dependencies": {
"@docusaurus/core": "2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"@docusaurus/core": "^3",
"@docusaurus/preset-classic": "^3",
"clsx": "^1.1.1",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"engines": {
"node": ">=18"
}
}
Loading

0 comments on commit 8e6388e

Please sign in to comment.