Instructions for AI coding agents working on this repo.
TypeScript monorepo for libraries enhancing web map clients (@xtramaps scope) with framework-specific variants. Libraries are published to npm.
packages/
vite.config.base.ts # Shared Vite lib config factory
core/<lib>/ # Plain TypeScript (no framework deps)
react/<lib>/ # React variant (depends on core, peers on react)
vue/<lib>/ # Vue variant (depends on core, peers on vue)
svelte/<lib>/ # Svelte variant (depends on core, peers on svelte)
Each library has: package.json, tsconfig.json, vite.config.ts, src/index.ts.
@xtramaps/<lib>— core package@xtramaps/<lib>-react— React variant@xtramaps/<lib>-vue— Vue variant@xtramaps/<lib>-svelte— Svelte variant
npm run build— build all packages (via Turborepo)npm run lint— lint and format check (Biome)npm run lint:fix— auto-fix lint/format issuesnpm run typecheck— type-check all packages
- All packages output ESM + CJS +
.d.tsvia Vite library mode vite.config.tsusesdefineLibConfig()frompackages/vite.config.base.tstsconfig.jsonextendstsconfig.base.json(must specifyoutDir,rootDir,includelocally)- Shared devDeps (
typescript,vite,vite-plugin-dts) live in root only — do not add to individual packages - Framework deps (react, vue, svelte) are externalized and declared as
peerDependencies - Core deps are listed in
dependencies(not peers) - Biome handles formatting and linting — no Prettier or ESLint
- Changesets for versioning — run
npx changesetafter changes
- Create
packages/core/<lib>/withpackage.json,tsconfig.json,vite.config.ts,src/index.ts - Create corresponding
packages/{react,vue,svelte}/<lib>/variants - Run
npm installto link workspaces - Run
npm run buildto verify
npm run lintpassesnpm run buildsucceedsnpm run typecheckpasses