@nx/js 19.4.1 → 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.4.1",
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.4.1",
62
- "@nx/workspace": "19.4.1",
63
- "@nrwl/js": "19.4.1"
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
- additionalExitHandler = await client_1.daemonClient.registerFileWatcher({
192
- watchProjects: [context.projectName],
193
- includeDependentProjects: true,
194
- }, async (err, data) => {
195
- if (err === 'closed') {
196
- devkit_1.logger.error(`Watch error: Daemon closed the connection`);
197
- process.exit(1);
198
- }
199
- else if (err) {
200
- devkit_1.logger.error(`Watch error: ${err?.message ?? 'Unknown'}`);
201
- }
202
- else {
203
- devkit_1.logger.info(`NX File change detected. Restarting...`);
204
- await runBuild();
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,
@@ -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 {