Skip to content
All projects
ACTIVE Updated September 11, 2026

ts-starter

A personal starter template for TypeScript libraries built to hold my own work to an unreasonable standard.

License Apache-2.0
Updated September 11, 2026
Rank #11 of 19
Overall 24.4 /100
Traction 4.0/100 · Stars 0.0 · Longevity 16.1 Momentum 54.9/100 · Freshness 49.4 · Newness 67.8
Languages TypeScript JavaScript

Source: README on GitHub

A personal starter template for TypeScript libraries built for strictness: nothing merges without passing every gate. 100% coverage, tiny bundles, automated releases, signed publishes. Designed for my own projects. You are welcome to use it too, but I built it to hold my own work to an unreasonable standard.

Customization

Every step below calls out the file and field you need to change. Do not skip anything — the configs reference the package name, repo path, or version directly, and placeholders will break CI.

cp -r ts-starter my-library && cd my-library
rm -rf .git && git init
rm CHANGELOG.md 2>/dev/null    # will be generated by Release Please

2. package.json

FieldWhat to change
nameYour npm package name (e.g. @scope/my-lib). Update this and the npm badge URL in the README.
versionStart at 0.0.0. Release Please manages this from the first merged PR on.
descriptionA one-line summary of what the library does.
exportsUpdate any sub-path exports if your entry structure changes. The ts-starter reference in attw output comes from name.
engines.nodeAdjust the minimum Node version if needed.
size-limit[].limitAfter your first pnpm build, run pnpm size to see actual sizes, then set realistic limits here.
packageManagerShould match pnpm --version. Update if you use a different locked pnpm version.

3. README.md

  • Replace every OWNER/REPO with your GitHub handle and repo name (badges, endpoint URLs, links).
  • Replace the npm version badge URL (ts-starter) with your package name.
  • Rewrite the description and stack badges to match your project.

4. Source code

  • Delete src/math.ts, src/math.test.ts, src/result.ts, and src/result.test.ts.
  • Delete the @/ imports from src/index.ts or rewrite it as your own barrel.
  • Write your library. Keep test files alongside source (src/foo.test.ts). The @ alias (@/) resolves to src/.

5. Biome (optional)

  • Review biome.json rule overrides. The preset is recommended with 48 additional strict rules. Tune anything that does not match your style. Rules that are too opinionated can be set to "off".

6. Size Limit

  • Update size-limit entries in package.json to match your exported symbols. The import field should use the actual named exports your consumers will tree-shake.
pnpm install
pnpm preflight

Everything should be green before you push your first commit. If preflight fails, fix the issue before continuing — the same gates run in CI.

git add -A
git commit -m "chore: initialize from ts-starter template"
git branch -M main
git remote add origin git@github.com:OWNER/REPO.git
git push -u origin main

9. GitHub repository settings

  • Secrets: add NPM_TOKEN (an npm automation token from npmjs.com). If you use npm OIDC instead, you can drop the token and configure id-token: write in publish.yml to use the built-in GITHUB_TOKEN.
  • Actions permissions: under Settings > Actions > General, set Allow all actions and reusable workflows, enable Read and write permissions, and check Allow GitHub Actions to create and approve pull requests. Without this last one, Release Please cannot open release PRs.
  • Branch protection (optional but recommended): require the ci status check to pass before merging to main.

10. npm publishing

  • If you published the package namespace before, make sure the name in package.json is available on npm (npm view <name> should 404).
  • The first Release Please PR will bump 0.0.0 to 1.0.0. Merge it and the package publishes.
  • You can also publish manually: tag a commit with v1.0.0, push the tag, and publish.yml handles the rest.

Scripts

ScriptWhat it does
pnpm buildBuild ESM + CJS with tsup, then emit declarations with tsc
pnpm devWatch mode for development
pnpm checkBiome lint and format check
pnpm check:fixAuto-fix lint and format issues
pnpm typecheckType-check both tsconfigs with TypeScript 7
pnpm testRun tests
pnpm test:coverageRun tests with coverage (100% per-file enforced)
pnpm test:watchWatch mode for tests
pnpm sizeCheck bundle sizes against budget
pnpm knipFind dead code and unused dependencies
pnpm run auditSecurity audit (fails on high or critical)
pnpm pubcheckValidate package exports and types (publint + attw)
pnpm preflightRun everything. If this is green, it ships.

How a Release Works

  1. Write Conventional Commits (feat:, fix:, etc.)
  2. Open a PR to main. CI runs lint, types, tests, coverage, build, size, dead code, audit, and package checks.
  3. Merge the PR. Release Please opens or updates a Release PR with the next version and a changelog.
  4. When you are ready to ship, merge the Release PR. Release Please bumps the version, updates CHANGELOG.md, creates a Git tag, and publishes a GitHub Release.
  5. The tag dispatches publish.yml: it checks out the tag, verifies the version matches package.json, builds, and runs pnpm publish --provenance.

You can also publish manually by pushing a v* tag or running the publish.yml workflow dispatch from the Actions tab.

License

Apache-2.0