@storybook/cli 7.0.0-alpha.19 → 7.0.0-alpha.21

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 CHANGED
@@ -53,4 +53,4 @@ If the CLI cannot detect your project type, it will ask you. You can also force
53
53
  npx sb init --type <type>
54
54
  ```
55
55
 
56
- Where type is one of the project types defined in [project_types.js](https://github.com/storybookjs/storybook/blob/next/lib/cli/src/project_types.ts)
56
+ 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)
@@ -26,6 +26,8 @@ var _npm = require("./npm7");
26
26
 
27
27
  var _sbScripts = require("./sb-scripts");
28
28
 
29
+ var _newFrameworks = require("./new-frameworks");
30
+
29
31
  var _types = require("../types");
30
32
 
31
33
  Object.keys(_types).forEach(function (key) {
@@ -39,5 +41,5 @@ Object.keys(_types).forEach(function (key) {
39
41
  }
40
42
  });
41
43
  });
42
- const fixes = [_cra.cra5, _webpack.webpack5, _angular.angular12, _vue.vue3, _mainjsFramework.mainjsFramework, _eslintPlugin.eslintPlugin, _builderVite.builderVite, _npm.npm7, _sbScripts.sbScripts];
44
+ const fixes = [_cra.cra5, _webpack.webpack5, _angular.angular12, _vue.vue3, _mainjsFramework.mainjsFramework, _eslintPlugin.eslintPlugin, _builderVite.builderVite, _npm.npm7, _sbScripts.sbScripts, _newFrameworks.newFrameworks];
43
45
  exports.fixes = fixes;
@@ -0,0 +1,249 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.newFrameworks = exports.getFrameworkOptions = exports.getBuilder = void 0;
7
+
8
+ var _chalk = _interopRequireDefault(require("chalk"));
9
+
10
+ var _tsDedent = _interopRequireDefault(require("ts-dedent"));
11
+
12
+ var _semver = _interopRequireDefault(require("@storybook/semver"));
13
+
14
+ var _csfTools = require("@storybook/csf-tools");
15
+
16
+ var _coreCommon = require("@storybook/core-common");
17
+
18
+ var _helpers = require("../../helpers");
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ const logger = console;
23
+ const packagesMap = {
24
+ '@storybook/react': {
25
+ webpack5: '@storybook/react-webpack5',
26
+ vite: '@storybook/react-vite'
27
+ },
28
+ '@storybook/preact': {
29
+ webpack5: '@storybook/preact-webpack5'
30
+ },
31
+ '@storybook/server': {
32
+ webpack5: '@storybook/server-webpack5'
33
+ },
34
+ '@storybook/angular': {
35
+ webpack5: '@storybook/angular'
36
+ },
37
+ '@storybook/vue': {
38
+ webpack5: '@storybook/vue-webpack5',
39
+ vite: '@storybook/vue-vite'
40
+ },
41
+ '@storybook/vue3': {
42
+ webpack5: '@storybook/vue3-webpack5',
43
+ vite: '@storybook/vue3-vite'
44
+ },
45
+ '@storybook/svelte': {
46
+ webpack5: '@storybook/svelte-webpack5',
47
+ vite: '@storybook/svelte-vite'
48
+ },
49
+ '@storybook/web-components': {
50
+ webpack5: '@storybook/web-components-webpack5'
51
+ },
52
+ '@storybook/html': {
53
+ webpack5: '@storybook/html-webpack5'
54
+ }
55
+ };
56
+
57
+ const getBuilder = builder => {
58
+ if (typeof builder === 'string') {
59
+ return builder.includes('vite') ? 'vite' : 'webpack5';
60
+ }
61
+
62
+ return builder !== null && builder !== void 0 && builder.name.includes('vite') ? 'vite' : 'webpack5';
63
+ };
64
+
65
+ exports.getBuilder = getBuilder;
66
+
67
+ const getFrameworkOptions = (framework, main) => {
68
+ const frameworkOptions = main.getFieldValue([`${framework}Options`]);
69
+ return frameworkOptions || {};
70
+ };
71
+ /**
72
+ * Does the user have separate framework and builders (e.g. @storybook/react + core.builder -> webpack5?
73
+ *
74
+ * If so:
75
+ * - Remove the dependencies (@storybook/react + @storybook/builder-webpack5 + @storybook/manager-webpack5)
76
+ * - Install the correct new package e.g. (@storybook/react-webpack5)
77
+ * - Update the main config to use the new framework
78
+ * -- moving core.builder into framework.options.builder
79
+ * -- moving frameworkOptions (e.g. reactOptions) into framework.options
80
+ */
81
+
82
+
83
+ exports.getFrameworkOptions = getFrameworkOptions;
84
+ const newFrameworks = {
85
+ id: 'newFrameworks',
86
+
87
+ async check({
88
+ packageManager
89
+ }) {
90
+ var _semver$coerce;
91
+
92
+ const packageJson = packageManager.retrievePackageJson();
93
+ const allDeps = Object.assign({}, packageJson.dependencies, packageJson.devDependencies);
94
+ const config = (0, _coreCommon.getStorybookInfo)(packageJson);
95
+ const {
96
+ mainConfig,
97
+ version: storybookVersion,
98
+ framework
99
+ } = config;
100
+
101
+ if (!mainConfig) {
102
+ logger.warn('Unable to find storybook main.js config, skipping');
103
+ return null;
104
+ }
105
+
106
+ const storybookCoerced = storybookVersion && ((_semver$coerce = _semver.default.coerce(storybookVersion)) === null || _semver$coerce === void 0 ? void 0 : _semver$coerce.version);
107
+
108
+ if (!storybookCoerced) {
109
+ logger.warn((0, _tsDedent.default)`
110
+ ❌ Unable to determine storybook version, skipping ${_chalk.default.cyan('newFrameworks')} fix.
111
+ 🤔 Are you running automigrate from your project directory?
112
+ `);
113
+ return null;
114
+ }
115
+
116
+ if (!_semver.default.gte(storybookCoerced, '7.0.0')) {
117
+ return null;
118
+ } // If in the future the eslint plugin has a framework option, using main to extract the framework field will be very useful
119
+
120
+
121
+ const main = await (0, _csfTools.readConfig)(mainConfig);
122
+ const frameworkPackage = main.getFieldValue(['framework']);
123
+ const builder = main.getFieldValue(['core', 'builder']);
124
+
125
+ if (!frameworkPackage) {
126
+ return null;
127
+ }
128
+
129
+ const supportedPackages = Object.keys(packagesMap);
130
+
131
+ if (!supportedPackages.includes(frameworkPackage)) {
132
+ return null;
133
+ }
134
+
135
+ const builderInfo = {
136
+ name: getBuilder(builder),
137
+ options: main.getFieldValue(['core', 'builder', 'options']) || {}
138
+ }; // TODO: once we have vite frameworks e.g. @storybook/react-vite, then we support it here
139
+ // and remove ['storybook-builder-vite', '@storybook/builder-vite'] from deps
140
+
141
+ if (builderInfo.name === 'vite') {
142
+ return null;
143
+ }
144
+
145
+ const frameworkOptions = getFrameworkOptions(framework, main);
146
+ const dependenciesToRemove = ['@storybook/builder-webpack5', '@storybook/manager-webpack5', '@storybook/builder-webpack4', '@storybook/manager-webpack4'].filter(dep => allDeps[dep]);
147
+ const newFrameworkPackage = packagesMap[frameworkPackage][builderInfo.name];
148
+ const dependenciesToAdd = []; // some frameworks didn't change e.g. Angular, Ember
149
+
150
+ if (newFrameworkPackage !== frameworkPackage) {
151
+ dependenciesToRemove.push(frameworkPackage);
152
+ dependenciesToAdd.push(newFrameworkPackage);
153
+ }
154
+
155
+ return {
156
+ main,
157
+ dependenciesToAdd,
158
+ dependenciesToRemove,
159
+ frameworkPackage: newFrameworkPackage,
160
+ frameworkOptions,
161
+ builderInfo,
162
+ packageJson
163
+ };
164
+ },
165
+
166
+ prompt() {
167
+ return (0, _tsDedent.default)`
168
+ We've detected you are using an older format of Storybook frameworks and builders.
169
+
170
+ In Storybook 7, frameworks also specify the builder to be used.
171
+
172
+ We can remove the dependencies that are no longer needed and install the new framework that already includes the builder.
173
+
174
+ To learn more about the framework field, see: ${_chalk.default.yellow('https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#framework-field-mandatory')}
175
+
176
+ ${_chalk.default.underline(_chalk.default.bold(_chalk.default.cyan('Webpack4 users')))}
177
+
178
+ Unless you're using Storybook's Vite builder, this automigration will install a Webpack5-based framework.
179
+
180
+ If you were using Storybook's Webpack4 builder (default in 6.x, discontinued in 7.0), this could be a breaking
181
+ change--especially if your project has a custom webpack configuration.
182
+
183
+ To learn more about migrating from Webpack4, see: ${_chalk.default.yellow('https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#webpack4-support-discontinued')}
184
+ `;
185
+ },
186
+
187
+ async run({
188
+ result: {
189
+ dependenciesToAdd,
190
+ dependenciesToRemove,
191
+ main,
192
+ frameworkPackage,
193
+ frameworkOptions,
194
+ builderInfo,
195
+ packageJson
196
+ },
197
+ packageManager,
198
+ dryRun
199
+ }) {
200
+ logger.info(`✅ Removing legacy dependencies: ${dependenciesToRemove.join(', ')}`);
201
+
202
+ if (!dryRun) {
203
+ packageManager.removeDependencies({
204
+ skipInstall: dependenciesToAdd.length > 0,
205
+ packageJson
206
+ }, dependenciesToRemove);
207
+ }
208
+
209
+ if (dependenciesToAdd.length > 0) {
210
+ logger.info(`✅ Installing new dependencies: ${dependenciesToAdd.join(', ')}`);
211
+
212
+ if (!dryRun) {
213
+ const versionToInstall = (0, _helpers.getStorybookVersionSpecifier)(packageJson);
214
+ const depsToAdd = dependenciesToAdd.map(dep => `${dep}@${versionToInstall}`);
215
+ packageManager.addDependencies({
216
+ installAsDevDependencies: true
217
+ }, depsToAdd);
218
+ }
219
+ }
220
+
221
+ if (!dryRun) {
222
+ logger.info(`✅ Updating framework field in main.js`);
223
+ const currentCore = main.getFieldValue(['core']);
224
+ main.setFieldValue(['framework', 'name'], frameworkPackage);
225
+ main.setFieldValue(['framework', 'options'], frameworkOptions);
226
+
227
+ if (currentCore !== null && currentCore !== void 0 && currentCore.builder) {
228
+ delete currentCore.builder;
229
+ }
230
+
231
+ if (Object.keys(builderInfo.options).length > 0) {
232
+ main.setFieldValue(['framework', 'options', 'builder'], builderInfo.options);
233
+ }
234
+
235
+ if (currentCore) {
236
+ if (Object.keys(currentCore).length === 0) {
237
+ // TODO: this should delete the field instead
238
+ main.setFieldValue(['core'], {});
239
+ } else {
240
+ main.setFieldValue(['core'], currentCore);
241
+ }
242
+ }
243
+
244
+ await (0, _csfTools.writeConfig)(main);
245
+ }
246
+ }
247
+
248
+ };
249
+ exports.newFrameworks = newFrameworks;
@@ -79,7 +79,7 @@ const automigrate = async ({
79
79
  logger.info(`✅ ran ${_chalk.default.cyan(f.id)} migration`);
80
80
  } catch (error) {
81
81
  logger.info(`❌ error when running ${_chalk.default.cyan(f.id)} migration:`);
82
- logger.info(error.message);
82
+ logger.info(error);
83
83
  logger.info();
84
84
  }
85
85
  } else {
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- // auto generated file, do not edit
8
7
  var _default = {
9
8
  'cra/default-js': {
10
9
  name: 'Create React App (Javascript)',
11
10
  script: 'npx create-react-app .',
11
+ cadence: ['ci', 'daily', 'weekly'],
12
12
  expected: {
13
13
  framework: '@storybook/cra',
14
14
  renderer: '@storybook/react',
@@ -18,11 +18,24 @@ var _default = {
18
18
  'cra/default-ts': {
19
19
  name: 'Create React App (Typescript)',
20
20
  script: 'npx create-react-app . --template typescript',
21
+ cadence: ['ci', 'daily', 'weekly'],
21
22
  expected: {
22
23
  framework: '@storybook/cra',
23
24
  renderer: '@storybook/react',
24
25
  builder: '@storybook/builder-webpack5'
25
26
  }
26
- }
27
+ } // FIXME: missing documentation.json
28
+ // 'angular/latest': {
29
+ // name: 'Angular (latest)',
30
+ // script:
31
+ // 'npx -p @angular/cli ng new angular-latest --directory . --routing=true --minimal=true --style=scss --skip-install=true --strict',
32
+ // cadence: ['ci', 'daily', 'weekly'],
33
+ // expected: {
34
+ // framework: '@storybook/angular',
35
+ // renderer: '@storybook/angular',
36
+ // builder: '@storybook/builder-webpack5',
37
+ // },
38
+ // },
39
+
27
40
  };
28
41
  exports.default = _default;
@@ -6,80 +6,80 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  // auto generated file, do not edit
8
8
  var _default = {
9
- '@storybook/addon-a11y': '7.0.0-alpha.19',
10
- '@storybook/addon-actions': '7.0.0-alpha.19',
11
- '@storybook/addon-backgrounds': '7.0.0-alpha.19',
12
- '@storybook/addon-controls': '7.0.0-alpha.19',
13
- '@storybook/addon-docs': '7.0.0-alpha.19',
14
- '@storybook/addon-essentials': '7.0.0-alpha.19',
15
- '@storybook/addon-highlight': '7.0.0-alpha.19',
16
- '@storybook/addon-interactions': '7.0.0-alpha.19',
17
- '@storybook/addon-jest': '7.0.0-alpha.19',
18
- '@storybook/addon-links': '7.0.0-alpha.19',
19
- '@storybook/addon-measure': '7.0.0-alpha.19',
20
- '@storybook/addon-outline': '7.0.0-alpha.19',
21
- '@storybook/addon-storyshots': '7.0.0-alpha.19',
22
- '@storybook/addon-storyshots-puppeteer': '7.0.0-alpha.19',
23
- '@storybook/addon-storysource': '7.0.0-alpha.19',
24
- '@storybook/addon-toolbars': '7.0.0-alpha.19',
25
- '@storybook/addon-viewport': '7.0.0-alpha.19',
26
- '@storybook/addons': '7.0.0-alpha.19',
27
- '@storybook/angular': '7.0.0-alpha.19',
28
- '@storybook/api': '7.0.0-alpha.19',
29
- '@storybook/blocks': '7.0.0-alpha.19',
30
- '@storybook/builder-manager': '7.0.0-alpha.19',
31
- '@storybook/builder-webpack5': '7.0.0-alpha.19',
32
- '@storybook/channel-postmessage': '7.0.0-alpha.19',
33
- '@storybook/channel-websocket': '7.0.0-alpha.19',
34
- '@storybook/channels': '7.0.0-alpha.19',
35
- '@storybook/cli': '7.0.0-alpha.19',
36
- '@storybook/client-api': '7.0.0-alpha.19',
37
- '@storybook/client-logger': '7.0.0-alpha.19',
38
- '@storybook/codemod': '7.0.0-alpha.19',
39
- '@storybook/components': '7.0.0-alpha.19',
40
- '@storybook/core-client': '7.0.0-alpha.19',
41
- '@storybook/core-common': '7.0.0-alpha.19',
42
- '@storybook/core-events': '7.0.0-alpha.19',
43
- '@storybook/core-server': '7.0.0-alpha.19',
44
- '@storybook/core-webpack': '7.0.0-alpha.19',
45
- '@storybook/csf-tools': '7.0.0-alpha.19',
46
- '@storybook/docs-tools': '7.0.0-alpha.19',
47
- '@storybook/ember': '7.0.0-alpha.19',
48
- '@storybook/html': '7.0.0-alpha.19',
49
- '@storybook/html-webpack5': '7.0.0-alpha.19',
50
- '@storybook/instrumenter': '7.0.0-alpha.19',
51
- '@storybook/node-logger': '7.0.0-alpha.19',
52
- '@storybook/postinstall': '7.0.0-alpha.19',
53
- '@storybook/preact': '7.0.0-alpha.19',
54
- '@storybook/preact-webpack5': '7.0.0-alpha.19',
55
- '@storybook/preset-html-webpack': '7.0.0-alpha.19',
56
- '@storybook/preset-preact-webpack': '7.0.0-alpha.19',
57
- '@storybook/preset-react-webpack': '7.0.0-alpha.19',
58
- '@storybook/preset-server-webpack': '7.0.0-alpha.19',
59
- '@storybook/preset-svelte-webpack': '7.0.0-alpha.19',
60
- '@storybook/preset-vue-webpack': '7.0.0-alpha.19',
61
- '@storybook/preset-vue3-webpack': '7.0.0-alpha.19',
62
- '@storybook/preset-web-components-webpack': '7.0.0-alpha.19',
63
- '@storybook/preview-web': '7.0.0-alpha.19',
64
- '@storybook/react': '7.0.0-alpha.19',
65
- '@storybook/react-webpack5': '7.0.0-alpha.19',
66
- '@storybook/router': '7.0.0-alpha.19',
67
- '@storybook/server': '7.0.0-alpha.19',
68
- '@storybook/server-webpack5': '7.0.0-alpha.19',
69
- '@storybook/source-loader': '7.0.0-alpha.19',
70
- '@storybook/store': '7.0.0-alpha.19',
71
- '@storybook/svelte': '7.0.0-alpha.19',
72
- '@storybook/svelte-webpack5': '7.0.0-alpha.19',
73
- '@storybook/telemetry': '7.0.0-alpha.19',
74
- '@storybook/theming': '7.0.0-alpha.19',
75
- '@storybook/ui': '7.0.0-alpha.19',
76
- '@storybook/vue': '7.0.0-alpha.19',
77
- '@storybook/vue-webpack5': '7.0.0-alpha.19',
78
- '@storybook/vue3': '7.0.0-alpha.19',
79
- '@storybook/vue3-webpack5': '7.0.0-alpha.19',
80
- '@storybook/web-components': '7.0.0-alpha.19',
81
- '@storybook/web-components-webpack5': '7.0.0-alpha.19',
82
- sb: '7.0.0-alpha.19',
83
- storybook: '7.0.0-alpha.19'
9
+ '@storybook/addon-a11y': '7.0.0-alpha.21',
10
+ '@storybook/addon-actions': '7.0.0-alpha.21',
11
+ '@storybook/addon-backgrounds': '7.0.0-alpha.21',
12
+ '@storybook/addon-controls': '7.0.0-alpha.21',
13
+ '@storybook/addon-docs': '7.0.0-alpha.21',
14
+ '@storybook/addon-essentials': '7.0.0-alpha.21',
15
+ '@storybook/addon-highlight': '7.0.0-alpha.21',
16
+ '@storybook/addon-interactions': '7.0.0-alpha.21',
17
+ '@storybook/addon-jest': '7.0.0-alpha.21',
18
+ '@storybook/addon-links': '7.0.0-alpha.21',
19
+ '@storybook/addon-measure': '7.0.0-alpha.21',
20
+ '@storybook/addon-outline': '7.0.0-alpha.21',
21
+ '@storybook/addon-storyshots': '7.0.0-alpha.21',
22
+ '@storybook/addon-storyshots-puppeteer': '7.0.0-alpha.21',
23
+ '@storybook/addon-storysource': '7.0.0-alpha.21',
24
+ '@storybook/addon-toolbars': '7.0.0-alpha.21',
25
+ '@storybook/addon-viewport': '7.0.0-alpha.21',
26
+ '@storybook/addons': '7.0.0-alpha.21',
27
+ '@storybook/angular': '7.0.0-alpha.21',
28
+ '@storybook/api': '7.0.0-alpha.21',
29
+ '@storybook/blocks': '7.0.0-alpha.21',
30
+ '@storybook/builder-manager': '7.0.0-alpha.21',
31
+ '@storybook/builder-webpack5': '7.0.0-alpha.21',
32
+ '@storybook/channel-postmessage': '7.0.0-alpha.21',
33
+ '@storybook/channel-websocket': '7.0.0-alpha.21',
34
+ '@storybook/channels': '7.0.0-alpha.21',
35
+ '@storybook/cli': '7.0.0-alpha.21',
36
+ '@storybook/client-api': '7.0.0-alpha.21',
37
+ '@storybook/client-logger': '7.0.0-alpha.21',
38
+ '@storybook/codemod': '7.0.0-alpha.21',
39
+ '@storybook/components': '7.0.0-alpha.21',
40
+ '@storybook/core-client': '7.0.0-alpha.21',
41
+ '@storybook/core-common': '7.0.0-alpha.21',
42
+ '@storybook/core-events': '7.0.0-alpha.21',
43
+ '@storybook/core-server': '7.0.0-alpha.21',
44
+ '@storybook/core-webpack': '7.0.0-alpha.21',
45
+ '@storybook/csf-tools': '7.0.0-alpha.21',
46
+ '@storybook/docs-tools': '7.0.0-alpha.21',
47
+ '@storybook/ember': '7.0.0-alpha.21',
48
+ '@storybook/html': '7.0.0-alpha.21',
49
+ '@storybook/html-webpack5': '7.0.0-alpha.21',
50
+ '@storybook/instrumenter': '7.0.0-alpha.21',
51
+ '@storybook/node-logger': '7.0.0-alpha.21',
52
+ '@storybook/postinstall': '7.0.0-alpha.21',
53
+ '@storybook/preact': '7.0.0-alpha.21',
54
+ '@storybook/preact-webpack5': '7.0.0-alpha.21',
55
+ '@storybook/preset-html-webpack': '7.0.0-alpha.21',
56
+ '@storybook/preset-preact-webpack': '7.0.0-alpha.21',
57
+ '@storybook/preset-react-webpack': '7.0.0-alpha.21',
58
+ '@storybook/preset-server-webpack': '7.0.0-alpha.21',
59
+ '@storybook/preset-svelte-webpack': '7.0.0-alpha.21',
60
+ '@storybook/preset-vue-webpack': '7.0.0-alpha.21',
61
+ '@storybook/preset-vue3-webpack': '7.0.0-alpha.21',
62
+ '@storybook/preset-web-components-webpack': '7.0.0-alpha.21',
63
+ '@storybook/preview-web': '7.0.0-alpha.21',
64
+ '@storybook/react': '7.0.0-alpha.21',
65
+ '@storybook/react-webpack5': '7.0.0-alpha.21',
66
+ '@storybook/router': '7.0.0-alpha.21',
67
+ '@storybook/server': '7.0.0-alpha.21',
68
+ '@storybook/server-webpack5': '7.0.0-alpha.21',
69
+ '@storybook/source-loader': '7.0.0-alpha.21',
70
+ '@storybook/store': '7.0.0-alpha.21',
71
+ '@storybook/svelte': '7.0.0-alpha.21',
72
+ '@storybook/svelte-webpack5': '7.0.0-alpha.21',
73
+ '@storybook/telemetry': '7.0.0-alpha.21',
74
+ '@storybook/theming': '7.0.0-alpha.21',
75
+ '@storybook/ui': '7.0.0-alpha.21',
76
+ '@storybook/vue': '7.0.0-alpha.21',
77
+ '@storybook/vue-webpack5': '7.0.0-alpha.21',
78
+ '@storybook/vue3': '7.0.0-alpha.21',
79
+ '@storybook/vue3-webpack5': '7.0.0-alpha.21',
80
+ '@storybook/web-components': '7.0.0-alpha.21',
81
+ '@storybook/web-components-webpack5': '7.0.0-alpha.21',
82
+ sb: '7.0.0-alpha.21',
83
+ storybook: '7.0.0-alpha.21'
84
84
  };
85
85
  exports.default = _default;
@@ -7,5 +7,6 @@ import { eslintPlugin } from './eslint-plugin';
7
7
  import { builderVite } from './builder-vite';
8
8
  import { npm7 } from './npm7';
9
9
  import { sbScripts } from './sb-scripts';
10
+ import { newFrameworks } from './new-frameworks';
10
11
  export * from '../types';
11
- export const fixes = [cra5, webpack5, angular12, vue3, mainjsFramework, eslintPlugin, builderVite, npm7, sbScripts];
12
+ export const fixes = [cra5, webpack5, angular12, vue3, mainjsFramework, eslintPlugin, builderVite, npm7, sbScripts, newFrameworks];
@@ -0,0 +1,225 @@
1
+ import chalk from 'chalk';
2
+ import dedent from 'ts-dedent';
3
+ import semver from '@storybook/semver';
4
+ import { readConfig, writeConfig } from '@storybook/csf-tools';
5
+ import { getStorybookInfo } from '@storybook/core-common';
6
+ import { getStorybookVersionSpecifier } from '../../helpers';
7
+ const logger = console;
8
+ const packagesMap = {
9
+ '@storybook/react': {
10
+ webpack5: '@storybook/react-webpack5',
11
+ vite: '@storybook/react-vite'
12
+ },
13
+ '@storybook/preact': {
14
+ webpack5: '@storybook/preact-webpack5'
15
+ },
16
+ '@storybook/server': {
17
+ webpack5: '@storybook/server-webpack5'
18
+ },
19
+ '@storybook/angular': {
20
+ webpack5: '@storybook/angular'
21
+ },
22
+ '@storybook/vue': {
23
+ webpack5: '@storybook/vue-webpack5',
24
+ vite: '@storybook/vue-vite'
25
+ },
26
+ '@storybook/vue3': {
27
+ webpack5: '@storybook/vue3-webpack5',
28
+ vite: '@storybook/vue3-vite'
29
+ },
30
+ '@storybook/svelte': {
31
+ webpack5: '@storybook/svelte-webpack5',
32
+ vite: '@storybook/svelte-vite'
33
+ },
34
+ '@storybook/web-components': {
35
+ webpack5: '@storybook/web-components-webpack5'
36
+ },
37
+ '@storybook/html': {
38
+ webpack5: '@storybook/html-webpack5'
39
+ }
40
+ };
41
+ export const getBuilder = builder => {
42
+ if (typeof builder === 'string') {
43
+ return builder.includes('vite') ? 'vite' : 'webpack5';
44
+ }
45
+
46
+ return builder?.name.includes('vite') ? 'vite' : 'webpack5';
47
+ };
48
+ export const getFrameworkOptions = (framework, main) => {
49
+ const frameworkOptions = main.getFieldValue([`${framework}Options`]);
50
+ return frameworkOptions || {};
51
+ };
52
+ /**
53
+ * Does the user have separate framework and builders (e.g. @storybook/react + core.builder -> webpack5?
54
+ *
55
+ * If so:
56
+ * - Remove the dependencies (@storybook/react + @storybook/builder-webpack5 + @storybook/manager-webpack5)
57
+ * - Install the correct new package e.g. (@storybook/react-webpack5)
58
+ * - Update the main config to use the new framework
59
+ * -- moving core.builder into framework.options.builder
60
+ * -- moving frameworkOptions (e.g. reactOptions) into framework.options
61
+ */
62
+
63
+ export const newFrameworks = {
64
+ id: 'newFrameworks',
65
+
66
+ async check({
67
+ packageManager
68
+ }) {
69
+ const packageJson = packageManager.retrievePackageJson();
70
+ const allDeps = Object.assign({}, packageJson.dependencies, packageJson.devDependencies);
71
+ const config = getStorybookInfo(packageJson);
72
+ const {
73
+ mainConfig,
74
+ version: storybookVersion,
75
+ framework
76
+ } = config;
77
+
78
+ if (!mainConfig) {
79
+ logger.warn('Unable to find storybook main.js config, skipping');
80
+ return null;
81
+ }
82
+
83
+ const storybookCoerced = storybookVersion && semver.coerce(storybookVersion)?.version;
84
+
85
+ if (!storybookCoerced) {
86
+ logger.warn(dedent`
87
+ ❌ Unable to determine storybook version, skipping ${chalk.cyan('newFrameworks')} fix.
88
+ 🤔 Are you running automigrate from your project directory?
89
+ `);
90
+ return null;
91
+ }
92
+
93
+ if (!semver.gte(storybookCoerced, '7.0.0')) {
94
+ return null;
95
+ } // If in the future the eslint plugin has a framework option, using main to extract the framework field will be very useful
96
+
97
+
98
+ const main = await readConfig(mainConfig);
99
+ const frameworkPackage = main.getFieldValue(['framework']);
100
+ const builder = main.getFieldValue(['core', 'builder']);
101
+
102
+ if (!frameworkPackage) {
103
+ return null;
104
+ }
105
+
106
+ const supportedPackages = Object.keys(packagesMap);
107
+
108
+ if (!supportedPackages.includes(frameworkPackage)) {
109
+ return null;
110
+ }
111
+
112
+ const builderInfo = {
113
+ name: getBuilder(builder),
114
+ options: main.getFieldValue(['core', 'builder', 'options']) || {}
115
+ }; // TODO: once we have vite frameworks e.g. @storybook/react-vite, then we support it here
116
+ // and remove ['storybook-builder-vite', '@storybook/builder-vite'] from deps
117
+
118
+ if (builderInfo.name === 'vite') {
119
+ return null;
120
+ }
121
+
122
+ const frameworkOptions = getFrameworkOptions(framework, main);
123
+ const dependenciesToRemove = ['@storybook/builder-webpack5', '@storybook/manager-webpack5', '@storybook/builder-webpack4', '@storybook/manager-webpack4'].filter(dep => allDeps[dep]);
124
+ const newFrameworkPackage = packagesMap[frameworkPackage][builderInfo.name];
125
+ const dependenciesToAdd = []; // some frameworks didn't change e.g. Angular, Ember
126
+
127
+ if (newFrameworkPackage !== frameworkPackage) {
128
+ dependenciesToRemove.push(frameworkPackage);
129
+ dependenciesToAdd.push(newFrameworkPackage);
130
+ }
131
+
132
+ return {
133
+ main,
134
+ dependenciesToAdd,
135
+ dependenciesToRemove,
136
+ frameworkPackage: newFrameworkPackage,
137
+ frameworkOptions,
138
+ builderInfo,
139
+ packageJson
140
+ };
141
+ },
142
+
143
+ prompt() {
144
+ return dedent`
145
+ We've detected you are using an older format of Storybook frameworks and builders.
146
+
147
+ In Storybook 7, frameworks also specify the builder to be used.
148
+
149
+ We can remove the dependencies that are no longer needed and install the new framework that already includes the builder.
150
+
151
+ To learn more about the framework field, see: ${chalk.yellow('https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#framework-field-mandatory')}
152
+
153
+ ${chalk.underline(chalk.bold(chalk.cyan('Webpack4 users')))}
154
+
155
+ Unless you're using Storybook's Vite builder, this automigration will install a Webpack5-based framework.
156
+
157
+ If you were using Storybook's Webpack4 builder (default in 6.x, discontinued in 7.0), this could be a breaking
158
+ change--especially if your project has a custom webpack configuration.
159
+
160
+ To learn more about migrating from Webpack4, see: ${chalk.yellow('https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#webpack4-support-discontinued')}
161
+ `;
162
+ },
163
+
164
+ async run({
165
+ result: {
166
+ dependenciesToAdd,
167
+ dependenciesToRemove,
168
+ main,
169
+ frameworkPackage,
170
+ frameworkOptions,
171
+ builderInfo,
172
+ packageJson
173
+ },
174
+ packageManager,
175
+ dryRun
176
+ }) {
177
+ logger.info(`✅ Removing legacy dependencies: ${dependenciesToRemove.join(', ')}`);
178
+
179
+ if (!dryRun) {
180
+ packageManager.removeDependencies({
181
+ skipInstall: dependenciesToAdd.length > 0,
182
+ packageJson
183
+ }, dependenciesToRemove);
184
+ }
185
+
186
+ if (dependenciesToAdd.length > 0) {
187
+ logger.info(`✅ Installing new dependencies: ${dependenciesToAdd.join(', ')}`);
188
+
189
+ if (!dryRun) {
190
+ const versionToInstall = getStorybookVersionSpecifier(packageJson);
191
+ const depsToAdd = dependenciesToAdd.map(dep => `${dep}@${versionToInstall}`);
192
+ packageManager.addDependencies({
193
+ installAsDevDependencies: true
194
+ }, depsToAdd);
195
+ }
196
+ }
197
+
198
+ if (!dryRun) {
199
+ logger.info(`✅ Updating framework field in main.js`);
200
+ const currentCore = main.getFieldValue(['core']);
201
+ main.setFieldValue(['framework', 'name'], frameworkPackage);
202
+ main.setFieldValue(['framework', 'options'], frameworkOptions);
203
+
204
+ if (currentCore?.builder) {
205
+ delete currentCore.builder;
206
+ }
207
+
208
+ if (Object.keys(builderInfo.options).length > 0) {
209
+ main.setFieldValue(['framework', 'options', 'builder'], builderInfo.options);
210
+ }
211
+
212
+ if (currentCore) {
213
+ if (Object.keys(currentCore).length === 0) {
214
+ // TODO: this should delete the field instead
215
+ main.setFieldValue(['core'], {});
216
+ } else {
217
+ main.setFieldValue(['core'], currentCore);
218
+ }
219
+ }
220
+
221
+ await writeConfig(main);
222
+ }
223
+ }
224
+
225
+ };
@@ -63,7 +63,7 @@ export const automigrate = async ({
63
63
  logger.info(`✅ ran ${chalk.cyan(f.id)} migration`);
64
64
  } catch (error) {
65
65
  logger.info(`❌ error when running ${chalk.cyan(f.id)} migration:`);
66
- logger.info(error.message);
66
+ logger.info(error);
67
67
  logger.info();
68
68
  }
69
69
  } else {
@@ -1,8 +1,8 @@
1
- // auto generated file, do not edit
2
1
  export default {
3
2
  'cra/default-js': {
4
3
  name: 'Create React App (Javascript)',
5
4
  script: 'npx create-react-app .',
5
+ cadence: ['ci', 'daily', 'weekly'],
6
6
  expected: {
7
7
  framework: '@storybook/cra',
8
8
  renderer: '@storybook/react',
@@ -12,10 +12,23 @@ export default {
12
12
  'cra/default-ts': {
13
13
  name: 'Create React App (Typescript)',
14
14
  script: 'npx create-react-app . --template typescript',
15
+ cadence: ['ci', 'daily', 'weekly'],
15
16
  expected: {
16
17
  framework: '@storybook/cra',
17
18
  renderer: '@storybook/react',
18
19
  builder: '@storybook/builder-webpack5'
19
20
  }
20
- }
21
+ } // FIXME: missing documentation.json
22
+ // 'angular/latest': {
23
+ // name: 'Angular (latest)',
24
+ // script:
25
+ // 'npx -p @angular/cli ng new angular-latest --directory . --routing=true --minimal=true --style=scss --skip-install=true --strict',
26
+ // cadence: ['ci', 'daily', 'weekly'],
27
+ // expected: {
28
+ // framework: '@storybook/angular',
29
+ // renderer: '@storybook/angular',
30
+ // builder: '@storybook/builder-webpack5',
31
+ // },
32
+ // },
33
+
21
34
  };
@@ -1,78 +1,78 @@
1
1
  // auto generated file, do not edit
2
2
  export default {
3
- '@storybook/addon-a11y': '7.0.0-alpha.19',
4
- '@storybook/addon-actions': '7.0.0-alpha.19',
5
- '@storybook/addon-backgrounds': '7.0.0-alpha.19',
6
- '@storybook/addon-controls': '7.0.0-alpha.19',
7
- '@storybook/addon-docs': '7.0.0-alpha.19',
8
- '@storybook/addon-essentials': '7.0.0-alpha.19',
9
- '@storybook/addon-highlight': '7.0.0-alpha.19',
10
- '@storybook/addon-interactions': '7.0.0-alpha.19',
11
- '@storybook/addon-jest': '7.0.0-alpha.19',
12
- '@storybook/addon-links': '7.0.0-alpha.19',
13
- '@storybook/addon-measure': '7.0.0-alpha.19',
14
- '@storybook/addon-outline': '7.0.0-alpha.19',
15
- '@storybook/addon-storyshots': '7.0.0-alpha.19',
16
- '@storybook/addon-storyshots-puppeteer': '7.0.0-alpha.19',
17
- '@storybook/addon-storysource': '7.0.0-alpha.19',
18
- '@storybook/addon-toolbars': '7.0.0-alpha.19',
19
- '@storybook/addon-viewport': '7.0.0-alpha.19',
20
- '@storybook/addons': '7.0.0-alpha.19',
21
- '@storybook/angular': '7.0.0-alpha.19',
22
- '@storybook/api': '7.0.0-alpha.19',
23
- '@storybook/blocks': '7.0.0-alpha.19',
24
- '@storybook/builder-manager': '7.0.0-alpha.19',
25
- '@storybook/builder-webpack5': '7.0.0-alpha.19',
26
- '@storybook/channel-postmessage': '7.0.0-alpha.19',
27
- '@storybook/channel-websocket': '7.0.0-alpha.19',
28
- '@storybook/channels': '7.0.0-alpha.19',
29
- '@storybook/cli': '7.0.0-alpha.19',
30
- '@storybook/client-api': '7.0.0-alpha.19',
31
- '@storybook/client-logger': '7.0.0-alpha.19',
32
- '@storybook/codemod': '7.0.0-alpha.19',
33
- '@storybook/components': '7.0.0-alpha.19',
34
- '@storybook/core-client': '7.0.0-alpha.19',
35
- '@storybook/core-common': '7.0.0-alpha.19',
36
- '@storybook/core-events': '7.0.0-alpha.19',
37
- '@storybook/core-server': '7.0.0-alpha.19',
38
- '@storybook/core-webpack': '7.0.0-alpha.19',
39
- '@storybook/csf-tools': '7.0.0-alpha.19',
40
- '@storybook/docs-tools': '7.0.0-alpha.19',
41
- '@storybook/ember': '7.0.0-alpha.19',
42
- '@storybook/html': '7.0.0-alpha.19',
43
- '@storybook/html-webpack5': '7.0.0-alpha.19',
44
- '@storybook/instrumenter': '7.0.0-alpha.19',
45
- '@storybook/node-logger': '7.0.0-alpha.19',
46
- '@storybook/postinstall': '7.0.0-alpha.19',
47
- '@storybook/preact': '7.0.0-alpha.19',
48
- '@storybook/preact-webpack5': '7.0.0-alpha.19',
49
- '@storybook/preset-html-webpack': '7.0.0-alpha.19',
50
- '@storybook/preset-preact-webpack': '7.0.0-alpha.19',
51
- '@storybook/preset-react-webpack': '7.0.0-alpha.19',
52
- '@storybook/preset-server-webpack': '7.0.0-alpha.19',
53
- '@storybook/preset-svelte-webpack': '7.0.0-alpha.19',
54
- '@storybook/preset-vue-webpack': '7.0.0-alpha.19',
55
- '@storybook/preset-vue3-webpack': '7.0.0-alpha.19',
56
- '@storybook/preset-web-components-webpack': '7.0.0-alpha.19',
57
- '@storybook/preview-web': '7.0.0-alpha.19',
58
- '@storybook/react': '7.0.0-alpha.19',
59
- '@storybook/react-webpack5': '7.0.0-alpha.19',
60
- '@storybook/router': '7.0.0-alpha.19',
61
- '@storybook/server': '7.0.0-alpha.19',
62
- '@storybook/server-webpack5': '7.0.0-alpha.19',
63
- '@storybook/source-loader': '7.0.0-alpha.19',
64
- '@storybook/store': '7.0.0-alpha.19',
65
- '@storybook/svelte': '7.0.0-alpha.19',
66
- '@storybook/svelte-webpack5': '7.0.0-alpha.19',
67
- '@storybook/telemetry': '7.0.0-alpha.19',
68
- '@storybook/theming': '7.0.0-alpha.19',
69
- '@storybook/ui': '7.0.0-alpha.19',
70
- '@storybook/vue': '7.0.0-alpha.19',
71
- '@storybook/vue-webpack5': '7.0.0-alpha.19',
72
- '@storybook/vue3': '7.0.0-alpha.19',
73
- '@storybook/vue3-webpack5': '7.0.0-alpha.19',
74
- '@storybook/web-components': '7.0.0-alpha.19',
75
- '@storybook/web-components-webpack5': '7.0.0-alpha.19',
76
- sb: '7.0.0-alpha.19',
77
- storybook: '7.0.0-alpha.19'
3
+ '@storybook/addon-a11y': '7.0.0-alpha.21',
4
+ '@storybook/addon-actions': '7.0.0-alpha.21',
5
+ '@storybook/addon-backgrounds': '7.0.0-alpha.21',
6
+ '@storybook/addon-controls': '7.0.0-alpha.21',
7
+ '@storybook/addon-docs': '7.0.0-alpha.21',
8
+ '@storybook/addon-essentials': '7.0.0-alpha.21',
9
+ '@storybook/addon-highlight': '7.0.0-alpha.21',
10
+ '@storybook/addon-interactions': '7.0.0-alpha.21',
11
+ '@storybook/addon-jest': '7.0.0-alpha.21',
12
+ '@storybook/addon-links': '7.0.0-alpha.21',
13
+ '@storybook/addon-measure': '7.0.0-alpha.21',
14
+ '@storybook/addon-outline': '7.0.0-alpha.21',
15
+ '@storybook/addon-storyshots': '7.0.0-alpha.21',
16
+ '@storybook/addon-storyshots-puppeteer': '7.0.0-alpha.21',
17
+ '@storybook/addon-storysource': '7.0.0-alpha.21',
18
+ '@storybook/addon-toolbars': '7.0.0-alpha.21',
19
+ '@storybook/addon-viewport': '7.0.0-alpha.21',
20
+ '@storybook/addons': '7.0.0-alpha.21',
21
+ '@storybook/angular': '7.0.0-alpha.21',
22
+ '@storybook/api': '7.0.0-alpha.21',
23
+ '@storybook/blocks': '7.0.0-alpha.21',
24
+ '@storybook/builder-manager': '7.0.0-alpha.21',
25
+ '@storybook/builder-webpack5': '7.0.0-alpha.21',
26
+ '@storybook/channel-postmessage': '7.0.0-alpha.21',
27
+ '@storybook/channel-websocket': '7.0.0-alpha.21',
28
+ '@storybook/channels': '7.0.0-alpha.21',
29
+ '@storybook/cli': '7.0.0-alpha.21',
30
+ '@storybook/client-api': '7.0.0-alpha.21',
31
+ '@storybook/client-logger': '7.0.0-alpha.21',
32
+ '@storybook/codemod': '7.0.0-alpha.21',
33
+ '@storybook/components': '7.0.0-alpha.21',
34
+ '@storybook/core-client': '7.0.0-alpha.21',
35
+ '@storybook/core-common': '7.0.0-alpha.21',
36
+ '@storybook/core-events': '7.0.0-alpha.21',
37
+ '@storybook/core-server': '7.0.0-alpha.21',
38
+ '@storybook/core-webpack': '7.0.0-alpha.21',
39
+ '@storybook/csf-tools': '7.0.0-alpha.21',
40
+ '@storybook/docs-tools': '7.0.0-alpha.21',
41
+ '@storybook/ember': '7.0.0-alpha.21',
42
+ '@storybook/html': '7.0.0-alpha.21',
43
+ '@storybook/html-webpack5': '7.0.0-alpha.21',
44
+ '@storybook/instrumenter': '7.0.0-alpha.21',
45
+ '@storybook/node-logger': '7.0.0-alpha.21',
46
+ '@storybook/postinstall': '7.0.0-alpha.21',
47
+ '@storybook/preact': '7.0.0-alpha.21',
48
+ '@storybook/preact-webpack5': '7.0.0-alpha.21',
49
+ '@storybook/preset-html-webpack': '7.0.0-alpha.21',
50
+ '@storybook/preset-preact-webpack': '7.0.0-alpha.21',
51
+ '@storybook/preset-react-webpack': '7.0.0-alpha.21',
52
+ '@storybook/preset-server-webpack': '7.0.0-alpha.21',
53
+ '@storybook/preset-svelte-webpack': '7.0.0-alpha.21',
54
+ '@storybook/preset-vue-webpack': '7.0.0-alpha.21',
55
+ '@storybook/preset-vue3-webpack': '7.0.0-alpha.21',
56
+ '@storybook/preset-web-components-webpack': '7.0.0-alpha.21',
57
+ '@storybook/preview-web': '7.0.0-alpha.21',
58
+ '@storybook/react': '7.0.0-alpha.21',
59
+ '@storybook/react-webpack5': '7.0.0-alpha.21',
60
+ '@storybook/router': '7.0.0-alpha.21',
61
+ '@storybook/server': '7.0.0-alpha.21',
62
+ '@storybook/server-webpack5': '7.0.0-alpha.21',
63
+ '@storybook/source-loader': '7.0.0-alpha.21',
64
+ '@storybook/store': '7.0.0-alpha.21',
65
+ '@storybook/svelte': '7.0.0-alpha.21',
66
+ '@storybook/svelte-webpack5': '7.0.0-alpha.21',
67
+ '@storybook/telemetry': '7.0.0-alpha.21',
68
+ '@storybook/theming': '7.0.0-alpha.21',
69
+ '@storybook/ui': '7.0.0-alpha.21',
70
+ '@storybook/vue': '7.0.0-alpha.21',
71
+ '@storybook/vue-webpack5': '7.0.0-alpha.21',
72
+ '@storybook/vue3': '7.0.0-alpha.21',
73
+ '@storybook/vue3-webpack5': '7.0.0-alpha.21',
74
+ '@storybook/web-components': '7.0.0-alpha.21',
75
+ '@storybook/web-components-webpack5': '7.0.0-alpha.21',
76
+ sb: '7.0.0-alpha.21',
77
+ storybook: '7.0.0-alpha.21'
78
78
  };
@@ -0,0 +1,31 @@
1
+ import { ConfigFile } from '@storybook/csf-tools';
2
+ import type { Fix } from '../types';
3
+ import type { PackageJsonWithDepsAndDevDeps } from '../../js-package-manager';
4
+ interface NewFrameworkRunOptions {
5
+ main: ConfigFile;
6
+ packageJson: PackageJsonWithDepsAndDevDeps;
7
+ dependenciesToAdd: string[];
8
+ dependenciesToRemove: string[];
9
+ frameworkPackage: string;
10
+ frameworkOptions: Record<string, any>;
11
+ builderInfo: {
12
+ name: string;
13
+ options: Record<string, any>;
14
+ };
15
+ }
16
+ export declare const getBuilder: (builder: string | {
17
+ name: string;
18
+ }) => "webpack5" | "vite";
19
+ export declare const getFrameworkOptions: (framework: string, main: ConfigFile) => any;
20
+ /**
21
+ * Does the user have separate framework and builders (e.g. @storybook/react + core.builder -> webpack5?
22
+ *
23
+ * If so:
24
+ * - Remove the dependencies (@storybook/react + @storybook/builder-webpack5 + @storybook/manager-webpack5)
25
+ * - Install the correct new package e.g. (@storybook/react-webpack5)
26
+ * - Update the main config to use the new framework
27
+ * -- moving core.builder into framework.options.builder
28
+ * -- moving frameworkOptions (e.g. reactOptions) into framework.options
29
+ */
30
+ export declare const newFrameworks: Fix<NewFrameworkRunOptions>;
31
+ export {};
@@ -2,6 +2,7 @@ declare const _default: {
2
2
  readonly 'cra/default-js': {
3
3
  readonly name: "Create React App (Javascript)";
4
4
  readonly script: "npx create-react-app .";
5
+ readonly cadence: readonly ["ci", "daily", "weekly"];
5
6
  readonly expected: {
6
7
  readonly framework: "@storybook/cra";
7
8
  readonly renderer: "@storybook/react";
@@ -11,6 +12,7 @@ declare const _default: {
11
12
  readonly 'cra/default-ts': {
12
13
  readonly name: "Create React App (Typescript)";
13
14
  readonly script: "npx create-react-app . --template typescript";
15
+ readonly cadence: readonly ["ci", "daily", "weekly"];
14
16
  readonly expected: {
15
17
  readonly framework: "@storybook/cra";
16
18
  readonly renderer: "@storybook/react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/cli",
3
- "version": "7.0.0-alpha.19",
3
+ "version": "7.0.0-alpha.21",
4
4
  "description": "Storybook's CLI - easiest method of adding storybook to your projects",
5
5
  "keywords": [
6
6
  "cli",
@@ -42,20 +42,19 @@
42
42
  ],
43
43
  "scripts": {
44
44
  "check": "tsc --noEmit",
45
- "preprepare": "node ./scripts/generate-repro-templates-list.js",
46
45
  "prepare": "node ../../../scripts/prepare.js",
47
46
  "test": "jest test/**/*.test.js"
48
47
  },
49
48
  "dependencies": {
50
49
  "@babel/core": "^7.12.10",
51
50
  "@babel/preset-env": "^7.12.11",
52
- "@storybook/codemod": "7.0.0-alpha.19",
53
- "@storybook/core-common": "7.0.0-alpha.19",
54
- "@storybook/core-server": "7.0.0-alpha.19",
55
- "@storybook/csf-tools": "7.0.0-alpha.19",
56
- "@storybook/node-logger": "7.0.0-alpha.19",
51
+ "@storybook/codemod": "7.0.0-alpha.21",
52
+ "@storybook/core-common": "7.0.0-alpha.21",
53
+ "@storybook/core-server": "7.0.0-alpha.21",
54
+ "@storybook/csf-tools": "7.0.0-alpha.21",
55
+ "@storybook/node-logger": "7.0.0-alpha.21",
57
56
  "@storybook/semver": "^7.3.2",
58
- "@storybook/telemetry": "7.0.0-alpha.19",
57
+ "@storybook/telemetry": "7.0.0-alpha.21",
59
58
  "boxen": "^5.1.2",
60
59
  "chalk": "^4.1.0",
61
60
  "commander": "^6.2.1",
@@ -82,7 +81,7 @@
82
81
  "update-notifier": "^5.0.1"
83
82
  },
84
83
  "devDependencies": {
85
- "@storybook/client-api": "7.0.0-alpha.19",
84
+ "@storybook/client-api": "7.0.0-alpha.21",
86
85
  "@types/cross-spawn": "^6.0.2",
87
86
  "@types/degit": "^2.8.3",
88
87
  "@types/prompts": "^2.0.9",
@@ -97,5 +96,5 @@
97
96
  "publishConfig": {
98
97
  "access": "public"
99
98
  },
100
- "gitHead": "74bdb53f67dd59bae2661c668d2d5d4296113281"
99
+ "gitHead": "d8cdc5b21af68e69c6eefeaae0e1efadd06947ea"
101
100
  }