nx 19.1.0-canary.20240518-3523720 → 19.1.0-canary.20240521-1255603

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/.eslintrc.json CHANGED
@@ -100,7 +100,8 @@
100
100
  "events", // This is coming from @storybook/builder-manager since it uses the browser polyfill
101
101
  "process", // This is coming from @storybook/builder-manager since it uses the browser polyfill
102
102
  "prettier", // This is coming from @storybook/builder-manager since it uses the browser polyfill
103
- "util" // This is coming from @storybook/builder-manager since it uses the browser polyfill
103
+ "util", // This is coming from @storybook/builder-manager since it uses the browser polyfill
104
+ "js-yaml" // The rule is failing with alias dependencies
104
105
  ]
105
106
  }
106
107
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "19.1.0-canary.20240518-3523720",
3
+ "version": "19.1.0-canary.20240521-1255603",
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": {
@@ -35,7 +35,6 @@
35
35
  "dependencies": {
36
36
  "@yarnpkg/lockfile": "^1.1.0",
37
37
  "@yarnpkg/parsers": "3.0.0-rc.46",
38
- "@zkochan/js-yaml": "0.0.6",
39
38
  "axios": "^1.6.0",
40
39
  "chalk": "^4.1.0",
41
40
  "cli-cursor": "3.1.0",
@@ -49,7 +48,7 @@
49
48
  "fs-extra": "^11.1.0",
50
49
  "ignore": "^5.0.4",
51
50
  "jest-diff": "^29.4.1",
52
- "js-yaml": "4.1.0",
51
+ "js-yaml": "npm:@zkochan/js-yaml@0.0.7",
53
52
  "jsonc-parser": "3.2.0",
54
53
  "lines-and-columns": "~2.0.3",
55
54
  "minimatch": "9.0.3",
@@ -66,7 +65,7 @@
66
65
  "yargs-parser": "21.1.1",
67
66
  "node-machine-id": "1.1.12",
68
67
  "ora": "5.3.0",
69
- "@nrwl/tao": "19.1.0-canary.20240518-3523720"
68
+ "@nrwl/tao": "19.1.0-canary.20240521-1255603"
70
69
  },
71
70
  "peerDependencies": {
72
71
  "@swc-node/register": "^1.8.0",
@@ -81,16 +80,16 @@
81
80
  }
82
81
  },
83
82
  "optionalDependencies": {
84
- "@nx/nx-darwin-x64": "19.1.0-canary.20240518-3523720",
85
- "@nx/nx-darwin-arm64": "19.1.0-canary.20240518-3523720",
86
- "@nx/nx-linux-x64-gnu": "19.1.0-canary.20240518-3523720",
87
- "@nx/nx-linux-x64-musl": "19.1.0-canary.20240518-3523720",
88
- "@nx/nx-win32-x64-msvc": "19.1.0-canary.20240518-3523720",
89
- "@nx/nx-linux-arm64-gnu": "19.1.0-canary.20240518-3523720",
90
- "@nx/nx-linux-arm64-musl": "19.1.0-canary.20240518-3523720",
91
- "@nx/nx-linux-arm-gnueabihf": "19.1.0-canary.20240518-3523720",
92
- "@nx/nx-win32-arm64-msvc": "19.1.0-canary.20240518-3523720",
93
- "@nx/nx-freebsd-x64": "19.1.0-canary.20240518-3523720"
83
+ "@nx/nx-darwin-x64": "19.1.0-canary.20240521-1255603",
84
+ "@nx/nx-darwin-arm64": "19.1.0-canary.20240521-1255603",
85
+ "@nx/nx-linux-x64-gnu": "19.1.0-canary.20240521-1255603",
86
+ "@nx/nx-linux-x64-musl": "19.1.0-canary.20240521-1255603",
87
+ "@nx/nx-win32-x64-msvc": "19.1.0-canary.20240521-1255603",
88
+ "@nx/nx-linux-arm64-gnu": "19.1.0-canary.20240521-1255603",
89
+ "@nx/nx-linux-arm64-musl": "19.1.0-canary.20240521-1255603",
90
+ "@nx/nx-linux-arm-gnueabihf": "19.1.0-canary.20240521-1255603",
91
+ "@nx/nx-win32-arm64-msvc": "19.1.0-canary.20240521-1255603",
92
+ "@nx/nx-freebsd-x64": "19.1.0-canary.20240521-1255603"
94
93
  },
