nx 19.6.1 → 19.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. package/.eslintrc.json +12 -1
  2. package/README.md +1 -1
  3. package/package.json +12 -12
  4. package/src/command-line/add/add.js +1 -5
  5. package/src/command-line/add/command-object.js +1 -5
  6. package/src/command-line/affected/affected.js +0 -3
  7. package/src/command-line/exec/exec.js +0 -3
  8. package/src/command-line/generate/command-object.js +2 -5
  9. package/src/command-line/generate/generate.js +4 -8
  10. package/src/command-line/graph/graph.d.ts +18 -1
  11. package/src/command-line/import/command-object.js +1 -1
  12. package/src/command-line/import/utils/prepare-source-repo.js +2 -2
  13. package/src/command-line/migrate/command-object.js +3 -2
  14. package/src/command-line/migrate/migrate.js +5 -39
  15. package/src/command-line/release/changelog.js +0 -3
  16. package/src/command-line/release/command-object.js +1 -5
  17. package/src/command-line/release/plan-check.js +0 -3
  18. package/src/command-line/release/plan.js +0 -3
  19. package/src/command-line/release/publish.js +0 -6
  20. package/src/command-line/release/release.js +0 -3
  21. package/src/command-line/release/version.js +0 -3
  22. package/src/command-line/repair/command-object.js +2 -4
  23. package/src/command-line/repair/repair.js +2 -6
  24. package/src/command-line/run/run-one.js +0 -3
  25. package/src/command-line/show/command-object.js +2 -2
  26. package/src/command-line/sync/command-object.js +3 -8
  27. package/src/command-line/sync/sync.js +1 -5
  28. package/src/command-line/watch/command-object.js +1 -1
  29. package/src/command-line/watch/watch.js +0 -3
  30. package/src/command-line/yargs-utils/shared-options.d.ts +2 -1
  31. package/src/command-line/yargs-utils/shared-options.js +14 -18
  32. package/src/core/graph/main.js +1 -1
  33. package/src/core/graph/styles.js +1 -1
  34. package/src/daemon/client/client.js +4 -2
  35. package/src/devkit-exports.d.ts +1 -0
  36. package/src/native/assert-supported-platform.js +1 -1
  37. package/src/native/nx.wasm32-wasi.wasm +0 -0
  38. package/src/nx-cloud/utilities/url-shorten.js +1 -1
  39. package/src/plugins/js/package-json/create-package-json.d.ts +1 -0
  40. package/src/plugins/js/package-json/create-package-json.js +1 -1
  41. package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +11 -6
  42. package/src/tasks-runner/cache.js +1 -1
  43. package/src/utils/git-utils.js +1 -1
  44. package/src/utils/logger.js +1 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[532],{79207:()=>{}},s=>{var e;e=79207,s(s.s=e)}]);
1
+ "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[532],{46134:()=>{}},s=>{var e;e=46134,s(s.s=e)}]);
@@ -71,9 +71,11 @@ class DaemonClient {
71
71
  // CI=true,env=undefined => no daemon
72
72
  // CI=true,env=false => no daemon
73
73
  // CI=true,env=true => daemon
74
+ // docker=true,env=undefined => no daemon
75
+ // docker=true,env=false => no daemon
76
+ // docker=true,env=true => daemon
74
77
  // WASM => no daemon because file watching does not work
75
- if (((0, is_ci_1.isCI)() && env !== 'true') ||
76
- isDocker() ||
78
+ if ((((0, is_ci_1.isCI)() || isDocker()) && env !== 'true') ||
77
79
  (0, tmp_dir_1.isDaemonDisabled)() ||
78
80
  nxJsonIsNotPresent() ||
79
81
  (useDaemonProcessOption === undefined && env === 'false') ||
@@ -67,6 +67,7 @@ export { readNxJson, updateNxJson, } from './generators/utils/project-configurat
67
67
  * @category Project Graph
68
68
  */
69
69
  export type { ProjectFileMap, FileMap, FileData, ProjectGraph, ProjectGraphDependency, ProjectGraphNode, ProjectGraphProjectNode, ProjectGraphExternalNode, ProjectGraphProcessorContext, } from './config/project-graph';
70
+ export type { GraphJson } from './command-line/graph/graph';
70
71
  /**
71
72
  * @category Project Graph
72
73
  */
@@ -18,7 +18,7 @@ function assertSupportedPlatform() {
18
18
  `The Nx CLI could not find or load the native binary for your supported platform (${process.platform}-${process.arch}).`,
19
19
  'This likely means that optional dependencies were not installed correctly, or your system is missing some system dependencies.',
20
20
  ];
21
- if (process.env.NX_VERBOSE_LOGGING == 'true') {
21
+ if (process.env.NX_VERBOSE_LOGGING === 'true') {
22
22
  bodyLines.push('', 'Additional error information:', e.message);
23
23
  }
24
24
  }
Binary file
@@ -95,7 +95,7 @@ async function getInstallationSupportsGitHub(apiUrl) {
95
95
  return !!response.data.isGithubIntegrationEnabled;
96
96
  }
97
97
  catch (e) {
98
- if (process.env.NX_VERBOSE_LOGGING) {
98
+ if (process.env.NX_VERBOSE_LOGGING === 'true') {
99
99
  devkit_exports_1.logger.warn(`Failed to access system features. GitHub integration assumed to be disabled.
100
100
  ${e}`);
101
101
  }
@@ -18,6 +18,7 @@ export declare function createPackageJson(projectName: string, graph: ProjectGra
18
18
  root?: string;
19
19
  isProduction?: boolean;
20
20
  helperDependencies?: string[];
21
+ skipPackageManager?: boolean;
21
22
  }, fileMap?: ProjectFileMap): PackageJson;
22
23
  export declare function findProjectsNpmDependencies(projectNode: ProjectGraphProjectNode, graph: ProjectGraph, target: string, rootPackageJson: PackageJson, options: {
23
24
  helperDependencies?: string[];
@@ -108,7 +108,7 @@ function createPackageJson(projectName, graph, options = {}, fileMap = null) {
108
108
  packageJson.dependencies &&= (0, object_sort_1.sortObjectByKeys)(packageJson.dependencies);
109
109
  packageJson.peerDependencies &&= (0, object_sort_1.sortObjectByKeys)(packageJson.peerDependencies);
110
110
  packageJson.peerDependenciesMeta &&= (0, object_sort_1.sortObjectByKeys)(packageJson.peerDependenciesMeta);
111
- if (rootPackageJson.packageManager) {
111
+ if (rootPackageJson.packageManager && !options.skipPackageManager) {
112
112
  if (packageJson.packageManager &&
113
113
  packageJson.packageManager !== rootPackageJson.packageManager) {
114
114
  output_1.output.warn({
@@ -140,15 +140,20 @@ class TargetProjectLocator {
140
140
  return externalNodeName;
141
141
  }
142
142
  const version = (0, semver_1.clean)(externalPackageJson.version);
143
- const npmProjectKey = `npm:${externalPackageJson.name}@${version}`;
144
- let matchingExternalNode = this.npmProjects[npmProjectKey];
143
+ let matchingExternalNode = this.npmProjects[`npm:${externalPackageJson.name}@${version}`];
145
144
  if (!matchingExternalNode) {
146
145
  // check if it's a package alias, where the resolved package key is used as the version
147
- const aliasNpmProjectKey = `npm:${packageName}@${npmProjectKey}`;
146
+ const aliasNpmProjectKey = `npm:${packageName}@npm:${externalPackageJson.name}@${version}`;
148
147
  matchingExternalNode = this.npmProjects[aliasNpmProjectKey];
149
- if (!matchingExternalNode) {
150
- return null;
151
- }
148
+ }
149
+ if (!matchingExternalNode) {
150
+ // Fallback to package name as key. This can happen if the version in project graph is not the same as in the resolved package.json.
151
+ // e.g. Version in project graph is a git remote, but the resolved version is semver.
152
+ matchingExternalNode =
153
+ this.npmProjects[`npm:${externalPackageJson.name}`];
154
+ }
155
+ if (!matchingExternalNode) {
156
+ return null;
152
157
  }
153
158
  this.npmResolutionCache.set(npmImportForProject, matchingExternalNode.name);
154
159
  return matchingExternalNode.name;
@@ -44,7 +44,7 @@ class Cache {
44
44
  this._currentMachineId = await (0, node_machine_id_1.machineId)();
45
45
  }
46
46
  catch (e) {
47
- if (process.env.NX_VERBOSE_LOGGING == 'true') {
47
+ if (process.env.NX_VERBOSE_LOGGING === 'true') {
48
48
  console.log(`Unable to get machineId. Error: ${e.message}`);
49
49
  }
50
50
  this._currentMachineId = '';
@@ -83,7 +83,7 @@ class GitRepository {
83
83
  return this.execAsync(`git checkout ${opts.new ? '-b ' : ' '}${branch}${opts.base ? ' ' + opts.base : ''}`);
84
84
  }
85
85
  async move(path, destination) {
86
- return this.execAsync(`git mv ${path} ${destination}`);
86
+ return this.execAsync(`git mv "${path}" "${destination}"`);
87
87
  }
88
88
  async push(ref, remoteName) {
89
89
  return this.execAsync(`git push -u -f ${remoteName} ${ref}`);
@@ -36,7 +36,7 @@ exports.logger = {
36
36
  console.error(...s);
37
37
  },
38
38
  verbose: (...s) => {
39
- if (process.env.NX_VERBOSE_LOGGING) {
39
+ if (process.env.NX_VERBOSE_LOGGING === 'true') {
40
40
  console.log(...s);
41
41
  }
42
42
  },