Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/jolly-dingos-spend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
"changeset:status": "changeset status",
"release:version": "changeset version",
"typecheck": "tsc --noEmit && tsc -p tsconfig.workers.json --noEmit && tsc -p tsconfig.viewer.json --noEmit",
"build": "tsc -p tsconfig.build.json && npm run build:viewer && npm run build:embed",
"clean:dist": "node scripts/clean-dist.ts",
"build": "npm run clean:dist && tsc -p tsconfig.build.json && npm run build:viewer && npm run build:embed",
"deploy": "npm run build:viewer && wrangler deploy",
"dev:cloud": "npm run build:viewer && wrangler dev",
"prepack": "npm run build",
Expand Down
14 changes: 14 additions & 0 deletions scripts/clean-dist.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env node

// Removes the tsc output tree before a package build. TypeScript only writes
// files, it never deletes output for sources that were renamed or removed, so a
// long-lived checkout accumulates stale modules that `npm pack` happily ships
// (and the "./*" export makes importable). The vite builds already self-clean
// via emptyOutDir, so this is the one output tree that needed it.
//
// Anchored to the package root rather than the process CWD so it cannot delete
// a `dist` belonging to whatever directory the script was invoked from.

import { rmSync } from "node:fs";

rmSync(new URL("../dist", import.meta.url), { recursive: true, force: true });
Loading