From 579b4a42dbafa9b437a2a294cbf221a17bc7bd6d Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Wed, 31 Jul 2024 13:30:48 -0400 Subject: [PATCH] Restore __dirname for cjs --- .../src/generate/betaClient/generatePackage.ts | 4 ++-- .../foundry-sdk-generator/src/generate/generateBundles.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/foundry-sdk-generator/src/generate/betaClient/generatePackage.ts b/packages/foundry-sdk-generator/src/generate/betaClient/generatePackage.ts index 30a3496cb..31877e005 100644 --- a/packages/foundry-sdk-generator/src/generate/betaClient/generatePackage.ts +++ b/packages/foundry-sdk-generator/src/generate/betaClient/generatePackage.ts @@ -109,7 +109,7 @@ export async function generatePackage( const { findUp } = await import("find-up"); const nodeModulesPath = await findUp("node_modules", { - cwd: dirname(fileURLToPath(import.meta.url)), + cwd: __dirname, type: "directory", }); @@ -174,7 +174,7 @@ async function getDependencyVersion(dependency: string): Promise { } const { findUp } = await import("find-up"); const result = await findUp("package.json", { - cwd: dirname(fileURLToPath(import.meta.url)), + cwd: __dirname, }); const packageJson = await readFile(result!, { encoding: "utf-8", diff --git a/packages/foundry-sdk-generator/src/generate/generateBundles.ts b/packages/foundry-sdk-generator/src/generate/generateBundles.ts index ece7dd898..c8c1df53f 100644 --- a/packages/foundry-sdk-generator/src/generate/generateBundles.ts +++ b/packages/foundry-sdk-generator/src/generate/generateBundles.ts @@ -30,7 +30,7 @@ async function createRollupBuild( const { findUp } = await import("find-up"); const nodeModulesPath = await findUp("node_modules", { - cwd: dirname(fileURLToPath(import.meta.url)), + cwd: __dirname, type: "directory", });