@nx/js 22.3.3 → 22.4.0-beta.1
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.d.ts.map +1 -1
- package/src/executors/node/node.impl.js +10 -2
- package/src/executors/tsc/lib/batch/watch.d.ts.map +1 -1
- package/src/executors/tsc/lib/batch/watch.js +20 -4
- package/src/utils/assets/copy-assets-handler.d.ts.map +1 -1
- package/src/utils/assets/copy-assets-handler.js +10 -2
- package/src/utils/typescript/plugin.d.ts +0 -1
- package/src/utils/typescript/plugin.d.ts.map +1 -1
- package/src/utils/typescript/plugin.js +8 -35
- package/src/utils/watch-for-single-file-changes.d.ts.map +1 -1
- package/src/utils/watch-for-single-file-changes.js +10 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.4.0-beta.1",
|
|
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.
|
|
43
|
-
"@nx/workspace": "22.
|
|
42
|
+
"@nx/devkit": "22.4.0-beta.1",
|
|
43
|
+
"@nx/workspace": "22.4.0-beta.1",
|
|
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.
|
|
63
|
+
"nx": "22.4.0-beta.1"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"verdaccio": "^6.0.5"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/node/node.impl.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EAQhB,MAAM,YAAY,CAAC;AAOpB,OAAO,EAAe,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAqB5D,wBAAuB,YAAY,CACjC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,eAAe;aAgEb,OAAO;cACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"node.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/node/node.impl.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EAQhB,MAAM,YAAY,CAAC;AAOpB,OAAO,EAAe,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAqB5D,wBAAuB,YAAY,CACjC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,eAAe;aAgEb,OAAO;cACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;cA6QhC;AA+HD,eAAe,YAAY,CAAC"}
|
|
@@ -231,8 +231,16 @@ async function* nodeExecutor(options, context) {
|
|
|
231
231
|
watchProjects: [context.projectName],
|
|
232
232
|
includeDependentProjects: true,
|
|
233
233
|
}, async (err, data) => {
|
|
234
|
-
if (err === '
|
|
235
|
-
|
|
234
|
+
if (err === 'reconnecting') {
|
|
235
|
+
// Silent - daemon restarts automatically on lockfile changes
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
else if (err === 'reconnected') {
|
|
239
|
+
// Silent - reconnection succeeded
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
else if (err === 'closed') {
|
|
243
|
+
devkit_1.logger.error(`Failed to reconnect to daemon after multiple attempts`);
|
|
236
244
|
process.exit(1);
|
|
237
245
|
}
|
|
238
246
|
else if (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/js/src/executors/tsc/lib/batch/watch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,wBAAsB,uCAAuC,CAC3D,SAAS,EAAE,QAAQ,EAAE,EACrB,QAAQ,EAAE,CAAC,gBAAgB,EAAE,QAAQ,EAAE,KAAK,IAAI,GAC/C,OAAO,CAAC,MAAM,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/js/src/executors/tsc/lib/batch/watch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,wBAAsB,uCAAuC,CAC3D,SAAS,EAAE,QAAQ,EAAE,EACrB,QAAQ,EAAE,CAAC,gBAAgB,EAAE,QAAQ,EAAE,KAAK,IAAI,GAC/C,OAAO,CAAC,MAAM,IAAI,CAAC,CAsCrB;AAED,wBAAsB,qCAAqC,CACzD,SAAS,EAAE,QAAQ,EAAE,GACpB,OAAO,CAAC,MAAM,IAAI,CAAC,CA4BrB"}
|
|
@@ -13,8 +13,16 @@ async function watchTaskProjectsPackageJsonFileChanges(taskInfos, callback) {
|
|
|
13
13
|
packageJsonTaskInfoMap.set((0, path_1.join)(t.options.projectRoot, 'package.json'), t);
|
|
14
14
|
});
|
|
15
15
|
const unregisterFileWatcher = await client_1.daemonClient.registerFileWatcher({ watchProjects: projects }, (err, data) => {
|
|
16
|
-
if (err === '
|
|
17
|
-
|
|
16
|
+
if (err === 'reconnecting') {
|
|
17
|
+
// Silent - daemon restarts automatically on lockfile changes
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
else if (err === 'reconnected') {
|
|
21
|
+
// Silent - reconnection succeeded
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
else if (err === 'closed') {
|
|
25
|
+
devkit_1.logger.error(`Failed to reconnect to daemon after multiple attempts`);
|
|
18
26
|
process.exit(1);
|
|
19
27
|
}
|
|
20
28
|
else if (err) {
|
|
@@ -40,8 +48,16 @@ async function watchTaskProjectsFileChangesForAssets(taskInfos) {
|
|
|
40
48
|
includeDependentProjects: true,
|
|
41
49
|
includeGlobalWorkspaceFiles: true,
|
|
42
50
|
}, (err, data) => {
|
|
43
|
-
if (err === '
|
|
44
|
-
|
|
51
|
+
if (err === 'reconnecting') {
|
|
52
|
+
// Silent - daemon restarts automatically on lockfile changes
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
else if (err === 'reconnected') {
|
|
56
|
+
// Silent - reconnection succeeded
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
else if (err === 'closed') {
|
|
60
|
+
devkit_1.logger.error(`Failed to reconnect to daemon after multiple attempts`);
|
|
45
61
|
process.exit(1);
|
|
46
62
|
}
|
|
47
63
|
else if (err) {
|
|
@@ -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;AAErC,OAAO,EAAE,WAAW,EAAgB,MAAM,6BAA6B,CAAC;AAGxE,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,SAA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AC;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;AAWD,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;IA2DnC,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;IAmBpB,OAAO,CAAC,qBAAqB;CAG9B"}
|
|
@@ -126,8 +126,16 @@ class CopyAssetsHandler {
|
|
|
126
126
|
watchProjects: 'all',
|
|
127
127
|
includeGlobalWorkspaceFiles: true,
|
|
128
128
|
}, (err, data) => {
|
|
129
|
-
if (err === '
|
|
130
|
-
|
|
129
|
+
if (err === 'reconnecting') {
|
|
130
|
+
// Silent - daemon restarts automatically on lockfile changes
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
else if (err === 'reconnected') {
|
|
134
|
+
// Silent - reconnection succeeded
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
else if (err === 'closed') {
|
|
138
|
+
devkit_1.logger.error(`Failed to reconnect to daemon after multiple attempts`);
|
|
131
139
|
process.exit(1);
|
|
132
140
|
}
|
|
133
141
|
else if (err) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { NxJsonConfiguration } from '@nx/devkit';
|
|
2
2
|
export declare function ensureProjectIsIncludedInPluginRegistrations(nxJson: NxJsonConfiguration, projectRoot: string, buildTargetName: string | null): void;
|
|
3
|
-
export declare function ensureProjectIsExcludedFromPluginRegistrations(nxJson: NxJsonConfiguration, projectRoot: string): void;
|
|
4
3
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/utils/typescript/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAIpB,wBAAgB,4CAA4C,CAC1D,MAAM,EAAE,mBAAmB,EAC3B,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GAAG,IAAI,GAC7B,IAAI,CAmGN
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/utils/typescript/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAIpB,wBAAgB,4CAA4C,CAC1D,MAAM,EAAE,mBAAmB,EAC3B,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GAAG,IAAI,GAC7B,IAAI,CAmGN"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ensureProjectIsIncludedInPluginRegistrations = ensureProjectIsIncludedInPluginRegistrations;
|
|
4
|
-
exports.ensureProjectIsExcludedFromPluginRegistrations = ensureProjectIsExcludedFromPluginRegistrations;
|
|
5
4
|
const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
6
5
|
function ensureProjectIsIncludedInPluginRegistrations(nxJson, projectRoot, buildTargetName) {
|
|
7
6
|
nxJson.plugins ??= [];
|
|
@@ -14,7 +13,7 @@ function ensureProjectIsIncludedInPluginRegistrations(nxJson, projectRoot, build
|
|
|
14
13
|
}
|
|
15
14
|
if (typeof registration === 'string') {
|
|
16
15
|
if (buildTargetName) {
|
|
17
|
-
// if it's a string all projects are included but
|
|
16
|
+
// if it's a string all projects are included but there are no user-specified options
|
|
18
17
|
// and the build task is not inferred by default, so we need to exclude it
|
|
19
18
|
nxJson.plugins[index] = {
|
|
20
19
|
plugin: '@nx/js/typescript',
|
|
@@ -87,38 +86,6 @@ function ensureProjectIsIncludedInPluginRegistrations(nxJson, projectRoot, build
|
|
|
87
86
|
nxJson.plugins.push(registration);
|
|
88
87
|
}
|
|
89
88
|
}
|
|
90
|
-
function ensureProjectIsExcludedFromPluginRegistrations(nxJson, projectRoot) {
|
|
91
|
-
if (!nxJson.plugins?.length ||
|
|
92
|
-
!nxJson.plugins.some(isTypeScriptPluginRegistration)) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
let index = 0;
|
|
96
|
-
for (const registration of nxJson.plugins) {
|
|
97
|
-
if (!isTypeScriptPluginRegistration(registration)) {
|
|
98
|
-
index++;
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
if (typeof registration === 'string') {
|
|
102
|
-
// if it's a string, it includes all projects, so we need to exclude it
|
|
103
|
-
nxJson.plugins[index] = {
|
|
104
|
-
plugin: '@nx/js/typescript',
|
|
105
|
-
exclude: [`${projectRoot}/*`],
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
// check if the project would be included by the plugin registration
|
|
110
|
-
const matchingConfigFiles = (0, devkit_internals_1.findMatchingConfigFiles)([`${projectRoot}/tsconfig.json`], '**/tsconfig.json', registration.include, registration.exclude);
|
|
111
|
-
if (matchingConfigFiles.length &&
|
|
112
|
-
(registration.options?.typecheck !== false ||
|
|
113
|
-
registration.options?.build)) {
|
|
114
|
-
// the project is included by a plugin registration that infers any of the targets, so we need to exclude it
|
|
115
|
-
registration.exclude ??= [];
|
|
116
|
-
registration.exclude.push(`${projectRoot}/*`);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
index++;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
89
|
function isTypeScriptPluginRegistration(plugin) {
|
|
123
90
|
return ((typeof plugin === 'string' && plugin === '@nx/js/typescript') ||
|
|
124
91
|
(typeof plugin !== 'string' && plugin.plugin === '@nx/js/typescript'));
|
|
@@ -128,7 +95,13 @@ function matchesBuildTargetDefinition(buildOptions, buildTargetName) {
|
|
|
128
95
|
return !buildTargetName;
|
|
129
96
|
}
|
|
130
97
|
if (!buildTargetName) {
|
|
131
|
-
|
|
98
|
+
// we don't want a build target to be inferred, in which case we'll generate
|
|
99
|
+
// the package.json with the entry points pointing to source, so, as long as
|
|
100
|
+
// we don't skip the build check, this registration is valid even if it has
|
|
101
|
+
// build options defined
|
|
102
|
+
return typeof buildOptions === 'object'
|
|
103
|
+
? !buildOptions.skipBuildCheck
|
|
104
|
+
: true;
|
|
132
105
|
}
|
|
133
106
|
if (buildOptions === true && buildTargetName === 'build') {
|
|
134
107
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch-for-single-file-changes.d.ts","sourceRoot":"","sources":["../../../../../packages/js/src/utils/watch-for-single-file-changes.ts"],"names":[],"mappings":"AAIA,wBAAsB,yBAAyB,CAC7C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,MAAM,IAAI,GACnB,OAAO,CAAC,MAAM,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"watch-for-single-file-changes.d.ts","sourceRoot":"","sources":["../../../../../packages/js/src/utils/watch-for-single-file-changes.ts"],"names":[],"mappings":"AAIA,wBAAsB,yBAAyB,CAC7C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,MAAM,IAAI,GACnB,OAAO,CAAC,MAAM,IAAI,CAAC,CA0BrB"}
|
|
@@ -6,8 +6,16 @@ const client_1 = require("nx/src/daemon/client/client");
|
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
async function watchForSingleFileChanges(projectName, projectRoot, relativeFilePath, callback) {
|
|
8
8
|
const unregisterFileWatcher = await client_1.daemonClient.registerFileWatcher({ watchProjects: [projectName] }, (err, data) => {
|
|
9
|
-
if (err === '
|
|
10
|
-
|
|
9
|
+
if (err === 'reconnecting') {
|
|
10
|
+
// Silent - daemon restarts automatically on lockfile changes
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
else if (err === 'reconnected') {
|
|
14
|
+
// Silent - reconnection succeeded
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
else if (err === 'closed') {
|
|
18
|
+
devkit_1.logger.error(`Failed to reconnect to daemon after multiple attempts`);
|
|
11
19
|
process.exit(1);
|
|
12
20
|
}
|
|
13
21
|
else if (err) {
|