@storybook/cli 8.2.0-alpha.9 → 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.
- package/README.md +1 -68
- package/index.js +3 -0
- package/package.json +6 -90
- package/project.json +6 -0
- package/vitest.config.ts +9 -0
- package/.eslintrc.js +0 -36
- package/__mocks__/@aw-web-design/x-default-browser.js +0 -2
- package/bin/index.js +0 -26
- package/dist/block-dependencies-versions-ONWPA5NK.mjs +0 -38
- package/dist/block-node-version-GDD4HW5I.mjs +0 -14
- package/dist/block-storystorev6-N6QNOLBD.mjs +0 -23
- package/dist/chunk-LGGOBZAG.mjs +0 -3
- package/dist/chunk-WUKYLWAZ.mjs +0 -1
- package/dist/generate.d.ts +0 -2
- package/dist/generate.js +0 -717
- package/dist/generate.mjs +0 -709
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1
- package/dist/index.mjs +0 -3
- package/rendererAssets/.eslintrc.json +0 -19
- package/rendererAssets/common/Configure.mdx +0 -364
- package/rendererAssets/common/assets/accessibility.png +0 -0
- package/rendererAssets/common/assets/accessibility.svg +0 -1
- package/rendererAssets/common/assets/addon-library.png +0 -0
- package/rendererAssets/common/assets/assets.png +0 -0
- package/rendererAssets/common/assets/avif-test-image.avif +0 -0
- package/rendererAssets/common/assets/context.png +0 -0
- package/rendererAssets/common/assets/discord.svg +0 -1
- package/rendererAssets/common/assets/docs.png +0 -0
- package/rendererAssets/common/assets/figma-plugin.png +0 -0
- package/rendererAssets/common/assets/github.svg +0 -1
- package/rendererAssets/common/assets/share.png +0 -0
- package/rendererAssets/common/assets/styling.png +0 -0
- package/rendererAssets/common/assets/testing.png +0 -0
- package/rendererAssets/common/assets/theming.png +0 -0
- package/rendererAssets/common/assets/tutorials.svg +0 -1
- package/rendererAssets/common/assets/youtube.svg +0 -1
- package/rendererAssets/common/button.css +0 -30
- package/rendererAssets/common/header.css +0 -32
- package/rendererAssets/common/page.css +0 -69
- package/templates/angular/application/template-csf/.storybook/tsconfig.doc.json +0 -10
- package/templates/angular/application/template-csf/.storybook/tsconfig.json +0 -11
- package/templates/angular/application/template-csf/.storybook/typings.d.ts +0 -4
- package/templates/angular/library/template-csf/.storybook/tsconfig.json +0 -11
- package/templates/angular/library/template-csf/.storybook/typings.d.ts +0 -4
- package/templates/aurelia/template-csf/.storybook/tsconfig.json +0 -9
- package/templates/aurelia/template-csf/.storybook/typings.d.ts +0 -4
- package/test/default/cli.test.js +0 -14
- package/test/helpers.js +0 -15
package/README.md
CHANGED
|
@@ -1,70 +1,3 @@
|
|
|
1
1
|
# Storybook CLI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-

|
|
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
package/package.json
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/cli",
|
|
3
|
-
"version": "8.2.0-
|
|
4
|
-
"description": "Storybook
|
|
3
|
+
"version": "8.2.0-beta.0",
|
|
4
|
+
"description": "Storybook CLI",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
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
|
-
"
|
|
42
|
-
"
|
|
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
|
-
"
|
|
60
|
-
"@babel/types": "^7.24.0",
|
|
61
|
-
"@ndelangen/get-tarball": "^3.0.7",
|
|
62
|
-
"@storybook/codemod": "8.2.0-alpha.9",
|
|
63
|
-
"@storybook/core-common": "8.2.0-alpha.9",
|
|
64
|
-
"@storybook/core-events": "8.2.0-alpha.9",
|
|
65
|
-
"@storybook/core-server": "8.2.0-alpha.9",
|
|
66
|
-
"@storybook/csf-tools": "8.2.0-alpha.9",
|
|
67
|
-
"@storybook/node-logger": "8.2.0-alpha.9",
|
|
68
|
-
"@storybook/telemetry": "8.2.0-alpha.9",
|
|
69
|
-
"@storybook/types": "8.2.0-alpha.9",
|
|
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
package/vitest.config.ts
ADDED
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
|
-
};
|
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&<(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&<(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 };
|
package/dist/chunk-LGGOBZAG.mjs
DELETED
|
@@ -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 };
|
package/dist/chunk-WUKYLWAZ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/dist/generate.d.ts
DELETED