diff --git a/packages/dashboard/tsconfig.json b/packages/dashboard/tsconfig.json index fdd5a8c30d59..06936d8e8719 100644 --- a/packages/dashboard/tsconfig.json +++ b/packages/dashboard/tsconfig.json @@ -10,6 +10,7 @@ { "path": "../public-api" }, { "path": "../theme/" }, { "path": "../mask/src" }, + { "path": "../web3-shared/base/" }, { "path": "../web3-shared/evm/" }, { "path": "../web3-shared/flow/" }, { "path": "../icons/" }, diff --git a/packages/mask/.webpack/config.ts b/packages/mask/.webpack/config.ts index c1e13b4775b6..823af482df53 100644 --- a/packages/mask/.webpack/config.ts +++ b/packages/mask/.webpack/config.ts @@ -72,6 +72,7 @@ export function createConfiguration(rawFlags: BuildFlags): Configuration { '@masknet/icons': join(__dirname, '../../icons/index.ts'), '@masknet/web3-kit': join(__dirname, '../../web3-kit/src/'), '@masknet/web3-providers': join(__dirname, '../../web3-providers/src'), + '@masknet/web3-shared-base': join(__dirname, '../../web3-shared/base/src'), '@masknet/web3-shared-evm': join(__dirname, '../../web3-shared/evm/'), '@masknet/web3-shared-flow': join(__dirname, '../../web3-shared/flow/'), '@masknet/web3-shared-solana': join(__dirname, '../../web3-shared/solana/'), diff --git a/packages/mask/src/plugins/Collectible/SNSAdaptor/MakeOfferDialog.tsx b/packages/mask/src/plugins/Collectible/SNSAdaptor/MakeOfferDialog.tsx index d7ecbf427a74..78fdf6601e85 100644 --- a/packages/mask/src/plugins/Collectible/SNSAdaptor/MakeOfferDialog.tsx +++ b/packages/mask/src/plugins/Collectible/SNSAdaptor/MakeOfferDialog.tsx @@ -35,7 +35,7 @@ import { PluginTraderMessages } from '../../Trader/messages' import { Trans } from 'react-i18next' import getUnixTime from 'date-fns/getUnixTime' import type { useAsset } from '../../EVM/hooks' -import { rightShift, ZERO } from '@masknet/web3-shared-base/utils/number' +import { rightShift, ZERO } from '@masknet/web3-shared-base' import type { Coin } from '../../Trader/types' import { isWyvernSchemaName } from '../utils' diff --git a/packages/mask/src/tsconfig.json b/packages/mask/src/tsconfig.json index 28176677c278..7bdabfffe9d5 100644 --- a/packages/mask/src/tsconfig.json +++ b/packages/mask/src/tsconfig.json @@ -16,6 +16,7 @@ { "path": "../../public-api" }, { "path": "../../shared" }, { "path": "../../shared-base" }, + { "path": "../../web3-shared/base" }, { "path": "../../web3-shared/evm" }, { "path": "../../web3-shared/flow" }, { "path": "../../web3-providers" }, diff --git a/packages/mask/utils-pure/tsconfig.json b/packages/mask/utils-pure/tsconfig.json index 55599407b5af..28492f65e59d 100644 --- a/packages/mask/utils-pure/tsconfig.json +++ b/packages/mask/utils-pure/tsconfig.json @@ -8,5 +8,5 @@ "lib": ["ES2021"] }, "include": ["./"], - "references": [] + "references": [{ "path": "../../shared-base" }] } diff --git a/packages/plugin-infra/tsconfig.json b/packages/plugin-infra/tsconfig.json index b9877d62ccd3..e7f2792a782a 100644 --- a/packages/plugin-infra/tsconfig.json +++ b/packages/plugin-infra/tsconfig.json @@ -6,7 +6,12 @@ "tsBuildInfoFile": "./dist/.tsbuildinfo" }, "include": ["./src"], - "references": [{ "path": "../shared/" }, { "path": "../shared-base" }, { "path": "../theme" }], + "references": [ + { "path": "../shared/" }, + { "path": "../shared-base" }, + { "path": "../theme" }, + { "path": "../web3-shared/base" } + ], "ts-node": { "transpileOnly": true, "compilerOptions": { "module": "CommonJS" } diff --git a/packages/plugins/Flow/tsconfig.json b/packages/plugins/Flow/tsconfig.json index 6d904dc19c06..6516b1372613 100644 --- a/packages/plugins/Flow/tsconfig.json +++ b/packages/plugins/Flow/tsconfig.json @@ -13,6 +13,7 @@ { "path": "../../shared" }, { "path": "../../shared-base" }, { "path": "../../theme" }, + { "path": "../../web3-shared/base" }, { "path": "../../web3-shared/flow" }, { "path": "../../web3-providers" } ] diff --git a/packages/polyfills/types/webpack.d.ts b/packages/polyfills/types/webpack.d.ts index d940351bb582..8a7de35ad2c1 100644 --- a/packages/polyfills/types/webpack.d.ts +++ b/packages/polyfills/types/webpack.d.ts @@ -6,6 +6,7 @@ */ declare namespace __WebpackModuleApi { + type ModuleId = any interface HotNotifierInfo { type: | 'self-declined' diff --git a/packages/web3-shared/base/env.d.ts b/packages/web3-shared/base/src/env.d.ts similarity index 51% rename from packages/web3-shared/base/env.d.ts rename to packages/web3-shared/base/src/env.d.ts index 868322d5ff30..64a8c3276ea7 100644 --- a/packages/web3-shared/base/env.d.ts +++ b/packages/web3-shared/base/src/env.d.ts @@ -1 +1,2 @@ /// +/// diff --git a/packages/web3-shared/base/hooks/index.ts b/packages/web3-shared/base/src/hooks/index.ts similarity index 100% rename from packages/web3-shared/base/hooks/index.ts rename to packages/web3-shared/base/src/hooks/index.ts diff --git a/packages/web3-shared/base/hooks/useBeat.ts b/packages/web3-shared/base/src/hooks/useBeat.ts similarity index 100% rename from packages/web3-shared/base/hooks/useBeat.ts rename to packages/web3-shared/base/src/hooks/useBeat.ts diff --git a/packages/web3-shared/base/index.ts b/packages/web3-shared/base/src/index.ts similarity index 100% rename from packages/web3-shared/base/index.ts rename to packages/web3-shared/base/src/index.ts diff --git a/packages/web3-shared/base/proxy/index.ts b/packages/web3-shared/base/src/proxy/index.ts similarity index 100% rename from packages/web3-shared/base/proxy/index.ts rename to packages/web3-shared/base/src/proxy/index.ts diff --git a/packages/web3-shared/base/utils/index.ts b/packages/web3-shared/base/src/utils/index.ts similarity index 100% rename from packages/web3-shared/base/utils/index.ts rename to packages/web3-shared/base/src/utils/index.ts diff --git a/packages/web3-shared/base/utils/number.ts b/packages/web3-shared/base/src/utils/number.ts similarity index 100% rename from packages/web3-shared/base/utils/number.ts rename to packages/web3-shared/base/src/utils/number.ts diff --git a/packages/web3-shared/base/tests/proxy.ts b/packages/web3-shared/base/tests/proxy.ts index 2bad33f2cb34..bfd8e0b31e1f 100644 --- a/packages/web3-shared/base/tests/proxy.ts +++ b/packages/web3-shared/base/tests/proxy.ts @@ -1,5 +1,5 @@ import { describe, test, expect, beforeEach, afterEach, jest, afterAll, beforeAll } from '@jest/globals' -import { SocketPoolItem, ProviderProxy } from '../proxy' +import { SocketPoolItem, ProviderProxy } from '../src/proxy' import * as mockWS from 'jest-websocket-mock' import addSeconds from 'date-fns/addSeconds' diff --git a/packages/web3-shared/base/tsconfig.json b/packages/web3-shared/base/tsconfig.json index bec1e5d4644c..07353b9b0ada 100644 --- a/packages/web3-shared/base/tsconfig.json +++ b/packages/web3-shared/base/tsconfig.json @@ -1,10 +1,10 @@ { "extends": "../../../tsconfig.json", "compilerOptions": { - "rootDir": "./", - "outDir": "../dist/base", - "tsBuildInfoFile": "../dist/base.tsbuildinfo" + "rootDir": "./src", + "outDir": "./dist", + "tsBuildInfoFile": "./dist/src.tsbuildinfo" }, - "include": ["./", "./**/*.json"], + "include": ["./src", "./src/env.d.ts", "./src/**/*.json"], "references": [{ "path": "../../injected-script/sdk" }] } diff --git a/packages/web3-shared/base/tsconfig.tests.json b/packages/web3-shared/base/tsconfig.tests.json index 8d45d3236f3d..8cb160537df2 100644 --- a/packages/web3-shared/base/tsconfig.tests.json +++ b/packages/web3-shared/base/tsconfig.tests.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.json", "compilerOptions": { "noEmit": true, - "tsBuildInfoFile": "../dist/tests.tsbuildinfo", "types": ["node"] }, "include": ["./tests"], diff --git a/packages/web3-shared/evm/tsconfig.json b/packages/web3-shared/evm/tsconfig.json index 85d6de3b559a..31e14ea11894 100644 --- a/packages/web3-shared/evm/tsconfig.json +++ b/packages/web3-shared/evm/tsconfig.json @@ -6,5 +6,5 @@ "tsBuildInfoFile": "../dist/evm.tsbuildinfo" }, "include": ["./", "./**/*.json"], - "references": [{ "path": "../../injected-script/sdk" }] + "references": [{ "path": "../../injected-script/sdk" }, { "path": "../base" }] } diff --git a/packages/web3-shared/tsconfig.json b/packages/web3-shared/tsconfig.json deleted file mode 100644 index 6ed8fbc79195..000000000000 --- a/packages/web3-shared/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "references": [{ "path": "./base/" }, { "path": "./evm/" }, { "path": "./flow/" }, { "path": "./solana/" }] -}