Skip to content

node: Add --pnpm-store-add to fill the pnpm store with pnpm store add - #567

Open
andersk wants to merge 1 commit into
flatpak:masterfrom
andersk:pnpm-store-add
Open

andersk wants to merge 1 commit into
flatpak:masterfrom
andersk:pnpm-store-add

Conversation

@andersk

@andersk andersk commented Nov 14, 2026

Copy link
Copy Markdown

The existing populate_pnpm_store.py requires intimate knowledge of the pnpm store binary format and requires extensive maintenance work every time the format changes (e.g. #537). To improve this situation, I’ve extended the upstream pnpm store add command in pnpm ≥ 12.21.0 so that we can use it to populate the store for us:

Provide flatpak-node-generator --pnpm-store-add, which sets up the generated sources to download the package tarballs into flatpak-node/pnpm-tarballs and set storeDir as before, but leaves out populate_pnpm_store.py and its manifest. The app’s build commands can then fill the store with

build-commands:
  - pnpm store add ./flatpak-node/pnpm-tarballs
  - pnpm install --offline --frozen-lockfile --trust-lockfile

(This has to be a build command rather than a generated shell command because pnpm is usually not runnable until the module’s own build commands set it up.)

The default is unchanged; populate_pnpm_store.py remains for pnpm 9 through 12.20.

pnpm 12.21 can fill its store from downloaded tarballs with
`pnpm store add`, reading the project's lockfile to serve registry,
tarball-URL, and git-hosted dependencies. With --pnpm-store-add, the
generated sources only download the tarballs and point pnpm's storeDir
into flatpak-node, without populate_pnpm_store.py. The build commands
then run `pnpm store add ./flatpak-node/pnpm-tarballs` before
`pnpm install --offline`.

pnpm decides the store format itself, so --pnpm-store-version does not
apply with --pnpm-store-add. An entry without an integrity in the
lockfile gets a warning, since `pnpm store add` cannot serve it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
@bbhtt

bbhtt commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

I'm not reviewing AI generated or assisted commits. GitHub doesn't let me remove my review request otherwise I would.

@andersk

andersk commented Nov 15, 2026

Copy link
Copy Markdown
Author

@bbhtt That’s understandable, and if you’d prefer to implement this yourself I am happy to close this.

@andersk

andersk commented Nov 25, 2026

Copy link
Copy Markdown
Author

I’m using this for Zulip Desktop, since it simplifies generated-sources.json significantly and I expect it to be much more future-proof:

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants