feat: Add DSS infrastructure, remove legacy admin-ui code
Some checks failed
DSS Project Analysis / dss-context-update (push) Has been cancelled
Some checks failed
DSS Project Analysis / dss-context-update (push) Has been cancelled
- Remove legacy admin-ui/js/ vanilla JS components - Add .dss/ directory with core tokens, skins, themes - Add Storybook configuration and generated stories - Add DSS management scripts (dss-services, dss-init, dss-setup, dss-reset) - Add MCP command definitions for DSS plugin - Add Figma sync architecture and scripts - Update pre-commit hooks with documentation validation - Fix JSON trailing commas in skin files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
178
scripts/dss-setup.sh
Executable file
178
scripts/dss-setup.sh
Executable file
@@ -0,0 +1,178 @@
|
||||
#!/bin/bash
|
||||
# DSS Complete Setup Script
|
||||
# Sets up MCP, initializes DSS structure, and starts services
|
||||
#
|
||||
# Usage: scripts/dss-setup.sh [--reset] [--skip-servers]
|
||||
#
|
||||
# Flow:
|
||||
# 1. Generate MCP configuration
|
||||
# 2. Install dependencies if needed
|
||||
# 3. Initialize DSS structure (dss-init.sh)
|
||||
# 4. Start development servers
|
||||
|
||||
set -e
|
||||
|
||||
DSS_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
cd "$DSS_ROOT"
|
||||
|
||||
# Parse arguments
|
||||
RESET=false
|
||||
SKIP_SERVERS=false
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
--reset) RESET=true ;;
|
||||
--skip-servers) SKIP_SERVERS=true ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Colors
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
CYAN='\033[0;36m'
|
||||
NC='\033[0m'
|
||||
|
||||
log_step() { echo -e "${BLUE}[SETUP]${NC} $1"; }
|
||||
log_ok() { echo -e "${GREEN}[OK]${NC} $1"; }
|
||||
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
||||
log_info() { echo -e "${CYAN}[INFO]${NC} $1"; }
|
||||
|
||||
echo "╔══════════════════════════════════════════════════════════════╗"
|
||||
echo "║ DSS COMPLETE SETUP ║"
|
||||
echo "╚══════════════════════════════════════════════════════════════╝"
|
||||
echo ""
|
||||
|
||||
# ============================================================================
|
||||
# STEP 1: Generate MCP Configuration
|
||||
# ============================================================================
|
||||
log_step "1. Generating MCP configuration..."
|
||||
|
||||
cat > "$DSS_ROOT/.mcp.json" << EOF
|
||||
{
|
||||
"\$schema": "https://raw.githubusercontent.com/anthropics/claude-code/main/schemas/mcp-servers.schema.json",
|
||||
"mcpServers": {
|
||||
"dss": {
|
||||
"command": "$DSS_ROOT/.venv/bin/python3",
|
||||
"args": ["$DSS_ROOT/dss-claude-plugin/servers/dss-mcp-server.py"],
|
||||
"env": {
|
||||
"PYTHONPATH": "$DSS_ROOT:$DSS_ROOT/dss-claude-plugin",
|
||||
"DSS_HOME": "$DSS_ROOT/.dss",
|
||||
"DSS_DATABASE": "$DSS_ROOT/.dss/dss.db",
|
||||
"DSS_CACHE": "$DSS_ROOT/.dss/cache",
|
||||
"DSS_BASE_PATH": "$DSS_ROOT"
|
||||
},
|
||||
"description": "Design System Server MCP - local development"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
log_ok "MCP config generated: .mcp.json"
|
||||
|
||||
echo ""
|
||||
|
||||
# ============================================================================
|
||||
# STEP 2: Check/Install Dependencies
|
||||
# ============================================================================
|
||||
log_step "2. Checking dependencies..."
|
||||
|
||||
# Check Python venv
|
||||
if [ ! -d "$DSS_ROOT/.venv" ]; then
|
||||
log_info "Creating Python virtual environment..."
|
||||
python3 -m venv "$DSS_ROOT/.venv"
|
||||
fi
|
||||
|
||||
# Activate venv and check packages
|
||||
source "$DSS_ROOT/.venv/bin/activate"
|
||||
if ! python3 -c "import mcp" 2>/dev/null; then
|
||||
log_info "Installing MCP package..."
|
||||
pip install mcp 2>/dev/null || log_warn "MCP package install failed"
|
||||
fi
|
||||
log_ok "Python venv ready"
|
||||
|
||||
# Check admin-ui node_modules
|
||||
if [ ! -d "$DSS_ROOT/admin-ui/node_modules" ]; then
|
||||
log_info "Installing admin-ui dependencies..."
|
||||
cd "$DSS_ROOT/admin-ui" && npm install
|
||||
cd "$DSS_ROOT"
|
||||
fi
|
||||
log_ok "Node dependencies ready"
|
||||
|
||||
echo ""
|
||||
|
||||
# ============================================================================
|
||||
# STEP 3: Initialize DSS Structure
|
||||
# ============================================================================
|
||||
log_step "3. Running DSS initialization..."
|
||||
|
||||
if [ "$RESET" = true ]; then
|
||||
"$DSS_ROOT/scripts/dss-init.sh" --reset
|
||||
else
|
||||
"$DSS_ROOT/scripts/dss-init.sh"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# ============================================================================
|
||||
# STEP 4: Start Development Servers
|
||||
# ============================================================================
|
||||
if [ "$SKIP_SERVERS" = false ]; then
|
||||
log_step "4. Starting development servers..."
|
||||
|
||||
# Kill existing processes
|
||||
pkill -f "vite.*admin-ui" 2>/dev/null || true
|
||||
pkill -f "storybook.*6006" 2>/dev/null || true
|
||||
sleep 1
|
||||
|
||||
# Start admin-ui (Vite)
|
||||
cd "$DSS_ROOT/admin-ui"
|
||||
nohup npm run dev > /tmp/dss-admin-ui.log 2>&1 &
|
||||
VITE_PID=$!
|
||||
log_info "admin-ui starting (PID: $VITE_PID)..."
|
||||
|
||||
# Start Storybook
|
||||
nohup npm run storybook > /tmp/dss-storybook.log 2>&1 &
|
||||
SB_PID=$!
|
||||
log_info "Storybook starting (PID: $SB_PID)..."
|
||||
|
||||
cd "$DSS_ROOT"
|
||||
|
||||
# Wait for servers
|
||||
sleep 5
|
||||
|
||||
# Check status
|
||||
if curl -s -o /dev/null -w "" http://localhost:3456 2>/dev/null; then
|
||||
log_ok "admin-ui running on http://localhost:3456"
|
||||
else
|
||||
log_warn "admin-ui not responding yet (check /tmp/dss-admin-ui.log)"
|
||||
fi
|
||||
|
||||
if curl -s -o /dev/null -w "" http://localhost:6006 2>/dev/null; then
|
||||
log_ok "Storybook running on http://localhost:6006"
|
||||
else
|
||||
log_warn "Storybook not responding yet (check /tmp/dss-storybook.log)"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
else
|
||||
log_step "4. Skipping servers (--skip-servers)"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# ============================================================================
|
||||
# SUMMARY
|
||||
# ============================================================================
|
||||
echo "╔══════════════════════════════════════════════════════════════╗"
|
||||
echo "║ DSS SETUP COMPLETE ║"
|
||||
echo "╚══════════════════════════════════════════════════════════════╝"
|
||||
echo ""
|
||||
echo " Services:"
|
||||
echo " admin-ui: http://localhost:3456"
|
||||
echo " Storybook: http://localhost:6006"
|
||||
echo ""
|
||||
echo " Logs:"
|
||||
echo " /tmp/dss-admin-ui.log"
|
||||
echo " /tmp/dss-storybook.log"
|
||||
echo ""
|
||||
echo " Next: Restart Claude Code to load DSS MCP server"
|
||||
echo ""
|
||||
Reference in New Issue
Block a user