@nx/angular 23.2.0-beta.0 → 23.2.0-beta.10

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 (63) hide show
  1. package/dist/src/builders/dev-server/dev-server.impl.js +6 -8
  2. package/dist/src/builders/webpack-browser/webpack-browser.impl.js +5 -6
  3. package/dist/src/executors/application/application.impl.js +1 -1
  4. package/dist/src/executors/browser-esbuild/browser-esbuild.impl.js +1 -1
  5. package/dist/src/executors/extract-i18n/extract-i18n.impl.js +3 -3
  6. package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +1 -1
  7. package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +2 -3
  8. package/dist/src/executors/unit-test/unit-test.impl.js +1 -1
  9. package/dist/src/generators/add-linting/add-linting.js +44 -22
  10. package/dist/src/generators/add-linting/schema.d.ts +7 -0
  11. package/dist/src/generators/add-linting/schema.json +15 -4
  12. package/dist/src/generators/application/lib/add-e2e.js +3 -2
  13. package/dist/src/generators/application/lib/add-linting.js +3 -1
  14. package/dist/src/generators/application/lib/create-files.js +3 -3
  15. package/dist/src/generators/application/lib/normalize-options.js +5 -1
  16. package/dist/src/generators/application/lib/normalized-schema.d.ts +2 -2
  17. package/dist/src/generators/application/lib/set-generator-defaults.js +3 -1
  18. package/dist/src/generators/application/schema.d.ts +7 -2
  19. package/dist/src/generators/application/schema.json +15 -5
  20. package/dist/src/generators/component-test/component-test.js +2 -0
  21. package/dist/src/generators/convert-to-rspack/convert-to-rspack.js +1 -5
  22. package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.js +2 -0
  23. package/dist/src/generators/host/host.js +7 -1
  24. package/dist/src/generators/host/schema.d.ts +6 -2
  25. package/dist/src/generators/host/schema.json +10 -5
  26. package/dist/src/generators/library/lib/create-files.js +3 -0
  27. package/dist/src/generators/library/lib/normalize-options.js +4 -2
  28. package/dist/src/generators/library/lib/normalized-schema.d.ts +6 -2
  29. package/dist/src/generators/library/lib/set-generator-defaults.js +5 -1
  30. package/dist/src/generators/library/library.js +5 -3
  31. package/dist/src/generators/library/schema.d.ts +6 -2
  32. package/dist/src/generators/library/schema.json +10 -5
  33. package/dist/src/generators/ng-add/migrators/projects/lib.migrator.js +1 -2
  34. package/dist/src/generators/ng-add/schema.d.ts +2 -2
  35. package/dist/src/generators/ng-add/schema.json +1 -3
  36. package/dist/src/generators/ng-add/utilities/format-files-task.js +2 -2
  37. package/dist/src/generators/ng-add/utilities/projects.js +2 -2
  38. package/dist/src/generators/ng-add/utilities/workspace.js +3 -4
  39. package/dist/src/generators/remote/remote.js +4 -3
  40. package/dist/src/generators/remote/schema.d.ts +6 -2
  41. package/dist/src/generators/remote/schema.json +10 -5
  42. package/dist/src/generators/scam-to-standalone/lib/get-component-data-from-ast.d.ts +1 -1
  43. package/dist/src/generators/scam-to-standalone/lib/get-target-project.d.ts +1 -1
  44. package/dist/src/generators/scam-to-standalone/lib/replace-module-usages-with-component.d.ts +1 -1
  45. package/dist/src/generators/setup-mf/lib/generate-config.js +2 -1
  46. package/dist/src/generators/setup-mf/schema.d.ts +4 -0
  47. package/dist/src/generators/setup-mf/schema.json +8 -2
  48. package/dist/src/generators/storybook-configuration/schema.d.ts +2 -2
  49. package/dist/src/generators/storybook-configuration/schema.json +1 -2
  50. package/dist/src/generators/utils/add-vitest.js +1 -2
  51. package/dist/src/generators/utils/tsconfig-utils.js +2 -7
  52. package/dist/src/migrations/update-20-2-0/migrate-mf-imports-to-new-package.js +2 -3
  53. package/dist/src/migrations/update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence.js +3 -4
  54. package/dist/src/plugins/plugin.js +2 -4
  55. package/dist/src/utils/assert-cypress-component-testing-support.d.ts +6 -0
  56. package/dist/src/utils/assert-cypress-component-testing-support.js +31 -0
  57. package/dist/src/utils/versions.d.ts +4 -4
  58. package/dist/src/utils/versions.js +4 -4
  59. package/dist/tailwind.d.ts +1 -1
  60. package/dist/tailwind.js +2 -2
  61. package/generators.json +1 -1
  62. package/migrations.json +161 -0
  63. package/package.json +19 -12
