Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 89 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,107 @@ name: build
on:
pull_request:
branches: [main]
push:
branches: [visill-migration]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.10.0
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '24'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Activate CI install recipe
# pnpm.overrides link: paths only exist on a developer laptop with the
# visill repo checked out as a sibling. CI installs the published RC
# by stripping the overrides block. See .npmrc.ci for details.
run: |
cp .npmrc.ci .npmrc
jq 'del(.pnpm)' package.json > package.json.tmp && mv package.json.tmp package.json
- run: pnpm install --no-frozen-lockfile
- run: pnpm format:check
- run: pnpm lint
- run: pnpm type-check
- run: pnpm build
- run: pnpm test

parity-check:
# Compares the migration-branch zip against the prior main SHA's zip
# to enforce the five parity gates from PRD 007 §6.
if: github.ref == 'refs/heads/visill-migration' || github.head_ref == 'visill-migration'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout migration branch
uses: actions/checkout@v4
with:
path: migration
fetch-depth: 0

- name: Resolve prior main SHA
id: prior-main
working-directory: migration
run: |
git fetch origin main --depth=1
PRIOR_MAIN_SHA=$(git merge-base origin/main HEAD)
echo "sha=${PRIOR_MAIN_SHA}" >> "$GITHUB_OUTPUT"
echo "Prior main SHA: ${PRIOR_MAIN_SHA}"

- name: Checkout prior main
uses: actions/checkout@v4
with:
path: prior-main
ref: ${{ steps.prior-main.outputs.sha }}

- uses: pnpm/action-setup@v4
with:
version: 10.10.0
- uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'pnpm'
cache-dependency-path: migration/pnpm-lock.yaml

- name: Build migration-branch zip
working-directory: migration
run: |
cp .npmrc.ci .npmrc
# Strip pnpm.overrides via jq; the .npmrc.ci documented node -e snippet
# uses require() which breaks under "type": "module".
jq 'del(.pnpm)' package.json > package.json.tmp && mv package.json.tmp package.json
pnpm install --no-frozen-lockfile
pnpm build:zip

- name: Build prior-main zip
working-directory: prior-main
run: |
# Prior main predates the @visill/* migration, so it installs as-is
# with the lockfile committed at that SHA.
pnpm install --frozen-lockfile
pnpm build:zip

- name: Run parity gates
env:
STRUCTURAL_DIFF_SCRIPT: ${{ github.workspace }}/migration/node_modules/@visill/test/scripts/structural-html-diff.mjs
run: |
bash migration/scripts/parity-check.sh \
migration/targetable-feedback.zip \
prior-main/targetable-feedback.zip

- name: Upload parity report
if: always()
uses: actions/upload-artifact@v4
with:
name: parity-report
path: parity-report.json
if-no-files-found: ignore
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules/
.claude/
dist/
.husky/_/
parity-report.json
18 changes: 18 additions & 0 deletions .npmrc.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# CI-only npmrc. Activated by .github/workflows/build.yml before `pnpm install`
# so CI resolves the published @visill/* rc tarballs from npm instead of the
# `link:../visill/packages/*` paths declared in package.json's `pnpm.overrides`
# block (those paths only exist on a developer laptop with the visill repo
# checked out as a sibling).
#
# pnpm 10.x exposes no built-in flag or env var to skip `pnpm.overrides`
# (verified against https://pnpm.io/settings, https://pnpm.io/npmrc, and
# https://pnpm.io/cli/install). The workflow therefore strips the block from
# package.json before install. Because that mutation invalidates the committed
# pnpm-lock.yaml (which encodes the link: resolutions), we disable the frozen
# lockfile here so pnpm can re-resolve against the registry.
#
# How T16's build.yml is expected to apply this file:
# - run: cp .npmrc.ci .npmrc
# - run: node -e "const fs=require('fs');const p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.pnpm;fs.writeFileSync('package.json',JSON.stringify(p,null,2)+'\n')"
# - run: pnpm install --no-frozen-lockfile
prefer-frozen-lockfile=false
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.4.2",
"type": "module",
"engines": {
"node": ">=20.0.0"
"node": ">=24.0.0"
},
"scripts": {
"build": "vite build",
Expand All @@ -26,7 +26,10 @@
},
"devDependencies": {
"@types/jsdom": "^21.1.0",
"@types/node": "^20.0.0",
"@types/node": "^24.0.0",
"@visill/build": "rc",
"@visill/sdk": "rc",
"@visill/test": "rc",
"husky": "^9.1.0",
"jsdom": "^25.0.0",
"lightningcss": "^1.32.0",
Expand All @@ -40,5 +43,12 @@
"vite-plugin-singlefile": "~2.3.3",
"vitest": "^2.1.0"
},
"packageManager": "pnpm@10.10.0"
"packageManager": "pnpm@10.10.0",
"pnpm": {
"overrides": {
"@visill/sdk": "link:../visill/packages/visill",
"@visill/build": "link:../visill/packages/visill-build",
"@visill/test": "link:../visill/packages/visill-test"
}
}
}
72 changes: 43 additions & 29 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading