@nx/js 22.6.3 → 22.6.5
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 +5 -5
- package/src/generators/library/library.d.ts.map +1 -1
- package/src/generators/library/library.js +2 -1
- package/src/generators/setup-verdaccio/generator.d.ts.map +1 -1
- package/src/generators/setup-verdaccio/generator.js +2 -6
- package/src/plugins/jest/start-local-registry.js +1 -1
- package/src/plugins/typescript/plugin.d.ts.map +1 -1
- package/src/plugins/typescript/plugin.js +29 -28
- package/src/utils/find-npm-dependencies.js +1 -1
- package/src/utils/versions.d.ts +2 -2
- package/src/utils/versions.js +2 -2
package/migrations.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "22.6.
|
|
3
|
+
"version": "22.6.5",
|
|
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.
|
|
43
|
-
"@nx/workspace": "22.6.
|
|
42
|
+
"@nx/devkit": "22.6.5",
|
|
43
|
+
"@nx/workspace": "22.6.5",
|
|
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",
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"jsonc-parser": "3.2.0",
|
|
54
54
|
"npm-run-path": "^4.0.1",
|
|
55
55
|
"picocolors": "^1.1.0",
|
|
56
|
-
"picomatch": "4.0.
|
|
56
|
+
"picomatch": "4.0.4",
|
|
57
57
|
"semver": "^7.6.3",
|
|
58
58
|
"source-map-support": "0.5.19",
|
|
59
59
|
"tinyglobby": "^0.2.12",
|
|
60
60
|
"tslib": "^2.3.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"nx": "22.6.
|
|
63
|
+
"nx": "22.6.5"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"verdaccio": "^6.0.5"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/library/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,iBAAiB,
|
|
1
|
+
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/library/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,iBAAiB,EAWjB,IAAI,EAKL,MAAM,YAAY,CAAC;AAyCpB,OAAO,KAAK,EAEV,sBAAsB,EACtB,iCAAiC,EAClC,MAAM,UAAU,CAAC;AASlB,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,sBAAsB,8BAO/B;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,sBAAsB,8BAqK/B;AA2HD,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,iCAAiC,EAC/B,MAAM,GACN,QAAQ,GACR,aAAa,GACb,gBAAgB,GAChB,IAAI,GACJ,yBAAyB,GACzB,aAAa,GACb,SAAS,GACT,WAAW,GACX,yBAAyB,CAC5B,CAAC;AAEF,wBAAsB,OAAO,CAC3B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,iBAAiB,CAAC,CA4G5B;AA+uBD,eAAe,gBAAgB,CAAC"}
|
|
@@ -649,7 +649,8 @@ function addProjectDependencies(tree, options) {
|
|
|
649
649
|
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
650
650
|
'@nx/esbuild': versions_1.nxVersion,
|
|
651
651
|
'@types/node': versions_1.typesNodeVersion,
|
|
652
|
-
esbuild:
|
|
652
|
+
esbuild: (0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'esbuild') ??
|
|
653
|
+
versions_1.esbuildVersion,
|
|
653
654
|
});
|
|
654
655
|
}
|
|
655
656
|
else if (options.bundler == 'rollup') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/setup-verdaccio/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,IAAI,EAEL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAKzD,wBAAsB,cAAc,CAClC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,6BAA6B,
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/setup-verdaccio/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,IAAI,EAEL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAKzD,wBAAsB,cAAc,CAClC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,6BAA6B,mDA0DvC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -5,15 +5,11 @@ const devkit_1 = require("@nx/devkit");
|
|
|
5
5
|
const path = require("path");
|
|
6
6
|
const ts_solution_setup_1 = require("../../utils/typescript/ts-solution-setup");
|
|
7
7
|
const versions_1 = require("../../utils/versions");
|
|
8
|
-
const
|
|
8
|
+
const npm_config_1 = require("../../utils/npm-config");
|
|
9
9
|
async function setupVerdaccio(tree, options) {
|
|
10
10
|
if (!tree.exists('.verdaccio/config.yml')) {
|
|
11
11
|
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), '.verdaccio', {
|
|
12
|
-
npmUplinkRegistry: (0,
|
|
13
|
-
windowsHide: true,
|
|
14
|
-
})
|
|
15
|
-
?.toString()
|
|
16
|
-
?.trim() ?? 'https://registry.npmjs.org',
|
|
12
|
+
npmUplinkRegistry: (await (0, npm_config_1.getNpmRegistry)(tree.root)) ?? 'https://registry.npmjs.org',
|
|
17
13
|
});
|
|
18
14
|
}
|
|
19
15
|
const verdaccioTarget = {
|
|
@@ -17,7 +17,7 @@ function startLocalRegistry({ localRegistryTarget, storage, verbose, clearStorag
|
|
|
17
17
|
throw new Error(`localRegistryTarget is required`);
|
|
18
18
|
}
|
|
19
19
|
return new Promise((resolve, reject) => {
|
|
20
|
-
const childProcess = (0, child_process_1.fork)(require.resolve('nx'), [
|
|
20
|
+
const childProcess = (0, child_process_1.fork)(require.resolve('nx/bin/nx'), [
|
|
21
21
|
...`run ${localRegistryTarget} --location none --clear ${clearStorage ?? true}`.split(' '),
|
|
22
22
|
...(storage ? [`--storage`, storage] : []),
|
|
23
23
|
], { stdio: 'pipe' });
|
|
@@ -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;AA0KD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAEF,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAI/C,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,gBAAgB,CA8FzD,CAAC;AAEF,eAAO,MAAM,WAAW,iCAAgB,CAAC"}
|
|
@@ -12,7 +12,6 @@ const lock_file_1 = require("nx/src/plugins/js/lock-file/lock-file");
|
|
|
12
12
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
13
13
|
const util_1 = require("./util");
|
|
14
14
|
let ts;
|
|
15
|
-
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
|
16
15
|
const TSCONFIG_CACHE_VERSION = 2;
|
|
17
16
|
const TS_CONFIG_CACHE_PATH = (0, node_path_1.join)(cache_directory_1.workspaceDataDirectory, 'tsconfig-files.hash');
|
|
18
17
|
// Module-level cache store — each invocation gets a unique Symbol key
|
|
@@ -123,6 +122,7 @@ exports.createNodesV2 = [
|
|
|
123
122
|
const cache = cacheStore.get(cacheKey);
|
|
124
123
|
initializeTsConfigCache(configFilePaths, context.workspaceRoot, cache);
|
|
125
124
|
const normalizedOptions = normalizePluginOptions(options);
|
|
125
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
|
|
126
126
|
const { configFilePaths: validConfigFilePaths, hashes, projectRoots, } = await resolveValidConfigFilesAndHashes(configFilePaths, normalizedOptions, optionsHash, context, cache);
|
|
127
127
|
try {
|
|
128
128
|
return await (0, devkit_1.createNodesFromFiles)((configFilePath, options, context, idx) => {
|
|
@@ -131,7 +131,7 @@ exports.createNodesV2 = [
|
|
|
131
131
|
const targetsCacheKey = `${hash}_${configFilePath}`;
|
|
132
132
|
const absolutePath = (0, node_path_1.join)(context.workspaceRoot, configFilePath);
|
|
133
133
|
const configContext = getConfigContext(absolutePath, context.workspaceRoot, cache);
|
|
134
|
-
targetsCache[targetsCacheKey] ??= buildTscTargets(configContext, options, context, validConfigFilePaths, cache);
|
|
134
|
+
targetsCache[targetsCacheKey] ??= buildTscTargets(configContext, options, context, validConfigFilePaths, cache, pmc);
|
|
135
135
|
const { targets } = targetsCache[targetsCacheKey];
|
|
136
136
|
return {
|
|
137
137
|
projects: {
|
|
@@ -244,7 +244,7 @@ function checkIfConfigFileShouldBeProject(config, cache) {
|
|
|
244
244
|
}
|
|
245
245
|
return true;
|
|
246
246
|
}
|
|
247
|
-
function buildTscTargets(config, options, context, configFiles, cache) {
|
|
247
|
+
function buildTscTargets(config, options, context, configFiles, cache, pmc) {
|
|
248
248
|
const targets = {};
|
|
249
249
|
const namedInputs = (0, get_named_inputs_1.getNamedInputs)(config.project.root, context);
|
|
250
250
|
const tsConfig = retrieveTsConfigFromCache(config.absolutePath, context.workspaceRoot, cache);
|
|
@@ -496,10 +496,6 @@ function getOutputs(config, rootTsConfig, internalProjectReferences, workspaceRo
|
|
|
496
496
|
outputs.add(pathToInputOrOutput((0, devkit_1.joinPathFragments)(outDir, `${outFileName}.js.map`), workspaceRoot, config.project));
|
|
497
497
|
outputs.add(pathToInputOrOutput((0, devkit_1.joinPathFragments)(outDir, `${outFileName}.d.ts`), workspaceRoot, config.project));
|
|
498
498
|
outputs.add(pathToInputOrOutput((0, devkit_1.joinPathFragments)(outDir, `${outFileName}.d.ts.map`), workspaceRoot, config.project));
|
|
499
|
-
// https://www.typescriptlang.org/tsconfig#tsBuildInfoFile
|
|
500
|
-
outputs.add(tsConfig.options.tsBuildInfoFile
|
|
501
|
-
? pathToInputOrOutput(tsConfig.options.tsBuildInfoFile, workspaceRoot, config.project)
|
|
502
|
-
: pathToInputOrOutput((0, devkit_1.joinPathFragments)(outDir, `${outFileName}.tsbuildinfo`), workspaceRoot, config.project));
|
|
503
499
|
}
|
|
504
500
|
else if (tsConfig.options.outDir) {
|
|
505
501
|
if (emitDeclarationOnly) {
|
|
@@ -509,23 +505,12 @@ function getOutputs(config, rootTsConfig, internalProjectReferences, workspaceRo
|
|
|
509
505
|
}
|
|
510
506
|
}
|
|
511
507
|
else {
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
outputs.add(pathToInputOrOutput(tsConfig.options.tsBuildInfoFile, workspaceRoot, config.project));
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
else if (tsConfig.options.rootDir && tsConfig.options.rootDir !== '.') {
|
|
522
|
-
// If rootDir is set, then the tsbuildinfo file will be outside the outDir so we need to add it.
|
|
523
|
-
const relativeRootDir = (0, node_path_1.relative)(tsConfig.options.rootDir, (0, node_path_1.join)(workspaceRoot, config.project.root));
|
|
524
|
-
outputs.add(pathToInputOrOutput((0, devkit_1.joinPathFragments)(tsConfig.options.outDir, relativeRootDir, `*.tsbuildinfo`), workspaceRoot, config.project));
|
|
525
|
-
}
|
|
526
|
-
else if (emitDeclarationOnly) {
|
|
527
|
-
// https://www.typescriptlang.org/tsconfig#tsBuildInfoFile
|
|
528
|
-
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));
|
|
529
514
|
}
|
|
530
515
|
}
|
|
531
516
|
else if (tsConfig.raw?.include?.length ||
|
|
@@ -544,14 +529,30 @@ function getOutputs(config, rootTsConfig, internalProjectReferences, workspaceRo
|
|
|
544
529
|
outputs.add((0, devkit_1.joinPathFragments)('{projectRoot}', '**/*.d.ts.map'));
|
|
545
530
|
outputs.add((0, devkit_1.joinPathFragments)('{projectRoot}', '**/*.d.cts.map'));
|
|
546
531
|
outputs.add((0, devkit_1.joinPathFragments)('{projectRoot}', '**/*.d.mts.map'));
|
|
547
|
-
// https://www.typescriptlang.org/tsconfig#tsBuildInfoFile
|
|
548
|
-
outputs.add(tsConfig.options.tsBuildInfoFile
|
|
549
|
-
? pathToInputOrOutput(tsConfig.options.tsBuildInfoFile, workspaceRoot, config.project)
|
|
550
|
-
: (0, devkit_1.joinPathFragments)('{projectRoot}', `${configBaseNameNoExt}.tsbuildinfo`));
|
|
551
532
|
}
|
|
533
|
+
// tsc --build always produces a tsbuildinfo file.
|
|
534
|
+
outputs.add(getTsBuildInfoOutputPath(tsConfig, configBaseNameNoExt, workspaceRoot, config.project));
|
|
552
535
|
});
|
|
553
536
|
return Array.from(outputs);
|
|
554
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
|
+
}
|
|
555
556
|
function pathToInputOrOutput(path, workspaceRoot, project) {
|
|
556
557
|
const fullProjectRoot = project.absolute;
|
|
557
558
|
const fullPath = (0, node_path_1.resolve)(workspaceRoot, path);
|
|
@@ -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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const esbuildVersion = "^0.
|
|
2
|
+
export declare const esbuildVersion = "^0.27.0";
|
|
3
3
|
export declare const prettierVersion = "~3.6.2";
|
|
4
4
|
export declare const swcCliVersion = "~0.8.0";
|
|
5
5
|
export declare const swcCoreVersion = "~1.15.5";
|
|
@@ -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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.supportedTypescriptVersions = exports.typescriptVersion = exports.verdaccioVersion = exports.typesNodeVersion = exports.tsLibVersion = exports.swcNodeVersion = exports.swcHelpersVersion = exports.swcCoreVersion = exports.swcCliVersion = exports.prettierVersion = exports.esbuildVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
-
exports.esbuildVersion = '^0.
|
|
5
|
+
exports.esbuildVersion = '^0.27.0';
|
|
6
6
|
exports.prettierVersion = '~3.6.2';
|
|
7
7
|
exports.swcCliVersion = '~0.8.0';
|
|
8
8
|
exports.swcCoreVersion = '~1.15.5';
|
|
@@ -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
|
/**
|