From 602aa69d5c8f6da0b6a28a4ec83b2582f45f52b7 Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Mon, 24 Jul 2023 12:33:45 +0200 Subject: [PATCH] Improve the exports for the package --- packages/prover/package.json | 10 ++-------- packages/prover/src/browser/index.ts | 3 +++ packages/prover/src/index.web.ts | 2 -- packages/prover/test/unit/web3_provider.test.ts | 4 +--- 4 files changed, 6 insertions(+), 13 deletions(-) create mode 100644 packages/prover/src/browser/index.ts delete mode 100644 packages/prover/src/index.web.ts diff --git a/packages/prover/package.json b/packages/prover/package.json index 7810a0ead0e9..b59791920081 100644 --- a/packages/prover/package.json +++ b/packages/prover/package.json @@ -15,16 +15,10 @@ "type": "module", "exports": { ".": { - "node": { - "import": "./lib/index.js" - }, - "browser": { - "import": "./lib/index.web.js" - }, - "default": "./lib/index.js" + "import": "./lib/index.js" }, "./browser": { - "import": "./lib/index.web.js" + "import": "./lib/browser/index.js" } }, "bin": { diff --git a/packages/prover/src/browser/index.ts b/packages/prover/src/browser/index.ts new file mode 100644 index 000000000000..6bce2e428088 --- /dev/null +++ b/packages/prover/src/browser/index.ts @@ -0,0 +1,3 @@ +export * from "../interfaces.js"; +export * from "../proof_provider/index.js"; +export {createVerifiedExecutionProvider} from "../web3_provider.js"; diff --git a/packages/prover/src/index.web.ts b/packages/prover/src/index.web.ts deleted file mode 100644 index bdde6e5542d3..000000000000 --- a/packages/prover/src/index.web.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./interfaces.js"; -export {createVerifiedExecutionProvider} from "./web3_provider.js"; diff --git a/packages/prover/test/unit/web3_provider.test.ts b/packages/prover/test/unit/web3_provider.test.ts index 290dfce72f3f..e29188503b96 100644 --- a/packages/prover/test/unit/web3_provider.test.ts +++ b/packages/prover/test/unit/web3_provider.test.ts @@ -2,9 +2,7 @@ import {expect} from "chai"; import Web3 from "web3"; import {ethers} from "ethers"; import sinon from "sinon"; -import {LCTransport} from "../../src/interfaces.js"; -import {ProofProvider} from "../../src/proof_provider/proof_provider.js"; -import {createVerifiedExecutionProvider} from "../../src/web3_provider.js"; +import {createVerifiedExecutionProvider, ProofProvider, LCTransport} from "@lodestar/prover/browser"; import {ELRpc} from "../../src/utils/rpc.js"; describe("web3_provider", () => {