Uploaded image for project: 'VS Code Extension'
  1. VS Code Extension
  2. VSCODE-370

Fix invalid optional dependency error on --omit=optional ci package

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Tech debt
    • None
    • 3

      In our CI when building the vsix extension package we install dependencies with the `–omit=optional` flag. However this causes the `npm list` command that vsce runs to fail with invalid dependencies. I'm not sure on the exact cause of the failure, I think it's something to do with transitive optional peer dependencies being hoisted differently.
      Currently we silence the errors with a node workaround:
      https://github.com/mongodb-js/vscode/blob/main/scripts/no-npm-list-fail.js 

      To make `npm run package` work without our current `no-npm-list-fail` workaround we'll need to make the command run by the vscode package command (vsce) `npm list --production --parseable --depth=99999 --loglevel=error` work with optional dependencies omitted.

      Install in ci: https://github.com/mongodb-js/vscode/blob/750c17a667f1a40828f0fef96218df90096f7b3e/.github/workflows/test-and-build.yaml#L57 

      Once this work is done we can remove the `no-npm-list-fail` node workaround:
      https://github.com/mongodb-js/vscode/blob/main/scripts/no-npm-list-fail.js 

            Assignee:
            Unassigned Unassigned
            Reporter:
            rhys.howell@mongodb.com Rhys Howell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: