-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Create "barrel" index file for hardhat tasks #2273
Description
We have lots of hardhat tasks in the contracts package. As a result, our hardhat.config.ts includes lots of imports:
optimism/packages/contracts/hardhat.config.ts
Lines 16 to 23 in 51a527b
| import './tasks/deploy' | |
| import './tasks/l2-gasprice' | |
| import './tasks/set-owner' | |
| import './tasks/validate-address-dictator' | |
| import './tasks/validate-chugsplash-dictator' | |
| import './tasks/whitelist' | |
| import './tasks/withdraw-fees' | |
| import './tasks/fetch-batches' |
We can reduce the size of our hardhat.config.ts file by creating an index.ts file inside of the tasks folder which re-exports each task. See here for an example:
optimism/packages/contracts/src/index.ts
Lines 1 to 2 in 51a527b
| export * from './contract-defs' | |
| export * from './predeploys' |
Goal of this issue is to create an index.ts file in the tasks folder which re-exports each of the tasks. Then we want to change all of the imports in hardhat.config.ts to instead simply:
import './tasks'As always, feel free to leave a comment here if you'd like to tackle this issue or if you're confused about anything!