chore: support branch artifacts as npm dependencies
Description
Problem
There's an issue with specifying a branch artifact as an npm dependency, where the npm package
command fails.
The error is described in detail here here:
- https://github.com/microsoft/vscode-vsce/issues/580
- https://github.com/microsoft/vscode-vsce/issues/203
Example logs:
ERROR Command failed: npm list --production --parseable --depth=99999 --loglevel=error
npm error code ELSPROBLEMS
npm error invalid: @gitlab-org/gitlab-lsp@6.7.1 /builds/gitlab-org/gitlab-vscode-extension/dist-desktop/node_modules/@gitlab-org/gitlab-lsp
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-09-19T01_54_09_824Z-debug-0.log
file:///builds/gitlab-org/gitlab-vscode-extension/node_modules/execa/lib/return/final-error.js:6
return new ErrorClass(message, options);
^
ExecaError: Command failed with exit code 1: vsce package
Solution
Add the no-dependencies
flag to the package build.
This flag should be appropriate, since we bundle the extension into a single file before running the package command.
This flag prevents the erroring npm list
command from being run.
Related Issues
Semi-related: gitlab-org/editor-extensions/gitlab-lsp#127
Resolves #[issue_number]
How has this been tested?
A test branch (using an artifact for the LS dependency) is located here: !1970 (closed)
- Ensure that the
e2e
job in the latest pipeline for !1970 (closed) passes. This relies on thenpm package
command working.
Extra:
- Download the artifact when the build completes.
- Add the .vsx file to a local VS Code instance.
- Test that functionality works as expected
👍🏻
What CHANGELOG entry will this MR create?
-
fix:
Bug fix fixes - a user-facing issue in production - included in changelog -
feature:
New feature - a user-facing change which adds functionality - included in changelog -
BREAKING CHANGE:
(fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog -
None - other non-user-facing changes
Edited by Tristan Read