Files
packages/anda/devs/yarn-berry/setup-ts-cache.patch
T
Raboneko dbd7d18f51 fix(yarnpkg-berry): Include all build and runtime files, patch package for system installation) (#7565) (#7569)
* fix(yarnpkg-berry): Include all build and runtime files, patch package for system installation)

* fix: What happened to noarch

(cherry picked from commit 07b486e4c3)

Co-authored-by: Gilver <rockgrub@disroot.org>
2025-11-22 05:21:07 -06:00

22 lines
908 B
Diff

# Quick and dirty patch to make Yarn Berry's build cache system work when installed as a system package.
# This patch is created for and maintained solely for Terra.
--- a/scripts/setup-ts-cache.js 2025-11-22 00:36:54.889317752 -0600
+++ b/scripts/setup-ts-cache.js 2025-11-22 00:44:29.823498920 -0600
@@ -1,6 +1,7 @@
const crypto = require(`crypto`);
const esbuild = require(`esbuild`);
const fs = require(`fs`);
+const os = require('os');
const path = require(`path`);
const v8 = require(`v8`);
const zlib = require(`zlib`);
@@ -25,7 +26,7 @@
isDirty: false,
};
-const cachePath = path.join(__dirname, `../node_modules/.cache/yarn/esbuild-transpile-cache.bin`);
+const cachePath = path.join(os.homedir(), `.cache/yarn/esbuild-transpile-cache.bin`);
try {
const cacheData = v8.deserialize(zlib.brotliDecompressSync(fs.readFileSync(cachePath)));
if (cacheData.version === cache.version) {