mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 22:37:32 +00:00
feat(pages): optimize GitHub Pages artifact handling and improve build configuration
- Update vitest-reports artifact download paths to use .gh-pages-cache for better organization - Fix .gitignore core dump pattern to be more general (core instead of /core) - Update .pages structure with migrated documentation and configuration - Refine Knip configuration to exclude .pages directory while keeping vite.config.ts - Improve build-pages.sh script to use relative paths consistently for .pages directory 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
4
.github/workflows/release-pages.yml
vendored
4
.github/workflows/release-pages.yml
vendored
@@ -65,7 +65,7 @@ jobs:
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: vitest-reports
|
||||
path: ./.pages
|
||||
path: ./.gh-pages-cache/vitest-reports
|
||||
run-id: ${{ github.event.workflow_run.id }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -79,7 +79,7 @@ jobs:
|
||||
name: vitest-reports
|
||||
branch: main
|
||||
workflow_conclusion: success
|
||||
path: ./.pages
|
||||
path: ./.gh-pages-cache/vitest-reports
|
||||
|
||||
- name: Build static assets (with artifact reuse)
|
||||
run: ./scripts/build-pages.sh
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -78,7 +78,7 @@ templates_repo/
|
||||
vite.config.mts.timestamp-*.mjs
|
||||
|
||||
# Linux core dumps
|
||||
/core
|
||||
core
|
||||
|
||||
*storybook.log
|
||||
storybook-static
|
||||
|
||||
@@ -25,7 +25,7 @@ The primary motivation for this deployment is to provide the design team with a
|
||||
|
||||
## Deployment Workflow
|
||||
|
||||
The deployment is managed by the `.github/workflows/deploy-gh-pages.yml` workflow, which:
|
||||
The deployment is managed by the `.github/workflows/release-pages.yml` workflow, which:
|
||||
|
||||
1. **Triggers on**:
|
||||
- Push to `main` branch
|
||||
@@ -123,7 +123,7 @@ If changes aren't reflected on the live site:
|
||||
|
||||
To add a new development tool to the deployment:
|
||||
|
||||
1. Add a new build step in `.github/workflows/deploy-gh-pages.yml`
|
||||
1. Add a new build step in `.github/workflows/release-pages.yml`
|
||||
2. Ensure the output goes to a subdirectory of `dist/`
|
||||
3. Add `continue-on-error: true` if the tool is optional
|
||||
4. Update the landing page `dist/index.html` with a link to the new tool
|
||||
@@ -157,4 +157,4 @@ The deployment only includes static, built artifacts:
|
||||
- [Storybook Documentation](https://storybook.js.org/docs)
|
||||
- [Nx Documentation](https://nx.dev)
|
||||
- [Vitest Documentation](https://vitest.dev)
|
||||
- [Knip Documentation](https://knip.dev)
|
||||
- [Knip Documentation](https://knip.dev)
|
||||
@@ -208,4 +208,4 @@
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
@@ -40,7 +40,6 @@ const config: KnipConfig = {
|
||||
'packages/registry-types/src/comfyRegistryTypes.ts',
|
||||
// Used by a custom node (that should move off of this)
|
||||
'src/scripts/ui/components/splitButton.ts',
|
||||
'.pages/**/*',
|
||||
'.pages/vite.config.ts'
|
||||
],
|
||||
compilers: {
|
||||
|
||||
@@ -7,57 +7,57 @@ cd "$ROOT_DIR"
|
||||
|
||||
# Build or reuse Storybook
|
||||
echo "[build-pages] Setting up Storybook"
|
||||
rm -rf "./.pages/storybook"
|
||||
rm -rf ".pages/storybook"
|
||||
if [ -d "./storybook-static" ] && [ "$(find ./storybook-static -name '*.html' | wc -l)" -gt 0 ]; then
|
||||
echo "✅ Reusing downloaded Storybook build"
|
||||
cp -r "./storybook-static" "./.pages/storybook"
|
||||
cp -r "./storybook-static" ".pages/storybook"
|
||||
else
|
||||
echo "🔨 Building Storybook from source"
|
||||
pnpm build-storybook && cp -r "storybook-static" "./.pages/storybook"
|
||||
pnpm build-storybook && cp -r "storybook-static" ".pages/storybook"
|
||||
fi
|
||||
|
||||
echo "[build-pages] Generating Nx dependency graph"
|
||||
rm -rf "./.pages/nx-graph" && mkdir -p "./.pages/nx-graph"
|
||||
pnpm nx graph --file="./.pages/nx-graph/index.html"
|
||||
rm -rf ".pages/nx-graph" && mkdir -p ".pages/nx-graph"
|
||||
pnpm nx graph --file=".pages/nx-graph/index.html"
|
||||
|
||||
# Generate or reuse Vitest test reports
|
||||
echo "[build-pages] Setting up Vitest test reports"
|
||||
rm -rf "./.pages/vitest-reports" && mkdir -p "./.pages/vitest-reports"
|
||||
if [ -d "./.gh-pages-cache/vitest-reports" ]; then
|
||||
rm -rf ".pages/vitest-reports" && mkdir -p ".pages/vitest-reports"
|
||||
if [ -d ".page/vitest-reports" ]; then
|
||||
echo "✅ Reusing downloaded Vitest reports"
|
||||
cp -r "./.gh-pages-cache/vitest-reports/"* "./.pages/vitest-reports/" 2>/dev/null || echo "⚠️ No vitest reports to copy"
|
||||
cp -r ".page/vitest-reports/"* ".pages/vitest-reports/" 2>/dev/null || echo "⚠️ No vitest reports to copy"
|
||||
else
|
||||
echo "🔨 Generating Vitest reports from source"
|
||||
pnpm exec vitest \
|
||||
--reporter=json --outputFile.json="./.pages/vitest-reports/results.json" \
|
||||
--reporter=html --outputFile.html="./.pages/vitest-reports/index.html" \
|
||||
--reporter=json --outputFile.json=".pages/vitest-reports/results.json" \
|
||||
--reporter=html --outputFile.html=".pages/vitest-reports/index.html" \
|
||||
--run
|
||||
fi
|
||||
|
||||
# Set up Playwright test reports if available
|
||||
echo "[build-pages] Setting up Playwright test reports"
|
||||
if [ -d "./.gh-pages-cache/playwright-reports" ]; then
|
||||
if [ -d ".page/playwright-reports" ]; then
|
||||
echo "✅ Reusing downloaded Playwright reports"
|
||||
mkdir -p "./.pages/playwright-reports"
|
||||
cp -r "./.gh-pages-cache/playwright-reports/"* "./.pages/playwright-reports/" 2>/dev/null || echo "⚠️ No playwright reports to copy"
|
||||
mkdir -p ".pages/playwright-reports"
|
||||
cp -r ".page/playwright-reports/"* ".pages/playwright-reports/" 2>/dev/null || echo "⚠️ No playwright reports to copy"
|
||||
fi
|
||||
|
||||
echo "[build-pages] Generating coverage report"
|
||||
mkdir -p "./.pages/coverage"
|
||||
if pnpm exec vitest --run --coverage --coverage.reporter=html --coverage.reportsDirectory="./.pages/coverage"; then
|
||||
mkdir -p ".pages/coverage"
|
||||
if pnpm exec vitest --run --coverage --coverage.reporter=html --coverage.reportsDirectory=".pages/coverage"; then
|
||||
echo "✅ Coverage report completed"
|
||||
else
|
||||
echo "⚠️ Coverage report failed, continuing..."
|
||||
fi
|
||||
|
||||
echo "[build-pages] Generating Knip report"
|
||||
mkdir -p "./.pages/knip"
|
||||
rm -f "./.pages/knip/report.md"
|
||||
if pnpm knip --reporter markdown --no-progress --no-exit-code > "./.pages/knip/report.md" 2>/dev/null && [ -s "./.pages/knip/report.md" ]; then
|
||||
echo "✅ Knip report generated at ./.pages/knip/report.md"
|
||||
mkdir -p ".pages/knip"
|
||||
rm -f ".pages/knip/report.md"
|
||||
if pnpm knip --reporter markdown --no-progress --no-exit-code > ".pages/knip/report.md" 2>/dev/null && [ -s ".pages/knip/report.md" ]; then
|
||||
echo "✅ Knip report generated at .pages/knip/report.md"
|
||||
else
|
||||
echo "⚠️ Knip report failed, creating placeholder..."
|
||||
cat > "./.pages/knip/report.md" <<'EOF'
|
||||
cat > ".pages/knip/report.md" <<'EOF'
|
||||
# Knip report
|
||||
|
||||
> ⚠️ Knip report unavailable.
|
||||
@@ -66,16 +66,10 @@ else
|
||||
EOF
|
||||
fi
|
||||
|
||||
if cp "${ROOT_DIR}/docs/pages/knip/index.html" "./.pages/knip/index.html" 2>/dev/null; then
|
||||
echo "✅ Knip HTML wrapper completed"
|
||||
else
|
||||
echo "⚠️ Knip HTML wrapper missing, continuing..."
|
||||
fi
|
||||
|
||||
echo "[build-pages] Landing page already exists at ./.pages/index.html"
|
||||
echo "[build-pages] Landing page already exists at .pages/index.html"
|
||||
|
||||
echo "[build-pages] Build artifacts ready in ./.pages"
|
||||
|
||||
echo "[build-pages] Note: For local dev, you can develop the docs/pages/index.html using:
|
||||
pnpm exec vite ./.pages
|
||||
pnpm exec vite .pages
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user