95
94
  "nx-migrations": {
96
95
  "migrations": "./migrations.json",
@@ -791,12 +791,10 @@ async function getWrappedWorkspaceNodeModulesArchitectHost(workspace, root, proj
791
791
  const [packageName, builderName] = builderStr.split(':');
792
792
  const { executorsFilePath, executorConfig } = this.readExecutorsJson(packageName, builderName);
793
793
  const builderInfo = this.readExecutor(packageName, builderName);
794
- const { builders, executors } = (0, fileutils_1.readJsonFile)(executorsFilePath);
795
794
  return {
796
795
  name: builderStr,
797
796
  builderName,
798
- description: builders?.[builderName]?.description ??
799
- executors?.[builderName]?.description,
797
+ description: executorConfig.description,
800
798
  optionSchema: builderInfo.schema,
801
799
  import: (0, schema_utils_1.resolveImplementation)(executorConfig.implementation, (0, path_1.dirname)(executorsFilePath)),
802
800
  };
@@ -813,6 +811,11 @@ async function getWrappedWorkspaceNodeModulesArchitectHost(workspace, root, proj
813
811
  if (!executorConfig) {
814
812
  throw new Error(`Cannot find builder '${builder}' in ${executorsFilePath}.`);
815
813
  }
814
+ if (typeof executorConfig === 'string') {
815
+ // Angular CLI can have a builder pointing to another package:builder
816
+ const [packageName, executorName] = executorConfig.split(':');
817
+ return this.readExecutorsJson(packageName, executorName);
818
+ }
816
819
  return { executorsFilePath, executorConfig, isNgCompat: true };
817
820
  }
818
821
  readExecutor(nodeModule, executor) {
@@ -223,7 +223,7 @@ async function resolveGithubToken() {
223
223
  const ghCLIPath = (0, path_1.joinPathFragments)(process.env.XDG_CONFIG_HOME || (0, path_1.joinPathFragments)((0, node_os_1.homedir)(), '.config'), 'gh', 'hosts.yml');
224
224
  if ((0, node_fs_1.existsSync)(ghCLIPath)) {
225
225
  const yamlContents = await node_fs_1.promises.readFile(ghCLIPath, 'utf8');
226
- const { load } = require('@zkochan/js-yaml');
226
+ const { load } = require('js-yaml');
227
227
  const ghCLIConfig = load(yamlContents);
228
228
  if (ghCLIConfig['github.com']) {
229
229
  // Web based session (the token is already embedded in the config)
@@ -68,6 +68,11 @@ function readExecutorJson(nodeModule, executor, root, projects) {
68
68
  if (!executorConfig) {
69
69
  throw new Error(`Cannot find executor '${executor}' in ${executorsFilePath}.`);
70
70
  }
71
+ if (typeof executorConfig === 'string') {
72
+ // Angular CLI can have a builder pointing to another package:builder
73
+ const [packageName, executorName] = executorConfig.split(':');
74
+ return readExecutorJson(packageName, executorName, root, projects);
75
+ }
71
76
  const isNgCompat = !executorsJson.executors?.[executor];
72
77
  return { executorsFilePath, executorConfig, isNgCompat };
73
78
  }
@@ -25,13 +25,14 @@ export interface GeneratorsJsonEntry {
25
25
  'x-use-standalone-layout'?: boolean;
26
26
  }
27
27
  export type OutputCaptureMethod = 'direct-nodejs' | 'pipe';
28
- export interface ExecutorsJsonEntry {
28
+ export interface ExecutorJsonEntryConfig {
29
29
  schema: string;
30
30
  implementation: string;
31
31
  batchImplementation?: string;
32
32
  description?: string;
33
33
  hasher?: string;
34
34
  }
35
+ export type ExecutorsJsonEntry = string | ExecutorJsonEntryConfig;
35
36
  export type Dependencies = 'dependencies' | 'devDependencies';
36
37
  export interface PackageJsonUpdateForPackage {
37
38
  version: string;
@@ -175,7 +175,16 @@ function findTarget(sourcePath, keyMap, targetName, versionRange) {
175
175
  const searchPath = `${sourcePath}node_modules/${targetName}`;
176
176
  if (keyMap.has(searchPath)) {
177
177
  const child = keyMap.get(searchPath);
178
- if (child.data.version === versionRange ||
178
+ // if the version is alias to another package we need to parse the versions to compare
179
+ if (child.data.version.startsWith('npm:') &&
180
+ versionRange.startsWith('npm:')) {
181
+ const nodeVersion = child.data.version.slice(child.data.version.indexOf('@', 5) + 1);
182
+ const depVersion = versionRange.slice(versionRange.indexOf('@', 5) + 1);
183
+ if (nodeVersion === depVersion || (0, semver_1.satisfies)(nodeVersion, depVersion)) {
184
+ return child;
185
+ }
186
+ }
187
+ else if (child.data.version === versionRange ||
179
188
  (0, semver_1.satisfies)(child.data.version, versionRange)) {
180
189
  return child;
181
190
  }
@@ -16,7 +16,7 @@ function loadPnpmHoistedDepsDefinition() {
16
16
  const fullPath = `${workspace_root_1.workspaceRoot}/node_modules/.modules.yaml`;
17
17
  if ((0, fs_1.existsSync)(fullPath)) {
18
18
  const content = (0, fs_1.readFileSync)(fullPath, 'utf-8');
19
- const { load } = require('@zkochan/js-yaml');
19
+ const { load } = require('js-yaml');
20
20
  return load(content)?.hoistedDependencies ?? {};
21
21
  }
22
22
  else {
@@ -32,7 +32,7 @@ exports.loadPnpmHoistedDepsDefinition = loadPnpmHoistedDepsDefinition;
32
32
  * https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/read.ts#L91
33
33
  */
34
34
  function parseAndNormalizePnpmLockfile(content) {
35
- const { load } = require('@zkochan/js-yaml');
35
+ const { load } = require('js-yaml');
36
36
  const lockFileData = load(content);
37
37
  return revertFromInlineSpecifiersFormatIfNecessary(convertFromLockfileFileMutable(lockFileData));
38
38
  }
@@ -77,7 +77,7 @@ function stringifyToPnpmYaml(lockfile) {
77
77
  const adaptedLockfile = isLockfileV6
78
78
  ? convertToInlineSpecifiersFormat(lockfile)
79
79
  : lockfile;
80
- const { dump } = require('@zkochan/js-yaml');
80
+ const { dump } = require('js-yaml');
81
81
  return dump(sortLockfileKeys(normalizeLockfile(adaptedLockfile, isLockfileV6)), LOCKFILE_YAML_FORMAT);
82
82
  }
83
83
  exports.stringifyToPnpmYaml = stringifyToPnpmYaml;
@@ -9,12 +9,12 @@ import { LoadedNxPlugin } from '../plugins/internal-api';
9
9
  * @param nxJson
10
10
  */
11
11
  export declare function retrieveWorkspaceFiles(workspaceRoot: string, projectRootMap: Record<string, string>): Promise<{
12
- allWorkspaceFiles: import("nx/src/devkit-exports").FileData[];
12
+ allWorkspaceFiles: import("../file-utils").FileData[];
13
13
  fileMap: {
14
14
  projectFileMap: ProjectFiles;
15
- nonProjectFiles: import("nx/src/native").FileData[];
15
+ nonProjectFiles: import("../../native").FileData[];
16
16
  };
17
- rustReferences: import("nx/src/native").NxWorkspaceFilesExternals;
17
+ rustReferences: import("../../native").NxWorkspaceFilesExternals;
18
18
  }>;
19
19
  /**
20
20
  * Walk through the workspace and return `ProjectConfigurations`. Only use this if the projectFileMap is not needed.
@@ -114,7 +114,7 @@ async function listPluginCapabilities(pluginName, projects) {
114
114
  if (hasBuilders) {
115
115
  bodyLines.push(chalk.bold(chalk.green('EXECUTORS/BUILDERS')));
116
116
  bodyLines.push('');
117
- bodyLines.push(...Object.keys(plugin.executors).map((name) => `${chalk.bold(name)} : ${plugin.executors[name].description}`));
117
+ bodyLines.push(...Object.keys(plugin.executors).map((name) => `${chalk.bold(name)} : ${resolveExecutorDescription(plugin.executors[name], projects)}`));
118
118
  }
119
119
  if (hasProjectGraphExtension) {
120
120
  bodyLines.push(`✔️ Project Graph Extension`);
@@ -128,3 +128,26 @@ async function listPluginCapabilities(pluginName, projects) {
128
128
  });
129
129
  }
130
130
  exports.listPluginCapabilities = listPluginCapabilities;
131
+ function resolveExecutorDescription(executorJsonEntry, projects) {
132
+ try {
133
+ if (typeof executorJsonEntry === 'string') {
134
+ // it points to another executor, resolve it
135
+ const [pkgName, executor] = executorJsonEntry.split(':');
136
+ const collection = loadExecutorsCollection(workspace_root_1.workspaceRoot, pkgName, projects);
137
+ return resolveExecutorDescription(collection[executor], projects);
138
+ }
139
+ return executorJsonEntry.description;
140
+ }
141
+ catch {
142
+ return 'No description available';
143
+ }
144
+ }
145
+ function loadExecutorsCollection(workspaceRoot, pluginName, projects) {
146
+ const { json: packageJson, path: packageJsonPath } = (0, plugins_1.readPluginPackageJson)(pluginName, projects, (0, installation_directory_1.getNxRequirePaths)(workspaceRoot));
147
+ return {
148
+ ...tryGetCollection(packageJsonPath, packageJson.builders, 'builders'),
149
+ ...tryGetCollection(packageJsonPath, packageJson.executors, 'builders'),
150
+ ...tryGetCollection(packageJsonPath, packageJson.builders, 'executors'),
151
+ ...tryGetCollection(packageJsonPath, packageJson.executors, 'executors'),
152
+ };
153
+ }