Template repo for building a modern TypeScript library optimized for minimal setup and maintenance effort
An opinionated template repo configured with the following:
- Typescript
- ESM only
- Node >= 20
- Test using Vitest
- Prettier (see
package.json
for config) - Typescript ESLint (strict & typed mode)
- Github Actions deployment to npm on push to
main
branch - Github dependabot configured for weekly updates
- Auto-approve dependabot changes after lint, built, and tests pass
- Auto package version bump on push to
main
branch (based on Conventional Commits conventions) - Github Release generation on deployment (based on Conventional Commits conventions)
- Yarn with
nodeLinker: node-modules
- Block commits on lint/format issues (using
lint-staged
) - VS Code config with suggested eslint and prettier extensions
- VS Code configured for auto-save
- Replace
I Forgot To Add My Name Here
on the copyright line with your name
name
: Your package namerepository
: Your repo infokeywords
: Keywords to help people find your package
NOTE: The package must have been published at least once with `npm publish` in order to be able to generate a granular token scoped to the specific package.
- Get a token from npmjs.com
- Add a secret with the npm token to be used by Github Actions. The secret must be named
NPM_TOKEN
.
There are actually two options:
- Enable auto-merge for the repo (only avaylable for public repos or paid accounts as of this writing)
- Disable the auto-merge option by removing it from
.github/workflows/dependabot.yml
- Run
yarn
at the root to install all the dependencies and register the new package name before pushing the initial commit - Ensure that any commits follow Conventional Commits conventions in order for the version bump and release notes to work appropriately.
yarn build
yarn lint
yarn test
yarn smoke
- runs build, lint, and test
See docs