@nx/js 22.6.0-beta.11 → 22.6.0-beta.13
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/plugins/typescript/plugin.js +42 -34
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "22.6.0-beta.
|
|
3
|
+
"version": "22.6.0-beta.13",
|
|
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": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@babel/preset-env": "^7.23.2",
|
|
40
40
|
"@babel/preset-typescript": "^7.22.5",
|
|
41
41
|
"@babel/runtime": "^7.22.6",
|
|
42
|
-
"@nx/devkit": "22.6.0-beta.
|
|
43
|
-
"@nx/workspace": "22.6.0-beta.
|
|
42
|
+
"@nx/devkit": "22.6.0-beta.13",
|
|
43
|
+
"@nx/workspace": "22.6.0-beta.13",
|
|
44
44
|
"@zkochan/js-yaml": "0.0.7",
|
|
45
45
|
"babel-plugin-const-enum": "^1.0.1",
|
|
46
46
|
"babel-plugin-macros": "^3.1.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"tslib": "^2.3.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"nx": "22.6.0-beta.
|
|
63
|
+
"nx": "22.6.0-beta.13"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"verdaccio": "^6.0.5"
|
|
@@ -456,15 +456,21 @@ function getInputs(namedInputs, config, tsConfig, internalProjectReferences, wor
|
|
|
456
456
|
if (excludePaths.size) {
|
|
457
457
|
inputs.push(...Array.from(excludePaths).map((p) => `!${pathToInputOrOutput((0, devkit_1.joinPathFragments)(config.project.root, p), workspaceRoot, config.project)}`));
|
|
458
458
|
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
459
|
+
// tsc --build reads .d.ts and .tsbuildinfo files from dependent tasks, not
|
|
460
|
+
// the source files of dependencies. This correctly tracks build outputs from
|
|
461
|
+
// both external project references and same-project task dependencies (e.g.
|
|
462
|
+
// build-native producing .d.ts files that may be excluded from file watching
|
|
463
|
+
// via .nxignore).
|
|
464
|
+
inputs.push({
|
|
465
|
+
dependentTasksOutputFiles: '**/*.{d.ts,tsbuildinfo}',
|
|
466
|
+
transitive: true,
|
|
467
|
+
});
|
|
468
|
+
const externalRefConfigFiles = getExternalProjectReferenceConfigFiles(tsConfig, internalProjectReferences, workspaceRoot, config.project, cache, configFiles);
|
|
469
|
+
if (externalRefConfigFiles.length > 0) {
|
|
470
|
+
// tsc --build also reads the tsconfig files from external project
|
|
471
|
+
// references (and their extended configs) when processing project
|
|
472
|
+
// references, so we need to add them as inputs
|
|
473
|
+
inputs.push(...externalRefConfigFiles.map((p) => pathToInputOrOutput(p, workspaceRoot, config.project)));
|
|
468
474
|
}
|
|
469
475
|
// inputs.push({ externalDependencies });
|
|
470
476
|
return inputs;
|
|
@@ -617,33 +623,35 @@ function resolveShallowExternalProjectReferences(tsConfig, workspaceRoot, projec
|
|
|
617
623
|
}
|
|
618
624
|
return projectReferences;
|
|
619
625
|
}
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
}
|
|
640
|
-
const
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
626
|
+
/**
|
|
627
|
+
* Collects config file paths from external project references, including their
|
|
628
|
+
* extended config files. It checks the root tsconfig and all internal project
|
|
629
|
+
* references for their direct external references.
|
|
630
|
+
*/
|
|
631
|
+
function getExternalProjectReferenceConfigFiles(tsConfig, internalProjectReferences, workspaceRoot, project, cache, existingConfigFiles) {
|
|
632
|
+
const externalRefs = {};
|
|
633
|
+
// Collect direct external references from the root tsconfig
|
|
634
|
+
resolveShallowExternalProjectReferences(tsConfig, workspaceRoot, project, cache, externalRefs);
|
|
635
|
+
// Collect external references from internal project references
|
|
636
|
+
for (const refTsConfig of Object.values(internalProjectReferences)) {
|
|
637
|
+
resolveShallowExternalProjectReferences(refTsConfig, workspaceRoot, project, cache, externalRefs);
|
|
638
|
+
}
|
|
639
|
+
const result = [];
|
|
640
|
+
const seen = new Set();
|
|
641
|
+
for (const [refConfigPath, refTsConfig] of Object.entries(externalRefs)) {
|
|
642
|
+
if (!existingConfigFiles.has(refConfigPath) && !seen.has(refConfigPath)) {
|
|
643
|
+
result.push(refConfigPath);
|
|
644
|
+
seen.add(refConfigPath);
|
|
645
|
+
}
|
|
646
|
+
const extendedFiles = getExtendedConfigFiles(refTsConfig, workspaceRoot, cache);
|
|
647
|
+
for (const extFile of extendedFiles.files) {
|
|
648
|
+
if (!existingConfigFiles.has(extFile) && !seen.has(extFile)) {
|
|
649
|
+
result.push(extFile);
|
|
650
|
+
seen.add(extFile);
|
|
651
|
+
}
|
|
644
652
|
}
|
|
645
653
|
}
|
|
646
|
-
return
|
|
654
|
+
return result;
|
|
647
655
|
}
|
|
648
656
|
function isExternalProjectReference(refConfig, project, workspaceRoot, cache) {
|
|
649
657
|
const owner = cache.configOwners.get(refConfig.relativePath);
|