nx 18.1.0-canary.20240220-003b961 → 18.1.0-canary.20240222-5d6abe4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "18.1.0-canary.20240220-003b961",
3
+ "version": "18.1.0-canary.20240222-5d6abe4",
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": {
@@ -66,7 +66,7 @@
66
66
  "yargs-parser": "21.1.1",
67
67
  "node-machine-id": "1.1.12",
68
68
  "ora": "5.3.0",
69
- "@nrwl/tao": "18.1.0-canary.20240220-003b961"
69
+ "@nrwl/tao": "18.1.0-canary.20240222-5d6abe4"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@swc-node/register": "^1.8.0",
@@ -81,16 +81,16 @@
81
81
  }
82
82
  },
83
83
  "optionalDependencies": {
84
- "@nx/nx-darwin-x64": "18.1.0-canary.20240220-003b961",
85
- "@nx/nx-darwin-arm64": "18.1.0-canary.20240220-003b961",
86
- "@nx/nx-linux-x64-gnu": "18.1.0-canary.20240220-003b961",
87
- "@nx/nx-linux-x64-musl": "18.1.0-canary.20240220-003b961",
88
- "@nx/nx-win32-x64-msvc": "18.1.0-canary.20240220-003b961",
89
- "@nx/nx-linux-arm64-gnu": "18.1.0-canary.20240220-003b961",
90
- "@nx/nx-linux-arm64-musl": "18.1.0-canary.20240220-003b961",
91
- "@nx/nx-linux-arm-gnueabihf": "18.1.0-canary.20240220-003b961",
92
- "@nx/nx-win32-arm64-msvc": "18.1.0-canary.20240220-003b961",
93
- "@nx/nx-freebsd-x64": "18.1.0-canary.20240220-003b961"
84
+ "@nx/nx-darwin-x64": "18.1.0-canary.20240222-5d6abe4",
85
+ "@nx/nx-darwin-arm64": "18.1.0-canary.20240222-5d6abe4",
86
+ "@nx/nx-linux-x64-gnu": "18.1.0-canary.20240222-5d6abe4",
87
+ "@nx/nx-linux-x64-musl": "18.1.0-canary.20240222-5d6abe4",
88
+ "@nx/nx-win32-x64-msvc": "18.1.0-canary.20240222-5d6abe4",
89
+ "@nx/nx-linux-arm64-gnu": "18.1.0-canary.20240222-5d6abe4",
90
+ "@nx/nx-linux-arm64-musl": "18.1.0-canary.20240222-5d6abe4",
91
+ "@nx/nx-linux-arm-gnueabihf": "18.1.0-canary.20240222-5d6abe4",
92
+ "@nx/nx-win32-arm64-msvc": "18.1.0-canary.20240222-5d6abe4",
93
+ "@nx/nx-freebsd-x64": "18.1.0-canary.20240222-5d6abe4"
94
94
  },
95
95
  "nx-migrations": {
96
96
  "migrations": "./migrations.json",
@@ -126,6 +126,7 @@
126
126
  "@nrwl/next",
127
127
  "@nx/node",
128
128
  "@nrwl/node",
129
+ "@nx/nuxt",
129
130
  "@nx/playwright",
130
131
  "@nx/plugin",
131
132
  "@nrwl/nx-plugin",
@@ -266,7 +266,7 @@ async function generateGraph(args, affectedProjects) {
266
266
  const { app, url } = await startServer(html, environmentJs, args.host || '127.0.0.1', args.port || 4211, args.watch, affectedProjects, args.focus, args.groupByFolder, args.exclude);
267
267
  url.pathname = args.view;
268
268
  if (args.focus) {
269
- url.pathname += '/' + args.focus;
269
+ url.pathname += '/' + encodeURIComponent(args.focus);
270
270
  }
271
271
  if (target) {
272
272
  url.pathname += '/' + target;
@@ -110,7 +110,8 @@ function runMigration() {
110
110
  function nxCliPath() {
111
111
  const version = process.env.NX_MIGRATE_CLI_VERSION || 'latest';
112
112
  try {
113
- const packageManager = (0, package_manager_1.getPackageManagerCommand)();
113
+ const packageManager = (0, package_manager_1.detectPackageManager)();
114
+ const pmc = (0, package_manager_1.getPackageManagerCommand)(packageManager);
114
115
  const { dirSync } = require('tmp');
115
116
  const tmpDir = dirSync().name;
116
117
  (0, fileutils_1.writeJsonFile)(path.join(tmpDir, 'package.json'), {
@@ -119,7 +120,21 @@ function nxCliPath() {
119
120
  },
120
121
  license: 'MIT',
121
122
  });
122
- (0, child_process_2.execSync)(packageManager.install, {
123
+ if (pmc.preInstall) {
124
+ // ensure package.json and repo in tmp folder is set to a proper package manager state
125
+ (0, child_process_2.execSync)(pmc.preInstall, {
126
+ cwd: tmpDir,
127
+ stdio: ['ignore', 'ignore', 'ignore'],
128
+ });
129
+ // if it's berry ensure we set the node_linker to node-modules
130
+ if (packageManager === 'yarn' && pmc.ciInstall.includes('immutable')) {
131
+ (0, child_process_2.execSync)(pmc.preInstall, {
132
+ cwd: 'yarn config set nodeLinker node-modules',
133
+ stdio: ['ignore', 'ignore', 'ignore'],
134
+ });
135
+ }
136
+ }
137
+ (0, child_process_2.execSync)(pmc.install, {
123
138
  cwd: tmpDir,
124
139
  stdio: ['ignore', 'ignore', 'ignore'],
125
140
  });
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.shouldCreateGitHubRelease = exports.releaseChangelog = exports.releaseChangelogCLIHandler = void 0;
4
4
  const chalk = require("chalk");
5
+ const enquirer_1 = require("enquirer");
5
6
  const node_fs_1 = require("node:fs");
6
7
  const semver_1 = require("semver");
7
8
  const tmp_1 = require("tmp");
@@ -10,6 +11,7 @@ const tree_1 = require("../../generators/tree");
10
11
  const register_1 = require("../../plugins/js/utils/register");
11
12
  const project_graph_1 = require("../../project-graph/project-graph");
12
13
  const utils_1 = require("../../tasks-runner/utils");
14
+ const is_ci_1 = require("../../utils/is-ci");
13
15
  const output_1 = require("../../utils/output");
14
16
  const params_1 = require("../../utils/params");
15
17
  const path_1 = require("../../utils/path");
@@ -302,6 +304,25 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
302
304
  `No changes were detected for any changelog files, so no changelog entries will be generated.`,
303
305
  ],
304
306
  });
307
+ if (!postGitTasks.length) {
308
+ // no GitHub releases to create so we can just exit
309
+ return;
310
+ }
311
+ if ((0, is_ci_1.isCI)()) {
312
+ output_1.output.warn({
313
+ title: `Skipped GitHub release creation because no changes were detected for any changelog files.`,
314
+ });
315
+ return;
316
+ }
317
+ // prompt the user to see if they want to create a GitHub release anyway
318
+ // we know that the user has configured GitHub releases because we have postGitTasks
319
+ const shouldCreateGitHubReleaseAnyway = await promptForGitHubRelease();
320
+ if (!shouldCreateGitHubReleaseAnyway) {
321
+ return;
322
+ }
323
+ for (const postGitTask of postGitTasks) {
324
+ await postGitTask(latestCommit);
325
+ }
305
326
  return;
306
327
  }
307
328
  // Generate a new commit for the changes, if configured to do so
@@ -600,3 +621,19 @@ function shouldCreateGitHubRelease(changelogConfig, createReleaseArg = undefined
600
621
  return (changelogConfig || {}).createRelease === 'github';
601
622
  }
602
623
  exports.shouldCreateGitHubRelease = shouldCreateGitHubRelease;
624
+ async function promptForGitHubRelease() {
625
+ try {
626
+ const result = await (0, enquirer_1.prompt)([
627
+ {
628
+ name: 'confirmation',
629
+ message: 'Do you want to create a GitHub release anyway?',
630
+ type: 'confirm',
631
+ },
632
+ ]);
633
+ return result.confirmation;
634
+ }
635
+ catch (e) {
636
+ // Handle the case where the user exits the prompt with ctrl+c
637
+ return false;
638
+ }
639
+ }