Skip to content
Open
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
13 changes: 13 additions & 0 deletions .changeset/migrate-monorepo-to-bun.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@sei-js/precompiles": major
"@sei-js/registry": major
"@sei-js/sei-global-wallet": major
"@sei-js/mcp-server": major
"@sei-js/create-sei": major
---

Migrate the monorepo to Bun and publish ESM-only packages.

**Breaking:** all packages drop CommonJS (`require`) entry points and flatten `dist/`. Consumers must use ESM `import`. `@sei-js/precompiles` now ships an `exports` map with working `./ethers`, `./viem`, and `./precompiles` subpaths. `@sei-js/sei-global-wallet` keeps the `./solana` entrypoint.

Install, build, and test with Bun (`bun install`, `bun run build`, `bun run test`). `@sei-js/mcp-server` now requires Node.js 20 or newer. The MCP server and precompiles development toolchain pin Viem to `2.37.2`, the last compatible release that includes `seiDevnet`. Generated apps target the new `@sei-js/precompiles` major. Packages continue to publish to npm via Changesets.
30 changes: 21 additions & 9 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Checks

on: [push]
on:
push:
branches: [main]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
Expand All @@ -9,27 +16,32 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch the full history instead of a shallow clone
fetch-depth: 0
submodules: recursive

- uses: actions/setup-node@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'

- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y rsync

- name: Install dependencies
run: pnpm install --frozen-lockfile
run: bun install --frozen-lockfile

- name: Lint, Format & Type Check
run: bun run check

- name: Build All Packages
run: pnpm build:all
run: bun run build

- name: Test
run: pnpm test:all
run: bun run test

- name: Validate Published Packages
run: pnpm lint:pack:all
run: bun run lint:pack:all
50 changes: 27 additions & 23 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,53 @@ name: Run & Upload Test Coverage

on:
push:
branches:
- main
branches: [main]
pull_request:
branches:
- main
- feature/**

jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- package: precompiles
flag: precompiles
- package: registry
flag: registry
- package: sei-global-wallet
flag: sei-global-wallet
- package: mcp-server
flag: mcp-server

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch the full history instead of a shallow clone
fetch-depth: 0
submodules: recursive
- name: Use Node.js

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- uses: browser-actions/setup-chrome@v1
- run: chrome --version

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y rsync
- uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build packages
run: pnpm build:all
run: bun install --frozen-lockfile

- name: Run Jest tests
run: pnpm test:coverage
- name: Run ${{ matrix.package }} tests with coverage
run: bun test --isolate --coverage --coverage-reporter=lcov --coverage-dir=coverage/${{ matrix.flag }} packages/${{ matrix.package }}/src

- name: Upload coverage reports to Codecov
- name: Upload ${{ matrix.package }} coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: '**/coverage-final.json'
files: coverage/${{ matrix.flag }}/lcov.info
flags: ${{ matrix.flag }}
name: ${{ matrix.flag }}
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,29 @@ jobs:
- name: Setup Node.js (for npm OIDC publishing)
uses: actions/setup-node@v4
with:
node-version: '24'
node-version-file: '.nvmrc'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] The step name still says "for npm OIDC publishing" but the version is now indirect via .nvmrc. npm OIDC trusted publishing needs npm >= 11.5.1, which is why this was hard-pinned to '24'. It resolves to 24 today, but a future .nvmrc change for the Bun/dev toolchain would silently break publishing here. Either keep node-version: '24' on this step or add a comment on .nvmrc noting that release.yml depends on it.

registry-url: 'https://registry.npmjs.org'

- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'

- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y rsync

- name: Install Dependencies
run: pnpm install --frozen-lockfile
run: bun install --frozen-lockfile

- name: Build Packages
run: pnpm build:all
run: bun run build

- name: Validate Published Packages
run: pnpm lint:pack:all
run: bun run lint:pack:all

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# Release builds the packages and calls changeset publish
publish: pnpm release
publish: bun run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# testing
packages/*/coverage
packages/*/coverage.json

