Skip to content

Commit

Permalink
⚡ chore: Migrate to bun for script runner (#488)
Browse files Browse the repository at this point in the history
## Description

Use bun as script runner. Don't use it to install packages because the
package manager is painful for monorepos

## Testing

Explain the quality checks that have been done on the code changes

## Additional Information

- [ ] I read the [contributing docs](../docs/contributing.md) (if this
is your first contribution)

Your ENS/address:

Co-authored-by: Will Cory <[email protected]>
  • Loading branch information
roninjin10 and Will Cory authored Sep 29, 2023
1 parent 570c4ed commit b8a8440
Show file tree
Hide file tree
Showing 11 changed files with 220 additions and 217 deletions.
3 changes: 3 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ runs:
registry-url: https://registry.npmjs.org
cache: pnpm

- name: Set up Bun
uses: oven-sh/setup-bun@v1

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: ./.github/actions/setup

- name: Run build
run: pnpm nx affected --target=build:types
run: bun nx affected --target=build:types
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
build-dist:
Expand All @@ -38,7 +38,7 @@ jobs:
uses: ./.github/actions/setup

- name: Run build dist
run: pnpm nx affected --target=build:dist
run: bun nx affected --target=build:dist
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: ./.github/actions/setup

- name: Run Linters
run: pnpm lint:check
run: bun lint:check
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

Expand All @@ -39,7 +39,7 @@ jobs:
uses: ./.github/actions/setup

- name: Run Formatters
run: pnpm format:check
run: bun format:check
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

Expand All @@ -55,7 +55,7 @@ jobs:
- name: "Setup"
uses: ./.github/actions/setup

- name: Run Package.json formatter - Run `pnpm sort-package-json` to fix
run: pnpm sort-package-json:check
- name: Run Package.json formatter - Run `bun sort-package-json` to fix
run: bun sort-package-json:check
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
with:
title: "chore: Version packages 🔖"
commit: "chore: Version packages 🔖"
publish: pnpm release:publish
version: pnpm release:version
publish: bun release:publish
version: bun release:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: ./.github/actions/setup

- name: Build
run: pnpm build
run: bun run build
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

Expand All @@ -38,7 +38,7 @@ jobs:
- name: Publish snapshots
uses: seek-oss/changesets-snapshot@v0
with:
pre-publish: pnpm nx run-many --targets=build,build:dist --skip-nx-cache
pre-publish: bun nx run-many --targets=build,build:dist --skip-nx-cache
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: ./.github/actions/setup

- name: Run tests
run: pnpm nx run-many --target=test:coverage
run: bun nx run-many --target=test:coverage
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
RPC_URL_MAINNET: ${{ secrets.RPC_URL_MAINNET }}
Expand Down Expand Up @@ -91,6 +91,6 @@ jobs:
run: npx playwright install --with-deps

- name: Run tests
run: echo "WIP" # pnpm nx e2e e2e
run: echo "WIP" # bun nx e2e e2e
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
50 changes: 25 additions & 25 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"name": "@evmts/docs",
"version": "0.0.1",
"private": true,
"contributors": [
"Will Cory <[email protected]>"
],
"type": "module",
"scripts": {
"build": "pnpm build:dist",
"build:dist": "vitepress build .",
"dev": "vitepress dev .",
"format": "rome format . --write",
"format:check": "rome format .",
"preinstall": "npx only-allow pnpm",
"lint": "rome check . --apply-unsafe",
"lint:check": "rome check . --verbose",
"package:up": "pnpm up --latest",
"preview": "vitepress preview ."
},
"devDependencies": {
"@vue/runtime-dom": "^3.3.4",
"@vue/server-renderer": "^3.3.4",
"rome": "^12.1.3",
"vitepress": "1.0.0-rc.9"
}
"name": "@evmts/docs",
"version": "0.0.1",
"private": true,
"contributors": [
"Will Cory <[email protected]>"
],
"type": "module",
"scripts": {
"build": "bun build:dist",
"build:dist": "vitepress build .",
"dev": "vitepress dev .",
"format": "rome format . --write",
"format:check": "rome format .",
"preinstall": "npx only-allow pnpm",
"lint": "rome check . --apply-unsafe",
"lint:check": "rome check . --verbose",
"package:up": "pnpm up --latest",
"preview": "vitepress preview ."
},
"devDependencies": {
"@vue/runtime-dom": "^3.3.4",
"@vue/server-renderer": "^3.3.4",
"rome": "^12.1.3",
"vitepress": "1.0.0-rc.9"
}
}
52 changes: 26 additions & 26 deletions examples/bun/package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"name": "@evmts/example-bun",
"version": "0.0.1",
"private": true,
"contributors": [
"Will Cory <[email protected]>"
],
"scripts": {
"dev": "bun --watch readContract.ts",
"test": "bun test"
},
"dependencies": {
"@evmts/core": "^0.11.2",
"bun-types": "^0.8.1",
"viem": "^1.2.12"
},
"devDependencies": {
"@evmts/bun-plugin": "workspace:^",
"@evmts/esbuild-plugin": "workspace:^",
"@evmts/ts-plugin": "workspace:^",
"@openzeppelin/contracts": "^4.9.2",
"@types/live-server": "^1.2.1",
"@types/node": "^20.4.1",
"solc": "0.8.20",
"typescript": "^5.1.6",
"vitest": "^0.33.0"
}
"name": "@evmts/example-bun",
"version": "0.0.1",
"private": true,
"contributors": [
"Will Cory <[email protected]>"
],
"scripts": {
"dev": "bun --watch readContract.ts",
"test": "bun run test"
},
"dependencies": {
"@evmts/core": "^0.11.2",
"bun-types": "^0.8.1",
"viem": "^1.2.12"
},
"devDependencies": {
"@evmts/bun-plugin": "workspace:^",
"@evmts/esbuild-plugin": "workspace:^",
"@evmts/ts-plugin": "workspace:^",
"@openzeppelin/contracts": "^4.9.2",
"@types/live-server": "^1.2.1",
"@types/node": "^20.4.1",
"solc": "0.8.20",
"typescript": "^5.1.6",
"vitest": "^0.33.0"
}
}
70 changes: 35 additions & 35 deletions examples/next/package.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
{
"name": "@evmts/example-next",
"version": "0.0.2",
"private": true,
"contributors": [
"Will Cory <[email protected]>"
],
"scripts": {
"build": "pnpm build:dist",
"build:dist": "next build",
"dev": "next dev",
"lint": "next lint",
"start": "next start"
},
"dependencies": {
"@evmts/core": "^0.11.2",
"@rainbow-me/rainbowkit": "^1.0.5",
"next": "^13.4.9",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "^1.2.11",
"wagmi": "~1.3.8"
},
"devDependencies": {
"@evmts/config": "^0.10.0",
"@evmts/ts-plugin": "^0.11.2",
"@evmts/webpack-plugin": "^0.11.2",
"@openzeppelin/contracts": "^4.9.2",
"@types/node": "^20.4.1",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"eslint": "^8.44.0",
"eslint-config-next": "^13.4.9",
"solc": "0.8.20",
"typescript": "^5.1.6"
}
"name": "@evmts/example-next",
"version": "0.0.2",
"private": true,
"contributors": [
"Will Cory <[email protected]>"
],
"scripts": {
"build": "bun build:dist",
"build:dist": "next build",
"dev": "next dev",
"lint": "next lint",
"start": "next start"
},
"dependencies": {
"@evmts/core": "^0.11.2",
"@rainbow-me/rainbowkit": "^1.0.5",
"next": "^13.4.9",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "^1.2.11",
"wagmi": "~1.3.8"
},
"devDependencies": {
"@evmts/config": "^0.10.0",
"@evmts/ts-plugin": "^0.11.2",
"@evmts/webpack-plugin": "^0.11.2",
"@openzeppelin/contracts": "^4.9.2",
"@types/node": "^20.4.1",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"eslint": "^8.44.0",
"eslint-config-next": "^13.4.9",
"solc": "0.8.20",
"typescript": "^5.1.6"
}
}
Loading

1 comment on commit b8a8440

@vercel
Copy link

@vercel vercel bot commented on b8a8440 Sep 29, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

evmts-docs – ./

evmts.dev
evmts-docs-git-main-evmts.vercel.app
evmts-docs-evmts.vercel.app

Please sign in to comment.