nx 19.3.0 → 19.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. package/package.json +14 -14
  2. package/release/changelog-renderer/index.d.ts +6 -0
  3. package/release/changelog-renderer/index.js +1 -1
  4. package/src/command-line/connect/connect-to-nx-cloud.d.ts +1 -1
  5. package/src/command-line/connect/connect-to-nx-cloud.js +16 -25
  6. package/src/command-line/release/changelog.js +6 -1
  7. package/src/command-line/release/config/config.js +3 -0
  8. package/src/config/workspace-json-project-json.d.ts +1 -0
  9. package/src/core/graph/main.js +1 -1
  10. package/src/core/graph/styles.css +1 -1
  11. package/src/daemon/server/plugins.js +12 -2
  12. package/src/executors/run-commands/run-commands.impl.js +29 -20
  13. package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts +1 -0
  14. package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +68 -33
  15. package/src/nx-cloud/generators/connect-to-nx-cloud/schema.json +5 -0
  16. package/src/nx-cloud/utilities/url-shorten.d.ts +2 -1
  17. package/src/nx-cloud/utilities/url-shorten.js +47 -11
  18. package/src/plugins/package-json-workspaces/create-nodes.js +12 -7
  19. package/src/plugins/project-json/build-nodes/package-json-next-to-project-json.js +1 -0
  20. package/src/project-graph/plugins/isolation/index.d.ts +1 -1
  21. package/src/project-graph/plugins/isolation/index.js +11 -4
  22. package/src/project-graph/plugins/isolation/plugin-pool.d.ts +1 -1
  23. package/src/project-graph/plugins/isolation/plugin-pool.js +10 -4
  24. package/src/project-graph/project-graph.js +7 -1
  25. package/src/project-graph/utils/project-configuration-utils.js +1 -1
  26. package/src/tasks-runner/task-env.d.ts +13 -0
  27. package/src/tasks-runner/task-env.js +41 -26
  28. package/src/utils/git-utils.d.ts +1 -1
  29. package/src/utils/git-utils.js +13 -2
  30. package/src/utils/package-json.d.ts +3 -0
  31. package/src/utils/package-json.js +15 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "19.3.0",
3
+ "version": "19.3.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": {
@@ -45,8 +45,8 @@
45
45
  "cli-cursor": "3.1.0",
46
46
  "cli-spinners": "2.6.1",
47
47
  "cliui": "^8.0.1",
48
- "dotenv": "~16.3.1",
49
- "dotenv-expand": "~10.0.0",
48
+ "dotenv": "~16.4.5",
49
+ "dotenv-expand": "~11.0.6",
50
50
  "enquirer": "~2.3.6",
51
51
  "figures": "3.2.0",
52
52
  "flat": "^5.0.2",
@@ -70,7 +70,7 @@
70
70
  "yargs-parser": "21.1.1",
71
71
  "node-machine-id": "1.1.12",
72
72
  "ora": "5.3.0",
73
- "@nrwl/tao": "19.3.0"
73
+ "@nrwl/tao": "19.3.2"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "@swc-node/register": "^1.8.0",
@@ -85,16 +85,16 @@
85
85
  }
86
86
  },
87
87
  "optionalDependencies": {
88
- "@nx/nx-darwin-x64": "19.3.0",
89
- "@nx/nx-darwin-arm64": "19.3.0",
90
- "@nx/nx-linux-x64-gnu": "19.3.0",
91
- "@nx/nx-linux-x64-musl": "19.3.0",
92
- "@nx/nx-win32-x64-msvc": "19.3.0",
93
- "@nx/nx-linux-arm64-gnu": "19.3.0",
94
- "@nx/nx-linux-arm64-musl": "19.3.0",
95
- "@nx/nx-linux-arm-gnueabihf": "19.3.0",
96
- "@nx/nx-win32-arm64-msvc": "19.3.0",
97
- "@nx/nx-freebsd-x64": "19.3.0"
88
+ "@nx/nx-darwin-x64": "19.3.2",
89
+ "@nx/nx-darwin-arm64": "19.3.2",
90
+ "@nx/nx-linux-x64-gnu": "19.3.2",
91
+ "@nx/nx-linux-x64-musl": "19.3.2",
92
+ "@nx/nx-win32-x64-msvc": "19.3.2",
93
+ "@nx/nx-linux-arm64-gnu": "19.3.2",
94
+ "@nx/nx-linux-arm64-musl": "19.3.2",
95
+ "@nx/nx-linux-arm-gnueabihf": "19.3.2",
96
+ "@nx/nx-win32-arm64-msvc": "19.3.2",
97
+ "@nx/nx-freebsd-x64": "19.3.2"
98
98
  },
