@nx/js 0.0.0-pr-30457-c3d462d → 0.0.0-pr-30522-def40ff
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-30522-def40ff",
|
|
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": "0.0.0-pr-
|
|
43
|
-
"@nx/workspace": "0.0.0-pr-
|
|
42
|
+
"@nx/devkit": "0.0.0-pr-30522-def40ff",
|
|
43
|
+
"@nx/workspace": "0.0.0-pr-30522-def40ff",
|
|
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",
|
|
@@ -737,12 +737,6 @@ function createProjectTsConfigs(tree, options) {
|
|
|
737
737
|
json.references.push({
|
|
738
738
|
path: './tsconfig.lib.json',
|
|
739
739
|
});
|
|
740
|
-
// If using `tsc` to build, then we do not want a typecheck target that duplicates the work, since both run `tsc`.
|
|
741
|
-
// This applies to `@nx/js/typescript` plugin only.
|
|
742
|
-
if (options.bundler === 'tsc') {
|
|
743
|
-
json['nx'] ??= {};
|
|
744
|
-
json['nx'].addTypecheckTarget = false;
|
|
745
|
-
}
|
|
746
740
|
return json;
|
|
747
741
|
});
|
|
748
742
|
}
|
|
@@ -754,12 +748,6 @@ function createProjectTsConfigs(tree, options) {
|
|
|
754
748
|
include: [],
|
|
755
749
|
references: [{ path: './tsconfig.lib.json' }],
|
|
756
750
|
};
|
|
757
|
-
// If using `tsc` to build, then we do not want a typecheck target that duplicates the work, since both run `tsc`.
|
|
758
|
-
// This applies to `@nx/js/typescript` plugin only.
|
|
759
|
-
if (options.bundler === 'tsc') {
|
|
760
|
-
tsconfig['nx'] ??= {};
|
|
761
|
-
tsconfig['nx'].addTypecheckTarget = false;
|
|
762
|
-
}
|
|
763
751
|
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.projectRoot, 'tsconfig.json'), tsconfig);
|
|
764
752
|
// update root project tsconfig.json references with the new lib tsconfig
|
|
765
753
|
(0, devkit_1.updateJson)(tree, 'tsconfig.json', (json) => {
|
|
@@ -33,8 +33,6 @@ export declare function calculateDependenciesFromTaskGraph(taskGraph: TaskGraph,
|
|
|
33
33
|
*/
|
|
34
34
|
export declare function computeCompilerOptionsPaths(tsConfig: string | ts.ParsedCommandLine, dependencies: DependentBuildableProjectNode[]): ts.MapLike<string[]>;
|
|
35
35
|
export declare function createTmpTsConfig(tsconfigPath: string, workspaceRoot: string, projectRoot: string, dependencies: DependentBuildableProjectNode[], useWorkspaceAsBaseUrl?: boolean): string;
|
|
36
|
-
export declare function checkDependentProjectsHaveBeenBuilt(root: string, projectName: string, targetName: string, projectDependencies: DependentBuildableProjectNode[]): boolean;
|
|
37
|
-
export declare function findMissingBuildDependencies(root: string, projectName: string, targetName: string, projectDependencies: DependentBuildableProjectNode[]): DependentBuildableProjectNode[];
|
|
38
36
|
export declare function updatePaths(dependencies: DependentBuildableProjectNode[], paths: Record<string, string[]>): void;
|
|
39
37
|
/**
|
|
40
38
|
* Updates the peerDependencies section in the `dist/lib/xyz/package.json` with
|
|
@@ -5,8 +5,6 @@ exports.calculateProjectDependencies = calculateProjectDependencies;
|
|
|
5
5
|
exports.calculateDependenciesFromTaskGraph = calculateDependenciesFromTaskGraph;
|
|
6
6
|
exports.computeCompilerOptionsPaths = computeCompilerOptionsPaths;
|
|
7
7
|
exports.createTmpTsConfig = createTmpTsConfig;
|
|
8
|
-
exports.checkDependentProjectsHaveBeenBuilt = checkDependentProjectsHaveBeenBuilt;
|
|
9
|
-
exports.findMissingBuildDependencies = findMissingBuildDependencies;
|
|
10
8
|
exports.updatePaths = updatePaths;
|
|
11
9
|
exports.updateBuildableProjectPackageJsonDependencies = updateBuildableProjectPackageJsonDependencies;
|
|
12
10
|
const devkit_1 = require("@nx/devkit");
|
|
@@ -252,36 +250,6 @@ function cleanupTmpTsConfigFile(tmpTsConfigPath) {
|
|
|
252
250
|
}
|
|
253
251
|
catch (e) { }
|
|
254
252
|
}
|
|
255
|
-
function checkDependentProjectsHaveBeenBuilt(root, projectName, targetName, projectDependencies) {
|
|
256
|
-
const missing = findMissingBuildDependencies(root, projectName, targetName, projectDependencies);
|
|
257
|
-
if (missing.length > 0) {
|
|
258
|
-
console.error((0, devkit_1.stripIndents) `
|
|
259
|
-
It looks like all of ${projectName}'s dependencies have not been built yet:
|
|
260
|
-
${missing.map((x) => ` - ${x.node.name}`).join('\n')}
|
|
261
|
-
|
|
262
|
-
You might be missing a "targetDefaults" configuration in your root nx.json (https://nx.dev/reference/project-configuration#target-defaults),
|
|
263
|
-
or "dependsOn" configured in ${projectName}'s project.json (https://nx.dev/reference/project-configuration#dependson)
|
|
264
|
-
`);
|
|
265
|
-
return false;
|
|
266
|
-
}
|
|
267
|
-
else {
|
|
268
|
-
return true;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
function findMissingBuildDependencies(root, projectName, targetName, projectDependencies) {
|
|
272
|
-
const depLibsToBuildFirst = [];
|
|
273
|
-
// verify whether all dependent libraries have been built
|
|
274
|
-
projectDependencies.forEach((dep) => {
|
|
275
|
-
if (dep.node.type !== 'lib') {
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
const paths = dep.outputs.map((p) => (0, path_1.join)(root, p));
|
|
279
|
-
if (!paths.some(fileutils_1.directoryExists)) {
|
|
280
|
-
depLibsToBuildFirst.push(dep);
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
return depLibsToBuildFirst;
|
|
284
|
-
}
|
|
285
253
|
function updatePaths(dependencies, paths) {
|
|
286
254
|
const pathsKeys = Object.keys(paths);
|
|
287
255
|
// For each registered dependency
|
|
@@ -291,7 +259,7 @@ function updatePaths(dependencies, paths) {
|
|
|
291
259
|
// If there are outputs
|
|
292
260
|
if (dep.outputs && dep.outputs.length > 0) {
|
|
293
261
|
// Directly map the dependency name to the output paths (dist/packages/..., etc.)
|
|
294
|
-
paths[dep.name] = dep.outputs;
|
|
262
|
+
paths[dep.name] = dep.outputs.map((output) => output.replace(/(\*|\/[^\/]*\*).*$/, ''));
|
|
295
263
|
// check for secondary entrypoints
|
|
296
264
|
// For each registered path
|
|
297
265
|
for (const path of pathsKeys) {
|