Calc Svelte is a Svelte 5 + TypeScript calculator built with Vite. The app is organized around pure calculator helpers, a small feature controller, presentational components, and automated unit and visual tests.
Install dependencies:
yarn install
Start the development server:
yarn dev
Run the Svelte type checks:
yarn check
Build the app:
yarn build
Preview the production build:
yarn preview
Run the unit test suite:
yarn test
Run the test watcher while developing:
yarn test:watch
Generate the coverage report:
yarn test:coverage
Run the Playwright visual regression suite:
yarn test:visual
If the UI changes intentionally, refresh the snapshots with:
yarn test:visual:update
src/lib/components/ contains presentational UI componentssrc/lib/features/calculator/ contains the calculator state machine and view-model wiringsrc/lib/utils/ contains pure math and formatting helperssrc/lib/constants.ts, src/lib/types.ts, and src/lib/i18n.ts hold shared button labels, types, and translationssrc/App.svelte and src/main.ts wire the app into Vite and Sveltetests/visual/ contains the Playwright visual regression suite and snapshotsSee ARCHITECTURE.md for a deeper explanation of the design and data flow.