@nx/node 23.0.0-pr.35413.460eeef → 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 (115) hide show
  1. package/{index.d.ts → dist/index.d.ts} +0 -1
  2. package/dist/internal.d.ts +2 -0
  3. package/dist/internal.js +5 -0
  4. package/{src → dist/src}/generators/application/application.d.ts +0 -1
  5. package/{src → dist/src}/generators/application/application.js +16 -43
  6. package/{src → dist/src}/generators/application/lib/add-dependencies.d.ts +0 -1
  7. package/dist/src/generators/application/lib/add-dependencies.js +55 -0
  8. package/{src → dist/src}/generators/application/lib/add-linting.d.ts +0 -1
  9. package/{src → dist/src}/generators/application/lib/add-proxy.d.ts +0 -1
  10. package/{src → dist/src}/generators/application/lib/create-files.d.ts +0 -1
  11. package/{src → dist/src}/generators/application/lib/create-project.d.ts +0 -1
  12. package/{src → dist/src}/generators/application/lib/create-project.js +10 -5
  13. package/{src → dist/src}/generators/application/lib/create-targets.d.ts +0 -1
  14. package/{src → dist/src}/generators/application/lib/create-targets.js +5 -5
  15. package/{src → dist/src}/generators/application/lib/index.d.ts +0 -1
  16. package/{src → dist/src}/generators/application/lib/normalize-options.d.ts +0 -1
  17. package/{src → dist/src}/generators/application/lib/normalize-options.js +5 -5
  18. package/{src → dist/src}/generators/application/lib/normalized-schema.d.ts +0 -1
  19. package/{src → dist/src}/generators/application/schema.d.ts +1 -1
  20. package/{src → dist/src}/generators/application/schema.json +6 -6
  21. package/{src → dist/src}/generators/e2e-project/e2e-project.d.ts +0 -1
  22. package/{src → dist/src}/generators/e2e-project/e2e-project.js +16 -20
  23. package/{src → dist/src}/generators/init/init.d.ts +0 -1
  24. package/{src → dist/src}/generators/init/init.js +1 -1
  25. package/{src → dist/src}/generators/init/schema.json +1 -1
  26. package/{src → dist/src}/generators/library/library.d.ts +0 -1
  27. package/{src → dist/src}/generators/library/library.js +11 -15
  28. package/{src → dist/src}/generators/library/schema.d.ts +0 -1
  29. package/{src → dist/src}/generators/library/schema.json +0 -6
  30. package/{src → dist/src}/generators/setup-docker/setup-docker.d.ts +0 -1
  31. package/dist/src/migrations/update-23-0-0/rewrite-internal-subpath-imports.d.ts +3 -0
  32. package/dist/src/migrations/update-23-0-0/rewrite-internal-subpath-imports.js +197 -0
  33. package/dist/src/utils/assert-supported-framework-version.d.ts +5 -0
  34. package/dist/src/utils/assert-supported-framework-version.js +28 -0
  35. package/{src → dist/src}/utils/has-webpack-plugin.d.ts +0 -1
  36. package/{src → dist/src}/utils/kill-port.d.ts +0 -1
  37. package/dist/src/utils/versions.d.ts +43 -0
  38. package/dist/src/utils/versions.js +127 -0
  39. package/{src → dist/src}/utils/vscode-debug-config.d.ts +0 -1
  40. package/{src → dist/src}/utils/wait-for-port-open.d.ts +0 -1
  41. package/{utils.d.ts → dist/utils.d.ts} +0 -1
  42. package/generators.json +8 -8
  43. package/migrations.json +13 -30
  44. package/package.json +67 -12
  45. package/index.d.ts.map +0 -1
  46. package/src/generators/application/application.d.ts.map +0 -1
  47. package/src/generators/application/lib/add-dependencies.d.ts.map +0 -1
  48. package/src/generators/application/lib/add-dependencies.js +0 -51
  49. package/src/generators/application/lib/add-linting.d.ts.map +0 -1
  50. package/src/generators/application/lib/add-proxy.d.ts.map +0 -1
  51. package/src/generators/application/lib/create-files.d.ts.map +0 -1
  52. package/src/generators/application/lib/create-project.d.ts.map +0 -1
  53. package/src/generators/application/lib/create-targets.d.ts.map +0 -1
  54. package/src/generators/application/lib/index.d.ts.map +0 -1
  55. package/src/generators/application/lib/normalize-options.d.ts.map +0 -1
  56. package/src/generators/application/lib/normalized-schema.d.ts.map +0 -1
  57. package/src/generators/e2e-project/e2e-project.d.ts.map +0 -1
  58. package/src/generators/init/init.d.ts.map +0 -1
  59. package/src/generators/library/library.d.ts.map +0 -1
  60. package/src/generators/setup-docker/setup-docker.d.ts.map +0 -1
  61. package/src/utils/has-webpack-plugin.d.ts.map +0 -1
  62. package/src/utils/kill-port.d.ts.map +0 -1
  63. package/src/utils/versions.d.ts +0 -13
  64. package/src/utils/versions.d.ts.map +0 -1
  65. package/src/utils/versions.js +0 -15
  66. package/src/utils/vscode-debug-config.d.ts.map +0 -1
  67. package/src/utils/wait-for-port-open.d.ts.map +0 -1
  68. package/utils.d.ts.map +0 -1
  69. /package/{LICENSE → dist/LICENSE} +0 -0
  70. /package/{index.js → dist/index.js} +0 -0
  71. /package/{src → dist/src}/generators/application/files/common/src/assets/.gitkeep +0 -0
  72. /package/{src → dist/src}/generators/application/files/common/src/main.ts__tmpl__ +0 -0
  73. /package/{src → dist/src}/generators/application/files/common/tsconfig.app.json +0 -0
  74. /package/{src → dist/src}/generators/application/files/common/tsconfig.json +0 -0
  75. /package/{src → dist/src}/generators/application/files/common/webpack.config.js__tmpl__ +0 -0
  76. /package/{src → dist/src}/generators/application/files/express/src/main.ts__tmpl__ +0 -0
  77. /package/{src → dist/src}/generators/application/files/fastify/src/app/app.spec.ts__tmpl__ +0 -0
  78. /package/{src → dist/src}/generators/application/files/fastify/src/app/app.ts__tmpl__ +0 -0
  79. /package/{src → dist/src}/generators/application/files/fastify/src/app/plugins/sensible.ts__tmpl__ +0 -0
  80. /package/{src → dist/src}/generators/application/files/fastify/src/app/routes/root.ts__tmpl__ +0 -0
  81. /package/{src → dist/src}/generators/application/files/fastify/src/main.ts__tmpl__ +0 -0
  82. /package/{src → dist/src}/generators/application/files/koa/src/main.ts__tmpl__ +0 -0
  83. /package/{src → dist/src}/generators/application/lib/add-linting.js +0 -0
  84. /package/{src → dist/src}/generators/application/lib/add-proxy.js +0 -0
  85. /package/{src → dist/src}/generators/application/lib/create-files.js +0 -0
  86. /package/{src → dist/src}/generators/application/lib/index.js +0 -0
  87. /package/{src → dist/src}/generators/application/lib/normalized-schema.js +0 -0
  88. /package/{src → dist/src}/generators/e2e-project/files/cli/jest.config.ts__tmpl__ +0 -0
  89. /package/{src → dist/src}/generators/e2e-project/files/cli/src/__fileName__/__fileName__.spec.ts__tmpl__ +0 -0
  90. /package/{src → dist/src}/generators/e2e-project/files/cli/src/test-setup.ts__tmpl__ +0 -0
  91. /package/{src → dist/src}/generators/e2e-project/files/non-ts-solution/tsconfig.json__tmpl__ +0 -0
  92. /package/{src → dist/src}/generators/e2e-project/files/non-ts-solution/tsconfig.spec.json__tmpl__ +0 -0
  93. /package/{src → dist/src}/generators/e2e-project/files/server/common/jest.config.ts__tmpl__ +0 -0
  94. /package/{src → dist/src}/generators/e2e-project/files/server/common/src/__fileName__/__fileName__.spec.ts__tmpl__ +0 -0
  95. /package/{src → dist/src}/generators/e2e-project/files/server/common/src/support/global-setup.ts__tmpl__ +0 -0
  96. /package/{src → dist/src}/generators/e2e-project/files/server/common/src/support/global-teardown.ts__tmpl__ +0 -0
  97. /package/{src → dist/src}/generators/e2e-project/files/server/common/src/support/test-setup.ts__tmpl__ +0 -0
  98. /package/{src → dist/src}/generators/e2e-project/files/server/nest/src/__fileName__/__fileName__.spec.ts__tmpl__ +0 -0
  99. /package/{src → dist/src}/generators/e2e-project/files/ts-solution/tsconfig.json__tmpl__ +0 -0
  100. /package/{src → dist/src}/generators/e2e-project/schema.d.ts +0 -0
  101. /package/{src → dist/src}/generators/e2e-project/schema.json +0 -0
  102. /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
  103. /package/{src → dist/src}/generators/library/files/lib/src/lib/__fileName__.spec.ts__tmpl__ +0 -0
  104. /package/{src → dist/src}/generators/library/files/lib/src/lib/__fileName__.ts__tmpl__ +0 -0
  105. /package/{src → dist/src}/generators/library/files/non-ts-solution/tsconfig.lib.json +0 -0
  106. /package/{src → dist/src}/generators/library/files/ts-solution/tsconfig.lib.json +0 -0
  107. /package/{src → dist/src}/generators/setup-docker/files/Dockerfile__tmpl__ +0 -0
  108. /package/{src → dist/src}/generators/setup-docker/schema.d.ts +0 -0
  109. /package/{src → dist/src}/generators/setup-docker/schema.json +0 -0
  110. /package/{src → dist/src}/generators/setup-docker/setup-docker.js +0 -0
  111. /package/{src → dist/src}/utils/has-webpack-plugin.js +0 -0
  112. /package/{src → dist/src}/utils/kill-port.js +0 -0
  113. /package/{src → dist/src}/utils/vscode-debug-config.js +0 -0
  114. /package/{src → dist/src}/utils/wait-for-port-open.js +0 -0
  115. /package/{utils.js → dist/utils.js} +0 -0
