nx 23.2.0-beta.8 → 23.2.0-beta.9

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 (71) hide show
  1. package/dist/src/ai/set-up-ai-agents/set-up-ai-agents.js +2 -2
  2. package/dist/src/command-line/format/format.js +84 -101
  3. package/dist/src/command-line/import/import.js +12 -0
  4. package/dist/src/command-line/init/configure-plugins.js +4 -1
  5. package/dist/src/command-line/init/implementation/add-nx-to-nest.js +9 -0
  6. package/dist/src/command-line/init/implementation/add-nx-to-turborepo.js +3 -17
  7. package/dist/src/command-line/init/implementation/angular/index.js +4 -0
  8. package/dist/src/command-line/init/implementation/angular/legacy-angular-versions.js +2 -0
  9. package/dist/src/command-line/init/implementation/angular/standalone-workspace.js +8 -2
  10. package/dist/src/command-line/init/implementation/check-compatible-with-plugins.js +2 -0
  11. package/dist/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +5 -0
  12. package/dist/src/command-line/init/implementation/format.d.ts +18 -0
  13. package/dist/src/command-line/init/implementation/format.js +114 -0
  14. package/dist/src/command-line/init/implementation/utils.js +8 -0
  15. package/dist/src/command-line/init/init-v1.js +7 -0
  16. package/dist/src/command-line/init/init-v2.js +11 -0
  17. package/dist/src/command-line/migrate/migrate.d.ts +4 -0
  18. package/dist/src/command-line/migrate/migrate.js +64 -24
  19. package/dist/src/command-line/release/version.js +2 -2
  20. package/dist/src/daemon/client/client.js +11 -2
  21. package/dist/src/devkit-internals.d.ts +5 -2
  22. package/dist/src/devkit-internals.js +14 -6
  23. package/dist/src/generators/internal-utils/{format-changed-files-with-prettier-if-available.d.ts → format-changed-files.d.ts} +6 -6
  24. package/dist/src/generators/internal-utils/format-changed-files.js +163 -0
  25. package/dist/src/generators/testing-utils/create-tree-with-empty-workspace.d.ts +15 -0
  26. package/dist/src/generators/testing-utils/create-tree-with-empty-workspace.js +21 -3
  27. package/dist/src/migrations/update-15-0-0/prefix-outputs.js +2 -2
  28. package/dist/src/migrations/update-16-0-0/remove-nrwl-cli.js +2 -2
  29. package/dist/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +2 -2
  30. package/dist/src/migrations/update-16-0-0/update-nx-cloud-runner.js +2 -2
  31. package/dist/src/migrations/update-16-2-0/remove-run-commands-output-path.js +2 -2
  32. package/dist/src/migrations/update-17-0-0/rm-default-collection-npm-scope.js +2 -2
  33. package/dist/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +2 -2
  34. package/dist/src/migrations/update-17-2-0/move-default-base.js +2 -2
  35. package/dist/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +2 -2
  36. package/dist/src/migrations/update-19-2-4/set-project-name.js +2 -2
  37. package/dist/src/migrations/update-20-0-0/move-use-daemon-process.js +2 -2
  38. package/dist/src/migrations/update-20-0-1/use-legacy-cache.js +2 -2
  39. package/dist/src/migrations/update-21-0-0/release-changelog-config-changes.js +2 -2
  40. package/dist/src/migrations/update-21-0-0/release-version-config-changes.js +2 -2
  41. package/dist/src/migrations/update-21-0-0/remove-custom-tasks-runner.js +2 -2
  42. package/dist/src/migrations/update-21-0-0/remove-legacy-cache.js +2 -2
  43. package/dist/src/migrations/update-22-0-0/consolidate-release-tag-config.js +2 -2
  44. package/dist/src/migrations/update-22-0-0/release-version-config-changes.js +2 -2
  45. package/dist/src/migrations/update-22-2-0/add-self-healing-to-gitignore.js +2 -2
  46. package/dist/src/migrations/update-22-6-0/add-claude-settings-local-to-git-ignore.js +2 -2
  47. package/dist/src/migrations/update-22-6-0/add-claude-worktrees-to-git-ignore.js +2 -2
  48. package/dist/src/migrations/update-22-7-0/add-polygraph-to-git-ignore.js +2 -2
  49. package/dist/src/migrations/update-23-0-0/add-migrate-runs-to-git-ignore.js +2 -2
  50. package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.js +2 -2
  51. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  52. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  53. package/dist/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +3 -3
  54. package/dist/src/utils/chunkify.d.ts +7 -1
  55. package/dist/src/utils/chunkify.js +10 -3
  56. package/dist/src/utils/formatters/index.d.ts +13 -0
  57. package/dist/src/utils/formatters/index.js +74 -0
  58. package/dist/src/utils/formatters/oxfmt.d.ts +32 -0
  59. package/dist/src/utils/formatters/oxfmt.js +764 -0
  60. package/dist/src/utils/formatters/prettier.d.ts +26 -0
  61. package/dist/src/utils/formatters/prettier.js +201 -0
  62. package/dist/src/utils/formatters/shared.d.ts +5 -0
  63. package/dist/src/utils/formatters/shared.js +8 -0
  64. package/dist/src/utils/ignore.d.ts +47 -5
  65. package/dist/src/utils/ignore.js +93 -11
  66. package/dist/src/utils/write-formatted-json-file.d.ts +3 -2
  67. package/dist/src/utils/write-formatted-json-file.js +5 -4
  68. package/package.json +11 -11
  69. package/dist/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +0 -88
  70. package/dist/src/utils/is-using-prettier.d.ts +0 -3
  71. package/dist/src/utils/is-using-prettier.js +0 -62
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatChangedFiles = formatChangedFiles;
4
+ exports.formatFileContents = formatFileContents;
5
+ const tslib_1 = require("tslib");
6
+ const path = tslib_1.__importStar(require("path"));
7
+ const path_1 = require("../../utils/path");
8
+ const formatters_1 = require("../../utils/formatters");
9
+ const oxfmt_1 = require("../../utils/formatters/oxfmt");
10
+ const installation_directory_1 = require("../../utils/installation-directory");
11
+ const output_1 = require("../../utils/output");
12
+ /**
13
+ * Formats all the created or updated files using the configured formatter
14
+ * @param tree - the file system tree
15
+ *
16
+ * @remarks
17
+ * Set the environment variable `NX_SKIP_FORMAT` to `true` to skip
18
+ * formatting. This is useful for repositories that format with a tool Nx does
19
+ * not drive (Biome, dprint) or that have custom formatting requirements.
20
+ */
21
+ async function formatChangedFiles(tree, options) {
22
+ if (process.env.NX_SKIP_FORMAT === 'true') {
23
+ return;
24
+ }
25
+ const excludedPaths = options?.excludePaths
26
+ ? new Set(Array.from(options.excludePaths, path_1.normalizePath))
27
+ : undefined;
28
+ const files = new Set(tree
29
+ .listChanges()
30
+ .filter((file) => file.type !== 'DELETE' &&
31
+ !excludedPaths?.has((0, path_1.normalizePath)(file.path))));
32
+ // Detect from the tree, not disk: the tree is the source of truth and may
33
+ // hold a config the generator just created but hasn't flushed. Probing disk
34
+ // would also read the real workspace config in tests.
35
+ //
36
+ // No `seedConfig` is threaded through, unlike devkit's `formatFiles`:
37
+ // `formatFilesWithOxfmt` falls back to a JSON config carried in the batch.
38
+ const formatterType = (0, formatters_1.detectFormatterInTree)(tree);
39
+ if (!formatterType) {
40
+ return;
41
+ }
42
+ const results = await formatDetectedFiles(formatterType, Array.from(files), tree.root, options,
43
+ // The post-flush root, which disk cannot see: a config staged here is not
44
+ // written yet, and one the tree deletes still is.
45
+ oxfmt_1.oxfmtConfigFiles.filter((name) => tree.exists(name)),
46
+ // Same reason, for the ignore files and the root .editorconfig: the batch
47
+ // is selected against the tree, so the backend has to re-check against the
48
+ // tree and not against disk.
49
+ (relativePath) => tree.read(relativePath, 'utf-8'));
50
+ for (const [path, content] of results) {
51
+ tree.write(path, content);
52
+ }
53
+ }
54
+ async function formatFileContents(files, root, options) {
55
+ // Check here as well for direct callers of this function
56
+ if (process.env.NX_SKIP_FORMAT === 'true' || files.length === 0) {
57
+ return new Map();
58
+ }
59
+ // Direct callers have no tree, so detection falls back to disk.
60
+ const formatterType = (0, formatters_1.detectFormatter)(root);
61
+ if (!formatterType) {
62
+ return new Map();
63
+ }
64
+ return formatDetectedFiles(formatterType, files, root, options);
65
+ }
66
+ function formatDetectedFiles(formatterType, files, root, options, rootConfigNames, read) {
67
+ switch (formatterType) {
68
+ case 'prettier':
69
+ return formatFilesWithPrettier(files, root, options);
70
+ case 'oxfmt':
71
+ return runOxfmtBatch(files, root, options, rootConfigNames, read);
72
+ default: {
73
+ // Without this arm an unhandled formatter returns undefined into
74
+ // callers that iterate it.
75
+ const unhandled = formatterType;
76
+ throw new Error(`Unhandled formatter: ${unhandled}`);
77
+ }
78
+ }
79
+ }
80
+ async function formatFilesWithPrettier(files, root, options) {
81
+ const results = new Map();
82
+ let prettier;
83
+ try {
84
+ const prettierPath = require.resolve('prettier', {
85
+ paths: [...(0, installation_directory_1.getNxRequirePaths)(root), __dirname],
86
+ });
87
+ prettier = require(prettierPath);
88
+ }
89
+ catch { }
90
+ if (!prettier) {
91
+ // Detection said prettier, so this is "configured but not installed" -
92
+ // the oxfmt path reports it, and silence here just leaves files
93
+ // unformatted with no reason given.
94
+ if (!options?.silent) {
95
+ output_1.output.warn({
96
+ title: 'prettier is configured for this workspace but is not installed.',
97
+ bodyLines: ['Install "prettier" to format generated files.'],
98
+ });
99
+ }
100
+ return results;
101
+ }
102
+ await Promise.all(Array.from(files).map(async (file) => {
103
+ try {
104
+ const systemPath = path.join(root, file.path);
105
+ let resolvedOptions = {
106
+ filepath: systemPath,
107
+ };
108
+ // No early return when this is null: detection accepts a formatter
109
+ // declared in the root package.json, so a workspace can select prettier
110
+ // without configuring it. Skipping here would leave `nx release` and
111
+ // migrations unformatted while devkit's `formatFiles` - which has never
112
+ // had this guard - formats the same workspace on prettier's defaults.
113
+ const config = await prettier.resolveConfig(systemPath, {
114
+ editorconfig: true,
115
+ });
116
+ resolvedOptions = {
117
+ ...resolvedOptions,
118
+ ...config,
119
+ };
120
+ const support = await prettier.getFileInfo(systemPath, resolvedOptions);
121
+ if (support.ignored || !support.inferredParser) {
122
+ return;
123
+ }
124
+ results.set(file.path, await prettier.format(file.content.toString('utf-8'), resolvedOptions));
125
+ }
126
+ catch (e) {
127
+ if (!options?.silent) {
128
+ output_1.output.warn({
129
+ title: `Could not format ${file.path}`,
130
+ bodyLines: [e.message],
131
+ });
132
+ }
133
+ }
134
+ }));
135
+ return results;
136
+ }
137
+ async function runOxfmtBatch(files, root, options, rootConfigNames, read) {
138
+ try {
139
+ // The whole batch goes through one call: oxfmt's ESM API is loaded once and
140
+ // each file is formatted in memory, so no process is spawned per file and a
141
+ // file oxfmt cannot parse costs only itself.
142
+ const { formatted, errors } = await (0, oxfmt_1.formatFilesWithOxfmt)(files.map((file) => ({
143
+ path: file.path,
144
+ content: file.content.toString('utf-8'),
145
+ })), root, undefined, rootConfigNames, read);
146
+ if (errors?.length && !options?.silent) {
147
+ output_1.output.warn({
148
+ title: 'Could not format some files with oxfmt',
149
+ bodyLines: errors,
150
+ });
151
+ }
152
+ return formatted;
153
+ }
154
+ catch (e) {
155
+ if (!options?.silent) {
156
+ output_1.output.warn({
157
+ title: 'Could not format files with oxfmt',
158
+ bodyLines: [e.message],
159
+ });
160
+ }
161
+ return new Map();
162
+ }
163
+ }
@@ -1,11 +1,26 @@
1
1
  import type { Tree } from '../tree';
