/CLAUDE.md
CLAUDE.md at /CLAUDE.md
Path: CLAUDE.md
@takazudo/mdx-formatter
AST-based markdown and MDX formatter powered by a Rust engine (via napi-rs). Published as a scoped npm package (ESM-only).
Tech Stack
Language: TypeScript (strict mode, ES2022 target, Node16 module resolution)
Runtime: Node.js >= 18
Package manager: pnpm
Test framework: vitest
Linting: ESLint (flat config) + Prettier + lefthook (pre-commit hooks)
Build:
tsc(output todist/)Doc site: zudo-doc 5.2.1 / zfb (workspace in
doc/; Node.js >= 22)Rust implementation: Production-ready Rust engine in
crates/(markdown-rs + napi-rs + WASM)
Commands
pnpm build # Compile TypeScript to dist/
pnpm test # Run tests (vitest run)
pnpm test:watch # Watch mode
pnpm test:coverage # Coverage report
pnpm lint # ESLint check
pnpm lint:fix # ESLint autofix
pnpm check # Prettier + ESLint check
pnpm check:fix # Prettier + ESLint autofix
pnpm build:wasm:doc # Build/copy the WASM assets required by the docs playground
pnpm doc:start # Run the zfb docs dev server (port 4321) plus doc-history (port 4322)
pnpm --dir doc check # Run zfb's docs type/content checks
pnpm --dir doc build # Build the static zfb docs site to doc/dist/
pnpm --dir doc preview # Preview doc/dist/ with zfbConventions
Commits: Start with a scope prefix, then a short description:
[formatter]- main formatter script (src/, test/, build, CLI)[doc]- documentation site related updates (doc/)[claude]- Claude Code related tweaks (.claude/, CLAUDE.md)[misc]- other things (CI, dependencies, config, etc.)
Unused vars: Prefix with
_(enforced by ESLintargsIgnorePattern: '^_')Imports: Always use
.jsextension in TypeScript imports (required for ESM with Node16 resolution)Console:
no-consoleiswarneverywhere exceptsrc/andcli. ts format-stdin.jsDocs: zudo-doc owns the generated layout, chrome, routes, and default islands. Keep authored docs in
doc/; add supported customization through zudo-doc's configuration and chrome bindings rather than altering generated framework internals.src/ content/
Package Publishing
Scoped package:
@takazudo/mdx-formatter+ 4 platform binary packages (npm/*, pnpm workspace members pinned asworkspace:X.Y.ZoptionalDependencies)filesfield limits published content to:dist/,format-stdin.js,README.md,LICENSEprepublishOnlyrunstsc && vitest runautomaticallyUse
/for ALL releases (stable, prerelease, promotion) — one-call autonomous: bump, changelog, CI wait, tag; the tag triggersl- make- release release.ymlwhich auto-publishes all 5 packages via the repoNPM_TOKEN. Pass--confirmfor interactive vettingNever run
npm publish/pnpm publishlocally — publishing happens only inrelease.yml(the root package MUST go throughpnpm publishthere, which rewrites theworkspace:specifiers)