mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
- when pack-npm fails on a non-release run, publish builds the libraries in place as before, so the CLI dev preview still ships after client - library scripts skip versions already on npm in pack mode too, and NpmLibraries.verify accepts a missing tarball only for a published version, so a re-dispatched release does not rerun every check - trim comments that restated code and correct inaccurate ones
21 lines
717 B
TypeScript
21 lines
717 B
TypeScript
import { Script } from "@opencode/script"
|
|
import { $ } from "bun"
|
|
|
|
// Shared with script/pack-npm.ts so its libraries build against the same versions and install as publish's would.
|
|
export async function packageJsons() {
|
|
return Array.fromAsync(
|
|
new Bun.Glob("**/package.json").scan({
|
|
absolute: true,
|
|
}),
|
|
).then((arr) => arr.filter((x) => !x.includes("node_modules") && !x.includes("dist")))
|
|
}
|
|
|
|
export async function prepareReleaseFiles(files: string[]) {
|
|
for (const file of files) {
|
|
const pkg = (await Bun.file(file).text()).replaceAll(/"version": "[^"]+"/g, `"version": "${Script.version}"`)
|
|
console.log("updated:", file)
|
|
await Bun.file(file).write(pkg)
|
|
}
|
|
|
|
await $`bun install`
|
|
}
|