@nx/js 21.2.0-beta.1 → 21.2.0-beta.2

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.2",
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.2",
43
+ "@nx/workspace": "21.2.0-beta.2",
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",
@@ -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, {