nx 20.4.0-canary.20250122-3c98a1c → 20.4.0-canary.20250124-45847a6

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.
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[532],{6395:()=>{}},s=>{var e;e=6395,s(s.s=e)}]);
1
+ "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[532],{69552:()=>{}},s=>{var e;e=69552,s(s.s=e)}]);
Binary file
@@ -18,7 +18,7 @@ class RemoteCacheV2 {
18
18
  (0, promises_1.readFile)((0, path_1.join)(cacheDirectory, hash, 'code'), 'utf-8').then((s) => +s),
19
19
  ]);
20
20
  return {
21
- outputsPath: cacheDirectory,
21
+ outputsPath: (0, path_1.join)(cacheDirectory, hash, 'outputs'),
22
22
  terminalOutput: terminalOutput ?? oldTerminalOutput,
23
23
  code,
24
24
  };
@@ -27,8 +27,26 @@ class RemoteCacheV2 {
27
27
  return null;
28
28
  }
29
29
  },
30
- store: async (hash, cacheDirectory, __, code) => {
30
+ store: async (hash, cacheDirectory, terminalOutput, code) => {
31
+ // The new db cache places the outputs directly into the cacheDirectory + hash.
32
+ // old instances of Nx Cloud expect these outputs to be in cacheDirectory + hash + outputs
33
+ // this ensures that everything that was in the cache directory is moved to the outputs directory
34
+ const cacheDir = (0, path_1.join)(cacheDirectory, hash);
35
+ const outputDir = (0, path_1.join)(cacheDir, 'outputs');
36
+ await (0, promises_1.mkdir)(outputDir, { recursive: true });
37
+ const files = await (0, promises_1.readdir)(cacheDir);
38
+ await Promise.all(files.map(async (file) => {
39
+ const filePath = (0, path_1.join)(cacheDir, file);
40
+ // we don't want to move these files to the outputs directory because they are not artifacts of the task
41
+ if (filePath === outputDir ||
42
+ file === 'code' ||
43
+ file === 'terminalOutput') {
44
+ return;
45
+ }
46
+ await (0, promises_1.rename)(filePath, (0, path_1.join)(outputDir, file));
47
+ }));
31
48
  await (0, promises_1.writeFile)((0, path_1.join)(cacheDirectory, hash, 'code'), code.toString());
49
+ await (0, promises_1.writeFile)((0, path_1.join)(cacheDirectory, hash, 'terminalOutput'), terminalOutput);
32
50
  return cache.store(hash, cacheDirectory);
33
51
  },
34
52
  };