From c90cc623ae0e40bcb4ca3b7f110943eabdaded5c Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Tue, 11 Nov 2025 10:57:03 -0700 Subject: [PATCH 01/21] chore: publish 2nd generation preview docs in PR --- .github/scripts/build-preview-urls-comment.js | 14 +- .github/workflows/preview-docs.yml | 288 +++++++++--------- 2 files changed, 159 insertions(+), 143 deletions(-) diff --git a/.github/scripts/build-preview-urls-comment.js b/.github/scripts/build-preview-urls-comment.js index 86864136aa6..e53f9e63392 100644 --- a/.github/scripts/build-preview-urls-comment.js +++ b/.github/scripts/build-preview-urls-comment.js @@ -82,15 +82,17 @@ export const buildPreviewURLComment = (prNumber) => { - [High Contrast Mode | Medium | LTR](${hcmUrl})`); // Documentation and Storybook URLs - const docsUrl = `${baseUrl}/${prHash}/docs/`; - const storybookUrl = `${baseUrl}/${prHash}/docs/storybook/`; + const docs1stGenUrl = `${baseUrl}/${prHash}/docs/1st-gen-docs/`; + const storybook1stGenUrl = `${baseUrl}/${prHash}/docs/1st-gen-storybook/`; + const storybook2ndGenUrl = `${baseUrl}/${prHash}/docs/2nd-gen-storybook/`; - let comment = `## 📚 Branch Preview + let comment = `## 📚 Branch Preview Links -- [Documentation Site](${docsUrl}) -- [Storybook](${storybookUrl}) +- [Documentation Site (1st-gen)](${docs1stGenUrl}) +- [Storybook (1st-gen)](${storybook1stGenUrl}) +- [Storybook (2nd-gen)](${storybook2ndGenUrl}) -

🔍 Visual Regression Test Results

+

🔍 First GenerationVisual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs: diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 772fc411e93..23fbc7f9e71 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -1,146 +1,160 @@ name: Preview Documentation (Azure Blob Storage) on: - pull_request: - types: [opened, synchronize, reopened, closed] - branches: - - "**" + pull_request: + types: [opened, synchronize, reopened, closed] + branches: + - '**' permissions: - contents: read - pull-requests: write + contents: read + pull-requests: write env: - AZCOPY_AUTO_LOGIN_TYPE: SPN - AZCOPY_SPA_APPLICATION_ID: ${{ secrets.AZURE_CLIENT_ID }} - AZCOPY_SPA_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} - AZCOPY_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} + AZCOPY_AUTO_LOGIN_TYPE: SPN + AZCOPY_SPA_APPLICATION_ID: ${{ secrets.AZURE_CLIENT_ID }} + AZCOPY_SPA_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} + AZCOPY_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} jobs: - build_and_deploy_job: - if: github.event_name == 'pull_request' && github.event.action != 'closed' - runs-on: ubuntu-latest - name: Build and Deploy Job - outputs: - doc_url: ${{ steps.deploy.outputs.docs_url }} - steps: - ## --- SETUP --- ## - - name: Check out code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Use Node LTS version - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: yarn - - - name: Enable Corepack - run: corepack enable - - - name: Generate PR hash - id: pr_hash - run: | - # Use just PR number so each commit overwrites the previous deployment - pr_hash="pr-${{ github.event.pull_request.number }}" - echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" - echo "Generated PR hash: ${pr_hash}" - - ## --- YARN CACHE --- ## - - name: Check for cached dependencies - continue-on-error: true - id: cache-dependencies - uses: actions/cache@v4 - with: - path: | - .cache/yarn - node_modules - key: ubuntu-latest-node20-${{ hashFiles('yarn.lock', 'package.json') }} - - ## --- INSTALL & BUILD --- ## - - name: Install dependencies - shell: bash - run: yarn install --immutable - - - name: Build 1st-gen - run: yarn workspace @spectrum-web-components/1st-gen build - - - name: Build 2nd-gen core - run: yarn workspace @spectrum-web-components/core build - - - name: Build 2nd-gen swc - run: yarn workspace @adobe/swc build - - - name: Generate Custom Elements Manifest - run: yarn workspace @spectrum-web-components/1st-gen docs:analyze - - - name: Move CEM to Storybook directory - run: cp 1st-gen/projects/documentation/custom-elements.json 1st-gen/storybook/ - - - name: Build documentation with path prefix - env: - SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs - run: | - yarn workspace @spectrum-web-components/1st-gen docs:build - - - name: Build Storybook - run: yarn workspace @spectrum-web-components/1st-gen storybook:build - - ## --- DEPLOY TO AZURE BLOB STORAGE --- ## - - name: Setup AzCopy - uses: ./.github/actions/setup-azcopy - - - name: Deploy to Azure Blob Storage - id: deploy - env: - PR_HASH: ${{ steps.pr_hash.outputs.hash }} - run: | - # Upload documentation - echo "Uploading documentation to ${PR_HASH}/docs/" - azcopy copy "1st-gen/projects/documentation/dist/*" \ - "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/" \ - --recursive \ - --from-to LocalBlob - - # Upload Storybook - echo "Uploading Storybook to ${PR_HASH}/docs/storybook/" - azcopy copy "1st-gen/storybook-static/*" \ - "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/storybook/" \ - --recursive \ - --from-to LocalBlob - - # Set output URLs - docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/" - storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/storybook/" - echo "docs_url=${docs_url}" >> "$GITHUB_OUTPUT" - echo "storybook_url=${storybook_url}" >> "$GITHUB_OUTPUT" - echo "Deployed to: ${docs_url}" - - close_pull_request_job: - if: github.event_name == 'pull_request' && github.event.action == 'closed' - runs-on: ubuntu-latest - name: Clean up PR deployment - steps: - - name: Check out code - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - name: Generate PR hash - id: pr_hash - run: | - # Create the same hash as in the deploy job - pr_hash="pr-${{ github.event.pull_request.number }}" - echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" - - - name: Setup AzCopy - uses: ./.github/actions/setup-azcopy - - - name: Clean up PR deployment - env: - PR_HASH: ${{ steps.pr_hash.outputs.hash }} - run: | - echo "Cleaning up deployment: ${PR_HASH}/" - azcopy remove "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/" \ - --recursive || echo "Cleanup completed (some files may not exist)" - echo "Cleanup completed for PR deployment: ${PR_HASH}/" + build_and_deploy_job: + if: github.event_name == 'pull_request' && github.event.action != 'closed' + runs-on: ubuntu-latest + name: Build and Deploy Job + outputs: + doc_url: ${{ steps.deploy.outputs.docs_url }} + steps: + ## --- SETUP --- ## + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Use Node LTS version + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn + + - name: Enable Corepack + run: corepack enable + + - name: Generate PR hash + id: pr_hash + run: | + # Use just PR number so each commit overwrites the previous deployment + pr_hash="pr-${{ github.event.pull_request.number }}" + echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" + echo "Generated PR hash: ${pr_hash}" + + ## --- YARN CACHE --- ## + - name: Check for cached dependencies + continue-on-error: true + id: cache-dependencies + uses: actions/cache@v4 + with: + path: | + .cache/yarn + node_modules + key: ubuntu-latest-node20-${{ hashFiles('yarn.lock', 'package.json') }} + + ## --- INSTALL & BUILD --- ## + - name: Install dependencies + shell: bash + run: yarn install --immutable + + - name: Build 1st-gen + run: yarn workspace @spectrum-web-components/1st-gen build + + - name: Build 2nd-gen core + run: yarn workspace @spectrum-web-components/core build + + - name: Build 2nd-gen swc + run: yarn workspace @adobe/swc build + + - name: Generate Custom Elements Manifest + run: yarn workspace @spectrum-web-components/1st-gen docs:analyze + + - name: Move CEM to Storybook directory + run: cp 1st-gen/projects/documentation/custom-elements.json 1st-gen/storybook/ + + - name: Build documentation with path prefix + env: + SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs + run: | + yarn workspace @spectrum-web-components/1st-gen docs:build + + - name: Build 1st-gen Storybook + run: yarn workspace @spectrum-web-components/1st-gen storybook:build + + - name: Build 2nd-gen Storybook + run: yarn workspace @spectrum-web-components/2nd-gen storybook:build + + ## --- DEPLOY TO AZURE BLOB STORAGE --- ## + - name: Setup AzCopy + uses: ./.github/actions/setup-azcopy + + - name: Deploy to Azure Blob Storage + id: deploy + env: + PR_HASH: ${{ steps.pr_hash.outputs.hash }} + run: | + # Upload documentation + echo "Uploading 1st-gen documentation to ${PR_HASH}/docs/1st-gen-docs/" + azcopy copy "1st-gen/projects/documentation/dist/*" \ + "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/1st-gen-docs/" \ + --recursive \ + --from-to LocalBlob + + # Upload 1st-gen Storybook + echo "Uploading 1st-gen Storybook to ${PR_HASH}/docs/1st-gen-storybook/" + azcopy copy "1st-gen/storybook-static/*" \ + "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/1st-gen-storybook/" \ + --recursive \ + --from-to LocalBlob + + # Upload 2nd-gen Storybook + echo "Uploading 2nd-gen Storybook to ${PR_HASH}/docs/2nd-gen-storybook/" + azcopy copy "2nd-gen/packages/swc/storybook-static/*" \ + "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/2nd-gen-storybook/" \ + --recursive \ + --from-to LocalBlob + + # Set output URLs + 1st-gendocs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/1st-gen-docs/" + 1st-gen-storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/1st-gen-storybook/" + 2nd-gen-storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/2nd-gen-storybook/" + echo "1st-gen-docs_url=${1st-gen-docs_url}" >> "$GITHUB_OUTPUT" + echo "1st-gen-storybook_url=${1st-gen-storybook_url}" >> "$GITHUB_OUTPUT" + echo "2nd-gen-storybook_url=${2nd-gen-storybook_url}" >> "$GITHUB_OUTPUT" + echo "Deployed to: ${1st-gen-docs_url}" + echo "Deployed to: ${1st-gen-storybook_url}" + echo "Deployed to: ${2nd-gen-storybook_url}" + + close_pull_request_job: + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Clean up PR deployment + steps: + - name: Check out code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Generate PR hash + id: pr_hash + run: | + # Create the same hash as in the deploy job + pr_hash="pr-${{ github.event.pull_request.number }}" + echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" + + - name: Setup AzCopy + uses: ./.github/actions/setup-azcopy + + - name: Clean up PR deployment + env: + PR_HASH: ${{ steps.pr_hash.outputs.hash }} + run: | + echo "Cleaning up deployment: ${PR_HASH}/" + azcopy remove "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/" \ + --recursive || echo "Cleanup completed (some files may not exist)" + echo "Cleanup completed for PR deployment: ${PR_HASH}/" From 40b82bf3f3a01b1aa4927a00e1ad33e926c23dba Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Tue, 11 Nov 2025 11:30:17 -0700 Subject: [PATCH 02/21] chore: typo --- .github/scripts/build-preview-urls-comment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/build-preview-urls-comment.js b/.github/scripts/build-preview-urls-comment.js index e53f9e63392..5accb5e989b 100644 --- a/.github/scripts/build-preview-urls-comment.js +++ b/.github/scripts/build-preview-urls-comment.js @@ -92,7 +92,7 @@ export const buildPreviewURLComment = (prNumber) => { - [Storybook (1st-gen)](${storybook1stGenUrl}) - [Storybook (2nd-gen)](${storybook2ndGenUrl}) -

🔍 First GenerationVisual Regression Test Results

+

