Flake lock file updates: • Updated input 'dream2nix': 'github:nix-community/dream2nix/1b5e01219a32324c8f6889fe1f4db933ec7932f6?narHash=sha256-04gy1icwnGO3ZXF6r96yBm/C0PNPzeLxA/8xzzq0dBI%3D' (2024-06-29) → 'github:nix-community/dream2nix/8ce6284ff58208ed8961681276f82c2f8f978ef4?narHash=sha256-n5CwhmqKxifuD4Sq4WuRP/h5LO6f23cGnSAuJemnd/4%3D' (2024-12-25) • Updated input 'dream2nix/nixpkgs': 'github:NixOS/nixpkgs/1e3deb3d8a86a870d925760db1a5adecc64d329d?narHash=sha256-vN5xJAZ4UGREEglh3lfbbkIj%2BMPEYMuqewMn4atZFaQ%3D' (2024-06-27) → 'github:NixOS/nixpkgs/41dea55321e5a999b17033296ac05fe8a8b5a257?narHash=sha256-WvLXzNNnnw%2BqpFOmgaM3JUlNEH%2BT4s22b5i2oyyCpXE%3D' (2024-10-25) • Updated input 'dream2nix/purescript-overlay': 'github:thomashoneyman/purescript-overlay/047c7933abd6da8aa239904422e22d190ce55ead?narHash=sha256-eMjFmsj2G1E0Q5XiibUNgFjTiSz0GxIeSSzzVdoN730%3D' (2023-09-29) → 'github:thomashoneyman/purescript-overlay/4ad4c15d07bd899d7346b331f377606631eb0ee4?narHash=sha256-Sws7w0tlnjD%2BBjck1nv29NjC5DbL6nH5auL9Ex9Iz2A%3D' (2024-10-10) • Added input 'dream2nix/purescript-overlay/flake-compat': 'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33?narHash=sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U%3D' (2023-10-04) • Updated input 'dream2nix/purescript-overlay/slimlock': 'github:thomashoneyman/slimlock/b5c6cdcaf636ebbebd0a1f32520929394493f1a6?narHash=sha256-Wg0ViDotFWGWqKIQzyYCgayeH8s4U1OZcTiWTQYdAp4%3D' (2023-07-06) → 'github:thomashoneyman/slimlock/cf72723f59e2340d24881fd7bf61cb113b4c407c?narHash=sha256-xzkkMv3neJJJ89zo3o2ojp7nFeaZc2G0fYwNXNJRFlo%3D' (2023-07-07) • Updated input 'fenix': 'github:nix-community/fenix/ebfe2c639111d7e82972a12711206afaeeda2450?narHash=sha256-K2xFp142onP35jcx7li10xUxNVEVRWjAdY8DSuR7Naw%3D' (2024-07-01) → 'github:nix-community/fenix/ac79bb490b8c1af4bbc587b84c76f9527d6b14f7?narHash=sha256-lvp77MhGzSN%2BICd0MugppCjQR6cmlM2iAC5cjy2ZsaA%3D' (2025-01-18) • Updated input 'fenix/rust-analyzer-src': 'github:rust-lang/rust-analyzer/ea7fdada6a0940b239ddbde2048a4d7dac1efe1e?narHash=sha256-fsxAuW6RxKZYjAP3biUC6C4vaYFhDfWv8lp1Tmx3ZCY%3D' (2024-06-30) → 'github:rust-lang/rust-analyzer/f61bfa4d7feb84d07538d361fe77d34a29e3b375?narHash=sha256-m4SN8DeKzsP10EQFS7%2B2zgGfCrMhTfTt1H0QRNesD08%3D' (2025-01-17) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/7dca15289a1c2990efbe4680f0923ce14139b042?narHash=sha256-RoxIr/fbndtuKqulGvNCcuzC6KdAib85Q8gXnjzA1dw%3D' (2024-06-30) → 'github:nixos/nixpkgs/6a3ae7a5a12fb8cac2d59d7df7cbd95f9b2f0566?narHash=sha256-s40Kk/OulP3J/1JvC3VT16U4r/Xw6Qdi7SRw3LYkPWs%3D' (2025-01-18)
52 lines
1.7 KiB
Bash
52 lines
1.7 KiB
Bash
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
# The backticks aren't supposed to be shell expansion
|
|
# shellcheck disable=SC2016
|
|
echo 'Note: Update the flake inputs with `nix flake update --commit-lockfile *first*`'
|
|
|
|
# Make sure we're at the repo root
|
|
cd "$(git rev-parse --show-toplevel)" || exit
|
|
|
|
# Update cargo deps
|
|
cd packages/server || exit
|
|
cargo update
|
|
|
|
if ! git diff --quiet Cargo.lock Cargo.toml; then
|
|
git commit -m 'server: Update cargo dependencies' Cargo.lock Cargo.toml
|
|
fi
|
|
|
|
# Update template deps
|
|
cd ../templates || exit
|
|
|
|
tmpdir="$(mktemp -dt 'npm-updates.XXXXXXXXXX')"
|
|
trap 'rm -r -- "$tmpdir"' EXIT
|
|
|
|
# Ensure package.json is up to date so that npm-check-updates can read
|
|
# it
|
|
yq --output-format json package.yaml > package.json
|
|
|
|
# Fetch package updates and prepare an update dict
|
|
yq -P eval-all '{"dependencies": select(fi==0)} * {"devDependencies": select(fi==1)}' \
|
|
<(npm-check-updates --dep prod --jsonUpgraded) \
|
|
<(npm-check-updates --dep dev --jsonUpgraded) \
|
|
> "$tmpdir/updates.yaml"
|
|
|
|
# Now apply these using yq
|
|
yq -P ". *= load(\"$tmpdir/updates.yaml\")" package.yaml > "$tmpdir/package.yaml.updated"
|
|
|
|
# yq's in-place replacement sadly doesn't persist newlines currently,
|
|
# so we need to apply the changes in a roundabout way using diff.
|
|
diff --ignore-blank-lines <(yq '.' package.yaml) "$tmpdir/package.yaml.updated" > "$tmpdir/update.patch" || true
|
|
patch --no-backup-if-mismatch --merge --input="$tmpdir/update.patch" package.yaml
|
|
|
|
# Update package.json again and get npm to update the package lock
|
|
# file
|
|
yq . package.yaml > package.json
|
|
npm install --package-lock-only
|
|
|
|
if ! git diff --quiet package.yaml package-lock.json; then
|
|
git commit -m 'templates: Update npm dependencies' package.yaml package-lock.json
|
|
fi
|