133 lines
7.6 KiB
JSON
133 lines
7.6 KiB
JSON
{
|
|
"name": "configuration",
|
|
"factory": "./src/generators/configuration/configuration",
|
|
"schema": {
|
|
"$schema": "http://json-schema.org/schema",
|
|
"cli": "nx",
|
|
"$id": "NxStorybookConfigure",
|
|
"title": "Storybook Configuration",
|
|
"description": "Add Storybook configuration to a UI library or an application.",
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"aliases": ["project", "projectName"],
|
|
"description": "Project for which to generate Storybook configuration.",
|
|
"$default": { "$source": "argv", "index": 0 },
|
|
"x-prompt": "For which project do you want to generate Storybook configuration?",
|
|
"x-dropdown": "projects",
|
|
"x-priority": "important"
|
|
},
|
|
"configureCypress": {
|
|
"type": "boolean",
|
|
"description": "Run the cypress-configure generator.",
|
|
"x-prompt": "Configure a cypress e2e app to run against the storybook instance?",
|
|
"x-priority": "important"
|
|
},
|
|
"cypressDirectory": {
|
|
"type": "string",
|
|
"description": "A directory where the Cypress project will be placed. Added at root by default."
|
|
},
|
|
"linter": {
|
|
"description": "The tool to use for running lint checks.",
|
|
"type": "string",
|
|
"enum": ["eslint", "none"],
|
|
"default": "eslint"
|
|
},
|
|
"js": {
|
|
"type": "boolean",
|
|
"description": "Generate JavaScript story files rather than TypeScript story files.",
|
|
"default": false
|
|
},
|
|
"tsConfiguration": {
|
|
"type": "boolean",
|
|
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
|
"default": false,
|
|
"x-priority": "important"
|
|
},
|
|
"standaloneConfig": {
|
|
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
|
|
"type": "boolean",
|
|
"default": true,
|
|
"x-deprecated": "Nx only supports standaloneConfig"
|
|
},
|
|
"configureStaticServe": {
|
|
"type": "boolean",
|
|
"description": "Add a static-storybook to serve the static storybook built files.",
|
|
"default": false
|
|
},
|
|
"configureTestRunner": {
|
|
"type": "boolean",
|
|
"description": "Add a Storybook Test-Runner target."
|
|
},
|
|
"bundler": {
|
|
"description": "The Storybook builder to use.",
|
|
"type": "string",
|
|
"enum": ["vite", "webpack"],
|
|
"default": "webpack",
|
|
"x-priority": "important"
|
|
},
|
|
"storybook7Configuration": {
|
|
"description": "Configure your workspace using Storybook version 7. Defaults to true.",
|
|
"type": "boolean",
|
|
"default": true,
|
|
"hidden": true,
|
|
"aliases": ["storybook7betaConfiguration"]
|
|
},
|
|
"storybook7UiFramework": {
|
|
"type": "string",
|
|
"description": "Storybook UI Framework to use, for Storybook version 7.",
|
|
"enum": [
|
|
"@storybook/angular",
|
|
"@storybook/html-webpack5",
|
|
"@storybook/nextjs",
|
|
"@storybook/preact-webpack5",
|
|
"@storybook/react-webpack5",
|
|
"@storybook/react-vite",
|
|
"@storybook/server-webpack5",
|
|
"@storybook/svelte-webpack5",
|
|
"@storybook/svelte-vite",
|
|
"@storybook/sveltekit",
|
|
"@storybook/vue-webpack5",
|
|
"@storybook/vue-vite",
|
|
"@storybook/vue3-webpack5",
|
|
"@storybook/vue3-vite",
|
|
"@storybook/web-components-webpack5",
|
|
"@storybook/web-components-vite"
|
|
],
|
|
"x-priority": "important",
|
|
"hidden": false
|
|
},
|
|
"uiFramework": {
|
|
"type": "string",
|
|
"description": "Storybook UI Framework to use.",
|
|
"enum": [
|
|
"@storybook/angular",
|
|
"@storybook/react",
|
|
"@storybook/react-native",
|
|
"@storybook/html",
|
|
"@storybook/web-components",
|
|
"@storybook/vue",
|
|
"@storybook/vue3",
|
|
"@storybook/svelte"
|
|
]
|
|
},
|
|
"skipFormat": {
|
|
"description": "Skip formatting files.",
|
|
"type": "boolean",
|
|
"default": false,
|
|
"x-priority": "internal"
|
|
}
|
|
},
|
|
"required": ["name"],
|
|
"examplesFile": "---\ntitle: Storybook configuration generator examples\ndescription: This page contains examples for the @nrwl/storybook:configuration generator.\n---\n\nThis is a framework-agnostic generator for setting up Storybook configuration for a project.\n\n```bash\nnx g @nrwl/storybook:configuration\n```\n\nNx will understand if you're using Storybook v7 or Storybook v6 and configure your project accordingly. By default, it will try to use Storybook v7.\n\nWhen running this generator, you will be prompted to provide the following:\n\n- The `name` of the project you want to generate the configuration for.\n- The `storybook7UiFramework` you want to use. Supported values are:\n - `@storybook/angular`\n - `@storybook/html-webpack5`\n - `@storybook/nextjs`\n - `@storybook/preact-webpack5`\n - `@storybook/react-webpack5`\n - `@storybook/react-vite`\n - `@storybook/server-webpack5`\n - `@storybook/svelte-webpack5`\n - `@storybook/svelte-vite`\n - `@storybook/sveltekit`\n - `@storybook/vue-webpack5`\n - `@storybook/vue-vite`\n - `@storybook/vue3-webpack5`\n - `@storybook/vue3-vite`\n - `@storybook/web-components-webpack5`\n - `@storybook/web-components-vite`\n- Whether you want to `configureCypress`. If you choose `yes`, a Cypress e2e app will be created (or configured) to run against the project's Storybook instance.\n- Whether you want to `configureTestRunner`. If you choose `yes`, a `test-storybook` target will be generated in your project's `project.json`, with a command to invoke the [Storybook `test-runner`](https://storybook.js.org/docs/react/writing-tests/test-runner).\n\nYou must provide a `name` and a `storybook7UiFramework` for the generator to work.\n\nYou can read more about how this generator works, in the [Storybook package overview page](/packages/storybook#generating-storybook-configuration).\n\nIf you are using Angular, React, React Native or Next.js in your project, it's best to use the framework specific generator:\n\n- [React Storybook Configuration Generator](/packages/react/generators/storybook-configuration) (React and Next.js projects)\n\n- [Angular Storybook Configuration Generator](/packages/angular/generators/storybook-configuration)\n\n- [React Native Storybook Configuration Generator](/packages/react-native/generators/storybook-configuration)\n\n## Examples\n\n### Generate Storybook configuration using TypeScript\n\n```bash\nnx g @nrwl/storybook:configuration ui --storybook7UiFramework=@storybook/web-components-vite --tsConfiguration=true\n```\n\nThis will generate a Storybook configuration for the `ui` project using TypeScript for the Storybook configuration files (the files inside the `.storybook` directory).\n\n### Generate Storybook configuration for Storybook version 6\n\nIf, for somem reason, you want to force Nx to generate Storybook version 6 configuration, you can do so by passing false to the `storybook7Configuration` flag:\n\n```bash\nnx g @nrwl/storybook:configuration ui --uiFramework=@storybook/react --storybook7Configuration=false\n```\n\nHowever, this is **NOT recommended**.\n",
|
|
"presets": []
|
|
},
|
|
"description": "Add Storybook configuration to a UI library or an application.",
|
|
"hidden": false,
|
|
"implementation": "/packages/storybook/src/generators/configuration/configuration.ts",
|
|
"aliases": [],
|
|
"path": "/packages/storybook/src/generators/configuration/schema.json",
|
|
"type": "generator"
|
|
}
|