feat: add documentation for synchronizing prototypes and script to automate the process
This commit introduces a new document explaining how to synchronize visual prototypes and POCs into the monorepo. It also adds a script to automate the process of building and copying the prototype files into the `internal/launchpad/prototypes/web/` directory. The documentation explains the benefits of synchronizing prototypes, the prerequisites, and the steps to synchronize them. The script automates the process of installing dependencies, building the web application, and copying the resulting `dist/` folder into the `internal/launchpad/prototypes/web/` directory. This allows developers to easily synchronize prototypes and make them available for local preview and deployment.
This commit is contained in:
56
scripts/sync-prototypes.sh
Executable file
56
scripts/sync-prototypes.sh
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Configuration - Paths relative to project root
|
||||
POC_REPO_PATH="../client-krow-poc"
|
||||
WEB_POC_SOURCE="$POC_REPO_PATH/prototypes/web/krow_web_application"
|
||||
WEB_DEST="internal/launchpad/prototypes/web"
|
||||
|
||||
# Colors
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
RED='\033[0;31m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
echo -e "${BLUE}🚀 Starting Prototypes Synchronization...${NC}"
|
||||
|
||||
# Check if POC repo exists
|
||||
if [ ! -d "$POC_REPO_PATH" ]; then
|
||||
echo -e "${RED}❌ Error: POC repository not found at $POC_REPO_PATH${NC}"
|
||||
echo "Please clone the repository adjacent to this one:"
|
||||
echo " cd .. && git clone git@github.com:Oloodi/client-krow-poc.git"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# --- Sync Web Dashboard ---
|
||||
echo -e "${BLUE}📦 Building Web Dashboard Prototype...${NC}"
|
||||
if [ -d "$WEB_POC_SOURCE" ]; then
|
||||
cd "$WEB_POC_SOURCE"
|
||||
|
||||
echo " -> Installing dependencies..."
|
||||
pnpm install --silent
|
||||
|
||||
echo " -> Building dist..."
|
||||
pnpm run build
|
||||
|
||||
# Go back to project root
|
||||
cd - > /dev/null
|
||||
|
||||
echo " -> Deploying to Launchpad..."
|
||||
# Ensure destination exists and is clean (remove old files but keep .keep if needed, though usually we wipe for a clean build)
|
||||
rm -rf "$WEB_DEST"/*
|
||||
mkdir -p "$WEB_DEST"
|
||||
|
||||
# Copy build artifacts
|
||||
cp -R "$WEB_POC_SOURCE/dist/"* "$WEB_DEST/"
|
||||
|
||||
echo -e "${GREEN}✅ Web Dashboard synced successfully.${NC}"
|
||||
else
|
||||
echo -e "${RED}⚠️ Warning: Web POC source directory not found at $WEB_POC_SOURCE${NC}"
|
||||
fi
|
||||
|
||||
# --- Future: Sync Mobile Prototypes ---
|
||||
# Add logic here when mobile prototypes are ready to be built for web (Flutter Web)
|
||||
|
||||
echo -e "${GREEN}🎉 Synchronization complete!${NC}"
|
||||
echo "You can now verify the prototypes in internal/launchpad/prototypes/ and commit the changes."
|
||||
Reference in New Issue
Block a user