diff --git a/scripts/docker-prep.sh b/scripts/docker-prep.sh new file mode 100755 index 0000000..6ff573e --- /dev/null +++ b/scripts/docker-prep.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# docker-prep.sh — Pack @bytelyst/* packages as tarballs for Docker/CI builds. +# Delegates to the universal prep-consumer.sh in learning_ai_common_plat. +# +# Usage: +# ./scripts/docker-prep.sh # prep for docker build +# ./scripts/docker-prep.sh --restore # undo package.json changes +# +# Prerequisites: +# cd ../learning_ai_common_plat && pnpm build +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +COMMON_PLAT="${REPO_ROOT}/../learning_ai_common_plat" +PREP_SCRIPT="${COMMON_PLAT}/scripts/prep-consumer.sh" + +if [ ! -f "$PREP_SCRIPT" ]; then + echo "❌ Cannot find prep-consumer.sh at $PREP_SCRIPT" + exit 1 +fi + +# Consumers in this repo that use file: refs to @bytelyst/* packages +CONSUMERS=(web) + +MODE="${1:-}" + +for consumer in "${CONSUMERS[@]}"; do + TARGET="${REPO_ROOT}/${consumer}" + if [ ! -d "$TARGET" ]; then + echo "⚠️ Skipping ${consumer} — directory not found" + continue + fi + + if [[ "$MODE" == "--restore" ]]; then + bash "$PREP_SCRIPT" "$TARGET" --restore + else + bash "$PREP_SCRIPT" "$TARGET" + fi +done + +if [[ "$MODE" != "--restore" ]]; then + echo "" + echo "✅ Docker prep complete. Restore with: ./scripts/docker-prep.sh --restore" +fi diff --git a/web/.gitignore b/web/.gitignore index d2097c8..bb7deba 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -43,3 +43,7 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +# Docker prep (generated by prep-consumer.sh) +.docker-deps/ +package.json.bak