Skip to content

fix(vscode): ship node_modules in .vsix + add extension metadata#181

Merged
jung-thomas merged 1 commit into
mainfrom
fix/vscode-ext-vsix-packaging
Jul 14, 2026
Merged

fix(vscode): ship node_modules in .vsix + add extension metadata#181
jung-thomas merged 1 commit into
mainfrom
fix/vscode-ext-vsix-packaging

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Summary

The VS Code extension broke at v0.1.3 with command 'hana-cli.openTools' not found. Root cause: the packaging command used vsce package --no-dependencies, which strips node_modules from the .vsix. But esbuild.config.mjs deliberately marks @sap/cds, @sap/cds-dk, and @sap/cds-compiler as external (inlining them breaks their lazy module.require — the documented e.require is not a function bug). With those externals stripped, the top-level require("@sap/cds") throws at module load, activate() never runs, and no commands register.

--no-dependencies was introduced in 8dfe583 (#180); v0.1.2 worked because it predated the flag.

Changes

Packaging fix (the bug)

  • Remove --no-dependencies from all four callers and route them through one canonical script:
    • vscode-extension package: clean:vsixbundlevsce package
    • root package:vscode now delegates to the extension package script (no duplicated vsce call)
    • .github/workflows/vscode-extension.yml — drop the flag
    • .github/workflows/release-hana-cli.yml — drop the flag

Extension metadata (blank page cleanup)

  • Add repository, homepage, bugs, license to the manifest
  • Add README.md (rendered on the extensions page — previously blank)
  • Add the Apache LICENSE file
  • Add a 128×128 icon.png (extracted from the Vue app favicon's 256px frame)
  • Bump version to 0.1.6

Verification

  • Rebuilt .vsix now ships 4499 node_modules files (~28 MB); the broken 0.1.3 had 0.
  • @sap/cds, @sap/cds-dk, @sap/cds-compiler confirmed present in the archive.
  • Unzipped the .vsix and ran activate() against its own bundled node_modules — succeeds and registers all 8 commands including hana-cli.openTools.
  • vsce repository/LICENSE warnings cleared; readme.md, LICENSE.txt, and icon.png all packaged.

🤖 Generated with Claude Code

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.
@jung-thomas
jung-thomas merged commit f2f1ec1 into main Jul 14, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant