fix(vscode): ship node_modules in .vsix + add extension metadata#181
Merged
Conversation
The .vsix packaging used `vsce package --no-dependencies`, which strips
node_modules from the archive. But esbuild.config.mjs marks @sap/cds,
@sap/cds-dk, and @sap/cds-compiler as external (inlining breaks their
lazy module.require). With node_modules stripped, `require("@sap/cds")`
threw at module load, activate() never ran, and no commands registered
-> VS Code reported "command 'hana-cli.openTools' not found".
Remove --no-dependencies from all four packaging callers and route them
through one canonical script:
- vscode-extension `package` script: clean:vsix -> bundle -> vsce package
- root `package:vscode` now delegates to the extension `package` script
- both CI workflows drop the --no-dependencies flag
Also complete the extension manifest so the extensions page renders
correctly: add repository, homepage, bugs, license, a README, the
Apache LICENSE file, and a 128x128 icon (extracted from the Vue app
favicon). Bump version to 0.1.6.
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
The VS Code extension broke at v0.1.3 with
command 'hana-cli.openTools' not found. Root cause: the packaging command usedvsce package --no-dependencies, which stripsnode_modulesfrom the.vsix. Butesbuild.config.mjsdeliberately marks@sap/cds,@sap/cds-dk, and@sap/cds-compileras external (inlining them breaks their lazymodule.require— the documentede.require is not a functionbug). With those externals stripped, the top-levelrequire("@sap/cds")throws at module load,activate()never runs, and no commands register.--no-dependencieswas introduced in 8dfe583 (#180); v0.1.2 worked because it predated the flag.Changes
Packaging fix (the bug)
--no-dependenciesfrom all four callers and route them through one canonical script:vscode-extensionpackage:clean:vsix→bundle→vsce packagepackage:vscodenow delegates to the extensionpackagescript (no duplicated vsce call).github/workflows/vscode-extension.yml— drop the flag.github/workflows/release-hana-cli.yml— drop the flagExtension metadata (blank page cleanup)
repository,homepage,bugs,licenseto the manifestREADME.md(rendered on the extensions page — previously blank)LICENSEfileicon.png(extracted from the Vue app favicon's 256px frame)0.1.6Verification
.vsixnow ships 4499 node_modules files (~28 MB); the broken 0.1.3 had 0.@sap/cds,@sap/cds-dk,@sap/cds-compilerconfirmed present in the archive..vsixand ranactivate()against its own bundled node_modules — succeeds and registers all 8 commands includinghana-cli.openTools.vscerepository/LICENSEwarnings cleared;readme.md,LICENSE.txt, andicon.pngall packaged.🤖 Generated with Claude Code