examples/

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
24
44 changes: 26 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,39 @@ SeiJS is a monorepo that contains multiple NPM libraries for writing application

SeiJS consists of smaller NPM packages within the @sei-js namespace. See the package READMEs below for usage details.

| Package | Description |
|---------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|
| [@sei-js/precompiles](packages/precompiles) | Typescript library containing helper functions for interacting with Sei's precompile contracts. |
| [@sei-js/create-sei](packages/create-sei) | CLI Tool used to quickly spin up Sei Projects and dApps in either the cosmos or EVM ecosystem |
| [@sei-js/mcp-server](packages/mcp-server) | MCP server for interacting with Sei via LLM's and agents |
| [@sei-js/sei-global-wallet](packages/sei-global-wallet) | A global wallet conforming to EIP-6963 allowing for AA across dApps. |
| Package | Description |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| [@sei-js/precompiles](packages/precompiles) | Typescript library containing helper functions for interacting with Sei's precompile contracts. |
| [@sei-js/create-sei](packages/create-sei) | CLI Tool used to quickly spin up Sei Projects and dApps in either the cosmos or EVM ecosystem |
| [@sei-js/mcp-server](packages/mcp-server) | MCP server for interacting with Sei via LLM's and agents |
| [@sei-js/sei-global-wallet](packages/sei-global-wallet) | A global wallet conforming to EIP-6963 allowing for AA across dApps. |
| [@sei-js/registry](packages/registry) | TypeScript library for Sei chain constants and assets. |

## Development

This project uses [Bun](https://bun.sh) for package management, tests, and scripts. Packages are still published to npm as ESM-only libraries.

### Prerequisites

This project uses Yarn 4.7.0 with Corepack for package management. To get started:
Install Bun 1.3.14: https://bun.sh/docs/installation

Node.js 24 is pinned in `.nvmrc` for npm package validation and OIDC publishing; Bun remains the workspace package manager and test runner.

### Install, build, test

1. **Enable Corepack** (if not already enabled):
```bash
corepack enable
```
```bash
git submodule update --init --recursive
bun install
bun run build
bun run test
```

2. **Install dependencies**:
```bash
yarn install
```
Lint and format with Biome:

The correct Yarn version will be automatically used thanks to the `packageManager` field in `package.json` and Corepack.
```bash
bun run check
```

### Building
### Publishing

To build all packages, run `pnpm install` then `pnpm build:all`
Releases still go through Changesets and publish to npm (OIDC). Merging to `main` opens a Version Packages PR; merging that publishes.
31 changes: 15 additions & 16 deletions REVIEW.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Review guidelines for AI agents

Repo-specific conventions for automated PR review (Codex, Cursor, Claude, and
any other AI reviewer). This is a pnpm workspace that publishes five
any other AI reviewer). This is a Bun workspace that publishes five
independently versioned `@sei-js/*` packages to npm, so a defect ships to every
downstream dApp that upgrades rather than to a single deployment we control.
Calibrate accordingly: a wrong precompile address or a weakened wallet guard is
Expand Down Expand Up @@ -59,10 +59,9 @@ the code without releasing it, which is the common miss on this repo.
Ask for a changeset when a published package's behaviour, types, or
dependencies change. Docs-only, CI-only, and changes confined to
`packages/create-sei/templates/**` generally don't need one, though the repo
has deliberately added patch changesets across all six packages for
release-note visibility (the `@asyncapi` pinning in `pnpm.overrides` is the
precedent). Absence of a changeset on that kind of PR is a question, not a
defect.
has deliberately added patch changesets across all five packages for
release-note visibility. Absence of a changeset on that kind of PR is a
question, not a defect.

## 4. Known non-issues — do not flag these

