@nx/js 16.4.1 → 16.4.3

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": "16.4.1",
3
+ "version": "16.4.3",
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,9 +39,9 @@
39
39
  "@babel/preset-env": "^7.15.0",
40
40
  "@babel/preset-typescript": "^7.15.0",
41
41
  "@babel/runtime": "^7.14.8",
42
- "@nrwl/js": "16.4.1",
43
- "@nx/devkit": "16.4.1",
44
- "@nx/workspace": "16.4.1",
42
+ "@nrwl/js": "16.4.3",
43
+ "@nx/devkit": "16.4.3",
44
+ "@nx/workspace": "16.4.3",
45
45
  "@phenomnomnominal/tsquery": "~5.0.1",
46
46
  "babel-plugin-const-enum": "^1.0.1",
47
47
  "babel-plugin-macros": "^2.8.0",
@@ -69,5 +69,5 @@
69
69
  "access": "public"
70
70
  },
71
71
  "types": "./src/index.d.ts",
72
- "gitHead": "544a10035930d24af38eef68b46dae8dc40ce261"
72
+ "gitHead": "30ea694c017a9e9956e007d009df18cf5347e6a5"
73
73
  }
@@ -21,7 +21,11 @@ function killTree(pid, signal) {
21
21
  };
22
22
  switch (process.platform) {
23
23
  case 'win32':
24
- (0, child_process_1.exec)('taskkill /pid ' + pid + ' /T /F', callback);
24
+ (0, child_process_1.exec)('taskkill /pid ' + pid + ' /T /F', (error) => {
25
+ // Ignore Fatal errors (128) because it might be due to the process already being killed.
26
+ // On Linux/Mac we can check ESRCH (no such process), but on Windows we can't.
27
+ callback((error === null || error === void 0 ? void 0 : error.code) !== 128 ? error : null);
28
+ });
25
29
  break;
26
30
  case 'darwin':
27
31
  buildProcessTree(pid, tree, pidsToProcess, function (parentPid) {
@@ -146,44 +146,46 @@ function nodeExecutor(options, context) {
146
146
  };
147
147
  tasks.push(task);
148
148
  });
149
- const stopWatch = yield client_1.daemonClient.registerFileWatcher({
150
- watchProjects: [context.projectName],
151
- includeDependentProjects: true,
152
- }, (err, data) => tslib_1.__awaiter(this, void 0, void 0, function* () {
153
- var _f;
154
- if (err === 'closed') {
155
- devkit_1.logger.error(`Watch error: Daemon closed the connection`);
156
- process.exit(1);
157
- }
158
- else if (err) {
159
- devkit_1.logger.error(`Watch error: ${(_f = err === null || err === void 0 ? void 0 : err.message) !== null && _f !== void 0 ? _f : 'Unknown'}`);
160
- }
161
- else {
162
- devkit_1.logger.info(`NX File change detected. Restarting...`);
163
- yield addToQueue();
164
- yield debouncedProcessQueue();
165
- }
166
- }));
167
- const stopAllTasks = (signal = 'SIGTERM') => {
168
- for (const task of tasks) {
169
- task.stop(signal);
170
- }
171
- };
172
- process.on('SIGTERM', () => tslib_1.__awaiter(this, void 0, void 0, function* () {
173
- stopWatch();
174
- stopAllTasks('SIGTERM');
175
- process.exit(128 + 15);
176
- }));
177
- process.on('SIGINT', () => tslib_1.__awaiter(this, void 0, void 0, function* () {
178
- stopWatch();
179
- stopAllTasks('SIGINT');
180
- process.exit(128 + 2);
181
- }));
182
- process.on('SIGHUP', () => tslib_1.__awaiter(this, void 0, void 0, function* () {
183
- stopWatch();
184
- stopAllTasks('SIGHUP');
185
- process.exit(128 + 1);
186
- }));
149
+ if (options.watch) {
150
+ const stopWatch = yield client_1.daemonClient.registerFileWatcher({
151
+ watchProjects: [context.projectName],
152
+ includeDependentProjects: true,
153
+ }, (err, data) => tslib_1.__awaiter(this, void 0, void 0, function* () {
154
+ var _f;
155
+ if (err === 'closed') {
156
+ devkit_1.logger.error(`Watch error: Daemon closed the connection`);
157
+ process.exit(1);
158
+ }
159
+ else if (err) {
160
+ devkit_1.logger.error(`Watch error: ${(_f = err === null || err === void 0 ? void 0 : err.message) !== null && _f !== void 0 ? _f : 'Unknown'}`);
161
+ }
162
+ else {
163
+ devkit_1.logger.info(`NX File change detected. Restarting...`);
164
+ yield addToQueue();
165
+ yield debouncedProcessQueue();
166
+ }
167
+ }));
168
+ const stopAllTasks = (signal = 'SIGTERM') => {
169
+ for (const task of tasks) {
170
+ task.stop(signal);
171
+ }
172
+ };
173
+ process.on('SIGTERM', () => tslib_1.__awaiter(this, void 0, void 0, function* () {
174
+ stopWatch();
175
+ stopAllTasks('SIGTERM');
176
+ process.exit(128 + 15);
177
+ }));
178
+ process.on('SIGINT', () => tslib_1.__awaiter(this, void 0, void 0, function* () {
179
+ stopWatch();
180
+ stopAllTasks('SIGINT');
181
+ process.exit(128 + 2);
182
+ }));
183
+ process.on('SIGHUP', () => tslib_1.__awaiter(this, void 0, void 0, function* () {
184
+ stopWatch();
185
+ stopAllTasks('SIGHUP');
186
+ process.exit(128 + 1);
187
+ }));
188
+ }
187
189
  yield addToQueue();
188
190
  yield processQueue();
189
191
  })))));
