nx 19.8.0-canary.20240914-dc821ab → 19.8.0-canary.20240918-eb61254

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/package.json +12 -12
  2. package/schemas/nx-schema.json +2 -2
  3. package/src/command-line/import/import.js +9 -4
  4. package/src/command-line/import/utils/prepare-source-repo.js +7 -35
  5. package/src/command-line/init/init-v2.d.ts +1 -1
  6. package/src/command-line/init/init-v2.js +10 -4
  7. package/src/command-line/release/command-object.d.ts +2 -2
  8. package/src/command-line/release/config/config.js +10 -3
  9. package/src/command-line/release/utils/git.d.ts +2 -2
  10. package/src/command-line/release/utils/git.js +12 -2
  11. package/src/command-line/release/utils/shared.d.ts +1 -1
  12. package/src/command-line/release/version.js +4 -0
  13. package/src/config/nx-json.d.ts +13 -5
  14. package/src/hasher/hash-task.js +2 -2
  15. package/src/native/nx.wasi-browser.js +42 -54
  16. package/src/native/nx.wasi.cjs +42 -54
  17. package/src/native/nx.wasm32-wasi.wasm +0 -0
  18. package/src/tasks-runner/cache.js +2 -1
  19. package/src/tasks-runner/init-tasks-runner.d.ts +1 -1
  20. package/src/tasks-runner/init-tasks-runner.js +5 -3
  21. package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.d.ts +0 -2
  22. package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.js +0 -5
  23. package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.d.ts +2 -6
  24. package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.d.ts +2 -6
  25. package/src/tasks-runner/life-cycles/store-run-information-life-cycle.d.ts +2 -7
  26. package/src/tasks-runner/life-cycles/task-profiling-life-cycle.d.ts +2 -7
  27. package/src/tasks-runner/life-cycles/task-results-life-cycle.d.ts +6 -0
  28. package/src/tasks-runner/life-cycles/task-results-life-cycle.js +17 -0
  29. package/src/tasks-runner/life-cycles/task-timings-life-cycle.d.ts +2 -7
  30. package/src/tasks-runner/run-command.d.ts +12 -2
  31. package/src/tasks-runner/run-command.js +53 -60
  32. package/src/tasks-runner/task-orchestrator.d.ts +0 -1
  33. package/src/tasks-runner/task-orchestrator.js +3 -6
  34. package/src/tasks-runner/tasks-schedule.js +6 -2
  35. package/src/utils/git-utils.d.ts +4 -2
  36. package/src/utils/git-utils.index-filter.d.ts +0 -0
  37. package/src/utils/git-utils.index-filter.js +20 -0
  38. package/src/utils/git-utils.js +48 -13
  39. package/src/utils/git-utils.tree-filter.d.ts +11 -0
  40. package/src/utils/git-utils.tree-filter.js +43 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "19.8.0-canary.20240914-dc821ab",
3
+ "version": "19.8.0-canary.20240918-eb61254",
4
4
  "private": false,
5
5
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
6
6
  "repository": {
@@ -71,7 +71,7 @@
71
71
  "yargs-parser": "21.1.1",
72
72
  "node-machine-id": "1.1.12",
73
73
  "ora": "5.3.0",
74
- "@nrwl/tao": "19.8.0-canary.20240914-dc821ab"
74
+ "@nrwl/tao": "19.8.0-canary.20240918-eb61254"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "@swc-node/register": "^1.8.0",
@@ -86,16 +86,16 @@
86
86
  }
87
87
  },
88
88
  "optionalDependencies": {
89
- "@nx/nx-darwin-x64": "19.8.0-canary.20240914-dc821ab",
90
- "@nx/nx-darwin-arm64": "19.8.0-canary.20240914-dc821ab",
91
- "@nx/nx-linux-x64-gnu": "19.8.0-canary.20240914-dc821ab",
92
- "@nx/nx-linux-x64-musl": "19.8.0-canary.20240914-dc821ab",
93
- "@nx/nx-win32-x64-msvc": "19.8.0-canary.20240914-dc821ab",
94
- "@nx/nx-linux-arm64-gnu": "19.8.0-canary.20240914-dc821ab",
95
- "@nx/nx-linux-arm64-musl": "19.8.0-canary.20240914-dc821ab",
96
- "@nx/nx-linux-arm-gnueabihf": "19.8.0-canary.20240914-dc821ab",
97
- "@nx/nx-win32-arm64-msvc": "19.8.0-canary.20240914-dc821ab",
98
- "@nx/nx-freebsd-x64": "19.8.0-canary.20240914-dc821ab"
89
+ "@nx/nx-darwin-x64": "19.8.0-canary.20240918-eb61254",
90
+ "@nx/nx-darwin-arm64": "19.8.0-canary.20240918-eb61254",
91
+ "@nx/nx-linux-x64-gnu": "19.8.0-canary.20240918-eb61254",
92
+ "@nx/nx-linux-x64-musl": "19.8.0-canary.20240918-eb61254",
93
+ "@nx/nx-win32-x64-msvc": "19.8.0-canary.20240918-eb61254",
94
+ "@nx/nx-linux-arm64-gnu": "19.8.0-canary.20240918-eb61254",
95
+ "@nx/nx-linux-arm64-musl": "19.8.0-canary.20240918-eb61254",
96
+ "@nx/nx-linux-arm-gnueabihf": "19.8.0-canary.20240918-eb61254",
97
+ "@nx/nx-win32-arm64-msvc": "19.8.0-canary.20240918-eb61254",
98
+ "@nx/nx-freebsd-x64": "19.8.0-canary.20240918-eb61254"
99
99
  },
