@storybook/cli 7.0.0-alpha.31 → 7.0.0-alpha.34
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/.eslintrc.js +35 -0
- package/bin/index.js +1 -1
- package/dist/generate.d.ts +1 -0
- package/dist/generate.js +265 -0
- package/dist/generate.mjs +265 -0
- package/package.json +18 -12
- package/rendererAssets/svelte/Button.svelte +4 -3
- package/{dist/cjs/generators/ANGULAR → templates/angular}/template-csf/.storybook/tsconfig.json +0 -0
- package/{dist/cjs/generators/ANGULAR → templates/angular}/template-csf/.storybook/typings.d.ts +0 -0
- package/{dist/cjs/generators/AURELIA → templates/aurelia}/template-csf/.storybook/tsconfig.json +0 -0
- package/{dist/cjs/generators/AURELIA → templates/aurelia}/template-csf/.storybook/typings.d.ts +0 -0
- package/{dist/esm/generators/REACT_NATIVE → templates/react-native}/template-csf/storybook/addons.js +1 -1
- package/{dist/esm/generators/REACT_NATIVE → templates/react-native}/template-csf/storybook/index.js +13 -6
- package/{dist/esm/generators/REACT_NATIVE → templates/react-native}/template-csf/storybook/rn-addons.js +1 -1
- package/templates/react-native/template-csf/storybook/stories/Button/Button.stories.js +20 -0
- package/{dist/esm/generators/REACT_NATIVE → templates/react-native}/template-csf/storybook/stories/Button/index.js +8 -10
- package/{dist/esm/generators/REACT_NATIVE → templates/react-native}/template-csf/storybook/stories/CenterView/index.js +8 -9
- package/{dist/esm/generators/REACT_NATIVE → templates/react-native}/template-csf/storybook/stories/CenterView/style.js +3 -3
- package/{dist/esm/generators/REACT_NATIVE → templates/react-native}/template-csf/storybook/stories/Welcome/Welcome.stories.js +2 -3
- package/templates/react-native/template-csf/storybook/stories/Welcome/index.js +57 -0
- package/templates/react-native/template-csf/storybook/stories/index.js +2 -0
- package/templates/server/template-csf/.storybook/preview.js +5 -0
- package/dist/cjs/NpmOptions.js +0 -1
- package/dist/cjs/add.js +0 -149
- package/dist/cjs/automigrate/fixes/angular12.js +0 -74
- package/dist/cjs/automigrate/fixes/builder-vite.js +0 -118
- package/dist/cjs/automigrate/fixes/cra5.js +0 -82
- package/dist/cjs/automigrate/fixes/eslint-plugin.js +0 -126
- package/dist/cjs/automigrate/fixes/index.js +0 -45
- package/dist/cjs/automigrate/fixes/mainjsFramework.js +0 -94
- package/dist/cjs/automigrate/fixes/new-frameworks.js +0 -258
- package/dist/cjs/automigrate/fixes/npm7.js +0 -57
- package/dist/cjs/automigrate/fixes/sb-scripts.js +0 -140
- package/dist/cjs/automigrate/fixes/vue3.js +0 -77
- package/dist/cjs/automigrate/fixes/webpack5.js +0 -151
- package/dist/cjs/automigrate/helpers/getEslintInfo.js +0 -28
- package/dist/cjs/automigrate/index.js +0 -98
- package/dist/cjs/automigrate/types.js +0 -5
- package/dist/cjs/babel-config.js +0 -65
- package/dist/cjs/build.js +0 -36
- package/dist/cjs/detect-nextjs.js +0 -33
- package/dist/cjs/detect-webpack.js +0 -39
- package/dist/cjs/detect.js +0 -179
- package/dist/cjs/dev.js +0 -66
- package/dist/cjs/dirs.js +0 -12
- package/dist/cjs/extract.js +0 -93
- package/dist/cjs/generate.js +0 -215
- package/dist/cjs/generators/ANGULAR/angular-helpers.js +0 -106
- package/dist/cjs/generators/ANGULAR/index.js +0 -95
- package/dist/cjs/generators/AURELIA/index.js +0 -41
- package/dist/cjs/generators/EMBER/index.js +0 -20
- package/dist/cjs/generators/HTML/index.js +0 -15
- package/dist/cjs/generators/MARIONETTE/index.js +0 -15
- package/dist/cjs/generators/MARKO/index.js +0 -15
- package/dist/cjs/generators/MITHRIL/index.js +0 -15
- package/dist/cjs/generators/PREACT/index.js +0 -15
- package/dist/cjs/generators/RAX/index.js +0 -28
- package/dist/cjs/generators/REACT/index.js +0 -15
- package/dist/cjs/generators/REACT_NATIVE/index.js +0 -55
- package/dist/cjs/generators/REACT_NATIVE/template-csf/storybook/addons.js +0 -7
- package/dist/cjs/generators/REACT_NATIVE/template-csf/storybook/index.js +0 -31
- package/dist/cjs/generators/REACT_NATIVE/template-csf/storybook/rn-addons.js +0 -5
- package/dist/cjs/generators/REACT_NATIVE/template-csf/storybook/stories/Button/Button.stories.js +0 -23
- package/dist/cjs/generators/REACT_NATIVE/template-csf/storybook/stories/Button/index.js +0 -32
- package/dist/cjs/generators/REACT_NATIVE/template-csf/storybook/stories/CenterView/index.js +0 -31
- package/dist/cjs/generators/REACT_NATIVE/template-csf/storybook/stories/CenterView/style.js +0 -15
- package/dist/cjs/generators/REACT_NATIVE/template-csf/storybook/stories/Welcome/Welcome.stories.js +0 -15
- package/dist/cjs/generators/REACT_NATIVE/template-csf/storybook/stories/Welcome/index.js +0 -68
- package/dist/cjs/generators/REACT_NATIVE/template-csf/storybook/stories/index.js +0 -5
- package/dist/cjs/generators/REACT_SCRIPTS/index.js +0 -68
- package/dist/cjs/generators/RIOT/index.js +0 -17
- package/dist/cjs/generators/SERVER/index.js +0 -20
- package/dist/cjs/generators/SERVER/template-csf/.storybook/preview.js +0 -12
- package/dist/cjs/generators/SFC_VUE/index.js +0 -15
- package/dist/cjs/generators/SVELTE/index.js +0 -59
- package/dist/cjs/generators/VUE/index.js +0 -17
- package/dist/cjs/generators/VUE3/index.js +0 -17
- package/dist/cjs/generators/WEB-COMPONENTS/index.js +0 -17
- package/dist/cjs/generators/WEBPACK_REACT/index.js +0 -15
- package/dist/cjs/generators/baseGenerator.js +0 -208
- package/dist/cjs/generators/configure.js +0 -83
- package/dist/cjs/generators/types.js +0 -5
- package/dist/cjs/helpers.js +0 -258
- package/dist/cjs/initiate.js +0 -295
- package/dist/cjs/js-package-manager/JsPackageManager.js +0 -358
- package/dist/cjs/js-package-manager/JsPackageManagerFactory.js +0 -71
- package/dist/cjs/js-package-manager/NPMProxy.js +0 -112
- package/dist/cjs/js-package-manager/PackageJson.js +0 -5
- package/dist/cjs/js-package-manager/Yarn1Proxy.js +0 -72
- package/dist/cjs/js-package-manager/Yarn2Proxy.js +0 -68
- package/dist/cjs/js-package-manager/index.js +0 -44
- package/dist/cjs/link.js +0 -99
- package/dist/cjs/migrate.js +0 -33
- package/dist/cjs/project_types.js +0 -263
- package/dist/cjs/repro-generators/configs.js +0 -201
- package/dist/cjs/repro-generators/scripts.js +0 -338
- package/dist/cjs/repro-next.js +0 -182
- package/dist/cjs/repro-templates.js +0 -103
- package/dist/cjs/repro.js +0 -194
- package/dist/cjs/typings.d.ts +0 -3
- package/dist/cjs/upgrade.js +0 -170
- package/dist/cjs/utils.js +0 -22
- package/dist/cjs/versions.js +0 -89
- package/dist/cjs/warn.js +0 -32
- package/dist/cjs/window.d.js +0 -5
- package/dist/esm/NpmOptions.js +0 -0
- package/dist/esm/add.js +0 -121
- package/dist/esm/automigrate/fixes/angular12.js +0 -58
- package/dist/esm/automigrate/fixes/builder-vite.js +0 -103
- package/dist/esm/automigrate/fixes/cra5.js +0 -66
- package/dist/esm/automigrate/fixes/eslint-plugin.js +0 -111
- package/dist/esm/automigrate/fixes/index.js +0 -12
- package/dist/esm/automigrate/fixes/mainjsFramework.js +0 -76
- package/dist/esm/automigrate/fixes/new-frameworks.js +0 -234
- package/dist/esm/automigrate/fixes/npm7.js +0 -45
- package/dist/esm/automigrate/fixes/sb-scripts.js +0 -119
- package/dist/esm/automigrate/fixes/vue3.js +0 -60
- package/dist/esm/automigrate/fixes/webpack5.js +0 -131
- package/dist/esm/automigrate/helpers/getEslintInfo.js +0 -14
- package/dist/esm/automigrate/index.js +0 -80
- package/dist/esm/automigrate/types.js +0 -1
- package/dist/esm/babel-config.js +0 -42
- package/dist/esm/build.js +0 -22
- package/dist/esm/detect-nextjs.js +0 -24
- package/dist/esm/detect-webpack.js +0 -30
- package/dist/esm/detect.js +0 -152
- package/dist/esm/dev.js +0 -47
- package/dist/esm/dirs.js +0 -4
- package/dist/esm/extract.js +0 -77
- package/dist/esm/generate.js +0 -162
- package/dist/esm/generators/ANGULAR/angular-helpers.js +0 -82
- package/dist/esm/generators/ANGULAR/index.js +0 -76
- package/dist/esm/generators/ANGULAR/template-csf/.storybook/tsconfig.json +0 -10
- package/dist/esm/generators/ANGULAR/template-csf/.storybook/typings.d.ts +0 -4
- package/dist/esm/generators/AURELIA/index.js +0 -32
- package/dist/esm/generators/AURELIA/template-csf/.storybook/tsconfig.json +0 -9
- package/dist/esm/generators/AURELIA/template-csf/.storybook/typings.d.ts +0 -4
- package/dist/esm/generators/EMBER/index.js +0 -12
- package/dist/esm/generators/HTML/index.js +0 -7
- package/dist/esm/generators/MARIONETTE/index.js +0 -7
- package/dist/esm/generators/MARKO/index.js +0 -7
- package/dist/esm/generators/MITHRIL/index.js +0 -7
- package/dist/esm/generators/PREACT/index.js +0 -7
- package/dist/esm/generators/RAX/index.js +0 -20
- package/dist/esm/generators/REACT/index.js +0 -7
- package/dist/esm/generators/REACT_NATIVE/index.js +0 -42
- package/dist/esm/generators/REACT_NATIVE/template-csf/storybook/stories/Button/Button.stories.js +0 -12
- package/dist/esm/generators/REACT_NATIVE/template-csf/storybook/stories/Welcome/index.js +0 -54
- package/dist/esm/generators/REACT_NATIVE/template-csf/storybook/stories/index.js +0 -2
- package/dist/esm/generators/REACT_SCRIPTS/index.js +0 -49
- package/dist/esm/generators/RIOT/index.js +0 -9
- package/dist/esm/generators/SERVER/index.js +0 -11
- package/dist/esm/generators/SERVER/template-csf/.storybook/preview.js +0 -5
- package/dist/esm/generators/SFC_VUE/index.js +0 -7
- package/dist/esm/generators/SVELTE/index.js +0 -44
- package/dist/esm/generators/VUE/index.js +0 -9
- package/dist/esm/generators/VUE3/index.js +0 -9
- package/dist/esm/generators/WEB-COMPONENTS/index.js +0 -9
- package/dist/esm/generators/WEBPACK_REACT/index.js +0 -7
- package/dist/esm/generators/baseGenerator.js +0 -191
- package/dist/esm/generators/configure.js +0 -69
- package/dist/esm/generators/types.js +0 -1
- package/dist/esm/helpers.js +0 -207
- package/dist/esm/initiate.js +0 -254
- package/dist/esm/js-package-manager/JsPackageManager.js +0 -334
- package/dist/esm/js-package-manager/JsPackageManagerFactory.js +0 -57
- package/dist/esm/js-package-manager/NPMProxy.js +0 -99
- package/dist/esm/js-package-manager/PackageJson.js +0 -1
- package/dist/esm/js-package-manager/Yarn1Proxy.js +0 -62
- package/dist/esm/js-package-manager/Yarn2Proxy.js +0 -58
- package/dist/esm/js-package-manager/index.js +0 -3
- package/dist/esm/link.js +0 -69
- package/dist/esm/migrate.js +0 -25
- package/dist/esm/project_types.js +0 -248
- package/dist/esm/repro-generators/configs.js +0 -174
- package/dist/esm/repro-generators/scripts.js +0 -307
- package/dist/esm/repro-next.js +0 -163
- package/dist/esm/repro-templates.js +0 -94
- package/dist/esm/repro.js +0 -170
- package/dist/esm/typings.d.ts +0 -3
- package/dist/esm/upgrade.js +0 -132
- package/dist/esm/utils.js +0 -13
- package/dist/esm/versions.js +0 -82
- package/dist/esm/warn.js +0 -16
- package/dist/esm/window.d.js +0 -1
- package/dist/types/NpmOptions.d.ts +0 -4
- package/dist/types/add.d.ts +0 -10
- package/dist/types/automigrate/fixes/angular12.d.ts +0 -15
- package/dist/types/automigrate/fixes/builder-vite.d.ts +0 -19
- package/dist/types/automigrate/fixes/cra5.d.ts +0 -15
- package/dist/types/automigrate/fixes/eslint-plugin.d.ts +0 -15
- package/dist/types/automigrate/fixes/index.d.ts +0 -3
- package/dist/types/automigrate/fixes/mainjsFramework.d.ts +0 -8
- package/dist/types/automigrate/fixes/new-frameworks.d.ts +0 -31
- package/dist/types/automigrate/fixes/npm7.d.ts +0 -9
- package/dist/types/automigrate/fixes/sb-scripts.d.ts +0 -23
- package/dist/types/automigrate/fixes/vue3.d.ts +0 -15
- package/dist/types/automigrate/fixes/webpack5.d.ts +0 -26
- package/dist/types/automigrate/helpers/getEslintInfo.d.ts +0 -2
- package/dist/types/automigrate/index.d.ts +0 -7
- package/dist/types/automigrate/types.d.ts +0 -15
- package/dist/types/babel-config.d.ts +0 -4
- package/dist/types/build.d.ts +0 -1
- package/dist/types/detect-nextjs.d.ts +0 -2
- package/dist/types/detect-webpack.d.ts +0 -2
- package/dist/types/detect.d.ts +0 -16
- package/dist/types/dev.d.ts +0 -1
- package/dist/types/dirs.d.ts +0 -1
- package/dist/types/extract.d.ts +0 -1
- package/dist/types/generate.d.ts +0 -1
- package/dist/types/generators/ANGULAR/angular-helpers.d.ts +0 -6
- package/dist/types/generators/ANGULAR/index.d.ts +0 -3
- package/dist/types/generators/AURELIA/index.d.ts +0 -3
- package/dist/types/generators/EMBER/index.d.ts +0 -3
- package/dist/types/generators/HTML/index.d.ts +0 -3
- package/dist/types/generators/MARIONETTE/index.d.ts +0 -3
- package/dist/types/generators/MARKO/index.d.ts +0 -3
- package/dist/types/generators/MITHRIL/index.d.ts +0 -3
- package/dist/types/generators/PREACT/index.d.ts +0 -3
- package/dist/types/generators/RAX/index.d.ts +0 -3
- package/dist/types/generators/REACT/index.d.ts +0 -3
- package/dist/types/generators/REACT_NATIVE/index.d.ts +0 -4
- package/dist/types/generators/REACT_SCRIPTS/index.d.ts +0 -3
- package/dist/types/generators/RIOT/index.d.ts +0 -3
- package/dist/types/generators/SERVER/index.d.ts +0 -3
- package/dist/types/generators/SFC_VUE/index.d.ts +0 -3
- package/dist/types/generators/SVELTE/index.d.ts +0 -3
- package/dist/types/generators/VUE/index.d.ts +0 -3
- package/dist/types/generators/VUE3/index.d.ts +0 -3
- package/dist/types/generators/WEB-COMPONENTS/index.d.ts +0 -3
- package/dist/types/generators/WEBPACK_REACT/index.d.ts +0 -3
- package/dist/types/generators/baseGenerator.d.ts +0 -5
- package/dist/types/generators/configure.d.ts +0 -19
- package/dist/types/generators/types.d.ts +0 -38
- package/dist/types/helpers.d.ts +0 -26
- package/dist/types/initiate.d.ts +0 -3
- package/dist/types/js-package-manager/JsPackageManager.d.ts +0 -118
- package/dist/types/js-package-manager/JsPackageManagerFactory.d.ts +0 -4
- package/dist/types/js-package-manager/NPMProxy.d.ts +0 -23
- package/dist/types/js-package-manager/PackageJson.d.ts +0 -4
- package/dist/types/js-package-manager/Yarn1Proxy.d.ts +0 -17
- package/dist/types/js-package-manager/Yarn2Proxy.d.ts +0 -17
- package/dist/types/js-package-manager/index.d.ts +0 -3
- package/dist/types/link.d.ts +0 -7
- package/dist/types/migrate.d.ts +0 -1
- package/dist/types/project_types.d.ts +0 -64
- package/dist/types/repro-generators/configs.d.ts +0 -44
- package/dist/types/repro-generators/scripts.d.ts +0 -44
- package/dist/types/repro-next.d.ts +0 -8
- package/dist/types/repro-templates.d.ts +0 -73
- package/dist/types/repro.d.ts +0 -14
- package/dist/types/upgrade.d.ts +0 -19
- package/dist/types/utils.d.ts +0 -2
- package/dist/types/versions.d.ts +0 -82
- package/dist/types/warn.d.ts +0 -5
package/dist/esm/repro.js
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import prompts from 'prompts';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import chalk from 'chalk';
|
|
5
|
-
import boxen from 'boxen';
|
|
6
|
-
import { dedent } from 'ts-dedent';
|
|
7
|
-
import { createAndInit, exec } from './repro-generators/scripts';
|
|
8
|
-
import * as configs from './repro-generators/configs';
|
|
9
|
-
const logger = console;
|
|
10
|
-
const TEMPLATES = configs; // Create a curate list of template because some of them only make sense in E2E
|
|
11
|
-
// context, fon instance react_in_yarn_workspace
|
|
12
|
-
|
|
13
|
-
const CURATED_TEMPLATES = Object.fromEntries(Object.entries(configs).filter(entry => entry[0] !== 'react_in_yarn_workspace'));
|
|
14
|
-
const RENDERERS = Object.values(CURATED_TEMPLATES).reduce((acc, cur) => {
|
|
15
|
-
acc[cur.renderer] = [...(acc[cur.renderer] || []), cur];
|
|
16
|
-
return acc;
|
|
17
|
-
}, {});
|
|
18
|
-
export const repro = async ({
|
|
19
|
-
outputDirectory,
|
|
20
|
-
list,
|
|
21
|
-
template,
|
|
22
|
-
renderer,
|
|
23
|
-
generator,
|
|
24
|
-
e2e,
|
|
25
|
-
local,
|
|
26
|
-
registry,
|
|
27
|
-
pnp
|
|
28
|
-
}) => {
|
|
29
|
-
logger.info(boxen(dedent`
|
|
30
|
-
🤗 Welcome to ${chalk.yellow('sb repro')}! 🤗
|
|
31
|
-
|
|
32
|
-
Create a ${chalk.green('new project')} to minimally reproduce Storybook issues.
|
|
33
|
-
|
|
34
|
-
1. select an environment that most closely matches your project setup.
|
|
35
|
-
2. select a location for the reproduction, outside of your project.
|
|
36
|
-
|
|
37
|
-
After the reproduction is ready, we'll guide you through the next steps.
|
|
38
|
-
`.trim(), {
|
|
39
|
-
borderStyle: 'round',
|
|
40
|
-
padding: 1,
|
|
41
|
-
borderColor: '#F1618C'
|
|
42
|
-
}));
|
|
43
|
-
|
|
44
|
-
if (list) {
|
|
45
|
-
logger.info('🌈 Available templates');
|
|
46
|
-
Object.entries(RENDERERS).forEach(([r, templates]) => {
|
|
47
|
-
logger.info(r);
|
|
48
|
-
templates.forEach(t => logger.info(`- ${t.name}`));
|
|
49
|
-
|
|
50
|
-
if (r === 'other') {
|
|
51
|
-
logger.info('- blank');
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
let selectedTemplate = template;
|
|
58
|
-
let selectedRenderer = renderer;
|
|
59
|
-
|
|
60
|
-
if (!selectedTemplate && !generator) {
|
|
61
|
-
if (!selectedRenderer) {
|
|
62
|
-
const {
|
|
63
|
-
renderer: rendererOpt
|
|
64
|
-
} = await prompts({
|
|
65
|
-
type: 'select',
|
|
66
|
-
message: '🌈 Select the repro renderer',
|
|
67
|
-
name: 'renderer',
|
|
68
|
-
choices: Object.keys(RENDERERS).map(f => ({
|
|
69
|
-
title: f,
|
|
70
|
-
value: f
|
|
71
|
-
}))
|
|
72
|
-
});
|
|
73
|
-
selectedRenderer = rendererOpt;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (!selectedRenderer) {
|
|
77
|
-
throw new Error('🚨 Repro: please select a renderer!');
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
selectedTemplate = (await prompts({
|
|
81
|
-
type: 'select',
|
|
82
|
-
message: '📝 Select the repro base template',
|
|
83
|
-
name: 'template',
|
|
84
|
-
choices: RENDERERS[selectedRenderer].map(f => ({
|
|
85
|
-
title: f.name,
|
|
86
|
-
value: f.name
|
|
87
|
-
}))
|
|
88
|
-
})).template;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const selectedConfig = !generator ? TEMPLATES[selectedTemplate] : {
|
|
92
|
-
name: 'custom',
|
|
93
|
-
version: 'custom',
|
|
94
|
-
generator
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
if (!selectedConfig) {
|
|
98
|
-
throw new Error('🚨 Repro: please specify a valid template type');
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
let selectedDirectory = outputDirectory;
|
|
102
|
-
|
|
103
|
-
if (!selectedDirectory) {
|
|
104
|
-
const {
|
|
105
|
-
directory
|
|
106
|
-
} = await prompts({
|
|
107
|
-
type: 'text',
|
|
108
|
-
message: 'Enter the output directory',
|
|
109
|
-
name: 'directory',
|
|
110
|
-
initial: selectedConfig.name,
|
|
111
|
-
validate: directoryName => fs.existsSync(directoryName) ? `${directoryName} already exists. Please choose another name.` : true
|
|
112
|
-
});
|
|
113
|
-
selectedDirectory = directory;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
try {
|
|
117
|
-
const cwd = path.isAbsolute(selectedDirectory) ? selectedDirectory : path.join(process.cwd(), selectedDirectory);
|
|
118
|
-
logger.info(`🏃 Running ${selectedTemplate} into ${cwd}`);
|
|
119
|
-
await createAndInit(cwd, selectedConfig, {
|
|
120
|
-
registry,
|
|
121
|
-
e2e: !!e2e,
|
|
122
|
-
pnp: !!pnp,
|
|
123
|
-
local: !!local
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
if (!e2e) {
|
|
127
|
-
await initGitRepo(cwd);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
logger.info(boxen(dedent`
|
|
131
|
-
🎉 Your Storybook reproduction project is ready to use! 🎉
|
|
132
|
-
|
|
133
|
-
${chalk.yellow(`cd ${selectedDirectory}`)}
|
|
134
|
-
${chalk.yellow(`yarn storybook`)}
|
|
135
|
-
|
|
136
|
-
Once you've recreated the problem you're experiencing, please:
|
|
137
|
-
|
|
138
|
-
1. Document any additional steps in ${chalk.cyan('README.md')}
|
|
139
|
-
2. Publish the repository to github
|
|
140
|
-
3. Link to the repro repository in your issue
|
|
141
|
-
|
|
142
|
-
Having a clean repro helps us solve your issue faster! 🙏
|
|
143
|
-
`.trim(), {
|
|
144
|
-
borderStyle: 'round',
|
|
145
|
-
padding: 1,
|
|
146
|
-
borderColor: '#F1618C'
|
|
147
|
-
}));
|
|
148
|
-
} catch (error) {
|
|
149
|
-
logger.error('🚨 Failed to create repro');
|
|
150
|
-
throw error;
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
const initGitRepo = async cwd => {
|
|
155
|
-
await exec('git init', {
|
|
156
|
-
cwd
|
|
157
|
-
});
|
|
158
|
-
await exec('echo "node_modules" >> .gitignore', {
|
|
159
|
-
cwd
|
|
160
|
-
});
|
|
161
|
-
await exec('git add --all', {
|
|
162
|
-
cwd
|
|
163
|
-
});
|
|
164
|
-
await exec('git commit -am "added storybook"', {
|
|
165
|
-
cwd
|
|
166
|
-
});
|
|
167
|
-
await exec('git tag repro-base', {
|
|
168
|
-
cwd
|
|
169
|
-
});
|
|
170
|
-
};
|
package/dist/esm/typings.d.ts
DELETED
package/dist/esm/upgrade.js
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
const _excluded = ["prerelease", "skipCheck", "useNpm", "dryRun", "yes"];
|
|
2
|
-
|
|
3
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
|
-
|
|
5
|
-
import { sync as spawnSync } from 'cross-spawn';
|
|
6
|
-
import { telemetry } from '@storybook/telemetry';
|
|
7
|
-
import semver from '@storybook/semver';
|
|
8
|
-
import { logger } from '@storybook/node-logger';
|
|
9
|
-
import { getPackageDetails, JsPackageManagerFactory } from './js-package-manager';
|
|
10
|
-
import { commandLog } from './helpers';
|
|
11
|
-
import { automigrate } from './automigrate';
|
|
12
|
-
const versionRegex = /(@storybook\/[^@]+)@(\S+)/;
|
|
13
|
-
export const getStorybookVersion = line => {
|
|
14
|
-
if (line.startsWith('npm ')) return null;
|
|
15
|
-
const match = versionRegex.exec(line);
|
|
16
|
-
if (!match || !semver.clean(match[2])) return null;
|
|
17
|
-
return {
|
|
18
|
-
package: match[1],
|
|
19
|
-
version: match[2]
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
const excludeList = ['@storybook/linter-config', '@storybook/design-system', '@storybook/ember-cli-storybook', '@storybook/semver', '@storybook/eslint-config-storybook', '@storybook/bench', '@storybook/addon-bench', '@storybook/addon-console', '@storybook/csf', '@storybook/storybook-deployer', '@storybook/addon-postcss', '@storybook/react-docgen-typescript-plugin', '@storybook/babel-plugin-require-context-hook', '@storybook/builder-vite', '@storybook/mdx1-csf', '@storybook/mdx2-csf', '@storybook/expect', '@storybook/jest', '@storybook/test-runner', '@storybook/testing-library'];
|
|
23
|
-
export const isCorePackage = pkg => pkg.startsWith('@storybook/') && !pkg.startsWith('@storybook/preset-') && !excludeList.includes(pkg);
|
|
24
|
-
const deprecatedPackages = [{
|
|
25
|
-
minVersion: '6.0.0-alpha.0',
|
|
26
|
-
url: 'https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#60-deprecations',
|
|
27
|
-
deprecations: ['@storybook/addon-notes', '@storybook/addon-info', '@storybook/addon-contexts', '@storybook/addon-options', '@storybook/addon-centered']
|
|
28
|
-
}];
|
|
29
|
-
|
|
30
|
-
const formatPackage = pkg => `${pkg.package}@${pkg.version}`;
|
|
31
|
-
|
|
32
|
-
const warnPackages = pkgs => pkgs.forEach(pkg => logger.warn(`- ${formatPackage(pkg)}`));
|
|
33
|
-
|
|
34
|
-
export const checkVersionConsistency = () => {
|
|
35
|
-
const lines = spawnSync('npm', ['ls'], {
|
|
36
|
-
stdio: 'pipe'
|
|
37
|
-
}).output.toString().split('\n');
|
|
38
|
-
const storybookPackages = lines.map(getStorybookVersion).filter(Boolean).filter(pkg => isCorePackage(pkg.package));
|
|
39
|
-
|
|
40
|
-
if (!storybookPackages.length) {
|
|
41
|
-
logger.warn('No storybook core packages found.');
|
|
42
|
-
logger.warn(`'npm ls | grep storybook' can show if multiple versions are installed.`);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
storybookPackages.sort((a, b) => semver.rcompare(a.version, b.version));
|
|
47
|
-
const latestVersion = storybookPackages[0].version;
|
|
48
|
-
const outdated = storybookPackages.filter(pkg => pkg.version !== latestVersion);
|
|
49
|
-
|
|
50
|
-
if (outdated.length > 0) {
|
|
51
|
-
logger.warn(`Found ${outdated.length} outdated packages (relative to '${formatPackage(storybookPackages[0])}')`);
|
|
52
|
-
logger.warn('Please make sure your packages are updated to ensure a consistent experience.');
|
|
53
|
-
warnPackages(outdated);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
deprecatedPackages.forEach(({
|
|
57
|
-
minVersion,
|
|
58
|
-
url,
|
|
59
|
-
deprecations
|
|
60
|
-
}) => {
|
|
61
|
-
if (semver.gte(latestVersion, minVersion)) {
|
|
62
|
-
const deprecated = storybookPackages.filter(pkg => deprecations.includes(pkg.package));
|
|
63
|
-
|
|
64
|
-
if (deprecated.length > 0) {
|
|
65
|
-
logger.warn(`Found ${deprecated.length} deprecated packages since ${minVersion}`);
|
|
66
|
-
logger.warn(`See ${url}`);
|
|
67
|
-
warnPackages(deprecated);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
const EXTRA_FLAGS = {
|
|
73
|
-
'react-scripts@<5': ['--reject', '/preset-create-react-app/']
|
|
74
|
-
};
|
|
75
|
-
export const addExtraFlags = (extraFlags, flags, {
|
|
76
|
-
dependencies,
|
|
77
|
-
devDependencies
|
|
78
|
-
}) => {
|
|
79
|
-
return Object.entries(extraFlags).reduce((acc, entry) => {
|
|
80
|
-
const [pattern, extra] = entry;
|
|
81
|
-
const [pkg, specifier] = getPackageDetails(pattern);
|
|
82
|
-
const pkgVersion = dependencies[pkg] || devDependencies[pkg];
|
|
83
|
-
|
|
84
|
-
if (pkgVersion && semver.satisfies(semver.coerce(pkgVersion), specifier)) {
|
|
85
|
-
return [...acc, ...extra];
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return acc;
|
|
89
|
-
}, [...flags]);
|
|
90
|
-
};
|
|
91
|
-
export const upgrade = async _ref => {
|
|
92
|
-
let {
|
|
93
|
-
prerelease,
|
|
94
|
-
skipCheck,
|
|
95
|
-
useNpm,
|
|
96
|
-
dryRun,
|
|
97
|
-
yes
|
|
98
|
-
} = _ref,
|
|
99
|
-
options = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
100
|
-
|
|
101
|
-
const packageManager = JsPackageManagerFactory.getPackageManager(useNpm);
|
|
102
|
-
commandLog(`Checking for latest versions of '@storybook/*' packages`);
|
|
103
|
-
|
|
104
|
-
if (!options.disableTelemetry) {
|
|
105
|
-
telemetry('upgrade', {
|
|
106
|
-
prerelease
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
let flags = [];
|
|
111
|
-
if (!dryRun) flags.push('--upgrade');
|
|
112
|
-
flags.push('--target');
|
|
113
|
-
flags.push(prerelease ? 'greatest' : 'latest');
|
|
114
|
-
flags = addExtraFlags(EXTRA_FLAGS, flags, packageManager.retrievePackageJson());
|
|
115
|
-
const check = spawnSync('npx', ['npm-check-updates@latest', '/storybook/', ...flags], {
|
|
116
|
-
stdio: 'pipe'
|
|
117
|
-
}).output.toString();
|
|
118
|
-
logger.info(check);
|
|
119
|
-
|
|
120
|
-
if (!dryRun) {
|
|
121
|
-
commandLog(`Installing upgrades`);
|
|
122
|
-
packageManager.installDependencies();
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (!skipCheck) {
|
|
126
|
-
checkVersionConsistency();
|
|
127
|
-
await automigrate({
|
|
128
|
-
dryRun,
|
|
129
|
-
yes
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
};
|
package/dist/esm/utils.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export function parseList(str) {
|
|
2
|
-
return str.split(',').map(item => item.trim()).filter(item => item.length > 0);
|
|
3
|
-
}
|
|
4
|
-
export function getEnvConfig(program, configEnv) {
|
|
5
|
-
Object.keys(configEnv).forEach(fieldName => {
|
|
6
|
-
const envVarName = configEnv[fieldName];
|
|
7
|
-
const envVarValue = process.env[envVarName];
|
|
8
|
-
|
|
9
|
-
if (envVarValue) {
|
|
10
|
-
program[fieldName] = envVarValue; // eslint-disable-line
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
}
|
package/dist/esm/versions.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
// auto generated file, do not edit
|
|
2
|
-
export default {
|
|
3
|
-
'@storybook/addon-a11y': '7.0.0-alpha.31',
|
|
4
|
-
'@storybook/addon-actions': '7.0.0-alpha.31',
|
|
5
|
-
'@storybook/addon-backgrounds': '7.0.0-alpha.31',
|
|
6
|
-
'@storybook/addon-controls': '7.0.0-alpha.31',
|
|
7
|
-
'@storybook/addon-docs': '7.0.0-alpha.31',
|
|
8
|
-
'@storybook/addon-essentials': '7.0.0-alpha.31',
|
|
9
|
-
'@storybook/addon-highlight': '7.0.0-alpha.31',
|
|
10
|
-
'@storybook/addon-interactions': '7.0.0-alpha.31',
|
|
11
|
-
'@storybook/addon-jest': '7.0.0-alpha.31',
|
|
12
|
-
'@storybook/addon-links': '7.0.0-alpha.31',
|
|
13
|
-
'@storybook/addon-measure': '7.0.0-alpha.31',
|
|
14
|
-
'@storybook/addon-outline': '7.0.0-alpha.31',
|
|
15
|
-
'@storybook/addon-storyshots': '7.0.0-alpha.31',
|
|
16
|
-
'@storybook/addon-storyshots-puppeteer': '7.0.0-alpha.31',
|
|
17
|
-
'@storybook/addon-storysource': '7.0.0-alpha.31',
|
|
18
|
-
'@storybook/addon-toolbars': '7.0.0-alpha.31',
|
|
19
|
-
'@storybook/addon-viewport': '7.0.0-alpha.31',
|
|
20
|
-
'@storybook/addons': '7.0.0-alpha.31',
|
|
21
|
-
'@storybook/angular': '7.0.0-alpha.31',
|
|
22
|
-
'@storybook/api': '7.0.0-alpha.31',
|
|
23
|
-
'@storybook/blocks': '7.0.0-alpha.31',
|
|
24
|
-
'@storybook/builder-manager': '7.0.0-alpha.31',
|
|
25
|
-
'@storybook/builder-vite': '7.0.0-alpha.31',
|
|
26
|
-
'@storybook/builder-webpack5': '7.0.0-alpha.31',
|
|
27
|
-
'@storybook/channel-postmessage': '7.0.0-alpha.31',
|
|
28
|
-
'@storybook/channel-websocket': '7.0.0-alpha.31',
|
|
29
|
-
'@storybook/channels': '7.0.0-alpha.31',
|
|
30
|
-
'@storybook/cli': '7.0.0-alpha.31',
|
|
31
|
-
'@storybook/client-api': '7.0.0-alpha.31',
|
|
32
|
-
'@storybook/client-logger': '7.0.0-alpha.31',
|
|
33
|
-
'@storybook/codemod': '7.0.0-alpha.31',
|
|
34
|
-
'@storybook/components': '7.0.0-alpha.31',
|
|
35
|
-
'@storybook/core-client': '7.0.0-alpha.31',
|
|
36
|
-
'@storybook/core-common': '7.0.0-alpha.31',
|
|
37
|
-
'@storybook/core-events': '7.0.0-alpha.31',
|
|
38
|
-
'@storybook/core-server': '7.0.0-alpha.31',
|
|
39
|
-
'@storybook/core-webpack': '7.0.0-alpha.31',
|
|
40
|
-
'@storybook/csf-tools': '7.0.0-alpha.31',
|
|
41
|
-
'@storybook/docs-tools': '7.0.0-alpha.31',
|
|
42
|
-
'@storybook/ember': '7.0.0-alpha.31',
|
|
43
|
-
'@storybook/html': '7.0.0-alpha.31',
|
|
44
|
-
'@storybook/html-webpack5': '7.0.0-alpha.31',
|
|
45
|
-
'@storybook/instrumenter': '7.0.0-alpha.31',
|
|
46
|
-
'@storybook/node-logger': '7.0.0-alpha.31',
|
|
47
|
-
'@storybook/postinstall': '7.0.0-alpha.31',
|
|
48
|
-
'@storybook/preact': '7.0.0-alpha.31',
|
|
49
|
-
'@storybook/preact-webpack5': '7.0.0-alpha.31',
|
|
50
|
-
'@storybook/preset-html-webpack': '7.0.0-alpha.31',
|
|
51
|
-
'@storybook/preset-preact-webpack': '7.0.0-alpha.31',
|
|
52
|
-
'@storybook/preset-react-webpack': '7.0.0-alpha.31',
|
|
53
|
-
'@storybook/preset-server-webpack': '7.0.0-alpha.31',
|
|
54
|
-
'@storybook/preset-svelte-webpack': '7.0.0-alpha.31',
|
|
55
|
-
'@storybook/preset-vue-webpack': '7.0.0-alpha.31',
|
|
56
|
-
'@storybook/preset-vue3-webpack': '7.0.0-alpha.31',
|
|
57
|
-
'@storybook/preset-web-components-webpack': '7.0.0-alpha.31',
|
|
58
|
-
'@storybook/preview-web': '7.0.0-alpha.31',
|
|
59
|
-
'@storybook/react': '7.0.0-alpha.31',
|
|
60
|
-
'@storybook/react-vite': '7.0.0-alpha.31',
|
|
61
|
-
'@storybook/react-webpack5': '7.0.0-alpha.31',
|
|
62
|
-
'@storybook/router': '7.0.0-alpha.31',
|
|
63
|
-
'@storybook/server': '7.0.0-alpha.31',
|
|
64
|
-
'@storybook/server-webpack5': '7.0.0-alpha.31',
|
|
65
|
-
'@storybook/source-loader': '7.0.0-alpha.31',
|
|
66
|
-
'@storybook/store': '7.0.0-alpha.31',
|
|
67
|
-
'@storybook/svelte': '7.0.0-alpha.31',
|
|
68
|
-
'@storybook/svelte-vite': '7.0.0-alpha.31',
|
|
69
|
-
'@storybook/svelte-webpack5': '7.0.0-alpha.31',
|
|
70
|
-
'@storybook/telemetry': '7.0.0-alpha.31',
|
|
71
|
-
'@storybook/theming': '7.0.0-alpha.31',
|
|
72
|
-
'@storybook/ui': '7.0.0-alpha.31',
|
|
73
|
-
'@storybook/vue': '7.0.0-alpha.31',
|
|
74
|
-
'@storybook/vue-webpack5': '7.0.0-alpha.31',
|
|
75
|
-
'@storybook/vue3': '7.0.0-alpha.31',
|
|
76
|
-
'@storybook/vue3-vite': '7.0.0-alpha.31',
|
|
77
|
-
'@storybook/vue3-webpack5': '7.0.0-alpha.31',
|
|
78
|
-
'@storybook/web-components': '7.0.0-alpha.31',
|
|
79
|
-
'@storybook/web-components-webpack5': '7.0.0-alpha.31',
|
|
80
|
-
sb: '7.0.0-alpha.31',
|
|
81
|
-
storybook: '7.0.0-alpha.31'
|
|
82
|
-
};
|
package/dist/esm/warn.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import globby from 'globby';
|
|
2
|
-
import { logger } from '@storybook/node-logger';
|
|
3
|
-
export const warn = ({
|
|
4
|
-
hasTSDependency
|
|
5
|
-
}) => {
|
|
6
|
-
if (!hasTSDependency) {
|
|
7
|
-
const hasTSFiles = !!globby.sync(['**/*.@(ts|tsx)', '!**/node_modules', '!**/*.d.ts']).length;
|
|
8
|
-
|
|
9
|
-
if (hasTSFiles) {
|
|
10
|
-
logger.warn('We have detected TypeScript files in your project directory, however TypeScript is not listed as a project dependency.');
|
|
11
|
-
logger.warn('Storybook will continue as though this is a JavaScript project.');
|
|
12
|
-
logger.line();
|
|
13
|
-
logger.info('For more information, see: https://storybook.js.org/docs/configurations/typescript-config/');
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
};
|
package/dist/esm/window.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/types/add.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PackageJson } from './js-package-manager';
|
|
2
|
-
export declare const storybookAddonScope = "@storybook/addon-";
|
|
3
|
-
export declare const getPackageName: (addonName: string, isOfficialAddon: boolean) => string;
|
|
4
|
-
export declare const getInstalledStorybookVersion: (packageJson: PackageJson) => string | false;
|
|
5
|
-
export declare const getPackageArg: (addonName: string, isOfficialAddon: boolean, packageJson: PackageJson) => string;
|
|
6
|
-
export declare const addStorybookAddonToFile: (addonName: string, addonsFile: string[], isOfficialAddon: boolean) => string[];
|
|
7
|
-
export declare function add(addonName: string, options: {
|
|
8
|
-
useNpm: boolean;
|
|
9
|
-
skipPostinstall: boolean;
|
|
10
|
-
}): Promise<void>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ConfigFile } from '@storybook/csf-tools';
|
|
2
|
-
import { Fix } from '../types';
|
|
3
|
-
interface Angular12RunOptions {
|
|
4
|
-
angularVersion: string;
|
|
5
|
-
storybookVersion: string;
|
|
6
|
-
main: ConfigFile;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Is the user upgrading to Angular12?
|
|
10
|
-
*
|
|
11
|
-
* If so:
|
|
12
|
-
* - Run webpack5 fix
|
|
13
|
-
*/
|
|
14
|
-
export declare const angular12: Fix<Angular12RunOptions>;
|
|
15
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ConfigFile } from '@storybook/csf-tools';
|
|
2
|
-
import { Fix } from '../types';
|
|
3
|
-
import { PackageJson } from '../../js-package-manager';
|
|
4
|
-
interface BuilderViteOptions {
|
|
5
|
-
builder: any;
|
|
6
|
-
main: ConfigFile;
|
|
7
|
-
packageJson: PackageJson;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Is the user using 'storybook-builder-vite' in their project?
|
|
11
|
-
*
|
|
12
|
-
* If so, prompt them to upgrade to '@storybook/builder-vite'.
|
|
13
|
-
*
|
|
14
|
-
* - Add '@storybook/builder-vite' as dev dependency
|
|
15
|
-
* - Remove 'storybook-builder-vite' dependency
|
|
16
|
-
* - Add core.builder = '@storybook/builder-vite' to main.js
|
|
17
|
-
*/
|
|
18
|
-
export declare const builderVite: Fix<BuilderViteOptions>;
|
|
19
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ConfigFile } from '@storybook/csf-tools';
|
|
2
|
-
import { Fix } from '../types';
|
|
3
|
-
interface CRA5RunOptions {
|
|
4
|
-
craVersion: string;
|
|
5
|
-
storybookVersion: string;
|
|
6
|
-
main: ConfigFile;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Is the user upgrading from CRA4 to CRA5?
|
|
10
|
-
*
|
|
11
|
-
* If so:
|
|
12
|
-
* - Run webpack5 fix
|
|
13
|
-
*/
|
|
14
|
-
export declare const cra5: Fix<CRA5RunOptions>;
|
|
15
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ConfigFile } from '@storybook/csf-tools';
|
|
2
|
-
import type { Fix } from '../types';
|
|
3
|
-
interface EslintPluginRunOptions {
|
|
4
|
-
main: ConfigFile;
|
|
5
|
-
eslintFile: string;
|
|
6
|
-
unsupportedExtension?: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Does the user not have eslint-plugin-storybook installed?
|
|
10
|
-
*
|
|
11
|
-
* If so:
|
|
12
|
-
* - Install it, and if possible configure it
|
|
13
|
-
*/
|
|
14
|
-
export declare const eslintPlugin: Fix<EslintPluginRunOptions>;
|
|
15
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Fix } from '../types';
|
|
2
|
-
import { PackageJsonWithDepsAndDevDeps } from '../../js-package-manager';
|
|
3
|
-
interface SbScriptsRunOptions {
|
|
4
|
-
storybookScripts: {
|
|
5
|
-
custom: Record<string, string>;
|
|
6
|
-
official: Record<string, string>;
|
|
7
|
-
};
|
|
8
|
-
storybookVersion: string;
|
|
9
|
-
packageJson: PackageJsonWithDepsAndDevDeps;
|
|
10
|
-
}
|
|
11
|
-
export declare const getStorybookScripts: (scripts: Record<string, string>) => {
|
|
12
|
-
custom: Record<string, string>;
|
|
13
|
-
official: Record<string, string>;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Is the user using start-storybook
|
|
17
|
-
*
|
|
18
|
-
* If so:
|
|
19
|
-
* - Add storybook dependency
|
|
20
|
-
* - Change start-storybook and build-storybook scripts
|
|
21
|
-
*/
|
|
22
|
-
export declare const sbScripts: Fix<SbScriptsRunOptions>;
|
|
23
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ConfigFile } from '@storybook/csf-tools';
|
|
2
|
-
import { Fix } from '../types';
|
|
3
|
-
interface Vue3RunOptions {
|
|
4
|
-
vueVersion: string;
|
|
5
|
-
storybookVersion: string;
|
|
6
|
-
main: ConfigFile;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Is the user upgrading to Vue3?
|
|
10
|
-
*
|
|
11
|
-
* If so:
|
|
12
|
-
* - Run webpack5 fix
|
|
13
|
-
*/
|
|
14
|
-
export declare const vue3: Fix<Vue3RunOptions>;
|
|
15
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ConfigFile } from '@storybook/csf-tools';
|
|
2
|
-
import { Fix } from '../types';
|
|
3
|
-
import { PackageJsonWithDepsAndDevDeps } from '../../js-package-manager';
|
|
4
|
-
interface Webpack5RunOptions {
|
|
5
|
-
webpackVersion: string;
|
|
6
|
-
storybookVersion: string;
|
|
7
|
-
main: ConfigFile;
|
|
8
|
-
}
|
|
9
|
-
interface CheckBuilder {
|
|
10
|
-
checkWebpack5Builder: (packageJson: PackageJsonWithDepsAndDevDeps) => Promise<{
|
|
11
|
-
storybookVersion: string;
|
|
12
|
-
main: ConfigFile;
|
|
13
|
-
}>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Is the user using webpack5 in their project?
|
|
17
|
-
*
|
|
18
|
-
* If the user is using a version of SB >= 6.3,
|
|
19
|
-
* prompt them to upgrade to webpack5.
|
|
20
|
-
*
|
|
21
|
-
* - Add manager-webpack5 builder-webpack5 as dev dependencies
|
|
22
|
-
* - Add core.builder = 'webpack5' to main.js
|
|
23
|
-
* - Add 'webpack5' as a project dependency
|
|
24
|
-
*/
|
|
25
|
-
export declare const webpack5: Fix<Webpack5RunOptions> & CheckBuilder;
|
|
26
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { JsPackageManager } from '../js-package-manager';
|
|
2
|
-
export interface CheckOptions {
|
|
3
|
-
packageManager: JsPackageManager;
|
|
4
|
-
}
|
|
5
|
-
export interface RunOptions<ResultType> {
|
|
6
|
-
packageManager: JsPackageManager;
|
|
7
|
-
result: ResultType;
|
|
8
|
-
dryRun?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface Fix<ResultType = any> {
|
|
11
|
-
id: string;
|
|
12
|
-
check: (options: CheckOptions) => Promise<ResultType | void>;
|
|
13
|
-
prompt: (result: ResultType) => string;
|
|
14
|
-
run: (options: RunOptions<ResultType>) => Promise<void>;
|
|
15
|
-
}
|