src/is the Vue 3 library source.src/components/*/contains SFC components (PascalCase folders,*.vuefiles) andindex.tsbarrel exports.src/utils/,src/types/,src/composables/contain shared helpers, types, and composables.- Library entry points and styles are exported via
src/exports.tsandsrc/index.css.
test/contains Vitest specs (e.g.test/index.test.ts,test/plugins/*.test.ts).playground/andplayground-nuxt/are local demo apps for manual testing.docs/is the VitePress documentation site.scripts/contains maintenance utilities (DTS build, peer-deps checks, doc sync scripts).
Use pnpm (see package.json#packageManager). Key commands:
pnpm dev/pnpm play: run the Vite playground.pnpm build: build the library bundles and generate.d.ts.pnpm test/pnpm test:ui: run tests (CLI/UI).pnpm typecheck: runvue-tsc --noEmit.pnpm lint/pnpm lint:fix: ESLint checks/fixes.pnpm docs:dev/pnpm docs:build: run/build VitePress.
- TypeScript-first, Vue 3 SFCs.
- Indentation: 2 spaces, LF endings (see
.editorconfig). - Components:
PascalCasefolder + file names (e.g.src/components/CodeBlockNode/CodeBlockNode.vue). - Helpers:
camelCasefunctions; follow existing file naming insrc/utils/. - Linting uses
@antfu/eslint-configviaeslint.config.mjs.
- Framework: Vitest (
pnpm test). - Prefer small, focused unit tests for parsers/components; name files
*.test.tsundertest/. - Update snapshots with
pnpm test:update.
- Commit messages follow Conventional Commits (e.g.
feat:,fix:,docs:,chore:). - Link issues using GitHub keywords when applicable (e.g.
close: #123). - PRs should include: clear description/rationale, linked issues, and screenshots/GIFs for UI-visible changes.
- Before requesting review: run
pnpm lint,pnpm typecheck, andpnpm test, then sanity-check the playground.
- Keep
peerDependenciesaccurate; large integrations (e.g.mermaid,katex) are peers and may be optional. - Verify local peer installs with
pnpm run check:peer-deps.