Thanks for your interest in TSDX! Contributions are welcome.
If you're proposing a new feature, please open an issue first to discuss it.
# macOS/Linux
curl -fsSL https://bun.sh/install | bash
# Windows
powershell -c "irm bun.sh/install.ps1 | iex"-
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 link
Now you can use
tsdxcommands globally and they'll run your local version.
# Build once
bun run build
# Watch mode (rebuilds on changes)
bun run dev# Run all tests
bun run test
# Watch mode
bun run test:watch
# Run specific test file
bun run test test/cli.test.ts# Lint the codebase
bun run lint
# Auto-fix issues
bun run lint --fixbun run typecheck# Format all files
bun run format
# Check formatting
bun run format:checkAfter 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 testTemplates 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
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
-
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
We follow Conventional Commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changestest:- Test changesrefactor:- Code refactoringchore:- Maintenance tasks
-
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
Feel free to open an issue if you have questions or need help.