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 May 28, 2024
2 parents 65699e9 + 3acc1c0 commit 86f866b
Show file tree
Hide file tree
Showing 104 changed files with 1,532 additions and 3,098 deletions.
5 changes: 0 additions & 5 deletions .changeset/thin-mirrors-ring.md

This file was deleted.

28 changes: 14 additions & 14 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
name: Bug Report
description: File a bug/issue
title: 'bug: <title>'
description: Report bugs or issues.
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! The more info you provide, the more we can help you. If you are a [Sponsor](https://github.com/sponsors/wevm?metadata_campaign=gh_issue), your issues are prioritized.
Thanks for taking the time to fill out this bug report! The more info you provide, the more we can help you.
If you are a [Viem Sponsor](https://github.com/sponsors/wevm?metadata_campaign=gh_issue), your issues are prioritized.
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
label: Check existing issues
description: By submitting this issue, you checked there isn't [already an issue](https://github.com/wevm/viem/issues) for this bug.
options:
- label: I have searched the existing issues
- label: I checked there isn't [already an issue](https://github.com/wevm/viem/issues) for the bug I encountered.
required: true

- type: input
attributes:
label: Package Version
description: What version of viem are you using?
placeholder: 0.1.0
label: Viem Version
description: What version of Viem are you using?
placeholder: x.y.z (do not write `latest`)
validations:
required: true

Expand All @@ -45,12 +46,11 @@ body:
required: false

- type: input
id: reproduction
attributes:
label: Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
description: |
Please provide a link via [new.viem.sh](https://new.viem.sh/) or a link to a minimal repository that can reproduce the problem you ran into.
This makes investigating issues and helping you out significantly easier! For most issues, you will likely get asked to provide one so why not add one now :)
placeholder: https://new.viem.sh/
label: Link to Minimal Reproducible Example
description: "Please provide a link that can reproduce the problem: [new.viem.sh](https://new.viem.sh) for runtime issues or [TypeScript Playground](https://www.typescriptlang.org/play) for type issues. For most issues, you will likely get asked to provide a minimal reproducible example so why not add one now :) If a report is vague (e.g. just snippets, generic error message, screenshot, etc.) and has no reproduction, it will receive a \"Needs Reproduction\" label and be auto-closed."
placeholder: https://new.viem.sh
validations:
required: false

Expand Down
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/docs_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Documentation Issue
description: Tell us about missing or incorrect documentation.
labels: ['A: Docs']
body:
- type: markdown
attributes:
value: |
Thank you for submitting a documentation request. It helps make Viem better.
If it's a small change, like misspelling or example that needs updating, feel free to submit a PR instead of creating this issue.
- type: dropdown
attributes:
label: What is the type of issue?
multiple: true
options:
- Documentation is missing
- Documentation is incorrect
- Documentation is confusing
- Example code is not working
- Something else

- type: textarea
attributes:
label: What is the issue?
validations:
required: true

- type: textarea
attributes:
label: Where did you find it?
description: Please provide the URL(s) where you found this issue.
validations:
required: true

19 changes: 5 additions & 14 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,14 @@ description: "Prepare repository and all dependencies"
runs:
using: "composite"
steps:
- name: Set up Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.30
- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1

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

- name: Set up Foundry
uses: foundry-rs/foundry-toolchain@v1

# TODO(3074): Remove this when 3074 supported natively in Anvil.
- name: Set up Docker
uses: docker-practice/actions-setup-docker@master
- name: Set up bun
uses: wevm/actions/.github/actions/bun@main

- name: Install dependencies
shell: bash
run: bun install
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Description

<!-- What is this PR solving? Write a clear description or reference the issues it solves (e.g. `fixes #123`). What other alternatives have you explored? Are there any parts you think require more attention from reviewers? -->

<!----------------------------------------------------------------------
Before creating the pull request, please make sure you do the following:
- Read the Contributing Guidelines at https://github.com/wevm/viem/blob/main/.github/CONTRIBUTING.md
- Check that there isn't already a PR that solves the problem the same way. If you find a duplicate, please help us review it.
- Update the corresponding documentation if needed.
- Include relevant tests that fail without this PR, but pass with it.
Thank you for contributing to Viem!
----------------------------------------------------------------------->

41 changes: 0 additions & 41 deletions .github/workflows/canary.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
permissions:
contents: write
id-token: write
pull-requests: write

steps:
- name: Clone repository
Expand All @@ -68,6 +69,22 @@ jobs:
# 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
jsr:
name: JSR
needs: verify
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Snapshot
on:
workflow_dispatch:

jobs:
canary:
name: Release snapshot version
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
timeout-minutes: 5

steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: 'recursive'

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

- name: Publish Snapshots
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: |
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
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Check chains
name: Test Chains
on:
workflow_dispatch:
workflow_call:
pull_request:
paths:
- src/chains/**
- src/chains/definitions/**

jobs:
chaincheck:
name: Check chains
test:
name: Test
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 10
Expand All @@ -19,8 +19,11 @@ jobs:
with:
submodules: 'recursive'

- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install dependencies
uses: ./.github/actions/install-dependencies
uses: wevm/actions/.github/actions/bun@main

- name: Check chain
run: bun run chaincheck
- name: Run tests
run: bun run test:chains
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: ./.github/actions/install-dependencies

- name: Lint code
run: bun format && bun lint:fix
run: bun run lint

- uses: stefanzweifel/git-auto-commit-action@v5
env:
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "test/invokers"]
path = test/invokers
url = https://github.com/anton-rs/3074-invokers.git
5 changes: 3 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
"CHANGELOG.md",
"cache",
"test/contracts",
"test/chains",
"test/invokers",
"test/kzg/*.json",
"test/kzg/*.txt",
"coverage",
Expand Down Expand Up @@ -46,6 +44,8 @@
"noUnusedVariables": "error"
},
"performance": {
"noBarrelFile": "error",
"noReExportAll": "error",
"noDelete": "off"
},
"style": {
Expand All @@ -56,6 +56,7 @@
"noArrayIndexKey": "off",
"noAssignInExpressions": "off",
"noConfusingVoidType": "off",
"noConsoleLog": "error",
"noExplicitAny": "off",
"noRedeclare": "off"
}
Expand Down
Binary file modified bun.lockb
Binary file not shown.
23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,24 @@
"build:trustedSetups:start": "mv src/node/trustedSetups.ts src/node/trustedSetups_esm.ts && mv src/node/trustedSetups_cjs.ts src/node/trustedSetups.ts",
"build:trustedSetups:end": "mv src/node/trustedSetups.ts src/node/trustedSetups_cjs.ts && mv src/node/trustedSetups_esm.ts src/node/trustedSetups.ts",
"build:types": "tsc --project ./tsconfig.build.json --module esnext --declarationDir ./src/_types --emitDeclarationOnly --declaration --declarationMap",
"chaincheck": "bun test test/chains/check.test.ts",
"changeset": "changeset",
"changeset:publish": "bun scripts/updateVersion.ts && bun run prepublishOnly && bun run build && changeset publish",
"changeset:version": "changeset version && bun install --lockfile-only && bun scripts/updateVersion.ts",
"changeset:prepublish": "bun run version:update && bun scripts/prepublishOnly.ts && bun run build",
"changeset:publish": "bun run changeset:prepublish && changeset publish",
"changeset:version": "changeset version && bun install --lockfile-only && bun version:update",
"clean": "rimraf src/_esm src/_cjs src/_types",
"contracts:build": "forge build --config-path ./test/foundry.toml && bun run contracts:build:invoker && bun ./scripts/generateTypedArtifacts.ts",
"contracts:build:invoker": "cd test/invokers && docker run --rm -v $(pwd):/app/foundry -u $(id -u):$(id -g) ghcr.io/paradigmxyz/foundry-alphanet:latest --foundry-directory /app/foundry --foundry-command 'forge build'",
"contracts:build": "forge build --config-path ./test/foundry.toml && bun ./scripts/generateTypedArtifacts.ts",
"docs:dev": "cd site && bun run dev",
"docs:build": "cd site && bun run build",
"docs:preview": "cd site && bun run preview",
"format": "biome format . --write",
"lint": "biome check .",
"lint:fix": "bun run lint --apply",
"lint": "biome check . --apply",
"postinstall": "git submodule update --init --recursive && bun run contracts:build",
"prepare": "bun x simple-git-hooks",
"prepublishOnly": "bun scripts/prepublishOnly.ts",
"size": "size-limit",
"test": "vitest -c ./test/vitest.config.ts dev",
"test:cov": "vitest dev -c ./test/vitest.config.ts --coverage",
"test:chains": "vitest test/chains.test.ts",
"test:ci": "CI=true vitest -c ./test/vitest.config.ts --coverage --retry=3 --bail=1 --pool=forks",
"test:cov": "vitest dev -c ./test/vitest.config.ts --coverage",
"test:env": "bun run test:env:bun && bun run test:env:next && bun run test:env:node && bun run test:env:vite && bun run test:env:sveltekit",
"test:env:bun": "cd environments/bun && bun run test",
"test:env:next": "cd environments/next && bun run test",
Expand All @@ -40,9 +38,10 @@
"test:env:vite": "cd environments/vite && bun run test",
"test:typecheck": "SKIP_GLOBAL_SETUP=true vitest --typecheck.only -c ./test/vitest.config.ts",
"test:ui": "vitest dev -c ./test/vitest.config.ts --ui",
"typecheck": "tsc --noEmit",
"vectors": "bun test vectors/**/*.test.ts",
"vectors:generate": "bun vectors/generate.ts",
"typecheck": "tsc --noEmit"
"version:update": "bun scripts/updateVersion.ts"
},
"devDependencies": {
"@actions/core": "^1.10.0",
Expand All @@ -52,11 +51,11 @@
"@changesets/cli": "^2.23.2",
"@ethereumjs/rlp": "^5.0.0",
"@size-limit/preset-big-lib": "^11.1.2",
"@types/bun": "^1.1.3",
"@types/fs-extra": "^9.0.13",
"@viem/anvil": "0.0.10",
"@vitest/coverage-v8": "^1.0.4",
"@vitest/ui": "^1.0.4",
"bun-types": "^1.0.1",
"c-kzg": "^2.1.2",
"ethers": "^6.0.2",
"fs-extra": "^10.1.0",
Expand All @@ -70,6 +69,6 @@
},
"trustedDependencies": ["c-kzg"],
"simple-git-hooks": {
"pre-commit": "bun run format && bun run lint:fix"
"pre-commit": "bun run lint"
}
}
Loading

0 comments on commit 86f866b

Please sign in to comment.