2.0 KiB
2.0 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
excel2json — a SvelteKit web application for converting Excel files to JSON. Built with Svelte 5, SvelteKit 2, TypeScript, and Tailwind CSS 4.
Commands
npm run dev— start dev servernpm run build— production buildnpm run preview— preview production buildnpm run check— type-check with svelte-checknpm run test— run all tests oncenpm run test:unit— run tests in watch modenpm run test:unit -- --run --testNamePattern="pattern"— run a single test by name
Architecture
- Framework: SvelteKit 2 with Svelte 5 (runes API:
$state,$props,$derived, etc.) - Styling: Tailwind CSS 4 with
@tailwindcss/formsand@tailwindcss/typographyplugins, configured viasrc/routes/layout.css - Adapter:
@sveltejs/adapter-auto - TypeScript: strict mode enabled
Testing
Two Vitest project configurations in vite.config.ts:
client— browser tests using Playwright (headless Chromium). Files matchingsrc/**/*.svelte.{test,spec}.{js,ts}. Usesvitest-browser-sveltefor component rendering.server— Node.js unit tests. Files matchingsrc/**/*.{test,spec}.{js,ts}(excluding.svelte.test files).
All tests require assertions (expect.requireAssertions: true).
Key Conventions
- Svelte components use
lang="ts"in script tags - Shared library code goes in
src/lib/(aliased as$lib) - Use Svelte 5 runes syntax, not legacy Svelte 4 patterns
Svelte MCP Server
A Svelte MCP server is available for Svelte 5 / SvelteKit documentation lookup and code validation. When writing Svelte code:
- Use
list-sectionsfirst to discover relevant documentation - Use
get-documentationto fetch needed sections - Use
svelte-autofixerto validate Svelte code before finalizing — keep calling until no issues remain - Offer
playground-linkonly if code was NOT written to project files