From f26047f125b34f9260ff55f0d3c4703d67aec609 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sun, 16 Nov 2025 02:23:04 +0000 Subject: [PATCH] Prettier format pending files --- build-api.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build-api.js b/build-api.js index f1f04130..5a82527a 100644 --- a/build-api.js +++ b/build-api.js @@ -40,7 +40,7 @@ console.log("Step 2: Transpiling to JavaScript with ESM imports..."); try { execSync( `npx esbuild "${destApi}/**/*.ts" --platform=node --target=es2020 --format=esm --outdir="${destApi}" --allow-overwrite`, - { cwd: __dirname, stdio: "inherit" } + { cwd: __dirname, stdio: "inherit" }, ); console.log("✓ Transpiled to JavaScript"); } catch (error) { @@ -53,32 +53,32 @@ let fixedCount = 0; function fixImportsInDir(dir) { const entries = fs.readdirSync(dir, { withFileTypes: true }); - + for (const entry of entries) { const fullPath = path.join(dir, entry.name); - + if (entry.isDirectory()) { fixImportsInDir(fullPath); } else if (entry.name.endsWith(".js")) { let content = fs.readFileSync(fullPath, "utf-8"); - + // Fix relative imports for ESM: "../../_supabase" -> "../../_supabase.js" let fixedContent = content.replace( /from\s+"(\.\.?\/[^"]+)"/g, (match, importPath) => { if (importPath.endsWith(".js")) return match; return `from "${importPath}.js"`; - } + }, ); - + fixedContent = fixedContent.replace( /from\s+'(\.\.?\/[^']+)'/g, (match, importPath) => { if (importPath.endsWith(".js")) return match; return `from '${importPath}.js'`; - } + }, ); - + if (fixedContent !== content) { fs.writeFileSync(fullPath, fixedContent); fixedCount++;