Skip to content

Commit b6081cc

Browse files
abernierclaude
andauthored
fix: stop publishing the API route (#588)
A Route Handler cannot be statically exported, and `buildWebsite` already leaves `src/app/api` behind when it copies the app — so it only ever travelled as dead weight. With its test that is 37 kB, and `files` now says so, which is also what the copy's exclusion claimed to mirror. `src/app/[...slug]/page.test.ts` still ships. Nothing under a bracketed directory can be excluded through `files` under pnpm — proven on a four-file reproduction: `npm pack` honours `!**/*.test.*` there, `pnpm pack` does not, and neither a directory negation nor an escaped bracket reaches it. Claude-Session: https://claude.ai/code/session_01HfCBpbazo3fr1n2EUXNyh5 Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 8dbee9b commit b6081cc

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

.changeset/drop-api-route.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@pmndrs/docs': patch
3+
---
4+
5+
Stop publishing `src/app/api`. A Route Handler cannot be statically exported, and the CLI
6+
already leaves it behind when it copies the app, so it only ever travelled as dead weight —
7+
37 kB of it, once its test is counted.
8+
9+
One test file still ships, `src/app/[...slug]/page.test.ts`. Nothing under a bracketed
10+
directory can be excluded through `files` under `pnpm`, whatever the pattern: `npm pack` honours
11+
`!**/*.test.*` there, `pnpm pack` does not, and neither a directory negation nor an escaped
12+
bracket reaches it.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
"postcss.config.mjs",
130130
"tsconfig.json",
131131
"!src/stories",
132+
"!src/app/api",
132133
"!**/*.test.*",
133134
"!**/*.stories.*"
134135
]

0 commit comments

Comments
 (0)