build: add reproducible VSIX package command - #957
Merged
lcottercertinia merged 19 commits intoSep 2, 2026
Conversation
peternhale
force-pushed
the
feat-vsix-build-upstream
branch
from
September 1, 2026 18:19
aa080a5 to
d5cf667
Compare
Contributor
Author
|
@lukecotter I made the module for browser CJS in this PR. |
…2e-upstream # Conflicts: # .gitignore # lana/package.json # lana/src/__tests__/mocks/vscode.ts # lana/src/cache/LogEventCache.ts # lana/src/cache/__tests__/LogEventCache.test.ts # lana/src/commands/LogView.ts # lana/src/commands/RetrieveLogFile.ts # lana/src/commands/ShowLogAnalysis.ts # lana/src/commands/__tests__/RetrieveLogFile.test.ts # lana/src/folding/RawLogFoldingProvider.ts # lana/src/folding/__tests__/RawLogFoldingProvider.test.ts # lana/src/hovers/RawLogHoverProvider.ts # lana/src/language/ApexLogLanguageDetector.ts # lana/src/log-features/RawLogNavigation.ts # lana/src/services/salesforceServices.ts # lana/src/services/servicesRuntime.ts # lana/src/symbols/RawLogSymbolProvider.ts # lana/tsconfig.json # pnpm-lock.yaml # rollup.config.mjs
…into feat-vsix-build-upstream # Conflicts: # lana/package.json # lana/test/playwright/support/paths.ts # pnpm-lock.yaml # rolldown.config.ts
…tream # Conflicts: # .github/workflows/ci.yml # lana/test/playwright/support/logAnalysis.ts # lana/test/playwright/support/logWorkspace.ts # lana/test/playwright/support/paths.ts # pnpm-lock.yaml
lcottercertinia
approved these changes
Sep 2, 2026
This was referenced Sep 2, 2026
lcottercertinia
pushed a commit
that referenced
this pull request
Sep 3, 2026
# PR overview Follow-up to #953 and #957. `Log: Retrieve Apex Log And Show Analysis` cannot work in the web extension host, because the web bundle is split across two files. ## The problem The web extension host does not use Node's loader. It fetches the entry point as text and wraps it: ```js initFn = new Function('module', 'exports', 'require', fullSource); ``` The `require` it supplies resolves only `'vscode'`. `importScripts` is blocked, and `require` and `define` are set to `undefined` in the worker. The docs say it plainly: "Importing or requiring other modules is not supported... the code must be packaged to a single file." Both web builds emitted two files: ``` lana/out/web/ Main.web.cjs lana-salesforceServices.js ``` `RetrieveLogFile.ts:56` does `await import('../services/salesforceServices.js')`, which rollup lowers to `require("./lana-salesforceServices.js")`. That require throws in the web host. It sits in the lazy path near the end of the file, not at the top, so the extension still activates and only Retrieve is affected. ## Changes made - `rollup.config.mjs`: `inlineDynamicImports: true` on the web output. - `rolldown.config.ts`: `codeSplitting: false` on the web output. Rolldown deprecates `inlineDynamicImports` in favour of this name, hence the difference. - Drop `chunkFileNames` from both, now that neither emits a chunk. ## Type of change - [x] Bug fix ## Validation Built both paths, production mode: | | before | after | |---|---|---| | rollup `lana/out/web/` | 2 files | **1 file**, `Main.web.cjs`, 806,071 bytes | | rolldown `lana/out/web/` | 2 files | **1 file**, `Main.web.cjs` | | requires in the entry | `require("vscode")` + `require("./lana-salesforceServices.js")` | **`require("vscode")` only** | The desktop entry is unchanged and still ESM. Not validated: I have not run this in a live web host, so the fix is verified against the emitted bundle and the documented loader, not observed. The web e2e in CI exercises `Log: Show Apex Log Analysis`, not Retrieve, so it will not catch this either way. ## Related Considered and rejected in the same area: dropping `nodePolyfills()` from the web target. The build succeeds without it, but 11 `process.` references survive, and while most are guarded by `typeof process`, `path.resolve()`'s shim calls a bare `process.cwd()`. Removing the plugin would turn a working shim into a latent `ReferenceError`, so it stays.
lukecotter
added a commit
to lukecotter/debug-log-analyzer
that referenced
this pull request
Sep 3, 2026
All three workflows installed vsce globally at run time, so the published VSIX was built with whatever version was latest that day. The @vscode/vsce devDep that certinia#957 pinned in lana was reachable only from build:vsix, which nothing in CI called. ci.yml and publish.yml now run that same script. cd-prerelease.yml needs --pre-release, so it calls the pinned binary directly.
lukecotter
added a commit
to lukecotter/debug-log-analyzer
that referenced
this pull request
Sep 3, 2026
All three workflows installed vsce globally at run time, so the published VSIX was built with whatever version was latest that day. The @vscode/vsce devDep that certinia#957 pinned in lana was reachable only from build:vsix, which nothing in CI called. ci.yml and publish.yml now run that same script. cd-prerelease.yml needs --pre-release, so it calls the pinned binary directly.
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.
PR overview
Stack 5 of 5. Depends on #954. Adds a repository-local command for reproducible VSIX packaging.
Changes made
Type of change
Validation