mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-10 00:12:22 +08:00
change ordering of commands
This commit is contained in:
parent
cb22ad2a69
commit
e8dc7ca3ae
@ -80,6 +80,29 @@ Options include:
|
|||||||
| `--disable-telemetry` | Disables Storybook's telemetry. Learn more about it [here](../configure/telemetry.md).<br/>`storybook build --disable-telemetry` |
|
| `--disable-telemetry` | Disables Storybook's telemetry. Learn more about it [here](../configure/telemetry.md).<br/>`storybook build --disable-telemetry` |
|
||||||
| `--test` | Optimize Storybook's production build for performance and tests by removing unnecessary features with the `test` option. Learn more [here](../api/main-config-build.md).<br/>`storybook build --test` |
|
| `--test` | Optimize Storybook's production build for performance and tests by removing unnecessary features with the `test` option. Learn more [here](../api/main-config-build.md).<br/>`storybook build --test` |
|
||||||
|
|
||||||
|
<!-- Re-read this for accuracy -->
|
||||||
|
|
||||||
|
### `init`
|
||||||
|
|
||||||
|
Installs Storybook into your project per specified version (e.g., `@latest`, `@next`). Read more in the [installation guide](../get-started/install.md).
|
||||||
|
|
||||||
|
```shell
|
||||||
|
|
||||||
|
storybook[@version] init [options]
|
||||||
|
```
|
||||||
|
|
||||||
|
Options include:
|
||||||
|
|
||||||
|
| Option | Description |
|
||||||
|
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| `-b`, `--builder` | Defines the [builder](../builders/index.md) to use for your Storybook<br/>`storybook init --builder webpack5` |
|
||||||
|
| `-f`,`--force` | Forcefully installs Storybook into your project, prompting you to overwrite existing files<br/>`storybook init --force` |
|
||||||
|
| `-s`, `--skip-install` | Skips the dependency installation step. Used only when you need to configure Storybook manually<br/>`storybook init --skip-install` |
|
||||||
|
| `-t`, `--type` | Defines the [framework](../configure/frameworks.md) to use for your Storybook instance<br/>`storybook init --type solid` |
|
||||||
|
| `-y`, `--yes` | Skips interactive prompts and automatically installs Storybook per specified version<br/>`storybook init --yes` |
|
||||||
|
| `--package-manager` | Sets the package manager to use when installing the addon.<br/> Available package managers include `npm`, `yarn`, and `pnpm`<br/>`storybook init --package-manager pnpm` |
|
||||||
|
| `--use-pnp` | Enables [Plug'n'Play](https://yarnpkg.com/features/pnp) support for Yarn. This option is only available when using Yarn as your package manager<br/>`storybook init --use-pnp` |
|
||||||
|
|
||||||
### `add`
|
### `add`
|
||||||
|
|
||||||
Installs a Storybook addon and configures your project for it. Read more in the [addon installation guide](../addons/install-addons.md).
|
Installs a Storybook addon and configures your project for it. Read more in the [addon installation guide](../addons/install-addons.md).
|
||||||
@ -95,20 +118,19 @@ Options include:
|
|||||||
| `--package-manager` | Sets the package manager to use when installing the addon.<br/> Available package managers include `npm`, `yarn`, and `pnpm`<br/>`storybook add [addon] --package-manager pnpm` |
|
| `--package-manager` | Sets the package manager to use when installing the addon.<br/> Available package managers include `npm`, `yarn`, and `pnpm`<br/>`storybook add [addon] --package-manager pnpm` |
|
||||||
| `-s`, `--skip-postinstall` | Skips post-install configuration. Used only when you need to configure the addon yourself<br/>`storybook add [addon] --skip-postinstall` |
|
| `-s`, `--skip-postinstall` | Skips post-install configuration. Used only when you need to configure the addon yourself<br/>`storybook add [addon] --skip-postinstall` |
|
||||||
|
|
||||||
### `doctor`
|
### `remove`
|
||||||
|
|
||||||
Performs a health check on your Storybook project for common issues (e.g., duplicate dependencies, incompatible addons or mismatched versions) and provides suggestions on how to fix them. Applicable when [upgrading](../configure/upgrading.md#verifying-the-upgrade) Storybook versions.
|
Deletes a Storybook addon from your project. Read more in the [addon installation guide](../addons/install-addons.md#removing-addons).
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
storybook doctor [options]
|
storybook remove [addon] [options]
|
||||||
```
|
```
|
||||||
|
|
||||||
Options include:
|
Options include:
|
||||||
|
|
||||||
| Option | Description |
|
| Option | Description |
|
||||||
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `-c`, `--config-dir` | Directory where to load Storybook configurations from<br/>`storybook doctor --config-dir .storybook` |
|
| `--package-manager` | Sets the package manager to use when removing the addon.<br/>Available package managers include `npm`, `yarn`, and `pnpm`<br/>`storybook remove [addon]--package-manager pnpm` |
|
||||||
| `--package-manager` | Sets the package manager to use when running the health check.<br/>Available package managers include `npm`, `yarn`, and `pnpm`<br/>`storybook doctor --package-manager pnpm` |
|
|
||||||
|
|
||||||
### `upgrade`
|
### `upgrade`
|
||||||
|
|
||||||
@ -128,6 +150,21 @@ Options include:
|
|||||||
| `-y`, `--yes` | Skips interactive prompts and automatically upgrades Storybook to the latest version<br/>`storybook upgrade --yes` |
|
| `-y`, `--yes` | Skips interactive prompts and automatically upgrades Storybook to the latest version<br/>`storybook upgrade --yes` |
|
||||||
| `--package-manager` | Sets the package manager to use when installing the addon.<br/> Available package managers include `npm`, `yarn`, and `pnpm`<br/>`storybook upgrade --package-manager pnpm` |
|
| `--package-manager` | Sets the package manager to use when installing the addon.<br/> Available package managers include `npm`, `yarn`, and `pnpm`<br/>`storybook upgrade --package-manager pnpm` |
|
||||||
|
|
||||||
|
### `doctor`
|
||||||
|
|
||||||
|
Performs a health check on your Storybook project for common issues (e.g., duplicate dependencies, incompatible addons or mismatched versions) and provides suggestions on how to fix them. Applicable when [upgrading](../configure/upgrading.md#verifying-the-upgrade) Storybook versions.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
storybook doctor [options]
|
||||||
|
```
|
||||||
|
|
||||||
|
Options include:
|
||||||
|
|
||||||
|
| Option | Description |
|
||||||
|
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `-c`, `--config-dir` | Directory where to load Storybook configurations from<br/>`storybook doctor --config-dir .storybook` |
|
||||||
|
| `--package-manager` | Sets the package manager to use when running the health check.<br/>Available package managers include `npm`, `yarn`, and `pnpm`<br/>`storybook doctor --package-manager pnpm` |
|
||||||
|
|
||||||
### `info`
|
### `info`
|
||||||
|
|
||||||
Reports useful debugging information about your environment. Helpful in providing information when opening an issue or a discussion.
|
Reports useful debugging information about your environment. Helpful in providing information when opening an issue or a discussion.
|
||||||
@ -147,7 +184,7 @@ Storybook Environment Info:
|
|||||||
Shell: 5.9 - /bin/zsh
|
Shell: 5.9 - /bin/zsh
|
||||||
Binaries:
|
Binaries:
|
||||||
Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
|
Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
|
||||||
npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm
|
npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm <----- active
|
||||||
Browsers:
|
Browsers:
|
||||||
Chrome: 120.0.6099.199
|
Chrome: 120.0.6099.199
|
||||||
npmPackages:
|
npmPackages:
|
||||||
@ -161,22 +198,10 @@ Storybook Environment Info:
|
|||||||
@storybook/react-webpack5: ^7.6.6 => 7.6.6
|
@storybook/react-webpack5: ^7.6.6 => 7.6.6
|
||||||
@storybook/test: ^7.6.6 => 7.6.6
|
@storybook/test: ^7.6.6 => 7.6.6
|
||||||
storybook: ^7.6.6 => 7.6.6
|
storybook: ^7.6.6 => 7.6.6
|
||||||
|
npmGlobalPackages:
|
||||||
|
chromatic: ^10.2.0 => 10.2.0
|
||||||
```
|
```
|
||||||
|
|
||||||
### `remove`
|
|
||||||
|
|
||||||
Deletes a Storybook addon from your project. Read more in the [addon installation guide](../addons/install-addons.md#removing-addons).
|
|
||||||
|
|
||||||
```shell
|
|
||||||
storybook remove [addon] [options]
|
|
||||||
```
|
|
||||||
|
|
||||||
Options include:
|
|
||||||
|
|
||||||
| Option | Description |
|
|
||||||
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| `--package-manager` | Sets the package manager to use when removing the addon.<br/>Available package managers include `npm`, `yarn`, and `pnpm`<br/>`storybook remove [addon]--package-manager pnpm` |
|
|
||||||
|
|
||||||
### `sandbox`
|
### `sandbox`
|
||||||
|
|
||||||
Generates a local sandbox project for testing Storybook features based on the list of supported [frameworks](../configure/frameworks.md). Useful for reproducing bugs when opening an issue or a discussion.
|
Generates a local sandbox project for testing Storybook features based on the list of supported [frameworks](../configure/frameworks.md). Useful for reproducing bugs when opening an issue or a discussion.
|
||||||
@ -194,8 +219,7 @@ The `framework-filter` argument is optional and can filter the list of available
|
|||||||
Options include:
|
Options include:
|
||||||
|
|
||||||
| Option | Description |
|
| Option | Description |
|
||||||
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| --------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||||
| `-b`, `--branch [branch name]` | Select the branch to use for the sandbox project featuring the available features present in the selected branch (`next` for the pre-release version, `main` for the latest stable release)<br/>`storybook sandbox --branch main` |
|
|
||||||
| `-o`, `--output [dir-name]` | Configures the location of the sandbox project<br/>`storybook sandbox --output /my-sandbox-project` |
|
| `-o`, `--output [dir-name]` | Configures the location of the sandbox project<br/>`storybook sandbox --output /my-sandbox-project` |
|
||||||
| `--no-init` | Generates a sandbox project without without initializing Storybook<br/>`storybook sandbox --no-init` |
|
| `--no-init` | Generates a sandbox project without without initializing Storybook<br/>`storybook sandbox --no-init` |
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user