Closed adrian-gierakowski closed 10 months ago
This is WIP as I'm getting some error when building test example (I've fixed hash missmatch )
I've built the plugin and yarn without minification and here's the stack trace
> at populateYarnPaths (/nix/store/jgj51a4nsbhzby18ldm1p6zklsh4pvna-yarn-plugin-yarnpnp2nix/plugin.js:5488:31)
> at _Configuration.triggerHook (/nix/store/mld37kzhq116qfyw2bp8svw5b07bk815-yarn-berry/bin/yarn:42325:19)
> at async genPackList (/nix/store/mld37kzhq116qfyw2bp8svw5b07bk815-yarn-berry/bin/yarn:148293:5)
> at async /nix/store/mld37kzhq116qfyw2bp8svw5b07bk815-yarn-berry/bin/yarn:148505:25
> at async prepareForPack (/nix/store/mld37kzhq116qfyw2bp8svw5b07bk815-yarn-berry/bin/yarn:148199:7)
> at async /nix/store/mld37kzhq116qfyw2bp8svw5b07bk815-yarn-berry/bin/yarn:148503:9
> at async StreamReport.start (/nix/store/mld37kzhq116qfyw2bp8svw5b07bk815-yarn-berry/bin/yarn:44426:13)
> at async PackCommand.execute (/nix/store/mld37kzhq116qfyw2bp8svw5b07bk815-yarn-berry/bin/yarn:148498:22)
> at async PackCommand.validateAndExecute (/nix/store/mld37kzhq116qfyw2bp8svw5b07bk815-yarn-berry/bin/yarn:16883:28)
and the code which it points at
in the plugin
if (pkg.canonicalReference.startsWith("workspace:")) {
if (pkg.drvPath !== process.env.out) {
await project.addWorkspace(pkg.packageLocation ?? path3.join(pkg.drvPath, "node_modules", pkg.name));
}
}
in yarn
addWorkspace(workspace) {
const dup = this.workspacesByIdent.get(workspace.locator.identHash);
Right, I forgot to update the yarnpkgs deps in package.json and addWorkspace changed
note that rc44 is had a regressions which was fixed in rc45
regarding the issue above, I've got a fix here
do let me know if you'd consider accepting this PR and I can clean this up
Closing as the bundled version of Yarn has been removed and yarn-berry
will be used from nixpkgs that is passed in, currently on 23.11 this is Yarn 4.0.1.
current version dosen't work with typescrpit > 4.8
Btw. how about using the yarnBerry you build with nix, together with
YARN_PLUGGINS
in development shell (just like you do in mkYarnPackage.nix), instead of checking inplugin/.yarn/releases/yarn-4.0.0-rc.25.cjs
? We could then remove the following 2 lines:https://github.com/madjam002/yarnpnp2nix/blob/fd1155ca345b9298014294c7eab796b32eec328d/plugin/.yarnrc.yml#L1
https://github.com/madjam002/yarnpnp2nix/blob/fd1155ca345b9298014294c7eab796b32eec328d/test/workspace/.yarnrc.yml#L4
done here, happy to add it to this PR