feat(http-recorder): sync recorder v0.3 (#35619)

This commit is contained in:
Kit Langton 2026-07-08 11:41:59 -04:00 committed by GitHub
commit 3dd29094f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
47 changed files with 2697 additions and 2207 deletions

View file

@ -14,7 +14,13 @@ const build = await Bun.build({
})
if (!build.success) throw new AggregateError(build.logs, "Failed to build @opencode-ai/http-recorder")
const publicFiles = new Set(["index.js", "index.d.ts", "effect.d.ts", "socket.d.ts", "types.d.ts"])
await Promise.all(
(await readdir("dist")).filter((file) => !publicFiles.has(file)).map((file) => rm(`dist/${file}`, { force: true })),
(await readdir("dist", { recursive: true }))
.filter((file) => file.endsWith(".d.ts") && file !== "index.d.ts" && file !== "api.d.ts")
.map((file) => rm(`dist/${file}`)),
)
for (const file of ["dist/index.d.ts", "dist/api.d.ts"]) {
if ((await Bun.file(file).text()).includes(["import", "("].join("")))
throw new Error(`${file} contains dynamic import syntax`)
}