pomerium: migrate ui build from mkYarnPackage

Does what it says on the tin. Also nix-update can update subpackages
like pomerium.ui, so we can use that instead of needing a yarn-hash
file.
This commit is contained in:
dish
2025-11-11 20:55:09 -05:00
parent c875fc2278
commit e1014e0e7e
4 changed files with 15 additions and 80 deletions
-61
View File
@@ -1,61 +0,0 @@
{
"name": "pomerium",
"version": "1.0.0",
"main": "src/index.tsx",
"license": "Apache-2.0",
"scripts": {
"build": "ts-node ./scripts/esbuild.ts",
"format": "prettier --write .",
"lint": "eslint .",
"watch": "ts-node ./scripts/esbuild.ts --watch"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"dependencies": {
"@babel/core": "^7.0.0",
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.11.0",
"@fontsource/dm-mono": "^5.0.14",
"@fontsource/dm-sans": "^5.0.13",
"@mui/icons-material": "^5.14.9",
"@mui/material": "^5.4.0",
"lodash": "^4.17.21",
"markdown-to-jsx": "^7.2.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-feather": "^2.0.10"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.2.1",
"@types/lodash": "^4.17.1",
"@types/node": "^20.12.11",
"@types/react": "^17.0.34",
"@types/react-dom": "^17.0.11",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.59.11",
"esbuild": "^0.25.0",
"eslint": "7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-react": "^7.28.0",
"prettier": "^2.4.1",
"ts-node": "^10.9.1",
"typescript": "^5.1.3"
},
"prettier": {
"importOrder": [
"^[./]"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
}
+13 -12
View File
@@ -1,10 +1,13 @@
{
stdenv,
buildGoModule,
fetchFromGitHub,
lib,
envoy,
mkYarnPackage,
yarnConfigHook,
yarnBuildHook,
fetchYarnDeps,
nodejs,
nixosTests,
pomerium-cli,
}:
@@ -29,29 +32,27 @@ buildGoModule rec {
vendorHash = "sha256-mOTjBH8VqsMdyW5jTIZ76bf55WnHw9XuUSh6zsBktt0=";
ui = mkYarnPackage {
ui = stdenv.mkDerivation {
pname = "pomerium-ui";
inherit version;
src = "${src}/ui";
packageJSON = ./package.json;
offlineCache = fetchYarnDeps {
yarnLock = "${src}/ui/yarn.lock";
sha256 = lib.fileContents ./yarn-hash;
hash = "sha256-V2nSSMvTCK+SYmEhTbLMArIOmNs/AgB5xfhQGx3e/x8=";
};
buildPhase = ''
runHook preBuild
yarn --offline build
runHook postBuild
'';
nativeBuildInputs = [
yarnConfigHook
yarnBuildHook
nodejs
];
installPhase = ''
runHook preInstall
cp -R deps/pomerium/dist $out
cp -R dist $out
runHook postInstall
'';
doDist = false;
};
subPackages = [
+2 -6
View File
@@ -1,5 +1,5 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p gnugrep coreutils curl wget jq nix-update prefetch-yarn-deps
#! nix-shell -i bash -p gnugrep coreutils curl jq nix-update prefetch-yarn-deps
set -euo pipefail
pushd "$(dirname "${BASH_SOURCE[0]}")"
@@ -14,10 +14,6 @@ if [[ "$UPDATE_NIX_OLD_VERSION" == "$version" ]]; then
exit 0
fi
rm -f package.json yarn.lock
wget "$url/ui/yarn.lock" "$url/ui/package.json"
echo $(prefetch-yarn-deps) > yarn-hash
rm -f yarn.lock
popd
nix-update pomerium --version $version
nix-update pomerium --version=skip --subpackage ui
-1
View File
@@ -1 +0,0 @@
07zzvqfinl7qqmwh00izvfc0xch2rjr4s8b1ca9ay26krd4d4sap