@nx/js 22.7.0-pr.33655.12b0dd7 → 22.7.0-pr.33655.2b96277
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/migrations.json +9 -0
- package/package.json +8 -9
- package/src/plugins/typescript/plugin.d.ts.map +1 -1
- package/src/plugins/typescript/plugin.js +32 -27
- package/src/utils/assets/copy-assets-handler.d.ts +3 -1
- package/src/utils/assets/copy-assets-handler.d.ts.map +1 -1
- package/src/utils/assets/copy-assets-handler.js +6 -38
- package/src/utils/assets/normalize-assets.d.ts +26 -0
- package/src/utils/assets/normalize-assets.d.ts.map +1 -0
- package/src/utils/assets/normalize-assets.js +47 -0
- package/src/utils/find-npm-dependencies.js +1 -1
- package/src/utils/test-fixtures/tsconfig.json +5 -0
- package/src/utils/typescript/test-fixtures/tsconfig.json +11 -0
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
package/migrations.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "22.7.0-pr.33655.
|
|
3
|
+
"version": "22.7.0-pr.33655.2b96277",
|
|
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": {
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"Backend"
|
|
20
20
|
],
|
|
21
21
|
"main": "src/index.js",
|
|
22
|
-
"
|
|
22
|
+
"type": "commonjs",
|
|
23
|
+
"types": "src/index.d.ts",
|
|
23
24
|
"license": "MIT",
|
|
24
25
|
"bugs": {
|
|
25
26
|
"url": "https://github.com/nrwl/nx/issues"
|
|
@@ -39,8 +40,8 @@
|
|
|
39
40
|
"@babel/preset-env": "^7.23.2",
|
|
40
41
|
"@babel/preset-typescript": "^7.22.5",
|
|
41
42
|
"@babel/runtime": "^7.22.6",
|
|
42
|
-
"@nx/devkit": "22.7.0-pr.33655.
|
|
43
|
-
"@nx/workspace": "22.7.0-pr.33655.
|
|
43
|
+
"@nx/devkit": "22.7.0-pr.33655.2b96277",
|
|
44
|
+
"@nx/workspace": "22.7.0-pr.33655.2b96277",
|
|
44
45
|
"@zkochan/js-yaml": "0.0.7",
|
|
45
46
|
"babel-plugin-const-enum": "^1.0.1",
|
|
46
47
|
"babel-plugin-macros": "^3.1.0",
|
|
@@ -53,14 +54,14 @@
|
|
|
53
54
|
"jsonc-parser": "3.2.0",
|
|
54
55
|
"npm-run-path": "^4.0.1",
|
|
55
56
|
"picocolors": "^1.1.0",
|
|
56
|
-
"picomatch": "4.0.
|
|
57
|
+
"picomatch": "4.0.4",
|
|
57
58
|
"semver": "^7.6.3",
|
|
58
59
|
"source-map-support": "0.5.19",
|
|
59
60
|
"tinyglobby": "^0.2.12",
|
|
60
61
|
"tslib": "^2.3.0"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
|
-
"nx": "22.7.0-pr.33655.
|
|
64
|
+
"nx": "22.7.0-pr.33655.2b96277"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
66
67
|
"verdaccio": "^6.0.5"
|
|
@@ -72,7 +73,5 @@
|
|
|
72
73
|
},
|
|
73
74
|
"publishConfig": {
|
|
74
75
|
"access": "public"
|
|
75
|
-
}
|
|
76
|
-
"types": "src/index.d.ts",
|
|
77
|
-
"type": "commonjs"
|
|
76
|
+
}
|
|
78
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/plugins/typescript/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,kBAAkB,EAEvB,KAAK,aAAa,EAInB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/plugins/typescript/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,kBAAkB,EAEvB,KAAK,aAAa,EAInB,MAAM,YAAY,CAAC;AA8BpB,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC1B,SAAS,CAAC,EACN,OAAO,GACP;QACE,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACN,KAAK,CAAC,EACF,OAAO,GACP;QACE,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B,CAAC;IACN,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA2KD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAEF,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAI/C,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,gBAAgB,CA0FzD,CAAC;AAEF,eAAO,MAAM,WAAW,iCAAgB,CAAC"}
|
|
@@ -257,7 +257,7 @@ function buildTscTargets(config, options, context, configFiles, cache) {
|
|
|
257
257
|
const targetName = options.typecheck.targetName;
|
|
258
258
|
const compiler = options.compiler;
|
|
259
259
|
if (!targets[targetName]) {
|
|
260
|
-
let command = `${compiler} --build --emitDeclarationOnly${options.verboseOutput ? ' --verbose' : ''}`;
|
|
260
|
+
let command = `${compiler} --build ${options.typecheck.configName} --emitDeclarationOnly${options.verboseOutput ? ' --verbose' : ''}`;
|
|
261
261
|
if (tsConfig.options.noEmit ||
|
|
262
262
|
Object.values(internalProjectReferences).some((ref) => ref.options.noEmit) ||
|
|
263
263
|
Object.values(externalProjectReferences).some((ref) => ref.options.noEmit)) {
|
|
@@ -460,11 +460,15 @@ function getInputs(namedInputs, config, tsConfig, internalProjectReferences, wor
|
|
|
460
460
|
// the source files of dependencies. This correctly tracks build outputs from
|
|
461
461
|
// both external project references and same-project task dependencies (e.g.
|
|
462
462
|
// build-native producing .d.ts files that may be excluded from file watching
|
|
463
|
-
// via .nxignore
|
|
463
|
+
// via .nxignore. "*.d.ts" are also read from the deps projects sources.
|
|
464
464
|
inputs.push({
|
|
465
465
|
dependentTasksOutputFiles: '**/*.{d.ts,tsbuildinfo}',
|
|
466
466
|
transitive: true,
|
|
467
467
|
});
|
|
468
|
+
inputs.push({
|
|
469
|
+
fileset: '{projectRoot}/**/*.d.ts',
|
|
470
|
+
dependencies: true,
|
|
471
|
+
});
|
|
468
472
|
const externalRefPatterns = getExternalProjectReferenceTsconfigPatterns(tsConfig, internalProjectReferences, workspaceRoot, config.project, cache);
|
|
469
473
|
inputs.push(...externalRefPatterns);
|
|
470
474
|
// inputs.push({ externalDependencies });
|
|
@@ -492,10 +496,6 @@ function getOutputs(config, rootTsConfig, internalProjectReferences, workspaceRo
|
|
|
492
496
|
outputs.add(pathToInputOrOutput((0, devkit_1.joinPathFragments)(outDir, `${outFileName}.js.map`), workspaceRoot, config.project));
|
|
493
497
|
outputs.add(pathToInputOrOutput((0, devkit_1.joinPathFragments)(outDir, `${outFileName}.d.ts`), workspaceRoot, config.project));
|
|
494
498
|
outputs.add(pathToInputOrOutput((0, devkit_1.joinPathFragments)(outDir, `${outFileName}.d.ts.map`), workspaceRoot, config.project));
|
|
495
|
-
// https://www.typescriptlang.org/tsconfig#tsBuildInfoFile
|
|
496
|
-
outputs.add(tsConfig.options.tsBuildInfoFile
|
|
497
|
-
? pathToInputOrOutput(tsConfig.options.tsBuildInfoFile, workspaceRoot, config.project)
|
|
498
|
-
: pathToInputOrOutput((0, devkit_1.joinPathFragments)(outDir, `${outFileName}.tsbuildinfo`), workspaceRoot, config.project));
|
|
499
499
|
}
|
|
500
500
|
else if (tsConfig.options.outDir) {
|
|
501
501
|
if (emitDeclarationOnly) {
|
|
@@ -505,23 +505,12 @@ function getOutputs(config, rootTsConfig, internalProjectReferences, workspaceRo
|
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
else {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
outputs.add(pathToInputOrOutput(tsConfig.options.tsBuildInfoFile, workspaceRoot, config.project));
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
else if (tsConfig.options.rootDir && tsConfig.options.rootDir !== '.') {
|
|
518
|
-
// If rootDir is set, then the tsbuildinfo file will be outside the outDir so we need to add it.
|
|
519
|
-
const relativeRootDir = (0, node_path_1.relative)(tsConfig.options.rootDir, (0, node_path_1.join)(workspaceRoot, config.project.root));
|
|
520
|
-
outputs.add(pathToInputOrOutput((0, devkit_1.joinPathFragments)(tsConfig.options.outDir, relativeRootDir, `*.tsbuildinfo`), workspaceRoot, config.project));
|
|
521
|
-
}
|
|
522
|
-
else if (emitDeclarationOnly) {
|
|
523
|
-
// https://www.typescriptlang.org/tsconfig#tsBuildInfoFile
|
|
524
|
-
outputs.add(pathToInputOrOutput((0, devkit_1.joinPathFragments)(tsConfig.options.outDir, `${configBaseNameNoExt}.tsbuildinfo`), workspaceRoot, config.project));
|
|
508
|
+
// List specific tsc output extensions instead of claiming the
|
|
509
|
+
// entire outDir, so other tasks that write into the same
|
|
510
|
+
// directory (e.g. copy-assets for .node/.wasm files) don't
|
|
511
|
+
// have their outputs captured by the tsc build cache.
|
|
512
|
+
const jsonExt = tsConfig.options.resolveJsonModule ? ',json' : '';
|
|
513
|
+
outputs.add(pathToInputOrOutput((0, devkit_1.joinPathFragments)(tsConfig.options.outDir, `**/*.{js,cjs,mjs,jsx${jsonExt},d.ts,d.cts,d.mts}{,.map}`), workspaceRoot, config.project));
|
|
525
514
|
}
|
|
526
515
|
}
|
|
527
516
|
else if (tsConfig.raw?.include?.length ||
|
|
@@ -540,14 +529,30 @@ function getOutputs(config, rootTsConfig, internalProjectReferences, workspaceRo
|
|
|
540
529
|
outputs.add((0, devkit_1.joinPathFragments)('{projectRoot}', '**/*.d.ts.map'));
|
|
541
530
|
outputs.add((0, devkit_1.joinPathFragments)('{projectRoot}', '**/*.d.cts.map'));
|
|
542
531
|
outputs.add((0, devkit_1.joinPathFragments)('{projectRoot}', '**/*.d.mts.map'));
|
|
543
|
-
// https://www.typescriptlang.org/tsconfig#tsBuildInfoFile
|
|
544
|
-
outputs.add(tsConfig.options.tsBuildInfoFile
|
|
545
|
-
? pathToInputOrOutput(tsConfig.options.tsBuildInfoFile, workspaceRoot, config.project)
|
|
546
|
-
: (0, devkit_1.joinPathFragments)('{projectRoot}', `${configBaseNameNoExt}.tsbuildinfo`));
|
|
547
532
|
}
|
|
533
|
+
// tsc --build always produces a tsbuildinfo file.
|
|
534
|
+
outputs.add(getTsBuildInfoOutputPath(tsConfig, configBaseNameNoExt, workspaceRoot, config.project));
|
|
548
535
|
});
|
|
549
536
|
return Array.from(outputs);
|
|
550
537
|
}
|
|
538
|
+
/**
|
|
539
|
+
* Returns the path to the tsbuildinfo file that tsc --build will produce.
|
|
540
|
+
* tsc always emits this file in build mode (incremental is implicit).
|
|
541
|
+
*/
|
|
542
|
+
function getTsBuildInfoOutputPath(tsConfig, configBaseNameNoExt, workspaceRoot, project) {
|
|
543
|
+
if (tsConfig.options.tsBuildInfoFile) {
|
|
544
|
+
return pathToInputOrOutput(tsConfig.options.tsBuildInfoFile, workspaceRoot, project);
|
|
545
|
+
}
|
|
546
|
+
if (tsConfig.options.outFile) {
|
|
547
|
+
const outFileName = (0, node_path_1.basename)(tsConfig.options.outFile, '.js');
|
|
548
|
+
const outDir = (0, node_path_1.relative)(workspaceRoot, (0, node_path_1.dirname)(tsConfig.options.outFile));
|
|
549
|
+
return pathToInputOrOutput((0, devkit_1.joinPathFragments)(outDir, `${outFileName}.tsbuildinfo`), workspaceRoot, project);
|
|
550
|
+
}
|
|
551
|
+
if (tsConfig.options.outDir) {
|
|
552
|
+
return pathToInputOrOutput((0, devkit_1.joinPathFragments)(tsConfig.options.outDir, `${configBaseNameNoExt}.tsbuildinfo`), workspaceRoot, project);
|
|
553
|
+
}
|
|
554
|
+
return (0, devkit_1.joinPathFragments)('{projectRoot}', `${configBaseNameNoExt}.tsbuildinfo`);
|
|
555
|
+
}
|
|
551
556
|
function pathToInputOrOutput(path, workspaceRoot, project) {
|
|
552
557
|
const fullProjectRoot = project.absolute;
|
|
553
558
|
const fullPath = (0, node_path_1.resolve)(workspaceRoot, path);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { AssetGlob } from './assets';
|
|
2
|
+
import { normalizeAssets, getAssetOutputPath, NormalizedAssetEntry as AssetEntry } from './normalize-assets';
|
|
2
3
|
import { ChangedFile } from 'nx/src/daemon/client/client';
|
|
4
|
+
export type { AssetEntry };
|
|
5
|
+
export { normalizeAssets, getAssetOutputPath };
|
|
3
6
|
export type FileEventType = 'create' | 'update' | 'delete';
|
|
4
7
|
export interface FileEvent {
|
|
5
8
|
type: FileEventType;
|
|
@@ -32,5 +35,4 @@ export declare class CopyAssetsHandler {
|
|
|
32
35
|
private filesToEvent;
|
|
33
36
|
private normalizeAssetPattern;
|
|
34
37
|
}
|
|
35
|
-
export {};
|
|
36
38
|
//# sourceMappingURL=copy-assets-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-assets-handler.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/utils/assets/copy-assets-handler.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"copy-assets-handler.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/utils/assets/copy-assets-handler.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,oBAAoB,IAAI,UAAU,EACnC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAgB,MAAM,6BAA6B,CAAC;AAGxE,YAAY,EAAE,UAAU,EAAE,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3D,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,uBAAuB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;IACzC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,eAAO,MAAM,uBAAuB,GAAI,QAAQ,SAAS,EAAE,SAiB1D,CAAC;AAEF,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAe;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4B;IACnD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgC;IACzD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAU;gBAElC,IAAI,EAAE,uBAAuB;IA2BnC,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAqB3C,wBAAwB,IAAI,IAAI;IAgBhC,OAAO,CAAC,yBAAyB;IAa3B,4BAA4B,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC;IA2BnD,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiC9D,OAAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,qBAAqB;CAG9B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CopyAssetsHandler = exports.defaultFileEventHandler = void 0;
|
|
3
|
+
exports.CopyAssetsHandler = exports.defaultFileEventHandler = exports.getAssetOutputPath = exports.normalizeAssets = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const picomatch = require("picomatch");
|
|
6
6
|
const node_fs_1 = require("node:fs");
|
|
@@ -8,6 +8,9 @@ const pathPosix = tslib_1.__importStar(require("node:path/posix"));
|
|
|
8
8
|
const path = tslib_1.__importStar(require("node:path"));
|
|
9
9
|
const ignore_1 = tslib_1.__importDefault(require("ignore"));
|
|
10
10
|
const tinyglobby_1 = require("tinyglobby");
|
|
11
|
+
const normalize_assets_1 = require("./normalize-assets");
|
|
12
|
+
Object.defineProperty(exports, "normalizeAssets", { enumerable: true, get: function () { return normalize_assets_1.normalizeAssets; } });
|
|
13
|
+
Object.defineProperty(exports, "getAssetOutputPath", { enumerable: true, get: function () { return normalize_assets_1.getAssetOutputPath; } });
|
|
11
14
|
const devkit_1 = require("@nx/devkit");
|
|
12
15
|
const client_1 = require("nx/src/daemon/client/client");
|
|
13
16
|
const picocolors_1 = require("picocolors");
|
|
@@ -49,40 +52,7 @@ class CopyAssetsHandler {
|
|
|
49
52
|
if ((0, node_fs_1.existsSync)(nxignore)) {
|
|
50
53
|
this.ignore.add((0, node_fs_1.readFileSync)(nxignore).toString());
|
|
51
54
|
}
|
|
52
|
-
this.assetGlobs = opts.assets.
|
|
53
|
-
let isGlob = false;
|
|
54
|
-
let pattern;
|
|
55
|
-
// Input and output directories are normalized to be relative to root
|
|
56
|
-
let input;
|
|
57
|
-
let output;
|
|
58
|
-
let ignore = null;
|
|
59
|
-
let includeIgnoredFiles = undefined;
|
|
60
|
-
const resolvedOutputDir = path.isAbsolute(opts.outputDir)
|
|
61
|
-
? opts.outputDir
|
|
62
|
-
: path.resolve(opts.rootDir, opts.outputDir);
|
|
63
|
-
if (typeof f === 'string') {
|
|
64
|
-
pattern = f;
|
|
65
|
-
input = path.relative(opts.rootDir, opts.projectDir);
|
|
66
|
-
output = path.relative(opts.rootDir, resolvedOutputDir);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
isGlob = true;
|
|
70
|
-
pattern = pathPosix.join(f.input, f.glob);
|
|
71
|
-
input = f.input;
|
|
72
|
-
output = pathPosix.join(path.relative(opts.rootDir, resolvedOutputDir), f.output);
|
|
73
|
-
if (f.ignore)
|
|
74
|
-
ignore = f.ignore.map((ig) => pathPosix.join(f.input, ig));
|
|
75
|
-
includeIgnoredFiles = f.includeIgnoredFiles;
|
|
76
|
-
}
|
|
77
|
-
return {
|
|
78
|
-
isGlob,
|
|
79
|
-
input,
|
|
80
|
-
pattern,
|
|
81
|
-
ignore,
|
|
82
|
-
output,
|
|
83
|
-
includeIgnoredFiles,
|
|
84
|
-
};
|
|
85
|
-
});
|
|
55
|
+
this.assetGlobs = (0, normalize_assets_1.normalizeAssets)(opts.assets, opts.rootDir, opts.projectDir, opts.outputDir);
|
|
86
56
|
}
|
|
87
57
|
async processAllAssetsOnce() {
|
|
88
58
|
await Promise.all(this.assetGlobs.map(async (ag) => {
|
|
@@ -181,12 +151,10 @@ class CopyAssetsHandler {
|
|
|
181
151
|
if (!assetGlob.ignore?.some((ig) => picomatch(ig)(src)) &&
|
|
182
152
|
((assetGlob.includeIgnoredFiles ?? this.includeIgnoredFiles) ||
|
|
183
153
|
!this.ignore.ignores(src))) {
|
|
184
|
-
const relPath = path.relative(assetGlob.input, src);
|
|
185
|
-
const dest = relPath.startsWith('..') ? src : relPath;
|
|
186
154
|
acc.push({
|
|
187
155
|
type: 'create',
|
|
188
156
|
src: path.join(this.rootDir, src),
|
|
189
|
-
dest: path.join(this.rootDir,
|
|
157
|
+
dest: path.join(this.rootDir, (0, normalize_assets_1.getAssetOutputPath)(src, assetGlob)),
|
|
190
158
|
});
|
|
191
159
|
}
|
|
192
160
|
return acc;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface AssetGlobInput {
|
|
2
|
+
input: string;
|
|
3
|
+
output: string;
|
|
4
|
+
glob: string;
|
|
5
|
+
ignore?: string[];
|
|
6
|
+
includeIgnoredFiles?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface NormalizedAssetEntry {
|
|
9
|
+
isGlob: boolean;
|
|
10
|
+
pattern: string;
|
|
11
|
+
ignore: string[] | null;
|
|
12
|
+
input: string;
|
|
13
|
+
output: string;
|
|
14
|
+
includeIgnoredFiles?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Normalize raw asset definitions (strings or objects) into resolved
|
|
18
|
+
* entries with computed input, output, and pattern fields.
|
|
19
|
+
*/
|
|
20
|
+
export declare function normalizeAssets(assets: (string | AssetGlobInput)[], rootDir: string, projectDir: string, outputDir: string): NormalizedAssetEntry[];
|
|
21
|
+
/**
|
|
22
|
+
* Compute the output path for a file given its asset entry,
|
|
23
|
+
* matching the dest logic used during file copying.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getAssetOutputPath(src: string, assetEntry: NormalizedAssetEntry): string;
|
|
26
|
+
//# sourceMappingURL=normalize-assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-assets.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/utils/assets/normalize-assets.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,CAAC,MAAM,GAAG,cAAc,CAAC,EAAE,EACnC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,oBAAoB,EAAE,CA8BxB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,oBAAoB,GAC/B,MAAM,CAIR"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeAssets = normalizeAssets;
|
|
4
|
+
exports.getAssetOutputPath = getAssetOutputPath;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const path = tslib_1.__importStar(require("node:path"));
|
|
7
|
+
const pathPosix = tslib_1.__importStar(require("node:path/posix"));
|
|
8
|
+
/**
|
|
9
|
+
* Normalize raw asset definitions (strings or objects) into resolved
|
|
10
|
+
* entries with computed input, output, and pattern fields.
|
|
11
|
+
*/
|
|
12
|
+
function normalizeAssets(assets, rootDir, projectDir, outputDir) {
|
|
13
|
+
const resolvedOutputDir = path.isAbsolute(outputDir)
|
|
14
|
+
? outputDir
|
|
15
|
+
: path.resolve(rootDir, outputDir);
|
|
16
|
+
return assets.map((f) => {
|
|
17
|
+
if (typeof f === 'string') {
|
|
18
|
+
return {
|
|
19
|
+
isGlob: false,
|
|
20
|
+
pattern: f,
|
|
21
|
+
input: path.relative(rootDir, projectDir),
|
|
22
|
+
output: path.relative(rootDir, resolvedOutputDir),
|
|
23
|
+
ignore: null,
|
|
24
|
+
includeIgnoredFiles: undefined,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
isGlob: true,
|
|
29
|
+
pattern: pathPosix.join(f.input, f.glob),
|
|
30
|
+
input: f.input,
|
|
31
|
+
output: pathPosix.join(path.relative(rootDir, resolvedOutputDir), f.output),
|
|
32
|
+
ignore: f.ignore
|
|
33
|
+
? f.ignore.map((ig) => pathPosix.join(f.input, ig))
|
|
34
|
+
: null,
|
|
35
|
+
includeIgnoredFiles: f.includeIgnoredFiles,
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Compute the output path for a file given its asset entry,
|
|
41
|
+
* matching the dest logic used during file copying.
|
|
42
|
+
*/
|
|
43
|
+
function getAssetOutputPath(src, assetEntry) {
|
|
44
|
+
const relPath = path.relative(assetEntry.input, src);
|
|
45
|
+
const dest = relPath.startsWith('..') ? src : relPath;
|
|
46
|
+
return pathPosix.join(assetEntry.output, dest);
|
|
47
|
+
}
|
|
@@ -150,7 +150,7 @@ function collectHelperDependencies(workspaceRoot, sourceProject, projectGraph, b
|
|
|
150
150
|
}
|
|
151
151
|
// For inferred targets or manually added run-commands, check if user is using `tsc` in build target.
|
|
152
152
|
if (target.executor === 'nx:run-commands' &&
|
|
153
|
-
/\
|
|
153
|
+
/\b(tsc|tsgo)\b/.test(target.options.command)) {
|
|
154
154
|
const tsConfigFileName = (0, ts_config_1.getRootTsConfigFileName)();
|
|
155
155
|
if (tsConfigFileName) {
|
|
156
156
|
const tsConfig = (0, ts_config_1.readTsConfig)((0, path_1.join)(workspaceRoot, tsConfigFileName));
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const swcHelpersVersion = "~0.5.18";
|
|
|
7
7
|
export declare const swcNodeVersion = "~1.11.1";
|
|
8
8
|
export declare const tsLibVersion = "^2.3.0";
|
|
9
9
|
export declare const typesNodeVersion = "20.19.9";
|
|
10
|
-
export declare const verdaccioVersion = "^6.
|
|
10
|
+
export declare const verdaccioVersion = "^6.3.2";
|
|
11
11
|
export declare const typescriptVersion = "~5.9.2";
|
|
12
12
|
/**
|
|
13
13
|
* The minimum version is currently determined from the lowest version
|
package/src/utils/versions.js
CHANGED
|
@@ -10,7 +10,7 @@ exports.swcHelpersVersion = '~0.5.18';
|
|
|
10
10
|
exports.swcNodeVersion = '~1.11.1';
|
|
11
11
|
exports.tsLibVersion = '^2.3.0';
|
|
12
12
|
exports.typesNodeVersion = '20.19.9';
|
|
13
|
-
exports.verdaccioVersion = '^6.
|
|
13
|
+
exports.verdaccioVersion = '^6.3.2';
|
|
14
14
|
// Typescript
|
|
15
15
|
exports.typescriptVersion = '~5.9.2';
|
|
16
16
|
/**
|