Skip to content

Commit

Permalink
Merge pull request #10 from Abracadabra-money/feature/switch-to-bun
Browse files Browse the repository at this point in the history
feature: Switch package manager from yarn to bun
  • Loading branch information
0xmDreamy authored Jul 22, 2024
2 parents 28c9321 + 61061c2 commit 0055052
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 9,337 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- working-directory: .
run: yarn
- working-directory:
run: yarn test
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun run lint:ci
- run: bun run test
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lint-staged
Binary file added bun.lockb
Binary file not shown.
6 changes: 1 addition & 5 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import "@gelatonetwork/web3-functions-sdk/hardhat-plugin";
import "@nomiclabs/hardhat-ethers";
import "@foundry-rs/hardhat-anvil";

// Process Env Variables
import * as dotenv from "dotenv";
dotenv.config({ path: `${__dirname}/.env` });

const PRIVATE_KEY = false; //process.env.PRIVATE_KEY;
const PRIVATE_KEY = process.env.PRIVATE_KEY;

const config = {
w3f: {
Expand Down
84 changes: 57 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
"url": "https://github.com/Abracadabra-money/web3-functions",
"private": false,
"scripts": {
"build": "yarn clean && yarn install && npx tsc",
"build": "bun run clean && bun run install && npx tsc",
"clean": "rm -rf dist",
"lint": "biome check .",
"lint:fix": "biome check --write .",
"test": "yarn test:spell-staking && yarn test:magiclvl && yarn test:spell-swapper && yarn test:negative-interests && yarn test:stargate",
"lint": "biome check",
"lint:fix": "biome check --write",
"lint:ci": "biome ci",
"test": "concurrently \"bun:test:*(!test:[^:]+:)\"",
"create-task:gm": "hardhat run ./scripts/create-gm-task.ts --network ethereum",
"create-task:spell-staking": "killall -9 anvil; hardhat run ./scripts/create-spell-staking-task.ts --network anvil",
"create-task:magiclvl": "hardhat run ./scripts/create-magiclvl-task.ts --network anvil",
Expand All @@ -24,52 +25,81 @@
"create-task:velodrome-op-usdc": "hardhat run ./scripts/create-velodrome-op-usdc-task.ts --network anvil",
"create-task:magicape": "hardhat run ./scripts/create-magicape-task.ts --network anvil",
"create-task:xf33d": "hardhat run ./scripts/create-xf33d-task.ts --network anvil",
"test:spell-staking": "yarn test:spell-staking-mainnet && yarn test:spell-staking-avalanche && yarn test:spell-staking-arbitrum && yarn test:spell-staking-fantom",
"test:spell-staking-mainnet": "hardhat w3f-run spell-staking --logs --network ethereum",
"test:spell-staking-avalanche": "hardhat w3f-run spell-staking --logs --network avalanche",
"test:spell-staking-arbitrum": "hardhat w3f-run spell-staking --logs --network arbitrum",
"test:spell-staking-fantom": "hardhat w3f-run spell-staking --logs --network fantom",
"test:spell-staking": "concurrently --kill-others-on-fail bun:test:spell-staking:*",
"test:spell-staking:mainnet": "hardhat w3f-run spell-staking --logs --network ethereum",
"test:spell-staking:avalanche": "hardhat w3f-run spell-staking --logs --network avalanche",
"test:spell-staking:arbitrum": "hardhat w3f-run spell-staking --logs --network arbitrum",
"test:spell-staking:fantom": "hardhat w3f-run spell-staking --logs --network fantom",
"test:gm": "concurrently --kill-others-on-fail -m 1 bun:test:gm:*",
"test:gm:gmarb": "cp web3-functions/gm/userArgs.gmarb.json web3-functions/gm/userArgs.json && hardhat w3f-run gm --logs --network arbitrum",
"test:gm:gmbtc": "cp web3-functions/gm/userArgs.gmbtc.json web3-functions/gm/userArgs.json && hardhat w3f-run gm --logs --network arbitrum",
"test:gm:gmeth": "cp web3-functions/gm/userArgs.gmeth.json web3-functions/gm/userArgs.json && hardhat w3f-run gm --logs --network arbitrum",
"test:gm:gmlink": "cp web3-functions/gm/userArgs.gmlink.json web3-functions/gm/userArgs.json && hardhat w3f-run gm --logs --network arbitrum",
"test:gm:gmsol": "cp web3-functions/gm/userArgs.gmsol.json web3-functions/gm/userArgs.json && hardhat w3f-run gm --logs --network arbitrum",
"test:magiclvl": "hardhat w3f-run magiclvl --logs --network bsc",
"test:process-locks-arb-msr": "cp web3-functions/process-locks/userArgs.arb-msr.json web3-functions/process-locks/userArgs.json && hardhat w3f-run process-locks --logs --network arbitrum",
"test:process-locks-blast-founders": "cp web3-functions/process-locks/userArgs.blast-founders.json web3-functions/process-locks/userArgs.json && hardhat w3f-run process-locks --logs --network arbitrum",
"test:process-locks": "concurrently --kill-others-on-fail -m 1 bun:test:process-locks:*",
"test:process-locks:arb-msr": "cp web3-functions/process-locks/userArgs.arb-msr.json web3-functions/process-locks/userArgs.json && hardhat w3f-run process-locks --logs --network arbitrum",
"test:process-locks:blast-founders": "cp web3-functions/process-locks/userArgs.blast-founders.json web3-functions/process-locks/userArgs.json && hardhat w3f-run process-locks --logs --network arbitrum",
"test:spell-swapper": "hardhat w3f-run spell-swapper --logs --network ethereum",
"test:negative-interests": "cp web3-functions/negative-interests/userArgs.default.json web3-functions/negative-interests/userArgs.json; hardhat w3f-run negative-interests --logs --network ethereum; rm web3-functions/negative-interests/userArgs.json",
"test:negative-interests": "concurrently --kill-others-on-fail -m 1 bun:test:negative-interests:*",
"test:negative-interests:crv": "cp web3-functions/negative-interests/userArgs.crv.json web3-functions/negative-interests/userArgs.json; hardhat w3f-run negative-interests --logs --network ethereum; rm web3-functions/negative-interests/userArgs.json",
"test:negative-interests:default": "cp web3-functions/negative-interests/userArgs.default.json web3-functions/negative-interests/userArgs.json; hardhat w3f-run negative-interests --logs --network ethereum; rm web3-functions/negative-interests/userArgs.json",
"test:reward-distributor": "hardhat w3f-run reward-distributor --logs --network arbitrum",
"test:crv-negative-interests": "cp web3-functions/negative-interests/userArgs.crv.json web3-functions/negative-interests/userArgs.json; hardhat w3f-run negative-interests --logs --network ethereum; rm web3-functions/negative-interests/userArgs.json",
"test:stargate-v1": "hardhat w3f-run stargate-v1 --logs --network ethereum",
"test:stargate-v2-kava": "cp web3-functions/stargate-v2/userArgs.kava.json web3-functions/stargate-v2/userArgs.json; hardhat w3f-run stargate-v2 --logs --network kava; rm web3-functions/stargate-v2/userArgs.json",
"test:magiccurvelp-kava": "cp web3-functions/magiccurvelp/userArgs.kava.json web3-functions/magiccurvelp/userArgs.json; hardhat w3f-run magiccurvelp --logs --network kava; rm web3-functions/magiccurvelp/userArgs.json",
"test:magicglp-avalanche": "cp web3-functions/magicglp/userArgs.avalanche.json web3-functions/magicglp/userArgs.json; hardhat w3f-run magicglp --logs --network avalanche; rm web3-functions/magicglp/userArgs.json",
"test:magicglp-arbitrum": "cp web3-functions/magicglp/userArgs.arbitrum.json web3-functions/magicglp/userArgs.json; hardhat w3f-run magicglp --logs --network arbitrum; rm web3-functions/magicglp/userArgs.json",
"test:magicglp": "concurrently --kill-others-on-fail -m 1 bun:test:magicglp:*",
"test:magicglp:avalanche": "cp web3-functions/magicglp/userArgs.avalanche.json web3-functions/magicglp/userArgs.json; hardhat w3f-run magicglp --logs --network avalanche; rm web3-functions/magicglp/userArgs.json",
"test:magicglp:arbitrum": "cp web3-functions/magicglp/userArgs.arbitrum.json web3-functions/magicglp/userArgs.json; hardhat w3f-run magicglp --logs --network arbitrum; rm web3-functions/magicglp/userArgs.json",
"test:velodrome-op-usdc": "hardhat w3f-run velodrome-op-usdc --logs --network optimism",
"test:magicape": "hardhat w3f-run magicape --logs --network ethereum",
"test:xf33d": "hardhat w3f-run xf33d --logs --network arbitrum"
"test:xf33d": "hardhat w3f-run xf33d --logs --network arbitrum",
"prepare": "husky"
},
"license": "ISC",
"lint-staged": {
"*": [
"biome check --no-errors-on-unmatched --files-ignore-unknown=true --write"
]
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@foundry-rs/easy-foundryup": "^0.1.3",
"@foundry-rs/hardhat-anvil": "^0.1.7",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@tsconfig/recommended": "^1.0.2",
"@types/node": "18.14.0",
"dotenv": "^16.0.3",
"ethereum-waffle": "^3.2.0",
"ethers": "5.5.1",
"hardhat": "^2.13.0",
"@tsconfig/recommended": "^1.0.7",
"@types/bun": "latest",
"concurrently": "^8.2.2",
"ethereum-waffle": "^3.4.4",
"ethers": "^5.7.2",
"hardhat": "^2.22.6",
"husky": "^9.1.1",
"lint-staged": "^15.2.7",
"ts-node": "10.9.2",
"typescript": "5.5.3"
},
"dependencies": {
"@gelatonetwork/automate-sdk": "^3.0.0",
"@gelatonetwork/web3-functions-sdk": "^2.0.3",
"@gelatonetwork/automate-sdk": "^3.0.19",
"@gelatonetwork/web3-functions-sdk": "^2.4.4",
"@urql/core": "^5.0.4",
"ky": "^1.4.0",
"remeda": "^2.5.0",
"viem": "^2.17.3"
}
"remeda": "^2.6.0",
"viem": "^2.17.9"
},
"trustedDependencies": [
"@biomejs/biome",
"bufferutil",
"core-js",
"core-js-pure",
"cpu-features",
"deno-bin",
"es5-ext",
"esbuild",
"keccak",
"postinstall-postinstall",
"secp256k1",
"ssh2",
"utf-8-validate",
"web3"
]
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@tsconfig/recommended/tsconfig.json",
"compilerOptions": {
"target": "ESNext",
"noImplicitAny": true,
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
Expand Down
Loading

0 comments on commit 0055052

Please sign in to comment.