1+ name : Check Scaffolded Vite Config Sync
2+
3+ on :
4+ pull_request :
5+ paths :
6+ - ' packages/standalone-ui/vite.config.ts'
7+ push :
8+ paths :
9+ - ' packages/standalone-ui/vite.config.ts'
10+
11+ jobs :
12+ check-vite-config-sync :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v4
18+ with :
19+ fetch-depth : 0
20+
21+ - name : Check for standalone-ui vite.config.ts changes
22+ id : check_changes
23+ run : |
24+ # Check if standalone-ui/vite.config.ts was modified
25+ if git diff --name-only HEAD~1..HEAD | grep -q "packages/standalone-ui/vite.config.ts"; then
26+ echo "standalone_ui_modified=true" >> $GITHUB_OUTPUT
27+ else
28+ echo "standalone_ui_modified=false" >> $GITHUB_OUTPUT
29+ fi
30+
31+ # Check if template.ts was also modified in this PR/push
32+ if git diff --name-only HEAD~1..HEAD | grep -q "packages/cli/src/utils/template.ts"; then
33+ echo "template_modified=true" >> $GITHUB_OUTPUT
34+ else
35+ echo "template_modified=false" >> $GITHUB_OUTPUT
36+ fi
37+
38+ - name : Display sync documentation and fail
39+ if : steps.check_changes.outputs.standalone_ui_modified == 'true'
40+ run : |
41+ echo "🚨 VITE CONFIG SYNC REQUIRED 🚨"
42+ echo ""
43+ echo "==============================================="
44+ echo "CHANGES DETECTED TO packages/standalone-ui/vite.config.ts"
45+ echo "==============================================="
46+ echo ""
47+ echo "📋 REQUIRED ACTION:"
48+ echo "Any changes to the library build configuration in standalone-ui"
49+ echo "must be manually synchronized to packages/cli/src/utils/template.ts"
50+ echo ""
51+ echo "🎯 SPECIFIC SECTIONS TO SYNC:"
52+ echo "- rollupOptions.external array"
53+ echo "- rollupOptions.output.globals object"
54+ echo "- Comments explaining bundling strategy"
55+ echo ""
56+ echo "🔍 WHY THIS MATTERS:"
57+ echo "- standalone-ui builds questions.mjs for monorepo development"
58+ echo "- template.ts generates vite.config.ts for scaffolded projects"
59+ echo "- Both must produce identical questions.mjs output"
60+ echo "- Config drift causes 'bare specifier' import errors in studio mode"
61+ echo ""
62+ echo "==============================================="
63+ echo "CURRENT CHANGES IN THIS PR/PUSH"
64+ echo "==============================================="
65+ echo ""
66+ echo "📄 Changes to standalone-ui/vite.config.ts:"
67+ git diff HEAD~1..HEAD -- packages/standalone-ui/vite.config.ts || echo "No diff available"
68+ echo ""
69+
70+ if [ "${{ steps.check_changes.outputs.template_modified }}" == "true" ]; then
71+ echo "✅ Changes detected to template.ts (good!):"
72+ git diff HEAD~1..HEAD -- packages/cli/src/utils/template.ts || echo "No diff available"
73+ else
74+ echo "❌ NO changes detected to packages/cli/src/utils/template.ts"
75+ echo ""
76+ echo "🔧 TO FIX:"
77+ echo "1. Review the standalone-ui vite.config.ts changes above"
78+ echo "2. Apply equivalent changes to packages/cli/src/utils/template.ts"
79+ echo "3. Focus on the library build rollupOptions section (lines ~200-230)"
80+ echo "4. Ensure external array and globals object match exactly"
81+ echo "5. Update comments to match bundling strategy"
82+ echo "6. Commit and push the template.ts changes"
83+ fi
84+ echo ""
85+ echo "==============================================="
86+ echo "REFERENCE LOCATIONS"
87+ echo "==============================================="
88+ echo ""
89+ echo "📁 Source of truth:"
90+ echo " packages/standalone-ui/vite.config.ts (lines ~56-80)"
91+ echo ""
92+ echo "📁 Template to update:"
93+ echo " packages/cli/src/utils/template.ts (lines ~200-230)"
94+ echo " Look for the rollupOptions section in createViteConfig()"
95+ echo ""
96+ echo "📚 Context:"
97+ echo " This sync requirement exists because scaffolded projects cannot"
98+ echo " use the monorepo's vite.config.base.js due to path dependencies."
99+ echo ""
100+ echo "🚨 THIS CHECK WILL ALWAYS FAIL TO FORCE MANUAL REVIEW 🚨"
101+ exit 1
0 commit comments