2
+ import type { FormatterType } from '../../utils/formatters';
3
+ /**
4
+ * A formatter choice rather than a dispatch target, so `'none'` is composed in
5
+ * here instead of living in `FormatterType`.
6
+ */
7
+ type TestFormatter = FormatterType | 'none';
2
8
  /**
3
9
  * Creates a host for testing.
10
+ *
11
+ * Defaults to oxfmt deliberately, so generator tests exercise the oxfmt path
12
+ * rather than the create-nx-workspace default. oxfmt formats
13
+ * JS, TS, JSON, YAML and Markdown - nothing filters by extension on the way in
14
+ * - so any spec asserting on generated file *content* is affected. Pass `none`
15
+ * to assert exactly what the generator wrote, or `prettier` only for a test
16
+ * that is about prettier itself.
4
17
  */
5
18
  export declare function createTreeWithEmptyWorkspace(opts?: {
6
19
  layout?: 'apps-libs';
20
+ formatter?: TestFormatter;
7
21
  }): Tree;
8
22
  /**
9
23
  * @deprecated use createTreeWithEmptyWorkspace instead
10
24
  */
11
25
  export declare function createTreeWithEmptyV1Workspace(): Tree;
26
+ export {};
@@ -4,8 +4,24 @@ exports.createTreeWithEmptyWorkspace = createTreeWithEmptyWorkspace;
4
4
  exports.createTreeWithEmptyV1Workspace = createTreeWithEmptyV1Workspace;
