From 8a9c124a681a31c5919e3563c9185918de5d7eec Mon Sep 17 00:00:00 2001 From: Nicholas Jackson Date: Thu, 14 Nov 2024 16:57:27 -0800 Subject: [PATCH] feat: add yarn Yarn is a bit unique in that it recommends installing via Corepack. To facilitate adding yarn via hermit, we can take the same approach that the official Node.JS Docker image takes, which is to install yarn v1, which can then be used to bootstrap yarn v2 and higher. --- yarn.hcl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 yarn.hcl diff --git a/yarn.hcl b/yarn.hcl new file mode 100644 index 00000000..2ce07d12 --- /dev/null +++ b/yarn.hcl @@ -0,0 +1,16 @@ +description = "Yarn is a fast, secure, and reliable package manager for JavaScript, designed to manage dependencies efficiently in JavaScript and Node.js projects." +source = "https://yarnpkg.com/downloads/${version}/yarn-v${version}.tar.gz" +homepage = "https://yarnpkg.com/" +repository = "https://github.com/yarnpkg/berry" +binaries = ["bin/yarn", "bin/yarnpkg"] +requires = ["node"] +strip = 1 +test = "yarn --version" + +// Yarn v2+, AKA berry, bootstraps itself from either yarn v1 or Corepack, so v2+ releases need not be provided by Hermit. +version "1.22.22" { +} + +sha256sums = { + "https://yarnpkg.com/downloads/1.22.22/yarn-v1.22.22.tar.gz": "88268464199d1611fcf73ce9c0a6c4d44c7d5363682720d8506f6508addf36a0", +}