Skip to content

Commit

Permalink
Document CLI version support
Browse files Browse the repository at this point in the history
  • Loading branch information
kylegach committed Jan 18, 2024
1 parent 80064a3 commit c970552
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 3 deletions.
7 changes: 7 additions & 0 deletions docs/api/cli-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ Storybook collects completely anonymous data to help us improve user experience.

All of the following documentation is available in the CLI by running `storybook --help`.

The [`init`](#init), [`sandbox`](#sandbox), and [`upgrade`](#upgrade) commands will use whichever version you specify. For example:

- `npx storybook@latest upgrade` will upgrade to the latest version
- `npx storybook@next upgrade` will upgrade to the newest pre-release version
- `npx storybook@7.6.10 upgrade` will upgrade to `7.6.10`
- `npx storybook@7 upgrade` will upgrade to the newest `7.x.x` version

### `dev`

Compiles and serves a development build of your Storybook that reflects your source code changes in the browser in real time. Should be run from the root of your project.
Expand Down
12 changes: 12 additions & 0 deletions docs/configure/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ To help ease the pain of keeping Storybook up-to-date, we provide a command-line

<!-- prettier-ignore-end -->

The `upgrade` command will use whichever version you specify. For example:

- `npx storybook@latest upgrade` will upgrade to the latest version
- `npx storybook@7.6.10 upgrade` will upgrade to `7.6.10`
- `npx storybook@7 upgrade` will upgrade to the newest `7.x.x` version

After running the command the script will:

- Upgrade all Storybook packages in your project to the latest stable version
Expand Down Expand Up @@ -69,6 +75,12 @@ To upgrade to the latest pre-release:

<!-- prettier-ignore-end -->

The `upgrade` command will use whichever version you specify. For example:

- `npx storybook@next upgrade` will upgrade to the newest pre-release version
- `npx storybook@8.0.0-beta.1 upgrade` will upgrade to `8.0.0-beta.1`
- `npx storybook@8 upgrade` will upgrade to the newest `8.x` version

If you'd like to downgrade to a stable version, manually edit the package version numbers in your `package.json` and re-install.

<Callout variant="info">
Expand Down
11 changes: 11 additions & 0 deletions docs/get-started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ Use the Storybook CLI to install it in a single command. Run this inside your pr

<!-- prettier-ignore-end -->

<details>
<summary>Install a specific version</summary>

The `init` command will use whichever version you specify. For example:

- `npx storybook@latest init` will initialize the latest version
- `npx storybook@7.6.10 init` will initialize `7.6.10`
- `npx storybook@7 init` will initialize the newest `7.x.x` version

</details>

Storybook will look into your project's dependencies during its install process and provide you with the best configuration available.

The command above will make the following changes to your local environment:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```shell
npx storybook@latest upgrade --prerelease
npx storybook@next upgrade
```
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```shell
pnpm dlx storybook@latest upgrade --prerelease
pnpm dlx storybook@next upgrade
```
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```shell
yarn dlx storybook@latest upgrade --prerelease
yarn dlx storybook@next upgrade
```

0 comments on commit c970552

Please sign in to comment.