npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ts-builds

v2.7.2

Published

Shared TypeScript configuration files for library templates. Provides standardized ESLint, Prettier, Vitest, TypeScript, and build configs.

Readme

ts-builds

npm version Validate

Shared TypeScript build tooling. Bundles ESLint, Prettier, Vitest, TypeScript and provides a CLI for running standardized commands across projects.

Quick Start

New Project

mkdir my-library && cd my-library
pnpm init

# Install (bundles all tooling)
pnpm add -D ts-builds tsdown

# Initialize
npx ts-builds init      # Creates .npmrc with hoist patterns
npx ts-builds config    # Creates ts-builds.config.json

# Create source files
mkdir src test
echo 'export const hello = () => "Hello!"' > src/index.ts

# Validate
npx ts-builds validate

Existing Project

pnpm add -D ts-builds tsdown

npx ts-builds init      # Creates .npmrc
npx ts-builds config    # Creates config file
npx ts-builds cleanup   # Remove redundant dependencies

npx ts-builds validate

CLI Commands

Setup Commands

npx ts-builds init           # Create .npmrc with hoist patterns
npx ts-builds config         # Create ts-builds.config.json
npx ts-builds config --force # Overwrite existing config
npx ts-builds info           # Show bundled packages
npx ts-builds cleanup        # Remove redundant dependencies
npx ts-builds help           # Show all commands

Script Commands

npx ts-builds validate       # Run full validation chain
npx ts-builds format         # Format with Prettier
npx ts-builds format:check   # Check formatting only
npx ts-builds lint           # Lint with ESLint (--fix)
npx ts-builds lint:check     # Check lint only
npx ts-builds typecheck      # TypeScript type checking
npx ts-builds test           # Run tests once
npx ts-builds test:watch     # Watch mode
npx ts-builds test:coverage  # With coverage
npx ts-builds build          # Production build (tsdown or vite)
npx ts-builds dev            # Dev mode (tsdown --watch or vite dev server)
npx ts-builds preview        # Preview production build (vite preview)

Analysis Commands

npx ts-builds size               # Report bundle sizes (raw + gzip)
npx ts-builds size --save        # Save baseline for delta tracking
npx ts-builds doctor             # Check package health (exports, files, types)
npx ts-builds changelog          # Generate changelog from conventional commits
npx ts-builds changelog --since v1.0.0 --version 2.0.0  # From specific tag
npx ts-builds changelog --output CHANGELOG.md            # Write to file

Package.json Scripts

Add these to delegate all commands to ts-builds:

{
  "scripts": {
    "validate": "ts-builds validate",
    "format": "ts-builds format",
    "format:check": "ts-builds format:check",
    "lint": "ts-builds lint",
    "lint:check": "ts-builds lint:check",
    "typecheck": "ts-builds typecheck",
    "test": "ts-builds test",
    "test:watch": "ts-builds test:watch",
    "build": "ts-builds build",
    "dev": "ts-builds dev",
    "prepublishOnly": "pnpm validate"
  }
}

Configuration

Create ts-builds.config.json to customize behavior:

Basic

{
  "srcDir": "./src",
  "validateChain": ["format", "lint", "typecheck", "test", "build"]
}

With Custom ESLint Plugins

If your project uses ESLint plugins not bundled with ts-builds (e.g., eslint-plugin-react-hooks):

{
  "srcDir": "./src",
  "lint": {
    "useProjectEslint": true
  }
}

This tells ts-builds to use your project's ESLint installation instead of the bundled version.

For SPAs/React Apps (Vite)

Use Vite instead of tsdown for SPA builds:

pnpm add -D ts-builds vite
{
  "srcDir": "./src",
  "buildMode": "vite"
}

With buildMode: "vite":

  • ts-builds buildvite build
  • ts-builds devvite (dev server with HMR)
  • ts-builds previewvite preview

Bundle Size Thresholds

{
  "size": {
    "maxTotal": 51200,
    "maxFile": 20480,
    "gzip": true,
    "baselineFile": ".ts-builds-size.json"
  }
}

Changelog

{
  "changelog": {
    "types": { "feat": "Features", "fix": "Bug Fixes" },
    "exclude": ["chore", "ci"]
  }
}

Advanced (Monorepos, Custom Commands)

{
  "srcDir": "./src",
  "commands": {
    "compile": "tsc",
    "docs:validate": "pnpm docs:build && pnpm docs:check",
    "landing:validate": { "run": "pnpm validate", "cwd": "./landing" }
  },
  "chains": {
    "validate": ["validate:core", "validate:landing"],
    "validate:core": ["format", "lint", "compile", "test", "docs:validate", "build"],
    "validate:landing": ["landing:validate"]
  }
}

Run named chains:

npx ts-builds validate:core
npx ts-builds validate:landing

Extendable Configs

ts-builds exports base configurations you can extend:

ESLint

// eslint.config.js
import baseConfig from "ts-builds/eslint"

export default [...baseConfig]

Vitest

// vitest.config.ts
import { defineConfig } from "vitest/config"
import baseConfig from "ts-builds/vitest"

export default defineConfig(baseConfig)

TypeScript

{
  "extends": "ts-builds/tsconfig",
  "compilerOptions": {
    "outDir": "./dist"
  }
}

tsdown

// tsdown.config.ts
import baseConfig from "ts-builds/tsdown"

export default baseConfig

Prettier

{
  "prettier": "ts-builds/prettier"
}

Vite (for SPAs)

// vite.config.ts
import { vite } from "ts-builds/vite"
import { defineConfig, mergeConfig } from "vite"

export default defineConfig(
  mergeConfig(vite, {
    // your customizations
  }),
)

Bundled Packages

Run npx ts-builds info to see all bundled packages. You don't need to install:

  • eslint, prettier, typescript, typescript-eslint, vitest
  • @eslint/js, eslint-plugin-prettier, eslint-plugin-simple-import-sort
  • eslint-config-prettier (flagged by cleanup)
  • @vitest/coverage-v8, @vitest/ui
  • cross-env, rimraf, ts-node

License

MIT