Skip to content

Commit

Permalink
Merge branch 'wevm:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
nikola-bozin-txfusion authored Jun 9, 2024
2 parents a0bdb5a + 3d240bc commit 4cc270e
Show file tree
Hide file tree
Showing 227 changed files with 14,612 additions and 2,207 deletions.
5 changes: 5 additions & 0 deletions .changeset/forty-books-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

Added API URL to `sei` chain.
5 changes: 0 additions & 5 deletions .changeset/happy-berries-sparkle.md

This file was deleted.

5 changes: 0 additions & 5 deletions .env.example

This file was deleted.

18 changes: 10 additions & 8 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,18 @@ After the install completes, Bun links packages across the project for developme
First, add the following to your environment (recommended to use [`direnv`](https://github.com/direnv/direnv)):

```bash
VITE_ANVIL_FORK_URL=https://rpc
VITE_ANVIL_BLOCK_TIME=1
VITE_ANVIL_BLOCK_NUMBER=16280770
VITE_ANVIL_FORK_URL=
VITE_ANVIL_FORK_URL_OPTIMISM=
VITE_ANVIL_FORK_URL_OPTIMISM_SEPOLIA=
VITE_ANVIL_FORK_URL_SEPOLIA=
VITE_ANVIL_FORK_URL_ZKSYNC=
VITE_BATCH_MULTICALL=false
VITE_NETWORK_TRANSPORT_MODE=http
VITE_ANVIL_PORT=8545
```

`VITE_ANVIL_FORK_URL` can be for any RPC service provider (e.g. Alchemy or Infura) for the mainnet. Now you are ready to run the tests!

- `bun run test` — runs tests in watch mode
- `pnpm test` — runs tests in watch mode

Sometimes there may be some tests which fail unexpectedly – you can press `f` to rerun them and they should pass.

Expand All @@ -134,7 +136,7 @@ When adding new features or fixing bugs, it's important to add test cases to cov
Documentation is crucial to helping developers of all experience levels use viem. viem uses [Vocs](https://vocs.dev) and Markdown for the documentation site (located at [`site`](../site)). To start the site in dev mode, run:

```bash
bun run docs:dev
pnpm docs:dev
```

Try to keep documentation brief and use plain language so folks of all experience levels can understand. If you think something is unclear or could be explained better, you are welcome to open a pull request.
Expand Down Expand Up @@ -170,7 +172,7 @@ When adding new features or fixing bugs, we'll need to bump the package versions
Each changeset defines which package(s) should be published and whether the change should be a major/minor/patch release, as well as providing release notes that will be added to the changelog upon release.

To create a new changeset, run `bun run changeset`. This will run the Changesets CLI, prompting you for details about the change. You’ll be able to edit the file after it’s created — don’t worry about getting everything perfect up front.
To create a new changeset, run `pnpm changeset`. This will run the Changesets CLI, prompting you for details about the change. You’ll be able to edit the file after it’s created — don’t worry about getting everything perfect up front.

Even though you can technically use any markdown formatting you like, headings should be avoided since each changeset will ultimately be nested within a bullet list. Instead, bold text should be used as section headings.

Expand Down Expand Up @@ -308,7 +310,7 @@ export { zora } from './definitions/zora.js'
Add a `patch` changeset with the description `"Added <your chain here> chain."`.

```diff
> bun run changeset
> pnpm changeset

What kind of change is this for viem?
+ patch
Expand Down
File renamed without changes.
9 changes: 2 additions & 7 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ runs:
- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Set up node
uses: actions/setup-node@v4
with:
node-version: 21

- name: Set up bun
uses: wevm/actions/.github/actions/bun@main
- name: Set up pnpm
uses: wevm/actions/.github/actions/pnpm@main

4 changes: 2 additions & 2 deletions .github/actions/setup-wagmi/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ runs:
with:
cache: pnpm
cache-dependency-path: ./wagmi/pnpm-lock.yaml
node-version: 21
node-version: 22

- name: Build viem
shell: bash
run: bun run build
run: pnpm build

- name: Install dependencies
shell: bash
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
with:
commit: 'chore: version package'
title: 'chore: version package'
version: bun run changeset:version
version: pnpm changeset:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -62,28 +62,24 @@ jobs:
uses: changesets/action@v1
with:
createGithubReleases: ${{ github.ref == 'refs/heads/main' }}
publish: bun run changeset:publish
publish: pnpm changeset:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# https://docs.npmjs.com/generating-provenance-statements
NPM_CONFIG_PROVENANCE: true

- name: Publish Prerelease
if: steps.changesets.outputs.published != 'true'
continue-on-error: true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# https://docs.npmjs.com/generating-provenance-statements
NPM_CONFIG_PROVENANCE: true
run: |
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
git reset --hard origin/main
bun run clean
bun run changeset version --no-git-tag --snapshot canary
bun run changeset:prepublish
bun run changeset publish --no-git-tag --snapshot canary --tag canary
pnpm clean
pnpm changeset version --no-git-tag --snapshot canary
pnpm changeset:prepublish
pnpm changeset publish --no-git-tag --snapshot canary --tag canary
jsr:
name: JSR
Expand All @@ -102,4 +98,4 @@ jobs:
uses: ./.github/actions/install-dependencies

- name: Publish to JSR
run: bun ./scripts/updateVersion.ts && cd src && bunx jsr publish --allow-slow-types --allow-dirty
run: pnpm version:update && cd src && pnpx jsr publish --allow-slow-types --allow-dirty
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
uses: andresz1/size-limit-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
package_manager: bun
package_manager: pnpm
10 changes: 4 additions & 6 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# https://docs.npmjs.com/generating-provenance-statements
NPM_CONFIG_PROVENANCE: true
run: |
snapshot=$(git branch --show-current | tr -cs '[:alnum:]-' '-' | tr '[:upper:]' '[:lower:]' | sed 's/-$//')
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
bun run clean
bun run changeset version --no-git-tag --snapshot $snapshot
bun run changeset:prepublish
bun run changeset publish --no-git-tag --snapshot $snapshot --tag $snapshot
pnpm clean
pnpm changeset version --no-git-tag --snapshot $snapshot
pnpm changeset:prepublish
pnpm changeset publish --no-git-tag --snapshot $snapshot --tag $snapshot
6 changes: 3 additions & 3 deletions .github/workflows/test-chains.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install dependencies
uses: wevm/actions/.github/actions/bun@main
- name: Set up pnpm
uses: wevm/actions/.github/actions/pnpm@main

- name: Run tests
run: bun run test:chains
run: pnpm test:chains
19 changes: 8 additions & 11 deletions .github/workflows/test-rpc-providers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:

- name: Build contracts
shell: bash
run: bun run contracts:build
run: pnpm contracts:build

- name: Run tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: bun run test:ci --shard=${{ matrix.shard }}/${{ matrix.total-shards }}
command: pnpm test:ci --shard=${{ matrix.shard }}/${{ matrix.total-shards }}
env:
VITE_ANVIL_BLOCK_NUMBER: ${{ vars.VITE_ANVIL_BLOCK_NUMBER }}
VITE_ANVIL_BLOCK_TIME: ${{ vars.VITE_ANVIL_BLOCK_TIME }}
Expand All @@ -45,7 +45,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
type: ['bun', 'node-18', 'node-20', 'node-latest', 'next', 'sveltekit', 'tsc', 'vite']
type: ['bun', 'node-18', 'node-20', 'node-latest', 'next', 'tsc', 'vite']
include:
- type: bun
runtime: bun
Expand All @@ -60,9 +60,6 @@ jobs:
runtime: node
- type: next
runtime: next
- type: sveltekit
node-version: 18
runtime: sveltekit
- type: tsc
node-version: 20
runtime: tsc
Expand All @@ -88,17 +85,17 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install Playwright Browsers
if: ${{ matrix.runtime == 'next' || matrix.runtime == 'sveltekit' || matrix.runtime == 'vite' }}
run: npx [email protected] install --with-deps
if: ${{ matrix.runtime == 'next' || matrix.runtime == 'vite' }}
run: pnpx [email protected] install --with-deps

- name: Install dependencies
uses: ./.github/actions/install-dependencies

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

- name: Link
run: bun install
run: pnpm install

- name: Run tests
run: bun run test:env:${{ matrix.runtime }}
run: pnpm test:env:${{ matrix.runtime }}
Loading

0 comments on commit 4cc270e

Please sign in to comment.