fix(deps): restore FAKE_REQUIRE patch

This commit is contained in:
2026-05-06 02:44:27 +07:00 Unverified
parent 6c6144bc72
commit 97287898d0
3 changed files with 47 additions and 0 deletions
+1
View File
@@ -24,6 +24,7 @@
}, },
}, },
"patchedDependencies": { "patchedDependencies": {
"@takumi-rs/[email protected]": "patches/@takumi-rs%[email protected]",
"@takumi-rs/[email protected]": "patches/@takumi-rs%[email protected]", "@takumi-rs/[email protected]": "patches/@takumi-rs%[email protected]",
}, },
"packages": { "packages": {
+1
View File
@@ -25,6 +25,7 @@
"oxlint": "^1.62.0" "oxlint": "^1.62.0"
}, },
"patchedDependencies": { "patchedDependencies": {
"@takumi-rs/[email protected]": "patches/@takumi-rs%[email protected]",
"@takumi-rs/[email protected]": "patches/@takumi-rs%[email protected]" "@takumi-rs/[email protected]": "patches/@takumi-rs%[email protected]"
} }
} }
+45
View File
@@ -0,0 +1,45 @@
diff --git a/node_modules/@takumi-rs/core/.bun-tag-98ae5df3ea26fbd0 b/.bun-tag-98ae5df3ea26fbd0
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/node_modules/@takumi-rs/core/.bun-tag-ec41a7cd6a499a11 b/.bun-tag-ec41a7cd6a499a11
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/dist/export.mjs b/dist/export.mjs
index 7429e65e77018b38f450cfc563bafaa45db4b818..eb55b96d9725bab2727689b43a29a7ea6572b494 100644
--- a/dist/export.mjs
+++ b/dist/export.mjs
@@ -1,10 +1,30 @@
-import { createRequire } from "node:module";
import { extractResourceUrls } from "@takumi-rs/helpers";
+import { createRequire } from 'node:module';
//#region index.js
-const require = createRequire(import.meta.url);
new URL(".", import.meta.url).pathname;
-const { readFileSync } = require(/* turbopackOptional: true */ "node:fs");
-let nativeBinding = null;
+const realRequire = createRequire(import.meta.url)
+
+import * as path from "node:path";
+import * as fs from "node:fs";
+import { feature } from 'bun:bundle';
+const { readFileSync } = require('node:fs');
+
+function require(name) {
+ if(!feature("FAKE_REQUIRE")) return realRequire(name);
+ const exeDir = path.dirname(process.execPath);
+ const candidate = path.join(exeDir, name);
+
+ if (fs.existsSync(candidate)) {
+ return realRequire(candidate);
+ }
+
+ try {
+ return realRequire(name);
+ } catch {
+ return realRequire(`./${name}`);
+ }
+}
+
const loadErrors = [];
const isMusl = () => {
let musl = false;