@nx/devkit 23.0.0-pr.35465.2bc2643 → 23.0.0-rc.0

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 (195) hide show
  1. package/{index.d.ts → dist/index.d.ts} +0 -1
  2. package/dist/internal.d.ts +24 -0
  3. package/dist/internal.js +85 -0
  4. package/{ngcli-adapter.d.ts → dist/ngcli-adapter.d.ts} +0 -1
  5. package/{public-api.d.ts → dist/public-api.d.ts} +0 -1
  6. package/{src → dist/src}/executors/parse-target-string.d.ts +0 -1
  7. package/{src → dist/src}/executors/read-target-options.d.ts +0 -1
  8. package/{src → dist/src}/generators/artifact-name-and-directory-utils.d.ts +0 -1
  9. package/{src → dist/src}/generators/e2e-web-server-info-utils.d.ts +0 -1
  10. package/{src → dist/src}/generators/e2e-web-server-info-utils.js +8 -12
  11. package/{src → dist/src}/generators/executor-options-utils.d.ts +0 -1
  12. package/{src → dist/src}/generators/format-files.d.ts +0 -1
  13. package/{src → dist/src}/generators/format-files.js +1 -1
  14. package/{src → dist/src}/generators/generate-files.d.ts +0 -1
  15. package/{src → dist/src}/generators/plugin-migrations/aggregate-log-util.d.ts +0 -1
  16. package/{src → dist/src}/generators/plugin-migrations/executor-to-plugin-migrator.d.ts +4 -4
  17. package/{src → dist/src}/generators/plugin-migrations/executor-to-plugin-migrator.js +19 -1
  18. package/{src → dist/src}/generators/plugin-migrations/plugin-migration-utils.d.ts +0 -1
  19. package/{src → dist/src}/generators/project-name-and-root-utils.d.ts +0 -1
  20. package/{src → dist/src}/generators/prompt.d.ts +0 -1
  21. package/{src → dist/src}/generators/run-tasks-in-serial.d.ts +0 -1
  22. package/dist/src/generators/target-defaults-utils.d.ts +31 -0
  23. package/dist/src/generators/target-defaults-utils.js +224 -0
  24. package/{src → dist/src}/generators/to-js.d.ts +0 -1
  25. package/{src → dist/src}/generators/to-js.js +9 -4
  26. package/{src → dist/src}/generators/typescript/insert-import.d.ts +0 -1
  27. package/{src → dist/src}/generators/typescript/insert-statement.d.ts +0 -1
  28. package/{src → dist/src}/generators/update-ts-configs-to-js.d.ts +0 -1
  29. package/{src → dist/src}/generators/visit-not-ignored-files.d.ts +0 -1
  30. package/dist/src/migrations/update-23-0-0/rename-create-nodes-v2-types.d.ts +10 -0
  31. package/dist/src/migrations/update-23-0-0/rename-create-nodes-v2-types.js +199 -0
  32. package/dist/src/migrations/update-23-0-0/rename-create-nodes-v2-types.md +29 -0
  33. package/dist/src/migrations/update-23-0-0/update-deep-imports.d.ts +4 -0
  34. package/dist/src/migrations/update-23-0-0/update-deep-imports.js +323 -0
  35. package/dist/src/migrations/update-23-0-0/update-deep-imports.md +43 -0
  36. package/{src → dist/src}/tasks/install-packages-task.d.ts +0 -1
  37. package/{src → dist/src}/utils/add-plugin.d.ts +3 -4
  38. package/{src → dist/src}/utils/add-plugin.js +1 -1
  39. package/{src → dist/src}/utils/async-iterable/combine-async-iterables.d.ts +0 -1
  40. package/{src → dist/src}/utils/async-iterable/create-async-iterable.d.ts +0 -1
  41. package/{src → dist/src}/utils/async-iterable/index.d.ts +0 -1
  42. package/{src → dist/src}/utils/async-iterable/map-async-iteratable.d.ts +0 -1
  43. package/{src → dist/src}/utils/async-iterable/tap-async-iteratable.d.ts +0 -1
  44. package/{src → dist/src}/utils/binary-extensions.d.ts +0 -1
  45. package/dist/src/utils/calculate-hash-for-create-nodes.d.ts +8 -0
  46. package/{src → dist/src}/utils/calculate-hash-for-create-nodes.js +12 -5
  47. package/{src → dist/src}/utils/catalog/index.d.ts +0 -1
  48. package/{src → dist/src}/utils/catalog/manager-factory.d.ts +0 -1
  49. package/{src → dist/src}/utils/catalog/manager.d.ts +0 -1
  50. package/{src → dist/src}/utils/catalog/pnpm-manager.d.ts +0 -1
  51. package/{src → dist/src}/utils/catalog/types.d.ts +0 -1
  52. package/{src → dist/src}/utils/catalog/yarn-manager.d.ts +0 -1
  53. package/{src → dist/src}/utils/config-utils.d.ts +0 -1
  54. package/{src → dist/src}/utils/config-utils.js +59 -4
  55. package/{src → dist/src}/utils/convert-nx-executor.d.ts +0 -1
  56. package/{src → dist/src}/utils/find-plugin-for-config-file.d.ts +0 -1
  57. package/dist/src/utils/find-plugin-for-config-file.js +34 -0
  58. package/{src → dist/src}/utils/get-named-inputs.d.ts +2 -3
  59. package/{src → dist/src}/utils/get-workspace-layout.d.ts +0 -1
  60. package/dist/src/utils/installed-version.d.ts +29 -0
  61. package/dist/src/utils/installed-version.js +57 -0
  62. package/{src → dist/src}/utils/invoke-nx-generator.d.ts +0 -1
  63. package/{src → dist/src}/utils/log-show-project-command.d.ts +0 -1
  64. package/{src → dist/src}/utils/move-dir.d.ts +0 -1
  65. package/{src → dist/src}/utils/names.d.ts +0 -1
  66. package/dist/src/utils/normalize-target-defaults.d.ts +32 -0
  67. package/dist/src/utils/normalize-target-defaults.js +84 -0
  68. package/{src → dist/src}/utils/offset-from-root.d.ts +0 -1
  69. package/{src → dist/src}/utils/package-json.d.ts +0 -1
  70. package/{src → dist/src}/utils/package-json.js +1 -1
  71. package/dist/src/utils/replace-project-configuration-with-plugin.d.ts +2 -0
  72. package/{src → dist/src}/utils/rxjs-for-await.d.ts +0 -1
  73. package/{src → dist/src}/utils/semver.d.ts +0 -1
  74. package/{src → dist/src}/utils/string-change.d.ts +0 -1
  75. package/{src → dist/src}/utils/string-utils.d.ts +0 -1
  76. package/dist/src/utils/version-floor.d.ts +37 -0
  77. package/dist/src/utils/version-floor.js +71 -0
  78. package/{src → dist/src}/utils/versions.d.ts +0 -1
  79. package/{testing.d.ts → dist/testing.d.ts} +0 -1
  80. package/migrations.json +16 -3
  81. package/package.json +59 -8
  82. package/assets.json +0 -15
  83. package/index.d.ts.map +0 -1
  84. package/internal.d.ts +0 -2
  85. package/internal.d.ts.map +0 -1
  86. package/internal.js +0 -8
  87. package/ngcli-adapter.d.ts.map +0 -1
  88. package/project.json +0 -14
  89. package/public-api.d.ts.map +0 -1
  90. package/src/executors/parse-target-string.d.ts.map +0 -1
  91. package/src/executors/read-target-options.d.ts.map +0 -1
  92. package/src/generators/artifact-name-and-directory-utils.d.ts.map +0 -1
  93. package/src/generators/e2e-web-server-info-utils.d.ts.map +0 -1
  94. package/src/generators/executor-options-utils.d.ts.map +0 -1
  95. package/src/generators/format-files.d.ts.map +0 -1
  96. package/src/generators/generate-files.d.ts.map +0 -1
  97. package/src/generators/plugin-migrations/aggregate-log-util.d.ts.map +0 -1
  98. package/src/generators/plugin-migrations/executor-to-plugin-migrator.d.ts.map +0 -1
  99. package/src/generators/plugin-migrations/plugin-migration-utils.d.ts.map +0 -1
  100. package/src/generators/project-name-and-root-utils.d.ts.map +0 -1
  101. package/src/generators/prompt.d.ts.map +0 -1
  102. package/src/generators/run-tasks-in-serial.d.ts.map +0 -1
  103. package/src/generators/target-defaults-utils.d.ts +0 -4
  104. package/src/generators/target-defaults-utils.d.ts.map +0 -1
  105. package/src/generators/target-defaults-utils.js +0 -100
  106. package/src/generators/to-js.d.ts.map +0 -1
  107. package/src/generators/typescript/insert-import.d.ts.map +0 -1
  108. package/src/generators/typescript/insert-statement.d.ts.map +0 -1
  109. package/src/generators/update-ts-configs-to-js.d.ts.map +0 -1
  110. package/src/generators/visit-not-ignored-files.d.ts.map +0 -1
  111. package/src/tasks/install-packages-task.d.ts.map +0 -1
  112. package/src/utils/add-plugin.d.ts.map +0 -1
  113. package/src/utils/async-iterable/combine-async-iterables.d.ts.map +0 -1
  114. package/src/utils/async-iterable/create-async-iterable.d.ts.map +0 -1
  115. package/src/utils/async-iterable/index.d.ts.map +0 -1
  116. package/src/utils/async-iterable/map-async-iteratable.d.ts.map +0 -1
  117. package/src/utils/async-iterable/tap-async-iteratable.d.ts.map +0 -1
  118. package/src/utils/binary-extensions.d.ts.map +0 -1
  119. package/src/utils/calculate-hash-for-create-nodes.d.ts +0 -4
  120. package/src/utils/calculate-hash-for-create-nodes.d.ts.map +0 -1
  121. package/src/utils/catalog/index.d.ts.map +0 -1
  122. package/src/utils/catalog/manager-factory.d.ts.map +0 -1
  123. package/src/utils/catalog/manager.d.ts.map +0 -1
  124. package/src/utils/catalog/pnpm-manager.d.ts.map +0 -1
  125. package/src/utils/catalog/types.d.ts.map +0 -1
  126. package/src/utils/catalog/yarn-manager.d.ts.map +0 -1
  127. package/src/utils/config-utils.d.ts.map +0 -1
  128. package/src/utils/convert-nx-executor.d.ts.map +0 -1
  129. package/src/utils/find-plugin-for-config-file.d.ts.map +0 -1
  130. package/src/utils/find-plugin-for-config-file.js +0 -61
  131. package/src/utils/get-named-inputs.d.ts.map +0 -1
  132. package/src/utils/get-workspace-layout.d.ts.map +0 -1
  133. package/src/utils/invoke-nx-generator.d.ts.map +0 -1
  134. package/src/utils/log-show-project-command.d.ts.map +0 -1
  135. package/src/utils/move-dir.d.ts.map +0 -1
  136. package/src/utils/names.d.ts.map +0 -1
  137. package/src/utils/offset-from-root.d.ts.map +0 -1
  138. package/src/utils/package-json.d.ts.map +0 -1
  139. package/src/utils/replace-package.d.ts +0 -3
  140. package/src/utils/replace-package.d.ts.map +0 -1
  141. package/src/utils/replace-package.js +0 -124
  142. package/src/utils/replace-project-configuration-with-plugin.d.ts +0 -3
  143. package/src/utils/replace-project-configuration-with-plugin.d.ts.map +0 -1
  144. package/src/utils/rxjs-for-await.d.ts.map +0 -1
  145. package/src/utils/semver.d.ts.map +0 -1
  146. package/src/utils/string-change.d.ts.map +0 -1
  147. package/src/utils/string-utils.d.ts.map +0 -1
  148. package/src/utils/versions.d.ts.map +0 -1
  149. package/testing.d.ts.map +0 -1
  150. /package/{LICENSE → dist/LICENSE} +0 -0
  151. /package/{index.js → dist/index.js} +0 -0
  152. /package/{ngcli-adapter.js → dist/ngcli-adapter.js} +0 -0
  153. /package/{public-api.js → dist/public-api.js} +0 -0
  154. /package/{src → dist/src}/executors/parse-target-string.js +0 -0
  155. /package/{src → dist/src}/executors/read-target-options.js +0 -0
  156. /package/{src → dist/src}/generators/artifact-name-and-directory-utils.js +0 -0
  157. /package/{src → dist/src}/generators/executor-options-utils.js +0 -0
  158. /package/{src → dist/src}/generators/generate-files.js +0 -0
  159. /package/{src → dist/src}/generators/plugin-migrations/aggregate-log-util.js +0 -0
  160. /package/{src → dist/src}/generators/plugin-migrations/plugin-migration-utils.js +0 -0
  161. /package/{src → dist/src}/generators/project-name-and-root-utils.js +0 -0
  162. /package/{src → dist/src}/generators/prompt.js +0 -0
  163. /package/{src → dist/src}/generators/run-tasks-in-serial.js +0 -0
  164. /package/{src → dist/src}/generators/typescript/insert-import.js +0 -0
  165. /package/{src → dist/src}/generators/typescript/insert-statement.js +0 -0
  166. /package/{src → dist/src}/generators/update-ts-configs-to-js.js +0 -0
  167. /package/{src → dist/src}/generators/visit-not-ignored-files.js +0 -0
  168. /package/{src → dist/src}/tasks/install-packages-task.js +0 -0
  169. /package/{src → dist/src}/utils/async-iterable/combine-async-iterables.js +0 -0
  170. /package/{src → dist/src}/utils/async-iterable/create-async-iterable.js +0 -0
  171. /package/{src → dist/src}/utils/async-iterable/index.js +0 -0
  172. /package/{src → dist/src}/utils/async-iterable/map-async-iteratable.js +0 -0
  173. /package/{src → dist/src}/utils/async-iterable/tap-async-iteratable.js +0 -0
  174. /package/{src → dist/src}/utils/binary-extensions.js +0 -0
  175. /package/{src → dist/src}/utils/catalog/index.js +0 -0
  176. /package/{src → dist/src}/utils/catalog/manager-factory.js +0 -0
  177. /package/{src → dist/src}/utils/catalog/manager.js +0 -0
  178. /package/{src → dist/src}/utils/catalog/pnpm-manager.js +0 -0
  179. /package/{src → dist/src}/utils/catalog/types.js +0 -0
  180. /package/{src → dist/src}/utils/catalog/yarn-manager.js +0 -0
  181. /package/{src → dist/src}/utils/convert-nx-executor.js +0 -0
  182. /package/{src → dist/src}/utils/get-named-inputs.js +0 -0
  183. /package/{src → dist/src}/utils/get-workspace-layout.js +0 -0
  184. /package/{src → dist/src}/utils/invoke-nx-generator.js +0 -0
  185. /package/{src → dist/src}/utils/log-show-project-command.js +0 -0
  186. /package/{src → dist/src}/utils/move-dir.js +0 -0
  187. /package/{src → dist/src}/utils/names.js +0 -0
  188. /package/{src → dist/src}/utils/offset-from-root.js +0 -0
  189. /package/{src → dist/src}/utils/replace-project-configuration-with-plugin.js +0 -0
  190. /package/{src → dist/src}/utils/rxjs-for-await.js +0 -0
  191. /package/{src → dist/src}/utils/semver.js +0 -0
  192. /package/{src → dist/src}/utils/string-change.js +0 -0
  193. /package/{src → dist/src}/utils/string-utils.js +0 -0
  194. /package/{src → dist/src}/utils/versions.js +0 -0
  195. /package/{testing.js → dist/testing.js} +0 -0
