@nx/js 0.0.0-pr-29705-2a402a9 → 0.0.0-pr-29408-73bb882

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": "0.0.0-pr-29705-2a402a9",
3
+ "version": "0.0.0-pr-29408-73bb882",
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": "0.0.0-pr-29705-2a402a9",
43
- "@nx/workspace": "0.0.0-pr-29705-2a402a9",
42
+ "@nx/devkit": "0.0.0-pr-29408-73bb882",
43
+ "@nx/workspace": "0.0.0-pr-29408-73bb882",
44
44
  "@zkochan/js-yaml": "0.0.7",
45
45
  "babel-plugin-const-enum": "^1.0.1",
46
46
  "babel-plugin-macros": "^2.8.0",
@@ -16,9 +16,25 @@ const get_main_file_dir_1 = require("../../utils/get-main-file-dir");
16
16
  const utils_1 = require("nx/src/tasks-runner/utils");
17
17
  function debounce(fn, wait) {
18
18
  let timeoutId;
19
+ let pendingPromise = null;
19
20
  return () => {
20
21
  clearTimeout(timeoutId);
21
- timeoutId = setTimeout(fn, wait);
22
+ if (!pendingPromise) {
23
+ pendingPromise = new Promise((resolve, reject) => {
24
+ timeoutId = setTimeout(() => {
25
+ fn()
26
+ .then((result) => {
27
+ pendingPromise = null;
28
+ resolve(result);
29
+ })
30
+ .catch((error) => {
31
+ pendingPromise = null;
32
+ reject(error);
33
+ });
34
+ }, wait);
35
+ });
36
+ }
37
+ return pendingPromise;
22
38
  };
23
39
  }
24
40
  async function* nodeExecutor(options, context) {
@@ -52,7 +68,7 @@ async function* nodeExecutor(options, context) {
52
68
  let additionalExitHandler = null;
53
69
  let currentTask = null;
54
70
  const tasks = [];
55
- yield* (0, async_iterable_1.createAsyncIterable)(async ({ done, next, error }) => {
71
+ yield* (0, async_iterable_1.createAsyncIterable)(async ({ done, next, error, registerCleanup }) => {
56
72
  const processQueue = async () => {
57
73
  if (tasks.length === 0)
58
74
  return;
@@ -163,6 +179,9 @@ async function* nodeExecutor(options, context) {
163
179
  await stopAllTasks('SIGHUP');
164
180
  process.exit(128 + 1);
165
181
  });
182
+ registerCleanup(async () => {
183
+ await stopAllTasks('SIGTERM');
184
+ });
166
185
  if (options.runBuildTargetDependencies) {
167
186
  // If a all dependencies need to be rebuild on changes, then register with watcher
168
187
  // and run through CLI, otherwise only the current project will rebuild.