Skip to content

Commit 13d7d5a

Browse files
hayes-mystenclaude
andcommitted
fix(release): make publish-time build work under prod-only install
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>
1 parent 7429f15 commit 13d7d5a

42 files changed

Lines changed: 254 additions & 317 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/_release-package.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@ jobs:
7272
with:
7373
ref: ${{ inputs.ref }}
7474

75+
- name: Compute artifact-safe package slug
76+
id: slug
77+
env:
78+
PACKAGE: ${{ inputs.package }}
79+
run: |
80+
set -euo pipefail
81+
# actions/upload-artifact rejects '/' (and quietly mangles '@'),
82+
# so '@mysten/sui' → 'mysten-sui'. Computed up front (not after Build)
83+
# so the always() artifact upload still gets a valid name when Build
84+
# fails — otherwise `name: tarball-` is produced and rejected.
85+
slug="${PACKAGE#@}"
86+
slug="${slug//\//-}"
87+
echo "slug=$slug" >> "$GITHUB_OUTPUT"
88+
7589
- name: Set up pnpm
7690
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
7791

@@ -150,18 +164,6 @@ jobs:
150164
pnpm --filter "${PACKAGE}..." --if-present run build
151165
fi
152166
153-
- name: Compute artifact-safe package slug
154-
id: slug
155-
env:
156-
PACKAGE: ${{ inputs.package }}
157-
run: |
158-
set -euo pipefail
159-
# actions/upload-artifact rejects '/' (and quietly mangles '@'),
160-
# so '@mysten/sui' → 'mysten-sui'.
161-
slug="${PACKAGE#@}"
162-
slug="${slug//\//-}"
163-
echo "slug=$slug" >> "$GITHUB_OUTPUT"
164-
165167
- name: Publish to npm
166168
working-directory: ${{ inputs.dir }}
167169
env:

.github/workflows/release-ledger-signer.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ jobs:
3333
dir: 'packages/signers/ledger'
3434
dry_run: ${{ inputs.dry_run || 'true' }}
3535
ref: ${{ inputs.ref }}
36+
# @types/semver — needed by ledgerjs-hw-app-sui (workspace dep) for tsc
37+
# --noEmit; semver itself is a runtime dep already, only the types are
38+
# build-time-only.
39+
tools: 'tsdown@0.20.0-beta.1 typescript@5.9.3 @types/node@25.0.8 @types/semver@7.7.1'

.github/workflows/release-ledgerjs-hw-app-sui.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ jobs:
3333
dir: 'packages/ledgerjs-hw-app-sui'
3434
dry_run: ${{ inputs.dry_run || 'true' }}
3535
ref: ${{ inputs.ref }}
36+
# @types/semver — semver itself is a runtime dep, but its types are
37+
# devDep-only and tsc --noEmit needs them at build time.
38+
tools: 'tsdown@0.20.0-beta.1 typescript@5.9.3 @types/node@25.0.8 @types/semver@7.7.1'

.github/workflows/release-signers.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ jobs:
3333
dir: 'packages/signers'
3434
dry_run: ${{ inputs.dry_run || 'true' }}
3535
ref: ${{ inputs.ref }}
36+
# @types/semver — needed transitively via ledgerjs-hw-app-sui for tsc
37+
# --noEmit; semver itself is a runtime dep already, only types are
38+
# build-time-only.
39+
tools: 'tsdown@0.20.0-beta.1 typescript@5.9.3 @types/node@25.0.8 @types/semver@7.7.1'

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"manypkg": {
3232
"ignoredRules": [
3333
"INTERNAL_MISMATCH",
34-
"ROOT_HAS_DEV_DEPENDENCIES"
34+
"ROOT_HAS_DEV_DEPENDENCIES",
35+
"INVALID_DEV_AND_PEER_DEPENDENCY_RELATIONSHIP"
3536
]
3637
},
3738
"devDependencies": {

packages/dapp-kit/packages/dapp-kit-core/.storybook/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function getAbsolutePath(value: string): any {
88
}
99

1010
const config: StorybookConfig = {
11-
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
11+
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
1212
framework: {
1313
name: getAbsolutePath('@storybook/web-components-vite'),
1414
options: {},

packages/dapp-kit/packages/dapp-kit-core/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"lint": "pnpm run oxlint:check && pnpm run prettier:check",
4343
"lint:fix": "pnpm run oxlint:fix && pnpm run prettier:fix",
4444
"test": "pnpm test:typecheck && pnpm vitest run",
45-
"test:typecheck": "tsc -b ./test",
45+
"test:typecheck": "tsc -b ./test ./stories",
4646
"storybook": "storybook dev -p 6006",
4747
"build-storybook": "storybook build"
4848
},
@@ -57,7 +57,6 @@
5757
"access": "public"
5858
},
5959
"devDependencies": {
60-
"@mysten/sui": "workspace:^",
6160
"@storybook/web-components": "^10.1.11",
6261
"@storybook/web-components-vite": "^10.1.11",
6362
"storybook": "^10.2.12",

packages/dapp-kit/packages/dapp-kit-core/src/web/dapp-kit-connect-button.stories.ts renamed to packages/dapp-kit/packages/dapp-kit-core/stories/dapp-kit-connect-button.stories.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import type { Meta, StoryObj } from '@storybook/web-components';
55
import { html } from 'lit';
6-
import type { DAppKitConnectButton } from './dapp-kit-connect-button.js';
7-
import { createDAppKit } from '../core/index.js';
6+
import type { DAppKitConnectButton } from '../src/web/dapp-kit-connect-button.js';
7+
import { createDAppKit } from '../src/core/index.js';
88
import { SuiGrpcClient } from '@mysten/sui/grpc';
99

1010
const GRPC_URLS = {

packages/dapp-kit/packages/dapp-kit-core/src/web/dapp-kit-connect-modal.stories.ts renamed to packages/dapp-kit/packages/dapp-kit-core/stories/dapp-kit-connect-modal.stories.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import type { Meta, StoryObj } from '@storybook/web-components';
55
import { html } from 'lit';
6-
import type { DAppKitConnectModal } from './dapp-kit-connect-modal.js';
7-
import { createDAppKit } from '../core/index.js';
6+
import type { DAppKitConnectModal } from '../src/web/dapp-kit-connect-modal.js';
7+
import { createDAppKit } from '../src/core/index.js';
88
import { SuiGrpcClient } from '@mysten/sui/grpc';
99

1010
const GRPC_URLS = {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"include": ["../src", "./**/*"],
4+
"compilerOptions": {
5+
"rootDir": "..",
6+
"noEmit": true,
7+
"module": "Preserve",
8+
"moduleResolution": "bundler",
9+
"emitDeclarationOnly": false,
10+
"resolveJsonModule": true
11+
}
12+
}

0 commit comments

Comments
 (0)