A template project for repos with TypeScript NPM packages.
- Repo structure:
src/for source,dist/as build output;.github/workflows/,.husky/, and config files (tsconfig, tsup, ESLint, Prettier) in place. - Build: TypeScript with tsup — CJS + ESM output and
.d.tsfromsrc/index.ts. - Lint & format: ESLint (flat config) and Prettier;
npm run lint,npm run format. - Git hooks: Husky + lint-staged — ESLint and Prettier on pre-commit.
- CI: GitHub Actions — validate (lint, test, build) on PR/push; release workflow publishes to npm on GitHub release (uses
NPM_TOKEN). - Basic docs: CONTRIBUTING.md and LICENSE.
- Create a new repo from this template (e.g. via GitHub “Use this template”).
- Update
package.json: setname,description,repository,bugs,homepage, andkeywordsfor your package. - Run
npm install - Implement your code in
src/and runnpm run buildto produce thedist/output. - Publish with
npm run releasewhen ready.
See more details on how to run releases in CONTRIBUTING.md