99
99
  "nx-migrations": {
100
100
  "migrations": "./migrations.json",
@@ -53,6 +53,12 @@ export interface DefaultChangelogRenderOptions extends ChangelogRenderOptions {
53
53
  * section. Defaults to true.
54
54
  */
55
55
  authors?: boolean;
56
+ /**
57
+ * If authors is enabled, controls whether or not to try to map the authors to their GitHub usernames
58
+ * using https://ungh.cc (from https://github.com/unjs/ungh) and the email addresses found in the commits.
59
+ * Defaults to true.
60
+ */
61
+ mapAuthorsToGitHubUsernames?: boolean;
56
62
  /**
57
63
  * Whether or not the commit references (such as commit and/or PR links) should be included in the changelog.
58
64
  * Defaults to true.
@@ -145,7 +145,7 @@ const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion,
145
145
  }
146
146
  }
147
147
  // Try to map authors to github usernames
148
- if (repoSlug) {
148
+ if (repoSlug && changelogRenderOptions.mapAuthorsToGitHubUsernames) {
149
149
  await Promise.all([..._authors.keys()].map(async (authorName) => {
150
150
  const meta = _authors.get(authorName);
151
151
  for (const email of meta.email) {
@@ -3,6 +3,6 @@ import { NxArgs } from '../../utils/command-line-utils';
3
3
  import { MessageKey } from '../../utils/ab-testing';
4
4
  export declare function onlyDefaultRunnerIsUsed(nxJson: NxJsonConfiguration): boolean;
5
5
  export declare function connectToNxCloudIfExplicitlyAsked(opts: NxArgs): Promise<void>;
6
- export declare function connectToNxCloudCommand(): Promise<boolean>;
6
+ export declare function connectToNxCloudCommand(command?: string): Promise<boolean>;
7
7
  export declare function connectToNxCloudWithPrompt(command: string): Promise<void>;
8
8
  export declare function connectExistingRepoToNxCloudPrompt(key?: MessageKey): Promise<boolean>;
@@ -41,38 +41,29 @@ async function connectToNxCloudIfExplicitlyAsked(opts) {
41
41
  }
42
42
  }
43
43
  exports.connectToNxCloudIfExplicitlyAsked = connectToNxCloudIfExplicitlyAsked;
44
- async function connectToNxCloudCommand() {
44
+ async function connectToNxCloudCommand(command) {
45
45
  const nxJson = (0, configuration_1.readNxJson)();
46
46
  if ((0, nx_cloud_utils_1.isNxCloudUsed)(nxJson)) {
47
- if (process.env.NX_NEW_CLOUD_ONBOARDING !== 'true') {
48
- output_1.output.log({
49
- title: '✔ This workspace already has Nx Cloud set up',
50
- bodyLines: [
51
- 'If you have not done so already, connect your workspace to your Nx Cloud account:',
52
- `- Login at ${(0, nx_cloud_utils_1.getNxCloudUrl)(nxJson)} to connect your repository`,
53
- ],
54
- });
47
+ const token = process.env.NX_CLOUD_ACCESS_TOKEN || nxJson.nxCloudAccessToken;
48
+ if (!token) {
49
+ throw new Error(`Unable to authenticate. Either define accessToken in nx.json or set the NX_CLOUD_ACCESS_TOKEN env variable.`);
55
50
  }
56
- else {
57
- const token = process.env.NX_CLOUD_ACCESS_TOKEN || nxJson.nxCloudAccessToken;
58
- if (!token) {
59
- throw new Error(`Unable to authenticate. Either define accessToken in nx.json or set the NX_CLOUD_ACCESS_TOKEN env variable.`);
60
- }
61
- const connectCloudUrl = await (0, url_shorten_1.shortenedCloudUrl)('nx-connect', token);
62
- output_1.output.log({
63
- title: '✔ This workspace already has Nx Cloud set up',
64
- bodyLines: [
65
- 'If you have not done so already, connect your workspace to your Nx Cloud account:',
66
- `- Connect with Nx Cloud at:
51
+ const connectCloudUrl = await (0, url_shorten_1.shortenedCloudUrl)('nx-connect', token);
52
+ output_1.output.log({
53
+ title: '✔ This workspace already has Nx Cloud set up',
54
+ bodyLines: [
55
+ 'If you have not done so already, connect your workspace to your Nx Cloud account:',
56
+ `- Connect with Nx Cloud at:
67
57
 
68
58
  ${connectCloudUrl}`,
69
- ],
70
- });
71
- }
59
+ ],
60
+ });
72
61
  return false;
73
62
  }
74
63
  const tree = new tree_1.FsTree(workspace_root_1.workspaceRoot, false, 'connect-to-nx-cloud');
75
- const callback = await (0, connect_to_nx_cloud_1.connectToNxCloud)(tree, {});
64
+ const callback = await (0, connect_to_nx_cloud_1.connectToNxCloud)(tree, {
65
+ installationSource: command ?? 'nx-connect',
66
+ });
76
67
  tree.lock();
77
68
  (0, tree_1.flushChanges)(workspace_root_1.workspaceRoot, tree.listChanges());
78
69
  await callback();
@@ -81,7 +72,7 @@ async function connectToNxCloudCommand() {
81
72
  exports.connectToNxCloudCommand = connectToNxCloudCommand;
82
73
  async function connectToNxCloudWithPrompt(command) {
83
74
  const setNxCloud = await nxCloudPrompt('setupNxCloud');
84
- const useCloud = setNxCloud === 'yes' ? await connectToNxCloudCommand() : false;
75
+ const useCloud = setNxCloud === 'yes' ? await connectToNxCloudCommand(command) : false;
85
76
  await (0, ab_testing_1.recordStat)({
86
77
  command,
87
78
  nxVersion: versions_1.nxVersion,
@@ -222,7 +222,12 @@ async function releaseChangelog(args) {
222
222
  continue;
223
223
  }
224
224
  for (const project of releaseGroup.projects) {
225
- const dependentProjects = (projectsVersionData[project]?.dependentProjects || [])
225
+ // If the project does not have any changes, do not process its dependents
226
+ if (!projectsVersionData[project] ||
227
+ projectsVersionData[project].newVersion === null) {
228
+ continue;
229
+ }
230
+ const dependentProjects = (projectsVersionData[project].dependentProjects || [])
226
231
  .map((dep) => {
227
232
  return {
228
233
  dependencyName: dep.source,
@@ -110,6 +110,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
110
110
  renderer: defaultRendererPath,
111
111
  renderOptions: {
112
112
  authors: true,
113
+ mapAuthorsToGitHubUsernames: true,
113
114
  commitReferences: true,
114
115
  versionTitleDate: true,
115
116
  },
@@ -123,6 +124,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
123
124
  renderer: defaultRendererPath,
124
125
  renderOptions: {
125
126
  authors: true,
127
+ mapAuthorsToGitHubUsernames: true,
126
128
  commitReferences: true,
127
129
  versionTitleDate: true,
128
130
  },
@@ -153,6 +155,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
153
155
  renderer: defaultRendererPath,
154
156
  renderOptions: {
155
157
  authors: true,
158
+ mapAuthorsToGitHubUsernames: true,
156
159
  commitReferences: true,
157
160
  versionTitleDate: true,
158
161
  },
@@ -105,6 +105,7 @@ export interface ProjectConfiguration {
105
105
  metadata?: ProjectMetadata;
106
106
  }
107
107
  export interface ProjectMetadata {
108
+ description?: string;
108
109
  technologies?: string[];
109
110
  targetGroups?: Record<string, string[]>;
110
111
  }