Skip to content

feat/fix: auto-detect dependencies for foreign managers, make vsce self-contained, and add --no-prepublish#1257

Open
Mopsgamer wants to merge 26 commits into
microsoft:mainfrom
Mopsgamer:arborist
Open

feat/fix: auto-detect dependencies for foreign managers, make vsce self-contained, and add --no-prepublish#1257
Mopsgamer wants to merge 26 commits into
microsoft:mainfrom
Mopsgamer:arborist

Conversation

@Mopsgamer

@Mopsgamer Mopsgamer commented Apr 3, 2026

Copy link
Copy Markdown

Issues

Some issues were prefixed with "fixes", and now they are "refs".

Summary

Fixes: vsce pack, dependencies (unblocks foreign managers)
Features: makes vsce self-contained, --no-prepublish.

100% backward compatibility.

Fixes

vsce pack (aliasing)

  • This PR fixes a race condition (I have no idea how it works):

The problem was the return Promise.all(promises).then(util.flatten) line. It's replaced with await + return arr.flat().
This problem is real: #1257 (comment)

dependencies

  • Now the npm/yarn list takes dependencies into account and uses an auto-detection for undefined. undefined is an equivalent for auto, it is not set to a boolean value as a fallback.
    • README.md

It ensures the flag is enabled automatically when there is a node_modules/ vscodeignore pattern, or a package manager other than npm/yarn1 is detected.

Note

Lockfile lookup order and logic can be found in npm.ts.

  • Enables support for pnpm, modern yarn (Berry, ZPM), vlt, bun, and other alternative package managers.

It's not a resolution algorithm. We are just assuming that users bundle their dependencies and they don't need node_modules prod deps in their vsix. dependencies is used for packaging this directory, so we are simply disabling this option.

dependencies: true will force npm/yarn list and node_modules prod deps, even if a foreign package manager is detected.

Features

vscode:prepublish

  • New CLI flag, --no-prepublish, skips vscode:prepublish.

    • README.md
  • @npmcli/run-script replaces exec(npm run vscode:prepublish)

versionBump()

  • Replaced the exec(npm version)-based versionBump implementation with a 'libnpmversion'-based one to make vsce self-contained.

@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)

@Mopsgamer Mopsgamer changed the title fix: bundled extensions (fix package managers) feat: unlock package managers Jul 16, 2026
@Mopsgamer Mopsgamer changed the title feat: unlock package managers feat/fix: auto-detect dependencies for foreign managers, make vsce self-contained, and add --no-prepublish Jul 16, 2026
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.

Feature Request: Add support for Bun package manager Use libnpmversion instead of execing npm version

1 participant