nx 19.5.7 → 19.6.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) 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/affected/affected.js +1 -1
  9. package/src/command-line/connect/connect-to-nx-cloud.js +2 -1
  10. package/src/command-line/init/init-v2.js +1 -1
  11. package/src/command-line/release/changelog.d.ts +2 -7
  12. package/src/command-line/release/changelog.js +415 -363
  13. package/src/command-line/release/command-object.d.ts +1 -0
  14. package/src/command-line/release/command-object.js +14 -0
  15. package/src/command-line/release/config/deep-merge-json.d.ts +1 -0
  16. package/src/command-line/release/config/deep-merge-json.js +28 -0
  17. package/src/command-line/release/config/version-plans.d.ts +5 -0
  18. package/src/command-line/release/config/version-plans.js +9 -5
  19. package/src/command-line/release/index.d.ts +16 -4
  20. package/src/command-line/release/index.js +23 -9
  21. package/src/command-line/release/plan.d.ts +2 -1
  22. package/src/command-line/release/plan.js +93 -100
  23. package/src/command-line/release/publish.d.ts +2 -6
  24. package/src/command-line/release/publish.js +67 -52
  25. package/src/command-line/release/release.d.ts +2 -1
  26. package/src/command-line/release/release.js +181 -165
  27. package/src/command-line/release/utils/generate-version-plan-content.js +2 -3
  28. package/src/command-line/release/utils/print-config.d.ts +7 -0
  29. package/src/command-line/release/utils/print-config.js +36 -0
  30. package/src/command-line/release/version.d.ts +7 -6
  31. package/src/command-line/release/version.js +179 -165
  32. package/src/command-line/run/run-one.js +1 -1
  33. package/src/command-line/run-many/run-many.js +1 -1
  34. package/src/command-line/yargs-utils/shared-options.d.ts +1 -0
  35. package/src/command-line/yargs-utils/shared-options.js +5 -0
  36. package/src/commands-runner/create-command-graph.js +4 -2
  37. package/src/config/nx-json.d.ts +6 -1
  38. package/src/core/graph/main.js +1 -1
  39. package/src/core/graph/styles.css +1 -1
  40. package/src/daemon/cache.d.ts +1 -0
  41. package/src/daemon/cache.js +25 -18
  42. package/src/daemon/client/client.js +9 -1
  43. package/src/daemon/message-types/force-shutdown.d.ts +5 -0
  44. package/src/daemon/message-types/force-shutdown.js +11 -0
  45. package/src/daemon/server/handle-force-shutdown.d.ts +5 -0
  46. package/src/daemon/server/handle-force-shutdown.js +18 -0
  47. package/src/daemon/server/handle-request-shutdown.js +2 -0
  48. package/src/daemon/server/server.d.ts +1 -0
  49. package/src/daemon/server/server.js +14 -0
  50. package/src/daemon/server/shutdown-utils.d.ts +2 -1
  51. package/src/daemon/server/shutdown-utils.js +11 -4
  52. package/src/daemon/server/watcher.js +3 -0
  53. package/src/devkit-internals.d.ts +1 -1
  54. package/src/devkit-internals.js +2 -1
  55. package/src/generators/utils/project-configuration.js +41 -11
  56. package/src/native/nx.wasm32-wasi.wasm +0 -0
  57. package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +45 -11
  58. package/src/nx-cloud/models/onboarding-status.d.ts +1 -0
  59. package/src/nx-cloud/models/onboarding-status.js +2 -0
  60. package/src/nx-cloud/nx-cloud-tasks-runner-shell.d.ts +1 -0
  61. package/src/nx-cloud/utilities/axios.js +9 -2
  62. package/src/nx-cloud/utilities/is-workspace-claimed.d.ts +1 -0
  63. package/src/nx-cloud/utilities/is-workspace-claimed.js +24 -0
  64. package/src/nx-cloud/utilities/onboarding.d.ts +5 -0
  65. package/src/nx-cloud/utilities/onboarding.js +28 -0
  66. package/src/project-graph/plugins/internal-api.js +16 -5
  67. package/src/project-graph/plugins/isolation/messaging.d.ts +5 -1
  68. package/src/project-graph/plugins/isolation/messaging.js +1 -0
  69. package/src/project-graph/plugins/isolation/plugin-pool.js +4 -6
  70. package/src/project-graph/plugins/isolation/plugin-worker.js +15 -0
  71. package/src/project-graph/utils/project-configuration-utils.d.ts +1 -0
  72. package/src/project-graph/utils/project-configuration-utils.js +6 -2
  73. package/src/tasks-runner/run-command.js +6 -1
  74. package/src/utils/command-line-utils.d.ts +1 -0
  75. package/src/utils/nx-cloud-utils.js +3 -1
  76. package/src/utils/package-json.d.ts +2 -9
  77. 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.5.7",
3
+ "version": "19.6.0-beta.1",
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.5.7"
74
+ "@nrwl/tao": "19.6.0-beta.1"
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.5.7",
90
- "@nx/nx-darwin-arm64": "19.5.7",
91
- "@nx/nx-linux-x64-gnu": "19.5.7",
92
- "@nx/nx-linux-x64-musl": "19.5.7",
93
- "@nx/nx-win32-x64-msvc": "19.5.7",
94
- "@nx/nx-linux-arm64-gnu": "19.5.7",
95
- "@nx/nx-linux-arm64-musl": "19.5.7",
96
- "@nx/nx-linux-arm-gnueabihf": "19.5.7",
97
- "@nx/nx-win32-arm64-msvc": "19.5.7",
98
- "@nx/nx-freebsd-x64": "19.5.7"
89
+ "@nx/nx-darwin-x64": "19.6.0-beta.1",
90
+ "@nx/nx-darwin-arm64": "19.6.0-beta.1",
91
+ "@nx/nx-linux-x64-gnu": "19.6.0-beta.1",
92
+ "@nx/nx-linux-x64-musl": "19.6.0-beta.1",
93
+ "@nx/nx-win32-x64-msvc": "19.6.0-beta.1",
94
+ "@nx/nx-linux-arm64-gnu": "19.6.0-beta.1",
95
+ "@nx/nx-linux-arm64-musl": "19.6.0-beta.1",
96
+ "@nx/nx-linux-arm-gnueabihf": "19.6.0-beta.1",
97
+ "@nx/nx-win32-arm64-msvc": "19.6.0-beta.1",
98
+ "@nx/nx-freebsd-x64": "19.6.0-beta.1"
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',
@@ -17,7 +17,7 @@ const find_matching_projects_1 = require("../../utils/find-matching-projects");
17
17
  const graph_1 = require("../graph/graph");
18
18
  const all_file_data_1 = require("../../utils/all-file-data");
19
19
  async function affected(command, args, extraTargetDependencies = {}, extraOptions = {
20
- excludeTaskDependencies: false,
20
+ excludeTaskDependencies: args.excludeTaskDependencies,
21
21
  loadDotEnvFiles: process.env.NX_LOAD_DOT_ENV_FILES !== 'false',
22
22
  }) {
23
23
  perf_hooks_1.performance.mark('code-loading:end');
@@ -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
  }
@@ -33,7 +33,7 @@ async function initHandler(options) {
33
33
  (0, add_nx_scripts_1.generateDotNxSetup)(version);
34
34
  const { plugins } = await detectPlugins();
35
35
  plugins.forEach((plugin) => {
36
- (0, child_process_2.execSync)(`./nx add ${plugin}`, {
36
+ (0, child_process_1.runNxSync)(`add ${plugin}`, {
37
37
  stdio: 'inherit',
38
38
  });
39
39
  });
@@ -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;