Investigating mdsmith bundling in VS Code extension - #247
Merged
Conversation
- Add @mdsmith/cli as optional dependency in package.json - Create binary.ts module to resolve bundled binary path - Update extension.ts to use bundled binary as fallback when mdsmith.path is the default 'mdsmith' string - Update .vscodeignore to ship bundled binary in .vsix - Update README and package.json descriptions to document bundling - Add unit tests for binary resolution logic The extension now bundles the mdsmith binary from npm, eliminating the need for manual installation in most cases. When the optional dependency install fails (proxies, offline), the extension falls back to PATH resolution. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: jeduden <1117699+jeduden@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #247 +/- ##
=======================================
Coverage 95.32% 95.32%
=======================================
Files 160 161 +1
Lines 20131 20155 +24
=======================================
+ Hits 19189 19213 +24
Misses 578 578
Partials 364 364
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR explores bundling the mdsmith CLI with the VS Code extension by adding runtime binary-path resolution that prefers a bundled npm-provided executable when mdsmith.path is left at its default.
Changes:
- Added
resolveBinary()to prefer a bundled@mdsmith/clibinary wrapper undernode_modules/.bin/whenmdsmith.path === "mdsmith". - Added Bun unit tests for the binary resolution logic.
- Updated VS Code extension packaging/docs to include the bundled npm dependency and explain the new default behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| editors/vscode/src/extension.ts | Uses resolveBinary() to select the server command instead of always spawning the configured string directly. |
| editors/vscode/src/binary.ts | Implements bundled-binary lookup under the extension’s node_modules/.bin. |
| editors/vscode/src/binary.test.ts | Adds unit tests for binary resolution behavior. |
| editors/vscode/README.md | Updates prerequisites and settings docs to describe bundled binary behavior. |
| editors/vscode/package.json | Adds @mdsmith/cli as an optional dependency and updates the mdsmith.path description accordingly. |
| editors/vscode/.vscodeignore | Re-includes @mdsmith/* and selected .bin wrappers in the packaged .vsix. |
Agent-Logs-Url: https://github.com/jeduden/mdsmith/sessions/17cbae91-624a-47cc-b72a-9787298ed65d Co-authored-by: jeduden <1117699+jeduden@users.noreply.github.com>
- Add optional platform and fileExists parameters to resolveBinary - Update tests to pass parameters instead of mocking process.platform and global.existsSync - Clarify cross-platform bundling behavior in comments (npm installs ALL optional deps during packaging) Agent-Logs-Url: https://github.com/jeduden/mdsmith/sessions/cc332da0-56a7-4c58-8486-2cbcf0a9db86 Co-authored-by: jeduden <1117699+jeduden@users.noreply.github.com>
- Update build.ts to copy platform binaries from @mdsmith/* to dist/bin/
- Update binary.ts to resolve from dist/bin/{platform}-{arch}-{binary}
- Update binary.test.ts to test new resolution with platform+arch params
- Update .vscodeignore to remove node_modules inclusions (dist/ is included by default)
- Binaries now ship in .vsix even with --no-dependencies flag
Agent-Logs-Url: https://github.com/jeduden/mdsmith/sessions/9b3811b3-360e-4209-97ad-c9d8af603b87
Co-authored-by: jeduden <1117699+jeduden@users.noreply.github.com>
- Update README to explain binaries are copied to dist/bin/ during build - Update package.json setting description with accurate bundling details - Clarify that single .vsix works on all platforms via build-time copy Agent-Logs-Url: https://github.com/jeduden/mdsmith/sessions/9b3811b3-360e-4209-97ad-c9d8af603b87 Co-authored-by: jeduden <1117699+jeduden@users.noreply.github.com>
- Remove bold formatting from "VS Code 1.85 or later" to fix MDS018 - Auto-fix table formatting to fix MDS025 Agent-Logs-Url: https://github.com/jeduden/mdsmith/sessions/c36bb1ca-3452-44b2-8c07-7f4ca32aebea Co-authored-by: jeduden <1117699+jeduden@users.noreply.github.com>
- Remove unused readdirSync import from build.ts - Update comments to clarify only host platform binary is bundled due to npm os/cpu constraints - Update warning message to reference bun instead of npm - Update README to accurately describe bundling (host platform only) - Update package.json setting description to reflect reality The @mdsmith/* platform packages have os/cpu constraints, so npm only installs the package matching the build host (typically linux-x64 in CI). Other platforms fall back to PATH and require manual installation. Agent-Logs-Url: https://github.com/jeduden/mdsmith/sessions/815aaf18-5770-4db2-b451-1f1430644ed4 Co-authored-by: jeduden <1117699+jeduden@users.noreply.github.com>
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.
Pull request created by AI Agent