Small D3 v7 playground built with Vite, TypeScript, and Vitest.
Node: 22.12+ (Vite 7 / ESLint 9; see engines in package.json). If you use mise, run mise install to use .mise.toml.
| Command | Description |
|---|---|
yarn dev |
Local dev server (default: http://localhost:5173) |
yarn build |
Production build → dist/ (base: / for local preview) |
yarn build:pages |
Build for GitHub Pages (base: /d3/; change in vite.config.ts if repo name differs) |
yarn preview |
Serve dist/ at http://localhost:4173/ (use after yarn build) |
yarn lint |
ESLint on .ts files |
yarn lint:fix |
ESLint with --fix |
yarn typecheck |
TypeScript (tsc --noEmit) |
yarn test |
Vitest watch mode |
yarn test:run |
Vitest single run (used in CI) |
One-time setup in the repo on GitHub: Settings → Pages → Build and deployment → Source: choose GitHub Actions (not “Deploy from a branch”). Until that is set, pushes will not publish a site.
CI runs on pushes to main or master and uses yarn build:pages. The site URL is https://<user>.github.io/<repo>/ (e.g. if the repo is d3, keep pagesBase as /d3/ in vite.config.ts). You can also run the workflow manually: Actions → “Deploy to GitHub Pages” → Run workflow.
src/main.ts— app entrydata/— typed sample datasetspublic/assets/— static assets (e.g. CSS)
Package manager: Yarn (lockfile: yarn.lock).