Publish @scality/breakbeat to npm and GitHub Packages - #12
Conversation
Registries need the package scoped, and it has to carry its own compiled output rather than compiling on the consumer -- which is why typescript was a runtime dependency, so a compiler would be around wherever it landed. Ship only lib/, built at pack time. Declarations were never emitted, so TypeScript consumers have been resolving types from the raw sources a git install happens to include. Those no longer ship, so emit them properly. Breaking for consumers: backbeat and scuba have to move their dependency key and every require/import over to the scoped name. Issue: BREAK-12
Dispatched manually with the tag to release, which is checked against the version in package.json before anything is built, so the two cannot drift apart. Refuses to run outside development/* and hotfix/*, and to reuse an existing tag or release. Both publish jobs are idempotent, so a failed run can just be dispatched again once whatever broke is fixed. Issue: BREAK-12
Hello francoisferrand,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
|
The PR description + commit says 1.1, but the pr targets 1.0 |
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: 'Tag to be pushed to registry' |
There was a problem hiding this comment.
Don't we have a setup on other repo where we don't even have to pass the tag now ?
There was a problem hiding this comment.
the problem is package.json is sometimes not updated - especially in packages which are seldom modified; so I'd rather keep it this way, and change everywhere once we have a safer way to handle it (like, not coming the version in package.json :-) )
ee79b3b to
fbeb074
Compare
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
|
/approve |
|
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue BREAK-12. Goodbye francoisferrand. The following options are set: approve |
breakbeat is installed straight from a git ref today, so it compiles on every consumer install. That is why typescript sits in
dependencies: a compiler has to be present wherever the package lands, which means shipping one into every consumer's production image. Publishing a built artifact removes the whole arrangement — and with it a class of install-time breakage we keep hitting on newer Node.Same setup as Arsenal (ARSN-605): scoped name,
files: ["lib"], build at pack time, and a release workflow dispatched by hand with the tag to publish.Breaking for consumers
The package is now
@scality/breakbeat, so backbeat and scuba have to move their dependency key and everyrequire/importover to the scoped name — roughly 13 call sites, and backbeat carries the dependency on 9 development branches. Follow-up tickets needed; nothing here works for them until that happens. scuba is the one to do first: it imports in TypeScript, so it exercises the type resolution.That is also why this is 1.1.0 rather than 1.0.4 — a patch number would say "no action needed" while requiring every consumer to be edited. If you would rather land the publishing setup on
development/1.0and decide the version separately, dropping the last commit does exactly that: the workflow refuses to release at 1.0.3 because that tag already exists, so nothing can go out by accident.declaration: trueWorth flagging, because it is easy to read as tidy-up. Declarations were never emitted — scuba's imports resolve types from the raw
.tssources that a git install happens to include. Those stop shipping withfiles: ["lib"], so without this the published package would break scuba's build while the diff looked fine.Before the first release
@scality/breakbeatdoes not exist on npmjs yet, and npm will not let you configure a trusted publisher for a package that has never been published. The npm job authenticates over OIDC with no token, so the first dispatch will fail on auth until someone publishes one version by hand and sets the trusted publisher up. Noted in the workflow next to the publish step.If it is dispatched before that, it fails safely: no tag and no release are created, GitHub Packages has already succeeded, and re-dispatching afterwards skips what is already published.
Verified
Packed the tarball and installed it into a clean consumer: no typescript and no
tscanywhere in the tree,requireworks, and a TypeScript consumer typechecks against the shipped declarations — including under TS 4.8.3, which is the oldest compiler among the consumers, withskipLibCheck: false. Deleting the.d.tsfrom the tarball reproduces the failure, so the check means something. Git-ref installs still build, so consumers will not break mid-migration.Issue: BREAK-12