@nx/storybook 18.3.0-beta.1 → 18.3.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/storybook",
|
|
3
|
-
"version": "18.3.0-beta.
|
|
3
|
+
"version": "18.3.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": {
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"migrations": "./migrations.json"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@nx/devkit": "18.3.0-beta.
|
|
33
|
+
"@nx/devkit": "18.3.0-beta.2",
|
|
34
34
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
35
35
|
"semver": "^7.5.3",
|
|
36
36
|
"tslib": "^2.3.0",
|
|
37
|
-
"@nx/cypress": "18.3.0-beta.
|
|
38
|
-
"@nx/js": "18.3.0-beta.
|
|
39
|
-
"@nx/eslint": "18.3.0-beta.
|
|
40
|
-
"@nrwl/storybook": "18.3.0-beta.
|
|
37
|
+
"@nx/cypress": "18.3.0-beta.2",
|
|
38
|
+
"@nx/js": "18.3.0-beta.2",
|
|
39
|
+
"@nx/eslint": "18.3.0-beta.2",
|
|
40
|
+
"@nrwl/storybook": "18.3.0-beta.2"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initGeneratorInternal = exports.initGenerator = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
|
|
6
6
|
const semver_1 = require("semver");
|
|
7
7
|
const plugin_1 = require("../../plugins/plugin");
|
|
8
8
|
const utilities_1 = require("../../utils/utilities");
|
|
@@ -60,7 +60,30 @@ async function initGeneratorInternal(tree, schema) {
|
|
|
60
60
|
nxJson.useInferencePlugins !== false;
|
|
61
61
|
schema.addPlugin ??= addPluginDefault;
|
|
62
62
|
if (schema.addPlugin) {
|
|
63
|
-
(0,
|
|
63
|
+
await (0, add_plugin_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/storybook/plugin', plugin_1.createNodes, {
|
|
64
|
+
serveStorybookTargetName: [
|
|
65
|
+
'storybook',
|
|
66
|
+
'serve:storybook',
|
|
67
|
+
'serve-storybook',
|
|
68
|
+
'storybook:serve',
|
|
69
|
+
'storybook-serve',
|
|
70
|
+
],
|
|
71
|
+
buildStorybookTargetName: [
|
|
72
|
+
'build-storybook',
|
|
73
|
+
'build:storybook',
|
|
74
|
+
'storybook:build',
|
|
75
|
+
],
|
|
76
|
+
testStorybookTargetName: [
|
|
77
|
+
'test-storybook',
|
|
78
|
+
'test:storybook',
|
|
79
|
+
'storybook:test',
|
|
80
|
+
],
|
|
81
|
+
staticStorybookTargetName: [
|
|
82
|
+
'static-storybook',
|
|
83
|
+
'static:storybook',
|
|
84
|
+
'storybook:static',
|
|
85
|
+
],
|
|
86
|
+
}, schema.updatePackageScripts);
|
|
64
87
|
(0, update_gitignore_1.updateGitignore)(tree);
|
|
65
88
|
}
|
|
66
89
|
else {
|
|
@@ -71,9 +94,6 @@ async function initGeneratorInternal(tree, schema) {
|
|
|
71
94
|
tasks.push(moveToDevDependencies(tree));
|
|
72
95
|
tasks.push(checkDependenciesInstalled(tree, schema));
|
|
73
96
|
}
|
|
74
|
-
if (schema.updatePackageScripts) {
|
|
75
|
-
await (0, update_package_scripts_1.updatePackageScripts)(tree, plugin_1.createNodes);
|
|
76
|
-
}
|
|
77
97
|
if (!schema.skipFormat) {
|
|
78
98
|
await (0, devkit_1.formatFiles)(tree);
|
|
79
99
|
}
|
package/src/utils/utilities.d.ts
CHANGED
|
@@ -40,4 +40,3 @@ export declare function findStorybookAndBuildTargetsAndCompiler(targets: {
|
|
|
40
40
|
export declare function isTheFileAStory(tree: Tree, path: string): boolean;
|
|
41
41
|
export declare function getTsSourceFile(host: Tree, path: string): ts.SourceFile;
|
|
42
42
|
export declare function pleaseUpgrade(): string;
|
|
43
|
-
export declare function addPlugin(tree: Tree): void;
|
package/src/utils/utilities.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
3
|
+
exports.pleaseUpgrade = exports.getTsSourceFile = exports.isTheFileAStory = exports.findStorybookAndBuildTargetsAndCompiler = exports.dedupe = exports.storybookConfigExistsCheck = exports.safeFileDelete = exports.getInstalledStorybookVersion = exports.storybookMajorVersion = exports.Constants = void 0;
|
|
5
4
|
const fs_1 = require("fs");
|
|
6
5
|
const js_1 = require("@nx/js");
|
|
7
6
|
const ts = require("typescript");
|
|
@@ -222,25 +221,3 @@ function pleaseUpgrade() {
|
|
|
222
221
|
`;
|
|
223
222
|
}
|
|
224
223
|
exports.pleaseUpgrade = pleaseUpgrade;
|
|
225
|
-
function addPlugin(tree) {
|
|
226
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
227
|
-
nxJson.plugins ??= [];
|
|
228
|
-
for (const plugin of nxJson.plugins) {
|
|
229
|
-
if (typeof plugin === 'string'
|
|
230
|
-
? plugin === '@nx/storybook/plugin'
|
|
231
|
-
: plugin.plugin === '@nx/storybook/plugin') {
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
nxJson.plugins.push({
|
|
236
|
-
plugin: '@nx/storybook/plugin',
|
|
237
|
-
options: {
|
|
238
|
-
buildStorybookTargetName: 'build-storybook',
|
|
239
|
-
serveStorybookTargetName: 'storybook',
|
|
240
|
-
testStorybookTargetName: 'test-storybook',
|
|
241
|
-
staticStorybookTargetName: 'static-storybook',
|
|
242
|
-
},
|
|
243
|
-
});
|
|
244
|
-
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
245
|
-
}
|
|
246
|
-
exports.addPlugin = addPlugin;
|