This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a monorepo for Astro loaders using pnpm workspaces. The main packages are:
packages/- Individual loader packages (@ascorbic/*)packages/utils/- Shared utilities (@ascorbic/loader-utils)demos/- Demo applications using the loaders
Each loader package follows the same structure:
src/- TypeScript source code with main loader implementationdist/- Built output (generated)test/- Vitest test files
All commands should be run from the repository root.
pnpm build- Build all packagespnpm test- Run tests for all packagespnpm check- Run type checking and linting for all packages
pnpm run --filter @ascorbic/csv-loader build- Build specific packagepnpm run --filter @ascorbic/csv-loader test- Test specific packagepnpm run --filter @ascorbic/csv-loader check- Check specific package
pnpm run dev- Start Astro dev serverpnpm run build- Build demo site
All loaders implement the Astro Loader interface:
name- Identifier for the loaderload(options: LoaderContext)- Main loading function that syncs data to Astro's store
@ascorbic/loader-utils provides common functionality:
getConditionalHeaders()- HTTP conditional request headersstoreConditionalHeaders()- Store HTTP cache headers in meta
- Uses
tsupfor TypeScript compilation to ESM publintand@arethetypeswrong/clifor package validation- Workspace dependencies use
workspace:^protocol
- Vitest for unit testing
- Tests in
test/directories within each package
- Uses conventional commits
- Changes tracked using
changesets