A modern TypeScript project starter template with built-in development tools and best practices.
- 🚀 TypeScript - Type-safe development
- 📦 tsdown - Fast TypeScript bundler for library development
- ✅ Vitest - Lightning fast unit testing
- 🔍 ESLint - Code linting with @antfu/eslint-config
- 📝 Commitlint - Conventional commit messages
- 🪝 Git Hooks - Pre-commit hooks with simple-git-hooks
- 📚 VitePress - Documentation site generator
- 🔄 pnpm - Fast, disk space efficient package manager
- Node.js >= 18
- pnpm >= 8
# Clone the repository
git clone https://github.com/oiij/ts-starter.git
cd ts-starter
# Install dependencies
pnpm install# Start development mode with watch
pnpm dev
# Run the source code directly
pnpm start
# Type checking
pnpm type:check# Build the project
pnpm buildThe build output will be in the dist directory.
# Run tests
pnpm test
# Run tests with UI
pnpm test --ui# Lint code
pnpm lint
# Fix linting issues
pnpm lint:fix# Start documentation site in development mode
pnpm docs:dev
# Build documentation site
pnpm docs:build
# Preview built documentation site
pnpm docs:previewThis project uses conventional commits with commitlint and cz-git.
# Stage changes and commit with interactive prompt
pnpm commit
# Or use commitizen directly
pnpm cz# Bump version and publish to npm
pnpm release| Script | Description |
|---|---|
pnpm dev |
Start development mode with watch |
pnpm build |
Build the project |
pnpm start |
Run source code directly |
pnpm test |
Run tests |
pnpm lint |
Lint code |
pnpm lint:fix |
Fix linting issues |
pnpm type:check |
Run TypeScript type checking |
pnpm docs:dev |
Start documentation site |
pnpm docs:build |
Build documentation site |
pnpm commit |
Interactive commit with conventional commits |
pnpm release |
Bump version and publish |
pnpm update:deps |
Update dependencies interactively |
ts-starter/
├── src/ # Source code
├── test/ # Test files
├── docs/ # VitePress documentation
├── dist/ # Build output
├── package.json # Package configuration
├── tsconfig.json # TypeScript configuration
├── tsdown.config.ts # tsdown configuration
├── vitest.config.ts # Vitest configuration
└── eslint.config.js # ESLint configuration
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
pnpm commit) - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request