nx 19.6.0-canary.20240814-6d83ae2 → 19.6.0-canary.20240815-5410794

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "19.6.0-canary.20240814-6d83ae2",
3
+ "version": "19.6.0-canary.20240815-5410794",
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.20240814-6d83ae2"
74
+ "@nrwl/tao": "19.6.0-canary.20240815-5410794"
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.20240814-6d83ae2",
90
- "@nx/nx-darwin-arm64": "19.6.0-canary.20240814-6d83ae2",
91
- "@nx/nx-linux-x64-gnu": "19.6.0-canary.20240814-6d83ae2",
92
- "@nx/nx-linux-x64-musl": "19.6.0-canary.20240814-6d83ae2",
93
- "@nx/nx-win32-x64-msvc": "19.6.0-canary.20240814-6d83ae2",
94
- "@nx/nx-linux-arm64-gnu": "19.6.0-canary.20240814-6d83ae2",
95
- "@nx/nx-linux-arm64-musl": "19.6.0-canary.20240814-6d83ae2",
96
- "@nx/nx-linux-arm-gnueabihf": "19.6.0-canary.20240814-6d83ae2",
97
- "@nx/nx-win32-arm64-msvc": "19.6.0-canary.20240814-6d83ae2",
98
- "@nx/nx-freebsd-x64": "19.6.0-canary.20240814-6d83ae2"
89
+ "@nx/nx-darwin-x64": "19.6.0-canary.20240815-5410794",
90
+ "@nx/nx-darwin-arm64": "19.6.0-canary.20240815-5410794",
91
+ "@nx/nx-linux-x64-gnu": "19.6.0-canary.20240815-5410794",
92
+ "@nx/nx-linux-x64-musl": "19.6.0-canary.20240815-5410794",
93
+ "@nx/nx-win32-x64-msvc": "19.6.0-canary.20240815-5410794",
94
+ "@nx/nx-linux-arm64-gnu": "19.6.0-canary.20240815-5410794",
95
+ "@nx/nx-linux-arm64-musl": "19.6.0-canary.20240815-5410794",
96
+ "@nx/nx-linux-arm-gnueabihf": "19.6.0-canary.20240815-5410794",
97
+ "@nx/nx-win32-arm64-msvc": "19.6.0-canary.20240815-5410794",
98
+ "@nx/nx-freebsd-x64": "19.6.0-canary.20240815-5410794"
99
99
  },
100
100
  "nx-migrations": {
101
101
  "migrations": "./migrations.json",
@@ -191,5 +191,6 @@
191
191
  ]
192
192
  },
193
193
  "main": "./bin/nx.js",
194
- "type": "commonjs"
194
+ "type": "commonjs",
195
+ "types": "./bin/nx.d.ts"
195
196
  }
@@ -53,6 +53,7 @@ export type PlanCheckOptions = BaseNxReleaseArgs & {
53
53
  untracked?: boolean;
54
54
  };
55
55
  export type ReleaseOptions = NxReleaseArgs & FirstReleaseArgs & {
56
+ specifier?: string;
56
57
  yes?: boolean;
57
58
  skipPublish?: boolean;
58
59
  };
@@ -60,6 +60,16 @@ function createAPI(overrideReleaseConfig) {
60
60
  isDebug: args.printConfig === 'debug',
61
61
  });
62
62
  }
63
+ const rawVersionPlans = await (0, version_plans_1.readRawVersionPlans)();
64
+ if (args.specifier && rawVersionPlans.length > 0) {
65
+ output_1.output.error({
66
+ title: `A specifier option cannot be provided when using version plans.`,
67
+ bodyLines: [
68
+ `To override this behavior, use the Nx Release programmatic API directly (https://nx.dev/features/manage-releases#using-the-programmatic-api-for-nx-release).`,
69
+ ],
70
+ });
71
+ process.exit(1);
72
+ }
63
73
  // These properties must never be undefined as this command should
64
74
  // always explicitly override the git operations of the subcommands.
65
75
  const shouldCommit = userProvidedReleaseConfig.git?.commit ?? true;
@@ -87,7 +97,6 @@ function createAPI(overrideReleaseConfig) {
87
97
  output_1.output.error(filterError);
88
98
  process.exit(1);
89
99
  }
90
- const rawVersionPlans = await (0, version_plans_1.readRawVersionPlans)();
91
100
  (0, version_plans_1.setResolvedVersionPlansOnGroups)(rawVersionPlans, releaseGroups, Object.keys(projectGraph.nodes));
92
101
  const planFiles = new Set();
93
102
  releaseGroups.forEach((group) => {
@@ -83,8 +83,15 @@ function createAPI(overrideReleaseConfig) {
83
83
  output_1.output.error(filterError);
84
84
  process.exit(1);
85
85
  }
86
- const rawVersionPlans = await (0, version_plans_1.readRawVersionPlans)();
87
- (0, version_plans_1.setResolvedVersionPlansOnGroups)(rawVersionPlans, releaseGroups, Object.keys(projectGraph.nodes));
86
+ if (!args.specifier) {
87
+ const rawVersionPlans = await (0, version_plans_1.readRawVersionPlans)();
88
+ (0, version_plans_1.setResolvedVersionPlansOnGroups)(rawVersionPlans, releaseGroups, Object.keys(projectGraph.nodes));
89
+ }
90
+ else {
91
+ if (args.verbose && releaseGroups.some((g) => !!g.versionPlans)) {
92
+ console.log(`Skipping version plan discovery as a specifier was provided`);
93
+ }
94
+ }
88
95
  if (args.deleteVersionPlans === undefined) {
89
96
  // default to not delete version plans after versioning as they may be needed for changelog generation
90
97
  args.deleteVersionPlans = false;
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.syncHandler = syncHandler;
4
+ const ora = require("ora");
4
5
  const project_graph_1 = require("../../project-graph/project-graph");
5
6
  const output_1 = require("../../utils/output");
6
7
  const params_1 = require("../../utils/params");
7
8
  const sync_generators_1 = require("../../utils/sync-generators");
9
+ const chalk = require("chalk");
8
10
  function syncHandler(options) {
9
11
  if (options.verbose) {
10
12
  process.env.NX_VERBOSE_LOGGING = 'true';
@@ -15,6 +17,12 @@ function syncHandler(options) {
15
17
  const syncGenerators = await (0, sync_generators_1.collectAllRegisteredSyncGenerators)(projectGraph);
16
18
  const results = await (0, sync_generators_1.getSyncGeneratorChanges)(syncGenerators);
17
19
  if (!results.length) {
20
+ output_1.output.success({
21
+ title: options.check
22
+ ? 'The workspace is up to date'
23
+ : 'The workspace is already up to date',
24
+ bodyLines: syncGenerators.map((generator) => `The ${chalk.bold(generator)} sync generator didn't identify any files in the workspace that are out of sync.`),
25
+ });
18
26
  return 0;
19
27
  }
20
28
  if (options.check) {
@@ -24,7 +32,17 @@ function syncHandler(options) {
24
32
  });
25
33
  return 1;
26
34
  }
35
+ output_1.output.warn({
36
+ title: `The workspace is out of sync`,
37
+ bodyLines: (0, sync_generators_1.syncGeneratorResultsToMessageLines)(results),
38
+ });
39
+ const spinner = ora('Syncing the workspace...');
40
+ spinner.start();
27
41
  await (0, sync_generators_1.flushSyncGeneratorChanges)(results);
42
+ spinner.succeed(`The workspace was synced successfully!
43
+
44
+ Please make sure to commit the changes to your repository.
45
+ `);
28
46
  return 0;
29
47
  });
30
48
  }