Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions .github/workflows/_release-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ jobs:
with:
ref: ${{ inputs.ref }}

- name: Compute artifact-safe package slug
id: slug
env:
PACKAGE: ${{ inputs.package }}
run: |
set -euo pipefail
# actions/upload-artifact rejects '/' (and quietly mangles '@'),
# so '@mysten/sui' → 'mysten-sui'. Computed up front (not after Build)
# so the always() artifact upload still gets a valid name when Build
# fails — otherwise `name: tarball-` is produced and rejected.
slug="${PACKAGE#@}"
slug="${slug//\//-}"
echo "slug=$slug" >> "$GITHUB_OUTPUT"

- name: Set up pnpm
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0

Expand Down Expand Up @@ -150,18 +164,6 @@ jobs:
pnpm --filter "${PACKAGE}..." --if-present run build
fi

- name: Compute artifact-safe package slug
id: slug
env:
PACKAGE: ${{ inputs.package }}
run: |
set -euo pipefail
# actions/upload-artifact rejects '/' (and quietly mangles '@'),
# so '@mysten/sui' → 'mysten-sui'.
slug="${PACKAGE#@}"
slug="${slug//\//-}"
echo "slug=$slug" >> "$GITHUB_OUTPUT"

- name: Publish to npm
working-directory: ${{ inputs.dir }}
env:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-ledger-signer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ jobs:
dir: 'packages/signers/ledger'
dry_run: ${{ inputs.dry_run || 'true' }}
ref: ${{ inputs.ref }}
# @types/semver — needed by ledgerjs-hw-app-sui (workspace dep) for tsc
# --noEmit; semver itself is a runtime dep already, only the types are
# build-time-only.
tools: 'tsdown@0.20.0-beta.1 typescript@5.9.3 @types/node@25.0.8 @types/semver@7.7.1'
3 changes: 3 additions & 0 deletions .github/workflows/release-ledgerjs-hw-app-sui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ jobs:
dir: 'packages/ledgerjs-hw-app-sui'
dry_run: ${{ inputs.dry_run || 'true' }}
ref: ${{ inputs.ref }}
# @types/semver — semver itself is a runtime dep, but its types are
# devDep-only and tsc --noEmit needs them at build time.
tools: 'tsdown@0.20.0-beta.1 typescript@5.9.3 @types/node@25.0.8 @types/semver@7.7.1'
4 changes: 4 additions & 0 deletions .github/workflows/release-signers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ jobs:
dir: 'packages/signers'
dry_run: ${{ inputs.dry_run || 'true' }}
ref: ${{ inputs.ref }}
# @types/semver — needed transitively via ledgerjs-hw-app-sui for tsc
# --noEmit; semver itself is a runtime dep already, only types are
# build-time-only.
tools: 'tsdown@0.20.0-beta.1 typescript@5.9.3 @types/node@25.0.8 @types/semver@7.7.1'
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"manypkg": {
"ignoredRules": [
"INTERNAL_MISMATCH",
"ROOT_HAS_DEV_DEPENDENCIES"
"ROOT_HAS_DEV_DEPENDENCIES",
"INVALID_DEV_AND_PEER_DEPENDENCY_RELATIONSHIP"
]
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function getAbsolutePath(value: string): any {
}

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
framework: {
name: getAbsolutePath('@storybook/web-components-vite'),
options: {},
Expand Down
3 changes: 1 addition & 2 deletions packages/dapp-kit/packages/dapp-kit-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"lint": "pnpm run oxlint:check && pnpm run prettier:check",
"lint:fix": "pnpm run oxlint:fix && pnpm run prettier:fix",
"test": "pnpm test:typecheck && pnpm vitest run",
"test:typecheck": "tsc -b ./test",
"test:typecheck": "tsc -b ./test ./stories",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
Expand All @@ -57,7 +57,6 @@
"access": "public"
},
"devDependencies": {
"@mysten/sui": "workspace:^",
"@storybook/web-components": "^10.1.11",
"@storybook/web-components-vite": "^10.1.11",
"storybook": "^10.2.12",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

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

const GRPC_URLS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

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

const GRPC_URLS = {
Expand Down
12 changes: 12 additions & 0 deletions packages/dapp-kit/packages/dapp-kit-core/stories/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../tsconfig.json",
"include": ["../src", "./**/*"],
"compilerOptions": {
"rootDir": "..",
"noEmit": true,
"module": "Preserve",
"moduleResolution": "bundler",
"emitDeclarationOnly": false,
"resolveJsonModule": true
}
}
2 changes: 0 additions & 2 deletions packages/dapp-kit/packages/dapp-kit-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
"access": "public"
},
"devDependencies": {
"@types/react": "^19.2.8",
"react": "^19.2.3",
"tsdown": "0.20.0-beta.1",
"typescript": "^5.9.3"
},
Expand Down
3 changes: 0 additions & 3 deletions packages/dapp-kit/packages/legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
"access": "public"
},
"devDependencies": {
"@mysten/sui": "workspace:^",
"@tanstack/react-query": "^5.90.16",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.1",
Expand All @@ -66,7 +64,6 @@
"jsdom": "^27.4.0",
"postcss": "^8.5.14",
"postcss-prefix-selector": "^2.1.1",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"typescript": "^5.9.3",
"vite": "^8.0.5",
Expand Down
1 change: 0 additions & 1 deletion packages/deepbook-v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"devDependencies": {
"@iarna/toml": "^2.2.5",
"@mysten/codegen": "workspace:^",
"@mysten/sui": "workspace:^",
"@types/node": "^25.0.8",
"dotenv": "^17.2.3",
"tmp": "^0.2.5",
Expand Down
5 changes: 0 additions & 5 deletions packages/docs/scripts/build-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@
* "build:docs": "tsx scripts/build-docs.ts --all"
*/

import { execFileSync } from 'node:child_process';
import * as fs from 'node:fs';
import * as path from 'node:path';

import { EXCLUDED_SUBDIRS, findMdxFiles, generateSectionIndex, processFile } from './docs-utils.ts';

const npxCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
const SCRIPTS_DIR = new URL('.', import.meta.url).pathname;
const DOCS_PKG_DIR = path.resolve(SCRIPTS_DIR, '..');
const CONTENT_DIR = path.join(DOCS_PKG_DIR, 'content');
Expand Down Expand Up @@ -113,9 +111,6 @@ async function buildSectionDocs(
const sectionIndex = generateSectionIndex(contentRoot, '.', '#', excludedSubdirs);
fs.writeFileSync(path.join(outputDir, 'llms-index.md'), sectionIndex);

// Format generated files with prettier
execFileSync(npxCmd, ['prettier', '--write', `${outputDir}/**/*.md`], { stdio: 'ignore' });

return processed;
}

Expand Down
1 change: 0 additions & 1 deletion packages/enoki-connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
},
"homepage": "https://github.com/MystenLabs/ts-sdks/tree/main/packages/enoki-connect#readme",
"devDependencies": {
"@mysten/sui": "workspace:^",
"@types/node": "^25.0.8",
"typescript": "^5.9.3",
"vitest": "^4.0.17"
Expand Down
3 changes: 0 additions & 3 deletions packages/enoki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,9 @@
"homepage": "https://docs.enoki.mystenlabs.com",
"devDependencies": {
"@mysten/dapp-kit-react": "workspace:^",
"@mysten/sui": "workspace:^",
"@types/node": "^25.0.8",
"@types/react": "^19.2.8",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react-swc": "^4.2.2",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"typescript": "^5.9.3",
"vite": "^8.0.5"
Expand Down
1 change: 0 additions & 1 deletion packages/kiosk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
},
"devDependencies": {
"@mysten/codegen": "workspace:^",
"@mysten/sui": "workspace:^",
"cross-env": "^10.1.0",
"tmp": "^0.2.5",
"ts-retry-promise": "^0.8.1",
Expand Down
1 change: 0 additions & 1 deletion packages/pas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
},
"devDependencies": {
"@mysten/codegen": "workspace:^",
"@mysten/sui": "workspace:^",
"@types/node": "^25.0.8",
"ts-retry-promise": "^0.8.1",
"tsdown": "0.20.0-beta.1",
Expand Down
1 change: 0 additions & 1 deletion packages/payment-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
},
"devDependencies": {
"@mysten/codegen": "workspace:^",
"@mysten/sui": "workspace:^",
"typescript": "^5.9.3",
"vitest": "^4.0.17"
},
Expand Down
1 change: 0 additions & 1 deletion packages/seal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"homepage": "https://github.com/MystenLabs/seal#readme",
"devDependencies": {
"@hey-api/openapi-ts": "^0.90.3",
"@mysten/sui": "workspace:^",
"@types/node": "^25.0.8",
"typescript": "^5.9.3",
"vitest": "^4.0.17"
Expand Down
1 change: 0 additions & 1 deletion packages/signers/aws/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"@mysten/sui": "workspace:^"
},
"devDependencies": {
"@mysten/sui": "workspace:^",
"@types/node": "^25.0.8",
"dotenv": "^17.2.3",
"typescript": "^5.9.3",
Expand Down
1 change: 0 additions & 1 deletion packages/signers/gcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"@mysten/sui": "workspace:^"
},
"devDependencies": {
"@mysten/sui": "workspace:^",
"@types/node": "^25.0.8",
"dotenv": "^17.2.3",
"typescript": "^5.9.3",
Expand Down
1 change: 0 additions & 1 deletion packages/signers/ledger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@mysten/sui": "workspace:^"
},
"devDependencies": {
"@mysten/sui": "workspace:^",
"@types/node": "^25.0.8",
"typescript": "^5.9.3",
"vitest": "^4.0.17"
Expand Down
1 change: 0 additions & 1 deletion packages/signers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
},
"homepage": "https://github.com/MystenLabs/ts-sdks/tree/main/packages/signers#readme",
"devDependencies": {
"@mysten/sui": "workspace:^",
"@types/node": "^25.0.8",
"typescript": "^5.9.3"
},
Expand Down
1 change: 0 additions & 1 deletion packages/signers/webcrypto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@mysten/sui": "workspace:^"
},
"devDependencies": {
"@mysten/sui": "workspace:^",
"@types/node": "^25.0.8",
"typescript": "^5.9.3",
"vitest": "^4.0.17"
Expand Down
1 change: 0 additions & 1 deletion packages/slush-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
},
"homepage": "https://github.com/MystenLabs/ts-sdks/tree/main/packages/slush-wallet#readme",
"devDependencies": {
"@mysten/sui": "workspace:^",
"@types/node": "^25.0.8",
"typescript": "^5.9.3",
"vitest": "^4.0.17"
Expand Down
38 changes: 5 additions & 33 deletions packages/sui/genversion.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,10 @@
import { readFile, writeFile } from 'fs/promises';

const LICENSE = '// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n';

const WARNING = '// This file is generated by genversion.mjs. Do not edit it directly.\n\n';

// Pulls `version = "..."` from the [workspace.package] table without a TOML
// dep. Tradeoff: keeps the release-time install minimal — full TOML parsing is
// overkill for a single string field in a stable upstream layout.
function extractWorkspacePackageVersion(cargoToml) {
const sectionRe = /^\[workspace\.package\]\s*$([\s\S]*?)(?=^\s*\[|\z)/m;
const section = cargoToml.match(sectionRe);
if (!section) {
throw new Error('genversion: [workspace.package] section not found in Cargo.toml');
}
const versionRe = /^\s*version\s*=\s*"([^"]+)"/m;
const version = section[1].match(versionRe);
if (!version) {
throw new Error('genversion: version field not found in [workspace.package]');
}
return version[1];
}

async function main() {
const pkg = JSON.parse(await readFile('./package.json', 'utf8'));
const cargoToml = await fetch(
'https://raw.githubusercontent.com/MystenLabs/sui/refs/heads/main/Cargo.toml',
).then((res) => res.text());
const targetedRpcVersion = extractWorkspacePackageVersion(cargoToml);
await writeFile(
'src/version.ts',
LICENSE +
WARNING +
`export const PACKAGE_VERSION = '${pkg.version}';\nexport const TARGETED_RPC_VERSION = '${targetedRpcVersion}';\n`,
);
}

await main();
const pkg = JSON.parse(await readFile('./package.json', 'utf8'));
await writeFile(
'src/version.ts',
LICENSE + WARNING + `export const PACKAGE_VERSION = '${pkg.version}';\n`,
);
3 changes: 1 addition & 2 deletions packages/sui/src/jsonRpc/http-transport.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

import { PACKAGE_VERSION, TARGETED_RPC_VERSION } from '../version.js';
import { PACKAGE_VERSION } from '../version.js';
import { JsonRpcError, SuiHTTPStatusError } from './errors.js';

/**
Expand Down Expand Up @@ -58,7 +58,6 @@ export class JsonRpcHTTPTransport implements JsonRpcTransport {
'Content-Type': 'application/json',
'Client-Sdk-Type': 'typescript',
'Client-Sdk-Version': PACKAGE_VERSION,
'Client-Target-Api-Version': TARGETED_RPC_VERSION,
'Client-Request-Method': input.method,
...this.#options.rpc?.headers,
},
Expand Down
1 change: 0 additions & 1 deletion packages/sui/src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
// This file is generated by genversion.mjs. Do not edit it directly.

export const PACKAGE_VERSION = '2.16.0';
export const TARGETED_RPC_VERSION = '1.72.0';
3 changes: 1 addition & 2 deletions packages/sui/test/unit/client/http-transport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';

import { JsonRpcHTTPTransport } from '../../../src/jsonRpc/index.js';
import { PACKAGE_VERSION, TARGETED_RPC_VERSION } from '../../../src/version.js';
import { PACKAGE_VERSION } from '../../../src/version.js';

describe('JsonRpcHTTPTransport', () => {
describe('rpc requests', () => {
Expand Down Expand Up @@ -60,7 +60,6 @@ describe('JsonRpcHTTPTransport', () => {
'Content-Type': 'application/json',
'Client-Sdk-Type': 'typescript',
'Client-Sdk-Version': PACKAGE_VERSION,
'Client-Target-Api-Version': TARGETED_RPC_VERSION,
'Client-Request-Method': 'getAllBalances',
},
method: 'POST',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import { toBase58 } from '@mysten/bcs';
import { describe, expect, it } from 'vitest';

import { bcs } from '../../bcs/index.js';
import { TransactionCommands, Transaction } from '../index.js';
import { Inputs } from '../Inputs.js';
import { bcs } from '../../../src/bcs/index.js';
import { TransactionCommands, Transaction } from '../../../src/transactions/index.js';
import { Inputs } from '../../../src/transactions/Inputs.js';

it('can construct and serialize an empty tranaction', () => {
const tx = new Transaction();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import { toBase58 } from '@mysten/bcs';
import { expect, it } from 'vitest';

import { bcs } from '../../bcs/index.js';
import { normalizeStructTag, normalizeSuiAddress } from '../../utils/sui-types.js';
import { bcs } from '../../../src/bcs/index.js';
import { normalizeStructTag, normalizeSuiAddress } from '../../../src/utils/sui-types.js';

// Oooh-weeee we nailed it!
it('can serialize simplified programmable call struct', () => {
Expand Down
Loading
Loading