Skip to content

fix(release): make publish-time build work under prod-only install#1056

Merged
hayes-mysten merged 1 commit into
mainfrom
mh/release-flow-build-fixes
May 8, 2026
Merged

fix(release): make publish-time build work under prod-only install#1056
hayes-mysten merged 1 commit into
mainfrom
mh/release-flow-build-fixes

Conversation

@hayes-mysten
Copy link
Copy Markdown
Contributor

Description

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. When the orchestrator dispatched release-<pkg>.yml workflows after #1049 merged, all 9 dispatches failed at the Build step. Three independent root causes, all surfacing before pnpm publish was reached, so nothing actually published.

Root causes + fixes

1. Workspace peer deps weren't being auto-installed under --prod

21 packages declare @mysten/sui as both peerDependencies AND devDependencies. The duplication satisfied dev installs while autoInstallPeers: false was set in pnpm-workspace.yaml. Under --prod, the devDep entry took precedence and was excluded, leaving sui unresolvable at build time:

src/objects.ts(4,34): error TS2307: Cannot find module '@mysten/sui/transactions'

Fix: Flipped autoInstallPeers: false → true and 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-standard peer specifier was *

Wildcard ranges aren't satisfied by workspace resolution, so pnpm pulled npm-published @mysten/sui@2.16.0 alongside the workspace copy — two distinct Transaction types 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 to test/unit/transactions/. The build's tsc --noEmit was trying to typecheck these against vitest (a workspace devDep, not in --prod).
  • packages/dapp-kit-core/src/web/*.stories.ts → moved to stories/ at the package root. The build was pulling in @storybook/web-components (workspace devDep). Updated .storybook/main.ts glob, added stories/tsconfig.json mirroring the existing test/ layout, 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 still works.
  • packages/docs/scripts/build-docs.ts dropped its npx prettier --write post-processing — formatting of generated LLM markdown that the published artifact didn't need, and prettier wasn't in the prod install.

Template fixes

  • Added @types/semver to the tools: list for release-{ledger-signer,signers,ledgerjs-hw-app-sui}.yml. semver itself is a runtime dep already; only the types are devDep-only and tsc --noEmit needs them.
  • Moved the artifact-slug step from after Build to right after Checkout. Previously, when Build failed, the always() artifact upload used an empty slug and produced the invalid name: 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:

Package Was failing on Now
@mysten/sui tests in src/
@mysten/ledger-signer sui peer + @types/semver
@mysten/walrus dapp-kit chain + dual sui
@mysten/docs prettier missing
@mysten/dapp-kit-core storybook stories
@mysten/dapp-kit-react sui peer
@mysten/enoki, @mysten/seal, @mysten/signers, @mysten/{aws,gcp,webcrypto}-kms-signer sui peer

Also verified pnpm --filter @mysten/dapp-kit-core run test:typecheck (now tsc -b ./test ./stories) and storybook build both pass.

Test plan

  • Local: reproduce CI flow with prod-only install + tools sandbox for 12 packages
  • storybook build succeeds with stories in new location
  • test:typecheck covers both test/ and stories/
  • Reviewer to validate: orchestrator dispatch on the merged main runs all per-package release workflows in dry-run mode and they pass through to pnpm publish --dry-run

AI Assistance Notice

Please disclose the usage of AI. This is primarily to help inform reviewers of how careful they need to review PRs, and to keep track of AI usage across our team. Please fill this out accurately, and do not modify the content or heading for this section!

  • This PR was primarily written by AI.
  • I used AI for docs / tests, but manually wrote the source code.
  • I used AI to understand the problem space / repository.
  • I did not use AI for this PR.

@hayes-mysten hayes-mysten requested review from a team as code owners May 8, 2026 04:18
@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-typescript-docs Ready Ready Preview, Comment May 8, 2026 4:54am

Request Review

@hayes-mysten hayes-mysten had a problem deploying to sui-typescript-aws-kms-test-env May 8, 2026 04:18 — with GitHub Actions Failure
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

⚠️ 🦋 Changesets Warning: This PR has changes to public npm packages, but does not contain a changeset. You can create a changeset easily by running pnpm changeset in the root of the Sui repo, and following the prompts. If your change does not need a changeset (e.g. a documentation-only change), you can ignore this message. This warning will be removed when a changeset is added to this pull request.

Learn more about Changesets.

@hayes-mysten hayes-mysten force-pushed the mh/release-flow-build-fixes branch from 8edd594 to 0798e44 Compare May 8, 2026 04:27
@hayes-mysten hayes-mysten had a problem deploying to sui-typescript-aws-kms-test-env May 8, 2026 04:28 — with GitHub Actions Failure
@hayes-mysten hayes-mysten force-pushed the mh/release-flow-build-fixes branch from 0798e44 to ec5e40d Compare May 8, 2026 04:28
@hayes-mysten hayes-mysten had a problem deploying to sui-typescript-aws-kms-test-env May 8, 2026 04:28 — with GitHub Actions Failure
@hayes-mysten hayes-mysten force-pushed the mh/release-flow-build-fixes branch from ec5e40d to 15a14d5 Compare May 8, 2026 04:30
@hayes-mysten hayes-mysten had a problem deploying to sui-typescript-aws-kms-test-env May 8, 2026 04:30 — with GitHub Actions Failure
@hayes-mysten hayes-mysten force-pushed the mh/release-flow-build-fixes branch from 15a14d5 to b3484b2 Compare May 8, 2026 04:33
@hayes-mysten hayes-mysten had a problem deploying to sui-typescript-aws-kms-test-env May 8, 2026 04:33 — with GitHub Actions Failure
@hayes-mysten hayes-mysten force-pushed the mh/release-flow-build-fixes branch from b3484b2 to f48e865 Compare May 8, 2026 04:36
@hayes-mysten hayes-mysten temporarily deployed to sui-typescript-aws-kms-test-env May 8, 2026 04:37 — with GitHub Actions Inactive
@hayes-mysten
Copy link
Copy Markdown
Contributor Author

@clud-bot please review

@hayes-mysten hayes-mysten force-pushed the mh/release-flow-build-fixes branch from f48e865 to 2f83173 Compare May 8, 2026 04:47
@hayes-mysten hayes-mysten temporarily deployed to sui-typescript-aws-kms-test-env May 8, 2026 04:47 — with GitHub Actions Inactive
@hayes-mysten hayes-mysten force-pushed the mh/release-flow-build-fixes branch from 2f83173 to 2bcc2d1 Compare May 8, 2026 04:49
@hayes-mysten hayes-mysten temporarily deployed to sui-typescript-aws-kms-test-env May 8, 2026 04:49 — with GitHub Actions Inactive
Copy link
Copy Markdown
Contributor

@clud-bot clud-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one release-blocking issue in the zksend prod-only build path.

Comment thread packages/zksend/package.json
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>
@hayes-mysten hayes-mysten force-pushed the mh/release-flow-build-fixes branch from 2bcc2d1 to 13d7d5a Compare May 8, 2026 04:53
@hayes-mysten hayes-mysten temporarily deployed to sui-typescript-aws-kms-test-env May 8, 2026 04:53 — with GitHub Actions Inactive
@hayes-mysten
Copy link
Copy Markdown
Contributor Author

@clud-bot check again

Copy link
Copy Markdown
Contributor

@clud-bot clud-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous zksend prod-only build issue is fixed. I reproduced the zksend release build path and resolved the old thread; no further blocking findings.

@hayes-mysten hayes-mysten merged commit 732d07f into main May 8, 2026
9 checks passed
@hayes-mysten hayes-mysten deleted the mh/release-flow-build-fixes branch May 8, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant