@storybook/cli 8.2.0-alpha.8 → 8.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +1 -68
  2. package/index.js +3 -0
  3. package/package.json +6 -90
  4. package/project.json +6 -0
  5. package/vitest.config.ts +9 -0
  6. package/.eslintrc.js +0 -36
  7. package/__mocks__/@aw-web-design/x-default-browser.js +0 -2
  8. package/bin/index.js +0 -26
  9. package/dist/block-dependencies-versions-ONWPA5NK.mjs +0 -38
  10. package/dist/block-node-version-GDD4HW5I.mjs +0 -14
  11. package/dist/block-storystorev6-N6QNOLBD.mjs +0 -23
  12. package/dist/chunk-LGGOBZAG.mjs +0 -3
  13. package/dist/chunk-WUKYLWAZ.mjs +0 -1
  14. package/dist/generate.d.ts +0 -2
  15. package/dist/generate.js +0 -717
  16. package/dist/generate.mjs +0 -709
  17. package/dist/index.d.ts +0 -2
  18. package/dist/index.js +0 -1
  19. package/dist/index.mjs +0 -3
  20. package/rendererAssets/.eslintrc.json +0 -19
  21. package/rendererAssets/common/Configure.mdx +0 -364
  22. package/rendererAssets/common/assets/accessibility.png +0 -0
  23. package/rendererAssets/common/assets/accessibility.svg +0 -1
  24. package/rendererAssets/common/assets/addon-library.png +0 -0
  25. package/rendererAssets/common/assets/assets.png +0 -0
  26. package/rendererAssets/common/assets/avif-test-image.avif +0 -0
  27. package/rendererAssets/common/assets/context.png +0 -0
  28. package/rendererAssets/common/assets/discord.svg +0 -1
  29. package/rendererAssets/common/assets/docs.png +0 -0
  30. package/rendererAssets/common/assets/figma-plugin.png +0 -0
  31. package/rendererAssets/common/assets/github.svg +0 -1
  32. package/rendererAssets/common/assets/share.png +0 -0
  33. package/rendererAssets/common/assets/styling.png +0 -0
  34. package/rendererAssets/common/assets/testing.png +0 -0
  35. package/rendererAssets/common/assets/theming.png +0 -0
  36. package/rendererAssets/common/assets/tutorials.svg +0 -1
  37. package/rendererAssets/common/assets/youtube.svg +0 -1
  38. package/rendererAssets/common/button.css +0 -30
  39. package/rendererAssets/common/header.css +0 -32
  40. package/rendererAssets/common/page.css +0 -69
  41. package/templates/angular/application/template-csf/.storybook/tsconfig.doc.json +0 -10
  42. package/templates/angular/application/template-csf/.storybook/tsconfig.json +0 -11
  43. package/templates/angular/application/template-csf/.storybook/typings.d.ts +0 -4
  44. package/templates/angular/library/template-csf/.storybook/tsconfig.json +0 -11
  45. package/templates/angular/library/template-csf/.storybook/typings.d.ts +0 -4
  46. package/templates/aurelia/template-csf/.storybook/tsconfig.json +0 -9
  47. package/templates/aurelia/template-csf/.storybook/typings.d.ts +0 -4
  48. package/test/default/cli.test.js +0 -14
  49. package/test/helpers.js +0 -15
package/README.md CHANGED
@@ -1,70 +1,3 @@
1
1
  # Storybook CLI
2
2
 
