From a159ed38e2ddf6e4d5d75b720d0faac3f72f7e04 Mon Sep 17 00:00:00 2001 From: Souradeep Das Date: Thu, 2 Mar 2023 19:38:42 +0530 Subject: [PATCH] [AA] unify aa-contracts package (#613) * unify aa package * restore artifacts structure because deploy script would overwrite * build * remove outdir * check version * check version * remove npmignore * remove npmignore * package version * update prepack script * update prepack script * udpate integ * fix integ tests * Update packages/boba/account-abstraction/package.json --------- Co-authored-by: Ino Murko --- packages/boba/account-abstraction/.gitignore | 1 + .../account-abstraction/contracts/.npmignore | 2 -- .../contracts/package.json | 26 ------------------- .../{contracts => }/index.ts | 0 .../boba/account-abstraction/package.json | 15 +++++++++-- .../scripts/postpack-contracts-package.sh | 2 +- .../scripts/prepack-contracts-package.sh | 16 +++--------- 7 files changed, 19 insertions(+), 43 deletions(-) delete mode 100644 packages/boba/account-abstraction/contracts/.npmignore delete mode 100644 packages/boba/account-abstraction/contracts/package.json rename packages/boba/account-abstraction/{contracts => }/index.ts (100%) diff --git a/packages/boba/account-abstraction/.gitignore b/packages/boba/account-abstraction/.gitignore index 4a1184e7f7..3aef56c914 100644 --- a/packages/boba/account-abstraction/.gitignore +++ b/packages/boba/account-abstraction/.gitignore @@ -11,6 +11,7 @@ artifacts /deployments/localhost/ /deployments/proxy/ /typechain-types/ +/types/ /reports/gas-used-output.color /coverage /coverage.json diff --git a/packages/boba/account-abstraction/contracts/.npmignore b/packages/boba/account-abstraction/contracts/.npmignore deleted file mode 100644 index b6abf238d9..0000000000 --- a/packages/boba/account-abstraction/contracts/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -**/*Test* -yarn* diff --git a/packages/boba/account-abstraction/contracts/package.json b/packages/boba/account-abstraction/contracts/package.json deleted file mode 100644 index 796c4260a6..0000000000 --- a/packages/boba/account-abstraction/contracts/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@account-abstraction/contracts", - "description": "Account Abstraction (EIP 4337) contracts", - "version": "0.2.0", - "main": "./dist/index.js", - "scripts": { - "prepack": "../scripts/prepack-contracts-package.sh", - "postpack": "../scripts/postpack-contracts-package.sh" - }, - "repository": { - "type": "git", - "url": "https://github.com/eth-infinitism/account-abstraction" - }, - "keywords": [ - "solidity", - "ethereum", - "smart", - "contracts", - "accipt-abstraction", - "eip-4337" - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/eth-infinitism/account-abstraction/issues" - } -} diff --git a/packages/boba/account-abstraction/contracts/index.ts b/packages/boba/account-abstraction/index.ts similarity index 100% rename from packages/boba/account-abstraction/contracts/index.ts rename to packages/boba/account-abstraction/index.ts diff --git a/packages/boba/account-abstraction/package.json b/packages/boba/account-abstraction/package.json index 11c4c80731..0d5d543c33 100644 --- a/packages/boba/account-abstraction/package.json +++ b/packages/boba/account-abstraction/package.json @@ -1,9 +1,12 @@ { "name": "@boba/accountabstraction", "version": "1.0.0", - "description": "BOBA Account Abstraction", + "description": "BOBA Account Abstraction (EIP 4337) contracts", + "main": "./dist/index.js", "scripts": { - "build": "yarn install && yarn compile", + "build": "yarn install && yarn compile && yarn prepack", + "prepack": "./scripts/prepack-contracts-package.sh", + "postpack": "./scripts/postpack-contracts-package.sh", "clean": "rm -rf cache artifacts typechain typechain-types", "compile": "./scripts/hh-wrapper compile", "tsc": "tsc", @@ -24,6 +27,14 @@ "runop-goerli": "AA_URL=https://account-abstraction-goerli.nethermind.io yarn runop --network goerli", "runop3": "hardhat run src/runop3.ts " }, + "keywords": [ + "solidity", + "ethereum", + "smart", + "contracts", + "account-abstraction", + "eip-4337" + ], "license": "ISC", "devDependencies": { "@eth-optimism/contracts": "^0.5.11", diff --git a/packages/boba/account-abstraction/scripts/postpack-contracts-package.sh b/packages/boba/account-abstraction/scripts/postpack-contracts-package.sh index e5ad7bfcd3..40faaf33f9 100755 --- a/packages/boba/account-abstraction/scripts/postpack-contracts-package.sh +++ b/packages/boba/account-abstraction/scripts/postpack-contracts-package.sh @@ -2,5 +2,5 @@ #echo postpack for "contracts" package cd `dirname $0`/.. pwd -rm -rf contracts/artifacts contracts/types contracts/dist +rm -rf artifacts types dist diff --git a/packages/boba/account-abstraction/scripts/prepack-contracts-package.sh b/packages/boba/account-abstraction/scripts/prepack-contracts-package.sh index 8d4c69aaf5..c65a6023bb 100755 --- a/packages/boba/account-abstraction/scripts/prepack-contracts-package.sh +++ b/packages/boba/account-abstraction/scripts/prepack-contracts-package.sh @@ -3,17 +3,9 @@ cd `dirname $0`/.. pwd -if git status contracts | grep -v 'nothing to commit'|tee /dev/stderr |grep -q Untracked; then - exit 1 -fi -yarn clean -yarn compile -cd contracts - -rm -rf artifacts types dist - -mkdir -p artifacts -cp `find ../artifacts/contracts -type f | grep -v -E 'Test|dbg|gnosis|bls|IOracle'` artifacts/ -npx typechain --target ethers-v5 --out-dir types artifacts/** +mkdir -p artifacts_clean +cp `find ./artifacts/contracts -type f | grep -v -E 'Test|dbg|gnosis|bls|IOracle'` artifacts_clean/ +typechain --target ethers-v5 --out-dir types artifacts_clean/** +rm -r artifacts_clean npx tsc index.ts -d --outDir dist