nx 19.6.1 → 19.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/package.json +12 -12
  3. package/src/command-line/add/add.js +1 -5
  4. package/src/command-line/add/command-object.js +1 -5
  5. package/src/command-line/affected/affected.js +0 -3
  6. package/src/command-line/exec/exec.js +0 -3
  7. package/src/command-line/generate/command-object.js +2 -5
  8. package/src/command-line/generate/generate.js +4 -8
  9. package/src/command-line/import/command-object.js +1 -1
  10. package/src/command-line/import/utils/prepare-source-repo.js +2 -2
  11. package/src/command-line/migrate/command-object.js +3 -2
  12. package/src/command-line/migrate/migrate.js +0 -3
  13. package/src/command-line/release/changelog.js +0 -3
  14. package/src/command-line/release/command-object.js +1 -5
  15. package/src/command-line/release/plan-check.js +0 -3
  16. package/src/command-line/release/plan.js +0 -3
  17. package/src/command-line/release/publish.js +0 -6
  18. package/src/command-line/release/release.js +0 -3
  19. package/src/command-line/release/version.js +0 -3
  20. package/src/command-line/repair/command-object.js +2 -4
  21. package/src/command-line/repair/repair.js +2 -6
  22. package/src/command-line/run/run-one.js +0 -3
  23. package/src/command-line/show/command-object.js +2 -2
  24. package/src/command-line/sync/command-object.js +3 -8
  25. package/src/command-line/sync/sync.js +1 -5
  26. package/src/command-line/watch/command-object.js +1 -1
  27. package/src/command-line/watch/watch.js +0 -3
  28. package/src/command-line/yargs-utils/shared-options.js +3 -3
  29. package/src/core/graph/main.js +1 -1
  30. package/src/native/assert-supported-platform.js +1 -1
  31. package/src/native/nx.wasm32-wasi.wasm +0 -0
  32. package/src/nx-cloud/utilities/url-shorten.js +1 -1
  33. package/src/plugins/js/package-json/create-package-json.d.ts +1 -0
  34. package/src/plugins/js/package-json/create-package-json.js +1 -1
  35. package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +11 -6
  36. package/src/tasks-runner/cache.js +1 -1
  37. package/src/utils/git-utils.js +1 -1
  38. package/src/utils/logger.js +1 -1
@@ -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
  },