summary refs log tree commit diff
path: root/pkgs/development/tools/yarn2nix-moretea/yarn2nix
diff options
context:
space:
mode:
authorMilan <mil@nyantec.com>2019-11-22 15:27:11 +0100
committerzimbatm <zimbatm@zimbatm.com>2019-11-22 14:27:11 +0000
commited90e59fc293c412c2a4f51024932a4245384549 (patch)
tree5d9efde35ec521513e57003581f5d1d51a16a464 /pkgs/development/tools/yarn2nix-moretea/yarn2nix
parent0ed2e5eba63c7a4437ec1a9c944db36765dfa29e (diff)
downloadnixpkgs-ed90e59fc293c412c2a4f51024932a4245384549.tar
nixpkgs-ed90e59fc293c412c2a4f51024932a4245384549.tar.gz
nixpkgs-ed90e59fc293c412c2a4f51024932a4245384549.tar.bz2
nixpkgs-ed90e59fc293c412c2a4f51024932a4245384549.tar.lz
nixpkgs-ed90e59fc293c412c2a4f51024932a4245384549.tar.xz
nixpkgs-ed90e59fc293c412c2a4f51024932a4245384549.tar.zst
nixpkgs-ed90e59fc293c412c2a4f51024932a4245384549.zip
yarn2nix-moretea: v1.0.0-36-g3f2dbb0 -> v1.0.0-39-g9e7279e (#73911)
Includes the following upstream commits:

- Fix for package.json without a version (moretea/yarn2nix#113)
- Don't access package.json via filtered src (moretea/yarn2nix#115)
- remove redundant rec (moretea/yarn2nix#119)
Diffstat (limited to 'pkgs/development/tools/yarn2nix-moretea/yarn2nix')
-rw-r--r--pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix
index f5989390c4b..22032e145d3 100644
--- a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix
+++ b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix
@@ -238,7 +238,7 @@ in rec {
       package = lib.importJSON packageJSON;
       pname = package.name;
       safeName = reformatPackageName pname;
-      version = package.version;
+      version = package.version or attrs.version;
       baseName = unlessNull name "${safeName}-${version}";
 
       workspaceDependenciesTransitive = lib.unique (
@@ -389,6 +389,11 @@ in rec {
     # yarn2nix is the only package that requires the yarnNix option.
     # All the other projects can auto-generate that file.
     yarnNix = ./yarn.nix;
+    
+    # Using the filter above and importing package.json from the filtered
+    # source results in an error in restricted mode. To circumvent this,
+    # we import package.json from the unfiltered source
+    packageJSON = ./package.json;
 
     yarnFlags = defaultYarnFlags ++ ["--production=true"];