!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

193 Members
57 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
27 Apr 2025
@adam_neverwas:matrix.org@adam_neverwas:matrix.org joined the room.15:56:01
@arexon:matrix.org@arexon:matrix.org changed their profile picture.16:12:40
@arexon:matrix.org@arexon:matrix.org changed their profile picture.16:12:53
29 Apr 2025
@c3n21:matrix.orgc3n21 joined the room.10:08:02
@c3n21:matrix.orgc3n21

Hey guys!

Does anybody know how to create a package for a yarn project that uses pnp?

I'm trying to package Verdaccio https://github.com/NixOS/nixpkgs/pull/398441

but it seems that pnp is not supported by the current packaging tooling

10:09:26
@c0ba1t:matrix.orgCobaltI'm not too familiar with yarn but PNP still has a yarn lockfile, correct? You could try to use the normal yarn deps fetcher on it. Regardless, the linked project's source, verdaccio, seems to use pnpm from cursory glance. This is iirc supported with a custom deps fetcher 10:31:07
@c0ba1t:matrix.orgCobalt(The pnpm guess is based on the pnpm lockfile, https://github.com/verdaccio/verdaccio/blob/master/pnpm-lock.yaml)10:33:24
@sandro:supersandro.deSandro 🐧Pnpm has its own lock file and fetcher11:57:24
@sandro:supersandro.deSandro 🐧(that is a pnpm lock file, or is pnp yet another package manager?)11:58:27
@c0ba1t:matrix.orgCobaltyarn PNP is yarn plug-n-plug iirc, it's a special-ish way for yarn to handle deps. An alternative to traditional node_modules12:52:52
@c0ba1t:matrix.orgCobalthttps://yarnpkg.com/features/pnp12:53:41
@c0ba1t:matrix.orgCobalt Though @c3n21:matrix.org, it might helpful if you could clarify if yarn PNP or pmpn was referred to here. 12:55:39
@c3n21:matrix.orgc3n21Yes it is yarn pnp, I should have mentioned that I'm packaging v6.1.2 which only uses yarn15:30:47
@c0ba1t:matrix.orgCobaltHave you tried the yarn deps fetcher then? https://nixos.org/manual/nixpkgs/stable/#javascript-yarn If this project requires more elaborate packaging than `npm install` it is usually easier to put into it's own package instead of the `nodePackages` set. Following the nixpkgs manual for JavaScript projects should help you there. 15:44:52
@c0ba1t:matrix.orgCobaltThe package does contain a yarn.lock for the requested tag so that might work out as a bypass for yarn PNP. 15:48:13
@c3n21:matrix.orgc3n21

Yes I followed the docs, and it doesn't work because fetchYarnDeps only supports yarn v1 (they have # yarn lockfile v1 as first line, which yarn berry doesn't have)

Funny enough, going the nodePackages at least allows me to build and run the package correctly, but it breaks the pipeline because generate script pulls in python for some reason

15:52:41
@c3n21:matrix.orgc3n21 *

Yes I followed the docs, and it doesn't work because fetchYarnDeps only supports yarn v1 (they have # yarn lockfile v1 as first line, which yarn berry doesn't have)

Funny enough, going the nodePackages at least allows me to build and run the package correctly, but it breaks the pipeline because generate script pulls in python2 for some reason

15:53:04
@cathal_mullan:matrix.orgCathalThe yarn.lock in the Verdaccio 6.x branch is from a yarn berry install, i.e. yarn v3/v4. Support for yarn berry just got merged last week, only hit unstable today actually: https://github.com/NixOS/nixpkgs/pull/399404 See these docs: https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/javascript.section.md#yarn-berry-v3v4-javascript-yarn-v3-v415:57:13
@c3n21:matrix.orgc3n21My current attempt is already using fetchYarnBerryDeps, but it seems that with pnp it just doesn't work, I think I should report it in the PR16:30:06
@c3n21:matrix.orgc3n21* My current attempt is already using fetchYarnBerryDeps, but it seems that with pnp it just doesn't work, do you think I should report it in the PR?16:30:14
@c3n21:matrix.orgc3n21* My current attempt is already using fetchYarnBerryDeps (on my machine, not on the PR), but it seems that with pnp it just doesn't work, do you think I should report it in the PR?16:30:40
@c3n21:matrix.orgc3n21* My current attempt is already using fetchYarnBerryDeps (on my machine, not on the PR), but it seems that with pnp it just doesn't work, do you think I should report it here https://github.com/NixOS/nixpkgs/pull/399404?16:31:12

Show newer messages


Back to Room ListRoom Version: 6