Skip to content

dorayx/template-typescript-library

Repository files navigation

opinionated TypeScript Library Template

This template is opinionated, and it is not meant to be a one-size-fits-all solution. It is meant to be a starting point for my personal projects to bootstrap development, as I like to create minimal viable products from time to time.

User Cases

Features

  • ✅ TypeScript v5
  • ✅ Vite + Vitest
  • ✅ Linters
  • ✅ Code Generator
  • ✅ Semantic Release
  • ✅ GitHub Actions
  • ❌ Monorepo

Tooling

This template is configured with the following tools:

Compiler & Bundler

Package Manager

Testing

  • Vite (v4)
  • Vitest
    • Convention: Unit tests for user cases are stored in the tests/units directory
    • Convention: Unit tests for individual functions are placed in *.test.ts files alongside their respective source files
    • Convention: The file tests/setup.ts is executed before each test file
    • Convention: The tests/tsconfig.json file configures TypeScript for testing
  • GitHub Action: .github/workflows/test.yml

Linters

Code Generator

  • Plop: A micro-generator framework that makes it easy for an entire team to create files with a level of uniformity

Publish

Development Conventions

Branches

  • main: Used for stable features & production releases
  • dev: Used for features under development
  • next: Used for experimental features