5
5
  const tree_1 = require("../tree");
6
6
  const workspace_root_1 = require("../../utils/workspace-root");
7
+ /**
8
+ * Keyed by `FormatterType` so adding a formatter fails to compile here until
9
+ * this helper can seed it, rather than silently producing a workspace with no
10
+ * config.
11
+ */
12
+ const formatterConfigFiles = {
13
+ prettier: '.prettierrc',
14
+ oxfmt: '.oxfmtrc.json',
15
+ };
7
16
  /**
8
17
  * Creates a host for testing.
18
+ *
19
+ * Defaults to oxfmt deliberately, so generator tests exercise the oxfmt path
20
+ * rather than the create-nx-workspace default. oxfmt formats
21
+ * JS, TS, JSON, YAML and Markdown - nothing filters by extension on the way in
22
+ * - so any spec asserting on generated file *content* is affected. Pass `none`
23
+ * to assert exactly what the generator wrote, or `prettier` only for a test
24
+ * that is about prettier itself.
9
25
  */
10
26
  function createTreeWithEmptyWorkspace(opts = {}) {
11
27
  const tree = new tree_1.FsTree('/virtual', false);
@@ -15,7 +31,7 @@ function createTreeWithEmptyWorkspace(opts = {}) {
15
31
  // is prepended to the paths created in the virtual tree.
16
32
  // Setting this envVar to workspaceRoot prevents this behaviour
17
33
  process.env.INIT_CWD = workspace_root_1.workspaceRoot;
18
- return addCommonFiles(tree, opts.layout === 'apps-libs');
34
+ return addCommonFiles(tree, opts.layout === 'apps-libs', opts.formatter);
19
35
  }
20
36
  /**
21
37
  * @deprecated use createTreeWithEmptyWorkspace instead
@@ -23,8 +39,10 @@ function createTreeWithEmptyWorkspace(opts = {}) {
23
39
  function createTreeWithEmptyV1Workspace() {
24
40
  throw new Error('Use createTreeWithEmptyWorkspace instead of createTreeWithEmptyV1Workspace');
25
41
  }
26
- function addCommonFiles(tree, addAppsAndLibsFolders) {
27
- tree.write('./.prettierrc', JSON.stringify({ singleQuote: true }));
42
+ function addCommonFiles(tree, addAppsAndLibsFolders, formatter = 'oxfmt') {
43
+ if (formatter !== 'none') {
44
+ tree.write(`./${formatterConfigFiles[formatter]}`, JSON.stringify({ singleQuote: true }));
45
+ }
28
46
  tree.write('/package.json', JSON.stringify({
29
47
  name: '@proj/source',
30
48
  dependencies: {},
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = default_1;
4
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
5
  const project_configuration_1 = require("../../generators/utils/project-configuration");
6
6
  const nx_json_1 = require("../../generators/utils/nx-json");
7
7
  const path_1 = require("path");
@@ -50,5 +50,5 @@ async function default_1(tree) {
50
50
  }
51
51
  (0, nx_json_1.updateNxJson)(tree, nxJson);
52
52
  }
53
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
53
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
54
54
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = default_1;
4
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
5
  const json_1 = require("../../generators/utils/json");
6
6
  async function default_1(tree) {
7
7
  (0, json_1.updateJson)(tree, 'package.json', (json) => {
@@ -12,5 +12,5 @@ async function default_1(tree) {
12
12
  }
13
13
  return json;
14
14
  });
15
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
15
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
16
16
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = default_1;
4
4
  const project_configuration_1 = require("../../generators/utils/project-configuration");
5
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
5
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
6
6
  const target_defaults_1 = require("../utils/target-defaults");
7
7
  async function default_1(tree) {
8
8
  updateDependsOnAndInputsInsideNxJson(tree);
@@ -20,7 +20,7 @@ async function default_1(tree) {
20
20
  (0, project_configuration_1.updateProjectConfiguration)(tree, projectName, projectConfiguration);
21
21
  }
22
22
  }
23
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
23
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
24
24
  }
25
25
  function updateDependsOnAndInputsInsideNxJson(tree) {
26
26
  const nxJson = (0, project_configuration_1.readNxJson)(tree);
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = default_1;
4
4
  const project_configuration_1 = require("../../generators/utils/project-configuration");
5
5
  const json_1 = require("../../generators/utils/json");
6
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
6
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
7
7
  async function default_1(tree) {
8
8
  (0, json_1.updateJson)(tree, 'package.json', (json) => {
9
9
  if (json.dependencies && json.dependencies['@nrwl/nx-cloud']) {
@@ -25,5 +25,5 @@ async function default_1(tree) {
25
25
  }
26
26
  }
27
27
  (0, project_configuration_1.updateNxJson)(tree, nxJson);
28
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
28
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
29
29
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = removeRunCommandsOutputPath;
4
4
  const path_1 = require("../../utils/path");
5
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
5
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
6
6
  const json_1 = require("../../generators/utils/json");
7
7
  const project_configuration_1 = require("../../generators/utils/project-configuration");
8
8
  const target_defaults_1 = require("../utils/target-defaults");
@@ -29,7 +29,7 @@ async function removeRunCommandsOutputPath(tree) {
29
29
  return json;
30
30
  });
31
31
  }
32
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
32
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
33
33
  }
34
34
  function updateTargetBlock(target) {
35
35
  let changed = false;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = update;
4
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
5
  const nx_json_1 = require("../../generators/utils/nx-json");
6
6
  const json_1 = require("../../generators/utils/json");
7
7
  const output_1 = require("../../utils/output");
@@ -18,7 +18,7 @@ async function update(tree) {
18
18
  warnNpmScopeHasChanged(tree, nxJson);
19
19
  delete nxJson['npmScope'];
20
20
  (0, nx_json_1.updateNxJson)(tree, nxJson);
21
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
21
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
22
22
  }
23
23
  function warnNpmScopeHasChanged(tree, nxJson) {
24
24
  const originalScope = nxJson['npmScope'];
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = migrate;
4
4
  const json_1 = require("../../generators/utils/json");
5
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
5
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
6
6
  const nx_json_1 = require("../../generators/utils/nx-json");
7
7
  const update_manager_1 = require("../../nx-cloud/update-manager");
8
8
  const run_command_1 = require("../../tasks-runner/run-command");
@@ -76,7 +76,7 @@ async function migrate(tree) {
76
76
  }
77
77
  return nxJson;
78
78
  });
79
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
79
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
80
80
  }
81
81
  async function isNxCloudClientSupported(nxJson) {
82
82
  const nxCloudOptions = (0, run_command_1.getRunnerOptions)('default', nxJson, {}, true);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = update;
4
4
  const nx_json_1 = require("../../generators/utils/nx-json");
5
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
5
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
6
6
  /**
7
7
  * Updates existing workspaces to move nx.json's affected.defaultBase to nx.json's base.
8
8
  */
@@ -16,5 +16,5 @@ async function update(host) {
16
16
  }
17
17
  (0, nx_json_1.updateNxJson)(host, nxJson);
18
18
  }
