fix: correct package.json require path in codeMetadata (version always "Unknown")#186
Merged
jgphilpott merged 2 commits intomainfrom Mar 13, 2026
Merged
Conversation
… number Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix G-code metadata version display issue
fix: correct package.json require path in codeMetadata (version always "Unknown")
Mar 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the require path for package.json in codeMetadata so the version string in G-code metadata resolves correctly instead of always falling back to "Unknown". Strengthens the test to assert the actual version value.
Changes:
- Fixed the relative
requirepath from../../package.jsonto../../../package.jsonincoders.coffee - Updated test to verify the version matches
pkg.versionand rejects"Unknown" - Minor
package-lock.jsonchurn (removedlibcfields)
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/slicer/gcode/coders.coffee | Fix require path to resolve root package.json |
| src/slicer/gcode/coders.test.coffee | Assert actual version value in metadata test |
| package-lock.json | Unrelated lockfile churn |
You can also share your feedback on Copilot code review. Take the survey.
jgphilpott
approved these changes
Mar 13, 2026
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.
; Version:in G-code metadata always emittedUnknownbecause therequirepath was resolved relative to the compiled file's location and pointed at a non-existentsrc/package.json.Changes
src/slicer/gcode/coders.coffee— fix off-by-one directory in require path:src/slicer/gcode/coders.test.coffee— strengthen metadata test to assert the version equals the actualpkg.versionand explicitly rejects"Unknown".🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.