@nx/js 19.4.0 → 19.5.0-beta.0
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": "19.
|
|
3
|
+
"version": "19.5.0-beta.0",
|
|
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": {
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"semver": "^7.5.3",
|
|
59
59
|
"source-map-support": "0.5.19",
|
|
60
60
|
"tslib": "^2.3.0",
|
|
61
|
-
"@nx/devkit": "19.
|
|
62
|
-
"@nx/workspace": "19.
|
|
63
|
-
"@nrwl/js": "19.
|
|
61
|
+
"@nx/devkit": "19.5.0-beta.0",
|
|
62
|
+
"@nx/workspace": "19.5.0-beta.0",
|
|
63
|
+
"@nrwl/js": "19.5.0-beta.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"verdaccio": "^5.0.4"
|
|
@@ -188,22 +188,27 @@ async function* nodeExecutor(options, context) {
|
|
|
188
188
|
await addToQueue(childProcess, whenReady);
|
|
189
189
|
await debouncedProcessQueue();
|
|
190
190
|
};
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
191
|
+
if ((0, devkit_1.isDaemonEnabled)()) {
|
|
192
|
+
additionalExitHandler = await client_1.daemonClient.registerFileWatcher({
|
|
193
|
+
watchProjects: [context.projectName],
|
|
194
|
+
includeDependentProjects: true,
|
|
195
|
+
}, async (err, data) => {
|
|
196
|
+
if (err === 'closed') {
|
|
197
|
+
devkit_1.logger.error(`Watch error: Daemon closed the connection`);
|
|
198
|
+
process.exit(1);
|
|
199
|
+
}
|
|
200
|
+
else if (err) {
|
|
201
|
+
devkit_1.logger.error(`Watch error: ${err?.message ?? 'Unknown'}`);
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
devkit_1.logger.info(`NX File change detected. Restarting...`);
|
|
205
|
+
await runBuild();
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
devkit_1.logger.warn(`NX Daemon is not running. Node process will not restart automatically after file changes.`);
|
|
211
|
+
}
|
|
207
212
|
await runBuild(); // run first build
|
|
208
213
|
}
|
|
209
214
|
else {
|
|
@@ -66,7 +66,12 @@ async function* tscBatchExecutor(taskGraph, inputs, overrides, context) {
|
|
|
66
66
|
},
|
|
67
67
|
afterProjectCompilationCallback: processTaskPostCompilation,
|
|
68
68
|
});
|
|
69
|
-
if (shouldWatch) {
|
|
69
|
+
if (shouldWatch && !(0, devkit_1.isDaemonEnabled)()) {
|
|
70
|
+
devkit_1.output.warn({
|
|
71
|
+
title: 'Nx Daemon is not enabled. Assets and package.json files will not be updated on file changes.',
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
if (shouldWatch && (0, devkit_1.isDaemonEnabled)()) {
|
|
70
75
|
const taskInfos = Object.values(tsConfigTaskInfoMap);
|
|
71
76
|
const watchAssetsChangesDisposer = await (0, batch_1.watchTaskProjectsFileChangesForAssets)(taskInfos);
|
|
72
77
|
const watchProjectsChangesDisposer = await (0, batch_1.watchTaskProjectsPackageJsonFileChanges)(taskInfos, (changedTaskInfos) => {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.tscExecutor = exports.createTypeScriptCompilationOptions = exports.determineModuleFormatFromTsConfig = void 0;
|
|
4
4
|
const ts = require("typescript");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
6
|
const copy_assets_handler_1 = require("../../utils/assets/copy-assets-handler");
|
|
6
7
|
const check_dependencies_1 = require("../../utils/check-dependencies");
|
|
7
8
|
const compiler_helper_dependency_1 = require("../../utils/compiler-helper-dependency");
|
|
@@ -72,7 +73,12 @@ async function* tscExecutor(_options, context) {
|
|
|
72
73
|
}, context, target, dependencies);
|
|
73
74
|
(0, inline_1.postProcessInlinedDependencies)(tsCompilationOptions.outputPath, tsCompilationOptions.projectRoot, inlineProjectGraph);
|
|
74
75
|
});
|
|
75
|
-
if (options.watch) {
|
|
76
|
+
if (!(0, devkit_1.isDaemonEnabled)() && options.watch) {
|
|
77
|
+
devkit_1.output.warn({
|
|
78
|
+
title: 'Nx Daemon is not enabled. Assets and package.json files will not be updated when files change.',
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
if ((0, devkit_1.isDaemonEnabled)() && options.watch) {
|
|
76
82
|
const disposeWatchAssetChanges = await assetHandler.watchAndProcessOnAssetChange();
|
|
77
83
|
const disposePackageJsonChanges = await (0, watch_for_single_file_changes_1.watchForSingleFileChanges)(context.projectName, options.projectRoot, 'package.json', () => (0, update_package_json_1.updatePackageJson)({
|
|
78
84
|
...options,
|
|
@@ -145,7 +145,7 @@ function getInputs(namedInputs, configFilePath, tsConfig, internalProjectReferen
|
|
|
145
145
|
});
|
|
146
146
|
const inputs = [];
|
|
147
147
|
if (includePaths.size) {
|
|
148
|
-
inputs.push(...Array.from(configFiles).map((p) => pathToInputOrOutput(p, workspaceRoot, projectRoot)), ...Array.from(includePaths).map((p) => (0, devkit_1.joinPathFragments)(
|
|
148
|
+
inputs.push(...Array.from(configFiles).map((p) => pathToInputOrOutput(p, workspaceRoot, projectRoot)), ...Array.from(includePaths).map((p) => pathToInputOrOutput((0, devkit_1.joinPathFragments)(projectRoot, p), workspaceRoot, projectRoot)));
|
|
149
149
|
}
|
|
150
150
|
else {
|
|
151
151
|
// If we couldn't identify any include paths, we default to the default
|
|
@@ -153,7 +153,7 @@ function getInputs(namedInputs, configFilePath, tsConfig, internalProjectReferen
|
|
|
153
153
|
inputs.push('production' in namedInputs ? 'production' : 'default');
|
|
154
154
|
}
|
|
155
155
|
if (excludePaths.size) {
|
|
156
|
-
inputs.push(...Array.from(excludePaths).map((p) => `!${(0, devkit_1.joinPathFragments)(
|
|
156
|
+
inputs.push(...Array.from(excludePaths).map((p) => `!${pathToInputOrOutput((0, devkit_1.joinPathFragments)(projectRoot, p), workspaceRoot, projectRoot)}`));
|
|
157
157
|
}
|
|
158
158
|
if (hasExternalProjectReferences(configFilePath, tsConfig)) {
|
|
159
159
|
// Importing modules from a referenced project will load its output declaration files (d.ts)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.copyAssets = void 0;
|
|
4
4
|
const copy_assets_handler_1 = require("./copy-assets-handler");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
6
|
async function copyAssets(options, context) {
|
|
6
7
|
const assetHandler = new copy_assets_handler_1.CopyAssetsHandler({
|
|
7
8
|
projectDir: context.projectsConfigurations.projects[context.projectName].root,
|
|
@@ -13,7 +14,12 @@ async function copyAssets(options, context) {
|
|
|
13
14
|
const result = {
|
|
14
15
|
success: true,
|
|
15
16
|
};
|
|
16
|
-
if (options.watch) {
|
|
17
|
+
if (!(0, devkit_1.isDaemonEnabled)() && options.watch) {
|
|
18
|
+
devkit_1.output.warn({
|
|
19
|
+
title: 'Nx Daemon is not enabled. Assets will not be updated when they are changed.',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if ((0, devkit_1.isDaemonEnabled)() && options.watch) {
|
|
17
23
|
result.stop = await assetHandler.watchAndProcessOnAssetChange();
|
|
18
24
|
}
|
|
19
25
|
try {
|