19
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(host);
19
+ await (0, format_changed_files_1.formatChangedFiles)(host);
20
20
  }
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = migrate;
4
4
  const nx_json_1 = require("../../generators/utils/nx-json");
5
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
5
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
6
6
  async function migrate(tree) {
7
7
  const nxJson = (0, nx_json_1.readNxJson)(tree);
8
8
  nxJson.useInferencePlugins = false;
9
9
  (0, nx_json_1.updateNxJson)(tree, nxJson);
10
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
10
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
11
11
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = setProjectName;
4
4
  const to_project_name_1 = require("../../config/to-project-name");
5
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
5
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
6
6
  const json_1 = require("../../generators/utils/json");
7
7
  const project_configuration_1 = require("../../generators/utils/project-configuration");
8
8
  async function setProjectName(tree) {
@@ -30,5 +30,5 @@ async function setProjectName(tree) {
30
30
  }
31
31
  }
32
32
  }
33
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
33
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
34
34
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = update;
4
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
5
  const nx_json_1 = require("../../generators/utils/nx-json");
6
6
  async function update(tree) {
7
7
  const nxJson = (0, nx_json_1.readNxJson)(tree);
@@ -21,5 +21,5 @@ async function update(tree) {
21
21
  }
22
22
  (0, nx_json_1.updateNxJson)(tree, nxJson);
23
23
  }
