Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/wagmi-dev/abitype into zod-…
Browse files Browse the repository at this point in the history
…abi-fallback-inputs
  • Loading branch information
tmm committed Aug 6, 2024
2 parents d5dadf7 + 9a0995d commit e9cb8ee
Show file tree
Hide file tree
Showing 112 changed files with 10,399 additions and 5,732 deletions.
7 changes: 2 additions & 5 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
"$schema": "https://unpkg.com/@changesets/config@2.1.0/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": [
"@changesets/changelog-github",
{ "repo": "wagmi-dev/abitype" }
],
"changelog": ["@changesets/changelog-github", { "repo": "wevm/abitype" }],
"commit": false,
"ignore": ["default-register", "functions", "performance"],
"ignore": ["default-register", "docs", "functions", "performance"],
"updateInternalDependencies": "patch",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
Expand Down
33 changes: 14 additions & 19 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Thanks for your interest in contributing to ABIType! Please take a moment to review this document **before submitting a pull request.**

If you want to contribute, but aren't sure where to start, you can create a [new discussion](https://github.com/wagmi-dev/abitype/discussions).
If you want to contribute, but aren't sure where to start, you can create a [new discussion](https://github.com/wevm/abitype/discussions).

> **Note** **Please ask first before starting work on any significant new features.**
>
> It's never a fun experience to have your pull request declined after investing time and effort into a new feature. To avoid this from happening, we request that contributors create a [feature request](https://github.com/wagmi-dev/abitype/discussions/new?category=ideas) to first discuss any API changes or significant new ideas.
> It's never a fun experience to have your pull request declined after investing time and effort into a new feature. To avoid this from happening, we request that contributors create a [feature request](https://github.com/wevm/abitype/discussions/new?category=ideas) to first discuss any API changes or significant new ideas.
<br>

Expand Down Expand Up @@ -39,51 +39,49 @@ This guide covers more advanced topics. Pick the topics based on your needs.
To start contributing to the project, clone it to your local machine using git:

```bash
git clone https://github.com/wagmi-dev/abitype.git
git clone https://github.com/wevm/abitype.git
```

Or the [GitHub CLI](https://cli.github.com):

```bash
gh repo clone wagmi-dev/abitype
gh repo clone wevm/abitype
```

<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>

## Installing Node.js and pnpm
## 2. Installing Node.js and pnpm

ABIType uses [pnpm](https://pnpm.io) as its package manager. You need to install **Node.js v16 or higher** and **pnpm v7 or higher**.

You can run the following commands in your terminal to check your local Node.js and npm versions:
ABIType uses Node.js with [pnpm workspaces](https://pnpm.io/workspaces) to manage multiple projects. You can run the following command in your terminal to check your local Node.js version.

```bash
node -v
pnpm -v
```

If the versions are not correct or you don't have Node.js or pnpm installed, download and follow their setup instructions:
If **`node@22`** is not installed, you can install via [fnm](https://github.com/Schniz/fnm) or from the [official website](https://nodejs.org).

Once Node.js is installed, run the following to install [Corepack](https://nodejs.org/api/corepack.html). Corepack automatically installs and manages pnpm.

- Install Node.js using [fnm](https://github.com/Schniz/fnm) or from the [official website](https://nodejs.org)
- Install [pnpm](https://pnpm.io/installation)
```bash
corepack enable
```

<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>

## Installing dependencies

Once in the project's root directory, run the following command to install the project's dependencies:
Once in the project's root directory, run the following command to install pnpm (via Corepack) and the project's dependencies:

```bash
pnpm install
```

After the install completes, pnpm links packages across the project for development and [git hooks](https://github.com/toplenboren/simple-git-hooks) are set up.

> **Note:** In case you have to install new packages or upgrade packages make sure to use **pnpm@8.8.0** and **typescript@5.0.4**
<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>
Expand All @@ -94,11 +92,8 @@ Tests are run with [Vitest](https://vitest.dev/guide/testing-types.html):

```bash
pnpm test
pnpm test:typecheck
```

> **Note** Ensure to build the package (`pnpm build`) before running the `test:typecheck` suite.
<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>
Expand Down Expand Up @@ -160,7 +155,7 @@ The first time a PR with a changeset is merged after a release, a new PR will au

### Creating a snapshot release

If a PR has changesets, you can create a [snapshot release](https://github.com/changesets/changesets/blob/main/docs/snapshot-releases.md) by [manually dispatching](https://github.com/wagmi-dev/abitype/actions/workflows/snapshot.yml) the Snapshot workflow. This publishes a tagged version to npm with the PR branch name and timestamp.
If a PR has changesets, you can create a [snapshot release](https://github.com/changesets/changesets/blob/main/docs/snapshot-releases.md) by [manually dispatching](https://github.com/wevm/abitype/actions/workflows/snapshot.yml) the Snapshot workflow. This publishes a tagged version to npm with the PR branch name and timestamp.

<div align="right">
<a href="#advanced-guide">&uarr; back to top</a></b>
Expand Down
37 changes: 19 additions & 18 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@ 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/wagmi-dev?metadata_campaign=gh_issue), your issues are prioritized.
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 [Wevm Sponsor](https://github.com/sponsors/wevm?metadata_campaign=gh_issue), your issues are prioritized.
- type: textarea
attributes:
label: Describe the bug
description: Clear and concise description of what the bug. If you intend to submit a PR for this issue, tell us in the description. Thanks!
placeholder: I am doing… What I expect is… What actually happening is
description: Clear and concise description of the bug. If you intend to submit a PR for this issue, tell us in the description. Thanks!
placeholder: I am doing… What I expect is… What is actually happening…
validations:
required: true

- type: input
id: reproduction
attributes:
label: Link to Minimal Reproducible Example
description: Please provide a link to a [TypeScript Playground](https://tsplay.dev/wjQvkW). This makes investigating issues and helping you out significantly easier! 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 a generic error message) and has no reproduction, it will receive a "needs reproduction" label. If no reproduction is provided after 3 days, it will be auto-closed.
description: "Please provide a link that can reproduce the problem: GitHub repository for runtime issues or [TypeScript Playground](https://tsplay.dev/wjQvkW) 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://tsplay.dev/wjQvkW
validations:
required: false
Expand All @@ -33,32 +36,30 @@ body:
attributes:
label: Package Version
description: What version of abitype are you using?
placeholder: x.y.z
placeholder: x.y.z (do not write `latest`)
validations:
required: true

- type: input
attributes:
label: TypeScript Version
description: What version of TypeScript are you using? ABIType requires `typescript@>=4.9.4`.
placeholder: x.y.z
description: What version of TypeScript are you using? ABIType requires `typescript@>=5.0.4`.
placeholder: x.y.z (do not write `latest`)
validations:
required: true

- type: checkboxes
attributes:
label: Check existing issues
description: By submitting this issue, you checked there isn't [already an issue](https://github.com/wevm/abitype/issues) for this bug.
options:
- label: I checked there isn't [already an issue](https://github.com/wevm/abitype/issues) for the bug I encountered.
required: true

- type: textarea
attributes:
label: Anything else?
description: Anything that will give us more context about the issue you are encountering. (You can attach images or files by clicking this area to highlight and then dragging files in.)
description: Anything that will give us more context about the issue you are encountering.
validations:
required: false

- type: checkboxes
id: checkboxes
attributes:
label: Validations
description: Before submitting this issue, please make sure you do the following.
options:
- label: Checked there isn't [already an issue](https://github.com/wagmi-dev/abitype/issues) that exists for the bug you encountered.
required: true
- label: Followed the [Code of Conduct](https://github.com/wagmi-dev/.github/blob/main/CODE_OF_CONDUCT.md).
required: true
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Question
url: https://github.com/wagmi-dev/abitype/discussions/new?category=q-a
url: https://github.com/wevm/abitype/discussions/new?category=q-a
about: Ask questions and discuss with other community members.
- name: Feature Request
url: https://github.com/wagmi-dev/abitype/discussions/new?category=ideas
url: https://github.com/wevm/abitype/discussions/new?category=ideas
about: Requests features or brainstorm ideas for new functionality.
18 changes: 0 additions & 18 deletions .github/actions/install-dependencies/action.yml

This file was deleted.

17 changes: 9 additions & 8 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
## 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? -->

What changes are made in this PR? Is it a feature or a bug fix?
<!----------------------------------------------------------------------
Before creating the pull request, please make sure you do the following:
## Additional Information
- Read the Contributing Guidelines at https://github.com/wevm/abitype/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.
Before submitting this issue, please make sure you do the following.

- [ ] Read the [contributing guide](https://github.com/wagmi-dev/abitype/blob/main/.github/CONTRIBUTING.md)
- [ ] Added documentation related to the changes made.
- [ ] Added or updated tests (and snapshots) related to the changes made.
Thank you for contributing to ABIType!
----------------------------------------------------------------------->
43 changes: 0 additions & 43 deletions .github/workflows/canary.yml

This file was deleted.

46 changes: 41 additions & 5 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ jobs:
secrets: inherit

changesets:
name: Create pull request or publish
name: Publish
needs: verify
permissions: write-all
permissions:
contents: write
id-token: write
pull-requests: write
runs-on: ubuntu-latest
timeout-minutes: 5

Expand All @@ -28,9 +31,9 @@ jobs:
fetch-depth: 0

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

- name: Create version pull request or publish to npm
- name: PR or publish
uses: changesets/action@v1
with:
title: 'chore: version packages'
Expand All @@ -40,4 +43,37 @@ jobs:
version: pnpm changeset:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish prerelease
if: steps.changesets.outputs.published != 'true'
continue-on-error: true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
git reset --hard origin/main
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
needs: verify
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
id-token: write

steps:
- name: Clone repository
uses: actions/checkout@v4

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

- name: Publish to JSR
run: pnpm version:update && cd packages/abitype && pnpx jsr publish --allow-slow-types --allow-dirty
17 changes: 0 additions & 17 deletions .github/workflows/close-issue.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Issue Labeled

on:
issues:
types: [labeled]

jobs:
issue-labeled:
if: ${{ github.repository_owner == 'wevm' }}
uses: wevm/actions/.github/workflows/issue-labeled.yml@main
with:
needs-reproduction-body: |
Hello @${{ github.event.issue.user.login }}.
Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a [TypeScript Playground](https://www.typescriptlang.org/play) or a separate minimal GitHub repository.
[Minimal reproductions are required](https://antfu.me/posts/why-reproductions-are-required) as they save us a lot of time reproducing your config/environment and issue, and allow us to help you faster.
Once a minimal reproduction is added, a team member will confirm it works, then re-open the issue.
Loading

0 comments on commit e9cb8ee

Please sign in to comment.