You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b1d9ca9
Browse filesBrowse the repository at this point in the historyBrowse files
fix(gate): the subpath gate must compare against the DECLARED target, not just find a file
Six findings from `/code-review high` on the previous commit. The one that
mattered: the gate checked that `src/<subpath>` resolves and never compared that
result to what the package's `bun` condition declares — so tsc and the runtime
could read DIFFERENT modules and the gate stayed green. Proven by reverting
`./library`'s `bun` to `library-sources.ts` with `index.ts` still present: the old
gate passed while `paths` read the index and bun read the other file. That is the
type-level form of the identity defect `tsconfig.scripts.json`'s own rationale is
written against, and following `library/index.ts`'s instruction to re-export new
modules there would have typechecked clean and been `undefined` at runtime. The
gate now resolves both sides and compares them by realpath; the same mutation now
fails it, naming both files.
Three more holes in the gate itself, all of which let something escape unchecked:
a subpath declaring no `bun` condition was skipped rather than failed, though it
is precisely a TS subpath the scripts typecheck cannot reach through source; a
subpath PATTERN (`./templates/*`) was treated as a literal and would have reported
a false miss against a correct package; and a `paths` target not shaped
`<pkgRoot>/src/*` made the derived manifest path miss, which `continue`d silently
and dropped that whole package from the gate. Patterns are now skipped explicitly,
the other two fail loudly.
And a premise correction, in three headers and the commit before this one.
"A directory deeper than the substitution can reach" is WRONG: `paths` `*` matches
across `/`, which is why `@metaobjectsdev/codegen-ts/templates/entity-file`
resolves to `src/templates/entity-file.ts` without trouble. The actual rule is
that the subpath NAME must mirror the layout under `src/` — `vocabulary-rewrite-yaml`
named a module living at `src/core/vocabulary-rewrite-yaml.ts`. Stated the wrong
way, the next maintainer concludes a nested module can never back a subpath and
flattens files out of `core/` for no reason. Renaming the export to
`./core/vocabulary-rewrite-yaml` would have satisfied the rule more cheaply; the
shim stays because that subpath is public API of a published package.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011cQxyVuTkdPmAduLiedNEg
0 commit comments