nx 22.7.2 → 22.7.4
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/dist/src/command-line/format/format.js +15 -5
- package/dist/src/command-line/report/report.js +0 -1
- package/dist/src/config/schema-utils.js +2 -1
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/core/graph/styles.js +1 -1
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/plugins/js/utils/typescript.d.ts +7 -0
- package/dist/src/plugins/js/utils/typescript.js +39 -0
- package/dist/src/project-graph/plugins/resolve-plugin.d.ts +7 -4
- package/dist/src/project-graph/plugins/resolve-plugin.js +152 -33
- package/dist/src/project-graph/plugins/utils.js +13 -7
- package/dist/src/tasks-runner/tasks-schedule.js +3 -3
- package/package.json +13 -13
|
@@ -34,10 +34,15 @@ async function format(command, args) {
|
|
|
34
34
|
process.exit(1);
|
|
35
35
|
}
|
|
36
36
|
const { nxArgs } = (0, command_line_utils_1.splitArgsIntoNxArgsAndOverrides)(args, 'affected', { printWarnings: false }, (0, configuration_1.readNxJson)());
|
|
37
|
-
const patterns = (await getPatterns(prettier, { ...args, ...nxArgs })).map(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
const patterns = (await getPatterns(prettier, { ...args, ...nxArgs })).map((p) => {
|
|
38
|
+
// On non-Windows, escape $ to prevent shell variable interpolation
|
|
39
|
+
// (the shell consumes one \, so \\$ becomes \$ which the shell treats as literal $)
|
|
40
|
+
// On Windows (cmd.exe), $ is not a special character, so escaping it would
|
|
41
|
+
// cause prettier to look for a file with a literal \$ in the name
|
|
42
|
+
// prettier-ignore
|
|
43
|
+
const escaped = process.platform !== 'win32' ? p.replace(/\$/g, '\\\$') : p;
|
|
44
|
+
return `"${escaped}"`;
|
|
45
|
+
});
|
|
41
46
|
// Chunkify the patterns array to prevent crashing the windows terminal
|
|
42
47
|
const chunkList = (0, chunkify_1.chunkify)(patterns);
|
|
43
48
|
switch (command) {
|
|
@@ -204,7 +209,12 @@ function getPrettierPath() {
|
|
|
204
209
|
return prettierPath;
|
|
205
210
|
}
|
|
206
211
|
const { packageJson, path: packageJsonPath } = (0, package_json_1.readModulePackageJson)('prettier');
|
|
207
|
-
|
|
212
|
+
const bin = packageJson.bin;
|
|
213
|
+
const binPath = typeof bin === 'string' ? bin : bin?.['prettier'];
|
|
214
|
+
if (!binPath) {
|
|
215
|
+
throw new Error(`Could not find prettier binary in ${packageJsonPath}`);
|
|
216
|
+
}
|
|
217
|
+
prettierPath = path.resolve(path.dirname(packageJsonPath), binPath);
|
|
208
218
|
return prettierPath;
|
|
209
219
|
}
|
|
210
220
|
let useListDifferent;
|
|
@@ -383,7 +383,6 @@ function findRegisteredPluginsBeingUsed(nxJson) {
|
|
|
383
383
|
}
|
|
384
384
|
function findInstalledPackagesWeCareAbout() {
|
|
385
385
|
const packagesWeMayCareAbout = {};
|
|
386
|
-
// TODO (v20): Remove workaround for hiding @nrwl packages when matching @nx package is found.
|
|
387
386
|
for (const pkg of exports.packagesWeCareAbout) {
|
|
388
387
|
const v = readPackageVersion(pkg);
|
|
389
388
|
if (v) {
|
|
@@ -8,6 +8,7 @@ const path_1 = require("path");
|
|
|
8
8
|
const resolve_exports_1 = require("resolve.exports");
|
|
9
9
|
const packages_1 = require("../plugins/js/utils/packages");
|
|
10
10
|
const plugins_1 = require("../project-graph/plugins");
|
|
11
|
+
const typescript_1 = require("../plugins/js/utils/typescript");
|
|
11
12
|
const path_2 = require("../utils/path");
|
|
12
13
|
/**
|
|
13
14
|
* This function is used to get the implementation factory of an executor or generator.
|
|
@@ -92,7 +93,7 @@ function tryResolveFromSource(path, directory, packageName, projects) {
|
|
|
92
93
|
const fromExports = (0, resolve_exports_1.resolve)({
|
|
93
94
|
name: localProject.metadata.js.packageName,
|
|
94
95
|
exports: localProject.metadata.js.packageExports,
|
|
95
|
-
}, path, { conditions:
|
|
96
|
+
}, path, { conditions: (0, typescript_1.getRootTsConfigResolveExportsConditions)() });
|
|
96
97
|
if (fromExports && fromExports.length) {
|
|
97
98
|
for (const exportPath of fromExports) {
|
|
98
99
|
if ((0, fs_1.existsSync)((0, path_1.join)(directory, exportPath))) {
|