From 118e59c4007ccd47e6f01af098abcb267ff1200f Mon Sep 17 00:00:00 2001 From: spsjvc Date: Tue, 19 Dec 2023 00:40:31 +0100 Subject: [PATCH 1/3] build: add dotenv --- .env.example | 1 + package.json | 1 + wagmi.config.ts | 3 +++ yarn.lock | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..10b1a76d --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +ARBISCAN_API_KEY= diff --git a/package.json b/package.json index c63f1ee3..7fcacfc4 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ }, "devDependencies": { "@wagmi/cli": "^1.5.2", + "dotenv": "^16.3.1", "patch-package": "^8.0.0", "postinstall-postinstall": "^2.1.0", "typescript": "^5.2.2", diff --git a/wagmi.config.ts b/wagmi.config.ts index 6b9a5e1b..38fd0420 100644 --- a/wagmi.config.ts +++ b/wagmi.config.ts @@ -1,8 +1,11 @@ import { erc, etherscan } from '@wagmi/cli/plugins'; +import dotenv from 'dotenv'; import { ParentChainId } from './src'; import { sepolia, arbitrumSepolia } from './src/chains'; +dotenv.config(); + if (typeof process.env.ARBISCAN_API_KEY === 'undefined') { throw new Error('Missing ARBISCAN_API_KEY environment variable'); } diff --git a/yarn.lock b/yarn.lock index 76b370d8..92c72922 100644 --- a/yarn.lock +++ b/yarn.lock @@ -736,7 +736,7 @@ dotenv-expand@^10.0.0: resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-10.0.0.tgz#12605d00fb0af6d0a592e6558585784032e4ef37" integrity sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A== -dotenv@^16.0.3: +dotenv@^16.0.3, dotenv@^16.3.1: version "16.3.1" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e" integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== From f9d76f1f45c141ce43c2302d833e07e2274a8774 Mon Sep 17 00:00:00 2001 From: spsjvc Date: Tue, 19 Dec 2023 00:42:20 +0100 Subject: [PATCH 2/3] build: run tests separately --- package.json | 2 +- ...Config.test.ts.snap => prepareChainConfig.unit.test.ts.snap} | 0 ...epareChainConfig.test.ts => prepareChainConfig.unit.test.ts} | 0 src/{upgradeExecutor.test.ts => upgradeExecutor.unit.test.ts} | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename src/__snapshots__/{prepareChainConfig.test.ts.snap => prepareChainConfig.unit.test.ts.snap} (100%) rename src/{prepareChainConfig.test.ts => prepareChainConfig.unit.test.ts} (100%) rename src/{upgradeExecutor.test.ts => upgradeExecutor.unit.test.ts} (100%) diff --git a/package.json b/package.json index 7fcacfc4..39c9a8a7 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "build": "tsc --project ./tsconfig.json --module commonjs --outDir ./src/dist --declaration", "dev": "yarn build --watch", "generate": "wagmi generate", - "test": "vitest", + "test:unit": "vitest unit.test", "postinstall": "patch-package" }, "devDependencies": { diff --git a/src/__snapshots__/prepareChainConfig.test.ts.snap b/src/__snapshots__/prepareChainConfig.unit.test.ts.snap similarity index 100% rename from src/__snapshots__/prepareChainConfig.test.ts.snap rename to src/__snapshots__/prepareChainConfig.unit.test.ts.snap diff --git a/src/prepareChainConfig.test.ts b/src/prepareChainConfig.unit.test.ts similarity index 100% rename from src/prepareChainConfig.test.ts rename to src/prepareChainConfig.unit.test.ts diff --git a/src/upgradeExecutor.test.ts b/src/upgradeExecutor.unit.test.ts similarity index 100% rename from src/upgradeExecutor.test.ts rename to src/upgradeExecutor.unit.test.ts From d7e123a7159d1949cb3db4bd7b1ea70bfdf57534 Mon Sep 17 00:00:00 2001 From: spsjvc Date: Tue, 19 Dec 2023 00:43:44 +0100 Subject: [PATCH 3/3] update thing --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 643144a7..966b1873 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -46,4 +46,4 @@ jobs: run: yarn build - name: Test - run: yarn test + run: yarn test:unit