Development & Tooling
Workspace scripts
pnpm install
pnpm build # all packages
pnpm test # vitest
pnpm typecheck
pnpm lint # eslint packages examples --max-warnings 0
pnpm format / format:write
pnpm verify:core-isolation # asserts @openweather/maps-core and @openweather/maps-ui-core stay DOM/React/WebGL-free
pnpm docs:build # renders this docs site from docs-site/content/**/*.md
pnpm clean
Tooling
| Tool | Use |
|---|---|
| pnpm workspaces | Monorepo linking (workspace:*) |
| TypeScript 5.9 | Strict packages, dual ESM/CJS via tsup |
| tsup | Package builds (+ a separate contour-worker build in maps-gl) |
| Vitest + jsdom | Unit tests — a two-project workspace config (node for DOM-free packages, jsdom for anything touching the DOM); a .test.ts file needing DOM APIs in a normally DOM-free package must be named .test.tsx to route to the jsdom project |
| ESLint 9 + Prettier | Lint/format; husky + lint-staged on commit |
| Changesets | Versioning & changelogs |
Verification checklist for a change
- Implement the change.
- Add/update tests; confirm they pass.
pnpm build && pnpm typecheck && pnpm lint.pnpm verify:core-isolationif you touched@openweather/maps-coreor@openweather/maps-ui-core.- For UI changes, run the relevant example app (
pnpm --filter @openweather/example-vanilla dev/@openweather/example-react dev) and check it in a browser — passing tests verify correctness, not that a feature actually renders and behaves right.
Shader workflow (@openweather/maps-gl)
- Edit
packages/maps-gl/shaders/*.glsl(and the matching*.gl1.*.glslwhen logic changes, to keep the WebGL1 fallback in sync — see Architecture). pnpm run bundle-shaders(insidemaps-gl) regeneratessrc/shaders.ts— a gitignored build artifact, never edited by hand.tsupemits the library and (separately) the contour-worker bundle.
Repository layout
One pnpm-workspace monorepo (packages/* + examples/*), not per-package repos with submodules —
see the repo's docs/ARCHITECTURE.md for the full rationale and for why the WebGL renderer
(@openweather/maps-gl) was internalized from a formerly-standalone sibling library.