Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions resources_servers/ui_generation_agentic/docker/regen_locks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Regenerate docker/<stack>/package-lock.json from the package.json heredoc in docker/<stack>.Dockerfile.
#
# The manifest lives only inside the Dockerfile; this script extracts it, resolves the tree with npm
# (no install), writes the lock back and fails if the lock root no longer mirrors the manifest.
# usage: regen_locks.sh [ui-next|ui-vite ...] (default: both)
set -euo pipefail
HERE=$(cd "$(dirname "$0")" && pwd)
stacks=("$@"); [ ${#stacks[@]} -eq 0 ] && stacks=(ui-next ui-vite)
for stack in "${stacks[@]}"; do
df=$HERE/$stack.Dockerfile
work=$(mktemp -d "${TMPDIR:-/tmp}/regen-$stack.XXXXXX")
trap 'rm -rf "$work"' EXIT
awk "/<<'EOF' \/app\/package.json\$/{on=1; next} on && /^EOF\$/{exit} on" "$df" > "$work/package.json"
cp "$HERE/$stack/package-lock.json" "$work/"
(cd "$work" && npm install --package-lock-only --legacy-peer-deps --ignore-scripts --no-audit --no-fund --loglevel=error)
python3 - "$work" <<'PY'
import json, sys
w = sys.argv[1]
manifest = json.load(open(f"{w}/package.json"))
root = json.load(open(f"{w}/package-lock.json"))["packages"][""]
# npm mirrors the manifest's dependencies into the lock root (overrides are not recorded there).
if manifest.get("dependencies") != root.get("dependencies"):
sys.exit("lock root dependencies differ from the Dockerfile manifest")
PY
cp "$work/package-lock.json" "$HERE/$stack/package-lock.json"
rm -rf "$work"; trap - EXIT
echo "$stack: package-lock.json regenerated"
done
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ COPY --chown=node:node <<'EOF' /app/package.json
"@tiptap/react": "3.0.9",
"@tiptap/starter-kit": "3.0.9",
"@types/node": "24.1.0",
"@types/react": "19.1.17",
"@types/react-dom": "19.1.11",
"@types/react": "19.3.3",
"@types/react-dom": "19.3.0",
"@use-gesture/react": "10.3.1",
"@xyflow/react": "12.8.6",
"antd": "5.26.7",
"aos": "2.3.4",
"apexcharts": "5.3.6",
"autoprefixer": "10.4.27",
"axios": "1.11.0",
"axios": "1.21.1",
"browser-image-compression": "2.0.2",
"canvas-confetti": "1.9.4",
"canvg": "4.0.3",
Expand Down Expand Up @@ -129,18 +129,18 @@ COPY --chown=node:node <<'EOF' /app/package.json
"jspdf-autotable": "5.0.8",
"jszip": "3.10.2",
"leaflet": "1.9.4",
"lodash": "4.17.23",
"lodash": "4.18.1",
"lorem-ipsum": "2.0.10",
"lucide-react": "0.534.0",
"marked": "16.1.2",
"mathjs": "14.6.0",
"mathjs": "14.9.1",
"matter-js": "0.20.0",
"moment": "2.30.1",
"monaco-editor": "0.52.2",
"motion": "12.23.28",
"motion-dom": "12.23.28",
"nanoid": "5.1.16",
"next": "15.4.11",
"next": "15.5.29",
"next-themes": "0.4.6",
"ogl": "1.0.11",
"openmeteo": "1.2.3",
Expand All @@ -149,7 +149,7 @@ COPY --chown=node:node <<'EOF' /app/package.json
"postcss": "8.5.30",
"postprocessing": "6.37.8",
"qrcode": "1.5.4",
"react": "19.1.9",
"react": "19.3.1",
"react-apexcharts": "1.7.0",
"react-chartjs-2": "5.3.1",
"react-circular-progressbar": "2.2.0",
Expand All @@ -161,7 +161,7 @@ COPY --chown=node:node <<'EOF' /app/package.json
"react-dnd": "16.0.1",
"react-dnd-html5-backend": "16.0.1",
"react-dnd-touch-backend": "16.0.1",
"react-dom": "19.1.9",
"react-dom": "19.3.1",
"react-dropzone": "14.3.8",
"react-fast-marquee": "1.6.5",
"react-feather": "2.0.10",
Expand Down Expand Up @@ -226,7 +226,8 @@ COPY --chown=node:node <<'EOF' /app/package.json
EOF

# The committed lockfile (docker/<stack>/package-lock.json, named context `stack_lock`) pins every transitive
# dependency; npm ci installs exactly that tree.
# dependency; npm ci installs exactly that tree. Regenerate it after editing the manifest above with
# docker/regen_locks.sh, which also checks the lock root still mirrors the manifest.
COPY --chown=node:node --from=stack_lock package-lock.json /app/package-lock.json
RUN npm ci --legacy-peer-deps --no-audit --no-fund --loglevel=error \
&& npm cache clean --force
Expand Down
Loading
Loading