Lands the P4 frontend MVP plus 9 follow-up polish batches (88 commits squashed). * Pipeline Context, Prompt Assembler, Debug Viewer widgets * PIPELINE_CONTEXT chain crosses subgraph boundaries * Conflict badges on SubgraphNodes containing WP nodes * Empty-state hero, soft-delete + Undo toasts, corrupt-workflow recovery * Bundled Inter + JetBrains Mono variable fonts, brand identity end-to-end * Settings panel: Reduce motion + Contrast (a11y) with live updates * DX: coverage gate, stricter ESLint, pre-commit pnpm size, PR size-delta workflow, contract doc Closes the polish-brainstorm spec.
78 lines
2.7 KiB
YAML
78 lines
2.7 KiB
YAML
name: Bundle size delta
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "src/**"
|
|
- "package.json"
|
|
- "pnpm-lock.yaml"
|
|
- "vite.config.*"
|
|
- "scripts/check-bundle-size.mjs"
|
|
- ".github/workflows/bundle-size-pr.yml"
|
|
|
|
# Compute the gzip-bundle-size delta between the PR head and the base branch
|
|
# and post it as a single sticky comment on the pull request. Lets reviewers
|
|
# spot regressions ("did this 5 KB ship intentionally?") without digging
|
|
# through CI logs.
|
|
env:
|
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
|
|
|
jobs:
|
|
size-delta:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
# Setting permissions: explicitly REMOVES default scopes — must list
|
|
# contents: read so actions/checkout can fetch the repo, otherwise
|
|
# the runner gets "Repository not found" with a 404.
|
|
contents: read
|
|
pull-requests: write
|
|
steps:
|
|
- name: Checkout PR head
|
|
uses: actions/checkout@v5
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
path: head
|
|
- name: Checkout base
|
|
uses: actions/checkout@v5
|
|
with:
|
|
ref: ${{ github.event.pull_request.base.sha }}
|
|
path: base
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
# Explicit version because both checkouts land in subdirs
|
|
# (head/, base/) so there's no package.json at the runner's CWD
|
|
# root for the action to autodetect "packageManager" from.
|
|
version: 9
|
|
- uses: actions/setup-node@v5
|
|
with:
|
|
node-version: "22"
|
|
cache: pnpm
|
|
cache-dependency-path: head/pnpm-lock.yaml
|
|
- name: Build + measure HEAD
|
|
working-directory: head
|
|
run: |
|
|
pnpm install --frozen-lockfile
|
|
pnpm build:extension
|
|
node scripts/check-bundle-size.mjs --json ../sizes/head.json
|
|
- name: Build + measure BASE
|
|
working-directory: base
|
|
run: |
|
|
pnpm install --frozen-lockfile
|
|
pnpm build:extension
|
|
# The size script resolves ../js relative to its own file URL,
|
|
# so we overwrite base/scripts/check-bundle-size.mjs with the head
|
|
# version to guarantee the JSON manifest format matches what
|
|
# bundle-size-diff expects, while keeping the relative-path read.
|
|
mkdir -p scripts
|
|
cp ../head/scripts/check-bundle-size.mjs scripts/check-bundle-size.mjs
|
|
node scripts/check-bundle-size.mjs --json ../sizes/base.json
|
|
continue-on-error: true
|
|
- name: Diff manifests
|
|
run: node head/scripts/bundle-size-diff.mjs sizes/base.json sizes/head.json > report.md
|
|
- name: Upsert PR comment
|
|
uses: marocchino/sticky-pull-request-comment@v2
|
|
with:
|
|
header: bundle-size
|
|
path: report.md
|