fix(release): make publish-time build work under prod-only install#1056
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
|
8edd594 to
0798e44
Compare
0798e44 to
ec5e40d
Compare
ec5e40d to
15a14d5
Compare
15a14d5 to
b3484b2
Compare
b3484b2 to
f48e865
Compare
Contributor
Author
|
@clud-bot please review |
f48e865 to
2f83173
Compare
2f83173 to
2bcc2d1
Compare
The new release flow's `pnpm install --filter <pkg>... --prod` install
broke for every workspace package that uses the standard `tsc --noEmit
&& tsdown` build script. Three independent root causes, all surfacing
at the Build step before reaching pnpm publish; verified locally for
@mysten/{sui,ledger-signer,walrus,docs,dapp-kit-core,dapp-kit-react,
enoki,seal,signers,aws-kms-signer,gcp-kms-signer,webcrypto-signer}.
(1) Workspace peer deps weren't being auto-installed under --prod.
21 packages declare @mysten/sui (and a few others) as both peerDep AND
devDep — the duplication satisfied dev installs while autoInstallPeers
was set to false in pnpm-workspace.yaml. Under --prod, the devDep entry
took precedence and was excluded, leaving sui unresolvable at build
time. Flipped autoInstallPeers: false -> true and dropped the
peer+devDep duplications across 22 package.jsons. Workspace peers now
auto-install under --prod, dev installs still get sui via the same
mechanism, and devDeps stay out of the release runner.
(2) packages/wallet-{sdk,standard} declared @mysten/sui as `*` in
peerDependencies. Wildcard ranges aren't satisfied by workspace
resolution, so pnpm pulled the npm-published @mysten/sui@2.16.0
alongside the workspace one — two distinct `Transaction` types caused
TS2322 errors throughout the dapp-kit / walrus chain. Switched to
`workspace:^` (resolves to ^<version> at publish), also a real
improvement vs. accepting any sui version.
(3) Source trees included build-time devDep imports the prod install
can't satisfy:
- packages/sui/src/transactions/__tests__/{Transaction,bcs}.test.ts
moved to test/unit/transactions/ (vitest is a workspace devDep).
- packages/dapp-kit-core/src/web/*.stories.ts moved to stories/
(@storybook/web-components is a workspace devDep). Updated
.storybook/main.ts glob, added stories/tsconfig.json mirroring
the test/ pattern, and chained the new project into test:typecheck
via `tsc -b ./test ./stories` so stories keep getting typechecked
outside the publish build. Verified `storybook build` and
`test:typecheck` both still pass.
- packages/docs/scripts/build-docs.ts dropped its `npx prettier`
post-processing — pure formatting of generated LLM markdown that
didn't need it, and prettier isn't in the prod install.
Also, in the release template:
- Added @types/semver to the tools list of release-{ledger-signer,
signers,ledgerjs-hw-app-sui}.yml. semver itself is a runtime dep;
only the types are devDep-only and tsc --noEmit needs them.
- Moved the artifact-slug step from after Build to after Checkout.
Previously, when Build failed, the always() artifact upload used
an empty slug and produced the invalid `name: tarball-`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2bcc2d1 to
13d7d5a
Compare
Contributor
Author
|
@clud-bot check again |
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.
Description
The new release flow's
pnpm install --filter <pkg>... --prodinstall broke for every workspace package that uses the standardtsc --noEmit && tsdownbuild script. When the orchestrator dispatchedrelease-<pkg>.ymlworkflows after #1049 merged, all 9 dispatches failed at the Build step. Three independent root causes, all surfacing beforepnpm publishwas reached, so nothing actually published.Root causes + fixes
1. Workspace peer deps weren't being auto-installed under
--prod21 packages declare
@mysten/suias bothpeerDependenciesANDdevDependencies. The duplication satisfied dev installs whileautoInstallPeers: falsewas set inpnpm-workspace.yaml. Under--prod, the devDep entry took precedence and was excluded, leaving sui unresolvable at build time:Fix: Flipped
autoInstallPeers: false → trueand dropped the redundant peer+devDep duplications across 22 package.jsons. Workspace peers now auto-install under--prod, dev installs still get sui via the same mechanism, and devDeps stay out of the release runner (the original supply-chain hygiene goal stays intact).2.
wallet-sdk/wallet-standardpeer specifier was*Wildcard ranges aren't satisfied by workspace resolution, so pnpm pulled npm-published
@mysten/sui@2.16.0alongside the workspace copy — two distinctTransactiontypes caused TS2322 errors throughout the dapp-kit / walrus chain.Fix: Switched both to
workspace:^. Resolves to^<version>at publish time — also a real improvement vs.*, which let consumers ship arbitrarily-old sui.3. Source trees included build-time devDep imports
packages/sui/src/transactions/__tests__/{Transaction,bcs}.test.ts→ moved totest/unit/transactions/. The build'stsc --noEmitwas trying to typecheck these againstvitest(a workspace devDep, not in--prod).packages/dapp-kit-core/src/web/*.stories.ts→ moved tostories/at the package root. The build was pulling in@storybook/web-components(workspace devDep). Updated.storybook/main.tsglob, addedstories/tsconfig.jsonmirroring the existingtest/layout, and chained the new project intotest:typecheckviatsc -b ./test ./storiesso stories keep getting typechecked outside the publish build. Verifiedstorybook buildstill works.packages/docs/scripts/build-docs.tsdropped itsnpx prettier --writepost-processing — formatting of generated LLM markdown that the published artifact didn't need, and prettier wasn't in the prod install.Template fixes
@types/semverto thetools:list forrelease-{ledger-signer,signers,ledgerjs-hw-app-sui}.yml.semveritself is a runtime dep already; only the types are devDep-only andtsc --noEmitneeds them.Buildto right afterCheckout. Previously, when Build failed, thealways()artifact upload used an empty slug and produced the invalidname: tarball-.Verification
Reproduced the CI flow locally for each failure mode (
pnpm install --filter <pkg>... --prod --frozen-lockfile --ignore-scripts+ sandboxed tools install + build). All pass:@mysten/sui@mysten/ledger-signer@mysten/walrus@mysten/docs@mysten/dapp-kit-core@mysten/dapp-kit-react@mysten/enoki,@mysten/seal,@mysten/signers,@mysten/{aws,gcp,webcrypto}-kms-signerAlso verified
pnpm --filter @mysten/dapp-kit-core run test:typecheck(nowtsc -b ./test ./stories) andstorybook buildboth pass.Test plan
storybook buildsucceeds with stories in new locationtest:typecheckcovers both test/ and stories/pnpm publish --dry-runAI Assistance Notice