This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
npm run dev- Start Vite development server at http://localhost:5173npm run build- Build for production (outputs tobuild/directory)npm run preview- Preview production buildnpm run test- Run all tests oncenpm run test:unit- Run tests in watch modenpm run check- Type check with svelte-checknpm run lint- Check code style with Prettier and ESLintnpm run format- Format code with Prettier
This is a SvelteKit application using Svelte 5 and OpenLayers for interactive mapping functionality. The core architecture consists of:
- Global state managed through
src/lib/global-data.svelte.tsusing Svelte 5's$staterunes - Shared
Point[]array accessible across components via theglobalsobject
Map.svelte- OpenLayers integration with OSM tiles, vector layers for markers, and optional grid overlayPointList.svelte- Sidebar component for coordinate input/display with format switching (decimal/DMS)ErrorMessage.svelte- Shared error display component
coordinates.ts- Coordinate validation and formatting utilities (decimal degrees ↔ DMS conversion)grid-layer-control.ts- Custom OpenLayers control for toggling grid overlaytypes.ts- TypeScript definitions for Point, LatLon, and CoordinateFormat
- User clicks map → creates marker → adds to global points array
- User enters coordinates in sidebar → validates → adds to both local and global state
- Both actions trigger reactive updates across Map and PointList components
- Supports decimal degrees and degrees-minutes-seconds (DMS) input/display
- Latitude/longitude swapping functionality for correcting reversed coordinates
- Clipboard integration for bulk coordinate paste operations
- Cardinal direction display (N/S/E/W) as optional format
- Uses Vitest for unit testing with browser testing support via
@vitest/browser - Component tests use
vitest-browser-sveltefor Svelte 5 compatibility - Test files follow
*.test.tsand*.spec.tspatterns
- Please keep the task list updated in the @docs\TASKS.md file as we work.
- Ensure that the near term plan is regularly updated in @docs/PLAN.md