nx 21.1.2 → 21.2.0-beta.2

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/.eslintrc.json CHANGED
@@ -105,6 +105,7 @@
105
105
  "typescript",
106
106
  "@nrwl/angular",
107
107
  "@angular-devkit/build-angular",
108
+ "@angular/build",
108
109
  "@angular-devkit/core",
109
110
  "@angular-devkit/architect",
110
111
  "@swc/core", //Optional, used in JS analysis if available
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <p style="text-align: center;">
2
2
  <picture>
3
3
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
4
- <img alt="Nx - Smart Monorepos · Fast CI" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
4
+ <img alt="Nx - Smart Repos · Fast Builds" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
5
5
  </picture>
6
6
  </p>
7
7
 
@@ -20,9 +20,9 @@
20
20
 
21
21
  <hr>
22
22
 
23
- # Nx: Smart Monorepos · Fast CI
23
+ # Nx: Smart Repos · Fast Builds
24
24
 
25
- Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
25
+ An AI-first build platform that connects everything from your editor to CI. Helping you deliver fast, without breaking things.
26
26
 
27
27
  ## Getting Started
28
28
 
@@ -62,5 +62,5 @@ npx nx@latest init
62
62
  - [Blog Posts About Nx](https://nx.dev/blog)
63
63
 
64
64
  <p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
65
- width="100%" alt="Nx - Smart Monorepos · Fast CI"></a></p>
65
+ width="100%" alt="Nx - Smart Repos · Fast Builds"></a></p>
66
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "21.1.2",
3
+ "version": "21.2.0-beta.2",
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": {
@@ -83,16 +83,16 @@
83
83
  }
84
84
  },
85
85
  "optionalDependencies": {
86
- "@nx/nx-darwin-arm64": "21.1.2",
87
- "@nx/nx-darwin-x64": "21.1.2",
88
- "@nx/nx-freebsd-x64": "21.1.2",
89
- "@nx/nx-linux-arm-gnueabihf": "21.1.2",
90
- "@nx/nx-linux-arm64-gnu": "21.1.2",
91
- "@nx/nx-linux-arm64-musl": "21.1.2",
92
- "@nx/nx-linux-x64-gnu": "21.1.2",
93
- "@nx/nx-linux-x64-musl": "21.1.2",
94
- "@nx/nx-win32-arm64-msvc": "21.1.2",
95
- "@nx/nx-win32-x64-msvc": "21.1.2"
86
+ "@nx/nx-darwin-arm64": "21.2.0-beta.2",
87
+ "@nx/nx-darwin-x64": "21.2.0-beta.2",
88
+ "@nx/nx-freebsd-x64": "21.2.0-beta.2",
89
+ "@nx/nx-linux-arm-gnueabihf": "21.2.0-beta.2",
90
+ "@nx/nx-linux-arm64-gnu": "21.2.0-beta.2",
91
+ "@nx/nx-linux-arm64-musl": "21.2.0-beta.2",
92
+ "@nx/nx-linux-x64-gnu": "21.2.0-beta.2",
93
+ "@nx/nx-linux-x64-musl": "21.2.0-beta.2",
94
+ "@nx/nx-win32-arm64-msvc": "21.2.0-beta.2",
95
+ "@nx/nx-win32-x64-msvc": "21.2.0-beta.2"
96
96
  },
97
97
  "nx-migrations": {
98
98
  "migrations": "./migrations.json",
@@ -93,6 +93,10 @@ if (!patched) {
93
93
  () => { };
94
94
  }
95
95
  catch (e) { }
96
+ try {
97
+ require('@angular/build/private').assertCompatibleAngularVersion = () => { };
98
+ }
99
+ catch (e) { }
96
100
  patched = true;
97
101
  }
98
102
  function mockReadWorkspace(ngCoreWorkspace) {
@@ -6,7 +6,7 @@ const documentation_1 = require("../yargs-utils/documentation");
6
6
  const shared_options_1 = require("../yargs-utils/shared-options");
7
7
  exports.yargsAffectedCommand = {
8
8
  command: 'affected',
9
- describe: 'Run target for affected projects. See https://nx.dev/ci/features/affected for more details.',
9
+ describe: 'Run target for affected projects. Affected projects are projects that have been changed and projects that depend on the changed projects. See https://nx.dev/ci/features/affected for more details.',
10
10
  builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withTuiOptions)((0, shared_options_1.withRunOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withTargetAndConfigurationOption)((0, shared_options_1.withBatch)(yargs))))))
