From 3c7d4a2815a72889eb3780daeec60690f5ae087b Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Fri, 24 Nov 2023 16:51:03 -0800 Subject: [PATCH] chore: Add type-extensions build target to ua-utils-evm --- packages/utils-evm-hardhat/package.json | 13 ++++++-- .../utils-evm-hardhat/src/type-extensions.ts | 1 + packages/utils-evm-hardhat/tsup.config.ts | 32 +++++++++++++------ 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/packages/utils-evm-hardhat/package.json b/packages/utils-evm-hardhat/package.json index ce21dff28..41f1e2c29 100644 --- a/packages/utils-evm-hardhat/package.json +++ b/packages/utils-evm-hardhat/package.json @@ -10,9 +10,16 @@ }, "license": "MIT", "exports": { - "types": "./dist/index.d.ts", - "require": "./dist/index.js", - "import": "./dist/index.mjs" + ".": { + "types": "./dist/index.d.ts", + "require": "./dist/index.js", + "import": "./dist/index.mjs" + }, + "./*": { + "types": "./dist/*.d.ts", + "require": "./dist/*.js", + "import": "./dist/*.mjs" + } }, "main": "./dist/index.js", "module": "./dist/index.mjs", diff --git a/packages/utils-evm-hardhat/src/type-extensions.ts b/packages/utils-evm-hardhat/src/type-extensions.ts index d49514861..3b71bba7c 100644 --- a/packages/utils-evm-hardhat/src/type-extensions.ts +++ b/packages/utils-evm-hardhat/src/type-extensions.ts @@ -1,3 +1,4 @@ +import 'hardhat/types/config' import { EndpointId } from '@layerzerolabs/lz-definitions' declare module 'hardhat/types/config' { diff --git a/packages/utils-evm-hardhat/tsup.config.ts b/packages/utils-evm-hardhat/tsup.config.ts index b0e373950..344fc3a9e 100644 --- a/packages/utils-evm-hardhat/tsup.config.ts +++ b/packages/utils-evm-hardhat/tsup.config.ts @@ -1,12 +1,24 @@ import { defineConfig } from 'tsup' -export default defineConfig({ - entry: ['src/index.ts'], - outDir: './dist', - clean: true, - dts: true, - sourcemap: true, - splitting: false, - treeshake: true, - format: ['esm', 'cjs'], -}) +export default defineConfig([ + { + entry: ['src/index.ts'], + outDir: './dist', + clean: true, + dts: true, + sourcemap: true, + splitting: false, + treeshake: true, + format: ['esm', 'cjs'], + }, + { + entry: ['src/type-extensions.ts'], + outDir: './dist', + clean: true, + dts: true, + sourcemap: true, + splitting: false, + treeshake: true, + format: ['esm', 'cjs'], + }, +])