@nx/storybook 20.0.0-beta.1 → 20.0.0-beta.2
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/package.json +6 -6
- package/src/generators/configuration/configuration.js +0 -22
- package/src/generators/configuration/lib/util-functions.d.ts +0 -1
- package/src/generators/configuration/lib/util-functions.js +0 -19
- package/src/generators/configuration/schema.d.ts +0 -8
- package/src/generators/configuration/schema.json +0 -10
- package/src/generators/migrate-7/calling-storybook-cli.js +2 -0
- package/src/generators/migrate-8/calling-storybook-cli.js +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/storybook",
|
|
3
|
-
"version": "20.0.0-beta.
|
|
3
|
+
"version": "20.0.0-beta.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Storybook contains executors and generators for allowing your workspace to use the powerful Storybook integration testing & documenting capabilities.",
|
|
6
6
|
"repository": {
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"migrations": "./migrations.json"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@nx/devkit": "20.0.0-beta.
|
|
36
|
+
"@nx/devkit": "20.0.0-beta.2",
|
|
37
37
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
38
38
|
"semver": "^7.5.3",
|
|
39
39
|
"tslib": "^2.3.0",
|
|
40
|
-
"@nx/cypress": "20.0.0-beta.
|
|
41
|
-
"@nx/js": "20.0.0-beta.
|
|
42
|
-
"@nx/eslint": "20.0.0-beta.
|
|
43
|
-
"@nrwl/storybook": "20.0.0-beta.
|
|
40
|
+
"@nx/cypress": "20.0.0-beta.2",
|
|
41
|
+
"@nx/js": "20.0.0-beta.2",
|
|
42
|
+
"@nx/eslint": "20.0.0-beta.2",
|
|
43
|
+
"@nrwl/storybook": "20.0.0-beta.2"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
@@ -4,7 +4,6 @@ exports.configurationGenerator = configurationGenerator;
|
|
|
4
4
|
exports.configurationGeneratorInternal = configurationGeneratorInternal;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
|
-
const cypress_project_1 = require("../cypress-project/cypress-project");
|
|
8
7
|
const init_1 = require("../init/init");
|
|
9
8
|
const util_functions_1 = require("./lib/util-functions");
|
|
10
9
|
const eslint_1 = require("@nx/eslint");
|
|
@@ -97,27 +96,6 @@ async function configurationGeneratorInternal(tree, rawSchema) {
|
|
|
97
96
|
else {
|
|
98
97
|
devDeps['storybook'] = versions_1.storybookVersion;
|
|
99
98
|
}
|
|
100
|
-
// TODO(katerina): Nx 19 -> remove Cypress
|
|
101
|
-
if (schema.configureCypress) {
|
|
102
|
-
const e2eProject = await (0, util_functions_1.getE2EProjectName)(tree, schema.project);
|
|
103
|
-
if (!e2eProject) {
|
|
104
|
-
const cypressTask = await (0, cypress_project_1.cypressProjectGenerator)(tree, {
|
|
105
|
-
name: schema.project,
|
|
106
|
-
js: schema.js,
|
|
107
|
-
linter: schema.linter,
|
|
108
|
-
directory: schema.cypressDirectory,
|
|
109
|
-
standaloneConfig: schema.standaloneConfig,
|
|
110
|
-
ciTargetName: schema.configureStaticServe
|
|
111
|
-
? 'static-storybook'
|
|
112
|
-
: undefined,
|
|
113
|
-
skipFormat: true,
|
|
114
|
-
});
|
|
115
|
-
tasks.push(cypressTask);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
devkit_1.logger.warn(`There is already an e2e project setup for ${schema.project}, called ${e2eProject}.`);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
99
|
if (schema.tsConfiguration) {
|
|
122
100
|
devDeps['ts-node'] = versions_1.tsNodeVersion;
|
|
123
101
|
}
|
|
@@ -25,7 +25,6 @@ export declare function addBuildStorybookToCacheableOperations(tree: Tree): void
|
|
|
25
25
|
export declare function projectIsRootProjectInStandaloneWorkspace(projectRoot: string): boolean;
|
|
26
26
|
export declare function workspaceHasRootProject(tree: Tree): boolean;
|
|
27
27
|
export declare function rootFileIsTs(tree: Tree, rootFileName: string, tsConfiguration: boolean): boolean;
|
|
28
|
-
export declare function getE2EProjectName(tree: Tree, mainProject: string): Promise<string | undefined>;
|
|
29
28
|
export declare function findViteConfig(tree: Tree, projectRoot: string): {
|
|
30
29
|
fullConfigPath: string | undefined;
|
|
31
30
|
viteConfigFileName: string | undefined;
|
|
@@ -17,13 +17,11 @@ exports.addBuildStorybookToCacheableOperations = addBuildStorybookToCacheableOpe
|
|
|
17
17
|
exports.projectIsRootProjectInStandaloneWorkspace = projectIsRootProjectInStandaloneWorkspace;
|
|
18
18
|
exports.workspaceHasRootProject = workspaceHasRootProject;
|
|
19
19
|
exports.rootFileIsTs = rootFileIsTs;
|
|
20
|
-
exports.getE2EProjectName = getE2EProjectName;
|
|
21
20
|
exports.findViteConfig = findViteConfig;
|
|
22
21
|
exports.findNextConfig = findNextConfig;
|
|
23
22
|
exports.findMetroConfig = findMetroConfig;
|
|
24
23
|
exports.renameAndMoveOldTsConfig = renameAndMoveOldTsConfig;
|
|
25
24
|
const devkit_1 = require("@nx/devkit");
|
|
26
|
-
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
27
25
|
const eslint_1 = require("@nx/eslint");
|
|
28
26
|
const path_1 = require("path");
|
|
29
27
|
const utilities_1 = require("../../../utils/utilities");
|
|
@@ -464,23 +462,6 @@ function rootFileIsTs(tree, rootFileName, tsConfiguration) {
|
|
|
464
462
|
return tsConfiguration;
|
|
465
463
|
}
|
|
466
464
|
}
|
|
467
|
-
async function getE2EProjectName(tree, mainProject) {
|
|
468
|
-
let e2eProject;
|
|
469
|
-
const graph = await (0, devkit_1.createProjectGraphAsync)();
|
|
470
|
-
(0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nx/cypress:cypress', (options, projectName) => {
|
|
471
|
-
if (e2eProject) {
|
|
472
|
-
return;
|
|
473
|
-
}
|
|
474
|
-
if (options['devServerTarget']) {
|
|
475
|
-
const { project, target } = (0, devkit_1.parseTargetString)(options['devServerTarget'], graph);
|
|
476
|
-
if ((project === mainProject && target === 'serve') ||
|
|
477
|
-
(project === mainProject && target === 'storybook')) {
|
|
478
|
-
e2eProject = projectName;
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
});
|
|
482
|
-
return e2eProject;
|
|
483
|
-
}
|
|
484
465
|
function findViteConfig(tree, projectRoot) {
|
|
485
466
|
const allowsExt = ['js', 'mjs', 'ts', 'cjs', 'mts', 'cts'];
|
|
486
467
|
for (const ext of allowsExt) {
|
|
@@ -11,14 +11,6 @@ export interface StorybookConfigureSchema {
|
|
|
11
11
|
standaloneConfig?: boolean;
|
|
12
12
|
configureStaticServe?: boolean;
|
|
13
13
|
skipFormat?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Use interactionTests instead. This option will be removed in v20.
|
|
16
|
-
*/
|
|
17
|
-
configureCypress?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated Use interactionTests instead. This option will be removed in v20.
|
|
20
|
-
*/
|
|
21
|
-
cypressDirectory?: string;
|
|
22
14
|
addPlugin?: boolean;
|
|
23
15
|
|
|
24
16
|
/**
|
|
@@ -25,16 +25,6 @@
|
|
|
25
25
|
"alias": ["configureTestRunner"],
|
|
26
26
|
"default": true
|
|
27
27
|
},
|
|
28
|
-
"configureCypress": {
|
|
29
|
-
"type": "boolean",
|
|
30
|
-
"description": "Run the cypress-configure generator.",
|
|
31
|
-
"x-deprecated": "Use interactionTests instead. This option will be removed in v20."
|
|
32
|
-
},
|
|
33
|
-
"cypressDirectory": {
|
|
34
|
-
"type": "string",
|
|
35
|
-
"description": "A directory where the Cypress project will be placed. Added at root by default.",
|
|
36
|
-
"x-deprecated": "Use interactionTests instead. This option will be removed in v20."
|
|
37
|
-
},
|
|
38
28
|
"linter": {
|
|
39
29
|
"description": "The tool to use for running lint checks.",
|
|
40
30
|
"type": "string",
|
|
@@ -17,6 +17,7 @@ function callUpgrade(schema) {
|
|
|
17
17
|
});
|
|
18
18
|
(0, child_process_1.execSync)(`${pm.dlx} storybook@latest upgrade ${schema.autoAcceptAllPrompts ? '--yes' : ''}`, {
|
|
19
19
|
stdio: [0, 1, 2],
|
|
20
|
+
windowsHide: true,
|
|
20
21
|
});
|
|
21
22
|
devkit_1.output.log({
|
|
22
23
|
title: `Storybook packages upgraded.`,
|
|
@@ -65,6 +66,7 @@ function callAutomigrate(allStorybookProjects, schema) {
|
|
|
65
66
|
});
|
|
66
67
|
(0, child_process_1.execSync)(`${commandToRun} ${schema.autoAcceptAllPrompts ? '--yes' : ''}`, {
|
|
67
68
|
stdio: 'inherit',
|
|
69
|
+
windowsHide: true,
|
|
68
70
|
});
|
|
69
71
|
resultOfMigration.successfulProjects[projectName] = commandToRun;
|
|
70
72
|
}
|
|
@@ -17,6 +17,7 @@ function callUpgrade(schema) {
|
|
|
17
17
|
});
|
|
18
18
|
(0, child_process_1.execSync)(`${pm.dlx} storybook@latest upgrade ${schema.autoAcceptAllPrompts ? '--yes' : ''}`, {
|
|
19
19
|
stdio: [0, 1, 2],
|
|
20
|
+
windowsHide: true,
|
|
20
21
|
});
|
|
21
22
|
devkit_1.output.log({
|
|
22
23
|
title: `Storybook packages upgraded.`,
|
|
@@ -65,6 +66,7 @@ function callAutomigrate(allStorybookProjects, schema) {
|
|
|
65
66
|
});
|
|
66
67
|
(0, child_process_1.execSync)(`${commandToRun} ${schema.autoAcceptAllPrompts ? '--yes' : ''}`, {
|
|
67
68
|
stdio: 'inherit',
|
|
69
|
+
windowsHide: true,
|
|
68
70
|
});
|
|
69
71
|
resultOfMigration.successfulProjects[projectName] = commandToRun;
|
|
70
72
|
}
|