@nx/js 22.7.0-rc.0 → 22.7.0-rc.1
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 +4 -4
- package/src/executors/node/lib/output-file.d.ts +9 -0
- package/src/executors/node/lib/output-file.d.ts.map +1 -0
- package/src/executors/node/lib/output-file.js +19 -0
- package/src/executors/node/node.impl.d.ts.map +1 -1
- package/src/executors/node/node.impl.js +7 -9
- package/src/generators/typescript-sync/typescript-sync.d.ts.map +1 -1
- package/src/generators/typescript-sync/typescript-sync.js +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "22.7.0-rc.
|
|
3
|
+
"version": "22.7.0-rc.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
|
|
6
6
|
"repository": {
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"@babel/preset-env": "^7.23.2",
|
|
41
41
|
"@babel/preset-typescript": "^7.22.5",
|
|
42
42
|
"@babel/runtime": "^7.22.6",
|
|
43
|
-
"@nx/devkit": "22.7.0-rc.
|
|
44
|
-
"@nx/workspace": "22.7.0-rc.
|
|
43
|
+
"@nx/devkit": "22.7.0-rc.1",
|
|
44
|
+
"@nx/workspace": "22.7.0-rc.1",
|
|
45
45
|
"@zkochan/js-yaml": "0.0.7",
|
|
46
46
|
"babel-plugin-const-enum": "^1.0.1",
|
|
47
47
|
"babel-plugin-macros": "^3.1.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"tslib": "^2.3.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"nx": "22.7.0-rc.
|
|
64
|
+
"nx": "22.7.0-rc.1"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"verdaccio": "^6.0.5"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface OutputFileNameOptions {
|
|
2
|
+
buildTargetExecutor: string;
|
|
3
|
+
main: string;
|
|
4
|
+
outputPath: string;
|
|
5
|
+
rootDir: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function getOutputFileName({ buildTargetExecutor, main, outputPath, rootDir, }: OutputFileNameOptions): string;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=output-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-file.d.ts","sourceRoot":"","sources":["../../../../../../../packages/js/src/executors/node/lib/output-file.ts"],"names":[],"mappings":"AAIA,UAAU,qBAAqB;IAC7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,mBAAmB,EACnB,IAAI,EACJ,UAAU,EACV,OAAO,GACR,EAAE,qBAAqB,GAAG,MAAM,CAqBhC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOutputFileName = getOutputFileName;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const path_2 = require("nx/src/utils/path");
|
|
6
|
+
const get_main_file_dir_1 = require("../../../utils/get-main-file-dir");
|
|
7
|
+
function getOutputFileName({ buildTargetExecutor, main, outputPath, rootDir, }) {
|
|
8
|
+
const fileName = `${(0, path_1.parse)(main).name}.js`;
|
|
9
|
+
if (buildTargetExecutor !== '@nx/js:tsc' &&
|
|
10
|
+
buildTargetExecutor !== '@nx/js:swc') {
|
|
11
|
+
return fileName;
|
|
12
|
+
}
|
|
13
|
+
const mainDirectory = (0, path_2.normalizePath)((0, path_1.dirname)(main));
|
|
14
|
+
const normalizedOutputPath = (0, path_2.normalizePath)(outputPath);
|
|
15
|
+
const isMainInsideOutputPath = mainDirectory === normalizedOutputPath ||
|
|
16
|
+
mainDirectory.startsWith(`${normalizedOutputPath}/`);
|
|
17
|
+
const base = isMainInsideOutputPath ? normalizedOutputPath : rootDir;
|
|
18
|
+
return (0, path_2.joinPathFragments)((0, get_main_file_dir_1.getRelativeDirectoryToProjectRoot)(main, base), fileName);
|
|
19
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/node/node.impl.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EAQhB,MAAM,YAAY,CAAC;AAOpB,OAAO,EAAe,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAqB5D,wBAAuB,YAAY,CACjC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,eAAe;aAgEb,OAAO;cACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;cA6QhC;
|
|
1
|
+
{"version":3,"file":"node.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/node/node.impl.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EAQhB,MAAM,YAAY,CAAC;AAOpB,OAAO,EAAe,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAqB5D,wBAAuB,YAAY,CACjC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,eAAe;aAgEb,OAAO;cACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;cA6QhC;AA6ID,eAAe,YAAY,CAAC"}
|
|
@@ -15,9 +15,9 @@ const kill_tree_1 = require("./lib/kill-tree");
|
|
|
15
15
|
const line_aware_writer_1 = require("./lib/line-aware-writer");
|
|
16
16
|
const coalescing_debounce_1 = require("./lib/coalescing-debounce");
|
|
17
17
|
const fileutils_1 = require("nx/src/utils/fileutils");
|
|
18
|
-
const get_main_file_dir_1 = require("../../utils/get-main-file-dir");
|
|
19
18
|
const utils_1 = require("nx/src/tasks-runner/utils");
|
|
20
19
|
const detect_module_format_1 = require("./lib/detect-module-format");
|
|
20
|
+
const output_file_1 = require("./lib/output-file");
|
|
21
21
|
const globalLineAwareWriter = new line_aware_writer_1.LineAwareWriter();
|
|
22
22
|
async function* nodeExecutor(options, context) {
|
|
23
23
|
process.env.NODE_ENV ??= context?.configurationName ?? 'development';
|
|
@@ -347,14 +347,12 @@ function getFileToRun(context, project, buildOptions, buildTargetExecutor) {
|
|
|
347
347
|
}
|
|
348
348
|
let outputFileName = buildOptions.outputFileName;
|
|
349
349
|
if (!outputFileName) {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
outputFileName = fileName;
|
|
357
|
-
}
|
|
350
|
+
outputFileName = (0, output_file_1.getOutputFileName)({
|
|
351
|
+
buildTargetExecutor,
|
|
352
|
+
main: buildOptions.main,
|
|
353
|
+
outputPath: buildOptions.outputPath,
|
|
354
|
+
rootDir: buildOptions.rootDir ?? project.data.root,
|
|
355
|
+
});
|
|
358
356
|
}
|
|
359
357
|
return (0, path_1.join)(context.root, buildOptions.outputPath, outputFileName);
|
|
360
358
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-sync.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/typescript-sync/typescript-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAIpB,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"typescript-sync.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/typescript-sync/typescript-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAIpB,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,8BAA8B,CAAC;AA4CtC,wBAAsB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAyQ5E;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -199,6 +199,7 @@ function updateTsConfigReferences(tree, tsSysFromTree, tsconfigInfoCaches, tsCon
|
|
|
199
199
|
const stringifiedJsonContents = readRawTsconfigContents(tree, tsconfigInfoCaches, tsConfigPath);
|
|
200
200
|
const tsConfig = (0, devkit_1.parseJson)(stringifiedJsonContents);
|
|
201
201
|
const ignoredReferences = new Set(tsConfig.nx?.sync?.ignoredReferences ?? []);
|
|
202
|
+
const ignoredDependencies = new Set(tsConfig.nx?.sync?.ignoredDependencies ?? []);
|
|
202
203
|
// We have at least one dependency so we can safely set it to an empty array if not already set
|
|
203
204
|
const references = [];
|
|
204
205
|
const originalReferencesSet = new Set();
|
|
@@ -236,6 +237,12 @@ function updateTsConfigReferences(tree, tsSysFromTree, tsconfigInfoCaches, tsCon
|
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
239
|
for (const dep of dependencies) {
|
|
240
|
+
if (ignoredDependencies.has(dep.name)) {
|
|
241
|
+
// The user has explicitly opted out of this dependency edge, typically
|
|
242
|
+
// to break a circular project reference graph that the project graph
|
|
243
|
+
// intentionally allows.
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
239
246
|
// Ensure the project reference for the target is set if we can find the
|
|
240
247
|
// relevant tsconfig file
|
|
241
248
|
let referencePath;
|