@nx/js 22.3.0-canary.20251211-205daee → 22.3.0-canary.20251215-e864b6a
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/node.impl.js +1 -1
- package/src/executors/release-publish/release-publish.impl.d.ts.map +1 -1
- package/src/executors/release-publish/release-publish.impl.js +16 -0
- package/src/executors/swc/swc.impl.js +2 -2
- package/src/plugins/typescript/plugin.d.ts +1 -0
- package/src/plugins/typescript/plugin.d.ts.map +1 -1
- package/src/plugins/typescript/plugin.js +9 -4
- package/src/utils/assets/copy-assets-handler.js +1 -1
- package/src/utils/swc/compile-swc.d.ts.map +1 -1
- package/src/utils/swc/compile-swc.js +5 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "22.3.0-canary.
|
|
3
|
+
"version": "22.3.0-canary.20251215-e864b6a",
|
|
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.3.0-canary.
|
|
43
|
-
"@nx/workspace": "22.3.0-canary.
|
|
42
|
+
"@nx/devkit": "22.3.0-canary.20251215-e864b6a",
|
|
43
|
+
"@nx/workspace": "22.3.0-canary.20251215-e864b6a",
|
|
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.3.0-canary.
|
|
63
|
+
"nx": "22.3.0-canary.20251215-e864b6a"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"verdaccio": "^6.0.5"
|
|
@@ -208,7 +208,7 @@ async function* nodeExecutor(options, context) {
|
|
|
208
208
|
const runBuild = async () => {
|
|
209
209
|
let childProcess = null;
|
|
210
210
|
const whenReady = new Promise(async (resolve) => {
|
|
211
|
-
childProcess = (0, child_process_1.fork)(require.resolve('nx'), [
|
|
211
|
+
childProcess = (0, child_process_1.fork)(require.resolve('nx/bin/nx.js'), [
|
|
212
212
|
'run',
|
|
213
213
|
`${context.projectName}:${buildTarget.target}${buildTarget.configuration ? `:${buildTarget.configuration}` : ''}`,
|
|
214
214
|
], {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-publish.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/release-publish/release-publish.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EAEhB,MAAM,YAAY,CAAC;AAQpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAiBjD,wBAA8B,WAAW,CACvC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,eAAe;;
|
|
1
|
+
{"version":3,"file":"release-publish.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/release-publish/release-publish.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EAEhB,MAAM,YAAY,CAAC;AAQpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAiBjD,wBAA8B,WAAW,CACvC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,eAAe;;GAsYzB"}
|
|
@@ -155,12 +155,20 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
|
|
|
155
155
|
!(err.stderr?.toString().includes('E404') &&
|
|
156
156
|
err.stderr?.toString().includes('no such package available'))) {
|
|
157
157
|
console.error('npm dist-tag add error:');
|
|
158
|
+
// npm returns error.summary and error.detail
|
|
158
159
|
if (stdoutData.error?.summary) {
|
|
159
160
|
console.error(stdoutData.error.summary);
|
|
160
161
|
}
|
|
161
162
|
if (stdoutData.error?.detail) {
|
|
162
163
|
console.error(stdoutData.error.detail);
|
|
163
164
|
}
|
|
165
|
+
// pnpm returns error.code and error.message
|
|
166
|
+
if (stdoutData.error?.code && !stdoutData.error?.summary) {
|
|
167
|
+
console.error(`Error code: ${stdoutData.error.code}`);
|
|
168
|
+
}
|
|
169
|
+
if (stdoutData.error?.message && !stdoutData.error?.summary) {
|
|
170
|
+
console.error(stdoutData.error.message);
|
|
171
|
+
}
|
|
164
172
|
if (context.isVerbose) {
|
|
165
173
|
console.error('npm dist-tag add stdout:');
|
|
166
174
|
console.error(JSON.stringify(stdoutData, null, 2));
|
|
@@ -285,12 +293,20 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
|
|
|
285
293
|
}
|
|
286
294
|
const stdoutData = JSON.parse(err.stdout?.toString() || '{}');
|
|
287
295
|
console.error(`${pm} publish error:`);
|
|
296
|
+
// npm returns error.summary and error.detail
|
|
288
297
|
if (stdoutData.error?.summary) {
|
|
289
298
|
console.error(stdoutData.error.summary);
|
|
290
299
|
}
|
|
291
300
|
if (stdoutData.error?.detail) {
|
|
292
301
|
console.error(stdoutData.error.detail);
|
|
293
302
|
}
|
|
303
|
+
// pnpm returns error.code and error.message
|
|
304
|
+
if (stdoutData.error?.code && !stdoutData.error?.summary) {
|
|
305
|
+
console.error(`Error code: ${stdoutData.error.code}`);
|
|
306
|
+
}
|
|
307
|
+
if (stdoutData.error?.message && !stdoutData.error?.summary) {
|
|
308
|
+
console.error(stdoutData.error.message);
|
|
309
|
+
}
|
|
294
310
|
if (context.isVerbose) {
|
|
295
311
|
console.error(`${pm} publish stdout:`);
|
|
296
312
|
console.error(JSON.stringify(stdoutData, null, 2));
|
|
@@ -77,8 +77,8 @@ async function* swcExecutor(_options, context) {
|
|
|
77
77
|
}
|
|
78
78
|
if (options.watch) {
|
|
79
79
|
let disposeFn;
|
|
80
|
-
process.on('SIGINT', () => disposeFn());
|
|
81
|
-
process.on('SIGTERM', () => disposeFn());
|
|
80
|
+
process.on('SIGINT', () => disposeFn?.());
|
|
81
|
+
process.on('SIGTERM', () => disposeFn?.());
|
|
82
82
|
return yield* (0, compile_swc_1.compileSwcWatch)(context, options, async () => {
|
|
83
83
|
const assetResult = await (0, assets_1.copyAssets)(options, context);
|
|
84
84
|
let packageJsonResult;
|
|
@@ -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;AAgCpB,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EACN,OAAO,GACP;QACE,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;
|
|
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;AAgCpB,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC1B,SAAS,CAAC,EACN,OAAO,GACP;QACE,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;AAmKD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAEF,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAI/C,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,gBAAgB,CA6EzD,CAAC;AAEF,eAAO,MAAM,WAAW,iCAAgB,CAAC"}
|
|
@@ -244,8 +244,9 @@ function buildTscTargets(config, options, context, configFiles) {
|
|
|
244
244
|
internalProjectReferences = resolveInternalProjectReferences(tsConfig, context.workspaceRoot, config.project);
|
|
245
245
|
const externalProjectReferences = resolveShallowExternalProjectReferences(tsConfig, context.workspaceRoot, config.project);
|
|
246
246
|
const targetName = options.typecheck.targetName;
|
|
247
|
+
const compiler = options.compiler;
|
|
247
248
|
if (!targets[targetName]) {
|
|
248
|
-
let command =
|
|
249
|
+
let command = `${compiler} --build --emitDeclarationOnly${options.verboseOutput ? ' --verbose' : ''}`;
|
|
249
250
|
if (tsConfig.options.noEmit ||
|
|
250
251
|
Object.values(internalProjectReferences).some((ref) => ref.options.noEmit) ||
|
|
251
252
|
Object.values(externalProjectReferences).some((ref) => ref.options.noEmit)) {
|
|
@@ -279,7 +280,7 @@ function buildTscTargets(config, options, context, configFiles) {
|
|
|
279
280
|
technologies: ['typescript'],
|
|
280
281
|
description: 'Runs type-checking for the project.',
|
|
281
282
|
help: {
|
|
282
|
-
command: `${pmc.exec}
|
|
283
|
+
command: `${pmc.exec} ${compiler} --build --help`,
|
|
283
284
|
example: {
|
|
284
285
|
args: ['--force'],
|
|
285
286
|
},
|
|
@@ -295,9 +296,10 @@ function buildTscTargets(config, options, context, configFiles) {
|
|
|
295
296
|
(0, util_1.isValidPackageJsonBuildConfig)(tsConfig, context.workspaceRoot, config.project.root))) {
|
|
296
297
|
internalProjectReferences ??= resolveInternalProjectReferences(tsConfig, context.workspaceRoot, config.project);
|
|
297
298
|
const targetName = options.build.targetName;
|
|
299
|
+
const compiler = options.compiler;
|
|
298
300
|
targets[targetName] = {
|
|
299
301
|
dependsOn: [`^${targetName}`],
|
|
300
|
-
command:
|
|
302
|
+
command: `${compiler} --build ${options.build.configName}${options.verboseOutput ? ' --verbose' : ''}`,
|
|
301
303
|
options: { cwd: config.project.root },
|
|
302
304
|
cache: true,
|
|
303
305
|
inputs: getInputs(namedInputs, config, tsConfig, internalProjectReferences, context.workspaceRoot),
|
|
@@ -309,7 +311,7 @@ function buildTscTargets(config, options, context, configFiles) {
|
|
|
309
311
|
technologies: ['typescript'],
|
|
310
312
|
description: 'Builds the project with `tsc`.',
|
|
311
313
|
help: {
|
|
312
|
-
command: `${pmc.exec}
|
|
314
|
+
command: `${pmc.exec} ${compiler} --build --help`,
|
|
313
315
|
example: {
|
|
314
316
|
args: ['--force'],
|
|
315
317
|
},
|
|
@@ -743,6 +745,8 @@ function readTsConfig(tsConfigPath, workspaceRoot) {
|
|
|
743
745
|
return ts.parseJsonConfigFileContent(readResult.config, tsSys, (0, node_path_1.dirname)(tsConfigPath));
|
|
744
746
|
}
|
|
745
747
|
function normalizePluginOptions(pluginOptions = {}) {
|
|
748
|
+
const defaultCompiler = 'tsc';
|
|
749
|
+
const compiler = pluginOptions.compiler ?? defaultCompiler;
|
|
746
750
|
const defaultTypecheckTargetName = 'typecheck';
|
|
747
751
|
let typecheck = {
|
|
748
752
|
targetName: defaultTypecheckTargetName,
|
|
@@ -779,6 +783,7 @@ function normalizePluginOptions(pluginOptions = {}) {
|
|
|
779
783
|
};
|
|
780
784
|
}
|
|
781
785
|
return {
|
|
786
|
+
compiler,
|
|
782
787
|
typecheck,
|
|
783
788
|
build,
|
|
784
789
|
verboseOutput: pluginOptions.verboseOutput ?? false,
|
|
@@ -27,7 +27,7 @@ const defaultFileEventHandler = (events) => {
|
|
|
27
27
|
}
|
|
28
28
|
const eventDir = path.dirname(event.src);
|
|
29
29
|
const relativeDest = path.relative(eventDir, event.dest);
|
|
30
|
-
devkit_1.logger.
|
|
30
|
+
devkit_1.logger.verbose(`\n${(0, picocolors_1.dim)(relativeDest)}`);
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
33
|
exports.defaultFileEventHandler = defaultFileEventHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-swc.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/utils/swc/compile-swc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,eAAe,EAAU,MAAM,YAAY,CAAC;AAK/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AAkEzD,wBAAsB,UAAU,CAC9B,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,4BAA4B,EAC/C,uBAAuB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;;;;;;
|
|
1
|
+
{"version":3,"file":"compile-swc.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/utils/swc/compile-swc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,eAAe,EAAU,MAAM,YAAY,CAAC;AAK/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AAkEzD,wBAAsB,UAAU,CAC9B,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,4BAA4B,EAC/C,uBAAuB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;;;;;;GA+C7C;AAED,wBAAuB,eAAe,CACpC,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,4BAA4B,EAC/C,uBAAuB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;aAcC,OAAO;aAAW,MAAM;aA+FtE"}
|
|
@@ -66,10 +66,13 @@ async function compileSwc(context, normalizedOptions, postCompilationCallback) {
|
|
|
66
66
|
devkit_1.logger.log(swcCmdLog.replace(/\n/, ''));
|
|
67
67
|
}
|
|
68
68
|
catch (error) {
|
|
69
|
-
devkit_1.logger.error(
|
|
70
|
-
if (error
|
|
69
|
+
devkit_1.logger.error(`SWC compilation failed: ${error?.message ?? error}`);
|
|
70
|
+
if (error?.stderr) {
|
|
71
71
|
devkit_1.logger.error(error.stderr.toString());
|
|
72
72
|
}
|
|
73
|
+
if (error?.stdout) {
|
|
74
|
+
devkit_1.logger.error(error.stdout.toString());
|
|
75
|
+
}
|
|
73
76
|
return { success: false };
|
|
74
77
|
}
|
|
75
78
|
if (normalizedOptions.skipTypeCheck && !normalizedOptions.isTsSolutionSetup) {
|