This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
TSDX is a zero-config CLI for TypeScript package development. Version 2.0 is a complete rewrite using modern Rust-based tooling: bunchee (bundling), vitest (testing), oxlint (linting), and oxfmt (formatting).
bun install # Install dependencies
bun run build # Build CLI with bunchee
bun run dev # Watch mode (rebuilds on changes)
bun run test # Run all tests with vitest
bun run test:watch # Run tests in watch mode
bun run test test/cli.test.ts # Run a specific test file
bun run lint # Lint with oxlint
bun run typecheck # TypeScript type checking
bun run format # Format with oxfmt
bun run format:check # Check formattingTests require a build first since they test the compiled CLI:
bun run build && bun run testThe e2e tests create projects in temp directories and have longer timeouts (60s).
Single CLI Entry Point: src/index.ts contains all CLI commands using Commander.js:
create- scaffolds projects from templates, installs deps with bunbuild/dev- wraps buncheetest- wraps vitestlint- wraps oxlintformat- wraps oxfmttypecheck- wraps tscinit- adds tsdx config to existing project
Templates: templates/basic/ and templates/react/ are copied directly during create. Template gitignore files are renamed to .gitignore post-copy. <year> and <author> placeholders in LICENSE are replaced.
- Create directory in
templates/ - Register in
src/index.tsin thetemplatesobject - Include: package.json, tsconfig.json, vitest.config.ts, src/, test/, gitignore (not .gitignore), LICENSE with
<year>and<author>placeholders
The documentation site is in ./website/ and built with:
- Next.js 16 - React framework
- Fumadocs - Documentation framework (fumadocs-core, fumadocs-mdx, fumadocs-ui)
- Tailwind CSS v4 - CSS-first configuration
- IBM Plex Sans/Mono - Typography via next/font/google
cd website
bun install # Install dependencies
bun run dev # Start dev server
bun run build # Build for productioncontent/docs/- MDX documentation filescontent/docs/meta.json- Sidebar navigation structureapp/- Next.js App Router pagesapp/layout.config.tsx- Navigation and logo configuration
- Create
.mdxfile incontent/docs/ - Add frontmatter with
titleanddescription - Add page to
content/docs/meta.jsonin desired position - Use
---Section Name---syntax in meta.json for sidebar sections
Uses Conventional Commits: feat:, fix:, docs:, test:, refactor:, chore:
Uses changesets for version management and npm publishing.
When making changes that should be released:
bun run changesetFollow the prompts to select version bump type (patch/minor/major) and describe the change.
- Create a changeset with your PR
- Merge PR to main
- GitHub Action creates a "Release" PR with version bumps
- Merge the Release PR to publish to npm
bun run changeset version # Apply version bumps from changesets
bun run release # Build and publish to npm