Development workflow
Run commands from the project root: /Users/amrit/fractals/sites/fractaldharma.
Commands
| Command | Use |
|---|---|
pnpm data:build | Build public runtime artifacts from canonical static/data inputs |
pnpm data:rebuild | Rebuild canonical intermediates and then public artifacts |
pnpm test:data | Run artifact, cache, architecture, and fixture tests |
pnpm dev | Start local Vite development server when explicitly needed |
pnpm build | Build data and production application |
pnpm check | Generate 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_patchfor 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-runtimeas 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:
- Which route or interaction needs it?
- What is the smallest stable artifact that answers it?
- Can it be built once rather than joined at runtime?
- Which existing tests need to specify its contract?
This discipline is what keeps a large Sanskrit corpus usable as a responsive site.