nx 19.1.0-canary.20240517-312b271 → 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 +2 -1
- package/package.json +13 -14
- package/src/adapter/ngcli-adapter.js +6 -3
- package/src/command-line/release/utils/github.js +1 -1
- package/src/command-line/run/executor-utils.js +5 -0
- package/src/config/misc-interfaces.d.ts +2 -1
- package/src/core/graph/main.js +1 -1
- package/src/daemon/server/server.js +1 -1
- package/src/plugins/js/lock-file/npm-parser.js +10 -1
- package/src/plugins/js/lock-file/utils/pnpm-normalizer.js +3 -3
- package/src/utils/plugins/plugin-capabilities.js +24 -1
@@ -198,7 +198,7 @@ const handleWorkspaceChanges = async (err, changeEvents) => {
|
|
198
198
|
});
|
199
199
|
return;
|
200
200
|
}
|
201
|
-
if (err
|
201
|
+
if (err) {
|
202
202
|
let error = typeof err === 'string' ? new Error(err) : err;
|
203
203
|
logger_1.serverLogger.watcherLog('Unexpected workspace watcher error', error.message);
|
204
204
|
console.error(error);
|
@@ -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
|
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('
|
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('
|
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('
|
80
|
+
const { dump } = require('js-yaml');
|
81
81
|
return dump(sortLockfileKeys(normalizeLockfile(adaptedLockfile, isLockfileV6)), LOCKFILE_YAML_FORMAT);
|
82
82
|
}
|
83
83
|
exports.stringifyToPnpmYaml = stringifyToPnpmYaml;
|
@@ -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]
|
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
|
+
}
|