Make Conformance's build script prepare Core first - #227
Open
cratis-stagehand[bot] wants to merge 1 commit into
Open
Make Conformance's build script prepare Core first#227cratis-stagehand[bot] wants to merge 1 commit into
cratis-stagehand[bot] wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
releasejob'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, andpublish-npm-packagesstill ran. The actual failure was a TypeScript build error:Conformance/src/internal/metadata.tscouldn't resolve@cratis/components/schemas/ui-adapter.schema.json.preparescript (tsc -b && rollup -c && copy-css.sh). Source's ownbuildscript (used by the rootyarn buildthat the Publish workflow's "Publish NPM packages" step runs across every workspace) only runstsc -p tsconfig.json, which never invokescopy-css.sh- so the schema asset never lands indist/esm/schemasbefore Conformance's own build tries to import it.yarn workspace @cratis/components preparebeforeyarn buildinpublish.yml- I confirmed run 33336889665 published cleanly afterward.buildscript now runs its existingprepare-corescript (yarn workspace @cratis/components prepare) first, exactly like itstypecheck-specsscript already does. Without this,yarn workspace @cratis/components.conformance buildstill fails with the sameTS2307error 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
Source/distandConformance/dist, ran the exacttscinvocations fromSource/package.json'sbuildscript followed byConformance/package.json'sbuildscript - got the sameTS2307: Cannot find module '@cratis/components/schemas/ui-adapter.schema.json'error.node run-task-on-workspaces.js buildend-to-end (the same task the Publish workflow's "Publish NPM packages" step runs) from a cleandiststate - all workspaces built successfully, including Conformance.yarn testinConformance- 20/20 tests passed.eslintinConformance- zero errors.