@nx/js 21.2.0-beta.1 → 21.2.0-beta.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/README.md CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # Nx: Smart Repos · Fast Builds
24
24
 
25
- Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
25
+ An AI-first build platform that connects everything from your editor to CI. Helping you deliver fast, without breaking things.
26
26
 
27
27
  This package is a [JavaScript/TypeScript plugin for Nx](https://nx.dev/js/overview).
28
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/js",
3
- "version": "21.2.0-beta.1",
3
+ "version": "21.2.0-beta.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,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": "21.2.0-beta.1",
43
- "@nx/workspace": "21.2.0-beta.1",
42
+ "@nx/devkit": "21.2.0-beta.3",
43
+ "@nx/workspace": "21.2.0-beta.3",
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",
@@ -18,7 +18,6 @@ function debounce(fn, wait) {
18
18
  let timeoutId;
19
19
  let pendingPromise = null;
20
20
  return () => {
21
- clearTimeout(timeoutId);
22
21
  if (!pendingPromise) {
23
22
  pendingPromise = new Promise((resolve, reject) => {
24
23
  timeoutId = setTimeout(() => {
@@ -30,6 +29,9 @@ function debounce(fn, wait) {
30
29
  .catch((error) => {
31
30
  pendingPromise = null;
32
31
  reject(error);
32
+ })
33
+ .finally(() => {
34
+ clearTimeout(timeoutId);
33
35
  });
34
36
  }, wait);
35
37
  });
@@ -134,7 +136,7 @@ async function* nodeExecutor(options, context) {
134
136
  error(new Error(`Process exited with code ${code}`));
135
137
  }
136
138
  else {
137
- done();
139
+ resolve(done());
138
140
  }
139
141
  }
140
142
  resolve();
@@ -161,8 +163,12 @@ async function* nodeExecutor(options, context) {
161
163
  tasks.push(task);
162
164
  };
163
165
  const stopAllTasks = async (signal = 'SIGTERM') => {
164
- additionalExitHandler?.();
165
- await currentTask?.stop(signal);
166
+ if (typeof additionalExitHandler === 'function') {
167
+ additionalExitHandler();
168
+ }
169
+ if (typeof currentTask?.stop === 'function') {
170
+ await currentTask.stop(signal);
171
+ }
166
172
  for (const task of tasks) {
167
173
  await task.stop(signal);
168
174
  }
@@ -36,7 +36,22 @@ function readTsConfigCacheData() {
36
36
  return cache.data;
37
37
  }
38
38
  function writeToCache(cachePath, data) {
39
- (0, devkit_1.writeJsonFile)(cachePath, data, { spaces: 0 });
39
+ const maxAttempts = 5;
40
+ for (let attempt = 0; attempt < maxAttempts; attempt++) {
41
+ const unique = (Math.random().toString(16) + '00000000').slice(2, 10);
42
+ const tempPath = `${cachePath}.${process.pid}.${unique}.tmp`;
43
+ try {
44
+ (0, devkit_1.writeJsonFile)(tempPath, data, { spaces: 0 });
45
+ (0, node_fs_1.renameSync)(tempPath, cachePath);
46
+ return;
47
+ }
48
+ catch {
49
+ try {
50
+ (0, node_fs_1.unlinkSync)(tempPath);
51
+ }
52
+ catch { }
53
+ }
54
+ }
40
55
  }
41
56
  function writeTsConfigCache(data) {
42
57
  writeToCache(TS_CONFIG_CACHE_PATH, {
@@ -12,6 +12,6 @@ export declare const typescriptVersion = "~5.8.2";
12
12
  /**
13
13
  * The minimum version is currently determined from the lowest version
14
14
  * that's supported by the lowest Angular supported version, e.g.
15
- * `npm view @angular/compiler-cli@17.0.0 peerDependencies.typescript`
15
+ * `npm view @angular/compiler-cli@18.0.0 peerDependencies.typescript`
16
16
  */
17
- export declare const supportedTypescriptVersions = ">=5.2.0";
17
+ export declare const supportedTypescriptVersions = ">=5.4.0";
@@ -16,6 +16,6 @@ exports.typescriptVersion = '~5.8.2';
16
16
  /**
17
17
  * The minimum version is currently determined from the lowest version
18
18
  * that's supported by the lowest Angular supported version, e.g.
19
- * `npm view @angular/compiler-cli@17.0.0 peerDependencies.typescript`
19
+ * `npm view @angular/compiler-cli@18.0.0 peerDependencies.typescript`
20
20
  */
21
- exports.supportedTypescriptVersions = '>=5.2.0';
21
+ exports.supportedTypescriptVersions = '>=5.4.0';