@storybook/cli 7.0.0-alpha.18 → 7.0.0-alpha.20
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 -1
- package/dist/cjs/automigrate/fixes/index.js +5 -1
- package/dist/cjs/automigrate/fixes/new-frameworks.js +249 -0
- package/dist/cjs/automigrate/fixes/sb-scripts.js +140 -0
- package/dist/cjs/automigrate/index.js +1 -1
- package/dist/cjs/generate.js +1 -1
- package/dist/cjs/helpers.js +18 -0
- package/dist/cjs/js-package-manager/JsPackageManager.js +42 -0
- package/dist/cjs/js-package-manager/NPMProxy.js +14 -0
- package/dist/cjs/js-package-manager/Yarn1Proxy.js +5 -0
- package/dist/cjs/js-package-manager/Yarn2Proxy.js +5 -0
- package/dist/cjs/repro-next.js +23 -14
- package/dist/cjs/repro-templates.js +15 -2
- package/dist/cjs/versions.js +75 -75
- package/dist/esm/automigrate/fixes/index.js +3 -1
- package/dist/esm/automigrate/fixes/new-frameworks.js +225 -0
- package/dist/esm/automigrate/fixes/sb-scripts.js +119 -0
- package/dist/esm/automigrate/index.js +1 -1
- package/dist/esm/generate.js +1 -1
- package/dist/esm/helpers.js +15 -0
- package/dist/esm/js-package-manager/JsPackageManager.js +42 -0
- package/dist/esm/js-package-manager/NPMProxy.js +14 -0
- package/dist/esm/js-package-manager/Yarn1Proxy.js +5 -0
- package/dist/esm/js-package-manager/Yarn2Proxy.js +5 -0
- package/dist/esm/repro-next.js +22 -13
- package/dist/esm/repro-templates.js +15 -2
- package/dist/esm/versions.js +75 -75
- package/dist/types/automigrate/fixes/new-frameworks.d.ts +31 -0
- package/dist/types/automigrate/fixes/sb-scripts.d.ts +23 -0
- package/dist/types/helpers.d.ts +1 -0
- package/dist/types/js-package-manager/JsPackageManager.d.ts +16 -0
- package/dist/types/js-package-manager/NPMProxy.d.ts +3 -0
- package/dist/types/js-package-manager/Yarn1Proxy.d.ts +1 -0
- package/dist/types/js-package-manager/Yarn2Proxy.d.ts +1 -0
- package/dist/types/repro-next.d.ts +2 -1
- package/dist/types/repro-templates.d.ts +2 -0
- package/package.json +9 -10
|
@@ -5,6 +5,7 @@ export class NPMProxy extends JsPackageManager {
|
|
|
5
5
|
super(...args);
|
|
6
6
|
this.type = 'npm';
|
|
7
7
|
this.installArgs = void 0;
|
|
8
|
+
this.uninstallArgs = void 0;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
initPackageJson() {
|
|
@@ -44,6 +45,14 @@ export class NPMProxy extends JsPackageManager {
|
|
|
44
45
|
return this.installArgs;
|
|
45
46
|
}
|
|
46
47
|
|
|
48
|
+
getUninstallArgs() {
|
|
49
|
+
if (!this.uninstallArgs) {
|
|
50
|
+
this.uninstallArgs = this.needsLegacyPeerDeps(this.getNpmVersion()) ? ['uninstall', '--legacy-peer-deps'] : ['uninstall'];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return this.uninstallArgs;
|
|
54
|
+
}
|
|
55
|
+
|
|
47
56
|
runInstall() {
|
|
48
57
|
this.executeCommand('npm', this.getInstallArgs(), 'inherit');
|
|
49
58
|
}
|
|
@@ -58,6 +67,11 @@ export class NPMProxy extends JsPackageManager {
|
|
|
58
67
|
this.executeCommand('npm', [...this.getInstallArgs(), ...args], 'inherit');
|
|
59
68
|
}
|
|
60
69
|
|
|
70
|
+
runRemoveDeps(dependencies) {
|
|
71
|
+
const args = [...dependencies];
|
|
72
|
+
this.executeCommand('npm', [...this.getUninstallArgs(), ...args], 'inherit');
|
|
73
|
+
}
|
|
74
|
+
|
|
61
75
|
runGetVersions(packageName, fetchAllVersions) {
|
|
62
76
|
const args = [fetchAllVersions ? 'versions' : 'version', '--json'];
|
|
63
77
|
const commandResult = this.executeCommand('npm', ['info', packageName, ...args]);
|
|
@@ -31,6 +31,11 @@ export class Yarn1Proxy extends JsPackageManager {
|
|
|
31
31
|
this.executeCommand('yarn', ['add', ...args], 'inherit');
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
runRemoveDeps(dependencies) {
|
|
35
|
+
const args = ['--ignore-workspace-root-check', ...dependencies];
|
|
36
|
+
this.executeCommand('yarn', ['remove', ...args], 'inherit');
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
runGetVersions(packageName, fetchAllVersions) {
|
|
35
40
|
const args = [fetchAllVersions ? 'versions' : 'version', '--json'];
|
|
36
41
|
const commandResult = this.executeCommand('yarn', ['info', packageName, ...args]);
|
|
@@ -31,6 +31,11 @@ export class Yarn2Proxy extends JsPackageManager {
|
|
|
31
31
|
this.executeCommand('yarn', ['add', ...args], 'inherit');
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
runRemoveDeps(dependencies) {
|
|
35
|
+
const args = [...dependencies];
|
|
36
|
+
this.executeCommand('yarn', ['remove', ...args], 'inherit');
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
runGetVersions(packageName, fetchAllVersions) {
|
|
35
40
|
const field = fetchAllVersions ? 'versions' : 'version';
|
|
36
41
|
const args = ['--fields', field, '--json'];
|
package/dist/esm/repro-next.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import prompts from 'prompts';
|
|
2
|
-
import fs from 'fs';
|
|
3
2
|
import path from 'path';
|
|
4
3
|
import chalk from 'chalk';
|
|
5
4
|
import boxen from 'boxen';
|
|
6
5
|
import { dedent } from 'ts-dedent';
|
|
7
6
|
import degit from 'degit';
|
|
7
|
+
import { existsSync } from 'fs-extra';
|
|
8
8
|
import TEMPLATES from './repro-templates';
|
|
9
9
|
const logger = console;
|
|
10
10
|
|
|
@@ -16,7 +16,8 @@ const toChoices = c => ({
|
|
|
16
16
|
export const reproNext = async ({
|
|
17
17
|
output: outputDirectory,
|
|
18
18
|
filterValue,
|
|
19
|
-
branch
|
|
19
|
+
branch,
|
|
20
|
+
init
|
|
20
21
|
}) => {
|
|
21
22
|
const keys = Object.keys(TEMPLATES); // get value from template and reduce through TEMPLATES to filter out the correct template
|
|
22
23
|
|
|
@@ -40,7 +41,8 @@ export const reproNext = async ({
|
|
|
40
41
|
if (choices.length === 0) {
|
|
41
42
|
logger.info(boxen(dedent`
|
|
42
43
|
🔎 You filtered out all templates. 🔍
|
|
43
|
-
|
|
44
|
+
|
|
45
|
+
After filtering all the templates with "${chalk.yellow(filterValue)}", we found no results. Please try again with a different filter.
|
|
44
46
|
|
|
45
47
|
Available templates:
|
|
46
48
|
${keys.map(key => chalk.blue`- ${key}`).join('\n')}
|
|
@@ -49,7 +51,7 @@ export const reproNext = async ({
|
|
|
49
51
|
padding: 1,
|
|
50
52
|
borderColor: '#F1618C'
|
|
51
53
|
}));
|
|
52
|
-
|
|
54
|
+
process.exit(1);
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
let selectedTemplate = null;
|
|
@@ -88,6 +90,11 @@ export const reproNext = async ({
|
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
let selectedDirectory = outputDirectory;
|
|
93
|
+
const outputDirectoryName = outputDirectory || selectedTemplate;
|
|
94
|
+
|
|
95
|
+
if (selectedDirectory && existsSync(`${selectedDirectory}`)) {
|
|
96
|
+
logger.info(`⚠️ ${selectedDirectory} already exists! Overwriting...`);
|
|
97
|
+
}
|
|
91
98
|
|
|
92
99
|
if (!selectedDirectory) {
|
|
93
100
|
const {
|
|
@@ -96,32 +103,34 @@ export const reproNext = async ({
|
|
|
96
103
|
type: 'text',
|
|
97
104
|
message: 'Enter the output directory',
|
|
98
105
|
name: 'directory',
|
|
99
|
-
initial:
|
|
100
|
-
validate: directoryName =>
|
|
106
|
+
initial: outputDirectoryName,
|
|
107
|
+
validate: async directoryName => existsSync(directoryName) ? `${directoryName} already exists. Please choose another name.` : true
|
|
101
108
|
});
|
|
102
109
|
selectedDirectory = directory;
|
|
103
110
|
}
|
|
104
111
|
|
|
105
112
|
try {
|
|
106
|
-
const
|
|
107
|
-
logger.info(`🏃 Adding ${selectedConfig.name} into ${
|
|
113
|
+
const templateDestination = path.isAbsolute(selectedDirectory) ? selectedDirectory : path.join(process.cwd(), selectedDirectory);
|
|
114
|
+
logger.info(`🏃 Adding ${selectedConfig.name} into ${templateDestination}`);
|
|
108
115
|
logger.log('📦 Downloading repro template...');
|
|
109
116
|
|
|
110
117
|
try {
|
|
111
|
-
// Download the repro based on subfolder "after-storybook" and selected branch
|
|
112
|
-
|
|
118
|
+
const templateType = init ? 'after-storybook' : 'before-storybook'; // Download the repro based on subfolder "after-storybook" and selected branch
|
|
119
|
+
|
|
120
|
+
await degit(`storybookjs/repro-templates-temp/${selectedTemplate}/${templateType}#${branch}`, {
|
|
113
121
|
force: true
|
|
114
|
-
}).clone(
|
|
122
|
+
}).clone(templateDestination);
|
|
115
123
|
} catch (err) {
|
|
116
124
|
logger.error(`🚨 Failed to download repro template: ${err.message}`);
|
|
117
|
-
|
|
125
|
+
throw err;
|
|
118
126
|
}
|
|
119
127
|
|
|
128
|
+
const initMessage = init ? chalk.yellow(`yarn storybook`) : `Recreate your setup, then ${chalk.yellow(`run npx storybook init`)}`;
|
|
120
129
|
logger.info(boxen(dedent`
|
|
121
130
|
🎉 Your Storybook reproduction project is ready to use! 🎉
|
|
122
131
|
|
|
123
132
|
${chalk.yellow(`cd ${selectedDirectory}`)}
|
|
124
|
-
${
|
|
133
|
+
${initMessage}
|
|
125
134
|
|
|
126
135
|
Once you've recreated the problem you're experiencing, please:
|
|
127
136
|
|
|
@@ -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
|
};
|
package/dist/esm/versions.js
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
// auto generated file, do not edit
|
|
2
2
|
export default {
|
|
3
|
-
'@storybook/addon-a11y': '7.0.0-alpha.
|
|
4
|
-
'@storybook/addon-actions': '7.0.0-alpha.
|
|
5
|
-
'@storybook/addon-backgrounds': '7.0.0-alpha.
|
|
6
|
-
'@storybook/addon-controls': '7.0.0-alpha.
|
|
7
|
-
'@storybook/addon-docs': '7.0.0-alpha.
|
|
8
|
-
'@storybook/addon-essentials': '7.0.0-alpha.
|
|
9
|
-
'@storybook/addon-highlight': '7.0.0-alpha.
|
|
10
|
-
'@storybook/addon-interactions': '7.0.0-alpha.
|
|
11
|
-
'@storybook/addon-jest': '7.0.0-alpha.
|
|
12
|
-
'@storybook/addon-links': '7.0.0-alpha.
|
|
13
|
-
'@storybook/addon-measure': '7.0.0-alpha.
|
|
14
|
-
'@storybook/addon-outline': '7.0.0-alpha.
|
|
15
|
-
'@storybook/addon-storyshots': '7.0.0-alpha.
|
|
16
|
-
'@storybook/addon-storyshots-puppeteer': '7.0.0-alpha.
|
|
17
|
-
'@storybook/addon-storysource': '7.0.0-alpha.
|
|
18
|
-
'@storybook/addon-toolbars': '7.0.0-alpha.
|
|
19
|
-
'@storybook/addon-viewport': '7.0.0-alpha.
|
|
20
|
-
'@storybook/addons': '7.0.0-alpha.
|
|
21
|
-
'@storybook/angular': '7.0.0-alpha.
|
|
22
|
-
'@storybook/api': '7.0.0-alpha.
|
|
23
|
-
'@storybook/blocks': '7.0.0-alpha.
|
|
24
|
-
'@storybook/builder-manager': '7.0.0-alpha.
|
|
25
|
-
'@storybook/builder-webpack5': '7.0.0-alpha.
|
|
26
|
-
'@storybook/channel-postmessage': '7.0.0-alpha.
|
|
27
|
-
'@storybook/channel-websocket': '7.0.0-alpha.
|
|
28
|
-
'@storybook/channels': '7.0.0-alpha.
|
|
29
|
-
'@storybook/cli': '7.0.0-alpha.
|
|
30
|
-
'@storybook/client-api': '7.0.0-alpha.
|
|
31
|
-
'@storybook/client-logger': '7.0.0-alpha.
|
|
32
|
-
'@storybook/codemod': '7.0.0-alpha.
|
|
33
|
-
'@storybook/components': '7.0.0-alpha.
|
|
34
|
-
'@storybook/core-client': '7.0.0-alpha.
|
|
35
|
-
'@storybook/core-common': '7.0.0-alpha.
|
|
36
|
-
'@storybook/core-events': '7.0.0-alpha.
|
|
37
|
-
'@storybook/core-server': '7.0.0-alpha.
|
|
38
|
-
'@storybook/core-webpack': '7.0.0-alpha.
|
|
39
|
-
'@storybook/csf-tools': '7.0.0-alpha.
|
|
40
|
-
'@storybook/docs-tools': '7.0.0-alpha.
|
|
41
|
-
'@storybook/ember': '7.0.0-alpha.
|
|
42
|
-
'@storybook/html': '7.0.0-alpha.
|
|
43
|
-
'@storybook/html-webpack5': '7.0.0-alpha.
|
|
44
|
-
'@storybook/instrumenter': '7.0.0-alpha.
|
|
45
|
-
'@storybook/node-logger': '7.0.0-alpha.
|
|
46
|
-
'@storybook/postinstall': '7.0.0-alpha.
|
|
47
|
-
'@storybook/preact': '7.0.0-alpha.
|
|
48
|
-
'@storybook/preact-webpack5': '7.0.0-alpha.
|
|
49
|
-
'@storybook/preset-html-webpack': '7.0.0-alpha.
|
|
50
|
-
'@storybook/preset-preact-webpack': '7.0.0-alpha.
|
|
51
|
-
'@storybook/preset-react-webpack': '7.0.0-alpha.
|
|
52
|
-
'@storybook/preset-server-webpack': '7.0.0-alpha.
|
|
53
|
-
'@storybook/preset-svelte-webpack': '7.0.0-alpha.
|
|
54
|
-
'@storybook/preset-vue-webpack': '7.0.0-alpha.
|
|
55
|
-
'@storybook/preset-vue3-webpack': '7.0.0-alpha.
|
|
56
|
-
'@storybook/preset-web-components-webpack': '7.0.0-alpha.
|
|
57
|
-
'@storybook/preview-web': '7.0.0-alpha.
|
|
58
|
-
'@storybook/react': '7.0.0-alpha.
|
|
59
|
-
'@storybook/react-webpack5': '7.0.0-alpha.
|
|
60
|
-
'@storybook/router': '7.0.0-alpha.
|
|
61
|
-
'@storybook/server': '7.0.0-alpha.
|
|
62
|
-
'@storybook/server-webpack5': '7.0.0-alpha.
|
|
63
|
-
'@storybook/source-loader': '7.0.0-alpha.
|
|
64
|
-
'@storybook/store': '7.0.0-alpha.
|
|
65
|
-
'@storybook/svelte': '7.0.0-alpha.
|
|
66
|
-
'@storybook/svelte-webpack5': '7.0.0-alpha.
|
|
67
|
-
'@storybook/telemetry': '7.0.0-alpha.
|
|
68
|
-
'@storybook/theming': '7.0.0-alpha.
|
|
69
|
-
'@storybook/ui': '7.0.0-alpha.
|
|
70
|
-
'@storybook/vue': '7.0.0-alpha.
|
|
71
|
-
'@storybook/vue-webpack5': '7.0.0-alpha.
|
|
72
|
-
'@storybook/vue3': '7.0.0-alpha.
|
|
73
|
-
'@storybook/vue3-webpack5': '7.0.0-alpha.
|
|
74
|
-
'@storybook/web-components': '7.0.0-alpha.
|
|
75
|
-
'@storybook/web-components-webpack5': '7.0.0-alpha.
|
|
76
|
-
sb: '7.0.0-alpha.
|
|
77
|
-
storybook: '7.0.0-alpha.
|
|
3
|
+
'@storybook/addon-a11y': '7.0.0-alpha.20',
|
|
4
|
+
'@storybook/addon-actions': '7.0.0-alpha.20',
|
|
5
|
+
'@storybook/addon-backgrounds': '7.0.0-alpha.20',
|
|
6
|
+
'@storybook/addon-controls': '7.0.0-alpha.20',
|
|
7
|
+
'@storybook/addon-docs': '7.0.0-alpha.20',
|
|
8
|
+
'@storybook/addon-essentials': '7.0.0-alpha.20',
|
|
9
|
+
'@storybook/addon-highlight': '7.0.0-alpha.20',
|
|
10
|
+
'@storybook/addon-interactions': '7.0.0-alpha.20',
|
|
11
|
+
'@storybook/addon-jest': '7.0.0-alpha.20',
|
|
12
|
+
'@storybook/addon-links': '7.0.0-alpha.20',
|
|
13
|
+
'@storybook/addon-measure': '7.0.0-alpha.20',
|
|
14
|
+
'@storybook/addon-outline': '7.0.0-alpha.20',
|
|
15
|
+
'@storybook/addon-storyshots': '7.0.0-alpha.20',
|
|
16
|
+
'@storybook/addon-storyshots-puppeteer': '7.0.0-alpha.20',
|
|
17
|
+
'@storybook/addon-storysource': '7.0.0-alpha.20',
|
|
18
|
+
'@storybook/addon-toolbars': '7.0.0-alpha.20',
|
|
19
|
+
'@storybook/addon-viewport': '7.0.0-alpha.20',
|
|
20
|
+
'@storybook/addons': '7.0.0-alpha.20',
|
|
21
|
+
'@storybook/angular': '7.0.0-alpha.20',
|
|
22
|
+
'@storybook/api': '7.0.0-alpha.20',
|
|
23
|
+
'@storybook/blocks': '7.0.0-alpha.20',
|
|
24
|
+
'@storybook/builder-manager': '7.0.0-alpha.20',
|
|
25
|
+
'@storybook/builder-webpack5': '7.0.0-alpha.20',
|
|
26
|
+
'@storybook/channel-postmessage': '7.0.0-alpha.20',
|
|
27
|
+
'@storybook/channel-websocket': '7.0.0-alpha.20',
|
|
28
|
+
'@storybook/channels': '7.0.0-alpha.20',
|
|
29
|
+
'@storybook/cli': '7.0.0-alpha.20',
|
|
30
|
+
'@storybook/client-api': '7.0.0-alpha.20',
|
|
31
|
+
'@storybook/client-logger': '7.0.0-alpha.20',
|
|
32
|
+
'@storybook/codemod': '7.0.0-alpha.20',
|
|
33
|
+
'@storybook/components': '7.0.0-alpha.20',
|
|
34
|
+
'@storybook/core-client': '7.0.0-alpha.20',
|
|
35
|
+
'@storybook/core-common': '7.0.0-alpha.20',
|
|
36
|
+
'@storybook/core-events': '7.0.0-alpha.20',
|
|
37
|
+
'@storybook/core-server': '7.0.0-alpha.20',
|
|
38
|
+
'@storybook/core-webpack': '7.0.0-alpha.20',
|
|
39
|
+
'@storybook/csf-tools': '7.0.0-alpha.20',
|
|
40
|
+
'@storybook/docs-tools': '7.0.0-alpha.20',
|
|
41
|
+
'@storybook/ember': '7.0.0-alpha.20',
|
|
42
|
+
'@storybook/html': '7.0.0-alpha.20',
|
|
43
|
+
'@storybook/html-webpack5': '7.0.0-alpha.20',
|
|
44
|
+
'@storybook/instrumenter': '7.0.0-alpha.20',
|
|
45
|
+
'@storybook/node-logger': '7.0.0-alpha.20',
|
|
46
|
+
'@storybook/postinstall': '7.0.0-alpha.20',
|
|
47
|
+
'@storybook/preact': '7.0.0-alpha.20',
|
|
48
|
+
'@storybook/preact-webpack5': '7.0.0-alpha.20',
|
|
49
|
+
'@storybook/preset-html-webpack': '7.0.0-alpha.20',
|
|
50
|
+
'@storybook/preset-preact-webpack': '7.0.0-alpha.20',
|
|
51
|
+
'@storybook/preset-react-webpack': '7.0.0-alpha.20',
|
|
52
|
+
'@storybook/preset-server-webpack': '7.0.0-alpha.20',
|
|
53
|
+
'@storybook/preset-svelte-webpack': '7.0.0-alpha.20',
|
|
54
|
+
'@storybook/preset-vue-webpack': '7.0.0-alpha.20',
|
|
55
|
+
'@storybook/preset-vue3-webpack': '7.0.0-alpha.20',
|
|
56
|
+
'@storybook/preset-web-components-webpack': '7.0.0-alpha.20',
|
|
57
|
+
'@storybook/preview-web': '7.0.0-alpha.20',
|
|
58
|
+
'@storybook/react': '7.0.0-alpha.20',
|
|
59
|
+
'@storybook/react-webpack5': '7.0.0-alpha.20',
|
|
60
|
+
'@storybook/router': '7.0.0-alpha.20',
|
|
61
|
+
'@storybook/server': '7.0.0-alpha.20',
|
|
62
|
+
'@storybook/server-webpack5': '7.0.0-alpha.20',
|
|
63
|
+
'@storybook/source-loader': '7.0.0-alpha.20',
|
|
64
|
+
'@storybook/store': '7.0.0-alpha.20',
|
|
65
|
+
'@storybook/svelte': '7.0.0-alpha.20',
|
|
66
|
+
'@storybook/svelte-webpack5': '7.0.0-alpha.20',
|
|
67
|
+
'@storybook/telemetry': '7.0.0-alpha.20',
|
|
68
|
+
'@storybook/theming': '7.0.0-alpha.20',
|
|
69
|
+
'@storybook/ui': '7.0.0-alpha.20',
|
|
70
|
+
'@storybook/vue': '7.0.0-alpha.20',
|
|
71
|
+
'@storybook/vue-webpack5': '7.0.0-alpha.20',
|
|
72
|
+
'@storybook/vue3': '7.0.0-alpha.20',
|
|
73
|
+
'@storybook/vue3-webpack5': '7.0.0-alpha.20',
|
|
74
|
+
'@storybook/web-components': '7.0.0-alpha.20',
|
|
75
|
+
'@storybook/web-components-webpack5': '7.0.0-alpha.20',
|
|
76
|
+
sb: '7.0.0-alpha.20',
|
|
77
|
+
storybook: '7.0.0-alpha.20'
|
|
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 {};
|
|
@@ -0,0 +1,23 @@
|
|
|
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 {};
|
package/dist/types/helpers.d.ts
CHANGED
|
@@ -23,3 +23,4 @@ export declare function getBabelDependencies(packageManager: JsPackageManager, p
|
|
|
23
23
|
export declare function addToDevDependenciesIfNotPresent(packageJson: PackageJson, name: string, packageVersion: string): void;
|
|
24
24
|
export declare function copyTemplate(templateRoot: string): void;
|
|
25
25
|
export declare function copyComponents(framework: SupportedRenderers, language: SupportedLanguage): Promise<void>;
|
|
26
|
+
export declare function getStorybookVersionSpecifier(packageJson: PackageJsonWithDepsAndDevDeps): string;
|
|
@@ -38,6 +38,21 @@ export declare abstract class JsPackageManager {
|
|
|
38
38
|
installAsDevDependencies?: boolean;
|
|
39
39
|
packageJson?: PackageJson;
|
|
40
40
|
}, dependencies: string[]): void;
|
|
41
|
+
/**
|
|
42
|
+
* Remove dependencies from a project using `yarn remove` or `npm uninstall`.
|
|
43
|
+
*
|
|
44
|
+
* @param {Object} options contains `skipInstall`, `packageJson` and `installAsDevDependencies` which we use to determine how we install packages.
|
|
45
|
+
* @param {Array} dependencies contains a list of packages to remove.
|
|
46
|
+
* @example
|
|
47
|
+
* removeDependencies(options, [
|
|
48
|
+
* `@storybook/react`,
|
|
49
|
+
* `@storybook/addon-actions`,
|
|
50
|
+
* ]);
|
|
51
|
+
*/
|
|
52
|
+
removeDependencies(options: {
|
|
53
|
+
skipInstall?: boolean;
|
|
54
|
+
packageJson?: PackageJson;
|
|
55
|
+
}, dependencies: string[]): void;
|
|
41
56
|
/**
|
|
42
57
|
* Return an array of strings matching following format: `<package_name>@<package_latest_version>`
|
|
43
58
|
*
|
|
@@ -78,6 +93,7 @@ export declare abstract class JsPackageManager {
|
|
|
78
93
|
addScripts(scripts: Record<string, string>): void;
|
|
79
94
|
protected abstract runInstall(): void;
|
|
80
95
|
protected abstract runAddDeps(dependencies: string[], installAsDevDependencies: boolean): void;
|
|
96
|
+
protected abstract runRemoveDeps(dependencies: string[]): void;
|
|
81
97
|
/**
|
|
82
98
|
* Get the latest or all versions of the input package available on npmjs.com
|
|
83
99
|
*
|
|
@@ -2,6 +2,7 @@ import { JsPackageManager } from './JsPackageManager';
|
|
|
2
2
|
export declare class NPMProxy extends JsPackageManager {
|
|
3
3
|
readonly type = "npm";
|
|
4
4
|
installArgs: string[] | undefined;
|
|
5
|
+
uninstallArgs: string[] | undefined;
|
|
5
6
|
initPackageJson(): string;
|
|
6
7
|
getRunStorybookCommand(): string;
|
|
7
8
|
getRunCommand(command: string): string;
|
|
@@ -10,7 +11,9 @@ export declare class NPMProxy extends JsPackageManager {
|
|
|
10
11
|
setLegacyPeerDeps(): void;
|
|
11
12
|
needsLegacyPeerDeps(version: string): boolean;
|
|
12
13
|
getInstallArgs(): string[];
|
|
14
|
+
getUninstallArgs(): string[];
|
|
13
15
|
protected runInstall(): void;
|
|
14
16
|
protected runAddDeps(dependencies: string[], installAsDevDependencies: boolean): void;
|
|
17
|
+
protected runRemoveDeps(dependencies: string[]): void;
|
|
15
18
|
protected runGetVersions<T extends boolean>(packageName: string, fetchAllVersions: T): Promise<T extends true ? string[] : string>;
|
|
16
19
|
}
|
|
@@ -6,5 +6,6 @@ export declare class Yarn1Proxy extends JsPackageManager {
|
|
|
6
6
|
getRunCommand(command: string): string;
|
|
7
7
|
protected runInstall(): void;
|
|
8
8
|
protected runAddDeps(dependencies: string[], installAsDevDependencies: boolean): void;
|
|
9
|
+
protected runRemoveDeps(dependencies: string[]): void;
|
|
9
10
|
protected runGetVersions<T extends boolean>(packageName: string, fetchAllVersions: T): Promise<T extends true ? string[] : string>;
|
|
10
11
|
}
|
|
@@ -6,5 +6,6 @@ export declare class Yarn2Proxy extends JsPackageManager {
|
|
|
6
6
|
getRunCommand(command: string): string;
|
|
7
7
|
protected runInstall(): void;
|
|
8
8
|
protected runAddDeps(dependencies: string[], installAsDevDependencies: boolean): void;
|
|
9
|
+
protected runRemoveDeps(dependencies: string[]): void;
|
|
9
10
|
protected runGetVersions<T extends boolean>(packageName: string, fetchAllVersions: T): Promise<T extends true ? string[] : string>;
|
|
10
11
|
}
|
|
@@ -2,6 +2,7 @@ interface ReproOptions {
|
|
|
2
2
|
filterValue?: string;
|
|
3
3
|
output?: string;
|
|
4
4
|
branch?: string;
|
|
5
|
+
init?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare const reproNext: ({ output: outputDirectory, filterValue, branch }: ReproOptions) => Promise<void>;
|
|
7
|
+
export declare const reproNext: ({ output: outputDirectory, filterValue, branch, init, }: ReproOptions) => Promise<void>;
|
|
7
8
|
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.
|
|
3
|
+
"version": "7.0.0-alpha.20",
|
|
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.
|
|
53
|
-
"@storybook/core-common": "7.0.0-alpha.
|
|
54
|
-
"@storybook/core-server": "7.0.0-alpha.
|
|
55
|
-
"@storybook/csf-tools": "7.0.0-alpha.
|
|
56
|
-
"@storybook/node-logger": "7.0.0-alpha.
|
|
51
|
+
"@storybook/codemod": "7.0.0-alpha.20",
|
|
52
|
+
"@storybook/core-common": "7.0.0-alpha.20",
|
|
53
|
+
"@storybook/core-server": "7.0.0-alpha.20",
|
|
54
|
+
"@storybook/csf-tools": "7.0.0-alpha.20",
|
|
55
|
+
"@storybook/node-logger": "7.0.0-alpha.20",
|
|
57
56
|
"@storybook/semver": "^7.3.2",
|
|
58
|
-
"@storybook/telemetry": "7.0.0-alpha.
|
|
57
|
+
"@storybook/telemetry": "7.0.0-alpha.20",
|
|
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.
|
|
84
|
+
"@storybook/client-api": "7.0.0-alpha.20",
|
|
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": "
|
|
99
|
+
"gitHead": "a6c00d2ebed21da54b4772b4a4f7fed9258f0ab4"
|
|
101
100
|
}
|