prometheus: 3.12.0 → 3.13.0
Upstream migrated `web/ui` from `npm` to `pnpm` in this release
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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=";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user