24
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
24
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
25
25
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = update;
4
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
5
  const nx_json_1 = require("../../generators/utils/nx-json");
6
6
  async function update(tree) {
7
7
  const nxJson = (0, nx_json_1.readNxJson)(tree);
@@ -16,5 +16,5 @@ async function update(tree) {
16
16
  nxJson.useLegacyCache = true;
17
17
  }
18
18
  (0, nx_json_1.updateNxJson)(tree, nxJson);
19
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
19
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
20
20
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = update;
4
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
5
  const nx_json_1 = require("../../generators/utils/nx-json");
6
6
  async function update(tree) {
7
7
  const nxJson = (0, nx_json_1.readNxJson)(tree);
@@ -34,5 +34,5 @@ async function update(tree) {
34
34
  }
35
35
  }
36
36
  (0, nx_json_1.updateNxJson)(tree, nxJson);
37
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
37
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
38
38
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = update;
4
4
  const node_path_1 = require("node:path");
5
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
5
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
6
6
  const json_1 = require("../../generators/utils/json");
7
7
  const nx_json_1 = require("../../generators/utils/nx-json");
8
8
  const project_configuration_1 = require("../../generators/utils/project-configuration");
@@ -97,5 +97,5 @@ async function update(tree) {
97
97
  }
98
98
  }