@@ -1,4 +1,3 @@
1
1
  export { applicationGenerator } from './src/generators/application/application';
2
2
  export { libraryGenerator } from './src/generators/library/library';
3
3
  export { initGenerator } from './src/generators/init/init';
4
- //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export type { Schema } from './src/generators/application/schema';
2
+ export { tslibVersion } from './src/utils/versions';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tslibVersion = void 0;
4
+ var versions_1 = require("./src/utils/versions");
5
+ Object.defineProperty(exports, "tslibVersion", { enumerable: true, get: function () { return versions_1.tslibVersion; } });
@@ -3,4 +3,3 @@ import { Schema } from './schema';
3
3
  export declare function applicationGenerator(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
4
4
  export declare function applicationGeneratorInternal(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
5
5
  export default applicationGenerator;
6
- //# sourceMappingURL=application.d.ts.map
@@ -1,46 +1,13 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  exports.applicationGenerator = applicationGenerator;
37
4
  exports.applicationGeneratorInternal = applicationGeneratorInternal;
5
+ const internal_1 = require("@nx/devkit/internal");
38
6
  const devkit_1 = require("@nx/devkit");
39
7
  const jest_1 = require("@nx/jest");
40
8
  const js_1 = require("@nx/js");
41
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
42
- const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
43
- const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
9
+ const internal_2 = require("@nx/js/internal");
10
+ const assert_supported_framework_version_1 = require("../../utils/assert-supported-framework-version");
44
11
  const versions_1 = require("../../utils/versions");
45
12
  const e2e_project_1 = require("../e2e-project/e2e-project");
46
13
  const init_1 = require("../init/init");
@@ -82,8 +49,9 @@ async function applicationGenerator(tree, schema) {
82
49
  });
83
50
  }