Expand All @@ -88,22 +87,22 @@ defect.
`submodules: recursive`; local source builds must initialize them explicitly.
Their JSON is vendored upstream — review the TypeScript wrappers, not the
data.
- **Biome findings are not enforced anywhere.** `biome.json` configures tabs,
160-column lines, single quotes and no trailing commas, but no package
defines a `biome` script and `.github/workflows/checks.yml` runs only
`pnpm build:all` and `pnpm test:all`. Match the surrounding style; do not
file formatting-only findings as blocking.
- **Biome is enforced in CI.** `bun run check` runs in `.github/workflows/checks.yml`
with tabs, 160-column lines, single quotes and no trailing commas. Match that
style; formatting-only findings that `biome check` already catches do not
need a separate review comment.
- **Test file naming is inconsistent across packages.** `mcp-server` and
`create-sei` use `*.test.ts`; `precompiles`, `registry` and
`sei-global-wallet` use `*.spec.ts` under `__tests__/`. Follow the
convention of the package being changed rather than proposing a repo-wide
rename.
- **`mcp-server` has no Codecov target.** `codecov.yml` defines 80% project
targets for the other four packages only. Thin coverage on an mcp-server PR
is worth mentioning on its merits, but it does not fail a gate.
- **`mcp-server` and `create-sei` have no Codecov target.** `codecov.yml`
defines 80% project targets for the three library packages with meaningful
source coverage. Thin coverage elsewhere is worth mentioning on its merits,
but it does not fail a gate.
- **`noImplicitAny: false` in `tsconfig.base.json`.** This is a deliberate
repo-wide setting. Flag an untyped value when it actually causes an unsound
path, not because the compiler permitted it.
- **The `create-sei` templates are excluded from the root Biome config** and
carry their own toolchain. Do not apply root formatting rules to anything
under `packages/create-sei/templates/`.
- **The `create-sei` templates and extensions are excluded from the root Biome
config** and carry their own toolchain. Do not apply root formatting rules to
scaffold sources under `packages/create-sei/{templates,extensions}/`.
52 changes: 43 additions & 9 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"$schema": "https://biomejs.dev/schemas/2.5.8/schema.json",
"vcs": {
"enabled": false,
"enabled": true,
"clientKind": "git",
"useIgnoreFile": false
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false,
"ignore": ["*/coverage/*", "*/dist/*", "packages/create-sei/templates/**"]
"includes": [
"**",
"!**/coverage",
"!**/dist",
"!**/node_modules",
"!**/bun.lock",
"!packages/create-sei/templates",
Comment thread
alexander-sei marked this conversation as resolved.
"!packages/create-sei/extensions",
"!packages/registry/chain-registry",
"!packages/registry/community-assetlist"
]
},
"formatter": {
"enabled": true,
"indentStyle": "tab",
"lineWidth": 160
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"preset": "recommended",
Comment thread
alexander-sei marked this conversation as resolved.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] I believe the Biome key here is "recommended": true, not "preset": "recommended" — I couldn't verify locally (no node_modules in this checkout). If preset is an unrecognised key, the effect is invisible rather than fatal: Biome's default is recommended: true when the linter is enabled, so the ruleset is unchanged either way and CI stays green. Worth confirming biome check emits no unknown-key diagnostic, since this is now the config that gates every PR.

"correctness": {
"useExhaustiveDependencies": "off"
},
Expand All @@ -35,5 +42,32 @@
"jsxQuoteStyle": "double",
"trailingCommas": "none"
}
}
},
"assist": {
"actions": {
"source": {
"organizeImports": "on"
}
}
},
"overrides": [
{
"includes": ["**/*.test.ts", "**/*.spec.ts", "**/__tests__/**", "**/tests/**"],
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "off"
},
"style": {
"noNonNullAssertion": "off"
},
"correctness": {
"noUnusedFunctionParameters": "off",
"noUnusedImports": "off",
"noUnusedVariables": "off"
}
}
}
}
]
}
Loading
Loading