Skip to content

Commit

Permalink
🐛 fork anvil correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Cory authored and Will Cory committed Sep 10, 2023
1 parent a4d28d6 commit a6893e7
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 66 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: pnpm i && npx playwright install && pnpm nx affected --target=e2e:ci
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
VITE_RPC_URL_1: ${{ secrets.RPC_URL_MAINNET }}
ANVIL_RPC_URL_1: ${{ secrets.RPC_URL_MAINNET }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
EXAMPLE_PROJECT: "@evmts/example-vite"

Expand All @@ -45,6 +45,6 @@ jobs:
run: pnpm i && npx playwright install && pnpm nx affected --target=e2e:ci
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
VITE_RPC_URL_1: ${{ secrets.RPC_URL_MAINNET }}
ANVIL_RPC_URL_1: ${{ secrets.RPC_URL_MAINNET }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
EXAMPLE_PROJECT: "@evmts/example-next"
2 changes: 1 addition & 1 deletion e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const config: PlaywrightTestConfig = {
}
},
webServer: {
command: `VITE_RPC_URL_1=${process.env.VITE_RPC_URL_1} pnpm nx dev ${process.env.EXAMPLE_PROJECT && "@evmts/example-vite"}`,
command: `ANVIL_RPC_URL_1=${process.env.ANVIL_RPC_URL_1} pnpm nx dev ${process.env.EXAMPLE_PROJECT && "@evmts/example-vite"}`,
port: 5173,
reuseExistingServer: true,
timeout: 180000,
Expand Down
124 changes: 61 additions & 63 deletions examples/vite/package.json
Original file line number Diff line number Diff line change
@@ -1,65 +1,63 @@
{
"name": "@evmts/example-vite",
"version": "0.0.1",
"private": true,
"contributors": [
"Will Cory <[email protected]>"
],
"scripts": {
"anvil": "source .env && anvil --fork-url https://eth-mainnet.g.alchemy.com/v2/$VITE_ALCHEMY_API_KEY",
"build": "pnpm build:contracts && pnpm build:dist",
"build:contracts": "forge build",
"build:dist": "vite build",
"clean": "rm -rf node_modules && rm -rf artifacts && rm -rf dist && rm -rf cache",
"deploy-contracts": "source .env && forge script script/Deploy.s.sol:Deploy --broadcast --verify -vvvv",
"deploy-contracts:anvil": "pnpm deploy-contracts --fork-url http://localhost:8545",
"dev": "source .env & anvil --fork-url https://eth-mainnet.g.alchemy.com/v2/$VITE_ALCHEMY_API_KEY & vite",
"format": "rome format . --write",
"format:check": "rome format .",
"generate": "evmts generate",
"preinstall": "npx only-allow pnpm",
"lint": "rome check . --apply-unsafe",
"lint:check": "rome check . --verbose",
"package:up": "pnpm up --latest",
"preview": "vite preview",
"rome": "^12.1.2",
"serve": "serve -s -l tcp://0.0.0.0:5173 dist",
"serve:test": "source .env & anvil --fork-url https://eth-mainnet.g.alchemy.com/v2/$VITE_ALCHEMY_API_KEY & vite",
"test": "vitest"
},
"dependencies": {
"@evmts/bundler": "workspace:^",
"@evmts/cli": "workspace:^",
"@evmts/config": "workspace:^",
"@evmts/contracts": "^0.0.1",
"@evmts/core": "workspace:^0.8.1",
"@rainbow-me/rainbowkit": "^1.0.9",
"buffer": "^6.0.3",
"ds-test": "github:dapphub/ds-test",
"process": "^0.11.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"util": "^0.12.5",
"viem": "~1.8.1",
"wagmi": "^1.3.10"
},
"devDependencies": {
"@evmts/ts-plugin": "workspace:^",
"@evmts/vite-plugin": "workspace:^",
"@openzeppelin/contracts": "^4.9.3",
"@testing-library/react": "^14.0.0",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@vitejs/plugin-react": "^4.0.4",
"abitype": "^0.9.8",
"forge-deploy": "^0.2.0",
"forge-std": "github:foundry-rs/forge-std",
"react-helmet": "^6.1.0",
"rome": "^12.1.3",
"serve": "^14.2.1",
"solc": "0.8.21",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vitest": "^0.34.3"
}
"name": "@evmts/example-vite",
"version": "0.0.1",
"private": true,
"contributors": ["Will Cory <[email protected]>"],
"scripts": {
"anvil": "source .env && anvil --fork-url https://eth-mainnet.g.alchemy.com/v2/$VITE_ALCHEMY_API_KEY",
"build": "pnpm build:contracts && pnpm build:dist",
"build:contracts": "forge build",
"build:dist": "vite build",
"clean": "rm -rf node_modules && rm -rf artifacts && rm -rf dist && rm -rf cache",
"deploy-contracts": "source .env && forge script script/Deploy.s.sol:Deploy --broadcast --verify -vvvv",
"deploy-contracts:anvil": "pnpm deploy-contracts --fork-url http://localhost:8545",
"dev": "VITE_RPC_URL_1=http://localhost:8545 anvil --fork-url $ANVIL_RPC_URL_1 & vite",
"format": "rome format . --write",
"format:check": "rome format .",
"generate": "evmts generate",
"preinstall": "npx only-allow pnpm",
"lint": "rome check . --apply-unsafe",
"lint:check": "rome check . --verbose",
"package:up": "pnpm up --latest",
"preview": "vite preview",
"rome": "^12.1.2",
"serve": "serve -s -l tcp://0.0.0.0:5173 dist",
"serve:test": "source .env & anvil --fork-url https://eth-mainnet.g.alchemy.com/v2/$VITE_ALCHEMY_API_KEY & vite",
"test": "vitest"
},
"dependencies": {
"@evmts/bundler": "workspace:^",
"@evmts/cli": "workspace:^",
"@evmts/config": "workspace:^",
"@evmts/contracts": "^0.0.1",
"@evmts/core": "workspace:^0.8.1",
"@rainbow-me/rainbowkit": "^1.0.9",
"buffer": "^6.0.3",
"ds-test": "github:dapphub/ds-test",
"process": "^0.11.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"util": "^0.12.5",
"viem": "~1.8.1",
"wagmi": "^1.3.10"
},
"devDependencies": {
"@evmts/ts-plugin": "workspace:^",
"@evmts/vite-plugin": "workspace:^",
"@openzeppelin/contracts": "^4.9.3",
"@testing-library/react": "^14.0.0",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@vitejs/plugin-react": "^4.0.4",
"abitype": "^0.9.8",
"forge-deploy": "^0.2.0",
"forge-std": "github:foundry-rs/forge-std",
"react-helmet": "^6.1.0",
"rome": "^12.1.3",
"serve": "^14.2.1",
"solc": "0.8.21",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vitest": "^0.34.3"
}
}

0 comments on commit a6893e7

Please sign in to comment.