You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte-kit-vice/AGENTS.md

1.9 KiB

AGENTS.md

This file provides guidance to agents when working with code in this repository.

Build/Test Commands

npm run dev          # Start dev server
npm run build        # Production build (static site)
npm run test         # Run all tests once
npm run test:unit    # Run tests in watch mode
npx vitest run src/lib/ling/test/ling.test.ts  # Run single test file
npx vitest run -t "describe name"              # Run tests matching pattern
npm run check        # Type check with svelte-check
npm run lint         # Check formatting with Prettier
npm run format       # Auto-format with Prettier

Critical Architecture

Dual Alias Configuration Required

Path aliases must be synced in BOTH svelte.config.js AND vite.config.ts for TypeScript, Svelte compiler, and Vitest to resolve consistently:

  • @/ → src/
  • @/ling → src/lib/ling (i18n)
  • @/logr → src/lib/logr (logging)
  • @/glob → src/lib/glob (globalization)
  • @/actx → src/lib/actx (audio context)
  • $uix → src/uix (UI components)

Svelte 5 Runes Mode Enforced

svelte.config.js forces runes: true for all project files via dynamicCompileOptions. All components must use Svelte 5 runes ($state, $derived, $effect, etc.).

Vitest Two-Project Structure

vite.config.ts defines separate test projects:

  • client: Browser tests via Playwright for *.svelte.{test,spec}.{js,ts} files
  • server: Node environment for *.{test,spec}.{js,ts} files (excludes svelte tests)

Internal Library Pattern

Each library (ling, logr, glob, actx) uses factory functions (createLing, createLogr, etc.) that return instances with internal state. The logr library depends on ling for localized messages.

Code Style

  • Tabs for indentation, single quotes, no trailing commas, 100 char print width
  • Spanish comments in code are acceptable

Powered by TurnKey Linux.