Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lazy-lines-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"swagger-typescript-api": patch
---

Bring "sta" command back to life, accidentally removed by a tsdown upgrade.
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.cts",
"bin": {
"sta": "./dist/cli.mjs",
"swagger-typescript-api": "./dist/cli.mjs"
},
"files": [

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Removing the static bin declaration from package.json makes CLI availability depend entirely on tsdown rewriting the manifest at build/pack time. This breaks workflows where prepack does not run, such as git dependency installs (npm install <git-repo>) and npm link before a local build, because the source manifest no longer advertises any bin commands. A safer alternative is to keep the bin field in package.json and set exports: { bin: false } in tsdown.config.ts so tsdown stops overwriting it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At package.json, line 28:

<comment>Removing the static `bin` declaration from `package.json` makes CLI availability depend entirely on `tsdown` rewriting the manifest at build/pack time. This breaks workflows where `prepack` does not run, such as git dependency installs (`npm install <git-repo>`) and `npm link` before a local build, because the source manifest no longer advertises any bin commands. A safer alternative is to keep the `bin` field in `package.json` and set `exports: { bin: false }` in `tsdown.config.ts` so tsdown stops overwriting it.</comment>

<file context>
@@ -25,10 +25,6 @@
-    "sta": "./dist/cli.mjs",
-    "swagger-typescript-api": "./dist/cli.mjs"
-  },
   "files": [
     "dist",
     "templates"
</file context>

"dist",
"templates"
Expand Down
7 changes: 6 additions & 1 deletion tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ export default defineConfig({
dts: true,
format: ["esm", "cjs"],
sourcemap: true,
exports: true,
exports: {
bin: {
sta: "./index.ts",
"swagger-typescript-api": "./index.ts",
},
},
});