100
100
  "nx-migrations": {
101
101
  "migrations": "./migrations.json",
@@ -634,7 +634,7 @@
634
634
  "description": "Custom git commit message to use when committing the changes made by this command"
635
635
  },
636
636
  "commitArgs": {
637
- "type": "string",
637
+ "type": ["string", "array"],
638
638
  "description": "Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes"
639
639
  },
640
640
  "stageChanges": {
@@ -650,7 +650,7 @@
650
650
  "description": "Custom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself."
651
651
  },
652
652
  "tagArgs": {
653
- "type": "string",
653
+ "type": ["string", "array"],
654
654
  "description": "Additional arguments to pass to the `git tag` command invoked behind the scenes"
655
655
  }
656
656
  }
@@ -25,7 +25,12 @@ const needs_install_1 = require("./utils/needs-install");
25
25
  const file_utils_1 = require("../../project-graph/file-utils");
26
26
  const importRemoteName = '__tmp_nx_import__';
27
27
  async function importHandler(options) {
28
+ process.env.NX_RUNNING_NX_IMPORT = 'true';
28
29
  let { sourceRepository, ref, source, destination } = options;
30
+ const destinationGitClient = new git_utils_1.GitRepository(process.cwd());
31
+ if (await destinationGitClient.hasUncommittedChanges()) {
32
+ throw new Error(`You have uncommitted changes in the destination repository. Commit or revert the changes and try again.`);
33
+ }
29
34
  output_1.output.log({
30
35
  title: 'Nx will walk you through the process of importing code from the source repository into this repository:',
31
36
  bodyLines: [
@@ -120,7 +125,6 @@ async function importHandler(options) {
120
125
  throw new Error(`The destination directory must be a relative path in this repository.`);
121
126
  }
122
127
  const absDestination = (0, path_1.join)(process.cwd(), destination);
123
- const destinationGitClient = new git_utils_1.GitRepository(process.cwd());
124
128
  await assertDestinationEmpty(destinationGitClient, absDestination);
125
129
  const tempImportBranch = getTempImportBranch(ref);
126
130
  await sourceGitClient.addFetchRemote(importRemoteName, ref);
@@ -152,7 +156,7 @@ async function importHandler(options) {
152
156
  const pmc = (0, package_manager_1.getPackageManagerCommand)();
153
157
  const nxJson = (0, nx_json_1.readNxJson)(workspace_root_1.workspaceRoot);
154
158
  (0, workspace_context_1.resetWorkspaceContext)();
155
- const { plugins, updatePackageScripts } = await (0, init_v2_1.detectPlugins)(nxJson, options.interactive);
159
+ const { plugins, updatePackageScripts } = await (0, init_v2_1.detectPlugins)(nxJson, options.interactive, true);
156
160
  if (packageManager !== sourcePackageManager) {
157
161
  output_1.output.warn({
158
162
  title: `Mismatched package managers`,
@@ -232,8 +236,9 @@ async function importHandler(options) {
232
236
  title: `Merging these changes into ${(0, command_line_utils_1.getBaseRef)(nxJson)}`,
233
237
  bodyLines: [
234
238
  `MERGE these changes when merging these changes.`,
235
- `Do NOT squash and do NOT rebase these changes when merging these changes.`,
236
- `If you would like to UNDO these changes, run "git reset HEAD~1 --hard"`,
239
+ `Do NOT squash these commits when merging these changes.`,
240
+ `If you rebase, make sure to use "--rebase-merges" to preserve merge commits.`,
241
+ `To UNDO these changes, run "git reset HEAD~1 --hard"`,
237
242
  ],
238
243
  });
239
244
  }
@@ -3,46 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prepareSourceRepo = prepareSourceRepo;
4
4
  const createSpinner = require("ora");
5
5
  const path_1 = require("path");
6
- const promises_1 = require("node:fs/promises");
7
6
  async function prepareSourceRepo(gitClient, ref, source, relativeDestination, tempImportBranch, sourceRemoteUrl) {
8
7
  const spinner = createSpinner().start(`Fetching ${ref} from ${sourceRemoteUrl}`);
9
8
  const relativeSourceDir = (0, path_1.relative)(gitClient.root, (0, path_1.join)(gitClient.root, source));
10
- if (relativeSourceDir !== '') {
11
- if (await gitClient.hasFilterRepoInstalled()) {
12
- spinner.start(`Filtering git history to only include files in ${relativeSourceDir}`);
13
- await gitClient.filterRepo(relativeSourceDir);
14
- }
15
- else {
16
- spinner.start(`Filtering git history to only include files in ${relativeSourceDir} (this might take a few minutes -- install git-filter-repo for faster performance)`);
17
- await gitClient.filterBranch(relativeSourceDir, tempImportBranch);
18
- }
19
- spinner.succeed(`Filtered git history to only include files in ${relativeSourceDir}`);
9
+ if (await gitClient.hasFilterRepoInstalled()) {
10
+ spinner.start(`Filtering git history to only include files in ${relativeSourceDir}`);
11
+ await gitClient.filterRepo(relativeSourceDir, relativeDestination);
20
12
  }
21
- const destinationInSource = (0, path_1.join)(gitClient.root, relativeDestination);
22
- spinner.start(`Moving files and git history to ${destinationInSource}`);
23
- // The result of filter-branch will contain only the files in the subdirectory at its root.
24
- const files = await gitClient.getGitFiles('.');
25
- try {
26
- await (0, promises_1.rm)(destinationInSource, {
27
- recursive: true,
28
- });
13
+ else {
14
+ spinner.start(`Filtering git history to only include files in ${relativeSourceDir} (this might take a few minutes -- install git-filter-repo for faster performance)`);
15
+ await gitClient.filterBranch(relativeSourceDir, relativeDestination, tempImportBranch);
29
16
  }
30
- catch { }
31
- await (0, promises_1.mkdir)(destinationInSource, { recursive: true });
32
- for (const file of files) {
33
- spinner.start(`Moving files and git history to ${destinationInSource}: ${file}`);
34
- const newPath = (0, path_1.join)(destinationInSource, file);
35
- await (0, promises_1.mkdir)((0, path_1.dirname)(newPath), { recursive: true });
36
- try {
37
- await gitClient.move(file, newPath);
38
- }
39
- catch {
40
- await wait(100);
41
- await gitClient.move(file, newPath);
42
- }
43
- }
44
- await gitClient.commit(`chore(repo): move ${source} to ${relativeDestination} to prepare to be imported`);
45
- await gitClient.amendCommit();
17
+ spinner.succeed(`Filtered git history to only include files in ${relativeSourceDir}`);
46
18
  spinner.succeed(`${sourceRemoteUrl} has been prepared to be imported into this workspace on a temporary branch: ${tempImportBranch} in ${gitClient.root}`);
47
19
  }
48
20
  function wait(ms) {
@@ -8,7 +8,7 @@ export interface InitArgs {
8
8
  }
9
9
  export declare function installPlugins(repoRoot: string, plugins: string[], pmc: PackageManagerCommands, updatePackageScripts: boolean): void;
10
10
  export declare function initHandler(options: InitArgs): Promise<void>;
11
- export declare function detectPlugins(nxJson: NxJsonConfiguration, interactive: boolean): Promise<{
11
+ export declare function detectPlugins(nxJson: NxJsonConfiguration, interactive: boolean, includeAngularCli?: boolean): Promise<{
12
12
  plugins: string[];
13
13
  updatePackageScripts: boolean;
14
14
  }>;
@@ -127,8 +127,8 @@ const npmPackageToPluginMap = {
127
127
  'react-native': '@nx/react-native',
128
128
  '@remix-run/dev': '@nx/remix',
129
129
  };
130
- async function detectPlugins(nxJson, interactive) {
131
- let files = ['package.json'].concat(await (0, workspace_context_1.globWithWorkspaceContext)(process.cwd(), ['**/*/package.json']));
130
+ async function detectPlugins(nxJson, interactive, includeAngularCli) {
131
+ let files = ['package.json'].concat((0, workspace_context_1.globWithWorkspaceContextSync)(process.cwd(), ['**/*/package.json']));
132
132
  const currentPlugins = new Set((nxJson.plugins ?? []).map((p) => {
133
133
  const plugin = typeof p === 'string' ? p : p.plugin;
134
134
  return (0, get_package_name_from_import_path_1.getPackageNameFromImportPath)(plugin);
@@ -149,13 +149,19 @@ async function detectPlugins(nxJson, interactive) {
149
149
  ...packageJson.dependencies,
150
150
  ...packageJson.devDependencies,
151
151
  };
152
- for (const [dep, plugin] of Object.entries(npmPackageToPluginMap)) {
152
+ const _npmPackageToPluginMap = {
153
+ ...npmPackageToPluginMap,
154
+ };
155
+ if (includeAngularCli) {
156
+ _npmPackageToPluginMap['@angular/cli'] = '@nx/angular';
157
+ }
158
+ for (const [dep, plugin] of Object.entries(_npmPackageToPluginMap)) {
153
159
  if (deps[dep]) {
154
160
  detectedPlugins.add(plugin);
155
161
  }
156
162
  }
157
163
  }
158
- let gradlewFiles = ['gradlew', 'gradlew.bat'].concat(await (0, workspace_context_1.globWithWorkspaceContext)(process.cwd(), [
164
+ let gradlewFiles = ['gradlew', 'gradlew.bat'].concat((0, workspace_context_1.globWithWorkspaceContextSync)(process.cwd(), [
159
165
  '**/gradlew',
160
166
  '**/gradlew.bat',
161
167
  ]));
@@ -14,10 +14,10 @@ interface GitCommitAndTagOptions {
14
14
  stageChanges?: boolean;
15
15
  gitCommit?: boolean;
16
16
  gitCommitMessage?: string;
17
- gitCommitArgs?: string;
17
+ gitCommitArgs?: string | string[];
18
18
  gitTag?: boolean;
19
19
  gitTagMessage?: string;
20
- gitTagArgs?: string;
20
+ gitTagArgs?: string | string[];
21
21
  }
22
22
  export type VersionOptions = NxReleaseArgs & GitCommitAndTagOptions & VersionPlanArgs & FirstReleaseArgs & {
23
23
  specifier?: string;
@@ -21,6 +21,7 @@ const fileutils_1 = require("../../../utils/fileutils");
21
21
  const find_matching_projects_1 = require("../../../utils/find-matching-projects");
22
22
  const output_1 = require("../../../utils/output");
23
23
  const workspace_root_1 = require("../../../utils/workspace-root");
24
+ const path_1 = require("../../../utils/path");
24
25
  const resolve_changelog_renderer_1 = require("../utils/resolve-changelog-renderer");
25
26
  const resolve_nx_json_error_message_1 = require("../utils/resolve-nx-json-error-message");
26
27
  const conventional_commits_1 = require("./conventional-commits");
@@ -154,6 +155,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
154
155
  conventionalCommits: false,
155
156
  generator: '@nx/js:release-version',
156
157
  generatorOptions: {},
158
+ groupPreVersionCommand: '',
157
159
  },
158
160
  changelog: {
159
161
  createRelease: false,
@@ -205,7 +207,9 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
205
207
  WORKSPACE_DEFAULTS.versionPlans);
206
208
  const rootConventionalCommitsConfig = deepMergeDefaults([WORKSPACE_DEFAULTS.conventionalCommits], fillUnspecifiedConventionalCommitsProperties(normalizeConventionalCommitsConfig(userConfig.conventionalCommits)));
207
209
  // these options are not supported at the group level, only the root/command level
208
- const rootVersionWithoutGlobalOptions = { ...rootVersionConfig };
210
+ const rootVersionWithoutGlobalOptions = {
211
+ ...rootVersionConfig,
212
+ };
209
213
  delete rootVersionWithoutGlobalOptions.git;
210
214
  delete rootVersionWithoutGlobalOptions.preVersionCommand;
211
215
  // Apply conventionalCommits shorthand to the final group defaults if explicitly configured in the original user config
@@ -315,7 +319,10 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
315
319
  projects: matchingProjects,
316
320
  version: deepMergeDefaults(
317
321
  // First apply any group level defaults, then apply actual root level config, then group level config
318
- [GROUP_DEFAULTS.version, rootVersionWithoutGlobalOptions], releaseGroup.version),
322
+ [
323
+ GROUP_DEFAULTS.version,
324
+ { ...rootVersionWithoutGlobalOptions, groupPreVersionCommand: '' },
325
+ ], releaseGroup.version),
319
326
  // If the user has set any changelog config at all, including at the root level, then use one set of defaults, otherwise default to false for the whole feature
320
327
  changelog: releaseGroup.changelog || rootChangelogConfig.projectChangelogs
321
328
  ? deepMergeDefaults(groupChangelogDefaults, releaseGroup.changelog || {})
@@ -657,7 +664,7 @@ async function getDefaultProjects(projectGraph, projectFileMap) {
657
664
  function isProjectPublic(project, projectGraph, projectFileMap) {
658
665
  const projectNode = projectGraph.nodes[project];
659
666
  const packageJsonPath = (0, node_path_1.join)(projectNode.data.root, 'package.json');
660
- if (!projectFileMap[project]?.find((f) => f.file === packageJsonPath)) {
667
+ if (!projectFileMap[project]?.find((f) => f.file === (0, path_1.normalizePath)(packageJsonPath))) {
661
668
  return false;
662
669
  }
663
670
  try {
@@ -37,7 +37,7 @@ export declare function gitAdd({ changedFiles, deletedFiles, dryRun, verbose, lo
37
37
  }): Promise<string>;
38
38
  export declare function gitCommit({ messages, additionalArgs, dryRun, verbose, logFn, }: {
39
39
  messages: string[];
40
- additionalArgs?: string;
40
+ additionalArgs?: string | string[];
41
41
  dryRun?: boolean;
42
42
  verbose?: boolean;
43
43
  logFn?: (message: string) => void;
@@ -45,7 +45,7 @@ export declare function gitCommit({ messages, additionalArgs, dryRun, verbose, l
45
45
  export declare function gitTag({ tag, message, additionalArgs, dryRun, verbose, logFn, }: {
46
46
  tag: string;
47
47
  message?: string;
48
- additionalArgs?: string;
48
+ additionalArgs?: string | string[];
49
49
  dryRun?: boolean;
50
50
  verbose?: boolean;
51
51
  logFn?: (message: string) => void;
@@ -188,7 +188,12 @@ async function gitCommit({ messages, additionalArgs, dryRun, verbose, logFn, })
188
188
  commandArgs.push('--message', message);
189
189
  }
190
190
  if (additionalArgs) {
191
- commandArgs.push(...additionalArgs.split(' '));
191
+ if (Array.isArray(additionalArgs)) {
192
+ commandArgs.push(...additionalArgs);
193
+ }
194
+ else {
195
+ commandArgs.push(...additionalArgs.split(' '));
196
+ }
192
197
  }
193
198
  if (verbose) {
194
199
  logFn(dryRun
@@ -224,7 +229,12 @@ async function gitTag({ tag, message, additionalArgs, dryRun, verbose, logFn, })
224
229
  message || tag,
225
230
  ];
226
231
  if (additionalArgs) {
227
- commandArgs.push(...additionalArgs.split(' '));
232
+ if (Array.isArray(additionalArgs)) {
233
+ commandArgs.push(...additionalArgs);
234
+ }
235
+ else {
236
+ commandArgs.push(...additionalArgs.split(' '));
237
+ }
228
238
  }
229
239
  if (verbose) {
230
240
  logFn(dryRun
@@ -45,7 +45,7 @@ export declare function commitChanges({ changedFiles, deletedFiles, isDryRun, is
45
45
  isDryRun?: boolean;
46
46
  isVerbose?: boolean;
47
47
  gitCommitMessages?: string[];
48
- gitCommitArgs?: string;
48
+ gitCommitArgs?: string | string[];
49
49
  }): Promise<void>;
50
50
  export declare function createCommitMessageValues(releaseGroups: ReleaseGroupWithName[], releaseGroupToFilteredProjects: Map<ReleaseGroupWithName, Set<string>>, versionData: VersionData, commitMessage: string): string[];
51
51
  export declare function createGitTagValues(releaseGroups: ReleaseGroupWithName[], releaseGroupToFilteredProjects: Map<ReleaseGroupWithName, Set<string>>, versionData: VersionData): string[];
@@ -207,6 +207,10 @@ function createAPI(overrideReleaseConfig) {
207
207
  */
208
208
  for (const releaseGroup of releaseGroups) {
209
209
  const releaseGroupName = releaseGroup.name;
210
+ runPreVersionCommand(releaseGroup.version.groupPreVersionCommand, {
211
+ dryRun: args.dryRun,
212
+ verbose: args.verbose,
213
+ });
210
214
  const projectBatches = (0, batch_projects_by_generator_config_1.batchProjectsByGeneratorConfig)(projectGraph, releaseGroup,
211
215
  // Batch based on all projects within the release group
212
216
  releaseGroup.projects);
@@ -101,9 +101,9 @@ export interface NxReleaseGitConfiguration {
101
101
  */
102
102
  commitMessage?: string;
103
103
  /**
104
- * Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes
104
+ * Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes. May be a string or array of strings.
105
105
  */
106
- commitArgs?: string;
106
+ commitArgs?: string | string[];
107
107
  /**
108
108
  * Whether or not to stage the changes made by this command. Always treated as true if commit is true.
109
109
  */
@@ -117,9 +117,9 @@ export interface NxReleaseGitConfiguration {
117
117
  */
118
118
  tagMessage?: string;
119
119
  /**
120
- * Additional arguments to pass to the `git tag` command invoked behind the scenes
120
+ * Additional arguments to pass to the `git tag` command invoked behind the scenes. . May be a string or array of strings.
121
121
  */
122
- tagArgs?: string;
122
+ tagArgs?: string | string[];
123
123
  }
124
124
  export interface NxReleaseConventionalCommitsConfiguration {
125
125
  types?: Record<string,
@@ -179,7 +179,15 @@ export interface NxReleaseConfiguration {
179
179
  *
180
180
  * NOTE: git configuration is not supported at the group level, only the root/command level
181
181
  */
182
- version?: NxReleaseVersionConfiguration;
182
+ version?: NxReleaseVersionConfiguration & {
183
+ /**
184
+ * A command to run after validation of nx release configuration, but before versioning begins.
185
+ * Used for preparing build artifacts. If --dry-run is passed, the command is still executed, but
186
+ * with the NX_DRY_RUN environment variable set to 'true'.
187
+ * It will run in addition to the global `preVersionCommand`
188
+ */
189
+ groupPreVersionCommand?: string;
190
+ };
183
191
  /**
184
192
  * Project changelogs are disabled by default.
185
193
  *
@@ -11,7 +11,7 @@ const db_connection_1 = require("../utils/db-connection");
11
11
  let taskDetails;
12
12
  function getTaskDetails() {
13
13
  // TODO: Remove when wasm supports sqlite
14
- if (native_1.IS_WASM) {
14
+ if (process.env.NX_DISABLE_DB === 'true' || native_1.IS_WASM) {
15
15
  return null;
16
16
  }
17
17
  if (!taskDetails) {
@@ -42,7 +42,7 @@ async function hashTasksThatDoNotDependOnOutputsOfOtherTasks(hasher, projectGrap
42
42
  tasksToHash[i].hash = hashes[i].value;
43
43
  tasksToHash[i].hashDetails = hashes[i].details;
44
44
  }
45
- // TODO: Remove if when wasm supports sqlite
45
+ // TODO: Remove if when sqlite is always on
46
46
  if (taskDetails) {
47
47
  taskDetails.recordTaskDetails(tasksToHash.map((task) => ({
48
48
  hash: task.hash,
@@ -51,63 +51,51 @@ const {
51
51
  })
52
52
 
53
53
  function __napi_rs_initialize_modules(__napiInstance) {
54
- __napiInstance.exports['__napi_register__CachedResult_struct_0']?.()
55
- __napiInstance.exports['__napi_register__NxCache_struct_1']?.()
56
- __napiInstance.exports['__napi_register__NxCache_impl_9']?.()
57
- __napiInstance.exports['__napi_register__expand_outputs_10']?.()
58
- __napiInstance.exports['__napi_register__get_files_for_outputs_11']?.()
59
- __napiInstance.exports['__napi_register__remove_12']?.()
60
- __napiInstance.exports['__napi_register__copy_13']?.()
61
- __napiInstance.exports['__napi_register__validate_outputs_14']?.()
62
- __napiInstance.exports['__napi_register__get_transformable_outputs_15']?.()
63
- __napiInstance.exports['__napi_register__hash_array_16']?.()
64
- __napiInstance.exports['__napi_register__hash_file_17']?.()
65
- __napiInstance.exports['__napi_register__IS_WASM_18']?.()
66
- __napiInstance.exports['__napi_register__get_binary_target_19']?.()
67
- __napiInstance.exports['__napi_register__ImportResult_struct_20']?.()
68
- __napiInstance.exports['__napi_register__find_imports_21']?.()
69
- __napiInstance.exports['__napi_register__transfer_project_graph_22']?.()
70
- __napiInstance.exports['__napi_register__ExternalNode_struct_23']?.()
71
- __napiInstance.exports['__napi_register__Target_struct_24']?.()
72
- __napiInstance.exports['__napi_register__Project_struct_25']?.()
73
- __napiInstance.exports['__napi_register__ProjectGraph_struct_26']?.()
74
- __napiInstance.exports['__napi_register__HashedTask_struct_27']?.()
75
- __napiInstance.exports['__napi_register__TaskDetails_struct_28']?.()
76
- __napiInstance.exports['__napi_register__TaskDetails_impl_31']?.()
77
- __napiInstance.exports['__napi_register__HashPlanner_struct_32']?.()
78
- __napiInstance.exports['__napi_register__HashPlanner_impl_36']?.()
79
- __napiInstance.exports['__napi_register__HashDetails_struct_37']?.()
80
- __napiInstance.exports['__napi_register__HasherOptions_struct_38']?.()
81
- __napiInstance.exports['__napi_register__TaskHasher_struct_39']?.()
82
- __napiInstance.exports['__napi_register__TaskHasher_impl_42']?.()
83
- __napiInstance.exports['__napi_register__TaskRun_struct_43']?.()
84
- __napiInstance.exports['__napi_register__NxTaskHistory_struct_44']?.()
85
- __napiInstance.exports['__napi_register__NxTaskHistory_impl_48']?.()
86
- __napiInstance.exports['__napi_register__Task_struct_49']?.()
87
- __napiInstance.exports['__napi_register__TaskTarget_struct_50']?.()
88
- __napiInstance.exports['__napi_register__TaskGraph_struct_51']?.()
89
- __napiInstance.exports['__napi_register__FileData_struct_52']?.()
90
- __napiInstance.exports['__napi_register__InputsInput_struct_53']?.()
91
- __napiInstance.exports['__napi_register__FileSetInput_struct_54']?.()
92
- __napiInstance.exports['__napi_register__RuntimeInput_struct_55']?.()
93
- __napiInstance.exports['__napi_register__EnvironmentInput_struct_56']?.()
94
- __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_57']?.()
95
- __napiInstance.exports['__napi_register__DepsOutputsInput_struct_58']?.()
96
- __napiInstance.exports['__napi_register__NxJson_struct_59']?.()
97
- __napiInstance.exports['__napi_register__WorkspaceContext_struct_60']?.()
98
- __napiInstance.exports['__napi_register__WorkspaceContext_impl_69']?.()
99
- __napiInstance.exports['__napi_register__WorkspaceErrors_70']?.()
100
- __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_71']?.()
101
- __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_72']?.()
102
- __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_73']?.()
103
- __napiInstance.exports['__napi_register__FileMap_struct_74']?.()
104
- __napiInstance.exports['__napi_register____test_only_transfer_file_map_75']?.()
54
+ __napiInstance.exports['__napi_register__expand_outputs_0']?.()
55
+ __napiInstance.exports['__napi_register__get_files_for_outputs_1']?.()
56
+ __napiInstance.exports['__napi_register__remove_2']?.()
57
+ __napiInstance.exports['__napi_register__copy_3']?.()
58
+ __napiInstance.exports['__napi_register__validate_outputs_4']?.()
59
+ __napiInstance.exports['__napi_register__get_transformable_outputs_5']?.()
60
+ __napiInstance.exports['__napi_register__hash_array_6']?.()
61
+ __napiInstance.exports['__napi_register__hash_file_7']?.()
62
+ __napiInstance.exports['__napi_register__IS_WASM_8']?.()
63
+ __napiInstance.exports['__napi_register__get_binary_target_9']?.()
64
+ __napiInstance.exports['__napi_register__ImportResult_struct_10']?.()
65
+ __napiInstance.exports['__napi_register__find_imports_11']?.()
66
+ __napiInstance.exports['__napi_register__transfer_project_graph_12']?.()
67
+ __napiInstance.exports['__napi_register__ExternalNode_struct_13']?.()
68
+ __napiInstance.exports['__napi_register__Target_struct_14']?.()
69
+ __napiInstance.exports['__napi_register__Project_struct_15']?.()
70
+ __napiInstance.exports['__napi_register__ProjectGraph_struct_16']?.()
71
+ __napiInstance.exports['__napi_register__HashPlanner_struct_17']?.()
72
+ __napiInstance.exports['__napi_register__HashPlanner_impl_21']?.()
73
+ __napiInstance.exports['__napi_register__HashDetails_struct_22']?.()
74
+ __napiInstance.exports['__napi_register__HasherOptions_struct_23']?.()
75
+ __napiInstance.exports['__napi_register__TaskHasher_struct_24']?.()
76
+ __napiInstance.exports['__napi_register__TaskHasher_impl_27']?.()
77
+ __napiInstance.exports['__napi_register__Task_struct_28']?.()
78
+ __napiInstance.exports['__napi_register__TaskTarget_struct_29']?.()
79
+ __napiInstance.exports['__napi_register__TaskGraph_struct_30']?.()
80
+ __napiInstance.exports['__napi_register__FileData_struct_31']?.()
81
+ __napiInstance.exports['__napi_register__InputsInput_struct_32']?.()
82
+ __napiInstance.exports['__napi_register__FileSetInput_struct_33']?.()
83
+ __napiInstance.exports['__napi_register__RuntimeInput_struct_34']?.()
84
+ __napiInstance.exports['__napi_register__EnvironmentInput_struct_35']?.()
85
+ __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_36']?.()
86
+ __napiInstance.exports['__napi_register__DepsOutputsInput_struct_37']?.()
87
+ __napiInstance.exports['__napi_register__NxJson_struct_38']?.()
88
+ __napiInstance.exports['__napi_register__WorkspaceContext_struct_39']?.()
89
+ __napiInstance.exports['__napi_register__WorkspaceContext_impl_48']?.()
90
+ __napiInstance.exports['__napi_register__WorkspaceErrors_49']?.()
91
+ __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_50']?.()
92
+ __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_51']?.()
93
+ __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_52']?.()
94
+ __napiInstance.exports['__napi_register__FileMap_struct_53']?.()
95
+ __napiInstance.exports['__napi_register____test_only_transfer_file_map_54']?.()
105
96
  }
106
97
  export const HashPlanner = __napiModule.exports.HashPlanner
107
98
  export const ImportResult = __napiModule.exports.ImportResult
108
- export const NxCache = __napiModule.exports.NxCache
109
- export const NxTaskHistory = __napiModule.exports.NxTaskHistory
110
- export const TaskDetails = __napiModule.exports.TaskDetails
111
99
  export const TaskHasher = __napiModule.exports.TaskHasher
112
100
  export const WorkspaceContext = __napiModule.exports.WorkspaceContext
113
101
  export const copy = __napiModule.exports.copy
@@ -82,63 +82,51 @@ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule
82
82
  })
83
83
 
84
84
  function __napi_rs_initialize_modules(__napiInstance) {
85
- __napiInstance.exports['__napi_register__CachedResult_struct_0']?.()
86
- __napiInstance.exports['__napi_register__NxCache_struct_1']?.()
87
- __napiInstance.exports['__napi_register__NxCache_impl_9']?.()
88
- __napiInstance.exports['__napi_register__expand_outputs_10']?.()
89
- __napiInstance.exports['__napi_register__get_files_for_outputs_11']?.()
90
- __napiInstance.exports['__napi_register__remove_12']?.()
91
- __napiInstance.exports['__napi_register__copy_13']?.()
92
- __napiInstance.exports['__napi_register__validate_outputs_14']?.()
93
- __napiInstance.exports['__napi_register__get_transformable_outputs_15']?.()
94
- __napiInstance.exports['__napi_register__hash_array_16']?.()
95
- __napiInstance.exports['__napi_register__hash_file_17']?.()
96
- __napiInstance.exports['__napi_register__IS_WASM_18']?.()
97
- __napiInstance.exports['__napi_register__get_binary_target_19']?.()
98
- __napiInstance.exports['__napi_register__ImportResult_struct_20']?.()
99
- __napiInstance.exports['__napi_register__find_imports_21']?.()
100
- __napiInstance.exports['__napi_register__transfer_project_graph_22']?.()
101
- __napiInstance.exports['__napi_register__ExternalNode_struct_23']?.()
102
- __napiInstance.exports['__napi_register__Target_struct_24']?.()
103
- __napiInstance.exports['__napi_register__Project_struct_25']?.()
104
- __napiInstance.exports['__napi_register__ProjectGraph_struct_26']?.()
105
- __napiInstance.exports['__napi_register__HashedTask_struct_27']?.()
106
- __napiInstance.exports['__napi_register__TaskDetails_struct_28']?.()
107
- __napiInstance.exports['__napi_register__TaskDetails_impl_31']?.()
108
- __napiInstance.exports['__napi_register__HashPlanner_struct_32']?.()
109
- __napiInstance.exports['__napi_register__HashPlanner_impl_36']?.()
110
- __napiInstance.exports['__napi_register__HashDetails_struct_37']?.()
111
- __napiInstance.exports['__napi_register__HasherOptions_struct_38']?.()
112
- __napiInstance.exports['__napi_register__TaskHasher_struct_39']?.()
113
- __napiInstance.exports['__napi_register__TaskHasher_impl_42']?.()
114
- __napiInstance.exports['__napi_register__TaskRun_struct_43']?.()
115
- __napiInstance.exports['__napi_register__NxTaskHistory_struct_44']?.()
116
- __napiInstance.exports['__napi_register__NxTaskHistory_impl_49']?.()
117
- __napiInstance.exports['__napi_register__Task_struct_50']?.()
118
- __napiInstance.exports['__napi_register__TaskTarget_struct_51']?.()
119
- __napiInstance.exports['__napi_register__TaskGraph_struct_52']?.()
120
- __napiInstance.exports['__napi_register__FileData_struct_53']?.()
121
- __napiInstance.exports['__napi_register__InputsInput_struct_54']?.()
122
- __napiInstance.exports['__napi_register__FileSetInput_struct_55']?.()
123
- __napiInstance.exports['__napi_register__RuntimeInput_struct_56']?.()
124
- __napiInstance.exports['__napi_register__EnvironmentInput_struct_57']?.()
125
- __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_58']?.()
126
- __napiInstance.exports['__napi_register__DepsOutputsInput_struct_59']?.()
127
- __napiInstance.exports['__napi_register__NxJson_struct_60']?.()
128
- __napiInstance.exports['__napi_register__WorkspaceContext_struct_61']?.()
129
- __napiInstance.exports['__napi_register__WorkspaceContext_impl_70']?.()
130
- __napiInstance.exports['__napi_register__WorkspaceErrors_71']?.()
131
- __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_72']?.()
132
- __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_73']?.()
133
- __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_74']?.()
134
- __napiInstance.exports['__napi_register__FileMap_struct_75']?.()
135
- __napiInstance.exports['__napi_register____test_only_transfer_file_map_76']?.()
85
+ __napiInstance.exports['__napi_register__expand_outputs_0']?.()
86
+ __napiInstance.exports['__napi_register__get_files_for_outputs_1']?.()
87
+ __napiInstance.exports['__napi_register__remove_2']?.()
88
+ __napiInstance.exports['__napi_register__copy_3']?.()
89
+ __napiInstance.exports['__napi_register__validate_outputs_4']?.()
90
+ __napiInstance.exports['__napi_register__get_transformable_outputs_5']?.()
91
+ __napiInstance.exports['__napi_register__hash_array_6']?.()
92
+ __napiInstance.exports['__napi_register__hash_file_7']?.()
93
+ __napiInstance.exports['__napi_register__IS_WASM_8']?.()
94
+ __napiInstance.exports['__napi_register__get_binary_target_9']?.()
95
+ __napiInstance.exports['__napi_register__ImportResult_struct_10']?.()
96
+ __napiInstance.exports['__napi_register__find_imports_11']?.()
97
+ __napiInstance.exports['__napi_register__transfer_project_graph_12']?.()
98
+ __napiInstance.exports['__napi_register__ExternalNode_struct_13']?.()
99
+ __napiInstance.exports['__napi_register__Target_struct_14']?.()
100
+ __napiInstance.exports['__napi_register__Project_struct_15']?.()
101
+ __napiInstance.exports['__napi_register__ProjectGraph_struct_16']?.()
102
+ __napiInstance.exports['__napi_register__HashPlanner_struct_17']?.()
103
+ __napiInstance.exports['__napi_register__HashPlanner_impl_21']?.()
104
+ __napiInstance.exports['__napi_register__HashDetails_struct_22']?.()
105
+ __napiInstance.exports['__napi_register__HasherOptions_struct_23']?.()
106
+ __napiInstance.exports['__napi_register__TaskHasher_struct_24']?.()
107
+ __napiInstance.exports['__napi_register__TaskHasher_impl_27']?.()
108
+ __napiInstance.exports['__napi_register__Task_struct_28']?.()
109
+ __napiInstance.exports['__napi_register__TaskTarget_struct_29']?.()
110
+ __napiInstance.exports['__napi_register__TaskGraph_struct_30']?.()
111
+ __napiInstance.exports['__napi_register__FileData_struct_31']?.()
112
+ __napiInstance.exports['__napi_register__InputsInput_struct_32']?.()
113
+ __napiInstance.exports['__napi_register__FileSetInput_struct_33']?.()
114
+ __napiInstance.exports['__napi_register__RuntimeInput_struct_34']?.()
115
+ __napiInstance.exports['__napi_register__EnvironmentInput_struct_35']?.()
116
+ __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_36']?.()
117
+ __napiInstance.exports['__napi_register__DepsOutputsInput_struct_37']?.()
118
+ __napiInstance.exports['__napi_register__NxJson_struct_38']?.()
119
+ __napiInstance.exports['__napi_register__WorkspaceContext_struct_39']?.()
120
+ __napiInstance.exports['__napi_register__WorkspaceContext_impl_48']?.()
121
+ __napiInstance.exports['__napi_register__WorkspaceErrors_49']?.()
122
+ __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_50']?.()
123
+ __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_51']?.()
124
+ __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_52']?.()
125
+ __napiInstance.exports['__napi_register__FileMap_struct_53']?.()
126
+ __napiInstance.exports['__napi_register____test_only_transfer_file_map_54']?.()
136
127
  }
137
128
  module.exports.HashPlanner = __napiModule.exports.HashPlanner
138
129
  module.exports.ImportResult = __napiModule.exports.ImportResult
139
- module.exports.NxCache = __napiModule.exports.NxCache
140
- module.exports.NxTaskHistory = __napiModule.exports.NxTaskHistory
141
- module.exports.TaskDetails = __napiModule.exports.TaskDetails
142
130
  module.exports.TaskHasher = __napiModule.exports.TaskHasher
143
131
  module.exports.WorkspaceContext = __napiModule.exports.WorkspaceContext
144
132
  module.exports.copy = __napiModule.exports.copy
Binary file
@@ -17,7 +17,8 @@ const nx_json_1 = require("../config/nx-json");
17
17
  const update_manager_1 = require("../nx-cloud/update-manager");
18
18
  const get_cloud_options_1 = require("../nx-cloud/utilities/get-cloud-options");
19
19
  function getCache(options) {
20
- return process.env.NX_DB_CACHE === 'true'
20
+ return process.env.NX_DISABLE_DB !== 'true' &&
21
+ process.env.NX_DB_CACHE === 'true'
21
22
  ? new DbCache({
22
23
  // Remove this in Nx 21
23
24
  nxCloudRemoteCache: (0, nx_cloud_utils_1.isNxCloudUsed)((0, nx_json_1.readNxJson)())