@@ -1,14 +1,13 @@
1
- import { CreateNodesV2, ProjectGraph, Tree } from 'nx/src/devkit-exports';
1
+ import { CreateNodes, ProjectGraph, Tree } from 'nx/src/devkit-exports';
2
2
  /**
3
3
  * Iterates through various forms of plugin options to find the one which does not conflict with the current graph
4
4
 
5
5
  */
6
- export declare function addPlugin<PluginOptions>(tree: Tree, graph: ProjectGraph, pluginName: string, createNodesTuple: CreateNodesV2<PluginOptions>, options: Partial<Record<keyof PluginOptions, PluginOptions[keyof PluginOptions][]>>, shouldUpdatePackageJsonScripts: boolean): Promise<void>;
6
+ export declare function addPlugin<PluginOptions>(tree: Tree, graph: ProjectGraph, pluginName: string, createNodesTuple: CreateNodes<PluginOptions>, options: Partial<Record<keyof PluginOptions, PluginOptions[keyof PluginOptions][]>>, shouldUpdatePackageJsonScripts: boolean): Promise<void>;
7
7
  /**
8
8
  * @deprecated Use `addPlugin` instead
9
9
  * Iterates through various forms of plugin options to find the one which does not conflict with the current graph
10
10
 
11
11
  */
