feat(http-recorder): sync recorder v0.3 (#35619)
This commit is contained in:
parent
05e8d5be73
commit
3dd29094f4
47 changed files with 2697 additions and 2207 deletions
|
|
@ -15,10 +15,6 @@ export const pack = async () => {
|
|||
}
|
||||
|
||||
for (const [key, value] of Object.entries(pkg.exports)) {
|
||||
if (key === "./internal") {
|
||||
delete pkg.exports[key]
|
||||
continue
|
||||
}
|
||||
if (typeof value !== "string") continue
|
||||
const file = value.replace("./src/", "./dist/").replace(/\.ts$/, "")
|
||||
pkg.exports[key] = { import: `${file}.js`, types: `${file}.d.ts` }
|
||||
|
|
@ -32,4 +28,14 @@ export const pack = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
export const withPackedArchive = async <A>(use: (archive: string) => Promise<A>) => {
|
||||
const archive = await pack()
|
||||
try {
|
||||
return await use(archive)
|
||||
} finally {
|
||||
const file = Bun.file(archive)
|
||||
if (await file.exists()) await file.delete()
|
||||
}
|
||||
}
|
||||
|
||||
if (import.meta.main) await pack()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue