Prompt
I’m building a small TypeScript library that other devs will use. What tools should I use to build, test, and publish it in 2026?
Latest observation
Here's a current stack for building, testing, and publishing a small TypeScript library in 2026, based on live search results.
Build The most widely used bundler for TS libraries is still tsup — it's the default, boring, works choice, with 1.2M+ weekly downloads and an esbuild base that makes it roughly 50x faster than Rollup-based alternatives. A fast-rising challenger is tsdown (built on Rolldown/Oxc by the Vite team, purpose-built for libraries), which benchmarks show is about 2x faster than tsup for standard builds and up to 8x faster when generating TypeScript declaration files, while staying compatible with tsup's main options for an easy migration. There's also bunup, a Bun-based bundler some early adopters use for very fast local builds, though it's less established. tsup is the safe default; tsdown is worth it if you want the newest tooling and don't mind a smaller ecosystem.
Whatever bundler you pick, run tsc --noEmit as a separate CI step — bundlers like tsup and esbuild don't actually type-check, so tsc is still needed for type checking even though it's no longer used for production transpilation.
Testing Vitest is the clear default — it offers the best out-of-the-box TypeScript support via Vite, and integrates cleanly with a Vite/esbuild-based toolchain.
Linting & formatting This is genuinely a live debate right now. ESLint remains the safe default, with 50M+ weekly downloads and an irreplaceable plugin ecosystem, while Biome is the best choice for greenfield projects that want one fast Rust-based tool for linting and formatting with no separate Prettier step, and Biome v2 now even ships type-aware linting that used to require @typescript-eslint. For a small new library with no legacy config, Biome is a very reasonable single-tool pick; if you need specific ESLint plugins (React hooks rules, accessibility edge cases, import-cycle detection), ESLint + Prettier is still more complete.
Packaging correctness
Run publint and @arethetypeswrong/cli (attw) before publishing to catch broken package.json exports and type resolution issues — this is standard practice and prevents the most common "works for me, broken for consumers" bug reports. On format: some library authors in 2026 are shipping ESM-only to sidestep the dual CJS/ESM package hazard entirely, though whether that's right for you depends on your target audience's runtime environment.
Versioning & release Changesets paired with GitHub Actions is the standard combo — the modern TypeScript package workflow comes down to three pieces: a bundler for building, changesets for versioning, and GitHub Actions for automation, after which publishing happens automatically on merge.
Where to publish: npm vs JSR npm is the default, but JSR (Deno's registry) is a legitimate alternative or companion for TS libraries now, especially if you want to publish raw TypeScript with stronger type-checking at publish time. The right call depends less on which is more popular and more on the operating model you're willing to own afterward — think of it as a fit decision, not a popularity contest.
Recommended stack: pnpm + tsup (or tsdown for cutting-edge speed) + Vitest + Biome (or ESLint/Prettier if you need specific plugins) + Changesets + GitHub Actions, gated by tsc --noEmit, publint, and attw, publishing to npm and optionally JSR.
Brands
Citations
- https://www.pkgpulse.com/guides/tsup-vs-unbuild-vs-pkgroll-2026
- https://tsdown.dev/advanced/benchmark
- https://medium.com/@ramunarasinga/tsdown-the-elegant-bundler-for-libraries-powered-by-rolldown-bddee176882d
- https://www.pkgpulse.com/guides/best-typescript-build-tools-2026
- https://testdino.com/blog/javascript-testing-frameworks
- https://dev.to/royce_fabbd83cb268312e928/biome-vs-eslint-vs-oxlint-js-linters-2026-408h
- https://www.pkgpulse.com/guides/how-to-migrate-eslint-to-biome
- https://snipshift.dev/blog/publish-typescript-npm-package-2026
- https://www.pkgpulse.com/guides/jsr-vs-npm-publishing-typescript-2026
- https://reintech.io/blog/how-to-build-typescript-library-npm-publishing