diff --git a/docs/api/cli-options.md b/docs/api/cli-options.md index ee164e45e499..a43fab688816 100644 --- a/docs/api/cli-options.md +++ b/docs/api/cli-options.md @@ -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. diff --git a/docs/configure/upgrading.md b/docs/configure/upgrading.md index c5e57d8d714e..1e9bd416f1dd 100644 --- a/docs/configure/upgrading.md +++ b/docs/configure/upgrading.md @@ -22,6 +22,12 @@ To help ease the pain of keeping Storybook up-to-date, we provide a command-line +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 @@ -69,6 +75,12 @@ To upgrade to the latest pre-release: +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. diff --git a/docs/get-started/install.md b/docs/get-started/install.md index 44b2cf7aad92..6dc4ba4be7e3 100644 --- a/docs/get-started/install.md +++ b/docs/get-started/install.md @@ -16,6 +16,17 @@ Use the Storybook CLI to install it in a single command. Run this inside your pr +
+Install a specific version + +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 + +
+ 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: diff --git a/docs/snippets/common/storybook-upgrade-prerelease.npm.js.mdx b/docs/snippets/common/storybook-upgrade-prerelease.npm.js.mdx index 58a5cb6dd40c..2627dd4df0f9 100644 --- a/docs/snippets/common/storybook-upgrade-prerelease.npm.js.mdx +++ b/docs/snippets/common/storybook-upgrade-prerelease.npm.js.mdx @@ -1,3 +1,3 @@ ```shell -npx storybook@latest upgrade --prerelease +npx storybook@next upgrade ``` diff --git a/docs/snippets/common/storybook-upgrade-prerelease.pnpm.js.mdx b/docs/snippets/common/storybook-upgrade-prerelease.pnpm.js.mdx index 1e7199a4b8c3..0992b91d603b 100644 --- a/docs/snippets/common/storybook-upgrade-prerelease.pnpm.js.mdx +++ b/docs/snippets/common/storybook-upgrade-prerelease.pnpm.js.mdx @@ -1,3 +1,3 @@ ```shell -pnpm dlx storybook@latest upgrade --prerelease +pnpm dlx storybook@next upgrade ``` diff --git a/docs/snippets/common/storybook-upgrade-prerelease.yarn.js.mdx b/docs/snippets/common/storybook-upgrade-prerelease.yarn.js.mdx index 2033dc73e8dd..97f21c53a131 100644 --- a/docs/snippets/common/storybook-upgrade-prerelease.yarn.js.mdx +++ b/docs/snippets/common/storybook-upgrade-prerelease.yarn.js.mdx @@ -1,3 +1,3 @@ ```shell -yarn dlx storybook@latest upgrade --prerelease +yarn dlx storybook@next upgrade ```