@nx/storybook 23.0.0-beta.1 → 23.0.0-beta.11

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.
Files changed (27) hide show
  1. package/package.json +8 -8
  2. package/src/executors/build-storybook/build-storybook.impl.d.ts.map +1 -1
  3. package/src/executors/build-storybook/build-storybook.impl.js +2 -0
  4. package/src/executors/build-storybook/schema.json +1 -0
  5. package/src/executors/storybook/schema.json +1 -0
  6. package/src/executors/storybook/storybook.impl.d.ts.map +1 -1
  7. package/src/executors/storybook/storybook.impl.js +2 -0
  8. package/src/generators/configuration/configuration.d.ts.map +1 -1
  9. package/src/generators/configuration/configuration.js +2 -0
  10. package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +1 -1
  11. package/src/generators/convert-to-inferred/convert-to-inferred.js +4 -5
  12. package/src/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts +1 -1
  13. package/src/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts.map +1 -1
  14. package/src/generators/convert-to-inferred/lib/build-post-target-transformer.js +5 -5
  15. package/src/generators/convert-to-inferred/lib/serve-post-target-transformer.d.ts +1 -1
  16. package/src/generators/convert-to-inferred/lib/serve-post-target-transformer.d.ts.map +1 -1
  17. package/src/generators/convert-to-inferred/lib/serve-post-target-transformer.js +3 -3
  18. package/src/generators/convert-to-inferred/lib/utils.d.ts +1 -1
  19. package/src/generators/convert-to-inferred/lib/utils.d.ts.map +1 -1
  20. package/src/generators/convert-to-inferred/lib/utils.js +6 -6
  21. package/src/generators/init/init.d.ts.map +1 -1
  22. package/src/generators/init/init.js +2 -2
  23. package/src/plugins/plugin.d.ts.map +1 -1
  24. package/src/plugins/plugin.js +15 -19
  25. package/src/utils/deprecation.d.ts +6 -0
  26. package/src/utils/deprecation.d.ts.map +1 -0
  27. package/src/utils/deprecation.js +21 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/storybook",
3
- "version": "23.0.0-beta.1",
3
+ "version": "23.0.0-beta.11",
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": {
@@ -34,20 +34,20 @@
34
34
  "migrations": "./migrations.json"
35
35
  },
36
36
  "dependencies": {
37
- "@nx/devkit": "23.0.0-beta.1",
38
- "@phenomnomnominal/tsquery": "~6.1.4",
37
+ "@nx/devkit": "23.0.0-beta.11",
38
+ "@phenomnomnominal/tsquery": "~6.2.0",
39
39
  "semver": "^7.6.3",
40
40
  "tslib": "^2.3.0",
41
- "@nx/cypress": "23.0.0-beta.1",
42
- "@nx/js": "23.0.0-beta.1",
43
- "@nx/eslint": "23.0.0-beta.1"
41
+ "@nx/cypress": "23.0.0-beta.11",
42
+ "@nx/js": "23.0.0-beta.11",
43
+ "@nx/eslint": "23.0.0-beta.11"
44
44
  },
45
45
  "devDependencies": {
46
- "nx": "23.0.0-beta.1",
46
+ "nx": "23.0.0-beta.11",
47
47
  "storybook": "9.0.6"
48
48
  },
49
49
  "peerDependencies": {
50
- "@nx/web": "23.0.0-beta.1",
50
+ "@nx/web": "23.0.0-beta.11",
51
51
  "storybook": ">=7.0.0 <11.0.0"
52
52
  },
53
53
  "peerDependenciesMeta": {
@@ -1 +1 @@
1
- {"version":3,"file":"build-storybook.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/executors/build-storybook/build-storybook.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAS3D,wBAA8B,sBAAsB,CAClD,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,eAAe;;GAczB"}
1
+ {"version":3,"file":"build-storybook.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/executors/build-storybook/build-storybook.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAU3D,wBAA8B,sBAAsB,CAClD,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,eAAe;;GAgBzB"}
@@ -37,7 +37,9 @@ exports.default = buildStorybookExecutor;
37
37
  const devkit_1 = require("@nx/devkit");
38
38
  const utilities_1 = require("../../utils/utilities");
39
39
  const semver_1 = require("semver");
40
+ const deprecation_1 = require("../../utils/deprecation");
40
41
  async function buildStorybookExecutor(options, context) {
42
+ (0, deprecation_1.warnStorybookBuildExecutorDeprecation)();
41
43
  (0, utilities_1.storybookConfigExistsCheck)(options.configDir, context.projectName);
42
44
  const storybookMajor = (0, utilities_1.storybookMajorVersion)();
43
45
  if (storybookMajor > 0 && storybookMajor <= 7) {
@@ -5,6 +5,7 @@
5
5
  "cli": "nx",
6
6
  "description": "Build storybook in production mode.",
7
7
  "type": "object",
8
+ "x-deprecated": "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 plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
8
9
  "presets": [
9
10
  {
10
11
  "name": "Default minimum setup",
@@ -6,6 +6,7 @@
6
6
  "cli": "nx",
7
7
  "description": "Serve up Storybook in development mode.",
8
8
  "type": "object",
9
+ "x-deprecated": "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 plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
9
10
  "presets": [
10
11
  {
11
12
  "name": "Default minimum setup",
@@ -1 +1 @@
1
- {"version":3,"file":"storybook.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/executors/storybook/storybook.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AAOrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,wBAA+B,iBAAiB,CAC9C,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,eAAe,GACvB,cAAc,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C,CAAC,CAmBD"}
1
+ {"version":3,"file":"storybook.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/executors/storybook/storybook.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AAOrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAI3D,wBAA+B,iBAAiB,CAC9C,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,eAAe,GACvB,cAAc,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C,CAAC,CAqBD"}
@@ -36,7 +36,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.default = storybookExecutor;
37
37
  const utilities_1 = require("../../utils/utilities");
38
38
  const semver_1 = require("semver");
39
+ const deprecation_1 = require("../../utils/deprecation");
39
40
  async function* storybookExecutor(options, context) {
41
+ (0, deprecation_1.warnStorybookExecutorDeprecation)();
40
42
  const storybookMajor = (0, utilities_1.storybookMajorVersion)();
41
43
  if (storybookMajor > 0 && storybookMajor <= 7) {
42
44
  throw (0, utilities_1.pleaseUpgrade)();
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAKjB,IAAI,EACL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAuCpD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,wBAAwB,8BAGjC;AAED,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,wBAAwB,8BA4KpC;AAwBD,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAKjB,IAAI,EACL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAwCpD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,wBAAwB,8BAGjC;AAED,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,wBAAwB,8BA6KpC;AAwBD,eAAe,sBAAsB,CAAC"}
@@ -5,6 +5,7 @@ exports.configurationGeneratorInternal = configurationGeneratorInternal;
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const js_1 = require("@nx/js");
7
7
  const init_1 = require("../init/init");
8
+ const deprecation_1 = require("../../utils/deprecation");
8
9
  const util_functions_1 = require("./lib/util-functions");
9
10
  const utilities_1 = require("../../utils/utilities");
10
11
  const versions_1 = require("../../utils/versions");
@@ -82,6 +83,7 @@ async function configurationGeneratorInternal(tree, rawSchema) {
82
83
  }
83
84
  let devDeps = {};
84
85
  if (!hasPlugin || schema.addExplicitTargets) {
86
+ (0, deprecation_1.warnStorybookExecutorGenerating)();
85
87
  if (schema.uiFramework === '@storybook/angular') {
86
88
  (0, util_functions_1.addAngularStorybookTarget)(tree, schema.project, schema.interactionTests);
87
89
  }
@@ -1 +1 @@
1
- {"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAWpB,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mDAkDlE;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"AAKA,OAAO,EAKL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAMpB,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mDAkDlE;AAED,eAAe,iBAAiB,CAAC"}
@@ -1,17 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.convertToInferred = convertToInferred;
4
+ const internal_1 = require("@nx/devkit/internal");
4
5
  const devkit_1 = require("@nx/devkit");
5
- const aggregate_log_util_1 = require("@nx/devkit/src/generators/plugin-migrations/aggregate-log-util");
6
- const executor_to_plugin_migrator_1 = require("@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator");
7
6
  const build_post_target_transformer_1 = require("./lib/build-post-target-transformer");
8
7
  const serve_post_target_transformer_1 = require("./lib/serve-post-target-transformer");
9
8
  const plugin_1 = require("../../plugins/plugin");
10
9
  const versions_1 = require("../../utils/versions");
11
10
  async function convertToInferred(tree, options) {
12
11
  const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
13
- const migrationLogs = new aggregate_log_util_1.AggregatedLog();
14
- const migratedProjects = await (0, executor_to_plugin_migrator_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/storybook/plugin', plugin_1.createNodesV2, {
12
+ const migrationLogs = new internal_1.AggregatedLog();
13
+ const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/storybook/plugin', plugin_1.createNodesV2, {
15
14
  buildStorybookTargetName: 'build-storybook',
16
15
  serveStorybookTargetName: 'storybook',
17
16
  staticStorybookTargetName: 'static-storybook',
@@ -33,7 +32,7 @@ async function convertToInferred(tree, options) {
33
32
  },
34
33
  ], options.project);
35
34
  if (migratedProjects.size === 0) {
36
- throw new executor_to_plugin_migrator_1.NoTargetsToMigrateError();
35
+ throw new internal_1.NoTargetsToMigrateError();
37
36
  }
38
37
  if (!options.skipFormat) {
39
38
  await (0, devkit_1.formatFiles)(tree);
@@ -1,5 +1,5 @@
1
1
  import { TargetConfiguration, Tree } from '@nx/devkit';
2
- import { AggregatedLog } from '@nx/devkit/src/generators/plugin-migrations/aggregate-log-util';
2
+ import { AggregatedLog } from '@nx/devkit/internal';
3
3
  export declare function buildPostTargetTransformer(migrationLogs: AggregatedLog): (target: TargetConfiguration, tree: Tree, projectDetails: {
4
4
  projectName: string;
5
5
  root: string;
@@ -1 +1 @@
1
- {"version":3,"file":"build-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/storybook/src/generators/convert-to-inferred/lib/build-post-target-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,mBAAmB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAM1E,OAAO,EAAE,aAAa,EAAE,MAAM,gEAAgE,CAAC;AAW/F,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,aAAa,IAEnE,QAAQ,mBAAmB,EAC3B,MAAM,IAAI,EACV,gBAAgB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACrD,6BAA6B,mBAAmB,8BAgHnD"}
1
+ {"version":3,"file":"build-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/storybook/src/generators/convert-to-inferred/lib/build-post-target-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,mBAAmB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAGL,aAAa,EACd,MAAM,qBAAqB,CAAC;AAY7B,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,aAAa,IAEnE,QAAQ,mBAAmB,EAC3B,MAAM,IAAI,EACV,gBAAgB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACrD,6BAA6B,mBAAmB,8BAgHnD"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildPostTargetTransformer = buildPostTargetTransformer;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const plugin_migration_utils_1 = require("@nx/devkit/src/generators/plugin-migrations/plugin-migration-utils");
5
+ const internal_1 = require("@nx/devkit/internal");
6
6
  const tsquery_1 = require("@phenomnomnominal/tsquery");
7
7
  const utils_1 = require("./utils");
8
8
  const utils_2 = require("./utils");
@@ -28,7 +28,7 @@ function buildPostTargetTransformer(migrationLogs) {
28
28
  const configuration = target.configurations[configurationName];
29
29
  if (configuration.configDir &&
30
30
  configuration.configDir !==
31
- (0, plugin_migration_utils_1.toProjectRelativePath)(defaultConfigDir, projectDetails.root)) {
31
+ (0, internal_1.toProjectRelativePath)(defaultConfigDir, projectDetails.root)) {
32
32
  const configFilePath = (0, utils_1.getConfigFilePath)(tree, (0, devkit_1.joinPathFragments)(projectDetails.root, configuration.configDir));
33
33
  (0, utils_1.addConfigValuesToConfigFile)(tree, configFilePath, configValues);
34
34
  (0, utils_1.ensureViteConfigPathIsRelative)(tree, configFilePath, projectDetails.projectName, projectDetails.root, '@nx/storybook:build', migrationLogs);
@@ -50,7 +50,7 @@ function buildPostTargetTransformer(migrationLogs) {
50
50
  }
51
51
  }
52
52
  if (target.outputs) {
53
- (0, plugin_migration_utils_1.processTargetOutputs)(target, [{ newName: 'output-dir', oldName: 'outputDir' }], inferredTargetConfiguration, {
53
+ (0, internal_1.processTargetOutputs)(target, [{ newName: 'output-dir', oldName: 'outputDir' }], inferredTargetConfiguration, {
54
54
  projectName: projectDetails.projectName,
55
55
  projectRoot: projectDetails.root,
56
56
  });
@@ -66,10 +66,10 @@ function handlePropertiesFromTargetOptions(tree, options, defaultConfigDir, proj
66
66
  if (options.configDir !== defaultConfigDir) {
67
67
  configDir = options.configDir;
68
68
  }
69
- options.configDir = (0, plugin_migration_utils_1.toProjectRelativePath)(options.configDir, projectRoot);
69
+ options.configDir = (0, internal_1.toProjectRelativePath)(options.configDir, projectRoot);
70
70
  }
71
71
  if (options.outputDir) {
72
- options.outputDir = (0, plugin_migration_utils_1.toProjectRelativePath)(options.outputDir, projectRoot);
72
+ options.outputDir = (0, internal_1.toProjectRelativePath)(options.outputDir, projectRoot);
73
73
  }
74
74
  if ('styles' in options) {
75
75
  delete options.styles;
@@ -1,5 +1,5 @@
1
1
  import { TargetConfiguration, Tree } from '@nx/devkit';
2
- import { AggregatedLog } from '@nx/devkit/src/generators/plugin-migrations/aggregate-log-util';
2
+ import { AggregatedLog } from '@nx/devkit/internal';
3
3
  export declare function servePostTargetTransformer(migrationLogs: AggregatedLog): (target: TargetConfiguration, tree: Tree, projectDetails: {
4
4
  projectName: string;
5
5
  root: string;
@@ -1 +1 @@
1
- {"version":3,"file":"serve-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/storybook/src/generators/convert-to-inferred/lib/serve-post-target-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,mBAAmB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,gEAAgE,CAAC;AAQ/F,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,aAAa,IAEnE,QAAQ,mBAAmB,EAC3B,MAAM,IAAI,EACV,gBAAgB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACrD,6BAA6B,mBAAmB,8BAyEnD"}
1
+ {"version":3,"file":"serve-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/storybook/src/generators/convert-to-inferred/lib/serve-post-target-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,mBAAmB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAyB,MAAM,qBAAqB,CAAC;AAO3E,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,aAAa,IAEnE,QAAQ,mBAAmB,EAC3B,MAAM,IAAI,EACV,gBAAgB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACrD,6BAA6B,mBAAmB,8BAyEnD"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.servePostTargetTransformer = servePostTargetTransformer;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const plugin_migration_utils_1 = require("@nx/devkit/src/generators/plugin-migrations/plugin-migration-utils");
5
+ const internal_1 = require("@nx/devkit/internal");
6
6
  const utils_1 = require("./utils");
7
7
  function servePostTargetTransformer(migrationLogs) {
8
8
  return (target, tree, projectDetails, inferredTargetConfiguration) => {
@@ -39,10 +39,10 @@ function servePostTargetTransformer(migrationLogs) {
39
39
  }
40
40
  function handlePropertiesFromTargetOptions(tree, options, projectName, projectRoot, migrationLogs) {
41
41
  if ('configDir' in options) {
42
- options.configDir = (0, plugin_migration_utils_1.toProjectRelativePath)(options.configDir, projectRoot);
42
+ options.configDir = (0, internal_1.toProjectRelativePath)(options.configDir, projectRoot);
43
43
  }
44
44
  if (options.outputDir) {
45
- options.outputDir = (0, plugin_migration_utils_1.toProjectRelativePath)(options.outputDir, projectRoot);
45
+ options.outputDir = (0, internal_1.toProjectRelativePath)(options.outputDir, projectRoot);
46
46
  }
47
47
  if ('uiFramework' in options) {
48
48
  delete options.uiFramework;
@@ -1,5 +1,5 @@
1
1
  import { type Tree } from '@nx/devkit';
2
- import { AggregatedLog } from '@nx/devkit/src/generators/plugin-migrations/aggregate-log-util';
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
5
  export declare const STORYBOOK_PROP_MAPPINGS: {
@@ -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,EAA+B,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,gEAAgE,CAAC;AAK/F,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;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCnC,CAAC;AAEF,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,CAKf;AAED,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM;;;EAIzE"}
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;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCnC,CAAC;AAEF,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"}
@@ -8,7 +8,7 @@ exports.getInstalledPackageVersion = getInstalledPackageVersion;
8
8
  exports.getInstalledPackageVersionInfo = getInstalledPackageVersionInfo;
9
9
  const tsquery_1 = require("@phenomnomnominal/tsquery");
10
10
  const devkit_1 = require("@nx/devkit");
11
- const plugin_migration_utils_1 = require("@nx/devkit/src/generators/plugin-migrations/plugin-migration-utils");
11
+ const internal_1 = require("@nx/devkit/internal");
12
12
  const semver_1 = require("semver");
13
13
  function getConfigFilePath(tree, configDir) {
14
14
  return [
@@ -122,15 +122,15 @@ function ensureViteConfigPathIsRelative(tree, configPath, projectName, projectRo
122
122
  if (pathToViteConfig.match(/^(\.\.\/|\.\/)/)) {
123
123
  return;
124
124
  }
125
- const relativePathToViteConfig = (0, plugin_migration_utils_1.toProjectRelativePath)(pathToViteConfig, projectRoot);
125
+ const relativePathToViteConfig = (0, internal_1.toProjectRelativePath)(pathToViteConfig, projectRoot);
126
126
  tree.write(configPath, `${configFileContents.slice(0, viteConfigPathNode.getStart() + 1)}${relativePathToViteConfig}${configFileContents.slice(viteConfigPathNode.getEnd() - 1)}`);
127
127
  }
128
128
  function getInstalledPackageVersion(tree, pkgName) {
129
- const { dependencies, devDependencies } = (0, devkit_1.readJson)(tree, 'package.json');
130
- const version = dependencies?.[pkgName] ?? devDependencies?.[pkgName];
131
- return version;
129
+ // resolves pnpm catalog: refs (and yarn catalog refs)
130
+ return (0, devkit_1.getDependencyVersionFromPackageJson)(tree, pkgName);
132
131
  }
133
132
  function getInstalledPackageVersionInfo(tree, pkgName) {
134
133
  const version = getInstalledPackageVersion(tree, pkgName);
135
- return version ? { major: (0, semver_1.major)((0, semver_1.coerce)(version)), version } : null;
134
+ const coerced = version ? (0, semver_1.coerce)(version) : null;
135
+ return coerced ? { major: (0, semver_1.major)(coerced), version } : null;
136
136
  }
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/storybook/src/generators/init/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAIjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAUpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AA8DlC,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAEvD;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAiErE;AAED,eAAe,aAAa,CAAC"}
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;AASpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AA8DlC,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAEvD;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAiErE;AAED,eAAe,aAAa,CAAC"}
@@ -2,8 +2,8 @@
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");
@@ -52,7 +52,7 @@ async function initGeneratorInternal(tree, schema) {
52
52
  nxJson.useInferencePlugins !== false;
53
53
  schema.addPlugin ??= addPluginDefault;
54
54
  if (schema.addPlugin) {
55
- await (0, add_plugin_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/storybook/plugin', plugin_1.createNodesV2, {
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":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/storybook/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAGlB,aAAa,EAQd,MAAM,YAAY,CAAC;AAapB,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;AAeD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,sBAAsB,CAgC7D,CAAC;AAEF,eAAO,MAAM,aAAa,uCAAc,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/storybook/src/plugins/plugin.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,kBAAkB,EAGlB,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,CAiC7D,CAAC;AAEF,eAAO,MAAM,aAAa,uCAAc,CAAC"}
@@ -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
12
  const util_1 = require("@nx/js/src/plugins/typescript/util");
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
- }
21
13
  /**
22
14
  * @deprecated The 'createDependencies' function is now a no-op. This functionality is included in 'createNodesV2'.
23
15
  */
@@ -32,18 +24,20 @@ 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 = readTargetsCache(cachePath);
36
- const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
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
- return await (0, devkit_1.createNodesFromFiles)((configFile, _, context) => createNodesInternal(configFile, normalizedOptions, context, targetsCache, pmc), configFilePaths, normalizedOptions, context);
32
+ return await (0, devkit_1.createNodesFromFiles)((configFile, _, context) => createNodesInternal(configFile, normalizedOptions, context, targetsCache, pmc, lockFileName), configFilePaths, normalizedOptions, context);
39
33
  }
40
34
  finally {
41
- writeTargetsToCache(cachePath, targetsCache);
35
+ targetsCache.writeToDisk();
42
36
  }
43
37
  },
44
38
  ];
45
39
  exports.createNodesV2 = exports.createNodes;
46
- async function createNodesInternal(configFilePath, options, context, targetsCache, pmc) {
40
+ async function createNodesInternal(configFilePath, options, context, targetsCache, pmc, lockFileName) {
47
41
  let projectRoot = '';
48
42
  if (configFilePath.includes('/.storybook')) {
49
43
  projectRoot = (0, path_1.dirname)(configFilePath).replace('/.storybook', '');
@@ -60,14 +54,16 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
60
54
  !siblingFiles.includes('project.json')) {
61
55
  return {};
62
56
  }
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))]);
57
+ const hash = await (0, internal_1.calculateHashForCreateNodes)(projectRoot, options, context, [lockFileName]);
64
58
  const projectName = buildProjectName(projectRoot, context.workspaceRoot);
65
- targetsCache[hash] ??= await buildStorybookTargets(configFilePath, projectRoot, options, context, projectName, pmc);
59
+ if (!targetsCache.has(hash)) {
60
+ targetsCache.set(hash, await buildStorybookTargets(configFilePath, projectRoot, options, context, projectName, pmc));
61
+ }
66
62
  const result = {
67
63
  projects: {
68
64
  [projectRoot]: {
69
65
  root: projectRoot,
70
- targets: targetsCache[hash],
66
+ targets: targetsCache.get(hash),
71
67
  },
72
68
  },
73
69
  };
@@ -75,7 +71,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
75
71
  }
76
72
  async function buildStorybookTargets(configFilePath, projectRoot, options, context, projectName, pmc) {
77
73
  const buildOutputs = getOutputs();
78
- const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
74
+ const namedInputs = (0, internal_1.getNamedInputs)(projectRoot, context);
79
75
  // First attempt to do a very fast lookup for the framework
80
76
  // If that fails, the framework might be inherited, so do a very heavyweight lookup
81
77
  const storybookFramework = (await getStorybookFramework(configFilePath, context)) ||
@@ -220,7 +216,7 @@ function parseFrameworkName(mainTsJs) {
220
216
  }
221
217
  async function getStorybookFullyResolvedFramework(configFilePath, context) {
222
218
  const resolvedPath = (0, path_1.join)(context.workspaceRoot, configFilePath);
223
- const { framework } = await (0, config_utils_1.loadConfigFile)(resolvedPath);
219
+ const { framework } = await (0, internal_1.loadConfigFile)(resolvedPath);
224
220
  return typeof framework === 'string' ? framework : framework.name;
225
221
  }
226
222
  function getOutputs() {
@@ -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
+ }