Skip to content

Commit

Permalink
yarn-berry_3: init at 3.8.6
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Brandes <[email protected]>
  • Loading branch information
gador committed Nov 22, 2024
1 parent 1dcdf53 commit a476035
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
17 changes: 15 additions & 2 deletions pkgs/development/tools/yarn-berry/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,30 @@
stdenv,
testers,
yarn,
berryVersion ? 4,
}:

let
# Please be _very_ careful, when updating these versions,
# as they are used to generate FOD using fetchYarnDeps.
# At the very least run the tests prefetch-yarn-deps.tests
# and make sure the hashes do not change (and if they do, we'll
# need to add another version here for stability across nixpkgs)
version_4 = "4.5.1";
version_3 = "3.8.6";
hash_4 = "sha256-HuF/V+JTkjRMIUpWFYcUwak9tzcn2pCkFr3FoSp8aiQ=";
hash_3 = "sha256-DVmIY0cNmLiPi8B6VrHrXseDw9F6ApHxVn/KZxnWfpA=";
in

stdenv.mkDerivation (finalAttrs: {
pname = "yarn-berry";
version = "4.5.0";
version = if berryVersion == 4 then version_4 else version_3;

src = fetchFromGitHub {
owner = "yarnpkg";
repo = "berry";
rev = "@yarnpkg/cli/${finalAttrs.version}";
hash = "sha256-OTCFUoEgj1kY8QSqaYIqtSoWBYR0i0ao2dNRBhijEzc=";
hash = if berryVersion == 4 then hash_4 else hash_3;
};

buildInputs = [
Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/tools/yarn-berry/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ EOF
)

version=$(jq -r "[.data.repository.tag.nodes[].name | select(contains(\"-\")|not)] | max_by(split(\".\") | map(tonumber))" <<< "$payload")
version3=$(jq -r "[.data.repository.tag.nodes[].name | select(contains(\"-\")|not)] | map(select(. < \"4.0.0\")) | sort | last" <<< "$payload")

update-source-version yarn-berry "$version"
update-source-version yarn-berry4 "$version" --version-key="version_4"
update-source-version yarn-berry3 "$version3" --version-key="version_3"
13 changes: 12 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ with pkgs;
fixup-yarn-lock
prefetch-yarn-deps
yarnConfigHook
yarnBerry3ConfigHook
yarnBuildHook
yarnInstallHook
fetchYarnDeps;
Expand Down Expand Up @@ -5873,7 +5874,17 @@ with pkgs;

yapf = with python3Packages; toPythonApplication yapf;

yarn-berry = callPackage ../development/tools/yarn-berry { };
inherit
({
yarn-berry_3 = callPackage ../development/tools/yarn-berry { berryVersion = 3; };

yarn-berry_4 = callPackage ../development/tools/yarn-berry { };
})
yarn-berry_3
yarn-berry_4
;

yarn-berry = yarn-berry_4;

yarn2nix-moretea = callPackage ../development/tools/yarn2nix-moretea/yarn2nix { pkgs = pkgs.__splicedPackages; };

Expand Down

0 comments on commit a476035

Please sign in to comment.