Add CI and publishing workflows to v2 - #112
Open
dcruzb wants to merge 2 commits into
Open
Conversation
v2 had no .github directory, so nothing type-checked it, nothing tested it, and it had no path to npm. These mirror the v1 workflows, adapted: - check.yml points tsc at tsconfig.app.json, because tsconfig.json is a solution file with "files": [] and would check nothing, and it runs vitest, which v1 has no equivalent for. - deploy.yml keeps LATEST_MAJOR at 1, so a 2.x tag publishes under the v2-latest dist-tag and no existing consumer is upgraded into the rewrite by installing @cincoders/cinnamon. It also checks the tagged commit against v2 rather than main, since the branches share no history. - build-storybook.yml builds without deploying. GitHub Pages serves one site per repository and main already publishes v1's Storybook there. package.json carried the repository URL as github.com/cincoders/cinnamon. Publishing with --provenance compares that against the repository in the signed attestation, case sensitively, and GitHub reports CinCoders. The 1.5.0 release failed on exactly this and v2 would have hit it too.
The Page story declared footerCopyrightText with a type, a control and a default, and passed it to Footer as copyrightText. FooterProps has no such property and nothing else in the tree mentions copyright, so the whole argument was inert: a leftover from the v1 Footer API. Nothing caught it because v2 had no type check. Vite compiles without checking types, so the story built and rendered while the prop was silently discarded.
|
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.



v2 had no
.githubdirectory at all: nothing type-checked it, nothing ran its tests, and it had no path to npm. This is the only thing standing between v2 and being publishable asv2-latest.The three workflows
check.yml— mirrors v1's, with two differences. It pointstscattsconfig.app.json, becausetsconfig.jsonis a solution file with"files": []and checking it would check nothing. And it runsvitest, which v1 has no equivalent for.deploy.yml— publishes on aversion/v*tag through OIDC trusted publishing with--provenance. Two adaptations matter:LATEST_MAJORstays at1, so a2.xtag publishes under thev2-latestdist-tag. Nobody runningnpm i @cincoders/cinnamonis upgraded into the rewrite until you change that value on both branches.v2, notmain. The branches share no history, so the v1 version of this check would reject every v2 tag.build-storybook.yml— builds without deploying. GitHub Pages serves one site per repository and the workflow onmainalready publishes v1's Storybook there; if this branch deployed too, whichever ran last would replace the other. The comment in the file says what to change when v2 becomes the mainline.One fix that is not CI
package.jsonhadrepository.urlasgithub.com/cincoders/cinnamon, lowercase. Publishing with--provenancemakes npm compare that against the repository recorded in the signed attestation, case sensitively, and GitHub reportsCinCoders. The 1.5.0 release failed on exactly this with a 422 after the tarball had already been built and signed. v2 would have hit the same wall on its first publish.Already configured on the repository
The npm trusted publisher is registered for
CinCoders/cinnamon/deploy.yml/ environmentnpm-publish. Since it matches on the workflow filename and not the branch, this file reuses that registration — no second setup needed. Thenpm-publishenvironment requires a reviewer before any publish runs.Worth a look, not changed here
package.jsondefines"prepublishonly". npm's lifecycle hook isprepublishOnly, camel-cased, so this script never runs automatically. It does not affect this workflow, which builds explicitly before publishing, but it would silently do nothing for anyone publishing by hand. Left alone since it is your build config.