nx 19.6.0-canary.20240803-bd7a2c9 → 19.6.0-canary.20240808-333ab77

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. package/package.json +12 -12
  2. package/release/changelog-renderer/index.js +16 -1
  3. package/release/index.d.ts +1 -1
  4. package/release/index.js +2 -1
  5. package/schemas/nx-schema.json +3 -0
  6. package/src/adapter/compat.d.ts +1 -1
  7. package/src/adapter/compat.js +1 -0
  8. package/src/command-line/connect/connect-to-nx-cloud.js +7 -3
  9. package/src/command-line/release/changelog.d.ts +2 -7
  10. package/src/command-line/release/changelog.js +415 -363
  11. package/src/command-line/release/command-object.d.ts +1 -0
  12. package/src/command-line/release/command-object.js +14 -0
  13. package/src/command-line/release/config/deep-merge-json.d.ts +1 -0
  14. package/src/command-line/release/config/deep-merge-json.js +28 -0
  15. package/src/command-line/release/config/version-plans.d.ts +5 -0
  16. package/src/command-line/release/config/version-plans.js +9 -5
  17. package/src/command-line/release/index.d.ts +16 -4
  18. package/src/command-line/release/index.js +23 -9
  19. package/src/command-line/release/plan.d.ts +2 -1
  20. package/src/command-line/release/plan.js +93 -100
  21. package/src/command-line/release/publish.d.ts +2 -6
  22. package/src/command-line/release/publish.js +67 -54
  23. package/src/command-line/release/release.d.ts +2 -1
  24. package/src/command-line/release/release.js +181 -165
  25. package/src/command-line/release/utils/generate-version-plan-content.js +2 -3
  26. package/src/command-line/release/utils/print-config.d.ts +7 -0
  27. package/src/command-line/release/utils/print-config.js +36 -0
  28. package/src/command-line/release/version.d.ts +7 -6
  29. package/src/command-line/release/version.js +179 -165
  30. package/src/config/nx-json.d.ts +6 -1
  31. package/src/devkit-internals.d.ts +2 -2
  32. package/src/devkit-internals.js +2 -2
  33. package/src/native/nx.wasm32-wasi.wasm +0 -0
  34. package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts +2 -1
  35. package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +49 -10
  36. package/src/nx-cloud/nx-cloud-tasks-runner-shell.d.ts +1 -0
  37. package/src/nx-cloud/utilities/axios.js +9 -2
  38. package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +7 -2
  39. package/src/plugins/package-json/create-nodes.js +9 -1
  40. package/src/project-graph/plugins/isolation/plugin-pool.js +32 -10
  41. package/src/tasks-runner/run-command.js +6 -1
  42. package/src/tasks-runner/utils.js +14 -10
  43. package/src/utils/nx-cloud-utils.js +3 -1
  44. package/src/utils/package-manager.js +12 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "19.6.0-canary.20240803-bd7a2c9",
3
+ "version": "19.6.0-canary.20240808-333ab77",
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.6.0-canary.20240803-bd7a2c9"
74
+ "@nrwl/tao": "19.6.0-canary.20240808-333ab77"
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.6.0-canary.20240803-bd7a2c9",
90
- "@nx/nx-darwin-arm64": "19.6.0-canary.20240803-bd7a2c9",
91
- "@nx/nx-linux-x64-gnu": "19.6.0-canary.20240803-bd7a2c9",
92
- "@nx/nx-linux-x64-musl": "19.6.0-canary.20240803-bd7a2c9",
93
- "@nx/nx-win32-x64-msvc": "19.6.0-canary.20240803-bd7a2c9",
94
- "@nx/nx-linux-arm64-gnu": "19.6.0-canary.20240803-bd7a2c9",
95
- "@nx/nx-linux-arm64-musl": "19.6.0-canary.20240803-bd7a2c9",
96
- "@nx/nx-linux-arm-gnueabihf": "19.6.0-canary.20240803-bd7a2c9",
97
- "@nx/nx-win32-arm64-msvc": "19.6.0-canary.20240803-bd7a2c9",
98
- "@nx/nx-freebsd-x64": "19.6.0-canary.20240803-bd7a2c9"
89
+ "@nx/nx-darwin-x64": "19.6.0-canary.20240808-333ab77",
90
+ "@nx/nx-darwin-arm64": "19.6.0-canary.20240808-333ab77",
91
+ "@nx/nx-linux-x64-gnu": "19.6.0-canary.20240808-333ab77",
92
+ "@nx/nx-linux-x64-musl": "19.6.0-canary.20240808-333ab77",
93
+ "@nx/nx-win32-x64-msvc": "19.6.0-canary.20240808-333ab77",
94
+ "@nx/nx-linux-arm64-gnu": "19.6.0-canary.20240808-333ab77",
95
+ "@nx/nx-linux-arm64-musl": "19.6.0-canary.20240808-333ab77",
96
+ "@nx/nx-linux-arm-gnueabihf": "19.6.0-canary.20240808-333ab77",
97
+ "@nx/nx-win32-arm64-msvc": "19.6.0-canary.20240808-333ab77",
98
+ "@nx/nx-freebsd-x64": "19.6.0-canary.20240808-333ab77"
99
99
  },