99
99
  (0, nx_json_1.updateNxJson)(tree, nxJson);
100
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
100
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
101
101
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = update;
4
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
5
  const nx_json_1 = require("../../generators/utils/nx-json");
6
6
  function isCustomRunnerPath(modulePath) {
7
7
  return !['nx-cloud', '@nrwl/nx-cloud', 'nx/tasks-runners/default'].includes(modulePath);
@@ -33,6 +33,6 @@ async function update(tree) {
33
33
  delete nxJson.tasksRunnerOptions;
34
34
  }
35
35
  (0, nx_json_1.updateNxJson)(tree, nxJson);
36
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
36
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
37
37
  return nextSteps;
38
38
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = update;
4
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
5
  const nx_json_1 = require("../../generators/utils/nx-json");
6
6
  async function update(tree) {
7
7
  const nxJson = (0, nx_json_1.readNxJson)(tree);
@@ -13,5 +13,5 @@ async function update(tree) {
13
13
  delete nxJson.useLegacyCache;
14
14
  }
15
15
  (0, nx_json_1.updateNxJson)(tree, nxJson);
16
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
16
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
17
17
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = update;
4
4
  const node_path_1 = require("node:path");
5
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
5
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
6
6
  const json_1 = require("../../generators/utils/json");
7
7
  const nx_json_1 = require("../../generators/utils/nx-json");
8
8
  const project_configuration_1 = require("../../generators/utils/project-configuration");
@@ -96,5 +96,5 @@ async function update(tree) {
96
96
  }
97
97
  }
98
98
  (0, nx_json_1.updateNxJson)(tree, nxJson);
99
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
99
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
100
100
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = update;
4
4
  const node_path_1 = require("node:path");
5
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
5
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
6
6
  const json_1 = require("../../generators/utils/json");
7
7
  const nx_json_1 = require("../../generators/utils/nx-json");
8
8
  const project_configuration_1 = require("../../generators/utils/project-configuration");
@@ -97,5 +97,5 @@ async function update(tree) {
97
97
  }
98
98
  }
