Skip to content

posva/template-lib-ts

template-lib-ts

npm version ci

A modern, AI-ready TypeScript library template.

  • ⚡ Ultra-fast formatting, linting, and bundling with the oxc toolchain
  • 🤖 AGENTS.md support for AI-assisted development
  • 🔁 Claude Code hooks for automated linting on stop
  • 📦 Automatic release previews on every PR with pkg.pr.new
  • 🚀 One-command interactive release with changelog generation
  • 🏷️ Better GitHub labels and repo settings out of the box

Getting Started

  1. Fork or clone this repository
  2. Follow the Migration Checklist below to customize it for your library
  3. Replace src/useHello.ts with your own code
  4. Run pnpm install and start developing

Migration Checklist

After forking, find & replace template-lib-ts with your package name, then go through these steps:

  1. Find & replace template-lib-ts with your package name in all files
  2. Update globalName in tsdown.config.ts (e.g. PosvaTemplateLibYourLibName)
  3. Update package.json: description, keywords, homepage, bugs, repository
  4. Update LICENSE year and copyright holder
  5. Update release.yml repo condition (github.repository == '...')
  6. Set up npm trusted publishing (see comments in release.yml)
  7. Set up pkg.pr.new (optional): install the GitHub App on your repo, or remove .github/workflows/pkg.pr.new.yml
  8. Set up Settings (optional): install the GitHub App on your repo and update .github/settings.yml, or remove it
  9. Set up Codecov (optional): add codecov/codecov-action step to ci.yml
  10. Replace src/ with your library code
  11. Update AGENTS.md: title, description, and Architecture section to match your project

Scripts

Command Description
pnpm dev Start Vitest UI
pnpm build Build with tsdown
pnpm test Build + test + typecheck
pnpm test:cov Run tests with coverage
pnpm test:types Typecheck
pnpm lint Lint with oxlint
pnpm fmt Format with oxfmt
pnpm release Interactive release script
pnpm size Check bundle size

License

MIT

About

Modern TypeScript library template with ultra-fast oxc toolchain

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors