diff --git a/.github/workflows/release-pages.yml b/.github/workflows/release-pages.yml index d7e73a457..4de7f51b3 100644 --- a/.github/workflows/release-pages.yml +++ b/.github/workflows/release-pages.yml @@ -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 diff --git a/.gitignore b/.gitignore index b5ee9e104..17d9b4ac1 100644 --- a/.gitignore +++ b/.gitignore @@ -78,7 +78,7 @@ templates_repo/ vite.config.mts.timestamp-*.mjs # Linux core dumps -/core +core *storybook.log storybook-static diff --git a/.pages/README.md b/.pages/README.md index 940a7c1c2..3aec49ca0 100644 --- a/.pages/README.md +++ b/.pages/README.md @@ -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) \ No newline at end of file diff --git a/.pages/index.html b/.pages/index.html index 913bdef18..803ea21ac 100644 --- a/.pages/index.html +++ b/.pages/index.html @@ -208,4 +208,4 @@ }) - + \ No newline at end of file diff --git a/knip.config.ts b/knip.config.ts index 1b532c8f3..127c1c947 100644 --- a/knip.config.ts +++ b/knip.config.ts @@ -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: { diff --git a/scripts/build-pages.sh b/scripts/build-pages.sh index 4d15758d3..575bbb4e2 100755 --- a/scripts/build-pages.sh +++ b/scripts/build-pages.sh @@ -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 "