mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 15:02:30 +02:00
fix: ship built opencode plugin assets
This commit is contained in:
parent
60b6de003b
commit
db6d52e4af
4 changed files with 169 additions and 3 deletions
24
scripts/build-opencode.js
Normal file
24
scripts/build-opencode.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const fs = require("node:fs")
|
||||
const path = require("node:path")
|
||||
const { execFileSync } = require("node:child_process")
|
||||
|
||||
const rootDir = path.resolve(__dirname, "..")
|
||||
const opencodeDir = path.join(rootDir, ".opencode")
|
||||
const distDir = path.join(opencodeDir, "dist")
|
||||
|
||||
fs.rmSync(distDir, { recursive: true, force: true })
|
||||
|
||||
const tscBin = path.join(rootDir, "node_modules", ".bin", process.platform === "win32" ? "tsc.cmd" : "tsc")
|
||||
|
||||
if (!fs.existsSync(tscBin)) {
|
||||
throw new Error(
|
||||
"TypeScript compiler not found. Install root dev dependencies before publishing so .opencode/dist can be built."
|
||||
)
|
||||
}
|
||||
|
||||
execFileSync(tscBin, ["-p", path.join(opencodeDir, "tsconfig.json")], {
|
||||
cwd: rootDir,
|
||||
stdio: "inherit",
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue