Skip to content

Commit ac07c2d

Browse files
committed
Remove abandoned strategy imports from build-externals
cherry-pick-entries.mjs and non-barrel-imports.mjs were deleted as abandoned strategies but imports remained, causing build errors. Simplify bundlePackage to use direct package resolution.
1 parent 4c978d3 commit ac07c2d

1 file changed

Lines changed: 0 additions & 34 deletions

File tree

scripts/build-externals.mjs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ const require = createRequire(import.meta.url)
1212

1313
// Use esbuild from node_modules.
1414
import esbuild from 'esbuild'
15-
import { createCherryPickEntry } from './cherry-pick-entries.mjs'
16-
import { createNonBarrelEntry } from './non-barrel-imports.mjs'
1715
import {
1816
printError,
1917
printFooter,
@@ -149,8 +147,6 @@ function getPackageSpecificOptions(packageName) {
149147
async function bundlePackage(packageName, outputPath) {
150148
console.log(` Bundling ${packageName}...`)
151149

152-
let cherryPickedEntry
153-
154150
try {
155151
// Check if package is installed.
156152
let packagePath
@@ -194,24 +190,6 @@ async function bundlePackage(packageName, outputPath) {
194190
}
195191
}
196192

197-
// Check if we have a cherry-pick optimization for this package first.
198-
const cherryPickEntry = await createCherryPickEntry(packageName, null)
199-
if (cherryPickEntry) {
200-
console.log(` Using cherry-picked imports for ${packageName}`)
201-
packagePath = cherryPickEntry
202-
// For cleanup tracking.
203-
cherryPickedEntry = cherryPickEntry
204-
} else {
205-
// Fall back to non-barrel import optimization.
206-
const nonBarrelEntry = await createNonBarrelEntry(packageName, null)
207-
if (nonBarrelEntry) {
208-
console.log(` Using non-barrel imports for ${packageName}`)
209-
packagePath = nonBarrelEntry
210-
// For cleanup tracking.
211-
cherryPickedEntry = nonBarrelEntry
212-
}
213-
}
214-
215193
// Get package-specific optimizations.
216194
const packageOpts = getPackageSpecificOptions(packageName)
217195

@@ -449,12 +427,6 @@ ${bundleContent}`
449427
const stats = await fs.stat(outputPath)
450428
const sizeKB = Math.round(stats.size / 1024)
451429
console.log(` ✓ Bundled ${packageName} (${sizeKB}KB)`)
452-
453-
// Clean up temp directory if we created one.
454-
if (cherryPickedEntry) {
455-
const tmpDir = path.join(process.cwd(), '.tmp-build')
456-
await fs.rm(tmpDir, { recursive: true, force: true })
457-
}
458430
} catch (error) {
459431
console.error(` ✗ Failed to bundle ${packageName}:`, error.message)
460432
// Create error stub.
@@ -464,12 +436,6 @@ ${bundleContent}`
464436
throw new Error('Failed to bundle ${packageName}')
465437
`
466438
await fs.writeFile(outputPath, stubContent)
467-
} finally {
468-
// Always clean up temp directory if we created one.
469-
if (cherryPickedEntry) {
470-
const tmpDir = path.join(process.cwd(), '.tmp-build')
471-
await fs.rm(tmpDir, { recursive: true, force: true }).catch(() => {})
472-
}
473439
}
474440
}
475441

0 commit comments

Comments
 (0)