100
100
  "nx-migrations": {
101
101
  "migrations": "./migrations.json",
@@ -216,13 +216,28 @@ function groupBy(items, key) {
216
216
  return groups;
217
217
  }
218
218
  function formatChange(change, changelogRenderOptions, repoSlug) {
219
+ let description = change.description;
220
+ let extraLines = [];
221
+ let extraLinesStr = '';
222
+ if (description.includes('\n')) {
223
+ [description, ...extraLines] = description.split('\n');
224
+ // Align the extra lines with the start of the description for better readability
225
+ const indentation = ' ';
226
+ extraLinesStr = extraLines
227
+ .filter((l) => l.trim().length > 0)
228
+ .map((l) => `${indentation}${l}`)
229
+ .join('\n');
230
+ }
219
231
  let changeLine = '- ' +
220
232
  (change.isBreaking ? '⚠️ ' : '') +
221
233
  (change.scope ? `**${change.scope.trim()}:** ` : '') +
222
- change.description;
234
+ description;
223
235
  if (repoSlug && changelogRenderOptions.commitReferences) {
224
236
  changeLine += (0, github_1.formatReferences)(change.githubReferences, repoSlug);
225
237
  }
238
+ if (extraLinesStr) {
239
+ changeLine += '\n\n' + extraLinesStr;
240
+ }
226
241
  return changeLine;
227
242
  }
228
243
  /**
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * @public Programmatic API for nx release
3
3
  */
4
- export { release, releaseChangelog, releasePublish, releaseVersion, } from '../src/command-line/release';
4
+ export { ReleaseClient, release, releaseChangelog, releasePublish, releaseVersion, } from '../src/command-line/release';
package/release/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.releaseVersion = exports.releasePublish = exports.releaseChangelog = exports.release = void 0;
3
+ exports.releaseVersion = exports.releasePublish = exports.releaseChangelog = exports.release = exports.ReleaseClient = void 0;
4
4
  /**
5
5
  * @public Programmatic API for nx release
6
6
  */
7
7
  var release_1 = require("../src/command-line/release");
8
+ Object.defineProperty(exports, "ReleaseClient", { enumerable: true, get: function () { return release_1.ReleaseClient; } });
8
9
  Object.defineProperty(exports, "release", { enumerable: true, get: function () { return release_1.release; } });
9
10
  Object.defineProperty(exports, "releaseChangelog", { enumerable: true, get: function () { return release_1.releaseChangelog; } });
10
11
  Object.defineProperty(exports, "releasePublish", { enumerable: true, get: function () { return release_1.releasePublish; } });
@@ -397,6 +397,9 @@
397
397
  "accessToken": {
398
398
  "type": "string"
399
399
  },
400
+ "nxCloudId": {
401
+ "type": "string"
402
+ },
400
403
  "captureStderr": {
401
404
  "type": "boolean",
402
405
  "description": "Defines whether the cache captures stderr or just stdout."
@@ -1,2 +1,2 @@
1
1
  export declare const allowedProjectExtensions: readonly ["tags", "implicitDependencies", "configFilePath", "$schema", "generators", "namedInputs", "name", "files", "root", "sourceRoot", "projectType", "release", "includedScripts", "metadata"];
2
- export declare const allowedWorkspaceExtensions: readonly ["implicitDependencies", "affected", "defaultBase", "tasksRunnerOptions", "workspaceLayout", "plugins", "targetDefaults", "files", "generators", "namedInputs", "extends", "cli", "pluginsConfig", "defaultProject", "installation", "release", "nxCloudAccessToken", "nxCloudUrl", "nxCloudEncryptionKey", "parallel", "cacheDirectory", "useDaemonProcess", "useInferencePlugins", "neverConnectToCloud"];
2
+ export declare const allowedWorkspaceExtensions: readonly ["implicitDependencies", "affected", "defaultBase", "tasksRunnerOptions", "workspaceLayout", "plugins", "targetDefaults", "files", "generators", "namedInputs", "extends", "cli", "pluginsConfig", "defaultProject", "installation", "release", "nxCloudAccessToken", "nxCloudId", "nxCloudUrl", "nxCloudEncryptionKey", "parallel", "cacheDirectory", "useDaemonProcess", "useInferencePlugins", "neverConnectToCloud"];
@@ -54,6 +54,7 @@ exports.allowedWorkspaceExtensions = [
54
54
  'installation',
55
55
  'release',
56
56
  'nxCloudAccessToken',
57
+ 'nxCloudId',
57
58
  'nxCloudUrl',
58
59
  'nxCloudEncryptionKey',
59
60
  'parallel',
@@ -25,7 +25,8 @@ function onlyDefaultRunnerIsUsed(nxJson) {
25
25
  // No tasks runner options OR no default runner defined:
26
26
  // - If access token defined, uses cloud runner
27
27
  // - If no access token defined, uses default
28
- return !(nxJson.nxCloudAccessToken ?? process.env.NX_CLOUD_ACCESS_TOKEN);
28
+ return (!(nxJson.nxCloudAccessToken ?? process.env.NX_CLOUD_ACCESS_TOKEN) &&
29
+ !nxJson.nxCloudId);
29
30
  }
30
31
  return defaultRunner === 'nx/tasks-runners/default';
31
32
  }
@@ -55,12 +56,15 @@ async function connectWorkspaceToCloud(options, directory = workspace_root_1.wor
55
56
  }
56
57
  async function connectToNxCloudCommand(command) {
57
58
  const nxJson = (0, configuration_1.readNxJson)();
59
+ const installationSource = process.env.NX_CONSOLE
60
+ ? 'nx-console'
61
+ : 'nx-connect';
58
62
  if ((0, nx_cloud_utils_1.isNxCloudUsed)(nxJson)) {
59
63
  const token = process.env.NX_CLOUD_ACCESS_TOKEN || nxJson.nxCloudAccessToken;
60
64
  if (!token) {
61
65
  throw new Error(`Unable to authenticate. Either define accessToken in nx.json or set the NX_CLOUD_ACCESS_TOKEN env variable.`);
62
66
  }
63
- const connectCloudUrl = await (0, url_shorten_1.createNxCloudOnboardingURL)('nx-connect', token);
67
+ const connectCloudUrl = await (0, url_shorten_1.createNxCloudOnboardingURL)(installationSource, token);
64
68
  output_1.output.log({
65
69
  title: '✔ This workspace already has Nx Cloud set up',
66
70
  bodyLines: [
@@ -73,7 +77,7 @@ async function connectToNxCloudCommand(command) {
73
77
  return false;
74
78
  }
75
79
  const token = await connectWorkspaceToCloud({
76
- installationSource: command ?? 'nx-connect',
80
+ installationSource: command ?? installationSource,
77
81
  });
78
82
  const connectCloudUrl = await (0, url_shorten_1.createNxCloudOnboardingURL)('nx-connect', token);
79
83
  try {
@@ -1,4 +1,4 @@
1
- import { NxReleaseChangelogConfiguration } from '../../config/nx-json';
1
+ import { NxReleaseChangelogConfiguration, NxReleaseConfiguration } from '../../config/nx-json';
2
2
  import { ChangelogOptions } from './command-object';
3
3
  import { Reference } from './utils/git';
4
4
  import { ReleaseVersion } from './utils/shared';
@@ -30,10 +30,5 @@ export interface ChangelogChange {
30
30
  revertedHashes?: string[];
31
31
  }
32
32
  export declare const releaseChangelogCLIHandler: (args: ChangelogOptions) => Promise<number>;
33
- /**
34
- * NOTE: This function is also exported for programmatic usage and forms part of the public API
35
- * of Nx. We intentionally do not wrap the implementation with handleErrors because users need
36
- * to have control over their own error handling when using the API.
37
- */
38
- export declare function releaseChangelog(args: ChangelogOptions): Promise<NxReleaseChangelogResult>;
33
+ export declare function createAPI(overrideReleaseConfig: NxReleaseConfiguration): (args: ChangelogOptions) => Promise<NxReleaseChangelogResult>;
39
34
  export declare function shouldCreateGitHubRelease(changelogConfig: NxReleaseChangelogConfiguration | false | undefined, createReleaseArg?: ChangelogOptions['createRelease'] | undefined): boolean;