@@ -26,7 +26,7 @@ function processTasksAndPopulateTsConfigTaskInfoMap(tsConfigTaskInfoMap, tasksOp
26
26
  let taskOptions = (_a = tasksOptions[taskName]) !== null && _a !== void 0 ? _a : (0, get_task_options_1.getTaskWithTscExecutorOptions)(taskName, context);
27
27
  if (taskOptions) {
28
28
  const taskInfo = createTaskInfo(taskName, taskOptions, context, tsConfig);
29
- const tsConfigPath = (0, path_1.join)(context.root, (0, path_1.relative)(context.root, taskOptions.tsConfig));
29
+ const tsConfigPath = (0, path_1.join)(context.root, (0, path_1.relative)(context.root, taskOptions.tsConfig)).replace(/\\/g, '/');
30
30
  tsConfigTaskInfoMap[tsConfigPath] = taskInfo;
31
31
  taskTsConfigCache.add(taskName);
32
32
  }
@@ -119,7 +119,7 @@ function getInMemoryTsConfig(tsConfig, taskOptions, projectReferences, dependent
119
119
  content: JSON.stringify(Object.assign(Object.assign({}, originalTsConfig), { compilerOptions: Object.assign(Object.assign({}, originalTsConfig.compilerOptions), { rootDir: taskOptions.rootDir, outDir: taskOptions.outputPath, composite: true, declaration: true, declarationMap: true, tsBuildInfoFile: (0, path_1.join)(taskOptions.outputPath, 'tsconfig.tsbuildinfo'), paths: dependentBuildableProjectNodes.length
120
120
  ? (0, buildable_libs_utils_1.computeCompilerOptionsPaths)(tsConfig, dependentBuildableProjectNodes)
121
121
  : (_b = originalTsConfig.compilerOptions) === null || _b === void 0 ? void 0 : _b.paths }), references: allProjectReferences.map((pr) => ({ path: pr })) })),
122
- path: tsConfig,
122
+ path: tsConfig.replace(/\\/g, '/'),
123
123
  };
124
124
  }
125
125
  function findTaskWithTsConfig(tasks, context) {