84
51
  async function applicationGeneratorInternal(tree, schema) {
52
+ (0, assert_supported_framework_version_1.assertSupportedFrameworkVersion)(tree, schema.framework);
85
53
  const tasks = [];
86
- const addTsPlugin = (0, ts_solution_setup_1.shouldConfigureTsSolutionSetup)(tree, schema.addPlugin, schema.useTsSolution);
54
+ const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(tree, schema.addPlugin, schema.useTsSolution);
87
55
  const jsInitTask = await (0, js_1.initGenerator)(tree, {
88
56
  ...schema,
89
57
  tsConfigName: schema.rootProject ? 'tsconfig.json' : 'tsconfig.base.json',
@@ -111,7 +79,7 @@ async function applicationGeneratorInternal(tree, schema) {
111
79
  return (0, devkit_1.runTasksInSerial)(...[
112
80
  ...tasks,
113
81
  () => {
114
- (0, log_show_project_command_1.logShowProjectCommand)(options.name);
82
+ (0, internal_1.logShowProjectCommand)(options.name);
115
83
  },
116
84
  ]);
117
85
  }
@@ -131,7 +99,12 @@ async function applicationGeneratorInternal(tree, schema) {
131
99
  });
132
100
  tasks.push(webpackInitTask);
133
101
  if (!options.skipPackageJson) {
134
- const { ensureDependencies } = await Promise.resolve().then(() => __importStar(require('@nx/webpack/src/utils/ensure-dependencies')));
102
+ // Use CommonJS `require` rather than a dynamic ESM `import`:
103
+ // `ensurePackage` makes the on-demand-installed package available via
104
+ // `Module._initPaths`, which `require()` honors but ESM resolution does
105
+ // not. Under nodenext, a dynamic `import()` is preserved as a true ESM
106
+ // dynamic import, so it can't see the temp install.
107
+ const { ensureDependencies, } = require('@nx/webpack/internal');
135
108
  tasks.push(ensureDependencies(tree, {
136
109
  uiFramework: options.isNest ? 'none' : 'react',
137
110
  }));
@@ -142,7 +115,7 @@ async function applicationGeneratorInternal(tree, schema) {
142
115
  // If we are using the new TS solution
143
116
  // We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
144
117
  if (options.isUsingTsSolutionConfig) {
145
- await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
118
+ await (0, internal_2.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
146
119
  }
147
120
  updateTsConfigOptions(tree, options);
148
121
  if (options.linter === 'eslint') {
@@ -206,19 +179,19 @@ async function applicationGeneratorInternal(tree, schema) {
206
179
  tasks.push(dockerTask);
207
180
  }
208
181
  if (options.isUsingTsSolutionConfig) {
209
- (0, ts_solution_setup_1.updateTsconfigFiles)(tree, options.appProjectRoot, 'tsconfig.app.json', {
182
+ (0, internal_2.updateTsconfigFiles)(tree, options.appProjectRoot, 'tsconfig.app.json', {
210
183
  module: 'nodenext',
211
184
  moduleResolution: 'nodenext',
212
185
  }, options.linter === 'eslint'
213
186
  ? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
214
187
  : undefined);
215
188
  }
216
- (0, sort_fields_1.sortPackageJsonFields)(tree, options.appProjectRoot);
189
+ (0, internal_2.sortPackageJsonFields)(tree, options.appProjectRoot);
217
190
  if (!options.skipFormat) {
218
191
  await (0, devkit_1.formatFiles)(tree);
219
192
  }
220
193
  tasks.push(() => {
221
- (0, log_show_project_command_1.logShowProjectCommand)(options.name);
194
+ (0, internal_1.logShowProjectCommand)(options.name);
222
195
  });
223
196
  return (0, devkit_1.runTasksInSerial)(...tasks);
224
197
  }
@@ -4,4 +4,3 @@ export declare function addProjectDependencies(tree: Tree, options: NormalizedSc
4
4
  installTask: GeneratorCallback;
5
5
  frameworkDependencies: Record<string, string>;
6
6
  };
7
- //# sourceMappingURL=add-dependencies.d.ts.map
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addProjectDependencies = addProjectDependencies;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const internal_1 = require("@nx/js/internal");
6
+ const versions_1 = require("../../../utils/versions");
7
+ function addProjectDependencies(tree, options) {
8
+ const bundlers = {
9
+ webpack: {
10
+ '@nx/webpack': versions_1.nxVersion,
11
+ },
12
+ esbuild: {
13
+ '@nx/esbuild': versions_1.nxVersion,
14
+ esbuild: internal_1.esbuildVersion,
15
+ },
16
+ };
17
+ const exprPkgVersions = (0, versions_1.expressVersions)(tree);
18
+ const koaPkgVersions = (0, versions_1.koaVersions)(tree);
19
+ const fastifyPkgVersions = (0, versions_1.fastifyVersions)(tree);
20
+ const frameworkDependencies = {
21
+ express: {
22
+ express: exprPkgVersions.expressVersion,
23
+ },
24
+ koa: {
25
+ koa: koaPkgVersions.koaVersion,
26
+ },
27
+ fastify: {
28
+ fastify: fastifyPkgVersions.fastifyVersion,
29
+ 'fastify-plugin': fastifyPkgVersions.fastifyPluginVersion,
30
+ '@fastify/autoload': fastifyPkgVersions.fastifyAutoloadVersion,
31
+ '@fastify/sensible': fastifyPkgVersions.fastifySensibleVersion,
32
+ },
33
+ };
34
+ const frameworkDevDependencies = {
35
+ express: {
36
+ '@types/express': exprPkgVersions.expressTypingsVersion,
37
+ },
38
+ koa: {
39
+ '@types/koa': koaPkgVersions.koaTypingsVersion,
40
+ },
41
+ fastify: {},
42
+ };
43
+ const typesNodeVersion = (0, versions_1.nodeTypesVersions)(tree).typesNodeVersion;
44
+ return {
45
+ installTask: (0, devkit_1.addDependenciesToPackageJson)(tree, {
46
+ ...frameworkDependencies[options.framework],
47
+ tslib: versions_1.tslibVersion,
48
+ }, {
49
+ ...frameworkDevDependencies[options.framework],
50
+ ...bundlers[options.bundler],
51
+ '@types/node': typesNodeVersion,
52
+ }, undefined, options.keepExistingVersions ?? true),
53
+ frameworkDependencies: frameworkDependencies[options.framework],
54
+ };
55
+ }
@@ -1,4 +1,3 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
2
  import { NormalizedSchema } from './normalized-schema';
3
3
  export declare function addLintingToApplication(tree: Tree, options: NormalizedSchema): Promise<GeneratorCallback>;
4
- //# sourceMappingURL=add-linting.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  import { NormalizedSchema } from './normalized-schema';
3
3
  export declare function addProxy(tree: Tree, options: NormalizedSchema): void;
4
- //# sourceMappingURL=add-proxy.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  import { NormalizedSchema } from './normalized-schema';
3
3
  export declare function addAppFiles(tree: Tree, options: NormalizedSchema): void;
4
- //# sourceMappingURL=create-files.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  import { NormalizedSchema } from './normalized-schema';
3
3
  export declare function addProject(tree: Tree, options: NormalizedSchema, frameworkDependencies: Record<string, string>): void;
4
- //# sourceMappingURL=create-project.d.ts.map
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addProject = addProject;
4
+ const internal_1 = require("@nx/devkit/internal");
4
5
  const devkit_1 = require("@nx/devkit");
5
- const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
6
+ const internal_2 = require("@nx/js/internal");
6
7
  const has_webpack_plugin_1 = require("../../../utils/has-webpack-plugin");
7
8
  const create_targets_1 = require("./create-targets");
8
9
  function addProject(tree, options, frameworkDependencies) {
@@ -14,17 +15,21 @@ function addProject(tree, options, frameworkDependencies) {
14
15
  tags: options.parsedTags,
15
16
  };
16
17
  if (options.bundler === 'esbuild') {
17
- (0, target_defaults_utils_1.addBuildTargetDefaults)(tree, '@nx/esbuild:esbuild');
18
+ (0, internal_1.addBuildTargetDefaults)(tree, '@nx/esbuild:esbuild', 'build', [
19
+ internal_2.TS_SOLUTION_SETUP_TSCONFIG_INPUT,
20
+ ]);
18
21
  project.targets.build = (0, create_targets_1.getEsBuildConfig)(tree, project, options);
19
22
  }
20
23
  else if (options.bundler === 'webpack') {
21
24
  if (!(0, has_webpack_plugin_1.hasWebpackPlugin)(tree) && options.addPlugin === false) {
22
- (0, target_defaults_utils_1.addBuildTargetDefaults)(tree, `@nx/webpack:webpack`);
25
+ (0, internal_1.addBuildTargetDefaults)(tree, `@nx/webpack:webpack`, 'build', [
26
+ internal_2.TS_SOLUTION_SETUP_TSCONFIG_INPUT,
27
+ ]);
23
28
  project.targets.build = (0, create_targets_1.getWebpackBuildConfig)(tree, project, options);
24
29
  }
25
30
  else if (options.isNest) {
26
31
  // If we are using Nest that has the webpack plugin we need to override the
27
- // build target so that node-env can be set to production or development so the serve target can be run in development mode
32
+ // build target so that NODE_ENV can be set to production or development so the serve target can be run in development mode
28
33
  project.targets.build = (0, create_targets_1.getNestWebpackBuildConfig)(project);
29
34
  }
30
35
  }
@@ -47,7 +52,7 @@ function addProject(tree, options, frameworkDependencies) {
47
52
  };
48
53
  }
49
54
  else {
50
- (0, devkit_1.addProjectConfiguration)(tree, options.name, project, options.standaloneConfig);
55
+ (0, devkit_1.addProjectConfiguration)(tree, options.name, project);
51
56
  }
52
57
  if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
53
58
  (0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json'), packageJson);
@@ -9,4 +9,3 @@ export declare function getPruneTargets(buildTarget: string, outputPath: string)
9
9
  'prune-lockfile': TargetConfiguration;
10
10
  'copy-workspace-modules': TargetConfiguration;
11
11
  };
12
- //# sourceMappingURL=create-targets.d.ts.map
@@ -6,10 +6,10 @@ exports.getServeConfig = getServeConfig;
6
6
  exports.getNestWebpackBuildConfig = getNestWebpackBuildConfig;
7
7
  exports.getPruneTargets = getPruneTargets;
8
8
  const devkit_1 = require("@nx/devkit");
9
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
9
+ const internal_1 = require("@nx/js/internal");
10
10
  const js_1 = require("@nx/js");
11
11
  function getWebpackBuildConfig(tree, project, options) {
12
- const sourceRoot = (0, ts_solution_setup_1.getProjectSourceRoot)(project, tree);
12
+ const sourceRoot = (0, internal_1.getProjectSourceRoot)(project, tree);
13
13
  return {
14
14
  executor: `@nx/webpack:webpack`,
15
15
  outputs: ['{options.outputPath}'],
@@ -35,7 +35,7 @@ function getWebpackBuildConfig(tree, project, options) {
35
35
  };
36
36
  }
37
37
  function getEsBuildConfig(tree, project, options) {
38
- const sourceRoot = (0, ts_solution_setup_1.getProjectSourceRoot)(project, tree);
38
+ const sourceRoot = (0, internal_1.getProjectSourceRoot)(project, tree);
39
39
  return {
40
40
  executor: '@nx/esbuild:esbuild',
41
41
  outputs: ['{options.outputPath}'],
@@ -98,12 +98,12 @@ function getNestWebpackBuildConfig(project) {
98
98
  executor: 'nx:run-commands',
99
99
  options: {
100
100
  command: 'webpack-cli build',
101
- args: ['--node-env=production'],
101
+ env: { NODE_ENV: 'production' },
102
102
  cwd: project.root,
103
103
  },
104
104
  configurations: {
105
105
  development: {
106
- args: ['--node-env=development'],
106
+ env: { NODE_ENV: 'development' },
107
107
  },
108
108
  },
109
109
  };
@@ -6,4 +6,3 @@ export * from './create-files';
6
6
  export * from './add-dependencies';
7
7
  export * from './add-linting';
8
8
  export * from './add-proxy';
9
- //# sourceMappingURL=index.d.ts.map
@@ -2,4 +2,3 @@ import { Tree } from '@nx/devkit';
2
2
  import { Schema } from '../schema';
3
3
  import { NormalizedSchema } from './normalized-schema';
4
4
  export declare function normalizeOptions(host: Tree, options: Schema): Promise<NormalizedSchema>;
5
- //# sourceMappingURL=normalize-options.d.ts.map
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = normalizeOptions;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
6
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
5
+ const internal_1 = require("@nx/devkit/internal");
6
+ const internal_2 = require("@nx/js/internal");
7
7
  async function normalizeOptions(host, options) {
8
- await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'application');
9
- const { projectName, projectRoot: appProjectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
8
+ await (0, internal_1.ensureRootProjectName)(options, 'application');
9
+ const { projectName, projectRoot: appProjectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
10
10
  name: options.name,
11
11
  projectType: 'application',
12
12
  directory: options.directory,
@@ -22,7 +22,7 @@ async function normalizeOptions(host, options) {
22
22
  const addPlugin = options.addPlugin ??
23
23
  (process.env.NX_ADD_PLUGINS !== 'false' &&
24
24
  nxJson.useInferencePlugins !== false);
25
- const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
25
+ const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(host);
26
26
  const swcJest = options.swcJest ?? isUsingTsSolutionConfig;
27
27
  const appProjectName = !isUsingTsSolutionConfig || options.name ? projectName : importPath;
28
28
  const useProjectJson = options.useProjectJson ?? !isUsingTsSolutionConfig;
@@ -6,4 +6,3 @@ export interface NormalizedSchema extends Omit<Schema, 'useTsSolution'> {
6
6
  importPath: string;
7
7
  isUsingTsSolutionConfig: boolean;
8
8
  }
9
- //# sourceMappingURL=normalized-schema.d.ts.map
@@ -16,7 +16,6 @@ export interface Schema {
16
16
  babelJest?: boolean;
17
17
  js?: boolean;
18
18
  setParserOptionsProject?: boolean;
19
- standaloneConfig?: boolean;
20
19
  bundler?: 'esbuild' | 'webpack';
21
20
  framework?: NodeJsFrameWorks;
22
21
  port?: number;
@@ -27,6 +26,7 @@ export interface Schema {
27
26
  addPlugin?: boolean;
28
27
  useTsSolution?: boolean;
29
28
  useProjectJson?: boolean;
29
+ keepExistingVersions?: boolean;
30
30
  }
31
31
 
32
32
  export type NodeJsFrameWorks = 'express' | 'koa' | 'fastify' | 'nest' | 'none';
@@ -87,12 +87,6 @@
87
87
  "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
88
88
  "default": false
89
89
  },
90
- "standaloneConfig": {
91
- "description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
92
- "type": "boolean",
93
- "default": true,
94
- "x-deprecated": "Nx only supports standaloneConfig"
95
- },
96
90
  "bundler": {
97
91
  "description": "Bundler which is used to package the application",
98
92
  "type": "string",
@@ -132,6 +126,12 @@
132
126
  "useProjectJson": {
133
127
  "type": "boolean",
134
128
  "description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
129
+ },
130
+ "keepExistingVersions": {
131
+ "type": "boolean",
132
+ "x-priority": "internal",
133
+ "description": "Keep existing dependencies versions",
134
+ "default": true
135
135
  }
136
136
  },
137
137
  "required": ["directory"]
@@ -3,4 +3,3 @@ import { Schema } from './schema';
3
3
  export declare function e2eProjectGenerator(host: Tree, options: Schema): Promise<GeneratorCallback>;
4
4
  export declare function e2eProjectGeneratorInternal(host: Tree, _options: Schema): Promise<GeneratorCallback>;
5
5
  export default e2eProjectGenerator;
6
- //# sourceMappingURL=e2e-project.d.ts.map
@@ -3,19 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.e2eProjectGenerator = e2eProjectGenerator;
4
4
  exports.e2eProjectGeneratorInternal = e2eProjectGeneratorInternal;
5
5
  const tslib_1 = require("tslib");
6
+ const internal_1 = require("@nx/devkit/internal");
6
7
  const devkit_1 = require("@nx/devkit");
7
- const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
8
8
  const eslint_1 = require("@nx/eslint");
9
- const global_eslint_config_1 = require("@nx/eslint/src/generators/init/global-eslint-config");
9
+ const internal_2 = require("@nx/eslint/internal");
10
10
  const path = tslib_1.__importStar(require("path"));
11
11
  const versions_1 = require("../../utils/versions");
12
- const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
13
- const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
14
- const config_file_1 = require("@nx/jest/src/utils/config/config-file");
15
- const versions_2 = require("@nx/jest/src/utils/versions");
16
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
12
+ const internal_3 = require("@nx/jest/internal");
13
+ const internal_4 = require("@nx/js/internal");
17
14
  const posix_1 = require("node:path/posix");
18
- const add_swc_config_1 = require("@nx/js/src/utils/swc/add-swc-config");
19
15
  async function e2eProjectGenerator(host, options) {
20
16
  return await e2eProjectGeneratorInternal(host, {
21
17
  addPlugin: false,
@@ -28,7 +24,7 @@ async function e2eProjectGeneratorInternal(host, _options) {
28
24
  const options = await normalizeOptions(host, _options);
29
25
  const appProject = (0, devkit_1.readProjectConfiguration)(host, options.project);
30
26
  // Detect Jest 30+ to use .cts config files (CommonJS TypeScript)
31
- const jestMajorVersion = (0, versions_2.getInstalledJestMajorVersion)(host);
27
+ const jestMajorVersion = (0, internal_3.getInstalledJestMajorVersion)(host);
32
28
  const useCommonJsConfig = jestMajorVersion === null || jestMajorVersion >= 30;
33
29
  const jestConfigExt = useCommonJsConfig ? 'cts' : 'ts';
34
30
  // TODO(@ndcunningham): This is broken.. the outputs are wrong.. and this isn't using the jest generator
@@ -102,7 +98,7 @@ async function e2eProjectGeneratorInternal(host, _options) {
102
98
  };
103
99
  });
104
100
  }
105
- const jestPreset = (0, config_file_1.findRootJestPreset)(host) ?? 'jest.preset.js';
101
+ const jestPreset = (0, internal_3.findRootJestPreset)(host) ?? 'jest.preset.js';
106
102
  const tsConfigFile = options.isUsingTsSolutionConfig
107
103
  ? 'tsconfig.json'
108
104
  : 'tsconfig.spec.json';
@@ -150,7 +146,7 @@ async function e2eProjectGeneratorInternal(host, _options) {
150
146
  host.rename(jestConfigPath, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'jest.config.cts'));
151
147
  }
152
148
  if (options.isUsingTsSolutionConfig) {
153
- (0, add_swc_config_1.addSwcTestConfig)(host, options.e2eProjectRoot, 'es6');
149
+ (0, internal_4.addSwcTestConfig)(host, options.e2eProjectRoot, 'es6');
154
150
  (0, devkit_1.generateFiles)(host, path.join(__dirname, 'files/ts-solution'), options.e2eProjectRoot, {
155
151
  ...options,
156
152
  relativeProjectReferencePath: (0, posix_1.relative)(options.e2eProjectRoot, appProject.root),
@@ -182,11 +178,11 @@ async function e2eProjectGeneratorInternal(host, _options) {
182
178
  addPlugin: options.addPlugin,
183
179
  });
184
180
  tasks.push(linterTask);
185
- if (options.rootProject && (0, eslint_file_1.isEslintConfigSupported)(host)) {
186
- (0, eslint_file_1.addPluginsToLintConfig)(host, options.e2eProjectRoot, '@nx');
187
- (0, eslint_file_1.replaceOverridesInLintConfig)(host, options.e2eProjectRoot, [
188
- global_eslint_config_1.typeScriptOverride,
189
- global_eslint_config_1.javaScriptOverride,
181
+ if (options.rootProject && (0, internal_2.isEslintConfigSupported)(host)) {
182
+ (0, internal_2.addPluginsToLintConfig)(host, options.e2eProjectRoot, '@nx');
183
+ (0, internal_2.replaceOverridesInLintConfig)(host, options.e2eProjectRoot, [
184
+ internal_2.typeScriptOverride,
185
+ internal_2.javaScriptOverride,
190
186
  ]);
191
187
  }
192
188
  }
@@ -203,13 +199,13 @@ async function e2eProjectGeneratorInternal(host, _options) {
203
199
  // If we are using the new TS solution
204
200
  // We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
205
201
  if (options.isUsingTsSolutionConfig) {
206
- await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(host, options.e2eProjectRoot);
202
+ await (0, internal_4.addProjectToTsSolutionWorkspace)(host, options.e2eProjectRoot);
207
203
  }
208
204
  if (!options.skipFormat) {
209
205
  await (0, devkit_1.formatFiles)(host);
210
206
  }
211
207
  tasks.push(() => {
212
- (0, log_show_project_command_1.logShowProjectCommand)(options.e2eProjectName);
208
+ (0, internal_1.logShowProjectCommand)(options.e2eProjectName);
213
209
  });
214
210
  return (0, devkit_1.runTasksInSerial)(...tasks);
215
211
  }
@@ -219,7 +215,7 @@ async function normalizeOptions(tree, options) {
219
215
  const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
220
216
  directory = `${projectConfig.root}-e2e`;
221
217
  }
222
- const { projectName: e2eProjectName, projectRoot: e2eProjectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
218
+ const { projectName: e2eProjectName, projectRoot: e2eProjectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(tree, {
223
219
  name: options.name,
224
220
  projectType: 'application',
225
221
  directory,
@@ -227,7 +223,7 @@ async function normalizeOptions(tree, options) {
227
223
  const nxJson = (0, devkit_1.readNxJson)(tree);
228
224
  const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
229
225
  nxJson.useInferencePlugins !== false;
230
- const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(tree);
226
+ const isUsingTsSolutionConfig = (0, internal_4.isUsingTsSolutionSetup)(tree);
231
227
  return {
232
228
  addPlugin,
233
229
  ...options,
@@ -2,4 +2,3 @@ import { GeneratorCallback, Tree } from '@nx/devkit';
2
2
  import { Schema } from './schema';
3
3
  export declare function initGenerator(tree: Tree, options: Schema): Promise<GeneratorCallback>;
4
4
  export default initGenerator;
5
- //# sourceMappingURL=init.d.ts.map
@@ -6,7 +6,7 @@ const versions_1 = require("../../utils/versions");
6
6
  function updateDependencies(tree, options) {
7
7
  const tasks = [];
8
8
  tasks.push((0, devkit_1.removeDependenciesFromPackageJson)(tree, ['@nx/node'], []));
9
- tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@nx/node': versions_1.nxVersion }, undefined, options.keepExistingVersions));
9
+ tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@nx/node': versions_1.nxVersion }, undefined, options.keepExistingVersions ?? true));
10
10
  return (0, devkit_1.runTasksInSerial)(...tasks);
11
11
  }
12
12
  async function initGenerator(tree, options) {
@@ -20,7 +20,7 @@
20
20
  "type": "boolean",
21
21
  "x-priority": "internal",
22
22
  "description": "Keep existing dependencies versions",
23
- "default": false
23
+ "default": true
24
24
  }
25
25
  },
26
26
  "required": []
@@ -11,4 +11,3 @@ export interface NormalizedSchema extends Schema {
11
11
  export declare function libraryGenerator(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
12
12
  export declare function libraryGeneratorInternal(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
13
13
  export default libraryGenerator;
14
- //# sourceMappingURL=library.d.ts.map
@@ -2,17 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.libraryGenerator = libraryGenerator;
4
4
  exports.libraryGeneratorInternal = libraryGeneratorInternal;
5
+ const internal_1 = require("@nx/devkit/internal");
5
6
  const devkit_1 = require("@nx/devkit");
6
- const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
7
7
  const js_1 = require("@nx/js");
8
- const add_swc_config_1 = require("@nx/js/src/utils/swc/add-swc-config");
9
- const add_swc_dependencies_1 = require("@nx/js/src/utils/swc/add-swc-dependencies");
8
+ const internal_2 = require("@nx/js/internal");
10
9
  const path_1 = require("path");
11
10
  const versions_1 = require("../../utils/versions");
12
11
  const init_1 = require("../init/init");
13
- const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
14
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
15
- const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
16
12
  async function libraryGenerator(tree, schema) {
17
13
  return await libraryGeneratorInternal(tree, {
18
14
  addPlugin: false,
@@ -25,7 +21,7 @@ async function libraryGeneratorInternal(tree, schema) {
25
21
  // If we are using the new TS solution
26
22
  // We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
27
23
  if (options.isUsingTsSolutionConfig) {
28
- await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.projectRoot);
24
+ await (0, internal_2.addProjectToTsSolutionWorkspace)(tree, options.projectRoot);
29
25
  }
30
26
  const tasks = [];
31
27
  if (options.publishable === true && !schema.importPath) {
@@ -67,7 +63,7 @@ async function libraryGeneratorInternal(tree, schema) {
67
63
  if (options.isUsingTsSolutionConfig) {
68
64
  tasks.push(() => (0, devkit_1.installPackagesTask)(tree, true));
69
65
  }
70
- (0, sort_fields_1.sortPackageJsonFields)(tree, options.projectRoot);
66
+ (0, internal_2.sortPackageJsonFields)(tree, options.projectRoot);
71
67
  if (!schema.skipFormat) {
72
68
  await (0, devkit_1.formatFiles)(tree);
73
69
  }
@@ -75,8 +71,8 @@ async function libraryGeneratorInternal(tree, schema) {
75
71
  }
76
72
  exports.default = libraryGenerator;
77
73
  async function normalizeOptions(tree, options) {
78
- await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'library');
79
- const { projectName, names: projectNames, projectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
74
+ await (0, internal_1.ensureRootProjectName)(options, 'library');
75
+ const { projectName, names: projectNames, projectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(tree, {
80
76
  name: options.name,
81
77
  projectType: 'library',
82
78
  directory: options.directory,
@@ -95,8 +91,8 @@ async function normalizeOptions(tree, options) {
95
91
  // this helper is called before the jsLibraryGenerator is called, so, if the
96
92
  // TS solution setup is not configured, we additionally check if the TS
97
93
  // solution setup will be configured by the jsLibraryGenerator
98
- const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(tree) ||
99
- (0, ts_solution_setup_1.shouldConfigureTsSolutionSetup)(tree, options.addPlugin);
94
+ const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(tree) ||
95
+ (0, internal_2.shouldConfigureTsSolutionSetup)(tree, options.addPlugin);
100
96
  return {
101
97
  ...options,
102
98
  fileName,
@@ -132,7 +128,7 @@ function updateProject(tree, options) {
132
128
  const project = (0, devkit_1.readProjectConfiguration)(tree, options.projectName);
133
129
  const rootProject = options.projectRoot === '.' || options.projectRoot === '';
134
130
  project.targets = project.targets || {};
135
- (0, target_defaults_utils_1.addBuildTargetDefaults)(tree, `@nx/js:${options.compiler}`);
131
+ (0, internal_1.addBuildTargetDefaults)(tree, `@nx/js:${options.compiler}`);
136
132
  // For TS solution, we want tsc build to be inferred by `@nx/js/typescript` plugin.
137
133
  if (!options.isUsingTsSolutionConfig || options.compiler === 'swc') {
138
134
  project.targets.build = {
@@ -153,8 +149,8 @@ function updateProject(tree, options) {
153
149
  };
154
150
  }
155
151
  if (options.compiler === 'swc') {
156
- (0, add_swc_dependencies_1.addSwcDependencies)(tree);
157
- (0, add_swc_config_1.addSwcConfig)(tree, options.projectRoot);
152
+ (0, internal_2.addSwcDependencies)(tree);
153
+ (0, internal_2.addSwcConfig)(tree, options.projectRoot);
158
154
  }
159
155
  if (options.rootDir) {
160
156
  project.targets.build.options.srcRootForCompilationRoot = options.rootDir;
@@ -17,7 +17,6 @@ export interface Schema {
17
17
  babelJest?: boolean;
18
18
  js?: boolean;
19
19
  strict?: boolean;
20
- standaloneConfig?: boolean;
21
20
  setParserOptionsProject?: boolean;
22
21
  compiler: 'tsc' | 'swc';
23
22
  addPlugin?: boolean;