3
- Storybook CLI (_Command Line Interface_) is the easiest way to add [Storybook](https://github.com/storybookjs/storybook) to your project.
4
-
5
- ![Screenshot](docs/getstorybook.png)
6
-
7
- Go to your project and run:
8
-
9
- ```sh
10
- cd my-app
11
- npx sb init
12
- ```
13
-
14
- In addition to `init`, the CLI also has other commands:
15
-
16
- - `add` - add an addon and register it
17
- - `info` - print out system information for bug reports
18
- - `migrate` - run codemods to migrate your code
19
-
20
- See the command-line help with `-h` for details.
21
-
22
- ---
23
-
24
- ## [Yarn](https://github.com/yarnpkg/yarn) support
25
-
26
- The CLI supports yarn. If you have installed yarn in your system and your project has a `yarn.lock` file, it'll detect it and use `yarn` to install dependencies.
27
-
28
- If you don't want to use `yarn` always you can use the `--package-manager` option like this:
29
-
30
- ```sh
31
- npx sb init --package-manager=npm
32
- ```
33
-
34
- If you would like to force a particular version of yarn, you can use the `--package-manager` flag with a value of `yarn1` or `yarn2`.
35
-
36
- ---
37
-
38
- ## [PNPM](https://pnpm.io/) support
39
-
40
- The CLI supports pnpm. If you have installed pnpm in your system and your project has a `pnpm-lock.yaml` file, it'll detect it and use `pnpm` to install dependencies.
41
-
42
- If you don't have a lock file and would like to force pnpm to be used, you can use the `--package-manager` option like this:
43
-
44
- ```sh
45
- npx sb init --package-manager=pnpm
46
- ```
47
-
48
- ---
49
-
50
- ## [Flow](https://flow.org/) support
51
-
52
- It also supports flow files. By default, [jscodeshift](https://github.com/facebook/jscodeshift), the tool used to transform the source files, uses babel to read the files. To be able to transform any flow annotated file, you need to use the flow parser.
53
-
54
- ```sh
55
- npx sb init --parser flow
56
- ```
57
-
58
- For more information visit: [storybook.js.org](https://storybook.js.org)
59
-
60
- ---
61
-
62
- ## Manually specify project type
63
-
64
- If the CLI cannot detect your project type, it will ask you. You can also force it to use a particular project type:
65
-
66
- ```sh
67
- npx sb init --type <type>
68
- ```
69
-
70
- Where type is one of the project types defined in [project_types.ts](https://github.com/storybookjs/storybook/blob/next/code/lib/cli/src/project_types.ts)
3
+ This is a wrapper for <https://www.npmjs.com/package/@storybook/cli>
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ require('storybook/bin/index.cjs');
package/package.json CHANGED
@@ -1,13 +1,9 @@
1
1
  {
2
2
  "name": "@storybook/cli",
3
- "version": "8.2.0-alpha.8",
4
- "description": "Storybook's CLI - install, dev, build, upgrade, and more",
3
+ "version": "8.2.0-beta.0",
4
+ "description": "Storybook CLI",
5
5
  "keywords": [
6
- "cli",
7
- "generator",
8
- "dev",
9
- "build",
10
- "upgrade"
6
+ "storybook"
11
7
  ],
12
8
  "homepage": "https://github.com/storybookjs/storybook/tree/next/code/lib/cli",
13
9
  "bugs": {
@@ -23,95 +19,15 @@
23
19
  "url": "https://opencollective.com/storybook"
24
20
  },
25
21
  "license": "MIT",
26
- "author": "Storybook Team",
27
- "exports": {
28
- ".": {
29
- "types": "./dist/index.d.ts",
30
- "node": "./dist/index.js",
31
- "import": "./dist/index.mjs",
32
- "require": "./dist/index.js"
33
- },
34
- "./package.json": "./package.json",
35
- "./bin/index": "./bin/index.js"
36
- },
37
- "main": "dist/index.js",
38
- "module": "dist/index.mjs",
39
- "types": "dist/index.d.ts",
40
22
  "bin": {
41
- "getstorybook": "./bin/index.js",
42
- "sb": "./bin/index.js"
43
- },
44
- "files": [
45
- "bin/**/*",
46
- "dist/**/*",
47
- "rendererAssets/**/*",
48
- "templates/**/*",
49
- "README.md",
50
- "*.js",
51
- "*.d.ts",
52
- "!src/**/*"
53
- ],
54
- "scripts": {
55
- "check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
56
- "prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
23
+ "sb": "./index.js",
24
+ "storybook": "./index.js"
57
25
  },
58
26
  "dependencies": {
59
- "@babel/core": "^7.24.4",
60
- "@babel/types": "^7.24.0",
61
- "@ndelangen/get-tarball": "^3.0.7",
62
- "@storybook/codemod": "8.2.0-alpha.8",
63
- "@storybook/core-common": "8.2.0-alpha.8",
64
- "@storybook/core-events": "8.2.0-alpha.8",
65
- "@storybook/core-server": "8.2.0-alpha.8",
66
- "@storybook/csf-tools": "8.2.0-alpha.8",
67
- "@storybook/node-logger": "8.2.0-alpha.8",
68
- "@storybook/telemetry": "8.2.0-alpha.8",
69
- "@storybook/types": "8.2.0-alpha.8",
70
- "@types/semver": "^7.3.4",
71
- "@yarnpkg/fslib": "2.10.3",
72
- "@yarnpkg/libzip": "2.3.0",
73
- "chalk": "^4.1.0",
74
- "commander": "^6.2.1",
75
- "cross-spawn": "^7.0.3",
76
- "detect-indent": "^6.1.0",
77
- "envinfo": "^7.7.3",
78
- "execa": "^5.0.0",
79
- "find-up": "^5.0.0",
80
- "fs-extra": "^11.1.0",
81
- "get-npm-tarball-url": "^2.0.3",
82
- "giget": "^1.0.0",
83
- "globby": "^14.0.1",
84
- "jscodeshift": "^0.15.1",
85
- "leven": "^3.1.0",
86
- "ora": "^5.4.1",
87
- "prettier": "^3.1.1",
88
- "prompts": "^2.4.0",
89
- "read-pkg-up": "^7.0.1",
90
- "semver": "^7.3.7",
91
- "strip-json-comments": "^3.0.1",
92
- "tempy": "^3.1.0",
93
- "tiny-invariant": "^1.3.1",
94
- "ts-dedent": "^2.0.0"
95
- },
96
- "devDependencies": {
97
- "@types/cross-spawn": "^6.0.2",
98
- "@types/prompts": "^2.0.9",
99
- "@types/util-deprecate": "^1.0.0",
100
- "boxen": "^7.1.1",
101
- "slash": "^5.0.0",
102
- "strip-ansi": "^7.1.0",
103
- "strip-json-comments": "^3.1.1",
104
- "typescript": "^5.3.2"
27
+ "storybook": "8.2.0-beta.0"
105
28
  },
106
29
  "publishConfig": {
107
30
  "access": "public"
108
31
  },
109
- "bundler": {
110
- "entries": [
111
- "./src/generate.ts",
112
- "./src/index.ts"
113
- ],
114
- "platform": "node"
115
- },
116
32
  "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
117
33
  }
package/project.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "cli-storybook",
3
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
+ "projectType": "library",
5
+ "targets": {}
6
+ }
@@ -0,0 +1,9 @@
1
+ import { defineConfig, mergeConfig } from 'vitest/config';
2
+ import { vitestCommonConfig } from '../../vitest.workspace';
3
+
4
+ export default mergeConfig(
5
+ vitestCommonConfig,
6
+ defineConfig({
7
+ // Add custom config here
8
+ })
9
+ );
package/.eslintrc.js DELETED
@@ -1,36 +0,0 @@
1
- const ignore = 0;
2
-
3
- module.exports = {
4
- overrides: [
5
- {
6
- files: 'templates/**/*',
7
- env: {
8
- browser: true,
9
- },
10
- rules: {
11
- 'react/no-this-in-sfc': ignore,
12
- 'import/no-unresolved': ignore,
13
- 'react/react-in-jsx-scope': ignore,
14
- 'import/no-extraneous-dependencies': ignore,
15
- 'global-require': ignore,
16
- 'no-redeclare': ignore,
17
- 'react/prop-types': ignore,
18
- },
19
- },
20
- {
21
- files: 'rendererAssets/**/*',
22
- env: {
23
- browser: true,
24
- },
25
- rules: {
26
- 'jsx-a11y/anchor-is-valid': ignore,
27
- 'import/no-unresolved': ignore,
28
- 'react/prop-types': ignore,
29
- 'react/react-in-jsx-scope': ignore,
30
- 'import/no-extraneous-dependencies': ignore,
31
- 'import/extensions': ignore,
32
- 'import/named': ignore,
33
- },
34
- },
35
- ],
36
- };
@@ -1,2 +0,0 @@
1
- // TODO: Once we upgrade to Jest 28/29 we can probably remove this entire mock.
2
- module.exports = {};
package/bin/index.js DELETED
@@ -1,26 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const majorNodeVersion = parseInt(process.versions.node, 10);
4
- if (majorNodeVersion < 18) {
5
- console.error('To run Storybook you need to have Node.js 18 or higher');
6
- process.exit(1);
7
- }
8
-
9
- // The Storybook CLI has a catch block for all of its commands, but if an error
10
- // occurs before the command even runs, for instance, if an import fails, then
11
- // such error will fall under the uncaughtException handler.
12
- // This is the earliest moment we can catch such errors.
13
- process.once('uncaughtException', (error) => {
14
- if (error.message.includes('string-width')) {
15
- console.error(
16
- [
17
- '🔴 Error: It looks like you are having a known issue with package hoisting.',
18
- 'Please check the following issue for details and solutions: https://github.com/storybookjs/storybook/issues/22431#issuecomment-1630086092\n\n',
19
- ].join('\n')
20
- );
21
- }
22
-
23
- throw error;
24
- });
25
-
26
- require('../dist/generate.js');
@@ -1,38 +0,0 @@
1
- import './chunk-WUKYLWAZ.mjs';
2
- import './chunk-LGGOBZAG.mjs';
3
- import { dedent } from 'ts-dedent';
4
- import { lt } from 'semver';
5
- import chalk from 'chalk';
6
-
7
- var minimalVersionsMap={"@angular/core":"15.0.0","react-scripts":"5.0.0",next:"13.5.0",preact:"10.0.0",svelte:"4.0.0",vue:"3.0.0",vite:"4.0.0"},typedKeys=obj=>Object.keys(obj),blocker={id:"dependenciesVersions",async check({packageManager}){return (await Promise.all(typedKeys(minimalVersionsMap).map(async packageName=>({packageName,installedVersion:await packageManager.getPackageVersion(packageName),minimumVersion:minimalVersionsMap[packageName]})))).reduce((acc,{installedVersion,minimumVersion,packageName})=>acc||(packageName&&installedVersion&&lt(installedVersion,minimumVersion)?{installedVersion,packageName,minimumVersion}:acc),!1)},log(options,data){switch(data.packageName){case"react-scripts":return dedent`
8
- Support for react-script < 5.0.0 has been removed.
9
- Please see the migration guide for more information:
10
- ${chalk.yellow("https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#create-react-app-dropped-cra4-support")}
11
-
12
- Upgrade to the latest version of react-scripts.
13
- `;case"vue":return dedent`
14
- Support for Vue 2 has been removed.
15
- Please see the migration guide for more information:
16
- ${chalk.yellow("https://v3-migration.vuejs.org/")}
17
-
18
- Please upgrade to the latest version of Vue.
19
- `;case"@angular/core":return dedent`
20
- Support for Angular < 15 has been removed.
21
- Please see the migration guide for more information:
22
- ${chalk.yellow("https://angular.io/guide/update-to-version-15")}
23
-
24
- Please upgrade to the latest version of Angular.
25
- `;case"next":return dedent`
26
- Support for Next.js < 13.5 has been removed.
27
- Please see the migration guide for more information:
28
- ${chalk.yellow("https://nextjs.org/docs/pages/building-your-application/upgrading/version-13")}
29
-
30
- Please upgrade to the latest version of Next.js.
31
- `;default:return dedent`
32
- Support for ${data.packageName} version < ${data.minimumVersion} has been removed.
33
- Since version 8, Storybook needs a minimum version of ${data.minimumVersion}, but you have version ${data.installedVersion}.
34
-
35
- Please update this dependency.
36
- `}}};
37
-
38
- export { blocker };
@@ -1,14 +0,0 @@
1
- import './chunk-WUKYLWAZ.mjs';
2
- import './chunk-LGGOBZAG.mjs';
3
- import { dedent } from 'ts-dedent';
4
- import { lt } from 'semver';
5
- import chalk from 'chalk';
6
-
7
- var blocker={id:"minimumNode16",async check(){let nodeVersion=process.versions.node;return nodeVersion&&lt(nodeVersion,"18.0.0")?{nodeVersion}:!1},log(options,data){return dedent`
8
- We've detected you're using Node.js v${data.nodeVersion}.
9
- Storybook needs Node.js 18 or higher.
10
-
11
- ${chalk.yellow("https://nodejs.org/en/download")}
12
- `}};
13
-
14
- export { blocker };
@@ -1,23 +0,0 @@
1
- import './chunk-WUKYLWAZ.mjs';
2
- import './chunk-LGGOBZAG.mjs';
3
- import { dedent } from 'ts-dedent';
4
- import chalk from 'chalk';
5
-
6
- var blocker={id:"storyStoreV7removal",async check({mainConfig}){let features=mainConfig?.features;return features===void 0?!1:!!Object.hasOwn(features,"storyStoreV7")},log(){return dedent`
7
- StoryStoreV7 feature must be removed from your Storybook configuration.
8
- This feature was removed in Storybook 8.0.0.
9
- Please see the migration guide for more information:
10
- ${chalk.yellow("https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#storystorev6-and-storiesof-is-deprecated")}
11
-
12
- In your Storybook configuration we found storyStoryV7 feature defined. For instance:
13
-
14
- export default = {
15
- features: {
16
- ${chalk.cyan("storyStoreV7: false")}, <--- ${chalk.bold("remove this line")}
17
- },
18
- };
19
-
20
- You need to remove the storyStoreV7 property.
21
- `}};
22
-
23
- export { blocker };
@@ -1,3 +0,0 @@
1
- var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __require=(x=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x,{get:(a,b)=>(typeof require<"u"?require:a)[b]}):x)(function(x){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+x+'" is not supported')});var __commonJS=(cb,mod)=>function(){return mod||(0, cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod));
2
-
3
- export { __commonJS, __require, __toESM };
@@ -1 +0,0 @@
1
-
@@ -1,2 +0,0 @@
1
-
2
- export { }