Skip to content
Public template

About

A modern, zero-config template for building high-quality TypeScript libraries.

Topics

Resources

Stars

2 stars

Watchers

2 watching

Forks

Repository files navigation

TypeScript Library Starter

Opinionated template for TypeScript libraries. ESM-only, strict types, fast tooling.

Stack

Getting Started

  1. Click Use this template on GitHub
  2. Clone your new repository
  3. Search and replace:
    • ts-lib-starter with your package name
    • 2BAD with your name/organization (keep @2bad/tsconfig and @2bad/axiom as-is)
  4. Update author and contributors in package.json
  5. pnpm install

Scripts

pnpm build            # compile to ESM + generate .d.ts, then validate with publint + attw
pnpm test             # run all tests
pnpm test:unit        # unit tests with coverage
pnpm test:integration # integration tests with coverage
pnpm check            # lint + format check + type check
pnpm fix              # auto-fix lint + formatting

Project Structure

source/   # source code, tests co-located
build/    # compiled output (generated)
  • test:unit and test:integration filter by filename, so name test files *.unit.test.ts or *.integration.test.ts.
  • ~/ is an alias for source/. Imports use .ts extensions.
  • The build keeps the source file tree, so every public entry point needs a matching block in package.json exports (see ./quotes/parts).

Publishing

Configure the package as a trusted publisher on npm for the publish.yml workflow, then create a GitHub release. Prerelease versions such as 1.1.0-beta.0 are published under the matching dist-tag (beta), everything else under latest.

Requirements

  • Node.js >= 26
  • pnpm >= 12

License

MIT

About

A modern, zero-config template for building high-quality TypeScript libraries.

Topics

Resources

Stars

2 stars

Watchers

2 watching

Forks

Used by

Contributors

Languages