feat: Modernize the visual card editor. (#2586)

This commit is contained in:
Dermot Duffy
2026-07-20 20:44:16 -07:00
committed by GitHub
parent e204ec183f
commit b6e1de5999
146 changed files with 8487 additions and 5992 deletions
+32
View File
@@ -0,0 +1,32 @@
import { existsSync, readdirSync, rmSync } from 'node:fs';
/**
* Rollup plugin: deletes prior build artifacts from `dist/` (which otherwise
* accumulate stale hashed chunks that can be served in place of fresh output).
* Deletes only top-level build artifacts by extension (no recursion), so
* anything unexpected in `dist/` survives. Cleans once per process: watch mode
* cleans at startup, not on every incremental rebuild.
*
* @type {() => import('rollup').Plugin}
*/
export const cleanDist = () => {
let cleaned = false;
return {
name: 'clean-dist',
buildStart() {
if (cleaned) {
return;
}
cleaned = true;
const dist = new URL('../dist/', import.meta.url);
if (!existsSync(dist)) {
return;
}
for (const entry of readdirSync(dist, { withFileTypes: true })) {
if (entry.isFile() && /\.js(\.map)?$/.test(entry.name)) {
rmSync(new URL(entry.name, dist));
}
}
},
};
};