Skip to content

fix: bundled extensions (fix package managers)#1257

Open
Mopsgamer wants to merge 13 commits intomicrosoft:mainfrom
Mopsgamer:arborist
Open

fix: bundled extensions (fix package managers)#1257
Mopsgamer wants to merge 13 commits intomicrosoft:mainfrom
Mopsgamer:arborist

Conversation

@Mopsgamer
Copy link
Copy Markdown

@Mopsgamer Mopsgamer commented Apr 3, 2026

Summary

Enables support for pnpm, modern yarn (Berry, ZPM), vlt, bun, and other alternative package managers by properly handling the --no-dependencies flag. This PR fixes a race condition (?) (Promise.all(promises).then(util.flatten)) and ensures the flag is enabled automatically when these managers are detected.

The core logic assumes that extensions using alternative managers are bundling their output; therefore, the node_modules directory does not need to be analyzed via npm list, eliminating "missing dependency" errors.

Features

  • Automatic Detection: bun, vlt, pnpm, npm and yarn (1, v2+) are detected out of the box.
  • Custom Prepublish Commands: Introduced the VSCE_RUN_PREPUBLISH environment variable and vsce.runPrepublish configuration option. This allows for custom commands like bun run vscode:prerelease, which is much faster and actually supports cross-platform scripts properly. You can provide empty VSCE_RUN_PREPUBLISH or false value for vsce.runPrepublish to disable it entirely (probably should remove it).
  • When Bun detected, uses bun pm version instead of npm version. So Node-less Bun environments should work.
  • For node_modules/** --no-dependecies option will be enabled now if not provided. This makes things faster.
  • Fixes #1108.
  • Fixes #421.
  • Fixes #517.

... Other package manager issues.

I can trim this PR down.

@Mopsgamer Mopsgamer mentioned this pull request Apr 3, 2026
@Mopsgamer Mopsgamer marked this pull request as draft April 4, 2026 19:03
@Mopsgamer Mopsgamer closed this Apr 4, 2026
@Mopsgamer Mopsgamer reopened this Apr 4, 2026
@Mopsgamer Mopsgamer changed the title fix!: robust dependency resolution fix: bundled extensions (fix package managers) Apr 4, 2026
@Mopsgamer Mopsgamer marked this pull request as ready for review April 4, 2026 23:37
@Mopsgamer
Copy link
Copy Markdown
Author

Before

Details
user@DESKTOP-NKNOS3C ~/D/G/dracula-highlighting (main)> time node node_modules/vsce/vsce package
 DONE  Packaged: C:\Users\user\Documents\GitHub\dracula-highlighting\dracula-highlighting-0.1.0.vsix (16 files, 79.47KB)

________________________________________________________
Executed in    3.06 secs      fish           external
   usr time   46.00 millis    0.00 micros   46.00 millis
   sys time   15.00 millis    0.00 micros   15.00 millis

user@DESKTOP-NKNOS3C ~/D/G/dracula-highlighting (main)> node node_modules/vsce/vsce pack
Usage: vsce <command>

Options:
  -V, --version                      output the version number
  -h, --help                         display help for command

Commands:
  ls [options]                       Lists all the files that will be published
  package [options] [version]        Packages an extension
  publish [options] [version]        Publishes an extension
  unpublish [options] [extensionid]  Unpublishes an extension. Example extension id: microsoft.csharp.
  ls-publishers                      List all known publishers
  delete-publisher <publisher>       Deletes a publisher
  login <publisher>                  Add a publisher to the known publishers list
  logout <publisher>                 Remove a publisher from the known publishers list
  verify-pat [options] [publisher]   Verify if the Personal Access Token has publish rights for the publisher.
  show [options] <extensionid>       Show extension metadata
  search [options] <text>            search extension gallery
  help [command]                     display help for command

Unknown command 'pack'.

After

Details
ser@DESKTOP-NKNOS3C ~/D/G/dracula-highlighting (main) [1]> time node ../vscode-vsce/vsce package
 INFO  Detected presence of bun.lock. Using 'bun' logic.
 INFO  Files included in the VSIX:
dracula-highlighting-0.1.0.vsix
├─ [Content_Types].xml
├─ extension.vsixmanifest
└─ extension/
   ├─ LICENSE.txt [1.1 KB]
   ├─ package.json [1.79 KB]
   ├─ readme.md [1.74 KB]
   ├─ assets/
   │  └─ icon.png [10.08 KB]
   └─ themes/
      ├─ abyss-dracula.json [58.82 KB]
      ├─ dark-2026-dracula.json [58.67 KB]
      ├─ dark-dracula.json [17.61 KB]
      ├─ dark-high-contrast-dracula.json [58.24 KB]
      ├─ dark-modern-dracula.json [22.05 KB]
      ├─ kimbie-dark-dracula.json [58.94 KB]
      ├─ monokai-dimmed-dracula.json [18.86 KB]
      ├─ monokai-dracula.json [20.13 KB]
      ├─ solarized-dark-dracula.json [20.12 KB]
      └─ tomorrow-night-blue-dracula.json [58.95 KB]

 DONE  Packaged: C:\Users\user\Documents\GitHub\dracula-highlighting\dracula-highlighting-0.1.0.vsix (16 files, 79.49 KB)

________________________________________________________
Executed in    1.90 secs      fish           external
   usr time    0.00 millis    0.00 micros    0.00 millis
   sys time   31.00 millis    0.00 micros   31.00 millis

user@DESKTOP-NKNOS3C ~/D/G/dracula-highlighting (main)> node ../vscode-vsce/vsce pack
 INFO  Detected presence of bun.lock. Using 'bun' logic.
 INFO  Files included in the VSIX:
dracula-highlighting-0.1.0.vsix
├─ [Content_Types].xml
├─ extension.vsixmanifest
└─ extension/
   ├─ LICENSE.txt [1.1 KB]
   ├─ package.json [1.79 KB]
   ├─ readme.md [1.74 KB]
   ├─ assets/
   │  └─ icon.png [10.08 KB]
   └─ themes/
      ├─ abyss-dracula.json [58.82 KB]
      ├─ dark-2026-dracula.json [58.67 KB]
      ├─ dark-dracula.json [17.61 KB]
      ├─ dark-high-contrast-dracula.json [58.24 KB]
      ├─ dark-modern-dracula.json [22.05 KB]
      ├─ kimbie-dark-dracula.json [58.94 KB]
      ├─ monokai-dimmed-dracula.json [18.86 KB]
      ├─ monokai-dracula.json [20.13 KB]
      ├─ solarized-dark-dracula.json [20.12 KB]
      └─ tomorrow-night-blue-dracula.json [58.95 KB]

 DONE  Packaged: C:\Users\user\Documents\GitHub\dracula-highlighting\dracula-highlighting-0.1.0.vsix (16 files, 79.49 KB)

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