A modern, opinionated TypeScript library starter template with best practices and comprehensive tooling setup. This template provides everything you need to build, test, and publish high-quality TypeScript libraries with minimal configuration.
- TSUP for zero-config TypeScript bundling
- Comprehensive linting with ESLint and Prettier
- Bundle size monitoring with size-limit
- Automated versioning and publishing with Changesets
- Quality checks with publint and @arethetypeswrong/cli
- GitHub Actions for CI/CD
- Continuous package testing with pkg.pr.new
- Pre-commit hooks with husky and lint-staged
-
Click the green
Use this template
button at the top of this repository -
Clone your new repository
-
Install dependencies:
pnpm install
-
Update package details:
- Replace all
[*]
placeholders inpackage.json
with your library details - Customize the ESLint and TypeScript configurations as needed
- Replace all
-
Install required GitHub apps on your repository:
- Autofix.ci for automated code fixes
- Changeset Bot for PR changeset validation
- pkg.pr.new for continuous package testing
-
Set up NPM publishing:
- Create an NPM access token
- Add the token as a repository secret named
NPM_TOKEN
pnpm build
- Build all packagespnpm lint:*
- Run various linting checks:lint:eslint
- ESLint checkslint:format
- Prettier formattinglint:check-types
- TypeScript type checkinglint:size
- Bundle size analysislint:publint
- Package publishing validationlint:attw
- Type resolution validation
-
Create a changeset:
pnpm changeset
-
Follow the prompts to describe your changes
-
Commit and push to GitHub
-
A PR will be created by the Changeset bot
-
Merging the PR will:
- Bump versions
- Create a GitHub release
- Publish to NPM
The template includes GitHub Actions for:
- Automated code formatting via autofix.ci
- Linting and type checking
- Automated publishing via Changesets
- Issue management (labeling and assignment)
- Package testing with pkg.pr.new
Contributions are welcome! Please feel free to submit a Pull Request.