@nx/storybook 23.0.0-beta.2 → 23.0.0-beta.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/migrations.json +17 -1
- package/package.json +9 -9
- package/src/executors/build-storybook/build-storybook.impl.d.ts.map +1 -1
- package/src/executors/build-storybook/build-storybook.impl.js +2 -4
- package/src/executors/build-storybook/schema.json +1 -0
- package/src/executors/storybook/schema.json +1 -0
- package/src/executors/storybook/storybook.impl.d.ts.map +1 -1
- package/src/executors/storybook/storybook.impl.js +2 -4
- package/src/generators/configuration/configuration.d.ts.map +1 -1
- package/src/generators/configuration/configuration.js +8 -7
- package/src/generators/configuration/lib/ensure-dependencies.d.ts.map +1 -1
- package/src/generators/configuration/lib/ensure-dependencies.js +4 -15
- package/src/generators/configuration/lib/util-functions.d.ts.map +1 -1
- package/src/generators/configuration/lib/util-functions.js +39 -35
- package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/convert-to-inferred.js +7 -6
- package/src/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts +1 -1
- package/src/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/lib/build-post-target-transformer.js +6 -9
- package/src/generators/convert-to-inferred/lib/serve-post-target-transformer.d.ts +1 -1
- package/src/generators/convert-to-inferred/lib/serve-post-target-transformer.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/lib/serve-post-target-transformer.js +4 -6
- package/src/generators/convert-to-inferred/lib/utils.d.ts +77 -37
- package/src/generators/convert-to-inferred/lib/utils.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/lib/utils.js +35 -40
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +7 -7
- package/src/generators/init/schema.json +1 -1
- package/src/generators/migrate-10/migrate-10.d.ts.map +1 -1
- package/src/generators/migrate-10/migrate-10.js +5 -0
- package/src/generators/migrate-10/schema.d.ts +1 -0
- package/src/generators/migrate-10/schema.json +5 -0
- package/src/generators/migrate-9/migrate-9.d.ts.map +1 -1
- package/src/generators/migrate-9/migrate-9.js +2 -0
- package/src/migrations/update-22-1-0/migrate-to-storybook-10.d.ts +1 -1
- package/src/migrations/update-22-1-0/migrate-to-storybook-10.d.ts.map +1 -1
- package/src/migrations/update-22-1-0/migrate-to-storybook-10.js +1 -4
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +61 -27
- package/src/utils/assert-supported-storybook-version.d.ts +3 -0
- package/src/utils/assert-supported-storybook-version.d.ts.map +1 -0
- package/src/utils/assert-supported-storybook-version.js +8 -0
- package/src/utils/deprecation.d.ts +6 -0
- package/src/utils/deprecation.d.ts.map +1 -0
- package/src/utils/deprecation.js +21 -0
- package/src/utils/utilities.d.ts +1 -4
- package/src/utils/utilities.d.ts.map +1 -1
- package/src/utils/utilities.js +5 -84
- package/src/utils/versions.d.ts +9 -0
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +47 -1
|
@@ -1,51 +1,91 @@
|
|
|
1
1
|
import { type Tree } from '@nx/devkit';
|
|
2
|
-
import { AggregatedLog } from '@nx/devkit/
|
|
2
|
+
import { AggregatedLog } from '@nx/devkit/internal';
|
|
3
3
|
export declare function getConfigFilePath(tree: Tree, configDir: string): string;
|
|
4
4
|
export declare function addConfigValuesToConfigFile(tree: Tree, configFile: string, configValues: Record<string, Record<string, unknown>>): void;
|
|
5
|
+
declare const MODERN_STORYBOOK_PROP_MAPPING: {
|
|
6
|
+
readonly port: "port";
|
|
7
|
+
readonly previewUrl: "preview-url";
|
|
8
|
+
readonly host: "host";
|
|
9
|
+
readonly docs: "docs";
|
|
10
|
+
readonly configDir: "config-dir";
|
|
11
|
+
readonly logLevel: "loglevel";
|
|
12
|
+
readonly quiet: "quiet";
|
|
13
|
+
readonly webpackStatsJson: "stats-json";
|
|
14
|
+
readonly debugWebpack: "debug-webpack";
|
|
15
|
+
readonly disableTelemetry: "disable-telemetry";
|
|
16
|
+
readonly https: "https";
|
|
17
|
+
readonly sslCa: "ssl-ca";
|
|
18
|
+
readonly sslCert: "ssl-cert";
|
|
19
|
+
readonly sslKey: "ssl-key";
|
|
20
|
+
readonly smokeTest: "smoke-test";
|
|
21
|
+
readonly noOpen: "no-open";
|
|
22
|
+
readonly outputDir: "output-dir";
|
|
23
|
+
};
|
|
5
24
|
export declare const STORYBOOK_PROP_MAPPINGS: {
|
|
6
|
-
|
|
7
|
-
port:
|
|
8
|
-
previewUrl:
|
|
9
|
-
host:
|
|
10
|
-
docs:
|
|
11
|
-
configDir:
|
|
12
|
-
logLevel:
|
|
13
|
-
quiet:
|
|
14
|
-
webpackStatsJson:
|
|
15
|
-
debugWebpack:
|
|
16
|
-
disableTelemetry:
|
|
17
|
-
https:
|
|
18
|
-
sslCa:
|
|
19
|
-
sslCert:
|
|
20
|
-
sslKey:
|
|
21
|
-
smokeTest:
|
|
22
|
-
noOpen:
|
|
23
|
-
outputDir:
|
|
25
|
+
readonly v8: {
|
|
26
|
+
readonly port: "port";
|
|
27
|
+
readonly previewUrl: "preview-url";
|
|
28
|
+
readonly host: "host";
|
|
29
|
+
readonly docs: "docs";
|
|
30
|
+
readonly configDir: "config-dir";
|
|
31
|
+
readonly logLevel: "loglevel";
|
|
32
|
+
readonly quiet: "quiet";
|
|
33
|
+
readonly webpackStatsJson: "stats-json";
|
|
34
|
+
readonly debugWebpack: "debug-webpack";
|
|
35
|
+
readonly disableTelemetry: "disable-telemetry";
|
|
36
|
+
readonly https: "https";
|
|
37
|
+
readonly sslCa: "ssl-ca";
|
|
38
|
+
readonly sslCert: "ssl-cert";
|
|
39
|
+
readonly sslKey: "ssl-key";
|
|
40
|
+
readonly smokeTest: "smoke-test";
|
|
41
|
+
readonly noOpen: "no-open";
|
|
42
|
+
readonly outputDir: "output-dir";
|
|
43
|
+
};
|
|
44
|
+
readonly v9: {
|
|
45
|
+
readonly port: "port";
|
|
46
|
+
readonly previewUrl: "preview-url";
|
|
47
|
+
readonly host: "host";
|
|
48
|
+
readonly docs: "docs";
|
|
49
|
+
readonly configDir: "config-dir";
|
|
50
|
+
readonly logLevel: "loglevel";
|
|
51
|
+
readonly quiet: "quiet";
|
|
52
|
+
readonly webpackStatsJson: "stats-json";
|
|
53
|
+
readonly debugWebpack: "debug-webpack";
|
|
54
|
+
readonly disableTelemetry: "disable-telemetry";
|
|
55
|
+
readonly https: "https";
|
|
56
|
+
readonly sslCa: "ssl-ca";
|
|
57
|
+
readonly sslCert: "ssl-cert";
|
|
58
|
+
readonly sslKey: "ssl-key";
|
|
59
|
+
readonly smokeTest: "smoke-test";
|
|
60
|
+
readonly noOpen: "no-open";
|
|
61
|
+
readonly outputDir: "output-dir";
|
|
24
62
|
};
|
|
25
|
-
|
|
26
|
-
port:
|
|
27
|
-
previewUrl:
|
|
28
|
-
host:
|
|
29
|
-
docs:
|
|
30
|
-
configDir:
|
|
31
|
-
logLevel:
|
|
32
|
-
quiet:
|
|
33
|
-
webpackStatsJson:
|
|
34
|
-
debugWebpack:
|
|
35
|
-
disableTelemetry:
|
|
36
|
-
https:
|
|
37
|
-
sslCa:
|
|
38
|
-
sslCert:
|
|
39
|
-
sslKey:
|
|
40
|
-
smokeTest:
|
|
41
|
-
noOpen:
|
|
42
|
-
outputDir:
|
|
63
|
+
readonly v10: {
|
|
64
|
+
readonly port: "port";
|
|
65
|
+
readonly previewUrl: "preview-url";
|
|
66
|
+
readonly host: "host";
|
|
67
|
+
readonly docs: "docs";
|
|
68
|
+
readonly configDir: "config-dir";
|
|
69
|
+
readonly logLevel: "loglevel";
|
|
70
|
+
readonly quiet: "quiet";
|
|
71
|
+
readonly webpackStatsJson: "stats-json";
|
|
72
|
+
readonly debugWebpack: "debug-webpack";
|
|
73
|
+
readonly disableTelemetry: "disable-telemetry";
|
|
74
|
+
readonly https: "https";
|
|
75
|
+
readonly sslCa: "ssl-ca";
|
|
76
|
+
readonly sslCert: "ssl-cert";
|
|
77
|
+
readonly sslKey: "ssl-key";
|
|
78
|
+
readonly smokeTest: "smoke-test";
|
|
79
|
+
readonly noOpen: "no-open";
|
|
80
|
+
readonly outputDir: "output-dir";
|
|
43
81
|
};
|
|
44
82
|
};
|
|
83
|
+
export declare function getStorybookPropMappings(tree: Tree): typeof MODERN_STORYBOOK_PROP_MAPPING;
|
|
45
84
|
export declare function ensureViteConfigPathIsRelative(tree: Tree, configPath: string, projectName: string, projectRoot: string, executorName: string, migrationLogs: AggregatedLog): void;
|
|
46
85
|
export declare function getInstalledPackageVersion(tree: Tree, pkgName: string): string | null;
|
|
47
86
|
export declare function getInstalledPackageVersionInfo(tree: Tree, pkgName: string): {
|
|
48
87
|
major: number;
|
|
49
88
|
version: string;
|
|
50
89
|
};
|
|
90
|
+
export {};
|
|
51
91
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/storybook/src/generators/convert-to-inferred/lib/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/storybook/src/generators/convert-to-inferred/lib/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAyB,MAAM,qBAAqB,CAAC;AAI3E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,UAS9D;AAED,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,QAgCtD;AAKD,QAAA,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;CAkBzB,CAAC;AAEX,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI1B,CAAC;AAEX,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,IAAI,GACT,OAAO,6BAA6B,CAMtC;AAED,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,aAAa,QAmE7B;AAED,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,IAAI,CAGf;AAED,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM;;;EAKzE"}
|
|
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.STORYBOOK_PROP_MAPPINGS = void 0;
|
|
4
4
|
exports.getConfigFilePath = getConfigFilePath;
|
|
5
5
|
exports.addConfigValuesToConfigFile = addConfigValuesToConfigFile;
|
|
6
|
+
exports.getStorybookPropMappings = getStorybookPropMappings;
|
|
6
7
|
exports.ensureViteConfigPathIsRelative = ensureViteConfigPathIsRelative;
|
|
7
8
|
exports.getInstalledPackageVersion = getInstalledPackageVersion;
|
|
8
9
|
exports.getInstalledPackageVersionInfo = getInstalledPackageVersionInfo;
|
|
9
10
|
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
10
11
|
const devkit_1 = require("@nx/devkit");
|
|
11
|
-
const
|
|
12
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
12
13
|
const semver_1 = require("semver");
|
|
13
14
|
function getConfigFilePath(tree, configDir) {
|
|
14
15
|
return [
|
|
@@ -46,46 +47,40 @@ function addConfigValuesToConfigFile(tree, configFile, configValues) {
|
|
|
46
47
|
${configValuesString}
|
|
47
48
|
${configFileContents.slice(startPosition)}`);
|
|
48
49
|
}
|
|
50
|
+
// CLI flag names across Storybook v8 / v9 / v10 are identical (verified against
|
|
51
|
+
// storybook v9 and v10 bundled CLI sources); kept as separate entries so a
|
|
52
|
+
// future divergence per major can be expressed in place.
|
|
53
|
+
const MODERN_STORYBOOK_PROP_MAPPING = {
|
|
54
|
+
port: 'port',
|
|
55
|
+
previewUrl: 'preview-url',
|
|
56
|
+
host: 'host',
|
|
57
|
+
docs: 'docs',
|
|
58
|
+
configDir: 'config-dir',
|
|
59
|
+
logLevel: 'loglevel',
|
|
60
|
+
quiet: 'quiet',
|
|
61
|
+
webpackStatsJson: 'stats-json',
|
|
62
|
+
debugWebpack: 'debug-webpack',
|
|
63
|
+
disableTelemetry: 'disable-telemetry',
|
|
64
|
+
https: 'https',
|
|
65
|
+
sslCa: 'ssl-ca',
|
|
66
|
+
sslCert: 'ssl-cert',
|
|
67
|
+
sslKey: 'ssl-key',
|
|
68
|
+
smokeTest: 'smoke-test',
|
|
69
|
+
noOpen: 'no-open',
|
|
70
|
+
outputDir: 'output-dir',
|
|
71
|
+
};
|
|
49
72
|
exports.STORYBOOK_PROP_MAPPINGS = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
host: 'host',
|
|
54
|
-
docs: 'docs',
|
|
55
|
-
configDir: 'config-dir',
|
|
56
|
-
logLevel: 'loglevel',
|
|
57
|
-
quiet: 'quiet',
|
|
58
|
-
webpackStatsJson: 'webpack-stats-json',
|
|
59
|
-
debugWebpack: 'debug-webpack',
|
|
60
|
-
disableTelemetry: 'disable-telemetry',
|
|
61
|
-
https: 'https',
|
|
62
|
-
sslCa: 'ssl-ca',
|
|
63
|
-
sslCert: 'ssl-cert',
|
|
64
|
-
sslKey: 'ssl-key',
|
|
65
|
-
smokeTest: 'smoke-test',
|
|
66
|
-
noOpen: 'no-open',
|
|
67
|
-
outputDir: 'output-dir',
|
|
68
|
-
},
|
|
69
|
-
v8: {
|
|
70
|
-
port: 'port',
|
|
71
|
-
previewUrl: 'preview-url',
|
|
72
|
-
host: 'host',
|
|
73
|
-
docs: 'docs',
|
|
74
|
-
configDir: 'config-dir',
|
|
75
|
-
logLevel: 'loglevel',
|
|
76
|
-
quiet: 'quiet',
|
|
77
|
-
webpackStatsJson: 'stats-json',
|
|
78
|
-
debugWebpack: 'debug-webpack',
|
|
79
|
-
disableTelemetry: 'disable-telemetry',
|
|
80
|
-
https: 'https',
|
|
81
|
-
sslCa: 'ssl-ca',
|
|
82
|
-
sslCert: 'ssl-cert',
|
|
83
|
-
sslKey: 'ssl-key',
|
|
84
|
-
smokeTest: 'smoke-test',
|
|
85
|
-
noOpen: 'no-open',
|
|
86
|
-
outputDir: 'output-dir',
|
|
87
|
-
},
|
|
73
|
+
v8: MODERN_STORYBOOK_PROP_MAPPING,
|
|
74
|
+
v9: MODERN_STORYBOOK_PROP_MAPPING,
|
|
75
|
+
v10: MODERN_STORYBOOK_PROP_MAPPING,
|
|
88
76
|
};
|
|
77
|
+
function getStorybookPropMappings(tree) {
|
|
78
|
+
const major = getInstalledPackageVersionInfo(tree, 'storybook')?.major;
|
|
79
|
+
const key = `v${major}`;
|
|
80
|
+
// Above-ceiling falls through to the latest known mapping. Below-floor is
|
|
81
|
+
// unreachable: the generator-level floor assert blocks it before this runs.
|
|
82
|
+
return exports.STORYBOOK_PROP_MAPPINGS[key] ?? exports.STORYBOOK_PROP_MAPPINGS.v10;
|
|
83
|
+
}
|
|
89
84
|
function ensureViteConfigPathIsRelative(tree, configPath, projectName, projectRoot, executorName, migrationLogs) {
|
|
90
85
|
const configFileContents = tree.read(configPath, 'utf-8');
|
|
91
86
|
if (configFileContents.includes('viteFinal:')) {
|
|
@@ -122,7 +117,7 @@ function ensureViteConfigPathIsRelative(tree, configPath, projectName, projectRo
|
|
|
122
117
|
if (pathToViteConfig.match(/^(\.\.\/|\.\/)/)) {
|
|
123
118
|
return;
|
|
124
119
|
}
|
|
125
|
-
const relativePathToViteConfig = (0,
|
|
120
|
+
const relativePathToViteConfig = (0, internal_1.toProjectRelativePath)(pathToViteConfig, projectRoot);
|
|
126
121
|
tree.write(configPath, `${configFileContents.slice(0, viteConfigPathNode.getStart() + 1)}${relativePathToViteConfig}${configFileContents.slice(viteConfigPathNode.getEnd() - 1)}`);
|
|
127
122
|
}
|
|
128
123
|
function getInstalledPackageVersion(tree, pkgName) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/generators/init/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/generators/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EAIjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AA2DlC,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAEvD;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAmErE;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initGenerator = initGenerator;
|
|
4
4
|
exports.initGeneratorInternal = initGeneratorInternal;
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
|
|
7
7
|
const plugin_1 = require("../../plugins/plugin");
|
|
8
8
|
const utilities_1 = require("../../utils/utilities");
|
|
9
9
|
const versions_1 = require("../../utils/versions");
|
|
10
|
+
const assert_supported_storybook_version_1 = require("../../utils/assert-supported-storybook-version");
|
|
10
11
|
const update_gitignore_1 = require("./lib/update-gitignore");
|
|
11
12
|
function checkDependenciesInstalled(host, schema) {
|
|
12
13
|
const devDependencies = {
|
|
@@ -15,17 +16,15 @@ function checkDependenciesInstalled(host, schema) {
|
|
|
15
16
|
};
|
|
16
17
|
const storybookVersionToInstall = (0, utilities_1.getStorybookVersionToInstall)(host);
|
|
17
18
|
devDependencies['storybook'] = storybookVersionToInstall;
|
|
18
|
-
return (0, devkit_1.addDependenciesToPackageJson)(host, {}, devDependencies, undefined, schema.keepExistingVersions);
|
|
19
|
+
return (0, devkit_1.addDependenciesToPackageJson)(host, {}, devDependencies, undefined, schema.keepExistingVersions ?? true);
|
|
19
20
|
}
|
|
20
21
|
function addCacheableOperation(tree) {
|
|
21
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
22
|
+
const nxJson = (0, devkit_1.readNxJson)(tree) ?? {};
|
|
22
23
|
const cacheableOperations = nxJson.tasksRunnerOptions?.default?.options?.cacheableOperations;
|
|
23
24
|
if (cacheableOperations && !cacheableOperations.includes('build-storybook')) {
|
|
24
25
|
nxJson.tasksRunnerOptions.default.options.cacheableOperations.push('build-storybook');
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
-
nxJson.targetDefaults['build-storybook'] ??= {};
|
|
28
|
-
nxJson.targetDefaults['build-storybook'].cache = true;
|
|
27
|
+
(0, internal_1.upsertTargetDefault)(tree, nxJson, { target: 'build-storybook', cache: true });
|
|
29
28
|
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
30
29
|
}
|
|
31
30
|
function moveToDevDependencies(tree) {
|
|
@@ -47,12 +46,13 @@ function initGenerator(tree, schema) {
|
|
|
47
46
|
return initGeneratorInternal(tree, { addPlugin: false, ...schema });
|
|
48
47
|
}
|
|
49
48
|
async function initGeneratorInternal(tree, schema) {
|
|
49
|
+
(0, assert_supported_storybook_version_1.assertSupportedStorybookVersion)(tree);
|
|
50
50
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
51
51
|
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
52
52
|
nxJson.useInferencePlugins !== false;
|
|
53
53
|
schema.addPlugin ??= addPluginDefault;
|
|
54
54
|
if (schema.addPlugin) {
|
|
55
|
-
await (0,
|
|
55
|
+
await (0, internal_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/storybook/plugin', plugin_1.createNodesV2, {
|
|
56
56
|
serveStorybookTargetName: [
|
|
57
57
|
'storybook',
|
|
58
58
|
'serve:storybook',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-10.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/generators/migrate-10/migrate-10.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,IAAI,EAAE,MAAM,YAAY,CAAC;AAIjE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"migrate-10.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/generators/migrate-10/migrate-10.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,IAAI,EAAE,MAAM,YAAY,CAAC;AAIjE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAKlC,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAqClE;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -6,7 +6,9 @@ const output_1 = require("nx/src/utils/output");
|
|
|
6
6
|
const calling_storybook_cli_1 = require("./calling-storybook-cli");
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
|
+
const assert_supported_storybook_version_1 = require("../../utils/assert-supported-storybook-version");
|
|
9
10
|
async function migrate10Generator(tree, schema) {
|
|
11
|
+
(0, assert_supported_storybook_version_1.assertSupportedStorybookVersion)(tree);
|
|
10
12
|
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
11
13
|
if (!(0, calling_storybook_cli_1.checkStorybookInstalled)(packageJson)) {
|
|
12
14
|
output_1.output.error({
|
|
@@ -19,6 +21,9 @@ async function migrate10Generator(tree, schema) {
|
|
|
19
21
|
return;
|
|
20
22
|
}
|
|
21
23
|
(0, calling_storybook_cli_1.callUpgrade)(schema);
|
|
24
|
+
if (schema.skipAiInstructions) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
22
27
|
const pathToAiInstructions = (0, path_1.join)(__dirname, 'files', 'ai-instructions-for-cjs-esm.md');
|
|
23
28
|
if (!(0, fs_1.existsSync)(pathToAiInstructions)) {
|
|
24
29
|
return;
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
"type": "array",
|
|
15
15
|
"description": "Directory(ies) where to load Storybook configurations from. Use this if you want to customize the Storybook projects you'd like to migrate.",
|
|
16
16
|
"default": []
|
|
17
|
+
},
|
|
18
|
+
"skipAiInstructions": {
|
|
19
|
+
"type": "boolean",
|
|
20
|
+
"description": "Skip writing the AI migration instructions file to `tools/ai-migrations/`.",
|
|
21
|
+
"default": false
|
|
17
22
|
}
|
|
18
23
|
},
|
|
19
24
|
"examplesFile": "../../../docs/migrate-10-generator-examples.md"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-9.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/generators/migrate-9/migrate-9.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,IAAI,EAAE,MAAM,YAAY,CAAC;AAWzD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"migrate-9.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/generators/migrate-9/migrate-9.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,IAAI,EAAE,MAAM,YAAY,CAAC;AAWzD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBA0CjE;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -5,7 +5,9 @@ const devkit_1 = require("@nx/devkit");
|
|
|
5
5
|
const output_1 = require("nx/src/utils/output");
|
|
6
6
|
const calling_storybook_cli_1 = require("./calling-storybook-cli");
|
|
7
7
|
const helper_functions_1 = require("./helper-functions");
|
|
8
|
+
const assert_supported_storybook_version_1 = require("../../utils/assert-supported-storybook-version");
|
|
8
9
|
async function migrate9Generator(tree, schema) {
|
|
10
|
+
(0, assert_supported_storybook_version_1.assertSupportedStorybookVersion)(tree);
|
|
9
11
|
schema.versionTag = schema.versionTag ?? 'latest';
|
|
10
12
|
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
11
13
|
if (!(0, helper_functions_1.checkStorybookInstalled)(packageJson)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-to-storybook-10.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/migrations/update-22-1-0/migrate-to-storybook-10.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"migrate-to-storybook-10.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/migrations/update-22-1-0/migrate-to-storybook-10.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAIlC,wBAA8B,oBAAoB,CAAC,IAAI,EAAE,IAAI,iBAc5D"}
|
|
@@ -16,9 +16,6 @@ async function migrateToStorybook10(tree) {
|
|
|
16
16
|
});
|
|
17
17
|
await (0, migrate_10_1.default)(tree, {
|
|
18
18
|
autoAcceptAllPrompts: true,
|
|
19
|
+
skipAiInstructions: true,
|
|
19
20
|
});
|
|
20
|
-
return [
|
|
21
|
-
`Storybook 10 requires Storybook Configs to use ESM.`,
|
|
22
|
-
`We created 'tools/ai-migrations/MIGRATE_STORYBOOK_10.md' with instructions for an AI Agent to convert CJS Storybook Configs to ESM in your workspace.`,
|
|
23
|
-
];
|
|
24
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/storybook/src/plugins/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/storybook/src/plugins/plugin.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,kBAAkB,EAIlB,aAAa,EAMd,MAAM,YAAY,CAAC;AAUpB,MAAM,WAAW,sBAAsB;IACrC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAID;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,sBAAsB,CA+D7D,CAAC;AAEF,eAAO,MAAM,aAAa,uCAAc,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNodesV2 = exports.createNodes = exports.createDependencies = void 0;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
6
|
const path_1 = require("path");
|
|
6
|
-
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
|
-
const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
|
|
9
8
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
10
9
|
const js_1 = require("@nx/js");
|
|
11
|
-
const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
|
|
12
10
|
const file_hasher_1 = require("nx/src/hasher/file-hasher");
|
|
13
11
|
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
14
|
-
const
|
|
15
|
-
function readTargetsCache(cachePath) {
|
|
16
|
-
return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|
|
17
|
-
}
|
|
18
|
-
function writeTargetsToCache(cachePath, results) {
|
|
19
|
-
(0, devkit_1.writeJsonFile)(cachePath, results);
|
|
20
|
-
}
|
|
12
|
+
const internal_2 = require("@nx/js/internal");
|
|
21
13
|
/**
|
|
22
14
|
* @deprecated The 'createDependencies' function is now a no-op. This functionality is included in 'createNodesV2'.
|
|
23
15
|
*/
|
|
@@ -32,18 +24,40 @@ exports.createNodes = [
|
|
|
32
24
|
const normalizedOptions = normalizeOptions(options);
|
|
33
25
|
const optionsHash = (0, file_hasher_1.hashObject)(normalizedOptions);
|
|
34
26
|
const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `storybook-${optionsHash}.hash`);
|
|
35
|
-
const targetsCache =
|
|
36
|
-
const
|
|
27
|
+
const targetsCache = new internal_1.PluginCache(cachePath);
|
|
28
|
+
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
29
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
30
|
+
const lockFileName = (0, js_1.getLockFileName)(packageManager);
|
|
37
31
|
try {
|
|
38
|
-
|
|
32
|
+
const { entries, preErrors } = await filterStorybookConfigs(configFilePaths, context);
|
|
33
|
+
const projectHashes = await (0, internal_1.calculateHashesForCreateNodes)(entries.map((e) => e.projectRoot), normalizedOptions, context, entries.map(() => [lockFileName]));
|
|
34
|
+
let results = [];
|
|
35
|
+
let nodeErrors = [];
|
|
36
|
+
try {
|
|
37
|
+
results = await (0, devkit_1.createNodesFromFiles)((configFile, _, ctx, idx) => createNodesInternal(configFile, normalizedOptions, ctx, targetsCache, pmc, entries[idx].projectRoot, projectHashes[idx]), entries.map((e) => e.configFile), normalizedOptions, context);
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
if (e instanceof devkit_1.AggregateCreateNodesError) {
|
|
41
|
+
results = e.partialResults ?? [];
|
|
42
|
+
nodeErrors = e.errors;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
throw e;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const allErrors = [...preErrors, ...nodeErrors];
|
|
49
|
+
if (allErrors.length > 0) {
|
|
50
|
+
throw new devkit_1.AggregateCreateNodesError(allErrors, results);
|
|
51
|
+
}
|
|
52
|
+
return results;
|
|
39
53
|
}
|
|
40
54
|
finally {
|
|
41
|
-
|
|
55
|
+
targetsCache.writeToDisk();
|
|
42
56
|
}
|
|
43
57
|
},
|
|
44
58
|
];
|
|
45
59
|
exports.createNodesV2 = exports.createNodes;
|
|
46
|
-
|
|
60
|
+
function getProjectRootFromConfigPath(configFilePath) {
|
|
47
61
|
let projectRoot = '';
|
|
48
62
|
if (configFilePath.includes('/.storybook')) {
|
|
49
63
|
projectRoot = (0, path_1.dirname)(configFilePath).replace('/.storybook', '');
|
|
@@ -54,20 +68,18 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
|
|
|
54
68
|
if (projectRoot === '') {
|
|
55
69
|
projectRoot = '.';
|
|
56
70
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
!siblingFiles.includes('project.json')) {
|
|
61
|
-
return {};
|
|
62
|
-
}
|
|
63
|
-
const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, context, [(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
|
|
71
|
+
return projectRoot;
|
|
72
|
+
}
|
|
73
|
+
async function createNodesInternal(configFilePath, options, context, targetsCache, pmc, projectRoot, hash) {
|
|
64
74
|
const projectName = buildProjectName(projectRoot, context.workspaceRoot);
|
|
65
|
-
targetsCache
|
|
75
|
+
if (!targetsCache.has(hash)) {
|
|
76
|
+
targetsCache.set(hash, await buildStorybookTargets(configFilePath, projectRoot, options, context, projectName, pmc));
|
|
77
|
+
}
|
|
66
78
|
const result = {
|
|
67
79
|
projects: {
|
|
68
80
|
[projectRoot]: {
|
|
69
81
|
root: projectRoot,
|
|
70
|
-
targets: targetsCache
|
|
82
|
+
targets: targetsCache.get(hash),
|
|
71
83
|
},
|
|
72
84
|
},
|
|
73
85
|
};
|
|
@@ -75,7 +87,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
|
|
|
75
87
|
}
|
|
76
88
|
async function buildStorybookTargets(configFilePath, projectRoot, options, context, projectName, pmc) {
|
|
77
89
|
const buildOutputs = getOutputs();
|
|
78
|
-
const namedInputs = (0,
|
|
90
|
+
const namedInputs = (0, internal_1.getNamedInputs)(projectRoot, context);
|
|
79
91
|
// First attempt to do a very fast lookup for the framework
|
|
80
92
|
// If that fails, the framework might be inherited, so do a very heavyweight lookup
|
|
81
93
|
const storybookFramework = (await getStorybookFramework(configFilePath, context)) ||
|
|
@@ -91,7 +103,7 @@ async function buildStorybookTargets(configFilePath, projectRoot, options, conte
|
|
|
91
103
|
targets[options.testStorybookTargetName] = testTarget(projectRoot);
|
|
92
104
|
}
|
|
93
105
|
targets[options.staticStorybookTargetName] = serveStaticTarget(options, projectRoot);
|
|
94
|
-
(0,
|
|
106
|
+
(0, internal_2.addBuildAndWatchDepsTargets)(context.workspaceRoot, projectRoot, targets, options, pmc);
|
|
95
107
|
return targets;
|
|
96
108
|
}
|
|
97
109
|
function buildTarget(namedInputs, outputs, projectRoot, frameworkIsAngular, projectName, configFilePath) {
|
|
@@ -220,7 +232,7 @@ function parseFrameworkName(mainTsJs) {
|
|
|
220
232
|
}
|
|
221
233
|
async function getStorybookFullyResolvedFramework(configFilePath, context) {
|
|
222
234
|
const resolvedPath = (0, path_1.join)(context.workspaceRoot, configFilePath);
|
|
223
|
-
const { framework } = await (0,
|
|
235
|
+
const { framework } = await (0, internal_1.loadConfigFile)(resolvedPath);
|
|
224
236
|
return typeof framework === 'string' ? framework : framework.name;
|
|
225
237
|
}
|
|
226
238
|
function getOutputs() {
|
|
@@ -232,6 +244,28 @@ function getOutputs() {
|
|
|
232
244
|
];
|
|
233
245
|
return outputs;
|
|
234
246
|
}
|
|
247
|
+
async function filterStorybookConfigs(configFiles, context) {
|
|
248
|
+
const preErrors = [];
|
|
249
|
+
const candidates = await Promise.all(configFiles.map(async (configFile) => {
|
|
250
|
+
try {
|
|
251
|
+
const projectRoot = getProjectRootFromConfigPath(configFile);
|
|
252
|
+
const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
|
|
253
|
+
if (!siblingFiles.includes('package.json') &&
|
|
254
|
+
!siblingFiles.includes('project.json')) {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
return { configFile, projectRoot };
|
|
258
|
+
}
|
|
259
|
+
catch (e) {
|
|
260
|
+
preErrors.push([configFile, e]);
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
}));
|
|
264
|
+
return {
|
|
265
|
+
entries: candidates.filter((c) => c !== null),
|
|
266
|
+
preErrors,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
235
269
|
function normalizeOptions(options) {
|
|
236
270
|
return {
|
|
237
271
|
buildStorybookTargetName: options.buildStorybookTargetName ?? 'build-storybook',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-supported-storybook-version.d.ts","sourceRoot":"","sources":["../../../../../packages/storybook/src/utils/assert-supported-storybook-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAIvC,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAMhE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertSupportedStorybookVersion = assertSupportedStorybookVersion;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
|
+
const versions_1 = require("./versions");
|
|
6
|
+
function assertSupportedStorybookVersion(tree) {
|
|
7
|
+
(0, internal_1.assertSupportedPackageVersion)(tree, 'storybook', versions_1.minSupportedStorybookVersion);
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const STORYBOOK_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/storybook:storybook` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/storybook:convert-to-inferred` to migrate to the `@nx/storybook/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.";
|
|
2
|
+
export declare const STORYBOOK_BUILD_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/storybook:build` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/storybook:convert-to-inferred` to migrate to the `@nx/storybook/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.";
|
|
3
|
+
export declare function warnStorybookExecutorDeprecation(): void;
|
|
4
|
+
export declare function warnStorybookBuildExecutorDeprecation(): void;
|
|
5
|
+
export declare function warnStorybookExecutorGenerating(): void;
|
|
6
|
+
//# sourceMappingURL=deprecation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecation.d.ts","sourceRoot":"","sources":["../../../../../packages/storybook/src/utils/deprecation.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,sCAAsC,+QAC2N,CAAC;AAE/Q,eAAO,MAAM,4CAA4C,2QACiN,CAAC;AAE3Q,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AAED,wBAAgB,qCAAqC,IAAI,IAAI,CAE5D;AAED,wBAAgB,+BAA+B,IAAI,IAAI,CAItD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.STORYBOOK_BUILD_EXECUTOR_DEPRECATION_MESSAGE = exports.STORYBOOK_EXECUTOR_DEPRECATION_MESSAGE = void 0;
|
|
4
|
+
exports.warnStorybookExecutorDeprecation = warnStorybookExecutorDeprecation;
|
|
5
|
+
exports.warnStorybookBuildExecutorDeprecation = warnStorybookBuildExecutorDeprecation;
|
|
6
|
+
exports.warnStorybookExecutorGenerating = warnStorybookExecutorGenerating;
|
|
7
|
+
const devkit_1 = require("@nx/devkit");
|
|
8
|
+
// TODO(v24): Remove the @nx/storybook:storybook and @nx/storybook:build
|
|
9
|
+
// executors. The inferred plugin (@nx/storybook/plugin) and the
|
|
10
|
+
// convert-to-inferred generator stay supported.
|
|
11
|
+
exports.STORYBOOK_EXECUTOR_DEPRECATION_MESSAGE = 'The `@nx/storybook:storybook` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/storybook:convert-to-inferred` to migrate to the `@nx/storybook/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.';
|
|
12
|
+
exports.STORYBOOK_BUILD_EXECUTOR_DEPRECATION_MESSAGE = 'The `@nx/storybook:build` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/storybook:convert-to-inferred` to migrate to the `@nx/storybook/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.';
|
|
13
|
+
function warnStorybookExecutorDeprecation() {
|
|
14
|
+
devkit_1.logger.warn(exports.STORYBOOK_EXECUTOR_DEPRECATION_MESSAGE);
|
|
15
|
+
}
|
|
16
|
+
function warnStorybookBuildExecutorDeprecation() {
|
|
17
|
+
devkit_1.logger.warn(exports.STORYBOOK_BUILD_EXECUTOR_DEPRECATION_MESSAGE);
|
|
18
|
+
}
|
|
19
|
+
function warnStorybookExecutorGenerating() {
|
|
20
|
+
devkit_1.logger.warn('Generating targets that use the deprecated `@nx/storybook:storybook` and `@nx/storybook:build` executors. These executors will be removed in Nx v24. Run `nx g @nx/storybook:convert-to-inferred` next to migrate these targets to the `@nx/storybook/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
|
|
21
|
+
}
|
package/src/utils/utilities.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TargetConfiguration, Tree } from '@nx/devkit';
|
|
2
2
|
import { CompilerOptions } from 'typescript';
|
|
3
3
|
import ts = require('typescript');
|
|
4
|
+
export { storybookMajorVersion, getInstalledStorybookVersion, } from './versions';
|
|
4
5
|
export declare const Constants: {
|
|
5
6
|
addonDependencies: string[];
|
|
6
7
|
tsConfigExclusions: string[];
|
|
@@ -9,11 +10,8 @@ export declare const Constants: {
|
|
|
9
10
|
};
|
|
10
11
|
jsonIndentLevel: number;
|
|
11
12
|
coreAddonPrefix: string;
|
|
12
|
-
uiFrameworks7: string[];
|
|
13
13
|
};
|
|
14
14
|
export declare function getStorybookVersionToInstall(tree: Tree): string;
|
|
15
|
-
export declare function storybookMajorVersion(tree?: Tree): number | undefined;
|
|
16
|
-
export declare function getInstalledStorybookVersion(tree?: Tree): string | undefined;
|
|
17
15
|
export declare function safeFileDelete(tree: Tree, path: string): boolean;
|
|
18
16
|
export type TsConfig = {
|
|
19
17
|
extends: string;
|
|
@@ -40,5 +38,4 @@ export declare function findStorybookAndBuildTargetsAndCompiler(targets: {
|
|
|
40
38
|
};
|
|
41
39
|
export declare function isTheFileAStory(tree: Tree, path: string): boolean;
|
|
42
40
|
export declare function getTsSourceFile(host: Tree, path: string): ts.SourceFile;
|
|
43
|
-
export declare function pleaseUpgrade(): string;
|
|
44
41
|
//# sourceMappingURL=utilities.d.ts.map
|