@@ -1,4 +1,4 @@
1
- import type { Linter, LinterType } from '@nx/eslint';
1
+ import type { LinterType } from '@nx/js';
2
2
  import type { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners';
3
3
  import type { Styles } from '../utils/types';
4
4
 
@@ -9,6 +9,10 @@ export interface Schema {
9
9
  port?: number;
10
10
  remotes?: string[];
11
11
  dynamic?: boolean;
12
+ enableTypedLinting?: boolean;
13
+ /**
14
+ * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
15
+ */
12
16
  setParserOptionsProject?: boolean;
13
17
  skipPackageJson?: boolean;
14
18
  skipPostInstall?: boolean;
@@ -16,7 +20,7 @@ export interface Schema {
16
20
  style?: Styles;
17
21
  skipTests?: boolean;
18
22
  tags?: string;
19
- linter?: Linter | LinterType;
23
+ linter?: LinterType;
20
24
  unitTestRunner?: Exclude<UnitTestRunner, UnitTestRunner.VitestAngular>;
21
25
  e2eTestRunner?: E2eTestRunner;
22
26
  backendProject?: string;
@@ -139,10 +139,9 @@
139
139
  "description": "Add tags to the application (used for linting)."
140
140
  },
141
141
  "linter": {
142
- "description": "The tool to use for running lint checks.",
142
+ "description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
143
143
  "type": "string",
144
- "enum": ["eslint", "none"],
145
- "default": "eslint"
144
+ "enum": ["eslint", "oxlint", "none"]
146
145
  },
147
146
  "backendProject": {
148
147
  "type": "string",
@@ -153,11 +152,17 @@
153
152
  "description": "Create an application with stricter type checking and build optimization options.",
154
153
  "default": true
155
154
  },
156
- "setParserOptionsProject": {
155
+ "enableTypedLinting": {
157
156
  "type": "boolean",
158
- "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
157
+ "description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
159
158
  "default": false
160
159
  },
160
+ "setParserOptionsProject": {
161
+ "type": "boolean",
162
+ "description": "Deprecated alias for `enableTypedLinting`.",
163
+ "default": false,
164
+ "x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
165
+ },
161
166
  "skipFormat": {
162
167
  "description": "Skip formatting files.",
163
168
  "type": "boolean",
@@ -41,6 +41,9 @@ function createFiles(tree, options, project) {
41
41
  tpl: '',
42
42
  };
43
43
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files/base'), options.libraryOptions.projectRoot, substitutions);
44
+ if (options.libraryOptions.buildable && !options.libraryOptions.publishable) {
45
+ (0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(options.libraryOptions.projectRoot, 'package.json'), (json) => ({ ...json, private: true }));
46
+ }
44
47
  if (options.libraryOptions.standalone) {
45
48
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files/standalone-components'), options.libraryOptions.projectRoot, substitutions);
46
49
  }
@@ -6,12 +6,14 @@ const internal_1 = require("@nx/devkit/internal");
6
6
  const test_runners_1 = require("../../../utils/test-runners");
7
7
  const artifact_types_1 = require("../../utils/artifact-types");
8
8
  const version_utils_1 = require("../../utils/version-utils");
9
+ const internal_2 = require("@nx/js/internal");
9
10
  async function normalizeOptions(host, schema) {
10
11
  schema.standalone = schema.standalone ?? true;
11
12
  // Create a schema with populated default values
13
+ // No `linter` default here: it would mask the resolution below, which is what
14
+ // detects the workspace's linter and prompts when there is nothing to detect.
12
15
  const options = {
13
16
  buildable: false,
14
- linter: 'eslint',
15
17
  publishable: false,
16
18
  skipFormat: false,
17
19
  // Publishable libs cannot use `full` yet, so if its false then use the passed value or default to `full`
@@ -45,7 +47,7 @@ async function normalizeOptions(host, schema) {
45
47
  const ngCliSchematicLibRoot = projectName;
46
48
  const allNormalizedOptions = {
47
49
  ...options,
48
- linter: options.linter ?? 'eslint',
50
+ linter: await (0, internal_2.normalizeLinterOption)(host, options.linter),
49
51
  unitTestRunner,
50
52
  prefix: options.prefix ?? 'lib',
51
53
  name: projectName,
@@ -1,5 +1,5 @@
1
1
  import { UnitTestRunner } from '../../../utils/test-runners';
2
- import type { Linter, LinterType } from '@nx/eslint';
2
+ import type { LinterType } from '@nx/js';
3
3
  export interface NormalizedSchema {
4
4
  libraryOptions: {
5
5
  directory: string;
@@ -18,13 +18,17 @@ export interface NormalizedSchema {
18
18
  tags?: string;
19
19
  strict?: boolean;
20
20
  compilationMode?: 'full' | 'partial';
21
+ enableTypedLinting?: boolean;
22
+ /**
23
+ * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
24
+ */
21
25
  setParserOptionsProject?: boolean;
22
26
  skipModule?: boolean;
23
27
  skipPackageJson?: boolean;
24
28
  skipPostInstall?: boolean;
25
29
  skipTsConfig?: boolean;
26
30
  standalone?: boolean;
27
- linter: Linter | LinterType;
31
+ linter: LinterType;
28
32
  unitTestRunner: UnitTestRunner;
29
33
  prefix: string;
30
34
  fileName: string;
@@ -6,7 +6,11 @@ function setGeneratorDefaults(tree, options) {
6
6
  const nxJson = (0, devkit_1.readNxJson)(tree);
7
7
  nxJson.generators = nxJson.generators ?? {};
8
8
  nxJson.generators['@nx/angular:library'] = {
9
- linter: options.libraryOptions.linter,
9
+ // Pinning `none` would freeze the answer detection exists to give, so a
10
+ // workspace that adopts a linter later would keep getting none.
11
+ linter: options.libraryOptions.linter === 'none'
12
+ ? undefined
13
+ : options.libraryOptions.linter,
10
14
  unitTestRunner: options.libraryOptions.unitTestRunner,
11
15
  strict: !options.libraryOptions.strict ? false : undefined,
12
16
  ...(nxJson.generators['@nx/angular:library'] || {}),
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.libraryGenerator = libraryGenerator;
4
4
  const tslib_1 = require("tslib");
5
5
  const internal_1 = require("@nx/devkit/internal");
6
+ const internal_2 = require("@nx/eslint/internal");
6
7
  const devkit_1 = require("@nx/devkit");
7
8
  const js_1 = require("@nx/js");
8
- const internal_2 = require("@nx/js/internal");
9
+ const internal_3 = require("@nx/js/internal");
9
10
  const init_1 = tslib_1.__importDefault(require("../../generators/init/init"));
10
11
  const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
11
12
  const test_runners_1 = require("../../utils/test-runners");
@@ -71,7 +72,7 @@ async function libraryGenerator(tree, schema) {
71
72
  () => (0, devkit_1.installPackagesTask)(tree),
72
73
  ];
73
74
  if (libraryOptions.publishable) {
74
- tasks.push(await (0, internal_2.releaseTasks)(tree));
75
+ tasks.push(await (0, internal_3.releaseTasks)(tree));
75
76
  }
76
77
  tasks.push(() => (0, internal_1.logShowProjectCommand)(libraryOptions.name));
77
78
  return (0, devkit_1.runTasksInSerial)(...tasks);
@@ -119,11 +120,12 @@ async function addLinting(host, options) {
119
120
  return;
120
121
  }
121
122
  await (0, add_linting_1.default)(host, {
123
+ linter: options.linter,
122
124
  projectName: options.name,
123
125
  projectRoot: options.projectRoot,
124
126
  prefix: options.prefix,
125
127
  unitTestRunner: options.unitTestRunner,
126
- setParserOptionsProject: options.setParserOptionsProject,
128
+ enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(options),
127
129
  skipFormat: true,
128
130
  skipPackageJson: options.skipPackageJson,
129
131
  });
@@ -1,4 +1,4 @@
1
- import type { Linter, LinterType } from '@nx/eslint';
1
+ import type { LinterType } from '@nx/js';
2
2
  import type { UnitTestRunner } from '../../utils/test-runners';
3
3
 
4
4
  export interface Schema {
@@ -19,9 +19,13 @@ export interface Schema {
19
19
  parent?: string;
20
20
  tags?: string;
21
21
  strict?: boolean;
22
- linter?: Linter | LinterType;
22
+ linter?: LinterType;
23
23
  unitTestRunner?: UnitTestRunner;
24
24
  compilationMode?: 'full' | 'partial';
25
+ enableTypedLinting?: boolean;
26
+ /**
27
+ * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
28
+ */
25
29
  setParserOptionsProject?: boolean;
26
30
  skipModule?: boolean;
27
31
  skipPackageJson?: boolean;
@@ -97,21 +97,26 @@
97
97
  "default": true
98
98
  },
99
99
  "linter": {
100
- "description": "The tool to use for running lint checks.",
100
+ "description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
101
101
  "type": "string",
102
- "enum": ["eslint", "none"],
103
- "default": "eslint"
102
+ "enum": ["eslint", "oxlint", "none"]
104
103
  },
105
104
  "compilationMode": {
106
105
  "description": "Specifies the compilation mode to use. If not specified, it will default to `partial` for publishable libraries and to `full` for buildable libraries. The `full` value can not be used for publishable libraries.",
107
106
  "type": "string",
108
107
  "enum": ["full", "partial"]
109
108
  },
110
- "setParserOptionsProject": {
109
+ "enableTypedLinting": {
111
110
  "type": "boolean",
112
- "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
111
+ "description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
113
112
  "default": false
114
113
  },
114
+ "setParserOptionsProject": {
115
+ "type": "boolean",
116
+ "description": "Deprecated alias for `enableTypedLinting`.",
117
+ "default": false,
118
+ "x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
119
+ },
115
120
  "skipModule": {
116
121
  "type": "boolean",
117
122
  "description": "Whether to skip the creation of a default module when generating the library.",
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LibMigrator = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const devkit_2 = require("@nx/devkit");
6
5
  const utilities_1 = require("../../utilities");
7
6
  const builders_1 = require("../builders");
8
7
  const project_migrator_1 = require("./project.migrator");
@@ -46,7 +45,7 @@ class LibMigrator extends project_migrator_1.ProjectMigrator {
46
45
  !Object.keys(this.projectConfig.targets).length) {
47
46
  this.logger.warn('The project does not have any targets configured. This might not be an issue. Skipping updating targets.');
48
47
  }
49
- (0, devkit_2.updateProjectConfiguration)(this.tree, this.project.name, {
48
+ (0, devkit_1.updateProjectConfiguration)(this.tree, this.project.name, {
50
49
  ...this.projectConfig,
51
50
  });
52
51
  }
@@ -1,4 +1,4 @@
1
- import { Linter, LinterType } from '@nx/eslint';
1
+ import { LinterType } from '@nx/js';
2
2
  import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners';
3
3
  import type { Styles } from '../utils/types';
4
4
 
@@ -11,6 +11,6 @@ export interface GeneratorOptions {
11
11
  skipInstall?: boolean;
12
12
  skipPostInstall?: boolean;
13
13
  style?: Styles;
14
- linter?: Linter | LinterType;
14
+ linter?: LinterType;
15
15
  skipPackageJson?: boolean;
16
16
  }
@@ -17,7 +17,6 @@
17
17
  "default": false,
18
18
  "x-priority": "internal"
19
19
  },
20
-
21
20
  "unitTestRunner": {
22
21
  "type": "string",
23
22
  "enum": ["karma", "jest", "none"],
@@ -39,8 +38,7 @@
39
38
  "linter": {
40
39
  "description": "The tool to use for running lint checks. NOTE: only used if running the generator in an Nx workspace.",
41
40
  "type": "string",
42
- "enum": ["eslint", "none"],
43
- "default": "eslint"
41
+ "enum": ["eslint", "oxlint", "none"]
44
42
  },
45
43
  "style": {
46
44
  "description": "The file extension to be used for style files. NOTE: only used if running the generator in an Nx workspace.",
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatFilesTask = formatFilesTask;
4
- const child_process_1 = require("nx/src/utils/child-process");
4
+ const internal_1 = require("@nx/devkit/internal");
5
5
  function formatFilesTask(tree) {
6
6
  if (!tree
7
7
  .listChanges()
@@ -9,7 +9,7 @@ function formatFilesTask(tree) {
9
9
  return;
10
10
  }
11
11
  try {
12
- (0, child_process_1.runNxSync)(`format`, { cwd: tree.root, stdio: [0, 1, 2] });
12
+ (0, internal_1.runNxSync)(`format`, { cwd: tree.root, stdio: [0, 1, 2] });
13
13
  }
14
14
  catch { }
15
15
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAllProjects = getAllProjects;
4
4
  exports.convertToNxProject = convertToNxProject;
5
5
  const devkit_1 = require("@nx/devkit");
6
- const angular_json_1 = require("nx/src/adapter/angular-json");
6
+ const internal_1 = require("@nx/devkit/internal");
7
7
  function getAllProjects(tree) {
8
8
  const projects = (0, devkit_1.getProjects)(tree);
9
9
  const result = {
@@ -26,7 +26,7 @@ function getAllProjects(tree) {
26
26
  }
27
27
  function convertToNxProject(tree, projectName) {
28
28
  const angularJson = (0, devkit_1.readJson)(tree, 'angular.json');
29
- const project = (0, angular_json_1.toNewFormat)(angularJson).projects[projectName];
29
+ const project = (0, internal_1.toNewFormat)(angularJson).projects[projectName];
30
30
  project.name = projectName;
31
31
  (0, devkit_1.addProjectConfiguration)(tree, projectName, project);
32
32
  delete angularJson.projects[projectName];
@@ -17,11 +17,10 @@ const devkit_1 = require("@nx/devkit");
17
17
  const eslint_1 = require("@nx/eslint");
18
18
  const internal_1 = require("@nx/eslint/internal");
19
19
  const js_1 = require("@nx/js");
20
- const default_base_1 = require("nx/src/utils/default-base");
21
20
  const internal_2 = require("@nx/js/internal");
22
- const angular_json_1 = require("nx/src/adapter/angular-json");
23
21
  const versions_1 = require("../../../utils/versions");
24
22
  const path_1 = require("path");
23
+ const internal_3 = require("@nx/devkit/internal");
25
24
  function validateWorkspace(tree) {
26
25
  const errors = [];
27
26
  if (!tree.exists('package.json')) {
@@ -40,7 +39,7 @@ function validateWorkspace(tree) {
40
39
  function createNxJson(tree, options, defaultProject) {
41
40
  const targets = getWorkspaceCommonTargets(tree);
42
41
  (0, devkit_1.writeJson)(tree, 'nx.json', {
43
- defaultBase: options.defaultBase ?? (0, default_base_1.deduceDefaultBase)(),
42
+ defaultBase: options.defaultBase ?? (0, internal_3.deduceDefaultBase)(),
44
43
  namedInputs: {
45
44
  sharedGlobals: [],
46
45
  default: ['{projectRoot}/**/*', 'sharedGlobals'],
@@ -278,7 +277,7 @@ function updateVsCodeRecommendedExtensions(tree) {
278
277
  }
279
278
  }
280
279
  function deleteAngularJson(tree) {
281
- const projects = (0, angular_json_1.toNewFormat)((0, devkit_1.readJson)(tree, 'angular.json')).projects;
280
+ const projects = (0, internal_3.toNewFormat)((0, devkit_1.readJson)(tree, 'angular.json')).projects;
282
281
  if (!Object.keys(projects).length) {
283
282
  tree.delete('angular.json');
284
283
  }
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.remote = remote;
4
4
  const tslib_1 = require("tslib");
5
5
  const internal_1 = require("@nx/devkit/internal");
6
+ const internal_2 = require("@nx/eslint/internal");
6
7
  const devkit_1 = require("@nx/devkit");
7
- const internal_2 = require("@nx/js/internal");
8
+ const internal_3 = require("@nx/js/internal");
8
9
  const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
9
10
  const test_runners_1 = require("../../utils/test-runners");
10
11
  const application_1 = require("../application/application");
@@ -68,12 +69,12 @@ async function remote(tree, schema) {
68
69
  standalone: options.standalone,
69
70
  prefix: options.prefix,
70
71
  typescriptConfiguration,
71
- setParserOptionsProject: options.setParserOptionsProject,
72
+ enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(options),
72
73
  });
73
74
  const installTasks = [appInstallTask];
74
75
  if (!options.skipPackageJson) {
75
76
  const installSwcHelpersTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
76
- '@swc/helpers': internal_2.swcHelpersVersion,
77
+ '@swc/helpers': internal_3.swcHelpersVersion,
77
78
  });
78
79
  installTasks.push(installSwcHelpersTask);
79
80
  }
@@ -1,4 +1,4 @@
1
- import type { Linter, LinterType } from '@nx/eslint';
1
+ import type { LinterType } from '@nx/js';
2
2
  import type { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners';
3
3
  import type { Styles } from '../utils/types';
4
4
 
@@ -8,13 +8,17 @@ export interface Schema {
8
8
  bundler?: 'webpack' | 'rspack';
9
9
  host?: string;
10
10
  port?: number;
11
+ enableTypedLinting?: boolean;
12
+ /**
13
+ * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
14
+ */
11
15
  setParserOptionsProject?: boolean;
12
16
  skipPackageJson?: boolean;
13
17
  prefix?: string;
14
18
  style?: Styles;
15
19
  skipTests?: boolean;
16
20
  tags?: string;
17
- linter?: Linter | LinterType;
21
+ linter?: LinterType;
18
22
  unitTestRunner?: Exclude<UnitTestRunner, UnitTestRunner.VitestAngular>;
19
23
  e2eTestRunner?: E2eTestRunner;
20
24
  backendProject?: string;
@@ -129,10 +129,9 @@
129
129
  "description": "Add tags to the application (used for linting)."
130
130
  },
131
131
  "linter": {
132
- "description": "The tool to use for running lint checks.",
132
+ "description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
133
133
  "type": "string",
134
- "enum": ["eslint", "none"],
135
- "default": "eslint"
134
+ "enum": ["eslint", "oxlint", "none"]
136
135
  },
137
136
  "backendProject": {
138
137
  "type": "string",
@@ -143,11 +142,17 @@
143
142
  "description": "Create an application with stricter type checking and build optimization options.",
144
143
  "default": true
145
144
  },
146
- "setParserOptionsProject": {
145
+ "enableTypedLinting": {
147
146
  "type": "boolean",
148
- "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
147
+ "description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
149
148
  "default": false
150
149
  },
150
+ "setParserOptionsProject": {
151
+ "type": "boolean",
152
+ "description": "Deprecated alias for `enableTypedLinting`.",
153
+ "default": false,
154
+ "x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
155
+ },
151
156
  "skipFormat": {
152
157
  "description": "Skip formatting files.",
153
158
  "type": "boolean",
@@ -1,4 +1,4 @@
1
- import type { Tree } from 'nx/src/generators/tree';
1
+ import { type Tree } from '@nx/devkit';
2
2
  export declare function getComponentDataFromAST(tree: Tree, normalizedComponentPath: string): {
3
3
  componentFileContents: string;
4
4
  componentAST: any;
@@ -1,2 +1,2 @@
1
- import { ProjectConfiguration } from 'nx/src/config/workspace-json-project-json';
1
+ import { ProjectConfiguration } from '@nx/devkit';
2
2
  export declare function getTargetProject(projectName: string, projects: Map<string, ProjectConfiguration>): ProjectConfiguration;
@@ -1,2 +1,2 @@
1
- import { Tree } from 'nx/src/generators/tree';
1
+ import { Tree } from '@nx/devkit';
2
2
  export declare function replaceModuleUsagesWithComponent(tree: Tree, moduleName: string, componentName: string): void;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generateWebpackConfig = generateWebpackConfig;
4
4
  const devkit_1 = require("@nx/devkit");
5
+ const internal_1 = require("@nx/eslint/internal");
5
6
  function generateWebpackConfig(tree, options, appRoot, remotesWithPorts) {
6
7
  if (tree.exists(`${appRoot}/module-federation.config.js`) ||
7
8
  tree.exists(`${appRoot}/webpack.config.js`) ||
@@ -25,7 +26,7 @@ function generateWebpackConfig(tree, options, appRoot, remotesWithPorts) {
25
26
  standalone: options.standalone,
26
27
  entryModuleFileName: options.entryModuleFileName,
27
28
  });
28
- if (!options.setParserOptionsProject) {
29
+ if (!(0, internal_1.isTypedLintingEnabled)(options)) {
29
30
  tree.delete((0, devkit_1.joinPathFragments)(appRoot, 'tsconfig.lint.json'));
30
31
  }
31
32
  }
@@ -17,6 +17,10 @@ export interface Schema {
17
17
  standalone?: boolean;
18
18
  skipE2E?: boolean;
19
19
  typescriptConfiguration?: boolean;
20
+ enableTypedLinting?: boolean;
21
+ /**
22
+ * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
23
+ */
20
24
  setParserOptionsProject?: boolean;
21
25
  }
22
26
 
@@ -81,10 +81,16 @@
81
81
  "description": "Whether the module federation configuration and webpack configuration files should use TS.",
82
82
  "default": true
83
83
  },
84
- "setParserOptionsProject": {
84
+ "enableTypedLinting": {
85
85
  "type": "boolean",
86
- "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
86
+ "description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
87
87
  "default": false
88
+ },
89
+ "setParserOptionsProject": {
90
+ "type": "boolean",
91
+ "description": "Deprecated alias for `enableTypedLinting`.",
92
+ "default": false,
93
+ "x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
88
94
  }
89
95
  },
90
96
  "required": ["appName", "mfType"],
@@ -1,9 +1,9 @@
1
- import type { Linter, LinterType } from '@nx/eslint';
1
+ import type { LinterType } from '@nx/js';
2
2
 
3
3
  export interface StorybookConfigurationOptions {
4
4
  configureStaticServe?: boolean;
5
5
  generateStories: boolean;
6
- linter: Linter | LinterType;
6
+ linter: LinterType;
7
7
  project: string;
8
8
  tsConfiguration?: boolean;
9
9
  skipFormat?: boolean;
@@ -43,8 +43,7 @@
43
43
  "linter": {
44
44
  "description": "The tool to use for running lint checks.",
45
45
  "type": "string",
46
- "enum": ["eslint", "none"],
47
- "default": "eslint"
46
+ "enum": ["eslint", "oxlint", "none"]
48
47
  },
49
48
  "tsConfiguration": {
50
49
  "type": "boolean",
@@ -4,7 +4,6 @@ exports.addVitestAngular = addVitestAngular;
4
4
  exports.addVitestAnalog = addVitestAnalog;
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const internal_1 = require("@nx/devkit/internal");
7
- const devkit_internals_1 = require("nx/src/devkit-internals");
8
7
  const semver_1 = require("semver");
9
8
  const versions_1 = require("../../utils/versions");
10
9
  const version_utils_1 = require("./version-utils");
@@ -90,7 +89,7 @@ function validateVitestVersion(tree) {
90
89
  let installedVitestVersion = null;
91
90
  // Try to get the actual installed version from node_modules
92
91
  try {
93
- const { packageJson } = (0, devkit_internals_1.readModulePackageJson)('vitest');
92
+ const { packageJson } = (0, internal_1.readModulePackageJson)('vitest');
94
93
  installedVitestVersion = packageJson.version;
95
94
  }
96
95
  catch { }
@@ -18,12 +18,7 @@ function getDefinedCompilerOption(tree, tsConfigPath, optionName) {
18
18
  }
19
19
  function readCompilerOptionsFromTsConfig(tree, tsConfigPath) {
20
20
  const ts = (0, internal_1.ensureTypescript)();
21
- const tsSysFromTree = {
22
- ...ts.sys,
23
- readDirectory: () => [],
24
- readFile: (path) => tree.read(path, 'utf-8'),
25
- fileExists: (path) => tree.exists(path),
26
- };
27
- const parsed = ts.parseJsonConfigFileContent(ts.readConfigFile(tsConfigPath, tsSysFromTree.readFile).config, tsSysFromTree, (0, node_path_1.dirname)(tsConfigPath));
21
+ const host = (0, internal_1.createTreeParseConfigHost)(tree);
22
+ const parsed = ts.parseJsonConfigFileContent(ts.readConfigFile(tsConfigPath, host.readFile).config, host, (0, node_path_1.dirname)(tsConfigPath));
28
23
  return parsed.options;
29
24
  }
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = migrateMfImportsToNewPackage;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const devkit_2 = require("@nx/devkit");
6
5
  const tsquery_1 = require("@phenomnomnominal/tsquery");
7
6
  const MF_IMPORT_TO_UPDATE = 'ModuleFederationConfig';
8
7
  const MF_CONFIG_IMPORT_SELECTOR = `ImportDeclaration:has(StringLiteral[value=@nx/webpack]):has(Identifier[name=ModuleFederationConfig])`;
@@ -23,7 +22,7 @@ async function migrateMfImportsToNewPackage(tree) {
23
22
  }
24
23
  }
25
24
  for (const root of rootsToCheck) {
26
- (0, devkit_2.visitNotIgnoredFiles)(tree, root, (filePath) => {
25
+ (0, devkit_1.visitNotIgnoredFiles)(tree, root, (filePath) => {
27
26
  if (!filePath.endsWith('.ts') && !filePath.endsWith('.js')) {
28
27
  return;
29
28
  }
@@ -57,5 +56,5 @@ async function migrateMfImportsToNewPackage(tree) {
57
56
  tree.write(filePath, contents);
58
57
  });
59
58
  }
60
- await (0, devkit_2.formatFiles)(tree);
59
+ await (0, devkit_1.formatFiles)(tree);
61
60
  }
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = default_1;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const internal_1 = require("@nx/js/internal");
6
- const project_graph_1 = require("nx/src/config/project-graph");
7
- const nx_deps_cache_1 = require("nx/src/project-graph/nx-deps-cache");
6
+ const internal_2 = require("@nx/devkit/internal");
8
7
  const version_utils_1 = require("../../generators/utils/version-utils");
9
8
  const file_change_recorder_1 = require("../../utils/file-change-recorder");
10
9
  const projects_1 = require("../utils/projects");
@@ -27,7 +26,7 @@ async function default_1(tree) {
27
26
  const tsqueryModule = require('@phenomnomnominal/tsquery');
28
27
  tsqueryAst = tsqueryModule.ast;
29
28
  tsqueryQuery = tsqueryModule.query;
30
- const cachedFileMap = (0, nx_deps_cache_1.readFileMapCache)().fileMap.projectFileMap;
29
+ const cachedFileMap = (0, internal_2.readFileMapCache)().fileMap.projectFileMap;
31
30
  const filesWithNxAngularImports = [];
32
31
  for (const graphNode of projects) {
33
32
  const files = filterFilesWithNxAngularDep(cachedFileMap[graphNode.name] || []);
@@ -115,7 +114,7 @@ function addNgrxRouterStoreIfNotInstalled(tree) {
115
114
  function filterFilesWithNxAngularDep(files) {
116
115
  const filteredFiles = [];
117
116
  for (const file of files) {
118
- if (file.deps?.some((dep) => angularPluginTargetNames.includes((0, project_graph_1.fileDataDepTarget)(dep)))) {
117
+ if (file.deps?.some((dep) => angularPluginTargetNames.includes((0, internal_2.fileDataDepTarget)(dep)))) {
119
118
  filteredFiles.push(file);
120
119
  }
121
120
  }
@@ -8,8 +8,6 @@ const js_1 = require("@nx/js");
8
8
  const node_fs_1 = require("node:fs");
9
9
  const node_path_1 = require("node:path");
10
10
  const posix = tslib_1.__importStar(require("node:path/posix"));
11
- const devkit_internals_1 = require("nx/src/devkit-internals");
12
- const cache_directory_1 = require("nx/src/utils/cache-directory");
13
11
  const targets_1 = require("../utils/targets");
14
12
  const vitest_1 = require("./utils/vitest");
15
13
  const knownExecutors = {
@@ -48,8 +46,8 @@ const knownExecutors = {
48
46
  exports.createNodes = [
49
47
  '**/angular.json',
50
48
  async (configFiles, options, context) => {
51
- const optionsHash = (0, devkit_internals_1.hashObject)(options);
52
- const cachePath = (0, node_path_1.join)(cache_directory_1.workspaceDataDirectory, `angular-${optionsHash}.hash`);
49
+ const optionsHash = (0, internal_1.hashObject)(options);
50
+ const cachePath = (0, node_path_1.join)(internal_1.workspaceDataDirectory, `angular-${optionsHash}.hash`);
53
51
  const projectsCache = new internal_1.PluginCache(cachePath);
54
52
  const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
55
53
  const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);