Migrating from Manual Setup
If you're manually configuring tsc, package.json, and npm publish, tspub automates the entire workflow.
Step 1: Install
bash
npm install -D @tspub-dev/tspubStep 2: Run Doctor
bash
npx @tspub-dev/tspub doctorThis diagnoses your existing package and shows what needs fixing. Add --fix to auto-repair:
bash
npx @tspub-dev/tspub doctor --fixStep 3: Run Check
bash
npx @tspub-dev/tspub checkThis validates your package.json against 70 rules. Fix issues automatically:
bash
npx @tspub-dev/tspub check --fixStep 4: Add Build
If you're using raw tsc:
json
{
"scripts": {
"build": "tspub build"
}
}tspub generates ESM + CJS + .d.ts in one step, replacing separate tsc and bundler commands.
Step 5: Add Scripts
json
{
"scripts": {
"build": "tspub build",
"check": "tspub check",
"test:types": "tspub test-types",
"prepublishOnly": "tspub build && tspub check"
}
}What You Can Remove
tsc --buildortsc -p tsconfig.build.jsonscripts- Manual
package.jsonfield ordering - Custom publish scripts
- Separate type-checking validation