pnpm-dev-kit
v0.0.5
Published
PDK (pnpm dev kit), an efficient pnpm workspace development and publishing tool
Readme
Features
- 💻 Dev Mode: Quickly launch on-demand development builds for monorepo packages
- 🚀 Release Management: Automated version bumping and publishing
- 🔧 Patch System: Repair failed package publications
- 📝 Changelog Generation: Automatic, customizable changelog creation
- 🏷️ GitHub Release: Automatic GitHub release creation with changelog extraction
Install
# Using npm
npm install --save-dev pnpm-dev-kit
# Using yarn
yarn add --dev pnpm-dev-kit
# Using pnpm
pnpm add -D pnpm-dev-kitFor global installation:
npm install -g pnpm-dev-kitUsage
Development Mode
Quickly start development mode to build packages on demand when files change:
# Using the CLI
pdk dev
# Or with npm script
npm run devInteractive Features:
- Type
nto select a package to build manually - Type
psto list running processes - Type package name to build a specific package
Release Process
Standard Release:
# Complete release (recommended)
pdk release --push-tag --create-github-release
# Canary release for CI/CD
pdk release --canaryRelease Flow:
- Select version type (patch/minor/major/prerelease)
- Choose NPM tag (latest/next/beta)
- Update workspace dependencies
- Publish packages to NPM
- Create git tag and push to remote
- Generate CHANGELOG.md
- Create GitHub Release
Failed Release Recovery:
pdk patch --version 1.0.0 --tag latestChangelog Generation:
# Standard changelog
pdk changelog --version 1.0.0 --beautify --commit --git-push
# AI-powered changelog
pdk changelog --version 1.0.0 --use-ai --provider openai --model gpt-4oGitHub Release:
pdk github-release --version 1.0.0
pdk github-release --dry-run # PreviewKey Options:
--dry-run: Preview without changes--run-in-band: Publish packages in series--build: Custom build script before release--ignore-scripts: Skip npm scripts--auto-create-release-branch: Auto-create release branch--filter-scopes: Filter by scope (default: tars,agent,tarko,o-agent,tars-stack,browser,infra,mcp,all)--filter-types: Filter by commit type (default: feat,fix)
Configuration
package.json Scripts:
{
"scripts": {
"dev": "pdk dev",
"release": "pdk release --push-tag",
"release:full": "pdk release --push-tag --create-github-release",
"release:canary": "pdk release --canary",
"github-release": "pdk github-release",
"changelog": "pdk changelog",
"patch": "pdk patch --version $(node -p \"require('./package.json').version\") --tag latest"
}
}Workspace Setup:
- Uses
pnpm-workspace.yamlfor package discovery - Follows conventional commit standards
- Auto-updates internal workspace dependencies
CI/CD Integration:
# .github/workflows/release.yml
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm install -g pnpm
- run: pnpm install
- run: pnpm run release:full
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}Best Practices:
- Always release from latest main branch
- Ensure clean working directory
- Run tests before release
- Use
--dry-runfor testing - Canary format:
{version}-canary-{commitHash}-{timestamp} - Auto-rollback on publish failure
License
This project is licensed under the Apache License 2.0.
