diff --git a/.gitignore b/.gitignore index b9f2db94..cae082e4 100644 --- a/.gitignore +++ b/.gitignore @@ -28,5 +28,6 @@ node_modules/ /types /cache_hardhat /artifacts +/pkg/types *.log diff --git a/hardhat.config.ts b/hardhat.config.ts index 0ecea877..e9361a2d 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -43,7 +43,8 @@ const config: HardhatUserConfig = { }, viaIR: true, }, - }, { + }, + { version: "0.8.21", settings: { optimizer: { @@ -70,7 +71,7 @@ const config: HardhatUserConfig = { }, typechain: { target: "ethers-v6", - outDir: "types/", + outDir: "pkg/types/", externalArtifacts: ["deps/**/*.json"], }, tracer: { diff --git a/package.json b/package.json index eeccd00a..15a28ee4 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,10 @@ "url": "https://github.com/morpho-labs/morpho-blue-bundlers/issues" }, "homepage": "https://github.com/morpho-labs/morpho-blue-bundlers#readme", + "main": "dist/index.js", + "files": [ + "dist" + ], "scripts": { "prepare": "husky install && forge install", "build:pkg": "yarn build:hardhat --force && tsc --build ./tsconfig.build.json", diff --git a/pkg/BundlerAction.ts b/pkg/BundlerAction.ts index 678abc9f..332bf92e 100644 --- a/pkg/BundlerAction.ts +++ b/pkg/BundlerAction.ts @@ -17,8 +17,8 @@ import { EthereumPermitBundler__factory, IAllowanceTransfer, ERC20WrapperBundler__factory, -} from "../types"; -import { AuthorizationStruct, MarketParamsStruct, WithdrawalStruct } from "../types/src/MorphoBundler"; +} from "./types"; +import { AuthorizationStruct, MarketParamsStruct, WithdrawalStruct } from "./types/src/MorphoBundler"; export type BundlerCall = string; diff --git a/pkg/index.ts b/pkg/index.ts index c7031171..ea876827 100644 --- a/pkg/index.ts +++ b/pkg/index.ts @@ -1 +1,2 @@ export { BundlerAction, BundlerCall } from "./BundlerAction"; +export * from "./types"; diff --git a/tsconfig.build.json b/tsconfig.build.json index 42597b32..16530d6f 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,5 +1,8 @@ { - "extends": "./tsconfig.json", - "include": ["pkg", "types"], - "files": [] + "extends": "./tsconfig.json", + "compilerOptions": { + "rootDir": "pkg" + }, + "include": ["pkg"], + "files": [] }