Skip to content

Make Conformance's build script prepare Core first - #227

Open
cratis-stagehand[bot] wants to merge 1 commit into
mainfrom
fix/conformance-build-prepares-core
Open

Make Conformance's build script prepare Core first#227
cratis-stagehand[bot] wants to merge 1 commit into
mainfrom
fix/conformance-build-prepares-core

Conversation

@cratis-stagehand

Copy link
Copy Markdown

Summary

  • Investigated the failing Publish workflow run (https://github.com/Cratis/Components/actions/runs/33336669545). The release job's "release for 'v4.0.0' already exists - skipping" annotation is benign - it's the intended manual-recovery path added in Fix Components 4 publish recovery #224, and publish-npm-packages still ran. The actual failure was a TypeScript build error: Conformance/src/internal/metadata.ts couldn't resolve @cratis/components/schemas/ui-adapter.schema.json.
  • Root cause: that subpath is only produced by Source's prepare script (tsc -b && rollup -c && copy-css.sh). Source's own build script (used by the root yarn build that the Publish workflow's "Publish NPM packages" step runs across every workspace) only runs tsc -p tsconfig.json, which never invokes copy-css.sh - so the schema asset never lands in dist/esm/schemas before Conformance's own build tries to import it.
  • By the time I got to this, Prepare Core before publishing Components #226 had already merged and fixed the immediate workflow failure by adding yarn workspace @cratis/components prepare before yarn build in publish.yml - I confirmed run 33336889665 published cleanly afterward.
  • This PR closes the same gap at its source instead of only at the one call site: Conformance's own build script now runs its existing prepare-core script (yarn workspace @cratis/components prepare) first, exactly like its typecheck-specs script already does. Without this, yarn workspace @cratis/components.conformance build still fails with the same TS2307 error whenever it's invoked without a prior full Source build (locally, or from any future workflow/task that doesn't happen to prepare Core first).

Related to #225.

Test plan

  • Reproduced the original failure locally: removed Source/dist and Conformance/dist, ran the exact tsc invocations from Source/package.json's build script followed by Conformance/package.json's build script - got the same TS2307: Cannot find module '@cratis/components/schemas/ui-adapter.schema.json' error.
  • Applied the fix and re-ran node run-task-on-workspaces.js build end-to-end (the same task the Publish workflow's "Publish NPM packages" step runs) from a clean dist state - all workspaces built successfully, including Conformance.
  • yarn test in Conformance - 20/20 tests passed.
  • eslint in Conformance - zero errors.

Conformance/src/internal/metadata.ts imports the JSON schema asset that
Source/scripts/copy-css.sh copies into dist/esm/schemas - an artifact
Source's own abbreviated "build" script (tsc only) never produces, only
"prepare" (tsc -b + rollup + copy-css) does. Conformance's own "build"
script called plain tsc directly without preparing Core first, so any
caller of `yarn workspace @cratis/components.conformance build` without
a prior full Source build fails with TS2307. This is exactly what broke
the Publish workflow in run 33336669545, since its "yarn build" step
runs every workspace's plain "build" script in sequence.

publish.yml has since been patched (PR #226) to run
`yarn workspace @cratis/components prepare` before `yarn build`, which
already fixes that workflow. This closes the same gap at its source so
Conformance's own "build" script is self-sufficient regardless of the
caller, matching the "prepare-core" pattern already used by its
"typecheck-specs" script.
@cratis-stagehand cratis-stagehand Bot added the no-release Merging publishes no package, image, release, or deployment label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-release Merging publishes no package, image, release, or deployment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants