All skills
onmax avatar

/ts-library

@50538df

Use when authoring TypeScript libraries or npm packages - covers project setup, package.json exports, build tooling (tsdown/unbuild), API design patterns, type inference tricks, testing, and publishing to npm. Use when bundling, configuring dual CJS/ESM output, or setting up release workflows.

  • 20 files
  • 73.4 KB
  • MIT
  • Updated 7 months ago
  • GitHub

Use this Skill: https://skilld.dev/gh/onmax/claude-config/ts-library

This session only. Nothing lands on disk.

referencesrelease.md

≈696 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Release Workflow

Tools

Tool Purpose
bumpp Interactive version bumping
changelogen Changelog generation from commits
pkg-pr-new PR preview packages

bumpp (Version Bumping)

pnpm add -D bumpp
{
  "scripts": {
    "release": "bumpp"
  }
}

Interactive prompt for patch/minor/major. Options:

{
  "scripts": {
    "release": "bumpp --commit --tag --push"
  }
}

For monorepos:

bumpp -r    # Recursive
bumpp packages/*/package.json  # Specific packages

changelogen (Changelog)

pnpm add -D changelogen
{
  "scripts": {
    "changelog": "changelogen --release"
  }
}

Combined workflow:

{
  "scripts": {
    "release": "changelogen --release && bumpp"
  }
}

Full Release Flow

{
  "scripts": {
    "release": "pnpm lint && pnpm test && changelogen --release && bumpp --commit --tag --push"
  }
}

CI publishes to npm on tag push.

pkg-pr-new (PR Previews)

For publishable packages. Creates install links on PRs.

# .github/workflows/pkg-pr-new.yml
name: Publish PR
on: pull_request

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: pnpm
      - run: pnpm install
      - run: pnpm build
      - run: pnpm dlx pkg-pr-new publish --compact --pnpm

For monorepos:

pnpm dlx pkg-pr-new publish --compact --pnpm './packages/*'

PR comment shows:

pnpm add https://pkg.pr.new/your-org/your-package@123

Conventional Commits

For changelogen to work:

feat: add dark mode support
fix: resolve memory leak in parser
docs: update README
chore: update dependencies

npm Publishing

Token-based (legacy)

- run: pnpm publish --access public --no-git-checks
  env:
    NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

OIDC (Recommended)

No token needed. See ci-workflows.md for full setup.

- run: pnpm publish --access public --no-git-checks --provenance

Monorepo Publishing

With pnpm:

pnpm -r publish --access public

With bumpp:

bumpp -r && pnpm -r publish

Pre-release Versions

bumpp --preid beta   # 1.0.0 -> 1.0.1-beta.0
bumpp --preid alpha  # 1.0.0 -> 1.0.1-alpha.0

Package.json Requirements

{
  "name": "@scope/package",
  "version": "1.0.0",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/org/repo.git"
  },
  "publishConfig": {
    "access": "public"
  }
}

repository required for npm provenance.

Source: SKILL.md on GitHub

No third-party reports yet.

Signed by skilld at 50538df. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 15 hours ago.

Activeupdated 7 months ago

README badge

README badge for onmax/claude-config/ts-library