/fuse-typescript:ts-packagingfrom fuse-typescript
Guides publishing a TypeScript library with correct exports map, JSR vs npm registry choice, dual ESM/CJS, type validation via attw, and provenance.
Ships in fuse-typescript. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Out of scope: application deployment (not a library) and framework-owned build pipelines belong to the framework expert's own skills.
Ship a TypeScript library with a correct exports map, on the right registry.
Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:
After implementation, run fuse-ai-pilot:sniper for validation.
| Registry | Format | Publishes | Best for |
|---|---|---|---|
| JSR | ESM only | TS source directly | Deno/Node/Bun libs, doc-rich APIs |
| npm | ESM (or dual ESM/CJS) | Built .js + .d.ts | Broadest public reach, CJS consumers |
Rule of thumb: internal or Bun/Deno/ESM-only consumer → ESM-pure; broad public library still serving CommonJS → dual ESM/CJS.
"types" first, "default" last - Conditions match in object orderimport↔ESM and require↔CJS - Never point require at ESM"type": "module" explicitlyarethetypeswrong before every publishid-token: writePublishing a TS library?
├── Consumers on Deno/Bun/Node ESM, want source + docs → JSR (ESM only)
│ └── Fix "slow types" (explicit return/prop/const types)
└── Public npm audience
├── ESM-only consumers → ESM-pure package.json
└── Some consumers still on CJS → dual ESM/CJS exports
→ See references/exports-map.md for the conditions model
| Topic | Reference | Load when |
|---|---|---|
| Exports map & conditions | references/exports-map.md | Writing the exports field |
| JSR publishing | references/jsr-publishing.md | Publishing TS source to JSR |
| npm publishing | references/npm-publishing.md | Publishing to npm (dual/ESM) |
| Type validation | references/validation.md | Checking types resolve correctly |
| Template | Use Case |
|---|---|
references/templates/package-json-dual.md | Dual ESM/CJS + ESM-pure package.json |
references/templates/jsr-json.md | jsr.json with multi-entry exports |
references/templates/publish-workflow.md | GitHub Actions release with provenance |
{
"type": "module",
"exports": {
".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
}
}
npx @arethetypeswrong/cli --pack
→ See references/validation.md
"type" explicitly, even for CJS packagestypes in every conditional branch"default" before "types" (breaks type resolution)--allow-slow-types on JSR as a habit (degrades docs + npm compat)references/exports-map.md (opens in a new tab)references/jsr-publishing.md (opens in a new tab)references/npm-publishing.md (opens in a new tab)references/templates/jsr-json.md (opens in a new tab)references/templates/package-json-dual.md (opens in a new tab)references/templates/publish-workflow.md (opens in a new tab)references/validation.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub fusengine/claude-plugins --plugin fuse-typescript7 skills in this plugin
/ts-configUse when creating or migrating a tsconfig.json, choosing module/moduleResolution, or fixing TS 6.0 deprecations that are hard errors in TS 7.0. Not for language syntax (ts-language-patterns)./ts-language-patternsUse when writing or reviewing modern TS syntax — const type parameters, using/await using, standard decorators, satisfies, or LLM anti-patterns (legacy enum/namespace). Not for tsconfig (ts-config)./ts-lint-formatUse when choosing or configuring a TS linter/formatter — Biome 2.x vs ESLint 10 flat config + typescript-eslint typed linting. Not for type checking itself (ts-config).Other plugins' skills for the same job