diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 0000000..d08c738 --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,7 @@ +# Changesets + +Hello and welcome! This folder was automatically generated by `@changesets/cli`, a build tool that works +with multi-package repos to help version and publish code. You can +find the full documentation for it [in the changesets repository](https://github.com/changesets/changesets). + +You can view a list of [common questions](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) to help you get started with changesets. diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000..d5b19b4 --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "fixed": [], + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "minor", + "privatePackages": false, + "ignore": [ + "@mysten/sdk-docs" + ], + "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { + "onlyUpdatePeerDependentsWhenOutOfRange": true + } +} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..cdbbdb9 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +packages/ @MystenLabs/sdk-reviewers +packages/kiosk @MystenLabs/kiosk-sdk-reviewers +packages/wallet-standard @MystenLabs/wallet-kit-reviewers diff --git a/.github/ISSUE_TEMPLATE/code-bug.md b/.github/ISSUE_TEMPLATE/code-bug.md new file mode 100644 index 0000000..0000b3c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/code-bug.md @@ -0,0 +1,35 @@ +--- +name: Sui Code Bug +about: Create a new software bug for issues encountered running Sui +title: 'Sui Code Bug or Feature Request' +labels: bug +assignees: '' +--- + +## Steps to Reproduce Issue + +Fill this in with the concrete steps needed to reproduce the bug. When providing code in the reproduction steps, use the smallest snippet of code that demonstrates the issue, removing any extraneous details. + +e.g. + +1. Call function . +2. Use return value and call . + +## Expected Result + +Specify what outcome you expected should have resulted, but didn't. + +e.g. +Expected to return 42. + +## Actual Result + +Specify what the actual unexpected outcome was. + +e.g. + returned 41. + +## Environment Information + +- Runtime: +- Package manager: diff --git a/.github/ISSUE_TEMPLATE/doc-bug.md b/.github/ISSUE_TEMPLATE/doc-bug.md new file mode 100644 index 0000000..f2dd4a8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/doc-bug.md @@ -0,0 +1,13 @@ +--- +name: Sui doc content issue or request +about: Creates an issue for Sui documentation +title: 'Sui doc content issue or request' +labels: doc-issue +assignees: 'ronny-mysten' +--- + +If this is an issue with existing content, provide the URL or GitHub path to the topic. Otherwise, use **New**. + +Describe the issue or request. Provide as much detail as possible. For issues, it is helpful to copy the specific section of the topic into the issue. + +Thank you for taking the time to let us know about the issue or request. We triage all new issues and requests within 2 business days. We will follow up if we need additional information. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..1f4b8da --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,9 @@ +## Description + +Describe the changes or additions included in this PR. + +## Test plan + +How did you test the new or updated feature? + +--- diff --git a/.github/workflows/changesets-ci-comment.yml b/.github/workflows/changesets-ci-comment.yml new file mode 100644 index 0000000..bc0a955 --- /dev/null +++ b/.github/workflows/changesets-ci-comment.yml @@ -0,0 +1,85 @@ +name: Changesets CI Comment + +# NOTE: This workflow run indirection is used to securely comment on PRs when +# changeset CI runs are completed. +on: + workflow_run: + workflows: ["Changesets CI"] + types: + - completed + +jobs: + upload: + runs-on: ubuntu-latest + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' + steps: + - name: Get workflow run information + uses: potiuk/get-workflow-origin@e3ba776faee1134e17551924b852bfb374e1703d # pin@v1_1 + id: source-run-info + with: + token: ${{ secrets.GITHUB_TOKEN }} + sourceRunId: ${{ github.event.workflow_run.id }} + + - name: "Download artifact" + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # pin@v7.0.1 + id: get-artifact + if: steps.source-run-info.outputs.pullRequestNumber + with: + result-encoding: string + script: | + let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.payload.workflow_run.id, + }); + + let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { + return artifact.name == "missing-changeset" + })[0]; + + if (!matchArtifact) { + return 'false'; + } + + return 'true'; + + - name: Comment PR + uses: thollander/actions-comment-pull-request@dadb7667129e23f12ca3925c90dc5cd7121ab57e # pin@v2 + if: steps.get-artifact.outputs.result == 'true' && steps.source-run-info.outputs.pullRequestNumber + with: + pr_number: ${{ steps.source-run-info.outputs.pullRequestNumber }} + comment_tag: "changesets-warning" + message: | + ⚠️ 🦋 **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](https://github.com/changesets/changesets). + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Remove outdated comments + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # pin@v7.0.1 + if: steps.get-artifact.outputs.result == 'false' && steps.source-run-info.outputs.pullRequestNumber + env: + ISSUE_NUMBER: ${{ steps.source-run-info.outputs.pullRequestNumber }} + with: + script: | + const resp = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: process.env.ISSUE_NUMBER + }); + + const comments = resp.data.filter(it => it.body.startsWith('⚠️ 🦋 **Changesets Warning:**')); + + for (const comment of comments) { + console.log( + `Removing issue ${comment.issue_url}` + ); + + await github.rest.issues.deleteComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: comment.id + }); + } diff --git a/.github/workflows/changesets-ci.yml b/.github/workflows/changesets-ci.yml new file mode 100644 index 0000000..5228438 --- /dev/null +++ b/.github/workflows/changesets-ci.yml @@ -0,0 +1,43 @@ +name: Changesets CI +on: pull_request +jobs: + validate: + runs-on: ubuntu-latest + steps: + - name: checkout code repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 + with: + fetch-depth: 0 + - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # pin@v3.0.0 + with: + version: 9.1.1 + - name: Install Nodejs + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 + with: + node-version: '18' + cache: 'pnpm' + - name: Install dependencies + run: pnpm install --frozen-lockfile + - id: diff + name: Determine changed public packages from previous commit + run: echo "hasChanges=$(pnpm list --filter "...[$(git rev-parse HEAD^1)]" --depth -1 --json | jq "any(.[] | select(.private != true) ; length > 0)")" >> $GITHUB_OUTPUT + - name: Get changed files in the changesets folder + id: has-changesets + uses: tj-actions/changed-files@0874344d6ebbaa00a27da73276ae7162fadcaf69 # pin@v44.3.0 + with: + files: | + .changeset/** + - name: Create missing changeset note if there are missing changesets + if: steps.has-changesets.outputs.any_changed != 'true' && steps.diff.outputs.hasChanges == 'true' + run: | + echo "true" > missing-changeset.txt + - name: Upload missing changeset artifact + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@4.4.3 + if: steps.has-changesets.outputs.any_changed != 'true' && steps.diff.outputs.hasChanges == 'true' + with: + name: missing-changeset + path: missing-changeset.txt + if-no-files-found: error + retention-days: 1 + - name: Attempt to create snapshots. + run: pnpm changeset version --snapshot test-do-not-publish diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml new file mode 100644 index 0000000..c0f87a6 --- /dev/null +++ b/.github/workflows/changesets.yml @@ -0,0 +1,55 @@ +name: Changesets +on: + ## Allow triggering this workflow manually via GitHub CLI/web + workflow_dispatch: + push: + branches: + - main + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Dispatch Changesets To Operations + uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # pin@v3.0.0 + with: + repository: MystenLabs/sui-operations + token: ${{ secrets.CHANGESETS_DEPLOY_DISPATCH }} + event-type: changesets + client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' + + version: + runs-on: ubuntu-latest + steps: + - name: Generate token + id: generate_token + uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # pin@v1 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + + - name: checkout code repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 + with: + token: ${{ steps.generate_token.outputs.token }} + fetch-depth: 0 + - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # pin@v3.0.0 + with: + version: 9.1.1 + - name: Install Nodejs + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 + with: + node-version: '18' + cache: 'pnpm' + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Create Release Pull Request + uses: changesets/action@f13b1baaa620fde937751f5d2c3572b9da32af23 # pin@v1 + with: + # Generates src/version.ts file using genVersion + # https://github.com/changesets/action#with-version-script + version: pnpm changeset-version + env: + GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 0000000..3cd7461 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,45 @@ +name: End-to-end Tests +on: + pull_request: + workflow_dispatch: + push: + branches: + - main +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: + # Run e2e test against localnet built on the testnet branch + localnet: + name: Localnet + runs-on: ubuntu-ghcloud + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Run TS SDK e2e tests + run: pnpm --filter @mysten/sui test:e2e + + - name: Run RPC/GraphQL compatibility e2e tests + run: pnpm --filter @mysten/graphql-transport test:e2e + + - name: Run kiosk sdk e2e tests + run: pnpm --filter @mysten/kiosk test:e2e + + - name: Run suins-toolkit sdk e2e tests + run: pnpm --filter @mysten/suins-toolkit test:e2e + shell: bash diff --git a/.github/workflows/turborepo.yml b/.github/workflows/turborepo.yml new file mode 100644 index 0000000..bfe7849 --- /dev/null +++ b/.github/workflows/turborepo.yml @@ -0,0 +1,85 @@ +name: Turborepo CI + +on: + push: + branches: [main] + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + audit: + name: pnpm audit + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 + - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # pin@v3.0.0 + with: + version: 9.1.1 + - name: Install Nodejs + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 + with: + node-version: '20' + - name: Run audit + run: pnpm audit --prod --audit-level high + + build: + name: Lint, Build, and Test + runs-on: ubuntu-latest + environment: sui-typescript-aws-kms-test-env + env: + E2E_AWS_KMS_TEST_ENABLE: 'false' + E2E_GCP_KMS_TEST_ENABLE: 'false' + E2E_SIGNER_TEST_ENABLE: 'false' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 + with: + fetch-depth: 2 + - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # pin@v3.0.0 + with: + version: 9.1.1 + - name: Install Nodejs + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2 + with: + node-version: '20' + cache: 'pnpm' + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Manypkg Check + run: pnpm manypkg check + - name: Turbo Cache + id: turbo-cache + uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # pin@v4.2.0 + with: + path: node_modules/.cache/turbo + key: turbo-${{ runner.os }}-${{ github.sha }} + restore-keys: | + turbo-${{ runner.os }}- + - name: Lint + run: pnpm turbo lint + - name: Install wasm-pack for mbf package + uses: jetli/wasm-pack-action@0d096b08b4e5a7de8c28de67e11e945404e9eefa # pin@v0.4.0 + with: + version: 'latest' + - name: configure gcp/gke service user auth + if: env.E2E_SIGNER_TEST_ENABLE == 'true' + uses: google-github-actions/auth@v1 + with: + credentials_json: ${{ secrets.GKE_TEST_KMS_SVCUSER_CREDENTIALS }} + - name: Build + run: pnpm turbo build + - name: Test + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KMS_TEST_KEY_ID}} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_KMS_TEST_SECRET_ACCESS_KEY }} + AWS_REGION: ${{ vars.AWS_KMS_AWS_REGION }} + AWS_KMS_KEY_ID: ${{ secrets.AWS_KMS_TEST_KMS_KEY_ID }} + E2E_AWS_KMS_TEST_ENABLE: ${{ env.E2E_AWS_KMS_TEST_ENABLE }} + GOOGLE_PROJECT_ID: ${{ secrets.GOOGLE_PROJECT_ID }} + GOOGLE_LOCATION: ${{ secrets.GOOGLE_LOCATION }} + GOOGLE_KEYRING: ${{ secrets.GOOGLE_KEYRING }} + GOOGLE_KEY_NAME: ${{ secrets.GOOGLE_KEY_NAME }} + GOOGLE_KEY_NAME_VERSION: ${{ secrets.GOOGLE_KEY_NAME_VERSION }} + E2E_GCP_KMS_TEST_ENABLE: ${{ env.E2E_GCP_KMS_TEST_ENABLE }} + run: pnpm turbo test diff --git a/packages/bcs/package.json b/packages/bcs/package.json index a2675bd..20cbc32 100644 --- a/packages/bcs/package.json +++ b/packages/bcs/package.json @@ -65,7 +65,7 @@ "@size-limit/preset-small-lib": "^11.1.4", "size-limit": "^11.1.4", "typescript": "^5.7.2", - "vitest": "^2.0.1" + "vitest": "^2.1.8" }, "dependencies": { "bs58": "^6.0.0" diff --git a/packages/create-dapp/templates/react-client-dapp/tsconfig.node.json b/packages/create-dapp/templates/react-client-dapp/tsconfig.node.json index 42872c5..a858353 100644 --- a/packages/create-dapp/templates/react-client-dapp/tsconfig.node.json +++ b/packages/create-dapp/templates/react-client-dapp/tsconfig.node.json @@ -6,5 +6,5 @@ "moduleResolution": "bundler", "allowSyntheticDefaultImports": true }, - "include": ["vite.config.ts"] + "include": ["vite.config.mts"] } diff --git a/packages/create-dapp/templates/react-client-dapp/vite.config.ts b/packages/create-dapp/templates/react-client-dapp/vite.config.mts similarity index 100% rename from packages/create-dapp/templates/react-client-dapp/vite.config.ts rename to packages/create-dapp/templates/react-client-dapp/vite.config.mts diff --git a/packages/create-dapp/templates/react-e2e-counter/tsconfig.node.json b/packages/create-dapp/templates/react-e2e-counter/tsconfig.node.json index 42872c5..a858353 100644 --- a/packages/create-dapp/templates/react-e2e-counter/tsconfig.node.json +++ b/packages/create-dapp/templates/react-e2e-counter/tsconfig.node.json @@ -6,5 +6,5 @@ "moduleResolution": "bundler", "allowSyntheticDefaultImports": true }, - "include": ["vite.config.ts"] + "include": ["vite.config.mts"] } diff --git a/packages/create-dapp/templates/react-e2e-counter/vite.config.ts b/packages/create-dapp/templates/react-e2e-counter/vite.config.mts similarity index 100% rename from packages/create-dapp/templates/react-e2e-counter/vite.config.ts rename to packages/create-dapp/templates/react-e2e-counter/vite.config.mts diff --git a/packages/dapp-kit/package.json b/packages/dapp-kit/package.json index bd59dd0..2f2dd57 100644 --- a/packages/dapp-kit/package.json +++ b/packages/dapp-kit/package.json @@ -75,7 +75,7 @@ "size-limit": "^11.1.4", "typescript": "^5.7.2", "vite": "^6.0.7", - "vitest": "^2.0.1" + "vitest": "^2.1.8" }, "dependencies": { "@mysten/sui": "workspace:*", diff --git a/packages/dapp-kit/vitest.config.ts b/packages/dapp-kit/vitest.config.mts similarity index 100% rename from packages/dapp-kit/vitest.config.ts rename to packages/dapp-kit/vitest.config.mts diff --git a/packages/deepbook-v3/package.json b/packages/deepbook-v3/package.json index 03e4afa..425e694 100644 --- a/packages/deepbook-v3/package.json +++ b/packages/deepbook-v3/package.json @@ -45,7 +45,7 @@ "ts-retry-promise": "^0.8.1", "typescript": "^5.7.2", "vite": "^6.0.7", - "vitest": "^2.0.1", + "vitest": "^2.1.8", "wait-on": "^8.0.1" } } diff --git a/packages/deepbook-v3/vitest.config.ts b/packages/deepbook-v3/vitest.config.mts similarity index 100% rename from packages/deepbook-v3/vitest.config.ts rename to packages/deepbook-v3/vitest.config.mts diff --git a/packages/deepbook/test/e2e/globalSetup.ts b/packages/deepbook/test/e2e/globalSetup.ts index d9af829..7b28a95 100644 --- a/packages/deepbook/test/e2e/globalSetup.ts +++ b/packages/deepbook/test/e2e/globalSetup.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { resolve } from 'path'; -import { GenericContainer, Network } from 'testcontainers'; +import { GenericContainer, Network, PullPolicy } from 'testcontainers'; import type { GlobalSetupContext } from 'vitest/node'; declare module 'vitest' { @@ -14,7 +14,10 @@ declare module 'vitest' { } } -const SUI_TOOLS_TAG = process.env.SUI_TOOLS_TAG || '2e256a70aa0ff81972ded6ebd57f7679e2ea194d-arm64'; +const SUI_TOOLS_TAG = + process.env.SUI_TOOLS_TAG || process.arch === 'arm64' + ? '2e256a70aa0ff81972ded6ebd57f7679e2ea194d-arm64' + : '2e256a70aa0ff81972ded6ebd57f7679e2ea194d'; export default async function setup({ provide }: GlobalSetupContext) { console.log('Starting test containers'); @@ -30,6 +33,7 @@ export default async function setup({ provide }: GlobalSetupContext) { .withExposedPorts(5432) .withNetwork(network) + .withPullPolicy(PullPolicy.alwaysPull()) .start(); const localnet = await new GenericContainer(`mysten/sui-tools:${SUI_TOOLS_TAG}`) diff --git a/packages/deepbook/vitest.config.ts b/packages/deepbook/vitest.config.mts similarity index 100% rename from packages/deepbook/vitest.config.ts rename to packages/deepbook/vitest.config.mts diff --git a/packages/enoki/demo/vite.config.ts b/packages/enoki/demo/vite.config.mts similarity index 100% rename from packages/enoki/demo/vite.config.ts rename to packages/enoki/demo/vite.config.mts diff --git a/packages/graphql-transport/package.json b/packages/graphql-transport/package.json index f3956ec..62560f6 100644 --- a/packages/graphql-transport/package.json +++ b/packages/graphql-transport/package.json @@ -52,7 +52,7 @@ "@types/node": "^22.10.5", "graphql-config": "^5.0.3", "typescript": "^5.7.2", - "vitest": "^2.0.1", + "vitest": "^2.1.8", "wait-on": "^8.0.1" }, "dependencies": { diff --git a/packages/graphql-transport/test/globalSetup.ts b/packages/graphql-transport/test/globalSetup.ts index 1bc4239..e60fa94 100644 --- a/packages/graphql-transport/test/globalSetup.ts +++ b/packages/graphql-transport/test/globalSetup.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { resolve } from 'path'; -import { GenericContainer, Network } from 'testcontainers'; +import { GenericContainer, Network, PullPolicy } from 'testcontainers'; import type { GlobalSetupContext } from 'vitest/node'; declare module 'vitest' { @@ -15,7 +15,10 @@ declare module 'vitest' { } } -const SUI_TOOLS_TAG = process.env.SUI_TOOLS_TAG || '2e256a70aa0ff81972ded6ebd57f7679e2ea194d-arm64'; +const SUI_TOOLS_TAG = + process.env.SUI_TOOLS_TAG || process.arch === 'arm64' + ? '2e256a70aa0ff81972ded6ebd57f7679e2ea194d-arm64' + : '2e256a70aa0ff81972ded6ebd57f7679e2ea194d'; export default async function setup({ provide }: GlobalSetupContext) { console.log('Starting test containers'); @@ -31,6 +34,7 @@ export default async function setup({ provide }: GlobalSetupContext) { .withExposedPorts(5432) .withNetwork(network) + .withPullPolicy(PullPolicy.alwaysPull()) .start(); const localnet = await new GenericContainer(`mysten/sui-tools:${SUI_TOOLS_TAG}`) diff --git a/packages/kiosk/package.json b/packages/kiosk/package.json index c4140d0..062f7d2 100644 --- a/packages/kiosk/package.json +++ b/packages/kiosk/package.json @@ -46,7 +46,7 @@ "ts-retry-promise": "^0.8.1", "typescript": "^5.7.2", "vite": "^6.0.7", - "vitest": "^2.0.1", + "vitest": "^2.1.8", "wait-on": "^8.0.1" } } diff --git a/packages/kiosk/test/e2e/globalSetup.ts b/packages/kiosk/test/e2e/globalSetup.ts index d6383bc..5b6e1b1 100644 --- a/packages/kiosk/test/e2e/globalSetup.ts +++ b/packages/kiosk/test/e2e/globalSetup.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { resolve } from 'path'; -import { GenericContainer, Network } from 'testcontainers'; +import { GenericContainer, Network, PullPolicy } from 'testcontainers'; import type { GlobalSetupContext } from 'vitest/node'; declare module 'vitest' { @@ -14,7 +14,10 @@ declare module 'vitest' { } } -const SUI_TOOLS_TAG = process.env.SUI_TOOLS_TAG || '2e256a70aa0ff81972ded6ebd57f7679e2ea194d-arm64'; +const SUI_TOOLS_TAG = + process.env.SUI_TOOLS_TAG || process.arch === 'arm64' + ? '2e256a70aa0ff81972ded6ebd57f7679e2ea194d-arm64' + : '2e256a70aa0ff81972ded6ebd57f7679e2ea194d'; export default async function setup({ provide }: GlobalSetupContext) { console.log('Starting test containers'); @@ -30,6 +33,7 @@ export default async function setup({ provide }: GlobalSetupContext) { .withExposedPorts(5432) .withNetwork(network) + .withPullPolicy(PullPolicy.alwaysPull()) .start(); const localnet = await new GenericContainer(`mysten/sui-tools:${SUI_TOOLS_TAG}`) diff --git a/packages/kiosk/vitest.config.ts b/packages/kiosk/vitest.config.mts similarity index 66% rename from packages/kiosk/vitest.config.ts rename to packages/kiosk/vitest.config.mts index 9fa6845..34e5ce2 100644 --- a/packages/kiosk/vitest.config.ts +++ b/packages/kiosk/vitest.config.mts @@ -16,6 +16,10 @@ export default defineConfig({ globalSetup: ['test/e2e/globalSetup.ts'], }, resolve: { - alias: {}, + alias: { + '@mysten/sui/transactions': new URL('../typescript/src/transactions', import.meta.url) + .pathname, + '@mysten/sui': new URL('../typescript/src', import.meta.url).pathname, + }, }, }); diff --git a/packages/ledgerjs-hw-app-sui/package.json b/packages/ledgerjs-hw-app-sui/package.json index 93a5382..f48d37c 100644 --- a/packages/ledgerjs-hw-app-sui/package.json +++ b/packages/ledgerjs-hw-app-sui/package.json @@ -73,6 +73,6 @@ "@types/node": "^22.10.5", "size-limit": "^11.1.4", "typescript": "^5.7.2", - "vitest": "^2.0.1" + "vitest": "^2.1.8" } } diff --git a/packages/move-bytecode-template/package.json b/packages/move-bytecode-template/package.json index d97a1c0..07dd18e 100644 --- a/packages/move-bytecode-template/package.json +++ b/packages/move-bytecode-template/package.json @@ -16,7 +16,7 @@ "@mysten/bcs": "workspace:*", "@mysten/build-scripts": "workspace:*", "typescript": "^5.7.2", - "vitest": "^2.0.1", + "vitest": "^2.1.8", "wasm-pack": "^0.13.0" } } diff --git a/packages/signers/package.json b/packages/signers/package.json index d199815..a573c0d 100644 --- a/packages/signers/package.json +++ b/packages/signers/package.json @@ -50,7 +50,7 @@ "@types/node": "^22.10.5", "dotenv": "^16.4.5", "typescript": "^5.7.2", - "vitest": "^2.0.1" + "vitest": "^2.1.8" }, "dependencies": { "@google-cloud/kms": "^4.5.0", diff --git a/packages/signers/vitest.config.ts b/packages/signers/vitest.config.mts similarity index 100% rename from packages/signers/vitest.config.ts rename to packages/signers/vitest.config.mts diff --git a/packages/suins-toolkit/package.json b/packages/suins-toolkit/package.json index 5200619..53dd8b7 100644 --- a/packages/suins-toolkit/package.json +++ b/packages/suins-toolkit/package.json @@ -39,7 +39,7 @@ "@mysten/build-scripts": "workspace:*", "ts-node": "^10.9.2", "typescript": "^5.7.2", - "vitest": "^2.0.1" + "vitest": "^2.1.8" }, "dependencies": { "@mysten/sui": "workspace:*" diff --git a/packages/suins-toolkit/vitest.config.ts b/packages/suins-toolkit/vitest.config.mts similarity index 100% rename from packages/suins-toolkit/vitest.config.ts rename to packages/suins-toolkit/vitest.config.mts diff --git a/packages/typescript/package.json b/packages/typescript/package.json index 273d11c..74d3270 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -108,7 +108,7 @@ "test": "pnpm test:typecheck && pnpm test:unit", "test:typecheck": "tsc -p ./test", "test:unit": "vitest run unit __tests__", - "test:e2e": "vitest run --config test/e2e/vitest.config.ts", + "test:e2e": "vitest run --config test/e2e/vitest.config.mts", "prepublishOnly": "pnpm build", "size": "size-limit", "analyze": "size-limit --why", @@ -147,7 +147,7 @@ "typescript": "^5.7.2", "vite": "^6.0.7", "vite-tsconfig-paths": "^5.1.4", - "vitest": "^2.0.1", + "vitest": "^2.1.8", "wait-on": "^8.0.1", "ws": "^8.18.0" }, diff --git a/packages/typescript/test/e2e/utils/globalSetup.ts b/packages/typescript/test/e2e/utils/globalSetup.ts index a87552a..8b41be4 100644 --- a/packages/typescript/test/e2e/utils/globalSetup.ts +++ b/packages/typescript/test/e2e/utils/globalSetup.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { resolve } from 'path'; -import { GenericContainer, Network } from 'testcontainers'; +import { GenericContainer, Network, PullPolicy } from 'testcontainers'; import type { GlobalSetupContext } from 'vitest/node'; declare module 'vitest' { @@ -14,7 +14,10 @@ declare module 'vitest' { } } -const SUI_TOOLS_TAG = process.env.SUI_TOOLS_TAG || '2e256a70aa0ff81972ded6ebd57f7679e2ea194d-arm64'; +const SUI_TOOLS_TAG = + process.env.SUI_TOOLS_TAG || process.arch === 'arm64' + ? '2e256a70aa0ff81972ded6ebd57f7679e2ea194d-arm64' + : '2e256a70aa0ff81972ded6ebd57f7679e2ea194d'; export default async function setup({ provide }: GlobalSetupContext) { console.log('Starting test containers'); @@ -30,6 +33,7 @@ export default async function setup({ provide }: GlobalSetupContext) { .withExposedPorts(5432) .withNetwork(network) + .withPullPolicy(PullPolicy.alwaysPull()) .start(); const localnet = await new GenericContainer(`mysten/sui-tools:${SUI_TOOLS_TAG}`) diff --git a/packages/typescript/test/e2e/vitest.config.ts b/packages/typescript/test/e2e/vitest.config.mts similarity index 100% rename from packages/typescript/test/e2e/vitest.config.ts rename to packages/typescript/test/e2e/vitest.config.mts diff --git a/packages/typescript/vitest.config.ts b/packages/typescript/vitest.config.mts similarity index 100% rename from packages/typescript/vitest.config.ts rename to packages/typescript/vitest.config.mts diff --git a/packages/zksend/package.json b/packages/zksend/package.json index 5db2069..01a356d 100644 --- a/packages/zksend/package.json +++ b/packages/zksend/package.json @@ -42,7 +42,7 @@ "@mysten/build-scripts": "workspace:*", "@types/node": "^22.10.5", "typescript": "^5.7.2", - "vitest": "^2.0.1" + "vitest": "^2.1.8" }, "dependencies": { "@mysten/sui": "workspace:*", diff --git a/packages/zksend/vitest.config.ts b/packages/zksend/vitest.config.mts similarity index 100% rename from packages/zksend/vitest.config.ts rename to packages/zksend/vitest.config.mts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 90b5a07..5eeeb4e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -113,7 +113,7 @@ importers: specifier: ^5.7.2 version: 5.7.2 vitest: - specifier: ^2.0.1 + specifier: ^2.1.8 version: 2.1.8(@types/node@22.10.5)(happy-dom@16.3.0)(jsdom@25.0.1)(msw@2.7.0(@types/node@22.10.5)(typescript@5.7.2)) packages/build-scripts: @@ -379,7 +379,7 @@ importers: specifier: ^6.0.7 version: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.7.0) vitest: - specifier: ^2.0.1 + specifier: ^2.1.8 version: 2.1.8(@types/node@22.10.5)(happy-dom@16.3.0)(jsdom@25.0.1)(msw@2.7.0(@types/node@22.10.5)(typescript@5.7.2)) packages/deepbook: @@ -447,7 +447,7 @@ importers: specifier: ^6.0.7 version: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.7.0) vitest: - specifier: ^2.0.1 + specifier: ^2.1.8 version: 2.1.8(@types/node@22.10.5)(happy-dom@16.3.0)(jsdom@25.0.1)(msw@2.7.0(@types/node@22.10.5)(typescript@5.7.2)) wait-on: specifier: ^8.0.1 @@ -606,7 +606,7 @@ importers: specifier: ^5.7.2 version: 5.7.2 vitest: - specifier: ^2.0.1 + specifier: ^2.1.8 version: 2.1.8(@types/node@22.10.5)(happy-dom@16.3.0)(jsdom@25.0.1)(msw@2.7.0(@types/node@22.10.5)(typescript@5.7.2)) wait-on: specifier: ^8.0.1 @@ -637,7 +637,7 @@ importers: specifier: ^6.0.7 version: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.7.0) vitest: - specifier: ^2.0.1 + specifier: ^2.1.8 version: 2.1.8(@types/node@22.10.5)(happy-dom@16.3.0)(jsdom@25.0.1)(msw@2.7.0(@types/node@22.10.5)(typescript@5.7.2)) wait-on: specifier: ^8.0.1 @@ -671,7 +671,7 @@ importers: specifier: ^5.7.2 version: 5.7.2 vitest: - specifier: ^2.0.1 + specifier: ^2.1.8 version: 2.1.8(@types/node@22.10.5)(happy-dom@16.3.0)(jsdom@25.0.1)(msw@2.7.0(@types/node@22.10.5)(typescript@5.7.2)) packages/move-bytecode-template: @@ -686,7 +686,7 @@ importers: specifier: ^5.7.2 version: 5.7.2 vitest: - specifier: ^2.0.1 + specifier: ^2.1.8 version: 2.1.8(@types/node@22.10.5)(happy-dom@16.3.0)(jsdom@25.0.1)(msw@2.7.0(@types/node@22.10.5)(typescript@5.7.2)) wasm-pack: specifier: ^0.13.0 @@ -723,7 +723,7 @@ importers: specifier: ^5.7.2 version: 5.7.2 vitest: - specifier: ^2.0.1 + specifier: ^2.1.8 version: 2.1.8(@types/node@22.10.5)(happy-dom@16.3.0)(jsdom@25.0.1)(msw@2.7.0(@types/node@22.10.5)(typescript@5.7.2)) packages/suins-toolkit: @@ -745,7 +745,7 @@ importers: specifier: ^5.7.2 version: 5.7.2 vitest: - specifier: ^2.0.1 + specifier: ^2.1.8 version: 2.1.8(@types/node@22.10.5)(happy-dom@16.3.0)(jsdom@25.0.1)(msw@2.7.0(@types/node@22.10.5)(typescript@5.7.2)) packages/typescript: @@ -851,7 +851,7 @@ importers: specifier: ^5.1.4 version: 5.1.4(typescript@5.7.2)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.7.0)) vitest: - specifier: ^2.0.1 + specifier: ^2.1.8 version: 2.1.8(@types/node@22.10.5)(happy-dom@16.3.0)(jsdom@25.0.1)(msw@2.7.0(@types/node@22.10.5)(typescript@5.7.2)) wait-on: specifier: ^8.0.1 @@ -907,7 +907,7 @@ importers: specifier: ^5.7.2 version: 5.7.2 vitest: - specifier: ^2.0.1 + specifier: ^2.1.8 version: 2.1.8(@types/node@22.10.5)(happy-dom@16.3.0)(jsdom@25.0.1)(msw@2.7.0(@types/node@22.10.5)(typescript@5.7.2)) packages: @@ -937,7 +937,7 @@ packages: resolution: {integrity: sha512-9anThAaj1dQr6IGmzBMcfzOQKTa5artjuPmw8NYK/fiGEMjADbSguBY2FMDykt+QhilR3wc9VA/3yVju7JHg7Q==} hasBin: true peerDependencies: - graphql: ^16.8.1 + graphql: '*' '@ardatan/sync-fetch@0.0.1': resolution: {integrity: sha512-xhlTqH0m31mnsG0tIP4ETgfSB6gXDaYYsUWTrlUV93fFQPI9dd8hE0Ot6MHLCtqgB32hwJAC3YZMWlXZw7AleA==}