ci: ship core's dist to the PR visual gate - #5481
Conversation
Importing a built theme runs its import of @astryxdesign/core/theme, which pnpm resolves through the workspace link into packages/core/dist — absent on the gate's runner, so every component PR died on ERR_MODULE_NOT_FOUND for packages/themes/butter/node_modules/@astryxdesign/core/dist/theme/index.js. build-storybook has already built core, so the existing artifact carries its dist too rather than pr-visual paying for a build.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
e19a16d to
0d891d3
Compare
|
Proof this fixes it, since a CI-only fix cannot be proven locally: this branch pr-visual on 6bd4892 — success, {"status": "pass", "components": ["Spinner"],
"counts": {"total": 8, "unchanged": 2, "changed": 0, "added": 6, "failed": 0}}Eight shots taken and compared — the |
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Problem
Every PR that touches a component gets a red
pr-visual, outside contributors'included — #5466,
#5462,
#5468,
#5018. The job crashes before it
shoots anything:
Root cause:
@astryxdesign/coreis not built when the gate runs. A builttheme is not self-contained —
dist/source.mjskeepsimport {defineTheme} from '@astryxdesign/core/theme'as an external, soloadThemeOverridesimporting it executes that import, pnpm resolves it throughthe workspace link, and core's
exportsmap sends it topackages/core/dist/theme/index.js.#5477 ships
packages/themes/*/dist/and nothing else, andpr-visualnever builds, sothat file is absent.
The other two candidates are both ruled out, not assumed:
pnpm install --frozen-lockfilein the jobrestores
packages/themes/butter/node_modules/@astryxdesign/core→../../../../core;Node resolved through it, which is why the error names a file inside the
package rather than "Cannot find package".
"./theme"maps to./dist/theme/index.js. Ablocked subpath would be
ERR_PACKAGE_PATH_NOT_EXPORTED, not a missing file.Solution
distfrombuild-storybook, which has already built it, ratherthan adding a build step to
pr-visual— #5477'sreasoning, unchanged.
the artifact roots at their common ancestor
packages/and the downloadunpacks there. Renamed
themes-<hash>→dists-<hash>because it is no longeronly themes.
Impact
Every component PR in the repo, including outside contributors'.
pr-visualiscontinue-on-error, so this was never blocking a merge — it was showing everycontributor a red check they could do nothing about.
API
None. Workflow-only.
Theme targets
None.
Breaking
None. The artifact is internal to one workflow run and consumed only by
pr-visual.Performance & resources
One artifact, ~14 MB / ~1600 files larger; no extra job, no extra build.
Building core inside
pr-visualinstead would cost minutes of every componentPR's CI.
Visual evidence
None — this is CI plumbing, no pixels change.
Testing
pnpm install --frozen-lockfile, themes'dist/copied in and nothing else(the state #5477 leaves) →
same
ERR_MODULE_NOT_FOUNDon the same path. Droppingpackages/core/dist/in and changing nothing else → all eight themes import and yield their
component maps (
butter21 targets,probe268, …), andgate.mjs plangets past theme loading to the Storybook index it downloadsin CI.
pr-visualby design(
check-componentsfinds no component change), so this branch carried athrowaway commit touching
Spinner.tsxto arm it. That commit is droppedbefore merge; the run it produced is linked in the comments.