Contributing to TSDX
December 29, 2025 · View on GitHub
Thanks for your interest in TSDX! Contributions are welcome.
If you're proposing a new feature, please open an issue first to discuss it.
Prerequisites
Installing Bun
# macOS/Linux
curl -fsSL https://bun.sh/install | bash
# Windows
powershell -c "irm bun.sh/install.ps1 | iex"
Setup
-
Fork this repository to your own GitHub account and clone it:
git clone https://github.com/your-username/tsdx.git cd tsdx -
Install dependencies:
bun install -
Build the CLI:
bun run build -
Link for local development:
bun linkNow you can use
tsdxcommands globally and they'll run your local version.
Development Workflow
Building
# Build once
bun run build
# Watch mode (rebuilds on changes)
bun run dev
Testing
# Run all tests
bun run test
# Watch mode
bun run test:watch
# Run specific test file
bun run test test/cli.test.ts
Linting
# Lint the codebase
bun run lint
# Auto-fix issues
bun run lint --fix
Type Checking
bun run typecheck
Formatting
# Format all files
bun run format
# Check formatting
bun run format:check
Testing Your Changes
Testing the CLI
After building, test your changes by creating a new project:
# Create a test project
cd /tmp
tsdx create test-project --template basic
cd test-project
# Verify it works
bun run build
bun run test
Testing Templates
Templates are in the templates/ directory. After modifying a template:
- Build tsdx:
bun run build - Create a new project:
tsdx create test-project --template <template-name> - Verify the generated project works correctly
Project Structure
tsdx/
├── src/
│ └── index.ts # CLI entry point
├── templates/
│ ├── basic/ # Basic TypeScript template
│ └── react/ # React component template
├── test/
│ ├── cli.test.ts # CLI unit tests
│ └── e2e.test.ts # End-to-end tests
├── package.json
├── tsconfig.json
└── vitest.config.ts
Submitting a PR
-
Create a feature branch:
git checkout -b feature/my-feature -
Make your changes
-
Run all checks:
bun run lint bun run typecheck bun run test bun run build -
Commit your changes with a descriptive message:
git commit -m "feat: add new feature" -
Push and create a pull request:
git push origin feature/my-feature
Commit Message Guidelines
We follow Conventional Commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changestest:- Test changesrefactor:- Code refactoringchore:- Maintenance tasks
Adding a New Template
-
Create a new directory in
templates/:mkdir templates/my-template -
Add the template files (use
basicas reference) -
Register the template in
src/index.ts:const templates = { basic: { ... }, react: { ... }, 'my-template': { name: 'my-template', description: 'Description of my template', }, }; -
Add tests for the new template
-
Update the README to document the new template
Questions?
Feel free to open an issue if you have questions or need help.