From 8e748c7ca37698818ca82a91ccd64c914dfadfb5 Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Sun, 5 Jul 2026 09:05:38 +0000 Subject: [PATCH] =?UTF-8?q?prometheus:=203.12.0=20=E2=86=92=203.13.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream migrated `web/ui` from `npm` to `pnpm` in this release --- pkgs/by-name/pr/prometheus/package.nix | 44 ++++++++++++++++++++------ pkgs/by-name/pr/prometheus/source.nix | 8 ++--- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/pr/prometheus/package.nix b/pkgs/by-name/pr/prometheus/package.nix index 23deee23b54f..e015a7ba9c2a 100644 --- a/pkgs/by-name/pr/prometheus/package.nix +++ b/pkgs/by-name/pr/prometheus/package.nix @@ -3,7 +3,10 @@ lib, go, buildGoModule, - buildNpmPackage, + nodejs, + pnpmConfigHook, + pnpm_11, + fetchPnpmDeps, fetchFromGitHub, nixosTests, enableAWS ? true, @@ -47,20 +50,31 @@ let hash = source.hash; }; - assets = buildNpmPackage { + assets = stdenv.mkDerivation (finalAssetsAttrs: { pname = "${pname}-assets"; inherit version; src = "${src}/web/ui"; - npmDepsHash = source.npmDepsHash; - patches = [ # Disable old React app as it depends on deprecated create-react-apps # script ./disable-react-app.diff ]; + pnpmDeps = fetchPnpmDeps { + inherit (finalAssetsAttrs) pname version src; + pnpm = pnpm_11; + fetcherVersion = 4; + hash = source.pnpmDepsHash; + }; + + nativeBuildInputs = [ + nodejs + pnpmConfigHook + pnpm_11 + ]; + env.CI = true; __darwinAllowLocalNetworking = true; @@ -69,20 +83,29 @@ let checkPhase = '' runHook preCheck - npm test + pnpm test runHook postCheck ''; - postInstall = '' + buildPhase = '' + runHook preBuild + + pnpm build + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out/static - cp -r $out/lib/node_modules/prometheus-io/static/* $out/static + cp -r static/* $out/static find $out/static -type f -exec gzip -f9 {} \; - # Remove node_modules - rm -rf $out/lib + runHook postInstall ''; - }; + }); in buildGoModule (finalAttrs: { inherit @@ -209,6 +232,7 @@ buildGoModule (finalAttrs: { doInstallCheck = true; passthru = { + inherit assets; tests = { inherit (nixosTests) prometheus; }; updateScript = ./update.sh; }; diff --git a/pkgs/by-name/pr/prometheus/source.nix b/pkgs/by-name/pr/prometheus/source.nix index f1322bb8c0ca..8bc7d9282302 100644 --- a/pkgs/by-name/pr/prometheus/source.nix +++ b/pkgs/by-name/pr/prometheus/source.nix @@ -1,6 +1,6 @@ { - version = "3.12.0"; - hash = "sha256-xeENUVmG9tbIF+7i2u9zuvo7RXI9iNWFVDNUfNpF6/4="; - npmDepsHash = "sha256-cHMI5DqSRpIanrgk/H3aFUHLrGXH1v796PH1qDrCnbE="; - vendorHash = "sha256-caSI9uzbH93j06sJus9jSqo6qHKbP8D9DuDkiAlnfF4="; + version = "3.13.0"; + hash = "sha256-v6jk4MqoxcfK+yj+T31Ovqj1tyh3mc4aEr8BD0vjBOc="; + pnpmDepsHash = "sha256-Z1TYYZhELi+rIiuleN8xR/WiMn9TF4KotFMTOsR2e6Y="; + vendorHash = "sha256-yvzQHfe7yd6Sjh1Vd2VxTp3jK8OWoKTmJ2uMyXX3+xs="; }