🔍 First Generation Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs: From 4ef14e0cd47ebab81ddd89f77199fb02ea9be7f6 Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Tue, 11 Nov 2025 12:08:55 -0700 Subject: [PATCH 03/21] chore: attempting to fix azure --- .github/workflows/preview-docs.yml | 14 +- .github/workflows/urls-smoke-test.yml | 194 +++++++++++++------------- 2 files changed, 101 insertions(+), 107 deletions(-) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 23fbc7f9e71..3654e2b43a8 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -63,14 +63,8 @@ jobs: shell: bash run: yarn install --immutable - - name: Build 1st-gen - run: yarn workspace @spectrum-web-components/1st-gen build - - - name: Build 2nd-gen core - run: yarn workspace @spectrum-web-components/core build - - - name: Build 2nd-gen swc - run: yarn workspace @adobe/swc build + - name: Build all generations + run: yarn build - name: Generate Custom Elements Manifest run: yarn workspace @spectrum-web-components/1st-gen docs:analyze @@ -80,7 +74,7 @@ jobs: - name: Build documentation with path prefix env: - SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs + SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs/1st-gen-docs run: | yarn workspace @spectrum-web-components/1st-gen docs:build @@ -121,7 +115,7 @@ jobs: --from-to LocalBlob # Set output URLs - 1st-gendocs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/1st-gen-docs/" + 1st-gen-docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/1st-gen-docs/" 1st-gen-storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/1st-gen-storybook/" 2nd-gen-storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/2nd-gen-storybook/" echo "1st-gen-docs_url=${1st-gen-docs_url}" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/urls-smoke-test.yml b/.github/workflows/urls-smoke-test.yml index 6f6ab56bedf..34f945e6ec7 100644 --- a/.github/workflows/urls-smoke-test.yml +++ b/.github/workflows/urls-smoke-test.yml @@ -1,104 +1,104 @@ name: Review URLs and Smoke Tests on: - pull_request: - types: [opened, synchronize, reopened, closed] - branches: - - "**" + pull_request: + types: [opened, synchronize, reopened, closed] + branches: + - '**' permissions: - contents: read - pull-requests: write + contents: read + pull-requests: write jobs: - wait-for-deployment: - name: Wait for deployment to complete - runs-on: ubuntu-latest - outputs: - doc_url: ${{ steps.extract_doc_url.outputs.DOC_URL }} - swc_dir: ${{ steps.pr_hash.outputs.hash }} - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 - - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job - - - name: Generate PR hash - id: pr_hash - run: | - pr_hash="pr-${{ github.event.pull_request.number }}" - echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" - echo "Generated PR hash: ${pr_hash}" - - - name: Extract doc preview url - run: echo "DOC_URL=https://swcpreviews.z13.web.core.windows.net/${{ steps.pr_hash.outputs.hash }}/docs/" >> "$GITHUB_OUTPUT" - id: extract_doc_url - - - name: Post Previews Comment - uses: actions/github-script@v7 - with: - script: | - const { buildPreviewURLComment } = await import('${{ github.workspace }}/.github/scripts/build-preview-urls-comment.js'); - const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js'); - - const prNumber = context.payload.pull_request.number; - const body = buildPreviewURLComment(prNumber); - - console.log(`Posting comment to PR #${prNumber}`); - commentOrUpdate(github, context, '## 📚 Branch Preview', body); - - - name: Wait for deployment - run: | - echo "Waiting for deployment to be available at: ${{ steps.extract_doc_url.outputs.DOC_URL }}" - - # Wait up to 10 minutes for the deployment to be available - max_attempts=60 - attempt=1 - - while [ $attempt -le $max_attempts ]; do - echo "Attempt $attempt/$max_attempts: Checking if site is available..." - - if curl -f -s --max-time 10 "${{ steps.extract_doc_url.outputs.DOC_URL }}" > /dev/null; then - echo "✅ Site is now available!" - break - else - echo "❌ Site not ready yet, waiting 10 seconds..." - sleep 10 - attempt=$((attempt + 1)) - fi - done - - if [ $attempt -gt $max_attempts ]; then - echo "❌ Timeout: Site was not available after 10 minutes" - exit 1 - fi - - playwright-smoke-tests: - timeout-minutes: 60 - runs-on: ubuntu-latest - needs: wait-for-deployment - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 - - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job - - - name: Install Playwright Browsers - run: cd 1st-gen && yarn playwright install --with-deps - - - name: Run Playwright tests - run: cd 1st-gen && yarn playwright test projects/documentation/e2e/published.spec.ts - env: - DOC_PREVIEW_URL: ${{ needs.wait-for-deployment.outputs.doc_url }} - SWC_DIR: ${{ needs.wait-for-deployment.outputs.swc_dir }} - NODE_ENV: CI - - - name: Upload Playwright Report - uses: actions/upload-artifact@v4 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 + wait-for-deployment: + name: Wait for deployment to complete + runs-on: ubuntu-latest + outputs: + doc_url: ${{ steps.extract_doc_url.outputs.DOC_URL }} + swc_dir: ${{ steps.pr_hash.outputs.hash }} + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 + + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job + + - name: Generate PR hash + id: pr_hash + run: | + pr_hash="pr-${{ github.event.pull_request.number }}" + echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" + echo "Generated PR hash: ${pr_hash}" + + - name: Extract doc preview url + run: echo "DOC_URL=https://swcpreviews.z13.web.core.windows.net/${{ steps.pr_hash.outputs.hash }}/docs/1st-gen-docs/" >> "$GITHUB_OUTPUT" + id: extract_doc_url + + - name: Post Previews Comment + uses: actions/github-script@v7 + with: + script: | + const { buildPreviewURLComment } = await import('${{ github.workspace }}/.github/scripts/build-preview-urls-comment.js'); + const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js'); + + const prNumber = context.payload.pull_request.number; + const body = buildPreviewURLComment(prNumber); + + console.log(`Posting comment to PR #${prNumber}`); + commentOrUpdate(github, context, '## 📚 Branch Preview', body); + + - name: Wait for deployment + run: | + echo "Waiting for deployment to be available at: ${{ steps.extract_doc_url.outputs.DOC_URL }}" + + # Wait up to 10 minutes for the deployment to be available + max_attempts=60 + attempt=1 + + while [ $attempt -le $max_attempts ]; do + echo "Attempt $attempt/$max_attempts: Checking if site is available..." + + if curl -f -s --max-time 10 "${{ steps.extract_doc_url.outputs.DOC_URL }}" > /dev/null; then + echo "✅ Site is now available!" + break + else + echo "❌ Site not ready yet, waiting 10 seconds..." + sleep 10 + attempt=$((attempt + 1)) + fi + done + + if [ $attempt -gt $max_attempts ]; then + echo "❌ Timeout: Site was not available after 10 minutes" + exit 1 + fi + + playwright-smoke-tests: + timeout-minutes: 60 + runs-on: ubuntu-latest + needs: wait-for-deployment + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 + + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job + + - name: Install Playwright Browsers + run: cd 1st-gen && yarn playwright install --with-deps + + - name: Run Playwright tests + run: cd 1st-gen && yarn playwright test projects/documentation/e2e/published.spec.ts + env: + DOC_PREVIEW_URL: ${{ needs.wait-for-deployment.outputs.doc_url }} + SWC_DIR: ${{ needs.wait-for-deployment.outputs.swc_dir }} + NODE_ENV: CI + + - name: Upload Playwright Report + uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 From f9565b1cd87663941c2e7ad60f74b87d59da713c Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Tue, 11 Nov 2025 12:28:07 -0700 Subject: [PATCH 04/21] chore: attempting to fix azure --- .github/workflows/preview-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 3654e2b43a8..74d7490459f 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -102,7 +102,7 @@ jobs: # Upload 1st-gen Storybook echo "Uploading 1st-gen Storybook to ${PR_HASH}/docs/1st-gen-storybook/" - azcopy copy "1st-gen/storybook-static/*" \ + azcopy copy "1st-gen/projects/documentation/dist/storybook/*" \ "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/1st-gen-storybook/" \ --recursive \ --from-to LocalBlob From 3c84cf42be71fd74991da3f58a7f49b9636d2451 Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Tue, 11 Nov 2025 13:00:08 -0700 Subject: [PATCH 05/21] chore: github doesnt like numbers i guess --- .github/scripts/build-preview-urls-comment.js | 12 ++-- .github/workflows/preview-docs.yml | 58 +++++++++---------- .github/workflows/urls-smoke-test.yml | 2 +- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/scripts/build-preview-urls-comment.js b/.github/scripts/build-preview-urls-comment.js index 5accb5e989b..03a903e8d6a 100644 --- a/.github/scripts/build-preview-urls-comment.js +++ b/.github/scripts/build-preview-urls-comment.js @@ -82,15 +82,15 @@ export const buildPreviewURLComment = (prNumber) => { - [High Contrast Mode | Medium | LTR](${hcmUrl})`); // Documentation and Storybook URLs - const docs1stGenUrl = `${baseUrl}/${prHash}/docs/1st-gen-docs/`; - const storybook1stGenUrl = `${baseUrl}/${prHash}/docs/1st-gen-storybook/`; - const storybook2ndGenUrl = `${baseUrl}/${prHash}/docs/2nd-gen-storybook/`; + const docsFirstGenUrl = `${baseUrl}/${prHash}/docs/first-gen-docs/`; + const storybookFirstGenUrl = `${baseUrl}/${prHash}/docs/first-gen-storybook/`; + const storybookSecondGenUrl = `${baseUrl}/${prHash}/docs/second-gen-storybook/`; let comment = `## 📚 Branch Preview Links -- [Documentation Site (1st-gen)](${docs1stGenUrl}) -- [Storybook (1st-gen)](${storybook1stGenUrl}) -- [Storybook (2nd-gen)](${storybook2ndGenUrl}) +- [Documentation Site (first-gen)](${docsFirstGenUrl}) +- [Storybook (first-gen)](${storybookFirstGenUrl}) +- [Storybook (second-gen)](${storybookSecondGenUrl})

🔍 First Generation Visual Regression Test Results

diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 74d7490459f..22a5840a78b 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest name: Build and Deploy Job outputs: - doc_url: ${{ steps.deploy.outputs.docs_url }} + doc_url: ${{ steps.deploy.outputs.first-gen-docs_url }} steps: ## --- SETUP --- ## - name: Check out code @@ -67,22 +67,22 @@ jobs: run: yarn build - name: Generate Custom Elements Manifest - run: yarn workspace @spectrum-web-components/1st-gen docs:analyze + run: yarn workspace @spectrum-web-components/first-gen docs:analyze - name: Move CEM to Storybook directory - run: cp 1st-gen/projects/documentation/custom-elements.json 1st-gen/storybook/ + run: cp first-gen/projects/documentation/custom-elements.json first-gen/storybook/ - name: Build documentation with path prefix env: - SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs/1st-gen-docs + SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs run: | - yarn workspace @spectrum-web-components/1st-gen docs:build + yarn workspace @spectrum-web-components/first-gen docs:build - - name: Build 1st-gen Storybook - run: yarn workspace @spectrum-web-components/1st-gen storybook:build + - name: Build first-gen Storybook + run: yarn workspace @spectrum-web-components/first-gen storybook:build - - name: Build 2nd-gen Storybook - run: yarn workspace @spectrum-web-components/2nd-gen storybook:build + - name: Build second-gen Storybook + run: yarn workspace @spectrum-web-components/second-gen storybook:build ## --- DEPLOY TO AZURE BLOB STORAGE --- ## - name: Setup AzCopy @@ -94,36 +94,36 @@ jobs: PR_HASH: ${{ steps.pr_hash.outputs.hash }} run: | # Upload documentation - echo "Uploading 1st-gen documentation to ${PR_HASH}/docs/1st-gen-docs/" - azcopy copy "1st-gen/projects/documentation/dist/*" \ - "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/1st-gen-docs/" \ + echo "Uploading first-gen documentation to ${PR_HASH}/docs/first-gen-docs/" + azcopy copy "first-gen/projects/documentation/dist/*" \ + "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-docs/" \ --recursive \ --from-to LocalBlob - # Upload 1st-gen Storybook - echo "Uploading 1st-gen Storybook to ${PR_HASH}/docs/1st-gen-storybook/" - azcopy copy "1st-gen/projects/documentation/dist/storybook/*" \ - "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/1st-gen-storybook/" \ + # Upload first-gen Storybook + echo "Uploading first-gen Storybook to ${PR_HASH}/docs/first-gen-storybook/" + azcopy copy "first-gen/projects/documentation/dist/storybook/*" \ + "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-storybook/" \ --recursive \ --from-to LocalBlob - # Upload 2nd-gen Storybook - echo "Uploading 2nd-gen Storybook to ${PR_HASH}/docs/2nd-gen-storybook/" - azcopy copy "2nd-gen/packages/swc/storybook-static/*" \ - "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/2nd-gen-storybook/" \ + # Upload second-gen Storybook + echo "Uploading second-gen Storybook to ${PR_HASH}/docs/second-gen-storybook/" + azcopy copy "second-gen/packages/swc/storybook-static/*" \ + "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/second-gen-storybook/" \ --recursive \ --from-to LocalBlob # Set output URLs - 1st-gen-docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/1st-gen-docs/" - 1st-gen-storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/1st-gen-storybook/" - 2nd-gen-storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/2nd-gen-storybook/" - echo "1st-gen-docs_url=${1st-gen-docs_url}" >> "$GITHUB_OUTPUT" - echo "1st-gen-storybook_url=${1st-gen-storybook_url}" >> "$GITHUB_OUTPUT" - echo "2nd-gen-storybook_url=${2nd-gen-storybook_url}" >> "$GITHUB_OUTPUT" - echo "Deployed to: ${1st-gen-docs_url}" - echo "Deployed to: ${1st-gen-storybook_url}" - echo "Deployed to: ${2nd-gen-storybook_url}" + first-gen-docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-docs/" + first-gen-storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-storybook/" + second-gen-storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/second-gen-storybook/" + echo "first-gen-docs_url=${first-gen-docs_url}" >> "$GITHUB_OUTPUT" + echo "first-gen-storybook_url=${first-gen-storybook_url}" >> "$GITHUB_OUTPUT" + echo "second-gen-storybook_url=${second-gen-storybook_url}" >> "$GITHUB_OUTPUT" + echo "Deployed to: ${first-gen-docs_url}" + echo "Deployed to: ${first-gen-storybook_url}" + echo "Deployed to: ${second-gen-storybook_url}" close_pull_request_job: if: github.event_name == 'pull_request' && github.event.action == 'closed' diff --git a/.github/workflows/urls-smoke-test.yml b/.github/workflows/urls-smoke-test.yml index 34f945e6ec7..5f7feaeb416 100644 --- a/.github/workflows/urls-smoke-test.yml +++ b/.github/workflows/urls-smoke-test.yml @@ -32,7 +32,7 @@ jobs: echo "Generated PR hash: ${pr_hash}" - name: Extract doc preview url - run: echo "DOC_URL=https://swcpreviews.z13.web.core.windows.net/${{ steps.pr_hash.outputs.hash }}/docs/1st-gen-docs/" >> "$GITHUB_OUTPUT" + run: echo "DOC_URL=https://swcpreviews.z13.web.core.windows.net/${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs/" >> "$GITHUB_OUTPUT" id: extract_doc_url - name: Post Previews Comment From d53f318277bef59aa5c2a6b2b13947205ae7c024 Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Tue, 11 Nov 2025 13:08:50 -0700 Subject: [PATCH 06/21] chore: too fast too furious --- .github/workflows/preview-docs.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 22a5840a78b..b0163efbc03 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -67,22 +67,22 @@ jobs: run: yarn build - name: Generate Custom Elements Manifest - run: yarn workspace @spectrum-web-components/first-gen docs:analyze + run: yarn workspace @spectrum-web-components/1st-gen docs:analyze - name: Move CEM to Storybook directory - run: cp first-gen/projects/documentation/custom-elements.json first-gen/storybook/ + run: cp 1st-gen/projects/documentation/custom-elements.json 1st-gen/storybook/ - name: Build documentation with path prefix env: SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs run: | - yarn workspace @spectrum-web-components/first-gen docs:build + yarn workspace @spectrum-web-components/1st-gen docs:build - name: Build first-gen Storybook run: yarn workspace @spectrum-web-components/first-gen storybook:build - name: Build second-gen Storybook - run: yarn workspace @spectrum-web-components/second-gen storybook:build + run: yarn workspace @spectrum-web-components/2nd-gen storybook:build ## --- DEPLOY TO AZURE BLOB STORAGE --- ## - name: Setup AzCopy @@ -95,21 +95,21 @@ jobs: run: | # Upload documentation echo "Uploading first-gen documentation to ${PR_HASH}/docs/first-gen-docs/" - azcopy copy "first-gen/projects/documentation/dist/*" \ + azcopy copy "1st-gen/projects/documentation/dist/*" \ "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-docs/" \ --recursive \ --from-to LocalBlob # Upload first-gen Storybook echo "Uploading first-gen Storybook to ${PR_HASH}/docs/first-gen-storybook/" - azcopy copy "first-gen/projects/documentation/dist/storybook/*" \ + azcopy copy "1st-gen/projects/documentation/dist/storybook/*" \ "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-storybook/" \ --recursive \ --from-to LocalBlob # Upload second-gen Storybook echo "Uploading second-gen Storybook to ${PR_HASH}/docs/second-gen-storybook/" - azcopy copy "second-gen/packages/swc/storybook-static/*" \ + azcopy copy "2nd-gen/packages/swc/storybook-static/*" \ "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/second-gen-storybook/" \ --recursive \ --from-to LocalBlob From c12b0993e8dd72f5f1dfceea2a90bd299713e35d Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Tue, 11 Nov 2025 14:06:55 -0700 Subject: [PATCH 07/21] chore: fix docs path resolving --- .github/workflows/preview-docs.yml | 2 +- 1st-gen/projects/documentation/rollup.config.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index b0163efbc03..0d74e0d7e05 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -79,7 +79,7 @@ jobs: yarn workspace @spectrum-web-components/1st-gen docs:build - name: Build first-gen Storybook - run: yarn workspace @spectrum-web-components/first-gen storybook:build + run: yarn workspace @spectrum-web-components/1st-gen storybook:build - name: Build second-gen Storybook run: yarn workspace @spectrum-web-components/2nd-gen storybook:build diff --git a/1st-gen/projects/documentation/rollup.config.js b/1st-gen/projects/documentation/rollup.config.js index a44b2e6bfae..641037e0a24 100644 --- a/1st-gen/projects/documentation/rollup.config.js +++ b/1st-gen/projects/documentation/rollup.config.js @@ -9,17 +9,17 @@ * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -import { copy } from '@web/rollup-plugin-copy'; import { createBasicConfig } from '@open-wc/building-rollup'; -import { injectManifest } from 'rollup-plugin-workbox'; -import { minify } from 'html-minifier-terser'; -import { nodeResolve } from '@rollup/plugin-node-resolve'; -import { rollupPluginHTML as html } from '@web/rollup-plugin-html'; import alias from '@rollup/plugin-alias'; import commonjs from '@rollup/plugin-commonjs'; import json from '@rollup/plugin-json'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; import replace from '@rollup/plugin-replace'; +import { copy } from '@web/rollup-plugin-copy'; +import { rollupPluginHTML as html } from '@web/rollup-plugin-html'; +import { minify } from 'html-minifier-terser'; import path from 'path'; +import { injectManifest } from 'rollup-plugin-workbox'; import Terser from 'terser'; const stringReplaceHtml = (source) => { @@ -237,7 +237,7 @@ export default async () => { entries: [ { find: '@swc-packages-internal', - replacement: '../../packages/', + replacement: path.resolve('../../packages'), }, { find: /^@spectrum-web-components\/core\/(.*)$/, From b825090ef5149266bdffe1b36e8d029655936dc4 Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Tue, 11 Nov 2025 15:28:07 -0700 Subject: [PATCH 08/21] chore: try again --- .github/workflows/preview-docs.yml | 10 +++++----- .github/workflows/urls-smoke-test.yml | 2 +- 1st-gen/projects/documentation/e2e/published.spec.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 0d74e0d7e05..6510bdc4fd4 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -74,7 +74,7 @@ jobs: - name: Build documentation with path prefix env: - SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs + SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs run: | yarn workspace @spectrum-web-components/1st-gen docs:build @@ -102,7 +102,7 @@ jobs: # Upload first-gen Storybook echo "Uploading first-gen Storybook to ${PR_HASH}/docs/first-gen-storybook/" - azcopy copy "1st-gen/projects/documentation/dist/storybook/*" \ + azcopy copy "1st-gen/storybook-static/*" \ "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-storybook/" \ --recursive \ --from-to LocalBlob @@ -115,9 +115,9 @@ jobs: --from-to LocalBlob # Set output URLs - first-gen-docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-docs/" - first-gen-storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-storybook/" - second-gen-storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/second-gen-storybook/" + first-gen-docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-docs" + first-gen-storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-storybook" + second-gen-storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/second-gen-storybook" echo "first-gen-docs_url=${first-gen-docs_url}" >> "$GITHUB_OUTPUT" echo "first-gen-storybook_url=${first-gen-storybook_url}" >> "$GITHUB_OUTPUT" echo "second-gen-storybook_url=${second-gen-storybook_url}" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/urls-smoke-test.yml b/.github/workflows/urls-smoke-test.yml index 5f7feaeb416..568dd1348e8 100644 --- a/.github/workflows/urls-smoke-test.yml +++ b/.github/workflows/urls-smoke-test.yml @@ -32,7 +32,7 @@ jobs: echo "Generated PR hash: ${pr_hash}" - name: Extract doc preview url - run: echo "DOC_URL=https://swcpreviews.z13.web.core.windows.net/${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs/" >> "$GITHUB_OUTPUT" + run: echo "DOC_URL=https://swcpreviews.z13.web.core.windows.net/${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs" >> "$GITHUB_OUTPUT" id: extract_doc_url - name: Post Previews Comment diff --git a/1st-gen/projects/documentation/e2e/published.spec.ts b/1st-gen/projects/documentation/e2e/published.spec.ts index c4f6a9d3a91..4b56c2767eb 100644 --- a/1st-gen/projects/documentation/e2e/published.spec.ts +++ b/1st-gen/projects/documentation/e2e/published.spec.ts @@ -33,7 +33,7 @@ test.describe('search and go', () => { : `/${formattedSearchString}`; // add the SWC_DIR to the href - href = `${process.env.SWC_DIR ? `/${process.env.SWC_DIR}/docs` : ''}${href}`; + href = `${process.env.SWC_DIR ? `/${process.env.SWC_DIR}/docs/first-gen-docs` : ''}${href}`; const menuItem = page.locator(menuItemSelector(href)); From 4f47e5cdff7bbf28b60ceb276697060209a07916 Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Tue, 11 Nov 2025 15:41:53 -0700 Subject: [PATCH 09/21] chore: try again --- .github/workflows/preview-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 6510bdc4fd4..eb39aae7b06 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -102,7 +102,7 @@ jobs: # Upload first-gen Storybook echo "Uploading first-gen Storybook to ${PR_HASH}/docs/first-gen-storybook/" - azcopy copy "1st-gen/storybook-static/*" \ + azcopy copy "1st-gen/projects/documentation/dist/storybook/*" \ "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-storybook/" \ --recursive \ --from-to LocalBlob From cbc48a5f4a98d9ac8d855d5d64558bdfc749bd88 Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Tue, 11 Nov 2025 16:07:18 -0700 Subject: [PATCH 10/21] chore: damn hyphens --- .github/workflows/preview-docs.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index eb39aae7b06..100463c6272 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -74,7 +74,7 @@ jobs: - name: Build documentation with path prefix env: - SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs + SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs run: | yarn workspace @spectrum-web-components/1st-gen docs:build @@ -115,15 +115,21 @@ jobs: --from-to LocalBlob # Set output URLs - first-gen-docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-docs" - first-gen-storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-storybook" - second-gen-storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/second-gen-storybook" - echo "first-gen-docs_url=${first-gen-docs_url}" >> "$GITHUB_OUTPUT" - echo "first-gen-storybook_url=${first-gen-storybook_url}" >> "$GITHUB_OUTPUT" - echo "second-gen-storybook_url=${second-gen-storybook_url}" >> "$GITHUB_OUTPUT" - echo "Deployed to: ${first-gen-docs_url}" - echo "Deployed to: ${first-gen-storybook_url}" - echo "Deployed to: ${second-gen-storybook_url}" + echo "Setting first_gen_docs_url..." + first_gen_docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-docs" + echo "first_gen_docs_url=${first_gen_docs_url}" >> "$GITHUB_OUTPUT" + + echo "Setting first_gen_storybook_url..." + first_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-storybook" + echo "first_gen_storybook_url=${first_gen_storybook_url}" >> "$GITHUB_OUTPUT" + + echo "Setting second_gen_storybook_url..." + second_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/second-gen-storybook" + echo "second_gen_storybook_url=${second_gen_storybook_url}" >> "$GITHUB_OUTPUT" + + echo "Deployed to: ${first_gen_docs_url}" + echo "Deployed to: ${first_gen_storybook_url}" + echo "Deployed to: ${second_gen_storybook_url}" close_pull_request_job: if: github.event_name == 'pull_request' && github.event.action == 'closed' From c5bcc4618d94aa82d9c8feabe223d51d2de22ae3 Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Tue, 11 Nov 2025 16:22:04 -0700 Subject: [PATCH 11/21] chore: corrected commentorupdate --- .github/workflows/urls-smoke-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/urls-smoke-test.yml b/.github/workflows/urls-smoke-test.yml index 568dd1348e8..396b92c3ed7 100644 --- a/.github/workflows/urls-smoke-test.yml +++ b/.github/workflows/urls-smoke-test.yml @@ -46,7 +46,7 @@ jobs: const body = buildPreviewURLComment(prNumber); console.log(`Posting comment to PR #${prNumber}`); - commentOrUpdate(github, context, '## 📚 Branch Preview', body); + commentOrUpdate(github, context, '## 📚 Branch Preview Links', body); - name: Wait for deployment run: | From 252c1ff0efd97a76b3e698268e7d65b27e2417d2 Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Tue, 11 Nov 2025 16:56:22 -0700 Subject: [PATCH 12/21] chore: fix smoke test --- .github/workflows/urls-smoke-test.yml | 2 +- 1st-gen/projects/documentation/e2e/published.spec.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/urls-smoke-test.yml b/.github/workflows/urls-smoke-test.yml index 396b92c3ed7..214b5843b26 100644 --- a/.github/workflows/urls-smoke-test.yml +++ b/.github/workflows/urls-smoke-test.yml @@ -32,7 +32,7 @@ jobs: echo "Generated PR hash: ${pr_hash}" - name: Extract doc preview url - run: echo "DOC_URL=https://swcpreviews.z13.web.core.windows.net/${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs" >> "$GITHUB_OUTPUT" + run: echo "DOC_URL=https://swcpreviews.z13.web.core.windows.net/${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs/" >> "$GITHUB_OUTPUT" id: extract_doc_url - name: Post Previews Comment diff --git a/1st-gen/projects/documentation/e2e/published.spec.ts b/1st-gen/projects/documentation/e2e/published.spec.ts index 4b56c2767eb..edab869f643 100644 --- a/1st-gen/projects/documentation/e2e/published.spec.ts +++ b/1st-gen/projects/documentation/e2e/published.spec.ts @@ -33,7 +33,7 @@ test.describe('search and go', () => { : `/${formattedSearchString}`; // add the SWC_DIR to the href - href = `${process.env.SWC_DIR ? `/${process.env.SWC_DIR}/docs/first-gen-docs` : ''}${href}`; + href = `${process.env.SWC_DIR ? `/${process.env.SWC_DIR}/docs/first-gen-docs/` : ''}${href}`; const menuItem = page.locator(menuItemSelector(href)); @@ -54,6 +54,7 @@ test.describe('search and go', () => { test.beforeEach(async ({ page }) => { await page.goto(startURL as string); + expect(page, `to have URL ${startURL}`).toHaveURL(/first-gen-docs/); await page.waitForLoadState('networkidle', { timeout: 30000 }); // Wait for any dynamic content to load From fbe6b785909d733fd251c79347c68711862882dc Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Wed, 12 Nov 2025 09:55:29 -0700 Subject: [PATCH 13/21] chore: smoke test fix --- .github/workflows/urls-smoke-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/urls-smoke-test.yml b/.github/workflows/urls-smoke-test.yml index 214b5843b26..396b92c3ed7 100644 --- a/.github/workflows/urls-smoke-test.yml +++ b/.github/workflows/urls-smoke-test.yml @@ -32,7 +32,7 @@ jobs: echo "Generated PR hash: ${pr_hash}" - name: Extract doc preview url - run: echo "DOC_URL=https://swcpreviews.z13.web.core.windows.net/${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs/" >> "$GITHUB_OUTPUT" + run: echo "DOC_URL=https://swcpreviews.z13.web.core.windows.net/${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs" >> "$GITHUB_OUTPUT" id: extract_doc_url - name: Post Previews Comment From 6c0c5b7aa74d097d16416c3369ed1f57fcbf8564 Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Wed, 12 Nov 2025 11:57:09 -0700 Subject: [PATCH 14/21] chore: smoke test fix --- 1st-gen/projects/documentation/e2e/published.spec.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/1st-gen/projects/documentation/e2e/published.spec.ts b/1st-gen/projects/documentation/e2e/published.spec.ts index edab869f643..ab0de195a9e 100644 --- a/1st-gen/projects/documentation/e2e/published.spec.ts +++ b/1st-gen/projects/documentation/e2e/published.spec.ts @@ -33,7 +33,7 @@ test.describe('search and go', () => { : `/${formattedSearchString}`; // add the SWC_DIR to the href - href = `${process.env.SWC_DIR ? `/${process.env.SWC_DIR}/docs/first-gen-docs/` : ''}${href}`; + href = `${process.env.SWC_DIR ? `/${process.env.SWC_DIR}/docs/first-gen-docs` : ''}${href}`; const menuItem = page.locator(menuItemSelector(href)); @@ -64,8 +64,14 @@ test.describe('search and go', () => { const searchField = await page.getByRole('searchbox', { name: 'Search', }); - + await searchField.waitFor(); + await expect(searchField, 'Search field should be visible').toBeVisible( + { timeout: 10000 } + ); await searchField.focus(); + await expect(searchField, 'Search field should be focused').toBeFocused( + { timeout: 10000 } + ); await page.waitForTimeout(500); // Ensure focus is set }); From 4aff75d96f6a1139b30606f41696849fb5b82bcf Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Thu, 13 Nov 2025 10:25:06 -0700 Subject: [PATCH 15/21] chore: yaml linting --- .vscode/extensions.json | 2 +- .vscode/settings.json | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 9b01c8e2744..4fbe199f14e 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,3 @@ { - "recommendations": ["runem.lit-plugin"] + "recommendations": ["runem.lit-plugin", "redhat.vscode-yaml"] } diff --git a/.vscode/settings.json b/.vscode/settings.json index e3ed778119b..093ccc96a92 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -31,5 +31,8 @@ }, "typescript.tsdk": "node_modules/typescript/lib", "lit-plugin.strict": true, - "cSpell.words": ["activedescendant", "coachmark", "valuetext"] + "cSpell.words": ["activedescendant", "coachmark", "valuetext"], + "[yaml]": { + "editor.defaultFormatter": "redhat.vscode-yaml" + } } From ff53aab873a02aa6570f23a1032d77c2fbaf3086 Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Fri, 14 Nov 2025 10:08:31 -0700 Subject: [PATCH 16/21] chore: correct yml linting, move smoke tests to preview docs --- .editorconfig | 5 +- .github/workflows/browser-tests.yml | 182 +++++------ .github/workflows/chromatic-vrt.yml | 100 +++--- .github/workflows/lint.yml | 218 ++++++------- .github/workflows/pr-update.yml | 42 +-- .github/workflows/preview-docs.yml | 390 +++++++++++++++--------- .github/workflows/preview-release.yml | 80 ++--- .github/workflows/publish-docs-site.yml | 74 ++--- .github/workflows/urls-smoke-test.yml | 104 ------- .prettierrc.yaml | 4 + .vscode/settings.json | 12 +- 11 files changed, 605 insertions(+), 606 deletions(-) delete mode 100644 .github/workflows/urls-smoke-test.yml diff --git a/.editorconfig b/.editorconfig index dc0858c028e..913e0353093 100755 --- a/.editorconfig +++ b/.editorconfig @@ -4,4 +4,7 @@ root = true end_of_line = lf indent_style = space indent_size = 4 -charset = utf-8 \ No newline at end of file +charset = utf-8 + +[*.{yml,yaml}] +indent_size = 2 \ No newline at end of file diff --git a/.github/workflows/browser-tests.yml b/.github/workflows/browser-tests.yml index a109a4b8122..2f0eef3cabe 100644 --- a/.github/workflows/browser-tests.yml +++ b/.github/workflows/browser-tests.yml @@ -1,98 +1,98 @@ name: Browser Performance Tests on: - workflow_dispatch: # Only run manually, not on pull requests + workflow_dispatch: # Only run manually, not on pull requests permissions: - contents: read - pull-requests: write + contents: read + pull-requests: write jobs: - test-changed-packages: - strategy: - matrix: - browser: [firefox, chrome] - name: Compare performance to latest release on ${{ matrix.browser }} - - # The job will only run if the pull request is from the same repository. - # Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token. - if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} - runs-on: ubuntu-22.04 - steps: - - name: Checkout main - uses: actions/checkout@v4 - with: - ref: main - - - name: Checkout PR branch - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Get full history - - - name: Fetch main branch - run: | - git fetch origin main:main - - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job - - - name: Check ChromeDriver Version - if: matrix.browser == 'chrome' - run: | - echo "Checking ChromeDriver version..." - npx chromedriver --version - echo "Checking Chrome version..." - google-chrome --version - echo "Checking tachometer chromedriver version..." - cd 1st-gen && yarn tachometer --version - - - name: Tachometer the changed packages - run: cd 1st-gen && yarn test:changed --browser=${{ matrix.browser }} - - - name: Create a dummy file to ensure at least one results file exists - run: touch 1st-gen/tachometer.${{ matrix.browser }}-ran.txt - - - name: Archive ${{ matrix.browser }} tachometer results - id: upload-artifact - uses: actions/upload-artifact@v4 - with: - name: tachometer-results-${{ matrix.browser }} - path: | - 1st-gen/tach-results.${{ matrix.browser }}.*.json - 1st-gen/tachometer.${{ matrix.browser }}-ran.txt - - comment-performance: - name: Comment tachometer performance results - needs: [test-changed-packages] - - # The job will only run if the pull request is from the same repository. - # Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token. - if: ${{ github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository }} - runs-on: ubuntu-latest - steps: - - name: Checkout main - uses: actions/checkout@v4 - with: - ref: main - - - name: Checkout PR branch - uses: actions/checkout@v4 - with: - fetch-depth: 2 - - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job - - - uses: actions/download-artifact@v4 - with: - pattern: tachometer-results-* - merge-multiple: true - - - name: Post Tachometer Performance Comment - uses: actions/github-script@v7 - with: - script: | - const { buildTachometerComment } = await import('${{ github.workspace }}/.github/scripts/build-tachometer-comment.js'); - const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js'); - const body = buildTachometerComment(); - commentOrUpdate(github, context, '## Tachometer results', body); + test-changed-packages: + strategy: + matrix: + browser: [firefox, chrome] + name: Compare performance to latest release on ${{ matrix.browser }} + + # The job will only run if the pull request is from the same repository. + # Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token. + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + runs-on: ubuntu-22.04 + steps: + - name: Checkout main + uses: actions/checkout@v4 + with: + ref: main + + - name: Checkout PR branch + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Get full history + + - name: Fetch main branch + run: | + git fetch origin main:main + + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job + + - name: Check ChromeDriver Version + if: matrix.browser == 'chrome' + run: | + echo "Checking ChromeDriver version..." + npx chromedriver --version + echo "Checking Chrome version..." + google-chrome --version + echo "Checking tachometer chromedriver version..." + cd 1st-gen && yarn tachometer --version + + - name: Tachometer the changed packages + run: cd 1st-gen && yarn test:changed --browser=${{ matrix.browser }} + + - name: Create a dummy file to ensure at least one results file exists + run: touch 1st-gen/tachometer.${{ matrix.browser }}-ran.txt + + - name: Archive ${{ matrix.browser }} tachometer results + id: upload-artifact + uses: actions/upload-artifact@v4 + with: + name: tachometer-results-${{ matrix.browser }} + path: | + 1st-gen/tach-results.${{ matrix.browser }}.*.json + 1st-gen/tachometer.${{ matrix.browser }}-ran.txt + + comment-performance: + name: Comment tachometer performance results + needs: [test-changed-packages] + + # The job will only run if the pull request is from the same repository. + # Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token. + if: ${{ github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository }} + runs-on: ubuntu-latest + steps: + - name: Checkout main + uses: actions/checkout@v4 + with: + ref: main + + - name: Checkout PR branch + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job + + - uses: actions/download-artifact@v4 + with: + pattern: tachometer-results-* + merge-multiple: true + + - name: Post Tachometer Performance Comment + uses: actions/github-script@v7 + with: + script: | + const { buildTachometerComment } = await import('${{ github.workspace }}/.github/scripts/build-tachometer-comment.js'); + const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js'); + const body = buildTachometerComment(); + commentOrUpdate(github, context, '## Tachometer results', body); diff --git a/.github/workflows/chromatic-vrt.yml b/.github/workflows/chromatic-vrt.yml index a88d2cfb6d9..259a5e97c6d 100644 --- a/.github/workflows/chromatic-vrt.yml +++ b/.github/workflows/chromatic-vrt.yml @@ -1,57 +1,57 @@ name: Visual regression testing with Chromatic on: - workflow_dispatch: - workflow_call: - inputs: - skip: - description: 'Skip running VRT' - required: false - type: boolean - default: false - outputs: - storybook-url: - description: 'URL of the published Storybook' - value: ${{ jobs.vrt.outputs.storybook-url }} + workflow_dispatch: + workflow_call: + inputs: + skip: + description: 'Skip running VRT' + required: false + type: boolean + default: false + outputs: + storybook-url: + description: 'URL of the published Storybook' + value: ${{ jobs.vrt.outputs.storybook-url }} permissions: - contents: read - pull-requests: write + contents: read + pull-requests: write jobs: - vrt: - name: Chromatic - runs-on: ubuntu-latest - timeout-minutes: 20 - outputs: - storybook-url: ${{ steps.chromatic.outputs.storybookUrl != 'undefined' && steps.chromatic.outputs.storybookUrl || '' }} - - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job - - - name: Generate Custom Elements Manifest - run: yarn docs:analyze - - - name: Move CEM to Storybook directory - run: cp projects/documentation/custom-elements.json storybook/ - - - name: Publish to Chromatic - id: chromatic - uses: chromaui/action@v11 - with: - projectToken: ${{ secrets.CHROMATIC_TOKEN }} - buildScriptName: storybook:build - storybookConfigDir: storybook - exitOnceUploaded: true - onlyChanged: true - traceChanged: true - untraced: '.github/actions/*/package.json' - diagnostics: true - # Lets VRT pass without running so as not to waste snapshots - skip: ${{ inputs.skip }} + vrt: + name: Chromatic + runs-on: ubuntu-latest + timeout-minutes: 20 + outputs: + storybook-url: ${{ steps.chromatic.outputs.storybookUrl != 'undefined' && steps.chromatic.outputs.storybookUrl || '' }} + + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job + + - name: Generate Custom Elements Manifest + run: yarn docs:analyze + + - name: Move CEM to Storybook directory + run: cp projects/documentation/custom-elements.json storybook/ + + - name: Publish to Chromatic + id: chromatic + uses: chromaui/action@v11 + with: + projectToken: ${{ secrets.CHROMATIC_TOKEN }} + buildScriptName: storybook:build + storybookConfigDir: storybook + exitOnceUploaded: true + onlyChanged: true + traceChanged: true + untraced: '.github/actions/*/package.json' + diagnostics: true + # Lets VRT pass without running so as not to waste snapshots + skip: ${{ inputs.skip }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a2176b65a78..bf08936203c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,122 +4,122 @@ name: Lint # on: - push: - branches: - - main + push: + branches: + - main - pull_request: - branches: - - main + pull_request: + branches: + - main - types: - - opened - - synchronize - - reopened - - auto_merge_enabled + types: + - opened + - synchronize + - reopened + - auto_merge_enabled permissions: - contents: read - pull-requests: write + contents: read + pull-requests: write concurrency: - group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' - cancel-in-progress: true + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true defaults: - run: - shell: bash + run: + shell: bash jobs: - # ------------------------------------------------------------- - # Returns all changed pull request files. - # -------------------------------------------------------------- - changed_files: - runs-on: ubuntu-latest - name: Capture changed-files - outputs: - styles_added_files: ${{ steps.changed-files.outputs.styles_added_files }} - styles_modified_files: ${{ steps.changed-files.outputs.styles_modified_files }} - eslint_added_files: ${{ steps.changed-files.outputs.eslint_added_files }} - eslint_modified_files: ${{ steps.changed-files.outputs.eslint_modified_files }} - permissions: - pull-requests: read - - steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Get changed files - id: changed-files - uses: step-security/changed-files@v46 - with: - files_yaml: | - styles: - - '*.css' - - '**/*.css' - eslint: - - '*.{js,json,ts}' - - '**/*.{js,json,ts}' - - '!*.d.ts' - - '!**/*.d.ts' - - # --- Lint pre-compiled assets for consistency --- # - lint: - name: Lint - runs-on: ubuntu-latest - needs: [changed_files] - timeout-minutes: 5 - steps: - # install but don't build - we're linting pre-compiled assets - - name: Check out code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Use Node LTS version - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: yarn - - - name: Enable Corepack - run: corepack enable - - ## --- YARN CACHE --- ## - - name: Check for cached dependencies - continue-on-error: true - id: cache-dependencies - uses: actions/cache@v4 - with: - path: | - .cache/yarn - node_modules - key: ubuntu-latest-node20-${{ hashFiles('yarn.lock') }} - - ## --- INSTALL --- ## - # If statement isn't needed here b/c yarn will leverage the cache if it exists - - name: Install dependencies - shell: bash - run: yarn install --immutable - - - name: Lint styles - # if: ${{ needs.changed_files.outputs.styles_added_files != '' || needs.changed_files.outputs.styles_modified_files != '' }} - uses: reviewdog/action-stylelint@v1.30.2 - with: - fail_level: error - filter_mode: diff_context - level: error - reporter: github-pr-review - stylelint_input: '${{ needs.changed_files.outputs.styles_added_files }} ${{ needs.changed_files.outputs.styles_modified_files }} --allow-empty-input' - stylelint_config: '${{ github.workspace }}/.stylelintrc.json' - packages: 'stylelint-header stylelint-config-standard' - - - name: ESLint - uses: reviewdog/action-eslint@v1.33.2 - # if: ${{ needs.changed_files.outputs.eslint_added_files != '' || needs.changed_files.outputs.eslint_modified_files != '' }} - with: - fail_level: error - level: error - reporter: github-pr-review - filter_mode: diff_context - eslint_flags: '${{ needs.changed_files.outputs.eslint_added_files }} ${{ needs.changed_files.outputs.eslint_modified_files }}' + # ------------------------------------------------------------- + # Returns all changed pull request files. + # -------------------------------------------------------------- + changed_files: + runs-on: ubuntu-latest + name: Capture changed-files + outputs: + styles_added_files: ${{ steps.changed-files.outputs.styles_added_files }} + styles_modified_files: ${{ steps.changed-files.outputs.styles_modified_files }} + eslint_added_files: ${{ steps.changed-files.outputs.eslint_added_files }} + eslint_modified_files: ${{ steps.changed-files.outputs.eslint_modified_files }} + permissions: + pull-requests: read + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Get changed files + id: changed-files + uses: step-security/changed-files@v46 + with: + files_yaml: | + styles: + - '*.css' + - '**/*.css' + eslint: + - '*.{js,json,ts}' + - '**/*.{js,json,ts}' + - '!*.d.ts' + - '!**/*.d.ts' + + # --- Lint pre-compiled assets for consistency --- # + lint: + name: Lint + runs-on: ubuntu-latest + needs: [changed_files] + timeout-minutes: 5 + steps: + # install but don't build - we're linting pre-compiled assets + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Use Node LTS version + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn + + - name: Enable Corepack + run: corepack enable + + ## --- YARN CACHE --- ## + - name: Check for cached dependencies + continue-on-error: true + id: cache-dependencies + uses: actions/cache@v4 + with: + path: | + .cache/yarn + node_modules + key: ubuntu-latest-node20-${{ hashFiles('yarn.lock') }} + + ## --- INSTALL --- ## + # If statement isn't needed here b/c yarn will leverage the cache if it exists + - name: Install dependencies + shell: bash + run: yarn install --immutable + + - name: Lint styles + # if: ${{ needs.changed_files.outputs.styles_added_files != '' || needs.changed_files.outputs.styles_modified_files != '' }} + uses: reviewdog/action-stylelint@v1.30.2 + with: + fail_level: error + filter_mode: diff_context + level: error + reporter: github-pr-review + stylelint_input: '${{ needs.changed_files.outputs.styles_added_files }} ${{ needs.changed_files.outputs.styles_modified_files }} --allow-empty-input' + stylelint_config: '${{ github.workspace }}/.stylelintrc.json' + packages: 'stylelint-header stylelint-config-standard' + + - name: ESLint + uses: reviewdog/action-eslint@v1.33.2 + # if: ${{ needs.changed_files.outputs.eslint_added_files != '' || needs.changed_files.outputs.eslint_modified_files != '' }} + with: + fail_level: error + level: error + reporter: github-pr-review + filter_mode: diff_context + eslint_flags: '${{ needs.changed_files.outputs.eslint_added_files }} ${{ needs.changed_files.outputs.eslint_modified_files }}' diff --git a/.github/workflows/pr-update.yml b/.github/workflows/pr-update.yml index 349157ea0a7..4aa0d39a25a 100644 --- a/.github/workflows/pr-update.yml +++ b/.github/workflows/pr-update.yml @@ -1,28 +1,28 @@ name: Update PRs on: - pull_request: - types: [labeled, auto_merge_enabled] + pull_request: + types: [labeled, auto_merge_enabled] jobs: - autoupdate: - name: Auto-update PRs - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 + autoupdate: + name: Auto-update PRs + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job - # README: https://github.com/castastrophe/actions-pr-auto-update#auto-update-pull-requests - - uses: castastrophe/actions-pr-auto-update@v1.1.0 - with: - token: ${{ secrets.USER_TOKEN }} - include_drafts: false - limit: 50 - exclude_labels: blocked,wip - include_labels: auto-update,ready-for-merge + # README: https://github.com/castastrophe/actions-pr-auto-update#auto-update-pull-requests + - uses: castastrophe/actions-pr-auto-update@v1.1.0 + with: + token: ${{ secrets.USER_TOKEN }} + include_drafts: false + limit: 50 + exclude_labels: blocked,wip + include_labels: auto-update,ready-for-merge diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 100463c6272..858861f24bb 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -1,160 +1,248 @@ name: Preview Documentation (Azure Blob Storage) on: - pull_request: - types: [opened, synchronize, reopened, closed] - branches: - - '**' + pull_request: + types: [opened, synchronize, reopened, closed] + branches: + - '**' permissions: - contents: read - pull-requests: write + contents: read + pull-requests: write + +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.number }}' + cancel-in-progress: true env: - AZCOPY_AUTO_LOGIN_TYPE: SPN - AZCOPY_SPA_APPLICATION_ID: ${{ secrets.AZURE_CLIENT_ID }} - AZCOPY_SPA_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} - AZCOPY_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} + AZCOPY_AUTO_LOGIN_TYPE: SPN + AZCOPY_SPA_APPLICATION_ID: ${{ secrets.AZURE_CLIENT_ID }} + AZCOPY_SPA_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} + AZCOPY_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} jobs: - build_and_deploy_job: - if: github.event_name == 'pull_request' && github.event.action != 'closed' - runs-on: ubuntu-latest - name: Build and Deploy Job - outputs: - doc_url: ${{ steps.deploy.outputs.first-gen-docs_url }} - steps: - ## --- SETUP --- ## - - name: Check out code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Use Node LTS version - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: yarn - - - name: Enable Corepack - run: corepack enable - - - name: Generate PR hash - id: pr_hash - run: | - # Use just PR number so each commit overwrites the previous deployment - pr_hash="pr-${{ github.event.pull_request.number }}" - echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" - echo "Generated PR hash: ${pr_hash}" - - ## --- YARN CACHE --- ## - - name: Check for cached dependencies - continue-on-error: true - id: cache-dependencies - uses: actions/cache@v4 - with: - path: | - .cache/yarn - node_modules - key: ubuntu-latest-node20-${{ hashFiles('yarn.lock', 'package.json') }} - - ## --- INSTALL & BUILD --- ## - - name: Install dependencies - shell: bash - run: yarn install --immutable - - - name: Build all generations - run: yarn build - - - name: Generate Custom Elements Manifest - run: yarn workspace @spectrum-web-components/1st-gen docs:analyze - - - name: Move CEM to Storybook directory - run: cp 1st-gen/projects/documentation/custom-elements.json 1st-gen/storybook/ - - - name: Build documentation with path prefix - env: - SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs - run: | - yarn workspace @spectrum-web-components/1st-gen docs:build - - - name: Build first-gen Storybook - run: yarn workspace @spectrum-web-components/1st-gen storybook:build - - - name: Build second-gen Storybook - run: yarn workspace @spectrum-web-components/2nd-gen storybook:build - - ## --- DEPLOY TO AZURE BLOB STORAGE --- ## - - name: Setup AzCopy - uses: ./.github/actions/setup-azcopy - - - name: Deploy to Azure Blob Storage - id: deploy - env: - PR_HASH: ${{ steps.pr_hash.outputs.hash }} - run: | - # Upload documentation - echo "Uploading first-gen documentation to ${PR_HASH}/docs/first-gen-docs/" - azcopy copy "1st-gen/projects/documentation/dist/*" \ - "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-docs/" \ - --recursive \ - --from-to LocalBlob - - # Upload first-gen Storybook - echo "Uploading first-gen Storybook to ${PR_HASH}/docs/first-gen-storybook/" - azcopy copy "1st-gen/projects/documentation/dist/storybook/*" \ - "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-storybook/" \ - --recursive \ - --from-to LocalBlob - - # Upload second-gen Storybook - echo "Uploading second-gen Storybook to ${PR_HASH}/docs/second-gen-storybook/" - azcopy copy "2nd-gen/packages/swc/storybook-static/*" \ - "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/second-gen-storybook/" \ - --recursive \ - --from-to LocalBlob - - # Set output URLs - echo "Setting first_gen_docs_url..." - first_gen_docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-docs" - echo "first_gen_docs_url=${first_gen_docs_url}" >> "$GITHUB_OUTPUT" - - echo "Setting first_gen_storybook_url..." - first_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-storybook" - echo "first_gen_storybook_url=${first_gen_storybook_url}" >> "$GITHUB_OUTPUT" - - echo "Setting second_gen_storybook_url..." - second_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/second-gen-storybook" - echo "second_gen_storybook_url=${second_gen_storybook_url}" >> "$GITHUB_OUTPUT" - - echo "Deployed to: ${first_gen_docs_url}" - echo "Deployed to: ${first_gen_storybook_url}" - echo "Deployed to: ${second_gen_storybook_url}" - - close_pull_request_job: - if: github.event_name == 'pull_request' && github.event.action == 'closed' - runs-on: ubuntu-latest - name: Clean up PR deployment - steps: - - name: Check out code - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - name: Generate PR hash - id: pr_hash - run: | - # Create the same hash as in the deploy job - pr_hash="pr-${{ github.event.pull_request.number }}" - echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" - - - name: Setup AzCopy - uses: ./.github/actions/setup-azcopy - - - name: Clean up PR deployment - env: - PR_HASH: ${{ steps.pr_hash.outputs.hash }} - run: | - echo "Cleaning up deployment: ${PR_HASH}/" - azcopy remove "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/" \ - --recursive || echo "Cleanup completed (some files may not exist)" - echo "Cleanup completed for PR deployment: ${PR_HASH}/" + build_and_deploy_job: + if: github.event_name == 'pull_request' && github.event.action != 'closed' + runs-on: ubuntu-latest + name: Build and Deploy Job + timeout-minutes: 30 + outputs: + first_gen_docs_url: ${{ steps.deploy.outputs.first_gen_docs_url }} + first_gen_storybook_url: ${{ steps.deploy.outputs.first_gen_storybook_url }} + second_gen_storybook_url: ${{ steps.deploy.outputs.second_gen_storybook_url }} + steps: + ## --- SETUP --- ## + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Use Node LTS version + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn + + - name: Enable Corepack + run: corepack enable + + - name: Generate PR hash + id: pr_hash + run: | + # Use just PR number so each commit overwrites the previous deployment + pr_hash="pr-${{ github.event.pull_request.number }}" + echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" + echo "Generated PR hash: ${pr_hash}" + + ## --- YARN CACHE --- ## + - name: Check for cached dependencies + continue-on-error: true + id: cache-dependencies + uses: actions/cache@v4 + with: + path: | + .cache/yarn + node_modules + key: ubuntu-latest-node20-${{ hashFiles('yarn.lock', 'package.json') }} + + ## --- INSTALL & BUILD --- ## + - name: Install dependencies + shell: bash + run: yarn install --immutable + + - name: Build all generations + run: yarn build + + - name: Generate Custom Elements Manifest + run: yarn workspace @spectrum-web-components/1st-gen docs:analyze + + - name: Move CEM to Storybook directory + run: cp 1st-gen/projects/documentation/custom-elements.json 1st-gen/storybook/ + + - name: Build documentation with path prefix + env: + SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs + run: | + yarn workspace @spectrum-web-components/1st-gen docs:build + + - name: Build first-gen Storybook + run: yarn workspace @spectrum-web-components/1st-gen storybook:build + + - name: Build second-gen Storybook + run: yarn workspace @spectrum-web-components/2nd-gen storybook:build + + ## --- DEPLOY TO AZURE BLOB STORAGE --- ## + - name: Setup AzCopy + uses: ./.github/actions/setup-azcopy + + - name: Deploy first-gen documentation to Azure Blob Storage + env: + PR_HASH: ${{ steps.pr_hash.outputs.hash }} + run: | + echo "Uploading first-gen documentation to ${PR_HASH}/docs/first-gen-docs/" + azcopy copy "1st-gen/projects/documentation/dist/*" \ + "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-docs/" \ + --recursive \ + --from-to LocalBlob + echo "✅ First-gen documentation uploaded successfully" + + - name: Deploy first-gen Storybook to Azure Blob Storage + env: + PR_HASH: ${{ steps.pr_hash.outputs.hash }} + run: | + echo "Uploading first-gen Storybook to ${PR_HASH}/docs/first-gen-storybook/" + azcopy copy "1st-gen/projects/documentation/dist/storybook/*" \ + "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-storybook/" \ + --recursive \ + --from-to LocalBlob + echo "✅ First-gen Storybook uploaded successfully" + + - name: Deploy second-gen Storybook to Azure Blob Storage + env: + PR_HASH: ${{ steps.pr_hash.outputs.hash }} + run: | + echo "Uploading second-gen Storybook to ${PR_HASH}/docs/second-gen-storybook/" + azcopy copy "2nd-gen/packages/swc/storybook-static/*" \ + "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/second-gen-storybook/" \ + --recursive \ + --from-to LocalBlob + echo "✅ Second-gen Storybook uploaded successfully" + + - name: Set deployment URLs + id: deploy + env: + PR_HASH: ${{ steps.pr_hash.outputs.hash }} + run: | + first_gen_docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-docs" + first_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-storybook" + second_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/second-gen-storybook" + + echo "first_gen_docs_url=${first_gen_docs_url}" >> "$GITHUB_OUTPUT" + echo "first_gen_storybook_url=${first_gen_storybook_url}" >> "$GITHUB_OUTPUT" + echo "second_gen_storybook_url=${second_gen_storybook_url}" >> "$GITHUB_OUTPUT" + + echo "📦 All deployments completed:" + echo " - Documentation: ${first_gen_docs_url}" + echo " - First-gen Storybook: ${first_gen_storybook_url}" + echo " - Second-gen Storybook: ${second_gen_storybook_url}" + + - name: Post Previews Comment + uses: actions/github-script@v7 + with: + script: | + const { buildPreviewURLComment } = await import('${{ github.workspace }}/.github/scripts/build-preview-urls-comment.js'); + const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js'); + + const prNumber = context.payload.pull_request.number; + const body = buildPreviewURLComment(prNumber); + + console.log(`Posting comment to PR #${prNumber}`); + commentOrUpdate(github, context, '## 📚 Branch Preview Links', body); + + smoke_tests: + if: github.event_name == 'pull_request' && github.event.action != 'closed' + needs: build_and_deploy_job + runs-on: ubuntu-latest + name: Smoke Tests + timeout-minutes: 15 + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 + + - name: Wait for deployment + env: + DOC_URL: ${{ needs.build_and_deploy_job.outputs.first_gen_docs_url }} + run: | + echo "Waiting for deployment to be available at: ${DOC_URL}" + + # Wait up to 10 minutes for the deployment to be available + max_attempts=60 + attempt=1 + + while [ $attempt -le $max_attempts ]; do + echo "Attempt $attempt/$max_attempts: Checking if site is available..." + + if curl -f -s --max-time 10 "${DOC_URL}" > /dev/null; then + echo "✅ Site is now available!" + break + else + echo "❌ Site not ready yet, waiting 10 seconds..." + sleep 10 + attempt=$((attempt + 1)) + fi + done + + if [ $attempt -gt $max_attempts ]; then + echo "❌ Timeout: Site was not available after 10 minutes" + exit 1 + fi + + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job + + - name: Install Playwright Browsers + run: cd 1st-gen && yarn playwright install --with-deps + + - name: Run Playwright tests + run: cd 1st-gen && yarn playwright test projects/documentation/e2e/published.spec.ts + env: + DOC_PREVIEW_URL: ${{ needs.build_and_deploy_job.outputs.first_gen_docs_url }} + SWC_DIR: pr-${{ github.event.pull_request.number }} + NODE_ENV: CI + + - name: Upload Playwright Report + uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 + + close_pull_request_job: + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Clean up PR deployment + timeout-minutes: 5 + steps: + - name: Check out code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Generate PR hash + id: pr_hash + run: | + # Create the same hash as in the deploy job + pr_hash="pr-${{ github.event.pull_request.number }}" + echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" + + - name: Setup AzCopy + uses: ./.github/actions/setup-azcopy + + - name: Clean up PR deployment + env: + PR_HASH: ${{ steps.pr_hash.outputs.hash }} + run: | + echo "Cleaning up deployment: ${PR_HASH}/" + azcopy remove "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/" \ + --recursive || echo "Cleanup completed (some files may not exist)" + echo "Cleanup completed for PR deployment: ${PR_HASH}/" diff --git a/.github/workflows/preview-release.yml b/.github/workflows/preview-release.yml index 741216f1dc8..44065c55b29 100644 --- a/.github/workflows/preview-release.yml +++ b/.github/workflows/preview-release.yml @@ -1,50 +1,50 @@ name: Preview Release on: - push: - branches: - - main + push: + branches: + - main jobs: - release: - runs-on: ubuntu-latest - env: - YARN_ENABLE_IMMUTABLE_INSTALLS: false - # Run the job if manually triggered or if the commit message includes a commit type of fix or feat or breaking change - if: contains(github.event.head_commit.message, 'fix:') || contains(github.event.head_commit.message, 'fix(') || contains(github.event.head_commit.message, 'feat:') || contains(github.event.head_commit.message, 'feat(') || contains(github.event.head_commit.message, '!:') - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 + release: + runs-on: ubuntu-latest + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false + # Run the job if manually triggered or if the commit message includes a commit type of fix or feat or breaking change + if: contains(github.event.head_commit.message, 'fix:') || contains(github.event.head_commit.message, 'fix(') || contains(github.event.head_commit.message, 'feat:') || contains(github.event.head_commit.message, 'feat(') || contains(github.event.head_commit.message, '!:') + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job - - name: Set Git identity - run: | - git config --global user.email "support+actions@github.com" - git config --global user.name "github-actions-bot" + - name: Set Git identity + run: | + git config --global user.email "support+actions@github.com" + git config --global user.name "github-actions-bot" - - name: Update package versions for preview snapshot release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - yarn changeset version --snapshot preview-${GITHUB_SHA::8} - yarn constraints --fix - yarn version:update - yarn install --refresh-lockfile + - name: Update package versions for preview snapshot release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + yarn changeset version --snapshot preview-${GITHUB_SHA::8} + yarn constraints --fix + yarn version:update + yarn install --refresh-lockfile - - name: Configure NPM for changeset publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + - name: Configure NPM for changeset publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - - name: Publish preview snapshot release - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - git add . - git commit -am "chore: publish preview snapshot version" - yarn prepublishOnly - yarn changeset publish --no-git-tag --tag preview - git reset --hard HEAD^ + - name: Publish preview snapshot release + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + git add . + git commit -am "chore: publish preview snapshot version" + yarn prepublishOnly + yarn changeset publish --no-git-tag --tag preview + git reset --hard HEAD^ diff --git a/.github/workflows/publish-docs-site.yml b/.github/workflows/publish-docs-site.yml index eabbacb14bf..d58f543bd53 100644 --- a/.github/workflows/publish-docs-site.yml +++ b/.github/workflows/publish-docs-site.yml @@ -1,42 +1,42 @@ name: Publish Documentation Site on: - workflow_dispatch: - push: - branches: - - main + workflow_dispatch: + push: + branches: + - main jobs: - site-build: - name: Build & publish site - runs-on: ubuntu-latest - # Run the job if manually triggered or if the commit message includes '#publish' & the check suite has passed or if the commit message includes 'docs' and the check suite has passed - if: github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '#publish') || contains(github.event.head_commit.message, 'docs:') || contains(github.event.head_commit.message, 'docs(') - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 - - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job - - - name: Generate Custom Elements Manifest - run: yarn docs:analyze - - - name: Move CEM to Storybook directory - run: cp projects/documentation/custom-elements.json storybook/ - - - name: Build documentation - run: yarn docs:production - - - name: Build Storybook - run: yarn storybook:build - - - name: Add redirects to documentation - run: echo '/* /index.html 200' > projects/documentation/dist/_redirects - - - name: Deploy to GitHub Pages - run: | - git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git - yarn gh-pages -d projects/documentation/dist -m "[skip ci] update demonstration site" -t -u "github-actions-bot " --nojekyll - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + site-build: + name: Build & publish site + runs-on: ubuntu-latest + # Run the job if manually triggered or if the commit message includes '#publish' & the check suite has passed or if the commit message includes 'docs' and the check suite has passed + if: github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '#publish') || contains(github.event.head_commit.message, 'docs:') || contains(github.event.head_commit.message, 'docs(') + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 + + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job + + - name: Generate Custom Elements Manifest + run: yarn docs:analyze + + - name: Move CEM to Storybook directory + run: cp projects/documentation/custom-elements.json storybook/ + + - name: Build documentation + run: yarn docs:production + + - name: Build Storybook + run: yarn storybook:build + + - name: Add redirects to documentation + run: echo '/* /index.html 200' > projects/documentation/dist/_redirects + + - name: Deploy to GitHub Pages + run: | + git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git + yarn gh-pages -d projects/documentation/dist -m "[skip ci] update demonstration site" -t -u "github-actions-bot " --nojekyll + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/urls-smoke-test.yml b/.github/workflows/urls-smoke-test.yml deleted file mode 100644 index 396b92c3ed7..00000000000 --- a/.github/workflows/urls-smoke-test.yml +++ /dev/null @@ -1,104 +0,0 @@ -name: Review URLs and Smoke Tests - -on: - pull_request: - types: [opened, synchronize, reopened, closed] - branches: - - '**' - -permissions: - contents: read - pull-requests: write - -jobs: - wait-for-deployment: - name: Wait for deployment to complete - runs-on: ubuntu-latest - outputs: - doc_url: ${{ steps.extract_doc_url.outputs.DOC_URL }} - swc_dir: ${{ steps.pr_hash.outputs.hash }} - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 - - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job - - - name: Generate PR hash - id: pr_hash - run: | - pr_hash="pr-${{ github.event.pull_request.number }}" - echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" - echo "Generated PR hash: ${pr_hash}" - - - name: Extract doc preview url - run: echo "DOC_URL=https://swcpreviews.z13.web.core.windows.net/${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs" >> "$GITHUB_OUTPUT" - id: extract_doc_url - - - name: Post Previews Comment - uses: actions/github-script@v7 - with: - script: | - const { buildPreviewURLComment } = await import('${{ github.workspace }}/.github/scripts/build-preview-urls-comment.js'); - const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js'); - - const prNumber = context.payload.pull_request.number; - const body = buildPreviewURLComment(prNumber); - - console.log(`Posting comment to PR #${prNumber}`); - commentOrUpdate(github, context, '## 📚 Branch Preview Links', body); - - - name: Wait for deployment - run: | - echo "Waiting for deployment to be available at: ${{ steps.extract_doc_url.outputs.DOC_URL }}" - - # Wait up to 10 minutes for the deployment to be available - max_attempts=60 - attempt=1 - - while [ $attempt -le $max_attempts ]; do - echo "Attempt $attempt/$max_attempts: Checking if site is available..." - - if curl -f -s --max-time 10 "${{ steps.extract_doc_url.outputs.DOC_URL }}" > /dev/null; then - echo "✅ Site is now available!" - break - else - echo "❌ Site not ready yet, waiting 10 seconds..." - sleep 10 - attempt=$((attempt + 1)) - fi - done - - if [ $attempt -gt $max_attempts ]; then - echo "❌ Timeout: Site was not available after 10 minutes" - exit 1 - fi - - playwright-smoke-tests: - timeout-minutes: 60 - runs-on: ubuntu-latest - needs: wait-for-deployment - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 - - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job - - - name: Install Playwright Browsers - run: cd 1st-gen && yarn playwright install --with-deps - - - name: Run Playwright tests - run: cd 1st-gen && yarn playwright test projects/documentation/e2e/published.spec.ts - env: - DOC_PREVIEW_URL: ${{ needs.wait-for-deployment.outputs.doc_url }} - SWC_DIR: ${{ needs.wait-for-deployment.outputs.swc_dir }} - NODE_ENV: CI - - - name: Upload Playwright Report - uses: actions/upload-artifact@v4 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 diff --git a/.prettierrc.yaml b/.prettierrc.yaml index 48275c22efd..fb860eedb7d 100644 --- a/.prettierrc.yaml +++ b/.prettierrc.yaml @@ -5,3 +5,7 @@ singleQuote: true trailingComma: es5 bracketSpacing: true arrowParens: always +overrides: + - files: '*.{yml,yaml}' + options: + tabWidth: 2 diff --git a/.vscode/settings.json b/.vscode/settings.json index 093ccc96a92..bf2b3406eb5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -32,7 +32,15 @@ "typescript.tsdk": "node_modules/typescript/lib", "lit-plugin.strict": true, "cSpell.words": ["activedescendant", "coachmark", "valuetext"], + "editor.detectIndentation": false, "[yaml]": { - "editor.defaultFormatter": "redhat.vscode-yaml" - } + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.tabSize": 2, + "editor.insertSpaces": true, + "editor.detectIndentation": false + }, + "yaml.format.enable": true, + "yaml.format.singleQuote": false, + "yaml.format.bracketSpacing": true, + "yaml.format.printWidth": 80 } From e5b01a1d460b3a7bff2f6608117213f82d157ad8 Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Fri, 14 Nov 2025 14:40:51 -0700 Subject: [PATCH 17/21] chore: borked actions --- .editorconfig | 2 +- .github/workflows/preview-docs.yml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index 913e0353093..cb7c2f85cc4 100755 --- a/.editorconfig +++ b/.editorconfig @@ -7,4 +7,4 @@ indent_size = 4 charset = utf-8 [*.{yml,yaml}] -indent_size = 2 \ No newline at end of file +indent_size = 2 diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 858861f24bb..134586141f1 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -3,15 +3,13 @@ name: Preview Documentation (Azure Blob Storage) on: pull_request: types: [opened, synchronize, reopened, closed] - branches: - - '**' permissions: contents: read pull-requests: write concurrency: - group: '${{ github.workflow }} @ ${{ github.event.pull_request.number }}' + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true env: From 4dd1cec87d849ea2042a94c47bb05dda89026e87 Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Fri, 14 Nov 2025 14:43:13 -0700 Subject: [PATCH 18/21] chore: borked actions --- .editorconfig | 3 - .github/workflows/browser-tests.yml | 182 ++++----- .github/workflows/chromatic-vrt.yml | 100 ++--- .github/workflows/coveralls.yml | 46 +-- .github/workflows/lint.yml | 218 +++++------ .github/workflows/pr-update.yml | 42 +-- .github/workflows/preview-docs.yml | 470 ++++++++++++------------ .github/workflows/preview-release.yml | 80 ++-- .github/workflows/publish-docs-site.yml | 74 ++-- .prettierrc.yaml | 4 - .vscode/extensions.json | 2 +- .vscode/settings.json | 13 +- 12 files changed, 608 insertions(+), 626 deletions(-) diff --git a/.editorconfig b/.editorconfig index cb7c2f85cc4..e8844ac3951 100755 --- a/.editorconfig +++ b/.editorconfig @@ -5,6 +5,3 @@ end_of_line = lf indent_style = space indent_size = 4 charset = utf-8 - -[*.{yml,yaml}] -indent_size = 2 diff --git a/.github/workflows/browser-tests.yml b/.github/workflows/browser-tests.yml index 2f0eef3cabe..a109a4b8122 100644 --- a/.github/workflows/browser-tests.yml +++ b/.github/workflows/browser-tests.yml @@ -1,98 +1,98 @@ name: Browser Performance Tests on: - workflow_dispatch: # Only run manually, not on pull requests + workflow_dispatch: # Only run manually, not on pull requests permissions: - contents: read - pull-requests: write + contents: read + pull-requests: write jobs: - test-changed-packages: - strategy: - matrix: - browser: [firefox, chrome] - name: Compare performance to latest release on ${{ matrix.browser }} - - # The job will only run if the pull request is from the same repository. - # Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token. - if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} - runs-on: ubuntu-22.04 - steps: - - name: Checkout main - uses: actions/checkout@v4 - with: - ref: main - - - name: Checkout PR branch - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Get full history - - - name: Fetch main branch - run: | - git fetch origin main:main - - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job - - - name: Check ChromeDriver Version - if: matrix.browser == 'chrome' - run: | - echo "Checking ChromeDriver version..." - npx chromedriver --version - echo "Checking Chrome version..." - google-chrome --version - echo "Checking tachometer chromedriver version..." - cd 1st-gen && yarn tachometer --version - - - name: Tachometer the changed packages - run: cd 1st-gen && yarn test:changed --browser=${{ matrix.browser }} - - - name: Create a dummy file to ensure at least one results file exists - run: touch 1st-gen/tachometer.${{ matrix.browser }}-ran.txt - - - name: Archive ${{ matrix.browser }} tachometer results - id: upload-artifact - uses: actions/upload-artifact@v4 - with: - name: tachometer-results-${{ matrix.browser }} - path: | - 1st-gen/tach-results.${{ matrix.browser }}.*.json - 1st-gen/tachometer.${{ matrix.browser }}-ran.txt - - comment-performance: - name: Comment tachometer performance results - needs: [test-changed-packages] - - # The job will only run if the pull request is from the same repository. - # Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token. - if: ${{ github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository }} - runs-on: ubuntu-latest - steps: - - name: Checkout main - uses: actions/checkout@v4 - with: - ref: main - - - name: Checkout PR branch - uses: actions/checkout@v4 - with: - fetch-depth: 2 - - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job - - - uses: actions/download-artifact@v4 - with: - pattern: tachometer-results-* - merge-multiple: true - - - name: Post Tachometer Performance Comment - uses: actions/github-script@v7 - with: - script: | - const { buildTachometerComment } = await import('${{ github.workspace }}/.github/scripts/build-tachometer-comment.js'); - const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js'); - const body = buildTachometerComment(); - commentOrUpdate(github, context, '## Tachometer results', body); + test-changed-packages: + strategy: + matrix: + browser: [firefox, chrome] + name: Compare performance to latest release on ${{ matrix.browser }} + + # The job will only run if the pull request is from the same repository. + # Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token. + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + runs-on: ubuntu-22.04 + steps: + - name: Checkout main + uses: actions/checkout@v4 + with: + ref: main + + - name: Checkout PR branch + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Get full history + + - name: Fetch main branch + run: | + git fetch origin main:main + + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job + + - name: Check ChromeDriver Version + if: matrix.browser == 'chrome' + run: | + echo "Checking ChromeDriver version..." + npx chromedriver --version + echo "Checking Chrome version..." + google-chrome --version + echo "Checking tachometer chromedriver version..." + cd 1st-gen && yarn tachometer --version + + - name: Tachometer the changed packages + run: cd 1st-gen && yarn test:changed --browser=${{ matrix.browser }} + + - name: Create a dummy file to ensure at least one results file exists + run: touch 1st-gen/tachometer.${{ matrix.browser }}-ran.txt + + - name: Archive ${{ matrix.browser }} tachometer results + id: upload-artifact + uses: actions/upload-artifact@v4 + with: + name: tachometer-results-${{ matrix.browser }} + path: | + 1st-gen/tach-results.${{ matrix.browser }}.*.json + 1st-gen/tachometer.${{ matrix.browser }}-ran.txt + + comment-performance: + name: Comment tachometer performance results + needs: [test-changed-packages] + + # The job will only run if the pull request is from the same repository. + # Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token. + if: ${{ github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository }} + runs-on: ubuntu-latest + steps: + - name: Checkout main + uses: actions/checkout@v4 + with: + ref: main + + - name: Checkout PR branch + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job + + - uses: actions/download-artifact@v4 + with: + pattern: tachometer-results-* + merge-multiple: true + + - name: Post Tachometer Performance Comment + uses: actions/github-script@v7 + with: + script: | + const { buildTachometerComment } = await import('${{ github.workspace }}/.github/scripts/build-tachometer-comment.js'); + const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js'); + const body = buildTachometerComment(); + commentOrUpdate(github, context, '## Tachometer results', body); diff --git a/.github/workflows/chromatic-vrt.yml b/.github/workflows/chromatic-vrt.yml index 259a5e97c6d..a88d2cfb6d9 100644 --- a/.github/workflows/chromatic-vrt.yml +++ b/.github/workflows/chromatic-vrt.yml @@ -1,57 +1,57 @@ name: Visual regression testing with Chromatic on: - workflow_dispatch: - workflow_call: - inputs: - skip: - description: 'Skip running VRT' - required: false - type: boolean - default: false - outputs: - storybook-url: - description: 'URL of the published Storybook' - value: ${{ jobs.vrt.outputs.storybook-url }} + workflow_dispatch: + workflow_call: + inputs: + skip: + description: 'Skip running VRT' + required: false + type: boolean + default: false + outputs: + storybook-url: + description: 'URL of the published Storybook' + value: ${{ jobs.vrt.outputs.storybook-url }} permissions: - contents: read - pull-requests: write + contents: read + pull-requests: write jobs: - vrt: - name: Chromatic - runs-on: ubuntu-latest - timeout-minutes: 20 - outputs: - storybook-url: ${{ steps.chromatic.outputs.storybookUrl != 'undefined' && steps.chromatic.outputs.storybookUrl || '' }} - - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job - - - name: Generate Custom Elements Manifest - run: yarn docs:analyze - - - name: Move CEM to Storybook directory - run: cp projects/documentation/custom-elements.json storybook/ - - - name: Publish to Chromatic - id: chromatic - uses: chromaui/action@v11 - with: - projectToken: ${{ secrets.CHROMATIC_TOKEN }} - buildScriptName: storybook:build - storybookConfigDir: storybook - exitOnceUploaded: true - onlyChanged: true - traceChanged: true - untraced: '.github/actions/*/package.json' - diagnostics: true - # Lets VRT pass without running so as not to waste snapshots - skip: ${{ inputs.skip }} + vrt: + name: Chromatic + runs-on: ubuntu-latest + timeout-minutes: 20 + outputs: + storybook-url: ${{ steps.chromatic.outputs.storybookUrl != 'undefined' && steps.chromatic.outputs.storybookUrl || '' }} + + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job + + - name: Generate Custom Elements Manifest + run: yarn docs:analyze + + - name: Move CEM to Storybook directory + run: cp projects/documentation/custom-elements.json storybook/ + + - name: Publish to Chromatic + id: chromatic + uses: chromaui/action@v11 + with: + projectToken: ${{ secrets.CHROMATIC_TOKEN }} + buildScriptName: storybook:build + storybookConfigDir: storybook + exitOnceUploaded: true + onlyChanged: true + traceChanged: true + untraced: '.github/actions/*/package.json' + diagnostics: true + # Lets VRT pass without running so as not to waste snapshots + skip: ${{ inputs.skip }} diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml index b470ba9af6e..b432c7d957a 100644 --- a/.github/workflows/coveralls.yml +++ b/.github/workflows/coveralls.yml @@ -1,32 +1,32 @@ name: Coveralls Code Coverage on: - push: - branches: - - main - pull_request: - branches: - - main + push: + branches: + - main + pull_request: + branches: + - main jobs: - code-coverage-report: - name: Generate and upload coverage report - runs-on: ubuntu-latest - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 + code-coverage-report: + name: Generate and upload coverage report + runs-on: ubuntu-latest + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job - - name: Install Playwright - run: cd 1st-gen && yarn playwright install --with-deps + - name: Install Playwright + run: cd 1st-gen && yarn playwright install --with-deps - - name: Run unit tests with coverage - run: cd 1st-gen && yarn test:ci --config web-test-runner.config.ci-chromium.js --group coveralls-ci --coverage - continue-on-error: true + - name: Run unit tests with coverage + run: cd 1st-gen && yarn test:ci --config web-test-runner.config.ci-chromium.js --group coveralls-ci --coverage + continue-on-error: true - - name: Upload coverage to Coveralls - uses: coverallsapp/github-action@v2 - with: - allow-empty: true + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + allow-empty: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bf08936203c..a2176b65a78 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,122 +4,122 @@ name: Lint # on: - push: - branches: - - main + push: + branches: + - main - pull_request: - branches: - - main + pull_request: + branches: + - main - types: - - opened - - synchronize - - reopened - - auto_merge_enabled + types: + - opened + - synchronize + - reopened + - auto_merge_enabled permissions: - contents: read - pull-requests: write + contents: read + pull-requests: write concurrency: - group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' - cancel-in-progress: true + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true defaults: - run: - shell: bash + run: + shell: bash jobs: - # ------------------------------------------------------------- - # Returns all changed pull request files. - # -------------------------------------------------------------- - changed_files: - runs-on: ubuntu-latest - name: Capture changed-files - outputs: - styles_added_files: ${{ steps.changed-files.outputs.styles_added_files }} - styles_modified_files: ${{ steps.changed-files.outputs.styles_modified_files }} - eslint_added_files: ${{ steps.changed-files.outputs.eslint_added_files }} - eslint_modified_files: ${{ steps.changed-files.outputs.eslint_modified_files }} - permissions: - pull-requests: read - - steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Get changed files - id: changed-files - uses: step-security/changed-files@v46 - with: - files_yaml: | - styles: - - '*.css' - - '**/*.css' - eslint: - - '*.{js,json,ts}' - - '**/*.{js,json,ts}' - - '!*.d.ts' - - '!**/*.d.ts' - - # --- Lint pre-compiled assets for consistency --- # - lint: - name: Lint - runs-on: ubuntu-latest - needs: [changed_files] - timeout-minutes: 5 - steps: - # install but don't build - we're linting pre-compiled assets - - name: Check out code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Use Node LTS version - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: yarn - - - name: Enable Corepack - run: corepack enable - - ## --- YARN CACHE --- ## - - name: Check for cached dependencies - continue-on-error: true - id: cache-dependencies - uses: actions/cache@v4 - with: - path: | - .cache/yarn - node_modules - key: ubuntu-latest-node20-${{ hashFiles('yarn.lock') }} - - ## --- INSTALL --- ## - # If statement isn't needed here b/c yarn will leverage the cache if it exists - - name: Install dependencies - shell: bash - run: yarn install --immutable - - - name: Lint styles - # if: ${{ needs.changed_files.outputs.styles_added_files != '' || needs.changed_files.outputs.styles_modified_files != '' }} - uses: reviewdog/action-stylelint@v1.30.2 - with: - fail_level: error - filter_mode: diff_context - level: error - reporter: github-pr-review - stylelint_input: '${{ needs.changed_files.outputs.styles_added_files }} ${{ needs.changed_files.outputs.styles_modified_files }} --allow-empty-input' - stylelint_config: '${{ github.workspace }}/.stylelintrc.json' - packages: 'stylelint-header stylelint-config-standard' - - - name: ESLint - uses: reviewdog/action-eslint@v1.33.2 - # if: ${{ needs.changed_files.outputs.eslint_added_files != '' || needs.changed_files.outputs.eslint_modified_files != '' }} - with: - fail_level: error - level: error - reporter: github-pr-review - filter_mode: diff_context - eslint_flags: '${{ needs.changed_files.outputs.eslint_added_files }} ${{ needs.changed_files.outputs.eslint_modified_files }}' + # ------------------------------------------------------------- + # Returns all changed pull request files. + # -------------------------------------------------------------- + changed_files: + runs-on: ubuntu-latest + name: Capture changed-files + outputs: + styles_added_files: ${{ steps.changed-files.outputs.styles_added_files }} + styles_modified_files: ${{ steps.changed-files.outputs.styles_modified_files }} + eslint_added_files: ${{ steps.changed-files.outputs.eslint_added_files }} + eslint_modified_files: ${{ steps.changed-files.outputs.eslint_modified_files }} + permissions: + pull-requests: read + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Get changed files + id: changed-files + uses: step-security/changed-files@v46 + with: + files_yaml: | + styles: + - '*.css' + - '**/*.css' + eslint: + - '*.{js,json,ts}' + - '**/*.{js,json,ts}' + - '!*.d.ts' + - '!**/*.d.ts' + + # --- Lint pre-compiled assets for consistency --- # + lint: + name: Lint + runs-on: ubuntu-latest + needs: [changed_files] + timeout-minutes: 5 + steps: + # install but don't build - we're linting pre-compiled assets + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Use Node LTS version + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn + + - name: Enable Corepack + run: corepack enable + + ## --- YARN CACHE --- ## + - name: Check for cached dependencies + continue-on-error: true + id: cache-dependencies + uses: actions/cache@v4 + with: + path: | + .cache/yarn + node_modules + key: ubuntu-latest-node20-${{ hashFiles('yarn.lock') }} + + ## --- INSTALL --- ## + # If statement isn't needed here b/c yarn will leverage the cache if it exists + - name: Install dependencies + shell: bash + run: yarn install --immutable + + - name: Lint styles + # if: ${{ needs.changed_files.outputs.styles_added_files != '' || needs.changed_files.outputs.styles_modified_files != '' }} + uses: reviewdog/action-stylelint@v1.30.2 + with: + fail_level: error + filter_mode: diff_context + level: error + reporter: github-pr-review + stylelint_input: '${{ needs.changed_files.outputs.styles_added_files }} ${{ needs.changed_files.outputs.styles_modified_files }} --allow-empty-input' + stylelint_config: '${{ github.workspace }}/.stylelintrc.json' + packages: 'stylelint-header stylelint-config-standard' + + - name: ESLint + uses: reviewdog/action-eslint@v1.33.2 + # if: ${{ needs.changed_files.outputs.eslint_added_files != '' || needs.changed_files.outputs.eslint_modified_files != '' }} + with: + fail_level: error + level: error + reporter: github-pr-review + filter_mode: diff_context + eslint_flags: '${{ needs.changed_files.outputs.eslint_added_files }} ${{ needs.changed_files.outputs.eslint_modified_files }}' diff --git a/.github/workflows/pr-update.yml b/.github/workflows/pr-update.yml index 4aa0d39a25a..349157ea0a7 100644 --- a/.github/workflows/pr-update.yml +++ b/.github/workflows/pr-update.yml @@ -1,28 +1,28 @@ name: Update PRs on: - pull_request: - types: [labeled, auto_merge_enabled] + pull_request: + types: [labeled, auto_merge_enabled] jobs: - autoupdate: - name: Auto-update PRs - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 + autoupdate: + name: Auto-update PRs + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job - # README: https://github.com/castastrophe/actions-pr-auto-update#auto-update-pull-requests - - uses: castastrophe/actions-pr-auto-update@v1.1.0 - with: - token: ${{ secrets.USER_TOKEN }} - include_drafts: false - limit: 50 - exclude_labels: blocked,wip - include_labels: auto-update,ready-for-merge + # README: https://github.com/castastrophe/actions-pr-auto-update#auto-update-pull-requests + - uses: castastrophe/actions-pr-auto-update@v1.1.0 + with: + token: ${{ secrets.USER_TOKEN }} + include_drafts: false + limit: 50 + exclude_labels: blocked,wip + include_labels: auto-update,ready-for-merge diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 134586141f1..058c2cc4631 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -1,246 +1,246 @@ name: Preview Documentation (Azure Blob Storage) on: - pull_request: - types: [opened, synchronize, reopened, closed] + pull_request: + types: [opened, synchronize, reopened, closed] permissions: - contents: read - pull-requests: write + contents: read + pull-requests: write concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true env: - AZCOPY_AUTO_LOGIN_TYPE: SPN - AZCOPY_SPA_APPLICATION_ID: ${{ secrets.AZURE_CLIENT_ID }} - AZCOPY_SPA_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} - AZCOPY_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} + AZCOPY_AUTO_LOGIN_TYPE: SPN + AZCOPY_SPA_APPLICATION_ID: ${{ secrets.AZURE_CLIENT_ID }} + AZCOPY_SPA_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} + AZCOPY_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} jobs: - build_and_deploy_job: - if: github.event_name == 'pull_request' && github.event.action != 'closed' - runs-on: ubuntu-latest - name: Build and Deploy Job - timeout-minutes: 30 - outputs: - first_gen_docs_url: ${{ steps.deploy.outputs.first_gen_docs_url }} - first_gen_storybook_url: ${{ steps.deploy.outputs.first_gen_storybook_url }} - second_gen_storybook_url: ${{ steps.deploy.outputs.second_gen_storybook_url }} - steps: - ## --- SETUP --- ## - - name: Check out code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Use Node LTS version - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: yarn - - - name: Enable Corepack - run: corepack enable - - - name: Generate PR hash - id: pr_hash - run: | - # Use just PR number so each commit overwrites the previous deployment - pr_hash="pr-${{ github.event.pull_request.number }}" - echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" - echo "Generated PR hash: ${pr_hash}" - - ## --- YARN CACHE --- ## - - name: Check for cached dependencies - continue-on-error: true - id: cache-dependencies - uses: actions/cache@v4 - with: - path: | - .cache/yarn - node_modules - key: ubuntu-latest-node20-${{ hashFiles('yarn.lock', 'package.json') }} - - ## --- INSTALL & BUILD --- ## - - name: Install dependencies - shell: bash - run: yarn install --immutable - - - name: Build all generations - run: yarn build - - - name: Generate Custom Elements Manifest - run: yarn workspace @spectrum-web-components/1st-gen docs:analyze - - - name: Move CEM to Storybook directory - run: cp 1st-gen/projects/documentation/custom-elements.json 1st-gen/storybook/ - - - name: Build documentation with path prefix - env: - SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs - run: | - yarn workspace @spectrum-web-components/1st-gen docs:build - - - name: Build first-gen Storybook - run: yarn workspace @spectrum-web-components/1st-gen storybook:build - - - name: Build second-gen Storybook - run: yarn workspace @spectrum-web-components/2nd-gen storybook:build - - ## --- DEPLOY TO AZURE BLOB STORAGE --- ## - - name: Setup AzCopy - uses: ./.github/actions/setup-azcopy - - - name: Deploy first-gen documentation to Azure Blob Storage - env: - PR_HASH: ${{ steps.pr_hash.outputs.hash }} - run: | - echo "Uploading first-gen documentation to ${PR_HASH}/docs/first-gen-docs/" - azcopy copy "1st-gen/projects/documentation/dist/*" \ - "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-docs/" \ - --recursive \ - --from-to LocalBlob - echo "✅ First-gen documentation uploaded successfully" - - - name: Deploy first-gen Storybook to Azure Blob Storage - env: - PR_HASH: ${{ steps.pr_hash.outputs.hash }} - run: | - echo "Uploading first-gen Storybook to ${PR_HASH}/docs/first-gen-storybook/" - azcopy copy "1st-gen/projects/documentation/dist/storybook/*" \ - "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-storybook/" \ - --recursive \ - --from-to LocalBlob - echo "✅ First-gen Storybook uploaded successfully" - - - name: Deploy second-gen Storybook to Azure Blob Storage - env: - PR_HASH: ${{ steps.pr_hash.outputs.hash }} - run: | - echo "Uploading second-gen Storybook to ${PR_HASH}/docs/second-gen-storybook/" - azcopy copy "2nd-gen/packages/swc/storybook-static/*" \ - "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/second-gen-storybook/" \ - --recursive \ - --from-to LocalBlob - echo "✅ Second-gen Storybook uploaded successfully" - - - name: Set deployment URLs - id: deploy - env: - PR_HASH: ${{ steps.pr_hash.outputs.hash }} - run: | - first_gen_docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-docs" - first_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-storybook" - second_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/second-gen-storybook" - - echo "first_gen_docs_url=${first_gen_docs_url}" >> "$GITHUB_OUTPUT" - echo "first_gen_storybook_url=${first_gen_storybook_url}" >> "$GITHUB_OUTPUT" - echo "second_gen_storybook_url=${second_gen_storybook_url}" >> "$GITHUB_OUTPUT" - - echo "📦 All deployments completed:" - echo " - Documentation: ${first_gen_docs_url}" - echo " - First-gen Storybook: ${first_gen_storybook_url}" - echo " - Second-gen Storybook: ${second_gen_storybook_url}" - - - name: Post Previews Comment - uses: actions/github-script@v7 - with: - script: | - const { buildPreviewURLComment } = await import('${{ github.workspace }}/.github/scripts/build-preview-urls-comment.js'); - const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js'); - - const prNumber = context.payload.pull_request.number; - const body = buildPreviewURLComment(prNumber); - - console.log(`Posting comment to PR #${prNumber}`); - commentOrUpdate(github, context, '## 📚 Branch Preview Links', body); - - smoke_tests: - if: github.event_name == 'pull_request' && github.event.action != 'closed' - needs: build_and_deploy_job - runs-on: ubuntu-latest - name: Smoke Tests - timeout-minutes: 15 - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 - - - name: Wait for deployment - env: - DOC_URL: ${{ needs.build_and_deploy_job.outputs.first_gen_docs_url }} - run: | - echo "Waiting for deployment to be available at: ${DOC_URL}" - - # Wait up to 10 minutes for the deployment to be available - max_attempts=60 - attempt=1 - - while [ $attempt -le $max_attempts ]; do - echo "Attempt $attempt/$max_attempts: Checking if site is available..." - - if curl -f -s --max-time 10 "${DOC_URL}" > /dev/null; then - echo "✅ Site is now available!" - break - else - echo "❌ Site not ready yet, waiting 10 seconds..." - sleep 10 - attempt=$((attempt + 1)) - fi - done - - if [ $attempt -gt $max_attempts ]; then - echo "❌ Timeout: Site was not available after 10 minutes" - exit 1 - fi - - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job - - - name: Install Playwright Browsers - run: cd 1st-gen && yarn playwright install --with-deps - - - name: Run Playwright tests - run: cd 1st-gen && yarn playwright test projects/documentation/e2e/published.spec.ts - env: - DOC_PREVIEW_URL: ${{ needs.build_and_deploy_job.outputs.first_gen_docs_url }} - SWC_DIR: pr-${{ github.event.pull_request.number }} - NODE_ENV: CI - - - name: Upload Playwright Report - uses: actions/upload-artifact@v4 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 - - close_pull_request_job: - if: github.event_name == 'pull_request' && github.event.action == 'closed' - runs-on: ubuntu-latest - name: Clean up PR deployment - timeout-minutes: 5 - steps: - - name: Check out code - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - name: Generate PR hash - id: pr_hash - run: | - # Create the same hash as in the deploy job - pr_hash="pr-${{ github.event.pull_request.number }}" - echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" - - - name: Setup AzCopy - uses: ./.github/actions/setup-azcopy - - - name: Clean up PR deployment - env: - PR_HASH: ${{ steps.pr_hash.outputs.hash }} - run: | - echo "Cleaning up deployment: ${PR_HASH}/" - azcopy remove "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/" \ - --recursive || echo "Cleanup completed (some files may not exist)" - echo "Cleanup completed for PR deployment: ${PR_HASH}/" + build_and_deploy_job: + if: github.event_name == 'pull_request' && github.event.action != 'closed' + runs-on: ubuntu-latest + name: Build and Deploy Job + timeout-minutes: 30 + outputs: + first_gen_docs_url: ${{ steps.deploy.outputs.first_gen_docs_url }} + first_gen_storybook_url: ${{ steps.deploy.outputs.first_gen_storybook_url }} + second_gen_storybook_url: ${{ steps.deploy.outputs.second_gen_storybook_url }} + steps: + ## --- SETUP --- ## + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Use Node LTS version + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn + + - name: Enable Corepack + run: corepack enable + + - name: Generate PR hash + id: pr_hash + run: | + # Use just PR number so each commit overwrites the previous deployment + pr_hash="pr-${{ github.event.pull_request.number }}" + echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" + echo "Generated PR hash: ${pr_hash}" + + ## --- YARN CACHE --- ## + - name: Check for cached dependencies + continue-on-error: true + id: cache-dependencies + uses: actions/cache@v4 + with: + path: | + .cache/yarn + node_modules + key: ubuntu-latest-node20-${{ hashFiles('yarn.lock', 'package.json') }} + + ## --- INSTALL & BUILD --- ## + - name: Install dependencies + shell: bash + run: yarn install --immutable + + - name: Build all generations + run: yarn build + + - name: Generate Custom Elements Manifest + run: yarn workspace @spectrum-web-components/1st-gen docs:analyze + + - name: Move CEM to Storybook directory + run: cp 1st-gen/projects/documentation/custom-elements.json 1st-gen/storybook/ + + - name: Build documentation with path prefix + env: + SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs + run: | + yarn workspace @spectrum-web-components/1st-gen docs:build + + - name: Build first-gen Storybook + run: yarn workspace @spectrum-web-components/1st-gen storybook:build + + - name: Build second-gen Storybook + run: yarn workspace @spectrum-web-components/2nd-gen storybook:build + + ## --- DEPLOY TO AZURE BLOB STORAGE --- ## + - name: Setup AzCopy + uses: ./.github/actions/setup-azcopy + + - name: Deploy first-gen documentation to Azure Blob Storage + env: + PR_HASH: ${{ steps.pr_hash.outputs.hash }} + run: | + echo "Uploading first-gen documentation to ${PR_HASH}/docs/first-gen-docs/" + azcopy copy "1st-gen/projects/documentation/dist/*" \ + "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-docs/" \ + --recursive \ + --from-to LocalBlob + echo "✅ First-gen documentation uploaded successfully" + + - name: Deploy first-gen Storybook to Azure Blob Storage + env: + PR_HASH: ${{ steps.pr_hash.outputs.hash }} + run: | + echo "Uploading first-gen Storybook to ${PR_HASH}/docs/first-gen-storybook/" + azcopy copy "1st-gen/projects/documentation/dist/storybook/*" \ + "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-storybook/" \ + --recursive \ + --from-to LocalBlob + echo "✅ First-gen Storybook uploaded successfully" + + - name: Deploy second-gen Storybook to Azure Blob Storage + env: + PR_HASH: ${{ steps.pr_hash.outputs.hash }} + run: | + echo "Uploading second-gen Storybook to ${PR_HASH}/docs/second-gen-storybook/" + azcopy copy "2nd-gen/packages/swc/storybook-static/*" \ + "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/second-gen-storybook/" \ + --recursive \ + --from-to LocalBlob + echo "✅ Second-gen Storybook uploaded successfully" + + - name: Set deployment URLs + id: deploy + env: + PR_HASH: ${{ steps.pr_hash.outputs.hash }} + run: | + first_gen_docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-docs" + first_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-storybook" + second_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/second-gen-storybook" + + echo "first_gen_docs_url=${first_gen_docs_url}" >> "$GITHUB_OUTPUT" + echo "first_gen_storybook_url=${first_gen_storybook_url}" >> "$GITHUB_OUTPUT" + echo "second_gen_storybook_url=${second_gen_storybook_url}" >> "$GITHUB_OUTPUT" + + echo "📦 All deployments completed:" + echo " - Documentation: ${first_gen_docs_url}" + echo " - First-gen Storybook: ${first_gen_storybook_url}" + echo " - Second-gen Storybook: ${second_gen_storybook_url}" + + - name: Post Previews Comment + uses: actions/github-script@v7 + with: + script: | + const { buildPreviewURLComment } = await import('${{ github.workspace }}/.github/scripts/build-preview-urls-comment.js'); + const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js'); + + const prNumber = context.payload.pull_request.number; + const body = buildPreviewURLComment(prNumber); + + console.log(`Posting comment to PR #${prNumber}`); + commentOrUpdate(github, context, '## 📚 Branch Preview Links', body); + + smoke_tests: + if: github.event_name == 'pull_request' && github.event.action != 'closed' + needs: build_and_deploy_job + runs-on: ubuntu-latest + name: Smoke Tests + timeout-minutes: 15 + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 + + - name: Wait for deployment + env: + DOC_URL: ${{ needs.build_and_deploy_job.outputs.first_gen_docs_url }} + run: | + echo "Waiting for deployment to be available at: ${DOC_URL}" + + # Wait up to 10 minutes for the deployment to be available + max_attempts=60 + attempt=1 + + while [ $attempt -le $max_attempts ]; do + echo "Attempt $attempt/$max_attempts: Checking if site is available..." + + if curl -f -s --max-time 10 "${DOC_URL}" > /dev/null; then + echo "✅ Site is now available!" + break + else + echo "❌ Site not ready yet, waiting 10 seconds..." + sleep 10 + attempt=$((attempt + 1)) + fi + done + + if [ $attempt -gt $max_attempts ]; then + echo "❌ Timeout: Site was not available after 10 minutes" + exit 1 + fi + + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job + + - name: Install Playwright Browsers + run: cd 1st-gen && yarn playwright install --with-deps + + - name: Run Playwright tests + run: cd 1st-gen && yarn playwright test projects/documentation/e2e/published.spec.ts + env: + DOC_PREVIEW_URL: ${{ needs.build_and_deploy_job.outputs.first_gen_docs_url }} + SWC_DIR: pr-${{ github.event.pull_request.number }} + NODE_ENV: CI + + - name: Upload Playwright Report + uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 + + close_pull_request_job: + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Clean up PR deployment + timeout-minutes: 5 + steps: + - name: Check out code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Generate PR hash + id: pr_hash + run: | + # Create the same hash as in the deploy job + pr_hash="pr-${{ github.event.pull_request.number }}" + echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" + + - name: Setup AzCopy + uses: ./.github/actions/setup-azcopy + + - name: Clean up PR deployment + env: + PR_HASH: ${{ steps.pr_hash.outputs.hash }} + run: | + echo "Cleaning up deployment: ${PR_HASH}/" + azcopy remove "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/" \ + --recursive || echo "Cleanup completed (some files may not exist)" + echo "Cleanup completed for PR deployment: ${PR_HASH}/" diff --git a/.github/workflows/preview-release.yml b/.github/workflows/preview-release.yml index 44065c55b29..741216f1dc8 100644 --- a/.github/workflows/preview-release.yml +++ b/.github/workflows/preview-release.yml @@ -1,50 +1,50 @@ name: Preview Release on: - push: - branches: - - main + push: + branches: + - main jobs: - release: - runs-on: ubuntu-latest - env: - YARN_ENABLE_IMMUTABLE_INSTALLS: false - # Run the job if manually triggered or if the commit message includes a commit type of fix or feat or breaking change - if: contains(github.event.head_commit.message, 'fix:') || contains(github.event.head_commit.message, 'fix(') || contains(github.event.head_commit.message, 'feat:') || contains(github.event.head_commit.message, 'feat(') || contains(github.event.head_commit.message, '!:') - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 + release: + runs-on: ubuntu-latest + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false + # Run the job if manually triggered or if the commit message includes a commit type of fix or feat or breaking change + if: contains(github.event.head_commit.message, 'fix:') || contains(github.event.head_commit.message, 'fix(') || contains(github.event.head_commit.message, 'feat:') || contains(github.event.head_commit.message, 'feat(') || contains(github.event.head_commit.message, '!:') + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job - - name: Set Git identity - run: | - git config --global user.email "support+actions@github.com" - git config --global user.name "github-actions-bot" + - name: Set Git identity + run: | + git config --global user.email "support+actions@github.com" + git config --global user.name "github-actions-bot" - - name: Update package versions for preview snapshot release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - yarn changeset version --snapshot preview-${GITHUB_SHA::8} - yarn constraints --fix - yarn version:update - yarn install --refresh-lockfile + - name: Update package versions for preview snapshot release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + yarn changeset version --snapshot preview-${GITHUB_SHA::8} + yarn constraints --fix + yarn version:update + yarn install --refresh-lockfile - - name: Configure NPM for changeset publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + - name: Configure NPM for changeset publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - - name: Publish preview snapshot release - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - git add . - git commit -am "chore: publish preview snapshot version" - yarn prepublishOnly - yarn changeset publish --no-git-tag --tag preview - git reset --hard HEAD^ + - name: Publish preview snapshot release + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + git add . + git commit -am "chore: publish preview snapshot version" + yarn prepublishOnly + yarn changeset publish --no-git-tag --tag preview + git reset --hard HEAD^ diff --git a/.github/workflows/publish-docs-site.yml b/.github/workflows/publish-docs-site.yml index d58f543bd53..eabbacb14bf 100644 --- a/.github/workflows/publish-docs-site.yml +++ b/.github/workflows/publish-docs-site.yml @@ -1,42 +1,42 @@ name: Publish Documentation Site on: - workflow_dispatch: - push: - branches: - - main + workflow_dispatch: + push: + branches: + - main jobs: - site-build: - name: Build & publish site - runs-on: ubuntu-latest - # Run the job if manually triggered or if the commit message includes '#publish' & the check suite has passed or if the commit message includes 'docs' and the check suite has passed - if: github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '#publish') || contains(github.event.head_commit.message, 'docs:') || contains(github.event.head_commit.message, 'docs(') - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 - - - name: Setup Job and Install Dependencies - uses: ./.github/actions/setup-job - - - name: Generate Custom Elements Manifest - run: yarn docs:analyze - - - name: Move CEM to Storybook directory - run: cp projects/documentation/custom-elements.json storybook/ - - - name: Build documentation - run: yarn docs:production - - - name: Build Storybook - run: yarn storybook:build - - - name: Add redirects to documentation - run: echo '/* /index.html 200' > projects/documentation/dist/_redirects - - - name: Deploy to GitHub Pages - run: | - git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git - yarn gh-pages -d projects/documentation/dist -m "[skip ci] update demonstration site" -t -u "github-actions-bot " --nojekyll - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + site-build: + name: Build & publish site + runs-on: ubuntu-latest + # Run the job if manually triggered or if the commit message includes '#publish' & the check suite has passed or if the commit message includes 'docs' and the check suite has passed + if: github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '#publish') || contains(github.event.head_commit.message, 'docs:') || contains(github.event.head_commit.message, 'docs(') + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 + + - name: Setup Job and Install Dependencies + uses: ./.github/actions/setup-job + + - name: Generate Custom Elements Manifest + run: yarn docs:analyze + + - name: Move CEM to Storybook directory + run: cp projects/documentation/custom-elements.json storybook/ + + - name: Build documentation + run: yarn docs:production + + - name: Build Storybook + run: yarn storybook:build + + - name: Add redirects to documentation + run: echo '/* /index.html 200' > projects/documentation/dist/_redirects + + - name: Deploy to GitHub Pages + run: | + git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git + yarn gh-pages -d projects/documentation/dist -m "[skip ci] update demonstration site" -t -u "github-actions-bot " --nojekyll + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.prettierrc.yaml b/.prettierrc.yaml index fb860eedb7d..48275c22efd 100644 --- a/.prettierrc.yaml +++ b/.prettierrc.yaml @@ -5,7 +5,3 @@ singleQuote: true trailingComma: es5 bracketSpacing: true arrowParens: always -overrides: - - files: '*.{yml,yaml}' - options: - tabWidth: 2 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 4fbe199f14e..9b01c8e2744 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,3 @@ { - "recommendations": ["runem.lit-plugin", "redhat.vscode-yaml"] + "recommendations": ["runem.lit-plugin"] } diff --git a/.vscode/settings.json b/.vscode/settings.json index bf2b3406eb5..e3ed778119b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -31,16 +31,5 @@ }, "typescript.tsdk": "node_modules/typescript/lib", "lit-plugin.strict": true, - "cSpell.words": ["activedescendant", "coachmark", "valuetext"], - "editor.detectIndentation": false, - "[yaml]": { - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.tabSize": 2, - "editor.insertSpaces": true, - "editor.detectIndentation": false - }, - "yaml.format.enable": true, - "yaml.format.singleQuote": false, - "yaml.format.bracketSpacing": true, - "yaml.format.printWidth": 80 + "cSpell.words": ["activedescendant", "coachmark", "valuetext"] } From ab65283aec6f184c09eeb75917e1c46cac533e4a Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Fri, 14 Nov 2025 15:14:17 -0700 Subject: [PATCH 19/21] chore: side nav search url fix --- 1st-gen/projects/documentation/e2e/published.spec.ts | 5 ++--- .../projects/documentation/scripts/build-search-index.js | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/1st-gen/projects/documentation/e2e/published.spec.ts b/1st-gen/projects/documentation/e2e/published.spec.ts index ab0de195a9e..c5acd009d60 100644 --- a/1st-gen/projects/documentation/e2e/published.spec.ts +++ b/1st-gen/projects/documentation/e2e/published.spec.ts @@ -29,8 +29,8 @@ test.describe('search and go', () => { const formattedSearchString = searchString.replace(/\s+/g, '-'); let href = category - ? `/${category}/${formattedSearchString}` - : `/${formattedSearchString}`; + ? `/${category}/${formattedSearchString}/` + : `/${formattedSearchString}/`; // add the SWC_DIR to the href href = `${process.env.SWC_DIR ? `/${process.env.SWC_DIR}/docs/first-gen-docs` : ''}${href}`; @@ -64,7 +64,6 @@ test.describe('search and go', () => { const searchField = await page.getByRole('searchbox', { name: 'Search', }); - await searchField.waitFor(); await expect(searchField, 'Search field should be visible').toBeVisible( { timeout: 10000 } ); diff --git a/1st-gen/projects/documentation/scripts/build-search-index.js b/1st-gen/projects/documentation/scripts/build-search-index.js index b81abda42eb..3e989ece92b 100644 --- a/1st-gen/projects/documentation/scripts/build-search-index.js +++ b/1st-gen/projects/documentation/scripts/build-search-index.js @@ -91,7 +91,7 @@ async function main() { name: title, url: `/${ process.env.SWC_DIR ? `${process.env.SWC_DIR}/` : '' - }components/${componentName}`, + }components/${componentName}/`, }), }); } @@ -120,7 +120,7 @@ async function main() { name: title, url: `/${ process.env.SWC_DIR ? `${process.env.SWC_DIR}/` : '' - }tools/${componentName}`, + }tools/${componentName}/`, }), }); } @@ -154,7 +154,7 @@ async function main() { name: title, url: `/${process.env.SWC_DIR ? `${process.env.SWC_DIR}/` : ''}${ guideDir !== 'content' ? `${guideDir}/` : '' - }${guideName}`, + }${guideName}/`, }), }); } From e98678351339ce7afef194403903303cb0bf1cd6 Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Mon, 17 Nov 2025 09:21:48 -0700 Subject: [PATCH 20/21] chore: fix e2e tests attempt --- .github/workflows/preview-docs.yml | 2 +- 1st-gen/projects/documentation/e2e/published.spec.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 058c2cc4631..58de650f227 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -181,7 +181,7 @@ jobs: echo "Attempt $attempt/$max_attempts: Checking if site is available..." if curl -f -s --max-time 10 "${DOC_URL}" > /dev/null; then - echo "✅ Site is now available!" + echo "✅ ${DOC_URL} is now available!" break else echo "❌ Site not ready yet, waiting 10 seconds..." diff --git a/1st-gen/projects/documentation/e2e/published.spec.ts b/1st-gen/projects/documentation/e2e/published.spec.ts index c5acd009d60..9c5921b2e48 100644 --- a/1st-gen/projects/documentation/e2e/published.spec.ts +++ b/1st-gen/projects/documentation/e2e/published.spec.ts @@ -54,7 +54,6 @@ test.describe('search and go', () => { test.beforeEach(async ({ page }) => { await page.goto(startURL as string); - expect(page, `to have URL ${startURL}`).toHaveURL(/first-gen-docs/); await page.waitForLoadState('networkidle', { timeout: 30000 }); // Wait for any dynamic content to load From 488f1b9eac63c0c75e84192c6fb5bd1728457c92 Mon Sep 17 00:00:00 2001 From: Casey Eickhoff Date: Mon, 17 Nov 2025 09:38:07 -0700 Subject: [PATCH 21/21] chore: missing slashes --- .github/workflows/preview-docs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 58de650f227..eb16abba726 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -131,9 +131,9 @@ jobs: env: PR_HASH: ${{ steps.pr_hash.outputs.hash }} run: | - first_gen_docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-docs" - first_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-storybook" - second_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/second-gen-storybook" + first_gen_docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-docs/" + first_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-storybook/" + second_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/second-gen-storybook/" echo "first_gen_docs_url=${first_gen_docs_url}" >> "$GITHUB_OUTPUT" echo "first_gen_storybook_url=${first_gen_storybook_url}" >> "$GITHUB_OUTPUT"