Dharmalib

Development workflow

Run commands from the project root: /Users/amrit/fractals/sites/fractaldharma.

Commands

CommandUse
pnpm data:buildBuild public runtime artifacts from canonical static/data inputs
pnpm data:rebuildRebuild canonical intermediates and then public artifacts
pnpm test:dataRun artifact, cache, architecture, and fixture tests
pnpm devStart local Vite development server when explicitly needed
pnpm buildBuild data and production application
pnpm checkGenerate types and run Svelte/TypeScript diagnostics

For ordinary source edits, run the focused tests that match the change. For corpus changes, rebuild and inspect both output and representative routes.

Safe editing rules

  • Use apply_patch for source edits and preserve unrelated worktree changes.
  • Do not use destructive Git resets or broad deletion commands.
  • Do not add absolute machine paths to active scripts. Use environment variables and repository-relative defaults.
  • Treat static-runtime as generated output; regenerate it rather than hand-editing its JSON.
  • Maintain artifact tests when changing a JSON shape, bucket rule, or pagination contract.

Svelte conventions

The project is runes-only. Type component props and route loaders. Route loaders should import their generated PageLoad or PageProps types from ./$types.

Use onclick, onchange, and other current event attributes. Avoid legacy directive syntax in touched code. Browser-only DOM work belongs in onMount or an appropriately guarded $effect.

SASS conventions

All styles use classic indented SASS with tabs, no braces, and no semicolons. Start by composing shared classes. Use tokens for colors, spacing, and type. Avoid component-local pixels and duplicate selectors where shared _primitives.sass, _spacing.sass, _typography.sass, or _components.sass already provide the pattern.

When to change architecture

Change the artifact schema only when a request cannot be satisfied with a bounded projection. Before adding a new runtime fetch, ask:

  1. Which route or interaction needs it?
  2. What is the smallest stable artifact that answers it?
  3. Can it be built once rather than joined at runtime?
  4. Which existing tests need to specify its contract?

This discipline is what keeps a large Sanskrit corpus usable as a responsive site.

A project by designLab at Bodha.