Fix: Resolve @opentui/core from various node_modules locations
This commit is contained in:
@@ -130,7 +130,22 @@ for (const item of targets) {
|
||||
console.log(`building ${name}`)
|
||||
await $`mkdir -p dist/${name}/bin`
|
||||
|
||||
const parserWorker = fs.realpathSync(path.resolve(dir, "./node_modules/@opentui/core/parser.worker.js"))
|
||||
const parserWorker = await (async () => {
|
||||
// Try to resolve from various possible locations (handles both hoisted and non-hoisted installs)
|
||||
const possiblePaths = [
|
||||
path.resolve(dir, "./node_modules/@opentui/core/parser.worker.js"),
|
||||
path.resolve(dir, "../../node_modules/@opentui/core/parser.worker.js"),
|
||||
path.resolve(dir, "../../../node_modules/@opentui/core/parser.worker.js"),
|
||||
]
|
||||
for (const p of possiblePaths) {
|
||||
try {
|
||||
return fs.realpathSync(p)
|
||||
} catch {
|
||||
continue
|
||||
}
|
||||
}
|
||||
throw new Error("Could not find @opentui/core/parser.worker.js in any node_modules location")
|
||||
})()
|
||||
const workerPath = "./src/cli/cmd/tui/worker.ts"
|
||||
|
||||
// Use platform-specific bunfs root path based on target OS
|
||||
|
||||
Reference in New Issue
Block a user