99
99
  (0, nx_json_1.updateNxJson)(tree, nxJson);
100
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
100
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
101
101
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = addSelfHealingToGitignore;
4
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
5
  const ignore_1 = require("../../utils/ignore");
6
6
  async function addSelfHealingToGitignore(tree) {
7
7
  if (!tree.exists('.gitignore')) {
@@ -15,5 +15,5 @@ async function addSelfHealingToGitignore(tree) {
15
15
  if (tree.exists('.prettierignore')) {
16
16
  (0, ignore_1.addEntryToGitIgnore)(tree, '.prettierignore', '.nx/self-healing');
17
17
  }
18
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
18
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
19
19
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = addClaudeSettingsLocalToGitIgnore;
4
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
5
  const ignore_1 = require("../../utils/ignore");
6
6
  async function addClaudeSettingsLocalToGitIgnore(tree) {
7
7
  if (!tree.exists('.gitignore')) {
@@ -12,5 +12,5 @@ async function addClaudeSettingsLocalToGitIgnore(tree) {
12
12
  return;
13
13
  }
14
14
  (0, ignore_1.addEntryToGitIgnore)(tree, '.gitignore', '.claude/settings.local.json');
15
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
15
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
16
16
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = addClaudeWorktreesToGitIgnore;
4
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
5
  const ignore_1 = require("../../utils/ignore");
6
6
  async function addClaudeWorktreesToGitIgnore(tree) {
7
7
  if (!tree.exists('.gitignore')) {
@@ -12,5 +12,5 @@ async function addClaudeWorktreesToGitIgnore(tree) {
12
12
  return;
13
13
  }
14
14
  (0, ignore_1.addEntryToGitIgnore)(tree, '.gitignore', '.claude/worktrees');
15
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
15
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
16
16
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = addPolygraphToGitIgnore;
4
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
5
  const ignore_1 = require("../../utils/ignore");
6
6
  async function addPolygraphToGitIgnore(tree) {
7
7
  if (!tree.exists('.gitignore')) {
@@ -12,5 +12,5 @@ async function addPolygraphToGitIgnore(tree) {
12
12
  return;
13
13
  }
14
14
  (0, ignore_1.addEntryToGitIgnore)(tree, '.gitignore', '.nx/polygraph');
15
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
15
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
16
16
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = addMigrateRunsToGitIgnore;
4
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
5
  const ignore_1 = require("../../utils/ignore");
6
6
  async function addMigrateRunsToGitIgnore(tree) {
7
7
  if (!tree.exists('.gitignore')) {
@@ -12,5 +12,5 @@ async function addMigrateRunsToGitIgnore(tree) {
12
12
  return;
13
13
  }
14
14
  (0, ignore_1.addEntryToGitIgnore)(tree, '.gitignore', '.nx/migrate-runs');
15
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
15
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
16
16
  }