fix(registry): match scoped definition names on Windows - #136
Merged
Merged
Conversation
loadDefinition derives the expected name from relative(managerDir, filePath), which returns platform separators. On Windows a scoped definition yields "@apollo\client" and never matches the "@apollo/client" inside the file, so listDefinitions() threw for every scoped package and no registry command ran at all. Reported by @TeeJS in #133, who reproduced it on main with their own definitions removed and deliberately left it unfixed to keep that PR to one concern. Normalising unconditionally rather than branching on sep keeps a single code path on every platform, so Linux CI exercises the same comparison Windows does instead of leaving the Windows branch untested. The regression test reproduces the failure on Linux: a literal backslash in the filename is one filename here rather than a separator, but the string reaching the comparison is byte-identical to what Windows produces. Without the fix it fails with the exact reported error, "Definition name \"@apollo/client\" doesn't match filename \"@apollo\\client.yaml\"". No changeset: @neuledge/registry is private. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NBQQpA86yYzwJUiVz8ph2R
|
moshest
marked this pull request as ready for review
September 8, 2026 23:34
This was referenced Sep 21, 2026
moshest
pushed a commit
that referenced
this pull request
Sep 21, 2026
Validated locally against current main, since the fork's CI runs were gated at action_required and never executed: gdscript 129 sections / 60,921 tokens godot 14,488 sections / 8,136,608 tokens Both match the numbers in the PR description. Plain git sources, so the versions:/min_version: shape that breaks the nightly publish does not apply. Whole-tree scan clean. The earlier exclude_paths objection on this PR was mistaken and was withdrawn; #135 has since added exclude_paths for git sources anyway. Thanks to @TeeJS, who also reported the Windows scoped-name bug fixed in #136 while keeping it out of this PR.
moshest
pushed a commit
that referenced
this pull request
Sep 22, 2026
Releases @neuledge/context 1.2.4 -> 1.2.5 (patch). Consumed one changeset, .changeset/tidy-manual-examples.md, declared as a patch on @neuledge/context and added by #137: preserve code formatting in HTML documentation that uses bare preformatted blocks, including systemd's rendered DocBook manuals. It was the only changeset on main, it names the published package only, and a patch bump is the right size for it. @neuledge/registry 0.0.17 -> 0.0.18 is the automatic dependent bump that changesets emits for the workspace:* dependency. It is "private": true, is not published, appears in no changeset, and matches the shape of the last release PR (#129). Cross-checked recently merged work: #133, #149 and #150 add registry YAML definitions only and #136 changes the private registry package only, so none of them warrants a changeset. No user-facing packages/context change merged without one. Verified against npm before merging: dist-tags.latest for @neuledge/context is 1.2.4 and 1.2.5 is absent from the published version list, so the new version is strictly greater and does not collide. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NBQQpA86yYzwJUiVz8ph2R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
loadDefinitionderives the expected name fromrelative(managerDir, filePath), which returns platform separators. On Windows a scoped definition yields@apollo\client, which never matches the@apollo/clientinside the file:listDefinitions()loads every definition, so one scoped package throws and no registry command runs at all on Windows.Reported by @TeeJS in #133. They reproduced it on
mainwith their own definitions removed, confirmed it doesn't affect Linux CI, and deliberately left it unfixed to keep that PR to one concern. Credit to them — this is their find and their proposed approach.The fix
Normalise the derived name to forward slashes before comparing.
They suggested
split(sep).join("/"), which is correct. I used.replaceAll("\\", "/")instead for one reason:sepis/on Linux, sosplit(sep)leaves backslashes untouched and the Windows behaviour becomes a branch that no Linux CI run ever executes. Normalising unconditionally keeps a single code path on both platforms, so the comparison Linux tests is the comparison Windows runs.Test
The regression test reproduces the failure on Linux. A literal backslash in a filename is one filename here rather than a separator, but the string reaching the comparison is byte-identical to what Windows produces from a real separator.
Verified in both directions rather than assumed:
Definition name "@apollo/client" doesn't match filename "@apollo\client.yaml"pnpm lintclean (neededpnpm fixfor wrapping),pnpm buildcleanpnpm test— 221 context + 49 registry, all passingNo changeset:
@neuledge/registryisprivate: true, and CLAUDE.md scopes changesets to published packages.Scope
The fix and its test only. The Windows path-separator artifact in
doc_pathvalues that @TeeJS also mentioned is a different thing — a display artifact in built output rather than a hard failure — and isn't touched here.🤖 Generated with Claude Code
https://claude.ai/code/session_01NBQQpA86yYzwJUiVz8ph2R
Generated by Claude Code