11
11
  .option('all', {
12
12
  type: 'boolean',
@@ -36,6 +36,7 @@ export interface ExpandedTaskInputsReponse {
36
36
  }
37
37
  export declare function generateGraph(args: {
38
38
  file?: string;
39
+ print?: boolean;
39
40
  host?: string;
40
41
  port?: number;
41
42
  groupByFolder?: boolean;
@@ -9,6 +9,7 @@ const minimatch_1 = require("minimatch");
9
9
  const node_url_1 = require("node:url");
10
10
  const open = require("open");
11
11
  const path_1 = require("path");
12
+ const net = require("net");
12
13
  const perf_hooks_1 = require("perf_hooks");
13
14
  const configuration_1 = require("../../config/configuration");
14
15
  const fileutils_1 = require("../../utils/fileutils");
@@ -207,7 +208,7 @@ async function generateGraph(args, affectedProjects) {
207
208
  }
208
209
  }
209
210
  if (args.affected) {
210
- affectedProjects = (await (0, affected_1.getAffectedGraphNodes)((0, command_line_utils_1.splitArgsIntoNxArgsAndOverrides)(args, 'affected', { printWarnings: args.file !== 'stdout' }, (0, configuration_1.readNxJson)()).nxArgs, rawGraph)).map((n) => n.name);
211
+ affectedProjects = (await (0, affected_1.getAffectedGraphNodes)((0, command_line_utils_1.splitArgsIntoNxArgsAndOverrides)(args, 'affected', { printWarnings: !args.print && args.file !== 'stdout' }, (0, configuration_1.readNxJson)()).nxArgs, rawGraph)).map((n) => n.name);
211
212
  }
212
213
  if (args.exclude) {
213
214
  const invalidExcludes = [];
@@ -226,13 +227,12 @@ async function generateGraph(args, affectedProjects) {
226
227
  }
227
228
  let html = (0, node_fs_1.readFileSync)((0, path_1.join)(__dirname, '../../core/graph/index.html'), 'utf-8');
228
229
  prunedGraph = filterGraph(prunedGraph, args.focus || null, args.exclude || []);
230
+ if (args.print || args.file === 'stdout') {
231
+ console.log(JSON.stringify(await createJsonOutput(prunedGraph, rawGraph, args.projects, args.targets), null, 2));
232
+ await output_1.output.drain();
233
+ process.exit(0);
234
+ }
229
235
  if (args.file) {
230
- // stdout is a magical constant that doesn't actually write a file
231
- if (args.file === 'stdout') {
232
- console.log(JSON.stringify(await createJsonOutput(prunedGraph, rawGraph, args.projects, args.targets), null, 2));
233
- await output_1.output.drain();
234
- process.exit(0);
235
- }
236
236
  const workspaceFolder = workspace_root_1.workspaceRoot;
237
237
  const ext = (0, path_1.extname)(args.file);
238
238
  const fullFilePath = (0, path_1.isAbsolute)(args.file)
@@ -287,7 +287,20 @@ async function generateGraph(args, affectedProjects) {
287
287
  }
288
288
  else {
289
289
  const environmentJs = buildEnvironmentJs(args.exclude || [], args.watch, !!args.file && args.file.endsWith('html') ? 'build' : 'serve');
290
- 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);
290
+ let app;
291
+ let url;
292
+ try {
293
+ const result = await startServer(html, environmentJs, args.host || '127.0.0.1', args.port || 4211, args.watch, affectedProjects, args.focus, args.groupByFolder, args.exclude);
294
+ app = result.app;
295
+ url = result.url;
296
+ }
297
+ catch (err) {
298
+ output_1.output.error({
299
+ title: 'Failed to start graph server',
300
+ bodyLines: [err.message],
301
+ });
302
+ process.exit(1);
303
+ }
291
304
  url.pathname = args.view;
292
305
  if (args.focus) {
293
306
  url.pathname += '/' + encodeURIComponent(args.focus);
@@ -318,6 +331,28 @@ async function generateGraph(args, affectedProjects) {
318
331
  });
319
332
  }
320
333
  }
334
+ function findAvailablePort(startPort, host = '127.0.0.1') {
335
+ return new Promise((resolve, reject) => {
336
+ const server = net.createServer();
337
+ server.listen(startPort, host, () => {
338
+ const port = server.address().port;
339
+ server.close(() => {
340
+ resolve(port);
341
+ });
342
+ });
343
+ server.on('error', (err) => {
344
+ if (err.code === 'EADDRINUSE') {
345
+ // Port is in use, try the next one
346
+ findAvailablePort(startPort + 1, host)
347
+ .then(resolve)
348
+ .catch(reject);
349
+ }
350
+ else {
351
+ reject(err);
352
+ }
353
+ });
354
+ });
355
+ }
321
356
  async function startServer(html, environmentJs, host, port = 4211, watchForChanges = true, affected = [], focus = null, groupByFolder = false, exclude = []) {
322
357
  let unregisterFileWatcher;
323
358
  if (watchForChanges && !client_1.daemonClient.enabled()) {
@@ -418,9 +453,19 @@ async function startServer(html, environmentJs, host, port = 4211, watchForChang
418
453
  };
419
454
  process.on('SIGINT', () => handleTermination(128 + 2));
420
455
  process.on('SIGTERM', () => handleTermination(128 + 15));
421
- return new Promise((res) => {
422
- app.listen(port, host, () => {
423
- res({ app, url: new node_url_1.URL(`http://${host}:${port}`) });
456
+ // Find an available port starting from the requested port
457
+ const availablePort = await findAvailablePort(port, host);
458
+ return new Promise((res, rej) => {
459
+ app.on('error', (err) => {
460
+ rej(err);
461
+ });
462
+ app.listen(availablePort, host, () => {
463
+ if (availablePort !== port) {
464
+ output_1.output.note({
465
+ title: `Port ${port} was already in use, using port ${availablePort} instead`,
466
+ });
467
+ }
468
+ res({ app, url: new node_url_1.URL(`http://${host}:${availablePort}`) });
424
469
  });
425
470
  });
426
471
  }
@@ -95,7 +95,9 @@ function addPluginDependencies() {
95
95
  const angularCliVersion = packageJson.devDependencies['@angular/cli'] ??
96
96
  packageJson.dependencies?.['@angular/cli'] ??
97
97
  packageJson.devDependencies['@angular-devkit/build-angular'] ??
98
- packageJson.dependencies?.['@angular-devkit/build-angular'];
98
+ packageJson.dependencies?.['@angular-devkit/build-angular'] ??
99
+ packageJson.devDependencies['@angular/build'] ??
100
+ packageJson.dependencies?.['@angular/build'];
99
101
  for (const dep of peerDepsToInstall) {
100
102
  if (!packageJson.devDependencies[dep] && !packageJson.dependencies?.[dep]) {
101
103
  packageJson.devDependencies[dep] = angularCliVersion;
@@ -5,28 +5,47 @@ const child_process_1 = require("child_process");
5
5
  const path_1 = require("path");
6
6
  const semver_1 = require("semver");
7
7
  const fileutils_1 = require("../../../../utils/fileutils");
8
+ const installation_directory_1 = require("../../../../utils/installation-directory");
8
9
  const object_sort_1 = require("../../../../utils/object-sort");
9
10
  const output_1 = require("../../../../utils/output");
10
11
  const package_json_1 = require("../../../../utils/package-json");
11
12
  const package_manager_1 = require("../../../../utils/package-manager");
12
- const utils_1 = require("../utils");
13
13
  const connect_to_nx_cloud_1 = require("../../../connect/connect-to-nx-cloud");
14
+ const utils_1 = require("../utils");
14
15
  // map of Angular major versions to Nx versions to use for legacy `nx init` migrations,
15
16
  // key is major Angular version and value is Nx version to use
16
17
  const nxAngularLegacyVersionMap = {
17
18
  14: '~17.0.0',
18
19
  15: '~19.0.0',
19
20
  16: '~20.1.0',
21
+ 17: '~21.1.0',
20
22
  };
21
23
  // min major angular version supported in latest Nx
22
- const minMajorAngularVersionSupported = 17;
24
+ const minMajorAngularVersionSupported = Math.max(...Object.keys(nxAngularLegacyVersionMap).map(Number)) + 1;
23
25
  // version when the Nx CLI changed from @nrwl/tao & @nrwl/cli to nx
24
26
  const versionWithConsolidatedPackages = '13.9.0';
25
27
  // version when packages were rescoped from @nrwl/* to @nx/*
26
28
  const versionWithRescopeToNx = '16.0.0-beta.2';
27
29
  async function getLegacyMigrationFunctionIfApplicable(repoRoot, options) {
28
- const angularVersion = (0, package_json_1.readModulePackageJson)('@angular/core').packageJson.version;
29
- const majorAngularVersion = (0, semver_1.major)(angularVersion);
30
+ let majorAngularVersion;
31
+ try {
32
+ const angularVersion = (0, package_json_1.readModulePackageJson)('@angular/core', [
33
+ repoRoot,
34
+ ...(0, installation_directory_1.getNxRequirePaths)(),
35
+ ]).packageJson.version;
36
+ majorAngularVersion = (0, semver_1.major)(angularVersion);
37
+ }
38
+ catch {
39
+ output_1.output.error({
40
+ title: 'Could not determine the existing Angular version',
41
+ bodyLines: [
42
+ 'Please ensure "@angular/core" is installed in the workspace and you are running this command from the root of the workspace.',
43
+ ],
44
+ });
45
+ // errors are caught in the initHandler and not logged to the user, so we
46
+ // log it first and then throw to ensure it is logged to the user
47
+ throw new Error('Could not determine the existing Angular version');
48
+ }
30
49
  if (majorAngularVersion >= minMajorAngularVersionSupported) {
31
50
  // non-legacy
32
51
  return null;
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setupStandaloneWorkspace = setupStandaloneWorkspace;
4
4
  const fs_1 = require("fs");
5
- const path_1 = require("path");
5
+ const node_path_1 = require("node:path");
6
6
  const angular_json_1 = require("../../../../adapter/angular-json");
7
7
  const fileutils_1 = require("../../../../utils/fileutils");
8
- const path_2 = require("../../../../utils/path");
8
+ const path_1 = require("../../../../utils/path");
9
9
  const utils_1 = require("../utils");
10
10
  async function setupStandaloneWorkspace(repoRoot, cacheableOperations, workspaceTargets) {
11
- const angularJsonPath = (0, path_1.join)(repoRoot, 'angular.json');
11
+ const angularJsonPath = (0, node_path_1.join)(repoRoot, 'angular.json');
12
12
  const angularJson = (0, fileutils_1.readJsonFile)(angularJsonPath);
13
13
  const workspaceCapabilities = getWorkspaceCapabilities(angularJson.projects);
14
14
  createNxJson(repoRoot, angularJson, cacheableOperations, workspaceCapabilities, workspaceTargets);
@@ -24,9 +24,9 @@ async function setupStandaloneWorkspace(repoRoot, cacheableOperations, workspace
24
24
  // update its targets outputs and delete angular.json
25
25
  const projects = (0, angular_json_1.toNewFormat)(angularJson).projects;
26
26
  for (const [projectName, project] of Object.entries(projects ?? {})) {
27
- updateProjectOutputs(repoRoot, project);
28
- (0, fileutils_1.writeJsonFile)((0, path_1.join)(project.root, 'project.json'), {
29
- $schema: (0, path_2.normalizePath)((0, path_1.relative)((0, path_1.join)(repoRoot, project.root), (0, path_1.join)(repoRoot, 'node_modules/nx/schemas/project-schema.json'))),
27
+ updateProjectOutputs(repoRoot, projectName, project, cacheableOperations);
28
+ (0, fileutils_1.writeJsonFile)((0, node_path_1.join)(project.root, 'project.json'), {
29
+ $schema: (0, path_1.normalizePath)((0, node_path_1.relative)((0, node_path_1.join)(repoRoot, project.root), (0, node_path_1.join)(repoRoot, 'node_modules/nx/schemas/project-schema.json'))),
30
30
  name: projectName,
31
31
  ...project,
32
32
  root: undefined,
@@ -36,7 +36,7 @@ async function setupStandaloneWorkspace(repoRoot, cacheableOperations, workspace
36
36
  }
37
37
  function createNxJson(repoRoot, angularJson, cacheableOperations, { eslintProjectConfigFile, test, karmaProjectConfigFile, }, workspaceTargets) {
38
38
  (0, utils_1.createNxJsonFile)(repoRoot, [], cacheableOperations, {});
39
- const nxJson = (0, fileutils_1.readJsonFile)((0, path_1.join)(repoRoot, 'nx.json'));
39
+ const nxJson = (0, fileutils_1.readJsonFile)((0, node_path_1.join)(repoRoot, 'nx.json'));
40
40
  nxJson.namedInputs = {
41
41
  sharedGlobals: [],
42
42
  default: ['{projectRoot}/**/*', 'sharedGlobals'],
@@ -70,7 +70,7 @@ function createNxJson(repoRoot, angularJson, cacheableOperations, { eslintProjec
70
70
  }
71
71
  if (workspaceTargets.includes('test')) {
72
72
  const inputs = ['default', '^production'];
73
- if ((0, fileutils_1.fileExists)((0, path_1.join)(repoRoot, 'karma.conf.js'))) {
73
+ if ((0, fileutils_1.fileExists)((0, node_path_1.join)(repoRoot, 'karma.conf.js'))) {
74
74
  inputs.push('{workspaceRoot}/karma.conf.js');
75
75
  }
76
76
  nxJson.targetDefaults.test = {
@@ -80,10 +80,10 @@ function createNxJson(repoRoot, angularJson, cacheableOperations, { eslintProjec
80
80
  }
81
81
  if (workspaceTargets.includes('lint')) {
82
82
  const inputs = ['default'];
83
- if ((0, fileutils_1.fileExists)((0, path_1.join)(repoRoot, '.eslintrc.json'))) {
83
+ if ((0, fileutils_1.fileExists)((0, node_path_1.join)(repoRoot, '.eslintrc.json'))) {
84
84
  inputs.push('{workspaceRoot}/.eslintrc.json');
85
85
  }
86
- if ((0, fileutils_1.fileExists)((0, path_1.join)(repoRoot, 'eslint.config.cjs'))) {
86
+ if ((0, fileutils_1.fileExists)((0, node_path_1.join)(repoRoot, 'eslint.config.cjs'))) {
87
87
  inputs.push('{workspaceRoot}/eslint.config.cjs');
88
88
  }
89
89
  nxJson.targetDefaults.lint = {
@@ -97,11 +97,30 @@ function createNxJson(repoRoot, angularJson, cacheableOperations, { eslintProjec
97
97
  inputs: ['default', '^production'],
98
98
  };
99
99
  }
100
- (0, fileutils_1.writeJsonFile)((0, path_1.join)(repoRoot, 'nx.json'), nxJson);
100
+ (0, fileutils_1.writeJsonFile)((0, node_path_1.join)(repoRoot, 'nx.json'), nxJson);
101
101
  }
102
- function updateProjectOutputs(repoRoot, project) {
103
- Object.values(project.targets ?? {}).forEach((target) => {
104
- if ([
102
+ function updateProjectOutputs(repoRoot, projectName, project, cacheableOperations) {
103
+ Object.entries(project.targets ?? {}).forEach(([targetName, target]) => {
104
+ if (target.executor === '@angular/build:application' ||
105
+ target.executor === '@angular-devkit/build-angular:application') {
106
+ if (target.options.outputPath) {
107
+ if (typeof target.options.outputPath === 'string') {
108
+ target.outputs = ['{options.outputPath}'];
109
+ }
110
+ else if (target.options.outputPath.base) {
111
+ target.outputs = ['{options.outputPath.base}'];
112
+ }
113
+ else if (cacheableOperations.includes(targetName)) {
114
+ target.cache = false;
115
+ }
116
+ }
117
+ else {
118
+ target.options.outputPath = node_path_1.posix.join('dist', projectName);
119
+ target.outputs = ['{options.outputPath}'];
120
+ }
121
+ }
122
+ else if ([
123
+ '@angular-devkit/build-angular:browser-esbuild',
105
124
  '@angular-devkit/build-angular:browser',
106
125
  '@angular-builders/custom-webpack:browser',
107
126
  'ngx-build-plus:browser',
@@ -109,7 +128,12 @@ function updateProjectOutputs(repoRoot, project) {
109
128
  '@angular-builders/custom-webpack:server',
110
129
  'ngx-build-plus:server',
111
130
  ].includes(target.executor)) {
112
- target.outputs = ['{options.outputPath}'];
131
+ if (target.options.outputPath) {
132
+ target.outputs = ['{options.outputPath}'];
133
+ }
134
+ else if (cacheableOperations.includes(targetName)) {
135
+ target.cache = false;
136
+ }
113
137
  }
114
138
  else if (target.executor === '@angular-eslint/builder:lint') {
115
139
  target.outputs = ['{options.outputFile}'];
@@ -117,10 +141,11 @@ function updateProjectOutputs(repoRoot, project) {
117
141
  else if (target.executor === '@angular-devkit/build-angular:ng-packagr' ||
118
142
  target.executor === '@angular/build:ng-packagr') {
119
143
  try {
120
- const ngPackageJsonPath = (0, path_1.join)(repoRoot, target.options.project);
144
+ const ngPackagrProject = target.options.project ?? node_path_1.posix.join(project.root, 'ng-package.json');
145
+ const ngPackageJsonPath = (0, node_path_1.join)(repoRoot, ngPackagrProject);
121
146
  const ngPackageJson = (0, fileutils_1.readJsonFile)(ngPackageJsonPath);
122
- const outputPath = (0, path_1.relative)(repoRoot, (0, path_1.resolve)((0, path_1.dirname)(ngPackageJsonPath), ngPackageJson.dest));
123
- target.outputs = [`{workspaceRoot}/${(0, path_2.normalizePath)(outputPath)}`];
147
+ const outputPath = (0, node_path_1.relative)(repoRoot, (0, node_path_1.resolve)((0, node_path_1.dirname)(ngPackageJsonPath), ngPackageJson.dest));
148
+ target.outputs = [`{workspaceRoot}/${(0, path_1.normalizePath)(outputPath)}`];
124
149
  }
125
150
  catch { }
126
151
  }
@@ -153,19 +178,20 @@ function getWorkspaceCapabilities(projects) {
153
178
  return capabilities;
154
179
  }
155
180
  function projectUsesKarmaBuilder(project) {
156
- return Object.values(project.architect ?? {}).some((target) => target.builder === '@angular-devkit/build-angular:karma');
181
+ return Object.values(project.architect ?? {}).some((target) => target.builder === '@angular/build:karma' ||
182
+ target.builder === '@angular-devkit/build-angular:karma');
157
183
  }
158
184
  function projectHasKarmaConfig(project) {
159
- return (0, fileutils_1.fileExists)((0, path_1.join)(project.root, 'karma.conf.js'));
185
+ return (0, fileutils_1.fileExists)((0, node_path_1.join)(project.root, 'karma.conf.js'));
160
186
  }
161
187
  function projectHasEslintConfig(project) {
162
- return ((0, fileutils_1.fileExists)((0, path_1.join)(project.root, '.eslintrc.json')) ||
163
- (0, fileutils_1.fileExists)((0, path_1.join)(project.root, 'eslint.config.js')) ||
164
- (0, fileutils_1.fileExists)((0, path_1.join)(project.root, 'eslint.config.mjs')) ||
165
- (0, fileutils_1.fileExists)((0, path_1.join)(project.root, 'eslint.config.cjs')));
188
+ return ((0, fileutils_1.fileExists)((0, node_path_1.join)(project.root, '.eslintrc.json')) ||
189
+ (0, fileutils_1.fileExists)((0, node_path_1.join)(project.root, 'eslint.config.js')) ||
190
+ (0, fileutils_1.fileExists)((0, node_path_1.join)(project.root, 'eslint.config.mjs')) ||
191
+ (0, fileutils_1.fileExists)((0, node_path_1.join)(project.root, 'eslint.config.cjs')));
166
192
  }
167
193
  function replaceNgWithNxInPackageJsonScripts(repoRoot) {
168
- const packageJsonPath = (0, path_1.join)(repoRoot, 'package.json');
194
+ const packageJsonPath = (0, node_path_1.join)(repoRoot, 'package.json');
169
195
  const packageJson = (0, fileutils_1.readJsonFile)(packageJsonPath);
170
196
  packageJson.scripts ??= {};
171
197
  Object.keys(packageJson.scripts).forEach((script) => {
@@ -1175,6 +1175,7 @@ function getImplementationPath(collection, collectionPath, name) {
1175
1175
  }
1176
1176
  function nxCliPath(nxWorkspaceRoot) {
1177
1177
  const version = process.env.NX_MIGRATE_CLI_VERSION || 'latest';
1178
+ const isVerbose = process.env.NX_VERBOSE_LOGGING === 'true';
1178
1179
  try {
1179
1180
  const packageManager = (0, package_manager_1.detectPackageManager)();
1180
1181
  const pmc = (0, package_manager_1.getPackageManagerCommand)(packageManager);
@@ -1187,25 +1188,30 @@ function nxCliPath(nxWorkspaceRoot) {
1187
1188
  license: 'MIT',
1188
1189
  });
1189
1190
  (0, package_manager_1.copyPackageManagerConfigurationFiles)(nxWorkspaceRoot ?? workspace_root_1.workspaceRoot, tmpDir);
1191
+ // Let's print the output of the install process to the console when verbose
1192
+ // is enabled, so it's easier to debug issues with the installation process
1193
+ const stdio = isVerbose
1194
+ ? ['ignore', 'inherit', 'inherit']
1195
+ : 'ignore';
1190
1196
  if (pmc.preInstall) {
1191
1197
  // ensure package.json and repo in tmp folder is set to a proper package manager state
1192
1198
  (0, child_process_1.execSync)(pmc.preInstall, {
1193
1199
  cwd: tmpDir,
1194
- stdio: ['ignore', 'ignore', 'ignore'],
1200
+ stdio,
1195
1201
  windowsHide: false,
1196
1202
  });
1197
1203
  // if it's berry ensure we set the node_linker to node-modules
1198
1204
  if (packageManager === 'yarn' && pmc.ciInstall.includes('immutable')) {
1199
1205
  (0, child_process_1.execSync)('yarn config set nodeLinker node-modules', {
1200
1206
  cwd: tmpDir,
1201
- stdio: ['ignore', 'ignore', 'ignore'],
1207
+ stdio,
1202
1208
  windowsHide: false,
1203
1209
  });
1204
1210
  }
1205
1211
  }
1206
1212
  (0, child_process_1.execSync)(pmc.install, {
1207
1213
  cwd: tmpDir,
1208
- stdio: ['ignore', 'ignore', 'ignore'],
1214
+ stdio,
1209
1215
  windowsHide: false,
1210
1216
  });
1211
1217
  // Set NODE_PATH so that these modules can be used for module resolution
@@ -1215,7 +1221,7 @@ function nxCliPath(nxWorkspaceRoot) {
1215
1221
  }
1216
1222
  catch (e) {
1217
1223
  console.error(`Failed to install the ${version} version of the migration script. Using the current version.`);
1218
- if (process.env.NX_VERBOSE_LOGGING === 'true') {
1224
+ if (isVerbose) {
1219
1225
  console.error(e);
1220
1226
  }
1221
1227
  return null;
@@ -44,7 +44,7 @@ exports.parserConfiguration = {
44
44
  */
45
45
  exports.commandsObject = yargs
46
46
  .parserConfiguration(exports.parserConfiguration)
47
- .usage(chalk.bold('Smart Monorepos · Fast CI'))
47
+ .usage(chalk.bold('Smart Repos · Fast Builds'))
48
48
  .demandCommand(1, '')
49
49
  .command(command_object_1.yargsRegisterCommand)
50
50
  .command(command_object_22.yargsAddCommand)