nx 19.7.1 → 19.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "19.7.1",
3
+ "version": "19.7.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": {
@@ -71,7 +71,7 @@
71
71
  "yargs-parser": "21.1.1",
72
72
  "node-machine-id": "1.1.12",
73
73
  "ora": "5.3.0",
74
- "@nrwl/tao": "19.7.1"
74
+ "@nrwl/tao": "19.7.2"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "@swc-node/register": "^1.8.0",
@@ -86,16 +86,16 @@
86
86
  }
87
87
  },
88
88
  "optionalDependencies": {
89
- "@nx/nx-darwin-x64": "19.7.1",
90
- "@nx/nx-darwin-arm64": "19.7.1",
91
- "@nx/nx-linux-x64-gnu": "19.7.1",
92
- "@nx/nx-linux-x64-musl": "19.7.1",
93
- "@nx/nx-win32-x64-msvc": "19.7.1",
94
- "@nx/nx-linux-arm64-gnu": "19.7.1",
95
- "@nx/nx-linux-arm64-musl": "19.7.1",
96
- "@nx/nx-linux-arm-gnueabihf": "19.7.1",
97
- "@nx/nx-win32-arm64-msvc": "19.7.1",
98
- "@nx/nx-freebsd-x64": "19.7.1"
89
+ "@nx/nx-darwin-x64": "19.7.2",
90
+ "@nx/nx-darwin-arm64": "19.7.2",
91
+ "@nx/nx-linux-x64-gnu": "19.7.2",
92
+ "@nx/nx-linux-x64-musl": "19.7.2",
93
+ "@nx/nx-win32-x64-msvc": "19.7.2",
94
+ "@nx/nx-linux-arm64-gnu": "19.7.2",
95
+ "@nx/nx-linux-arm64-musl": "19.7.2",
96
+ "@nx/nx-linux-arm-gnueabihf": "19.7.2",
97
+ "@nx/nx-win32-arm64-msvc": "19.7.2",
98
+ "@nx/nx-freebsd-x64": "19.7.2"
99
99
  },
100
100
  "nx-migrations": {
101
101
  "migrations": "./migrations.json",
@@ -83,12 +83,14 @@ async function getGitDiff(from, to = 'HEAD') {
83
83
  else {
84
84
  range = `${from}..${to}`;
85
85
  }
86
+ // Use a unique enough separator that we can be relatively certain will not occur within the commit message itself
87
+ const separator = '§§§';
86
88
  // https://git-scm.com/docs/pretty-formats
87
89
  const r = await (0, exec_command_1.execCommand)('git', [
88
90
  '--no-pager',
89
91
  'log',
90
92
  range,
91
- '--pretty="----%n%s|%h|%an|%ae%n%b"',
93
+ `--pretty="----%n%s${separator}%h${separator}%an${separator}%ae%n%b"`,
92
94
  '--name-status',
93
95
  ]);
94
96
  return r
@@ -96,7 +98,7 @@ async function getGitDiff(from, to = 'HEAD') {
96
98
  .splice(1)
97
99
  .map((line) => {
98
100
  const [firstLine, ..._body] = line.split('\n');
99
- const [message, shortHash, authorName, authorEmail] = firstLine.split('|');
101
+ const [message, shortHash, authorName, authorEmail] = firstLine.split(separator);
100
102
  const r = {
101
103
  message,
102
104
  shortHash,
Binary file
@@ -110,7 +110,7 @@ function buildProjectConfigurationFromPackageJson(packageJson, workspaceRoot, pa
110
110
  sourceRoot: projectRoot,
111
111
  name,
112
112
  ...packageJson.nx,
113
- targets: (0, package_json_1.readTargetsFromPackageJson)(packageJson),
113
+ targets: (0, package_json_1.readTargetsFromPackageJson)(packageJson, nxJson),
114
114
  tags: (0, package_json_1.getTagsFromPackageJson)(packageJson),
115
115
  metadata: (0, package_json_1.getMetadataFromPackageJson)(packageJson),
116
116
  };
@@ -1,3 +1,4 @@
1
+ import { NxJsonConfiguration } from '../config/nx-json';
1
2
  import { ProjectConfiguration, ProjectMetadata, TargetConfiguration } from '../config/workspace-json-project-json';
2
3
  import { PackageManagerCommands } from './package-manager';
3
4
  export interface NxProjectPackageJsonConfiguration extends Partial<ProjectConfiguration> {
@@ -69,7 +70,7 @@ export declare function readNxMigrateConfig(json: Partial<PackageJson>): NxMigra
69
70
  export declare function buildTargetFromScript(script: string, scripts: Record<string, string>, packageManagerCommand: PackageManagerCommands): TargetConfiguration;
70
71
  export declare function getMetadataFromPackageJson(packageJson: PackageJson): ProjectMetadata;
71
72
  export declare function getTagsFromPackageJson(packageJson: PackageJson): string[];
72
- export declare function readTargetsFromPackageJson(packageJson: PackageJson): Record<string, TargetConfiguration<any>>;
73
+ export declare function readTargetsFromPackageJson(packageJson: PackageJson, nxJson: NxJsonConfiguration): Record<string, TargetConfiguration<any>>;
73
74
  /**
74
75
  * Uses `require.resolve` to read the package.json for a module.
75
76
  *
@@ -77,7 +77,7 @@ function getTagsFromPackageJson(packageJson) {
77
77
  }
78
78
  return tags;
79
79
  }
80
- function readTargetsFromPackageJson(packageJson) {
80
+ function readTargetsFromPackageJson(packageJson, nxJson) {
81
81
  const { scripts, nx, private: isPrivate } = packageJson ?? {};
82
82
  const res = {};
83
83
  const includedScripts = nx?.includedScripts || Object.keys(scripts ?? {});
@@ -92,12 +92,23 @@ function readTargetsFromPackageJson(packageJson) {
92
92
  * Add implicit nx-release-publish target for all package.json files that are
93
93
  * not marked as `"private": true` to allow for lightweight configuration for
94
94
  * package based repos.
95
+ *
96
+ * Any targetDefaults for the nx-release-publish target set by the user should
97
+ * be merged with the implicit target.
95
98
  */
96
99
  if (!isPrivate && !res['nx-release-publish']) {
100
+ const nxReleasePublishTargetDefaults = nxJson?.targetDefaults?.['nx-release-publish'] ?? {};
97
101
  res['nx-release-publish'] = {
98
- dependsOn: ['^nx-release-publish'],
99
102
  executor: '@nx/js:release-publish',
100
- options: {},
103
+ ...nxReleasePublishTargetDefaults,
104
+ dependsOn: [
105
+ // For maximum correctness, projects should only ever be published once their dependencies are successfully published
106
+ '^nx-release-publish',
107
+ ...(nxReleasePublishTargetDefaults.dependsOn ?? []),
108
+ ],
109
+ options: {
110
+ ...(nxReleasePublishTargetDefaults.options ?? {}),
111
+ },
101
112
  };
102
113
  }
103
114
  return res;