commit 5d880ad784668dc187f9d376a07095c1b757ff6f
parent 78e4ce5e48fa9a8e01d9ebde243b138d5c52d8f9
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Mon, 7 Sep 2026 15:53:51 -0400
common: the surface is declared, and mcp admits it depends on it
`common/package.json` had no `exports`, so all ~400 files were public API and
nothing could be moved without grepping seven packages. It now has a map that
preserves every deep import in use — nothing was renamed, nothing moved.
`mcp/package.json` gained `yt-dlp-transcript-common: workspace:*`. It has
imported common all along and resolved through hoisting by accident;
mcp/node_modules now carries the symlink.
THE COMPONENTS PATTERN IS NOT A FALLBACK ARRAY, and that cost a build. The
first attempt used `"./components/*": ["./components/*.tsx", "./components/*.ts"]`
because components/ mixes the two (30 .tsx, 25 .ts including ui/ and charts/).
tsc accepted it; `next build` did not — Turbopack takes the first entry of a
fallback array and stops, so three .ts components failed to resolve
(statsCache, summariesCache, virtualizer) and the build died with
module-not-found. The map now lists those 25 .ts modules explicitly (an exact
key beats a pattern) and keeps `"./components/*": "./components/*.tsx"` for the
rest. A NEW .ts file under components/ needs a new line here.
`styles/tokens.css` is untouched: every app imports it as a relative path from
its own globals.css (`@import "../../common/styles/tokens.css"`), not as a
package subpath. `"./styles/*.css"` is mapped anyway so that stays possible.
Verified: `pnpm --filter editor exec next build` succeeds (a real build, because
an exports map changes RUNTIME resolution, not just types). `tsc --noEmit`
clean in common, editor, export, mcp, homepage, umtool. Tests: common 876/876,
mcp 205/205, scripts 71 pass / 1 skipped. Runtime smoke under tsx from mcp:
`import("yt-dlp-transcript-common/lib/corpus")` resolves, spec 3.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat:
3 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/common/package.json b/common/package.json
@@ -3,6 +3,43 @@
"version": "0.1.0",
"private": true,
"type": "module",
+ "exports": {
+ "./package.json": "./package.json",
+ "./components/aliasesCache": "./components/aliasesCache.ts",
+ "./components/charts/chartExport": "./components/charts/chartExport.ts",
+ "./components/charts/useSearchSeries": "./components/charts/useSearchSeries.ts",
+ "./components/digestCache": "./components/digestCache.ts",
+ "./components/digestStore": "./components/digestStore.ts",
+ "./components/duplicatesCache": "./components/duplicatesCache.ts",
+ "./components/exportAdvancedStorage": "./components/exportAdvancedStorage.ts",
+ "./components/exportFilterStorage": "./components/exportFilterStorage.ts",
+ "./components/originId": "./components/originId.ts",
+ "./components/postsCache": "./components/postsCache.ts",
+ "./components/searchIndex.worker": "./components/searchIndex.worker.ts",
+ "./components/searchIndexWorkerClient": "./components/searchIndexWorkerClient.ts",
+ "./components/searchIndexWorkerProtocol": "./components/searchIndexWorkerProtocol.ts",
+ "./components/searchLayerCache": "./components/searchLayerCache.ts",
+ "./components/searchPipeline": "./components/searchPipeline.ts",
+ "./components/shareUrl": "./components/shareUrl.ts",
+ "./components/siteRegistry": "./components/siteRegistry.ts",
+ "./components/statsCache": "./components/statsCache.ts",
+ "./components/subsCache": "./components/subsCache.ts",
+ "./components/summariesCache": "./components/summariesCache.ts",
+ "./components/themeConfig": "./components/themeConfig.ts",
+ "./components/transcriptCache": "./components/transcriptCache.ts",
+ "./components/transcriptStore": "./components/transcriptStore.ts",
+ "./components/urlState": "./components/urlState.ts",
+ "./components/virtualizer": "./components/virtualizer.ts",
+ "./components/*": "./components/*.tsx",
+ "./lib/*": "./lib/*.ts",
+ "./controller/*": "./controller/*.ts",
+ "./jobs/*": "./jobs/*.ts",
+ "./social/*": "./social/*.ts",
+ "./ytdlp/*": "./ytdlp/*.ts",
+ "./bin/*": "./bin/*.ts",
+ "./styles/*.css": "./styles/*.css",
+ "./styles/*": "./styles/*.ts"
+ },
"scripts": {
"test": "tsx --test \"*.test.ts\" \"{lib,controller,jobs,social,ytdlp,components}/*.test.ts\""
},
diff --git a/mcp/package.json b/mcp/package.json
@@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"type": "module",
- "description": "MCP server exposing a yt-dlp transcript archive (or a federated hub) to Claude Code and other MCP clients — reads the site's static JSON shards.",
+ "description": "MCP server exposing a yt-dlp transcript archive (or a federated hub) to Claude Code and other MCP clients \u2014 reads the site's static JSON shards.",
"bin": {
"yt-dlp-transcript-mcp": "src/index.ts"
},
@@ -15,7 +15,8 @@
"smoke": "tsx bench/smoke.ts"
},
"dependencies": {
- "@modelcontextprotocol/server": "^2.0.0"
+ "@modelcontextprotocol/server": "^2.0.0",
+ "yt-dlp-transcript-common": "workspace:*"
},
"devDependencies": {
"@modelcontextprotocol/client": "^2.0.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
@@ -288,6 +288,9 @@ importers:
'@modelcontextprotocol/server':
specifier: ^2.0.0
version: 2.0.0
+ yt-dlp-transcript-common:
+ specifier: workspace:*
+ version: link:../common
devDependencies:
'@modelcontextprotocol/client':
specifier: ^2.0.0