chore(core): upgrade fff to 0.10.1 (#38545)
Co-authored-by: Aiden Cline <rekram1-node@users.noreply.github.com>
This commit is contained in:
parent
74e92f73e0
commit
ad596fb42b
4 changed files with 13 additions and 43 deletions
|
|
@ -1,31 +0,0 @@
|
|||
diff --git a/src/download.ts b/src/download.ts
|
||||
index 3454256..6dca25a 100644
|
||||
--- a/src/download.ts
|
||||
+++ b/src/download.ts
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
+declare const FFF_LIBC: "gnu" | "musl";
|
||||
import { existsSync } from "node:fs";
|
||||
-import { createRequire } from "node:module";
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { getLibFilename, getNpmPackageName } from "./platform";
|
||||
@@ -54,14 +54,10 @@ export function binaryExists(): boolean {
|
||||
* in the same directory.
|
||||
*/
|
||||
function resolveFromNpmPackage(): string | null {
|
||||
- const packageName = getNpmPackageName();
|
||||
-
|
||||
try {
|
||||
- // Use createRequire to resolve the platform package's location
|
||||
- const require = createRequire(join(getPackageDir(), "package.json"));
|
||||
- const packageJsonPath = require.resolve(`${packageName}/package.json`);
|
||||
- const packageDir = dirname(packageJsonPath);
|
||||
- const binaryPath = join(packageDir, getLibFilename());
|
||||
+ const binaryPath = require(
|
||||
+ `@ff-labs/fff-bin-${process.platform === "linux" ? `linux-${process.arch}-${typeof FFF_LIBC === "string" ? FFF_LIBC : getNpmPackageName().endsWith("musl") ? "musl" : "gnu"}` : `${process.platform}-${process.arch}`}/${process.platform === "win32" ? "fff_c.dll" : process.platform === "darwin" ? "libfff_c.dylib" : "libfff_c.so"}`,
|
||||
+ );
|
||||
|
||||
if (existsSync(binaryPath)) {
|
||||
return binaryPath;
|
||||
Loading…
Add table
Add a link
Reference in a new issue