Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame contribute delete
457 Bytes
import { cpSync } from "node:fs"
import { join } from "node:path/posix"
export async function generateTypes(dir: string) {
const { execa } = await import("execa")
await execa("pnpm", ["tsc", "--project", "tsconfig.build.json"], {
cwd: dir,
stdio: "inherit",
})
try {
cpSync(
join(dir, "dist", "types", "index.d.ts"),
join(dir, "dist", "types", "index.d.mts"),
)
} catch {
console.log("No .dts file found")
}
}