Skip to content

oiij/ts-starter

Repository files navigation

ts-starter

TypeScript tsdown Vitest pnpm ESLint VitePress License

A modern TypeScript project starter template with built-in development tools and best practices.

Features

  • 🚀 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

Quick Start

Prerequisites

  • Node.js >= 18
  • pnpm >= 8

Installation

# Clone the repository
git clone https://github.com/oiij/ts-starter.git
cd ts-starter

# Install dependencies
pnpm install

Development

# Start development mode with watch
pnpm dev

# Run the source code directly
pnpm start

# Type checking
pnpm type:check

Building

# Build the project
pnpm build

The build output will be in the dist directory.

Testing

# Run tests
pnpm test

# Run tests with UI
pnpm test --ui

Linting

# Lint code
pnpm lint

# Fix linting issues
pnpm lint:fix

Documentation

# Start documentation site in development mode
pnpm docs:dev

# Build documentation site
pnpm docs:build

# Preview built documentation site
pnpm docs:preview

Committing Changes

This project uses conventional commits with commitlint and cz-git.

# Stage changes and commit with interactive prompt
pnpm commit

# Or use commitizen directly
pnpm cz

Publishing

# Bump version and publish to npm
pnpm release

Scripts

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

Project Structure

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

License

MIT License © 2024 oiij

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (pnpm commit)
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors