fix: derive packed tarball name from package.json for stable alias#80
Merged
Merged
Conversation
The bundle script copied "<scope>-<name>-<version>.tgz" to a stable "mcp-debugger-latest.tgz" alias by listing all *.tgz files in the package directory, sorting them lexicographically, and pop()-ing the last entry. But "mcp-debugger-latest.tgz" itself is in that list, and 'm' > 'd', so pop() returned the alias and the script copied it onto itself — the alias never refreshed. Derive the exact tarball filename from package.json (name + version) so the alias always points at the freshly-packed artifact. Also resolves the existing inline TODO about lexicographic sort misordering semver (0.9.0 > 0.10.0) — there is no sort anymore. Verified by seeding the alias with garbage, rebuilding, and confirming the alias is overwritten with byte-identical content to the fresh versioned tarball. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
Fixes #78 — the
mcp-debugger-latest.tgzalias became stale after its first creation and never refreshed.The bundle script enumerated
*.tgzin the package directory, sorted lexicographically, andpop()-ed the last entry as "latest". Because'm' > 'd',mcp-debugger-latest.tgzalways won that sort overdebugmcp-mcp-debugger-<version>.tgz, so the script copied the alias onto itself. I hit this while verifying #72: the freshly-built version-named tarball was minutes old, but the alias was 7 weeks old and silently exercising a pre-fix build.Fix: derive the expected filename from
package.json(name + version) instead of discovering it viareaddirSync. Also closes the existing inline TODO about lexicographic semver misordering (0.9.0 > 0.10.0) — there is no sort anymore.Test plan
mcp-debugger-latest.tgzwith 13 bytes of garbage, ranpnpm --filter @debugmcp/mcp-debugger run build, confirmed the alias was overwritten with byte-identical content to the fresh versioned tarball (cmpreturned 0).Copied debugmcp-mcp-debugger-0.20.0.tgz → mcp-debugger-latest.tgz(previously the log would have shownmcp-debugger-latest.tgz → mcp-debugger-latest.tgz).fs.readFileSync/JSON.parse/path.join/fs.existsSync/fs.copyFileSync/String.replace) with identical behavior on Windows / macOS / Linux. pnpm pack's<scope>-<name>-<version>.tgznaming is platform-independent.🤖 Generated with Claude Code