Skip to content

Support for pnpm #368

Closed
Closed

Description

@idleberg

ovsx publish does not explicitly support the pnpm package manager. To my surprise, using the --yarn flag will publish the extension just fine.

Questions:

  1. is using the --yarn flag for packages with pnpm lockfiles intentional (or coincidence?)
  2. should the flag be renamed to something more generic?
  3. should there be a second flag for pnpm in a future release?
  4. will the above still be relevant, once corepack is stable and ships with npm?

Activity

  1. added
    cli(Component: cli) Open VSX command-line client
    questionMore information is needed to define the next action
    on Nov 22, 2021
  2. spoenemann commented on Nov 22, 2021

    @spoenemann
    Contributor

    We just pass that flag to vsce, which is used behind the scenes to package extensions. If vsce adds a dedicated flag for pnpm or changes the --yarn flag, we should adapt ovsx as well.

  3. idleberg commented on Nov 22, 2021

    @idleberg
    ContributorAuthor

    Related but unresolved vsce issue:

    microsoft/vscode-vsce#421

  4. netomi commented on Sep 5, 2026

    @netomi
    Contributor

    Coming back to this after a long while — the question it was waiting on has been answered upstream, so here's where things stand on all four points.

    The blocking condition resolved, in the negative

    The 2021 reply here set the condition: "If vsce adds a dedicated flag for pnpm or changes the --yarn flag, we should adapt ovsx as well."

    The linked microsoft/vscode-vsce#421 was closed on 2023-12-13:

    Closing this as out of scope. As part of our recurring maintenance milestone, we've decided to limit the amount of supported package managers to npm and yarn v1 only.

    So no dedicated pnpm flag is coming, and there's nothing for ovsx to adapt to. Confirmed against what we actually ship: @vscode/vsce@3.7.1 contains no occurrence of pnpm anywhere in its compiled output. That answers questions 2 and 3.

    Question 1 — coincidence, not intent

    --yarn maps to vsce's useYarn, which only selects yarn list --json over npm list --production --parseable when enumerating what to pack. Nothing about it is pnpm-aware. Worth knowing too: vsce's detectYarn sniffs for yarn.lock, .yarnrc, .yarnrc.yaml, .pnp.cjs and .yarn — pnpm-lock.yaml is not on that list, so an unflagged pnpm project falls through to the npm path rather than being detected as anything.

    Question 4 — moot

    corepack governs which package manager gets invoked. It has no bearing on vsce's internal choice between npm list and yarn list, so corepack stabilising neither changed nor will change this.

    What actually needed doing

    Two things, both in #2169:

    • --follow-symlinks is now forwarded. vsce treats a symlinked directory as a file unless that flag is set, so a node_modules built out of symlinks — pnpm's — packs the links instead of what they point at. vsce has carried the option on ls, package and publish for a while; ovsx simply never passed it. Not passing it still packs exactly what it packed before.
    • The pnpm story is written down. The real substance of this issue was "what is a pnpm user supposed to do?", and the answer existed but appeared nowhere: the CLI README mentioned neither --yarn, --no-dependencies nor pnpm. It now says that vsce supports npm and yarn v1 only, that --no-dependencies is the right answer for a bundled extension (esbuild/webpack — most of them now, whatever installed the sources) and is what upstream recommends, and that --follow-symlinks covers the case where the dependency walk really is wanted.

    The --yarn flag keeps its name, per question 2: it maps 1:1 onto vsce's useYarn, so a generic name would describe what it does less accurately, not more.

    Closing once #2169 lands — happy to reopen if pnpm packaging still misbehaves for anyone with those flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cli(Component: cli) Open VSX command-line clientpriority:lowNice-to-have or can wait for community contributionsquestionMore information is needed to define the next action

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions