nx 19.5.3 → 19.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/package.json +13 -13
  2. package/release/changelog-renderer/index.js +5 -4
  3. package/schemas/project-schema.json +40 -6
  4. package/src/command-line/connect/connect-to-nx-cloud.d.ts +2 -0
  5. package/src/command-line/connect/connect-to-nx-cloud.js +33 -6
  6. package/src/command-line/connect/view-logs.js +5 -3
  7. package/src/command-line/examples.js +4 -0
  8. package/src/command-line/init/implementation/add-nx-to-monorepo.js +1 -1
  9. package/src/command-line/init/implementation/add-nx-to-nest.js +1 -1
  10. package/src/command-line/init/implementation/add-nx-to-npm-repo.js +1 -1
  11. package/src/command-line/init/implementation/angular/index.js +1 -1
  12. package/src/command-line/init/implementation/angular/legacy-angular-versions.js +1 -1
  13. package/src/command-line/init/implementation/utils.d.ts +1 -1
  14. package/src/command-line/init/implementation/utils.js +7 -5
  15. package/src/command-line/init/init-v2.js +1 -4
  16. package/src/command-line/migrate/migrate.js +33 -13
  17. package/src/command-line/release/changelog.js +1 -0
  18. package/src/command-line/release/config/config.js +4 -0
  19. package/src/command-line/release/plan.js +2 -12
  20. package/src/command-line/release/utils/generate-version-plan-content.d.ts +1 -0
  21. package/src/command-line/release/utils/generate-version-plan-content.js +21 -0
  22. package/src/command-line/release/utils/shared.js +8 -5
  23. package/src/command-line/release/version.js +4 -2
  24. package/src/command-line/report/report.d.ts +1 -0
  25. package/src/command-line/report/report.js +14 -9
  26. package/src/core/graph/main.js +1 -1
  27. package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.d.ts +6 -0
  28. package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +15 -5
  29. package/src/native/index.d.ts +2 -0
  30. package/src/native/native-bindings.js +1 -0
  31. package/src/native/nx.wasi.cjs +35 -33
  32. package/src/native/nx.wasm32-wasi.wasm +0 -0
  33. package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts +3 -2
  34. package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +18 -57
  35. package/src/nx-cloud/utilities/url-shorten.d.ts +1 -1
  36. package/src/nx-cloud/utilities/url-shorten.js +5 -7
  37. package/src/project-graph/plugins/internal-api.js +4 -1
  38. package/src/tasks-runner/task-env.js +3 -2
  39. package/src/tasks-runner/task-graph-utils.js +1 -1
  40. package/src/utils/git-utils.js +3 -1
@@ -140,8 +140,9 @@ async function releaseVersion(args) {
140
140
  ...tree.listChanges().map((f) => f.path),
141
141
  ...additionalChangedFiles,
142
142
  ];
143
+ const deletedFiles = Array.from(additionalDeletedFiles);
143
144
  // No further actions are necessary in this scenario (e.g. if conventional commits detected no changes)
144
- if (!changedFiles.length) {
145
+ if (!changedFiles.length && !deletedFiles.length) {
145
146
  return {
146
147
  // An overall workspace version cannot be relevant when filtering to independent projects
147
148
  workspaceVersion: undefined,
@@ -151,7 +152,7 @@ async function releaseVersion(args) {
151
152
  if (args.gitCommit ?? nxReleaseConfig.version.git.commit) {
152
153
  await (0, shared_1.commitChanges)({
153
154
  changedFiles,
154
- deletedFiles: Array.from(additionalDeletedFiles),
155
+ deletedFiles,
155
156
  isDryRun: !!args.dryRun,
156
157
  isVerbose: !!args.verbose,
157
158
  gitCommitMessages: (0, shared_1.createCommitMessageValues)(releaseGroups, releaseGroupToFilteredProjects, versionData, commitMessage),
@@ -162,6 +163,7 @@ async function releaseVersion(args) {
162
163
  output_1.output.logSingleLine(`Staging changed files with git`);
163
164
  await (0, git_1.gitAdd)({
164
165
  changedFiles,
166
+ deletedFiles,
165
167
  dryRun: args.dryRun,
166
168
  verbose: args.verbose,
167
169
  });
@@ -31,6 +31,7 @@ export interface ReportData {
31
31
  migrateTarget: string;
32
32
  };
33
33
  projectGraphError?: Error | null;
34
+ nativeTarget: string | null;
34
35
  }
35
36
  export declare function getReportData(): Promise<ReportData>;
36
37
  interface OutOfSyncPackageGroup {
@@ -43,14 +43,18 @@ const LINE_SEPARATOR = '---------------------------------------';
43
43
  *
44
44
  */
45
45
  async function reportHandler() {
46
- const { pm, pmVersion, localPlugins, communityPlugins, registeredPlugins, packageVersionsWeCareAbout, outOfSyncPackageGroup, projectGraphError, } = await getReportData();
47
- const bodyLines = [
48
- `Node : ${process.versions.node}`,
49
- `OS : ${process.platform}-${process.arch}`,
50
- `${pm.padEnd(7)}: ${pmVersion}`,
51
- ``,
46
+ const { pm, pmVersion, localPlugins, communityPlugins, registeredPlugins, packageVersionsWeCareAbout, outOfSyncPackageGroup, projectGraphError, nativeTarget, } = await getReportData();
47
+ const fields = [
48
+ ['Node', process.versions.node],
49
+ ['OS', `${process.platform}-${process.arch}`],
50
+ ['Native Target', nativeTarget ?? 'Unavailable'],
51
+ [pm, pmVersion],
52
52
  ];
53
- let padding = Math.max(...packageVersionsWeCareAbout.map((x) => x.package.length)) + 1;
53
+ let padding = Math.max(...fields.map((f) => f[0].length));
54
+ const bodyLines = fields.map(([field, value]) => `${field.padEnd(padding)} : ${value}`);
55
+ bodyLines.push('');
56
+ padding =
57
+ Math.max(...packageVersionsWeCareAbout.map((x) => x.package.length)) + 1;
54
58
  packageVersionsWeCareAbout.forEach((p) => {
55
59
  bodyLines.push(`${chalk.green(p.package.padEnd(padding))} : ${chalk.bold(p.version)}`);
56
60
  });
@@ -116,6 +120,7 @@ async function getReportData() {
116
120
  });
117
121
  }
118
122
  const outOfSyncPackageGroup = findMisalignedPackagesForPackage(nxPackageJson);
123
+ const native = isNativeAvailable();
119
124
  return {
120
125
  pm,
121
126
  pmVersion,
@@ -125,6 +130,7 @@ async function getReportData() {
125
130
  packageVersionsWeCareAbout,
126
131
  outOfSyncPackageGroup,
127
132
  projectGraphError,
133
+ nativeTarget: native ? native.getBinaryTarget() : null,
128
134
  };
129
135
  }
130
136
  async function tryGetProjectGraph() {
@@ -248,8 +254,7 @@ function findInstalledPackagesWeCareAbout() {
248
254
  }
249
255
  function isNativeAvailable() {
250
256
  try {
251
- require('../../native');
252
- return true;
257
+ return require('../../native');
253
258
  }
254
259
  catch {
255
260
  return false;