From f6f4fc200d5a239563987b9eca98b6578f755d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= Date: Thu, 5 Sep 2024 18:19:44 +0200 Subject: [PATCH] protoc-gen-es: fix missing node_modules directories This workaround won't be needed anymore once #333759 is merged, which fixes the node_modules copying behavior in npm-install-hooks. --- pkgs/by-name/pr/protoc-gen-es/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/pr/protoc-gen-es/package.nix b/pkgs/by-name/pr/protoc-gen-es/package.nix index fe36c239a8a7..ada1eca94b36 100644 --- a/pkgs/by-name/pr/protoc-gen-es/package.nix +++ b/pkgs/by-name/pr/protoc-gen-es/package.nix @@ -29,6 +29,13 @@ buildNpmPackage rec { npm run --workspace=packages/protoplugin build ''; + # copy npm workspace modules while properly resolving symlinks + # TODO: workaround can be removed once this is merged: https://github.com/NixOS/nixpkgs/pull/333759 + postInstall = '' + rm -rf $out/lib/node_modules/protobuf-es/node_modules/@bufbuild + cp -rL node_modules/@bufbuild $out/lib/node_modules/protobuf-es/node_modules/ + ''; + passthru.updateScript = ./update.sh; meta = with lib; {