Repository navigation
Commit 6c39053
fix(metadata): the /library subpath needs an index.ts, or scripts/ typechecks against dist
`tsconfig.scripts.json` maps `@metaobjectsdev/metadata/*` to
`packages/metadata/src/*` so the repo-root `scripts/` typecheck reads workspace
SOURCE — its own comment says so, and the reason is that a bare import and a
relative import to the same file would otherwise be two class declarations.
`/library` was the one subpath with no `index.ts` to land on: `/core` has one,
the root entry has one, and `package.json` pointed `/library` straight at
`library-sources.ts`. So the mapping missed, tsc fell through to `node_modules`,
and found `dist/library/library-sources.d.ts`. That file exists on a machine that
has built and does not exist on a fresh checkout, where the `gates` lane runs
`bun install` and never builds. Hence green here, `TS2307` × 4 there.
`--traceResolution` before: `src/library/index.ts` does not exist → node_modules.
After: `src/library/index.ts` exists - use it as a name resolution result. The
fallback is never reached, so the result no longer depends on a warm `dist/`.
`package.json` now names the index for all three conditions, which is what every
other subpath does. The exported surface is unchanged — both modules were loaded
and their key sets compared, and the eleven names are identical.
The gate's own instruction is "fix the error; do not widen this gate", so nothing
in `tsconfig.scripts.json` moved.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011cQxyVuTkdPmAduLiedNEg1 parent 0b20f0b commit 6c39053
2 files changed
Lines changed: 20 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments