Skip to content

Commit

Permalink
feat: migrate to TSC, TS 5 and NodeNext (#126)
Browse files Browse the repository at this point in the history
* feat: migrate to TSC, TS 5 and NodeNext

* chore: changeset

* chore: change action

* chore: change build order

* chore: change type test command

* chore: change ci

* chore: change linter

* chore: revert change

* chore: undo revert change

* refactor(build, ci): setup

* chore: enable exactOptionalPropertyTypes and noUncheckedIndexedAccess & fix test

* revert test

* ci: update verify

* ci: pr

* ci: remove duplicate cache code

* ci: add codecov

* chore: remove twoslash patch

* chore: update changeset

* ci: snapshot action

* chore: debug size

* chore: rename

---------

Co-authored-by: Tom Meagher <tom@meagher.co>
  • Loading branch information
Raiden1411 and tmm committed Apr 29, 2023
1 parent 56228df commit 7ccc347
Show file tree
Hide file tree
Showing 107 changed files with 1,433 additions and 2,156 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-flies-attack.md
@@ -0,0 +1,5 @@
---
"abitype": patch
---

Switched from `tsup` to `tsc`.
18 changes: 18 additions & 0 deletions .github/actions/install-dependencies/action.yml
@@ -0,0 +1,18 @@
name: "Install dependencies"
description: "Prepare repository and all dependencies"

runs:
using: "composite"
steps:
- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up node
uses: actions/setup-node@v3
with:
cache: pnpm
node-version: 18

- name: Install dependencies
shell: bash
run: pnpm install
2 changes: 1 addition & 1 deletion .github/workflows/lock-issue.yml
Expand Up @@ -14,10 +14,10 @@ jobs:
- uses: dessant/lock-threads@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-lock-inactive-days: '14'
issue-comment: |
This issue has been locked since it has been closed for more than 14 days.
If you found a concrete bug or regression related to it, please open a new [bug report](https://github.com/wagmi-dev/abitype/issues/new/choose) with a reproduction against the latest ABIType version. If you have any other comments you can create a new [discussion](https://github.com/wagmi-dev/abitype/discussions).
issue-lock-reason: ''
issue-inactive-days: '14'
process-only: 'issues'
187 changes: 0 additions & 187 deletions .github/workflows/main.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/on-pull-request.yml
@@ -0,0 +1,46 @@
name: Pull request
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
verify:
name: Verify
uses: ./.github/workflows/verify.yml
secrets: inherit

bench:
name: Benchmark
runs-on: ubuntu-latest
timeout-minutes: 5

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

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

- name: Bench
run: pnpm bench

size:
name: Size
runs-on: ubuntu-latest
timeout-minutes: 5

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

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

- name: Report build size
uses: preactjs/compressed-size-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
61 changes: 61 additions & 0 deletions .github/workflows/on-push-to-main.yml
@@ -0,0 +1,61 @@
name: Main
on:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
verify:
name: Verify
uses: ./.github/workflows/verify.yml
secrets: inherit

snapshot:
name: Snapshot
needs: verify
runs-on: ubuntu-latest
timeout-minutes: 5

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

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

- name: Publish snapshots
uses: seek-oss/changesets-snapshot@v0
with:
pre-publish: pnpm build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

changesets:
name: Changesets
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Clone repository
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

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

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
with:
title: 'chore: version packages'
commit: 'chore: version packages'
publish: pnpm changeset:release
version: pnpm changeset:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53 changes: 0 additions & 53 deletions .github/workflows/release-canary.yml

This file was deleted.

0 comments on commit 7ccc347

Please sign in to comment.