fix(vscode): ship self-contained, OS-portable .vsix via npm#159
Merged
Conversation
The packaged extension previously installed but rendered blank webviews and carried a platform-specific native sqlite binary, and no .vsix shipped in the npm package — so `hana-cli vscode install` could never find one (issue #158). Webview UI (was loaded from a sibling path that only exists in the repo): - htmlProvider resolves a local `webview-dist/` (shipped inside the .vsix), falling back to ../app/vue/dist-vscode for F5 dev-launch. - esbuild copies app/vue/dist-vscode into vscode-extension/webview-dist during bundle, with a warning if assets are missing. OS portability (was bundling better-sqlite3's native .node binary): - Default the sqlite CDS driver to Node's built-in node:sqlite (respecting any explicit override); matches the CAP 10 default, Node >=22 baseline always ships it. Verified end-to-end: SELECT runs, better-sqlite3 never loads. - Mark better-sqlite3 external in esbuild so no native binary is bundled. Keep sqlite3 external (it is a guarded optional require in @sap/cds). Ship the .vsix via npm: - Add vscode-extension/.npmignore so the git-ignored *.vsix is allowed into the npm tarball while all extension source is excluded. - Build a fresh .vsix in the release workflow's publish job (installs app/vue + vscode-extension deps that root `npm ci` does not). This also fixes a latent prepack:build:vue failure that would break the next publish. Docs: document the root-install prerequisite for building from source (the exact esbuild "Could not resolve" errors from #158) and the offline install.
jung-thomas
added a commit
that referenced
this pull request
Jul 11, 2026
Version bump + changelog for the 4.202607.0 release. Done via PR because the release workflow's workflow_dispatch path pushes the bump commit directly to main, which the branch-protection rulesets reject (GH013). After this merges, pushing the v4.202607.0 tag triggers the workflow's tag path (resolve-version -> publish), which does not push to main and publishes cleanly. Includes: self-contained OS-portable VS Code .vsix (#159), CAP 10 + cds-10 drivers (#160), TypeScript 7 for extension/mcp-server + consolidated deps (#160, #162), Group B majors (#162), i18n key fixes (#163). Co-authored-by: Thomas Jung <12159356+jung-thomas@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.
Summary
Fixes #158. The VS Code extension had three problems that made it effectively uninstallable for users:
.vsixshipped in the npm package — sohana-cli vscode installfell through to instructions that pointed at a Marketplace listing that doesn't exist and a from-source build that fails..vsixloaded its Vue UI from../app/vue/dist-vscode, a sibling path that only exists inside the repo, not in an installed extension.better-sqlite3(a native.nodemodule) was compiled into the bundle, so a.vsixbuilt on one OS wouldn't load on another.@ihenry's report was exactly this: Marketplace search returns nothing, and
npm run bundlefails with dozens ofCould not resolve "express" / "exceljs" / "@sap/cds" …errors — because the extension's bundle reaches into the root project'snode_modules, which he hadn't installed.Changes
Self-contained webview UI
htmlProvider.ts: newresolveWebviewDist()prefers a localwebview-dist/(shipped in the.vsix), falls back to../app/vue/dist-vscodefor F5 dev-launch.esbuild.config.mjs: copiesapp/vue/dist-vscode→vscode-extension/webview-distduring bundle.OS-portable — no native binary
utils/database/index.js: default the sqlite CDS driver to Node's built-innode:sqlite(respects any explicit override). Matches the CAP 10 default; the Node>=22baseline always ships it.esbuild.config.mjs: markbetter-sqlite3external so no.nodebinary is bundled. (Keptsqlite3external — the build proved it's a guarded optional require in@sap/cds.)Ship the
.vsixvia npmvscode-extension/.npmignore: allow the git-ignored*.vsixinto the npm tarball while excluding all extension source..github/workflows/release-hana-cli.yml: build a fresh.vsixin the publish job (installsapp/vue+vscode-extensiondeps that rootnpm cidoesn't). Also fixes a latentprepack: build:vuefailure — that step was added after the last successful publish and would break the next release.Docs
#158errors) and the offline bundled-.vsixinstall.Verification
.vsixcontains the Vue UI (301 files; the old one had 8, no UI)..vsixcontains zero.nodenative binaries.driver:'node',SELECT 1runs, andbetter-sqlite3is never loaded (cap-js/node-sqlite.jsis)..vsix+package.jsonfromvscode-extension/, no source.eslintclean; 14tests/utils/database.Test.jstests pass.Notes
node:sqliteemits anExperimentalWarningon Node 22 (stabilizes in a later release) — expected and harmless for a dev tool, and it's the CAP 10 direction..vsixinstall path the reliable one.