12
- export declare function addPluginV1<PluginOptions>(tree: Tree, graph: ProjectGraph, pluginName: string, createNodesTuple: CreateNodesV2<PluginOptions>, options: Partial<Record<keyof PluginOptions, PluginOptions[keyof PluginOptions][]>>, shouldUpdatePackageJsonScripts: boolean): Promise<void>;
12
+ export declare function addPluginV1<PluginOptions>(tree: Tree, graph: ProjectGraph, pluginName: string, createNodesTuple: CreateNodes<PluginOptions>, options: Partial<Record<keyof PluginOptions, PluginOptions[keyof PluginOptions][]>>, shouldUpdatePackageJsonScripts: boolean): Promise<void>;
13
13
  export declare function generateCombinations<T>(input: Record<string, T[]>): Record<string, T>[];
14
- //# sourceMappingURL=add-plugin.d.ts.map
@@ -14,7 +14,7 @@ const devkit_internals_1 = require("nx/src/devkit-internals");
14
14
  async function addPlugin(tree, graph, pluginName, createNodesTuple, options, shouldUpdatePackageJsonScripts) {
15
15
  return _addPluginInternal(tree, graph, pluginName, (pluginOptions) => new devkit_internals_1.LoadedNxPlugin({
16
16
  name: pluginName,
17
- createNodesV2: createNodesTuple,
17
+ createNodes: createNodesTuple,
18
18
  }, {
19
19
  plugin: pluginName,
20
20
  options: pluginOptions,
@@ -1,4 +1,3 @@
1
1
  export declare function combineAsyncIterables<T = any>(..._iterators: {
2
2
  0: AsyncIterable<T>;
3
3
  } & AsyncIterable<T>[]): AsyncGenerator<T>;
4
- //# sourceMappingURL=combine-async-iterables.d.ts.map
@@ -5,4 +5,3 @@ export interface AsyncPushCallbacks<T> {
5
5
  registerCleanup?: (cb: () => void | Promise<void>) => void;
6
6
  }
7
7
  export declare function createAsyncIterable<T = unknown>(listener: (ls: AsyncPushCallbacks<T>) => void): AsyncIterable<T>;
8
- //# sourceMappingURL=create-async-iterable.d.ts.map
@@ -2,4 +2,3 @@ export * from './create-async-iterable';
2
2
  export * from './combine-async-iterables';
3
3
  export * from './map-async-iteratable';
4
4
  export * from './tap-async-iteratable';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function mapAsyncIterable<T = any, I = any, O = any>(data: AsyncIterable<T> | AsyncIterableIterator<T>, transform: (input: I, index?: number, data?: AsyncIterable<T> | AsyncIterableIterator<T>) => O): AsyncIterable<O> | AsyncIterableIterator<O>;
2
- //# sourceMappingURL=map-async-iteratable.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function tapAsyncIterable<T = any, I = any, O = any>(data: AsyncIterable<T> | AsyncIterableIterator<T>, fn: (input: I) => void): AsyncIterable<T> | AsyncIterableIterator<T>;
2
- //# sourceMappingURL=tap-async-iteratable.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function isBinaryPath(path: string): boolean;
2
- //# sourceMappingURL=binary-extensions.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { CreateNodesContext } from 'nx/src/devkit-exports';
2
+ /**
3
+ * @deprecated Use {@link calculateHashesForCreateNodes} instead, which batches
4
+ * workspace-context hashing across multiple project roots in a single call.
5
+ * This will be removed in Nx 24.
6
+ */
7
+ export declare function calculateHashForCreateNodes(projectRoot: string, options: object, context: CreateNodesContext, additionalGlobs?: string[]): Promise<string>;
8
+ export declare function calculateHashesForCreateNodes(projectRoots: string[], options: object, context: CreateNodesContext, additionalGlobs?: string[][]): Promise<string[]>;
@@ -5,6 +5,11 @@ exports.calculateHashesForCreateNodes = calculateHashesForCreateNodes;
5
5
  const path_1 = require("path");
6
6
  const devkit_exports_1 = require("nx/src/devkit-exports");
7
7
  const devkit_internals_1 = require("nx/src/devkit-internals");
8
+ /**
9
+ * @deprecated Use {@link calculateHashesForCreateNodes} instead, which batches
10
+ * workspace-context hashing across multiple project roots in a single call.
11
+ * This will be removed in Nx 24.
12
+ */
8
13
  async function calculateHashForCreateNodes(projectRoot, options, context, additionalGlobs = []) {
9
14
  return (0, devkit_exports_1.hashArray)([
10
15
  await (0, devkit_internals_1.hashWithWorkspaceContext)(context.workspaceRoot, [
@@ -15,14 +20,16 @@ async function calculateHashForCreateNodes(projectRoot, options, context, additi
15
20
  ]);
16
21
  }
17
22
  async function calculateHashesForCreateNodes(projectRoots, options, context, additionalGlobs = []) {
23
+ if (projectRoots.length === 0) {
24
+ return [];
25
+ }
18
26
  if (additionalGlobs.length &&
19
27
  additionalGlobs.length !== projectRoots.length) {
20
- throw new Error('If additionalGlobs is provided, it must be the same length as projectRoots');
28
+ throw new Error(`calculateHashesForCreateNodes: projectRoots.length (${projectRoots.length}) !== additionalGlobs.length (${additionalGlobs.length})`);
21
29
  }
22
- return (0, devkit_internals_1.hashMultiGlobWithWorkspaceContext)(context.workspaceRoot, projectRoots.map((projectRoot, idx) => [
30
+ const hashes = await (0, devkit_internals_1.hashMultiGlobWithWorkspaceContext)(context.workspaceRoot, projectRoots.map((projectRoot, idx) => [
23
31
  (0, path_1.join)(projectRoot, '**/*'),
24
32
  ...(additionalGlobs.length ? additionalGlobs[idx] : []),
25
- ])).then((hashes) => {
26
- return hashes.map((hash) => (0, devkit_exports_1.hashArray)([hash, (0, devkit_internals_1.hashObject)(options)]));
27
- });
33
+ ]));
34
+ return hashes.map((hash) => (0, devkit_exports_1.hashArray)([hash, (0, devkit_internals_1.hashObject)(options)]));
28
35
  }
@@ -7,4 +7,3 @@ export { type CatalogManager, getCatalogManager };
7
7
  * Returns Map of package name -> catalog name (undefined for default catalog)
8
8
  */
9
9
  export declare function getCatalogDependenciesFromPackageJson(tree: Tree, packageJsonPath: string, manager: CatalogManager): Map<string, string | undefined>;
10
- //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,3 @@ import type { CatalogManager } from './manager';
3
3
  * Factory function to get the appropriate catalog manager based on the package manager
4
4
  */
5
5
  export declare function getCatalogManager(workspaceRoot: string): CatalogManager | null;
6
- //# sourceMappingURL=manager-factory.d.ts.map
@@ -38,4 +38,3 @@ export interface CatalogManager {
38
38
  catalogName?: string;
39
39
  }>): void;
40
40
  }
41
- //# sourceMappingURL=manager.d.ts.map
@@ -19,4 +19,3 @@ export declare class PnpmCatalogManager implements CatalogManager {
19
19
  catalogName?: string;
20
20
  }>): void;
21
21
  }
22
- //# sourceMappingURL=pnpm-manager.d.ts.map
@@ -9,4 +9,3 @@ export interface CatalogDefinitions {
9
9
  catalog?: CatalogEntry;
10
10
  catalogs?: Record<string, CatalogEntry>;
11
11
  }
12
- //# sourceMappingURL=types.d.ts.map
@@ -19,4 +19,3 @@ export declare class YarnCatalogManager implements CatalogManager {
19
19
  catalogName?: string;
20
20
  }>): void;
21
21
  }
22
- //# sourceMappingURL=yarn-manager.d.ts.map
@@ -3,4 +3,3 @@ export declare function loadConfigFile<T extends object = any>(configFilePath: s
3
3
  export declare function getRootTsConfigPath(): string | null;
4
4
  export declare function getRootTsConfigFileName(): string | null;
5
5
  export declare function clearRequireCache(): void;
6
- //# sourceMappingURL=config-utils.d.ts.map
@@ -27,16 +27,71 @@ function isTypeScriptFile(extension) {
27
27
  }
28
28
  async function loadTypeScriptModule(path, extension, tsconfigFileNames) {
29
29
  const tsConfigPath = getTypeScriptConfigPath(path, tsconfigFileNames);
30
- if (tsConfigPath) {
31
- const unregisterTsProject = (0, devkit_internals_1.registerTsProject)(tsConfigPath);
30
+ if (!tsConfigPath) {
31
+ return await loadModuleByExtension(path, extension);
32
+ }
33
+ // loadTsFile was added in nx@23. @nx/devkit's peer range supports older
34
+ // nx majors, so fall back to the legacy registerTsProject + require path
35
+ // when loadTsFile isn't available on the host nx.
36
+ if (typeof devkit_internals_1.loadTsFile !== 'function') {
37
+ const cleanup = (0, devkit_internals_1.registerTsProject)(tsConfigPath);
32
38
  try {
33
39
  return await loadModuleByExtension(path, extension);
34
40
  }
35
41
  finally {
36
- unregisterTsProject();
42
+ cleanup();
43
+ }
44
+ }
45
+ // Both .ts and .mts go through loadTsFile first. Node 22.12+ supports
46
+ // require() of synchronous ESM by default, and loadTsFile's lazy fallback
47
+ // covers swc/ts-node + tsconfig-paths registration when needed (swc-node
48
+ // hooks .cts/.mts/.ts via Module._extensions). Async-only ESM modules
49
+ // (top-level await) throw ERR_REQUIRE_ASYNC_MODULE and fall through to
50
+ // dynamic import(). ERR_REQUIRE_ESM is the legacy code for the same case
51
+ // - kept for older Node lines.
52
+ try {
53
+ return (0, devkit_internals_1.loadTsFile)(path, tsConfigPath);
54
+ }
55
+ catch (e) {
56
+ if (e?.code !== 'ERR_REQUIRE_ESM' &&
57
+ e?.code !== 'ERR_REQUIRE_ASYNC_MODULE') {
58
+ throw e;
59
+ }
60
+ // The module must be loaded via dynamic import(). Register
61
+ // tsconfig-paths first so workspace alias imports resolve, then try a
62
+ // native dynamic import. Node 22.18+ LTS strips TS types on the ESM
63
+ // path natively, so pure-ESM TLA configs load without any swc/ts-node
64
+ // ESM loader. Only escalate to forceRegisterEsmLoader (which throws
65
+ // when neither @swc-node/register nor ts-node is installed) if the
66
+ // native attempt hits unsupported TS syntax.
67
+ const cleanup = (0, devkit_internals_1.registerTsProject)(tsConfigPath);
68
+ try {
69
+ return await loadESM(path);
70
+ }
71
+ catch (esmErr) {
72
+ if (esmErr?.code !== 'ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX' ||
73
+ typeof devkit_internals_1.forceRegisterEsmLoader !== 'function') {
74
+ throw esmErr;
75
+ }
76
+ // Module.register is global and one-shot per process. After this
77
+ // runs, every subsequent ESM import in the process is routed
78
+ // through the registered loader, forfeiting Node's native TS
79
+ // stripping for the dynamic-import path. If neither swc-node nor
80
+ // ts-node is installed, forceRegisterEsmLoader throws - surface the
81
+ // original ESM error in that case so the user sees the real
82
+ // problem, not a misleading "loader missing" message.
83
+ try {
84
+ (0, devkit_internals_1.forceRegisterEsmLoader)();
85
+ }
86
+ catch {
87
+ throw esmErr;
88
+ }
89
+ return await loadESM(path);
90
+ }
91
+ finally {
92
+ cleanup();
37
93
  }
38
94
  }
39
- return await loadModuleByExtension(path, extension);
40
95
  }
41
96
  function getTypeScriptConfigPath(path, tsconfigFileNames) {
42
97
  const siblingFiles = (0, fs_1.readdirSync)((0, path_1.dirname)(path));
@@ -5,4 +5,3 @@ import type { Executor } from 'nx/src/devkit-exports';
5
5
  * Use this to expose a compatible Angular Builder
6
6
  */
7
7
  export declare function convertNxExecutor(executor: Executor): any;
8
- //# sourceMappingURL=convert-nx-executor.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { type Tree, type PluginConfiguration } from 'nx/src/devkit-exports';
2
2
  export declare function findPluginForConfigFile(tree: Tree, pluginName: string, pathToConfigFile: string): Promise<PluginConfiguration>;
3
- //# sourceMappingURL=find-plugin-for-config-file.d.ts.map
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findPluginForConfigFile = findPluginForConfigFile;
4
+ const devkit_exports_1 = require("nx/src/devkit-exports");
5
+ const devkit_internals_1 = require("nx/src/devkit-internals");
6
+ const minimatch_1 = require("minimatch");
7
+ async function findPluginForConfigFile(tree, pluginName, pathToConfigFile) {
8
+ const nxJson = (0, devkit_exports_1.readNxJson)(tree);
9
+ if (!nxJson.plugins) {
10
+ return;
11
+ }
12
+ const pluginRegistrations = nxJson.plugins.filter((p) => (typeof p === 'string' ? p === pluginName : p.plugin === pluginName));
13
+ for (const plugin of pluginRegistrations) {
14
+ if (typeof plugin === 'string') {
15
+ return plugin;
16
+ }
17
+ if (!plugin.include && !plugin.exclude) {
18
+ return plugin;
19
+ }
20
+ if (plugin.include || plugin.exclude) {
21
+ const resolvedPlugin = await import(pluginName);
22
+ const pluginGlob = resolvedPlugin.createNodes?.[0] ?? resolvedPlugin.createNodesV2?.[0];
23
+ // The file must be one this plugin actually processes (its path matches
24
+ // the plugin's createNodes glob) before the registration's include/exclude
25
+ // filters are applied.
26
+ const matchingConfigFile = !pluginGlob || (0, minimatch_1.minimatch)(pathToConfigFile, pluginGlob, { dot: true })
27
+ ? (0, devkit_internals_1.findMatchingConfigFiles)([pathToConfigFile], plugin.include, plugin.exclude)
28
+ : [];
29
+ if (matchingConfigFile.length) {
30
+ return plugin;
31
+ }
32
+ }
33
+ }
34
+ }
@@ -1,9 +1,8 @@
1
1
  import type { InputDefinition } from 'nx/src/config/workspace-json-project-json';
2
- import { CreateNodesContextV2 } from 'nx/src/devkit-exports';
2
+ import { CreateNodesContext } from 'nx/src/devkit-exports';
3
3
  /**
4
4
  * Get the named inputs available for a directory
5
5
  */
6
- export declare function getNamedInputs(directory: string, context: CreateNodesContextV2): {
6
+ export declare function getNamedInputs(directory: string, context: CreateNodesContext): {
7
7
  [inputName: string]: (string | InputDefinition)[];
8
8
  };
9
- //# sourceMappingURL=get-named-inputs.d.ts.map
@@ -22,4 +22,3 @@ export declare function extractLayoutDirectory(directory?: string): {
22
22
  layoutDirectory: string | null;
23
23
  projectDirectory?: string;
24
24
  };
25
- //# sourceMappingURL=get-workspace-layout.d.ts.map
@@ -0,0 +1,29 @@
1
+ import type { Tree } from 'nx/src/devkit-exports';
2
+ /**
3
+ * Returns the concrete version of a package as resolved by Node module
4
+ * resolution from the workspace. Reads the installed package's own
5
+ * `package.json` — not the workspace's declared range.
6
+ *
7
+ * Use this from executor / runtime contexts where node_modules is present.
8
+ * Generator-time code should use `getDeclaredPackageVersion` instead.
9
+ *
10
+ * Returns `null` when the package is not resolvable.
11
+ */
12
+ export declare function getInstalledPackageVersion(packageName: string): string | null;
13
+ /**
14
+ * Returns the declared version of a package as read from the workspace's
15
+ * `package.json`, normalized to a plain semver string (range markers
16
+ * stripped) suitable for arithmetic comparisons (e.g. `lt(v, '1.37.0')`).
17
+ *
18
+ * When the package is missing or declared as `latest`/`next`, falls back to
19
+ * the cleaned `latestKnownVersion` if provided; otherwise returns `null`.
20
+ *
21
+ * Use this from generator-time contexts where node_modules is not assumed
22
+ * to be present. Executor / runtime code should use
23
+ * `getInstalledPackageVersion` instead.
24
+ */
25
+ export declare function getDeclaredPackageVersion(tree: Tree, packageName: string, latestKnownVersion?: string): string | null;
26
+ export declare const NON_SEMVER_DIST_TAGS: readonly ["latest", "next"];
27
+ export type NonSemverDistTag = (typeof NON_SEMVER_DIST_TAGS)[number];
28
+ export declare function isNonSemverDistTag(version: string): version is NonSemverDistTag;
29
+ export declare function normalizeSemver(version: string): string | null;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NON_SEMVER_DIST_TAGS = void 0;
4
+ exports.getInstalledPackageVersion = getInstalledPackageVersion;
5
+ exports.getDeclaredPackageVersion = getDeclaredPackageVersion;
6
+ exports.isNonSemverDistTag = isNonSemverDistTag;
7
+ exports.normalizeSemver = normalizeSemver;
8
+ const devkit_internals_1 = require("nx/src/devkit-internals");
9
+ const semver_1 = require("semver");
10
+ const package_json_1 = require("./package-json");
11
+ /**
12
+ * Returns the concrete version of a package as resolved by Node module
13
+ * resolution from the workspace. Reads the installed package's own
14
+ * `package.json` — not the workspace's declared range.
15
+ *
16
+ * Use this from executor / runtime contexts where node_modules is present.
17
+ * Generator-time code should use `getDeclaredPackageVersion` instead.
18
+ *
19
+ * Returns `null` when the package is not resolvable.
20
+ */
21
+ function getInstalledPackageVersion(packageName) {
22
+ try {
23
+ const { packageJson } = (0, devkit_internals_1.readModulePackageJson)(packageName);
24
+ return packageJson.version ?? null;
25
+ }
26
+ catch {
27
+ return null;
28
+ }
29
+ }
30
+ /**
31
+ * Returns the declared version of a package as read from the workspace's
32
+ * `package.json`, normalized to a plain semver string (range markers
33
+ * stripped) suitable for arithmetic comparisons (e.g. `lt(v, '1.37.0')`).
34
+ *
35
+ * When the package is missing or declared as `latest`/`next`, falls back to
36
+ * the cleaned `latestKnownVersion` if provided; otherwise returns `null`.
37
+ *
38
+ * Use this from generator-time contexts where node_modules is not assumed
39
+ * to be present. Executor / runtime code should use
40
+ * `getInstalledPackageVersion` instead.
41
+ */
42
+ function getDeclaredPackageVersion(tree, packageName, latestKnownVersion) {
43
+ const declared = (0, package_json_1.getDependencyVersionFromPackageJson)(tree, packageName);
44
+ if (declared && !isNonSemverDistTag(declared)) {
45
+ const normalized = normalizeSemver(declared);
46
+ if (normalized)
47
+ return normalized;
48
+ }
49
+ return latestKnownVersion ? normalizeSemver(latestKnownVersion) : null;
50
+ }
51
+ exports.NON_SEMVER_DIST_TAGS = ['latest', 'next'];
52
+ function isNonSemverDistTag(version) {
53
+ return exports.NON_SEMVER_DIST_TAGS.includes(version);
54
+ }
55
+ function normalizeSemver(version) {
56
+ return (0, semver_1.clean)(version) ?? (0, semver_1.coerce)(version)?.version ?? null;
57
+ }
@@ -4,4 +4,3 @@ import { Generator } from 'nx/src/devkit-exports';
4
4
  * @param generator The Nx generator to convert to an Angular Devkit Schematic.
5
5
  */
6
6
  export declare function convertNxGenerator<T = any>(generator: Generator<T>, skipWritingConfigInOldFormat?: boolean): (generatorOptions: T) => (tree: any, context: any) => Promise<any>;
7
- //# sourceMappingURL=invoke-nx-generator.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function logShowProjectCommand(projectName: string): void;
2
- //# sourceMappingURL=log-show-project-command.d.ts.map
@@ -3,4 +3,3 @@ import { Tree } from 'nx/src/devkit-exports';
3
3
  * Analogous to cp -r oldDir newDir
4
4
  */
5
5
  export declare function moveFilesToNewDirectory(tree: Tree, oldDir: string, newDir: string): void;
6
- //# sourceMappingURL=move-dir.d.ts.map
@@ -16,4 +16,3 @@ export declare function names(name: string): {
16
16
  constantName: string;
17
17
  fileName: string;
18
18
  };
19
- //# sourceMappingURL=names.d.ts.map
@@ -0,0 +1,32 @@
1
+ import type { TargetDefaultEntry, TargetDefaults, TargetDefaultsRecord } from 'nx/src/devkit-exports';
2
+ /**
3
+ * Convert an nx.json `targetDefaults` value (either the legacy record shape
4
+ * or the new array shape) into the normalized array shape.
5
+ *
6
+ * Record entries become `{ target: key, ...value }` preserving insertion
7
+ * order — except executor-shaped keys (e.g. `@nx/vite:test`,
8
+ * `nx:run-commands`), which become `{ executor: key, ...value }`.
9
+ *
10
+ * Returns the array directly when already normalized — callers must not
11
+ * mutate the result if they want to preserve the underlying nx.json.
12
+ */
13
+ export declare function normalizeTargetDefaults(raw: TargetDefaults | undefined): TargetDefaultEntry[];
14
+ /**
15
+ * Project an array of `TargetDefaultEntry` back into the legacy
16
+ * record shape. The intended caller is a pre-v23 migration that
17
+ * normalized to array internally but wants to preserve the original
18
+ * on-disk record shape so it remains valid against pre-v23 nx.json
19
+ * schemas.
20
+ *
21
+ * Each entry's key is its `target` (if set) or `executor`. Entries that
22
+ * have both keep the locator role on `target` and retain `executor` as
23
+ * a value field.
24
+ *
25
+ * Throws when the input contains entries that the record shape cannot
26
+ * represent — `projects`/`plugin` filters, two entries that would collapse
27
+ * to the same key, or entries with neither `target` nor `executor`. The
28
+ * caller must keep array shape in those cases (or refuse to write the
29
+ * change). Silently dropping these entries would corrupt nx.json without
30
+ * the user noticing.
31
+ */
32
+ export declare function downgradeTargetDefaults(entries: TargetDefaultEntry[]): TargetDefaultsRecord;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeTargetDefaults = normalizeTargetDefaults;
4
+ exports.downgradeTargetDefaults = downgradeTargetDefaults;
5
+ // Mirrors `GLOB_CHARACTERS` / `isGlobPattern` from
6
+ // `nx/src/utils/globs.ts`. We can't import from there directly: devkit
7
+ // supports nx +/- 1 major version and that file isn't part of the
8
+ // devkit-exports surface guaranteed across the range. Keeping a local
9
+ // copy that exactly matches the canonical implementation avoids the
10
+ // import while staying behaviorally aligned.
11
+ const GLOB_CHARACTERS = new Set(['*', '|', '{', '}', '(', ')', '[']);
12
+ /**
13
+ * Convert an nx.json `targetDefaults` value (either the legacy record shape
14
+ * or the new array shape) into the normalized array shape.
15
+ *
16
+ * Record entries become `{ target: key, ...value }` preserving insertion
17
+ * order — except executor-shaped keys (e.g. `@nx/vite:test`,
18
+ * `nx:run-commands`), which become `{ executor: key, ...value }`.
19
+ *
20
+ * Returns the array directly when already normalized — callers must not
21
+ * mutate the result if they want to preserve the underlying nx.json.
22
+ */
23
+ function normalizeTargetDefaults(raw) {
24
+ if (!raw)
25
+ return [];
26
+ if (Array.isArray(raw))
27
+ return raw;
28
+ const out = [];
29
+ const record = raw;
30
+ for (const key of Object.keys(record)) {
31
+ const value = record[key] ?? {};
32
+ out.push(isExecutorLikeKey(key)
33
+ ? { ...value, executor: key }
34
+ : { ...value, target: key });
35
+ }
36
+ return out;
37
+ }
38
+ function isExecutorLikeKey(key) {
39
+ if (!key.includes(':'))
40
+ return false;
41
+ for (const c of key)
42
+ if (GLOB_CHARACTERS.has(c))
43
+ return false;
44
+ return true;
45
+ }
46
+ /**
47
+ * Project an array of `TargetDefaultEntry` back into the legacy
48
+ * record shape. The intended caller is a pre-v23 migration that
49
+ * normalized to array internally but wants to preserve the original
50
+ * on-disk record shape so it remains valid against pre-v23 nx.json
51
+ * schemas.
52
+ *
53
+ * Each entry's key is its `target` (if set) or `executor`. Entries that
54
+ * have both keep the locator role on `target` and retain `executor` as
55
+ * a value field.
56
+ *
57
+ * Throws when the input contains entries that the record shape cannot
58
+ * represent — `projects`/`plugin` filters, two entries that would collapse
59
+ * to the same key, or entries with neither `target` nor `executor`. The
60
+ * caller must keep array shape in those cases (or refuse to write the
61
+ * change). Silently dropping these entries would corrupt nx.json without
62
+ * the user noticing.
63
+ */
64
+ function downgradeTargetDefaults(entries) {
65
+ const out = {};
66
+ for (const entry of entries) {
67
+ if (entry.projects !== undefined || entry.plugin !== undefined) {
68
+ throw new Error(`Cannot downgrade targetDefaults to legacy record shape: entry ${JSON.stringify(entry)} uses a \`projects\`/\`plugin\` filter, which is only supported in the array shape.`);
69
+ }
70
+ const { target, executor, projects, plugin, ...rest } = entry;
71
+ const key = target ?? executor;
72
+ if (key === undefined) {
73
+ throw new Error(`Cannot downgrade targetDefaults to legacy record shape: entry ${JSON.stringify(entry)} has neither \`target\` nor \`executor\` to use as the record key.`);
74
+ }
75
+ if (Object.prototype.hasOwnProperty.call(out, key)) {
76
+ throw new Error(`Cannot downgrade targetDefaults to legacy record shape: two entries collapse to the same key \`${key}\`. Keep the array shape so both can coexist.`);
77
+ }
78
+ const value = { ...rest };
79
+ if (target && executor)
80
+ value.executor = executor;
81
+ out[key] = value;
82
+ }
83
+ return out;
84
+ }
@@ -11,4 +11,3 @@
11
11
  * @param fullPathToDir - directory path
12
12
  */
13
13
  export declare function offsetFromRoot(fullPathToDir: string): string;
14
- //# sourceMappingURL=offset-from-root.d.ts.map
@@ -153,4 +153,3 @@ export declare function ensurePackage<T extends any = any>(pkg: string, version:
153
153
  * @description The version of Nx used by the workspace. Returns null if no version is found.
154
154
  */
155
155
  export declare const NX_VERSION: string;
156
- //# sourceMappingURL=package-json.d.ts.map
@@ -456,7 +456,7 @@ function ensurePackage(pkgOrTree, requiredVersionOrPackage, maybeRequiredVersion
456
456
  if (process.env.NX_DRY_RUN && process.env.NX_DRY_RUN !== 'false') {
457
457
  throw new Error('NOTE: This generator does not support --dry-run. If you are running this in Nx Console, it should execute fine once you hit the "Generate" button.\n');
458
458
  }
459
- const { tempDir } = (0, devkit_internals_1.installPackageToTmp)(pkg, requiredVersion);
459
+ const { tempDir } = (0, devkit_internals_1.installPackageToTmp)(pkg, requiredVersion, (0, devkit_exports_1.detectPackageManager)(devkit_exports_1.workspaceRoot));
460
460
  addToNodePath((0, path_1.join)(devkit_exports_1.workspaceRoot, 'node_modules'));
461
461
  addToNodePath((0, path_1.join)(tempDir, 'node_modules'));
462
462
  // Re-initialize the added paths into require
@@ -0,0 +1,2 @@
1
+ import { CreateNodes, Tree } from 'nx/src/devkit-exports';
2
+ export declare function replaceProjectConfigurationsWithPlugin<T = unknown>(tree: Tree, rootMappings: Map<string, string>, pluginPath: string, createNodes: CreateNodes<T>, pluginOptions: T): Promise<void>;
@@ -107,4 +107,3 @@ export declare function latestValueFrom<T>(source: Observable<T>): AsyncGenerato
107
107
  * @param source the Observable source to await values from
108
108
  */
109
109
  export declare function nextValueFrom<T>(source: Observable<T>): AsyncGenerator<T, void, void>;
110
- //# sourceMappingURL=rxjs-for-await.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { type Tree } from 'nx/src/devkit-exports';
2
2
  export declare function checkAndCleanWithSemver(pkgName: string, version: string): string;
3
3
  export declare function checkAndCleanWithSemver(tree: Tree, pkgName: string, version: string): string;
4
- //# sourceMappingURL=semver.d.ts.map
@@ -60,4 +60,3 @@ export type StringChange = StringInsertion | StringDeletion;
60
60
  * ```
61
61
  */
62
62
  export declare function applyChangesToString(text: string, changes: StringChange[]): string;
63
- //# sourceMappingURL=string-change.d.ts.map
@@ -93,4 +93,3 @@ export declare function underscore(str: string): string;
93
93
  export declare function capitalize(str: string): string;
94
94
  export declare function group(name: string, group: string | undefined): string;
95
95
  export declare function featurePath(group: boolean | undefined, flat: boolean | undefined, path: string, name: string): string;
96
- //# sourceMappingURL=string-utils.d.ts.map
@@ -0,0 +1,37 @@
1
+ import type { Tree } from 'nx/src/devkit-exports';
2
+ /**
3
+ * Throws a standardized error when a package is installed at a version below
4
+ * a plugin's supported floor.
5
+ *
6
+ * Use this at every site where a plugin determines the installed version of
7
+ * a supported package is below its declared floor, so the message is
8
+ * consistent across plugins.
9
+ *
10
+ * @param packageName Name of the package (e.g. `@angular/core`).
11
+ * @param installedVersion Version detected in the workspace (e.g. `18.2.0`).
12
+ * @param floor Lowest version the plugin supports (e.g. `19.0.0`).
13
+ */
14
+ export declare function throwForUnsupportedVersion(packageName: string, installedVersion: string, floor: string): never;
15
+ /**
16
+ * Asserts that a package detected in the workspace is at or above the
17
+ * plugin's supported floor. No-op when the package is not detected
18
+ * (fresh-install path) or when declared as `latest`/`next`. Throws via
19
+ * `throwForUnsupportedVersion` (with the original declared range for
20
+ * clarity) when below floor.
21
+ *
22
+ * Use from generator entry points to fail fast on unsupported workspaces
23
+ * before writing any incompatible config.
24
+ */
25
+ export declare function assertSupportedPackageVersion(tree: Tree, packageName: string, minSupportedVersion: string): void;
26
+ /**
27
+ * Asserts that a package installed in the workspace is at or above the
28
+ * plugin's supported floor. No-op when the package is not resolvable from
29
+ * `node_modules` (peer not yet satisfied, fresh-install path). Throws via
30
+ * `throwForUnsupportedVersion` when below floor.
31
+ *
32
+ * Use from executor / runtime / preset / library entry points where
33
+ * node_modules is present and no `Tree` is available. Generator code should
34
+ * use `assertSupportedPackageVersion` instead, which reads the declared
35
+ * range from a tree.
36
+ */
37
+ export declare function assertSupportedInstalledPackageVersion(packageName: string, minSupportedVersion: string): void;