@wagmi/core 0.10.10 → 1.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +2 -2
  2. package/connectors/walletConnectV1/package.json +4 -0
  3. package/dist/{chunk-VQG3VKOR.js → chunk-LF3Y5HFO.js} +714 -1242
  4. package/dist/index-fc9ab085.d.ts +22 -0
  5. package/dist/index.d.ts +1039 -1291
  6. package/dist/index.js +17 -45
  7. package/dist/internal/index.d.ts +18 -8
  8. package/dist/internal/index.js +5 -3
  9. package/dist/internal/test.d.ts +771 -9
  10. package/dist/internal/test.js +46 -34
  11. package/dist/providers/alchemy.d.ts +4 -6
  12. package/dist/providers/alchemy.js +9 -26
  13. package/dist/providers/infura.d.ts +4 -6
  14. package/dist/providers/infura.js +9 -26
  15. package/dist/providers/jsonRpc.d.ts +4 -7
  16. package/dist/providers/jsonRpc.js +4 -20
  17. package/dist/providers/public.d.ts +4 -7
  18. package/dist/providers/public.js +3 -18
  19. package/dist/window.d.ts +7 -0
  20. package/dist/window.js +0 -0
  21. package/internal/dist/wagmi-core-internal.cjs.d.ts +11 -0
  22. package/internal/dist/wagmi-core-internal.cjs.js +16 -0
  23. package/package.json +11 -6
  24. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.d.ts +11 -0
  25. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.js +16 -0
  26. package/providers/infura/dist/wagmi-core-providers-infura.cjs.d.ts +11 -0
  27. package/providers/infura/dist/wagmi-core-providers-infura.cjs.js +16 -0
  28. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.d.ts +11 -0
  29. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.js +16 -0
  30. package/providers/public/dist/wagmi-core-providers-public.cjs.d.ts +11 -0
  31. package/providers/public/dist/wagmi-core-providers-public.cjs.js +16 -0
  32. package/window/package.json +4 -0
  33. package/dist/getContract-2443b222.d.ts +0 -310
  34. package/dist/index-35b6525c.d.ts +0 -49
@@ -1,5 +1,5 @@
1
1
  import "../chunk-KX4UEHS5.js";
2
- import "../chunk-VQG3VKOR.js";
2
+ import "../chunk-LF3Y5HFO.js";
3
3
  import {
4
4
  foundry,
5
5
  goerli,
@@ -13,39 +13,38 @@ import "../chunk-KFW652VN.js";
13
13
  import "../chunk-MQXBDTVK.js";
14
14
 
15
15
  // test/utils.ts
16
- import { BigNumber, Wallet, providers } from "ethers";
17
- function getNetwork(chain) {
18
- return {
19
- chainId: chain.id,
20
- ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
21
- name: chain.name
22
- };
23
- }
16
+ import {
17
+ createPublicClient,
18
+ createWalletClient,
19
+ custom,
20
+ http,
21
+ webSocket
22
+ } from "viem";
23
+ import { privateKeyToAccount } from "viem/accounts";
24
+ import { rpc } from "viem/utils";
24
25
  var foundryMainnet = {
25
26
  ...mainnet,
26
27
  rpcUrls: foundry.rpcUrls
27
28
  };
28
29
  var testChains = [foundryMainnet, mainnet, goerli, optimism, polygon];
29
- var EthersProviderWrapper = class extends providers.StaticJsonRpcProvider {
30
- toJSON() {
31
- return `<Provider network={${this.network.chainId}} />`;
32
- }
33
- };
34
- function getProvider({
30
+ function getPublicClient({
35
31
  chains = testChains,
36
32
  chainId
37
33
  } = {}) {
38
- const chain = testChains.find((x) => x.id === chainId) ?? foundryMainnet;
34
+ const chain = chains.find((x) => x.id === chainId) ?? foundryMainnet;
39
35
  const url = foundryMainnet.rpcUrls.default.http[0];
40
- const provider = new EthersProviderWrapper(url, getNetwork(chain));
41
- provider.pollingInterval = 1e3;
42
- return Object.assign(provider, { chains });
36
+ const publicClient = createPublicClient({
37
+ chain,
38
+ transport: http(url),
39
+ pollingInterval: 1e3
40
+ });
41
+ return Object.assign(publicClient, {
42
+ chains,
43
+ toJSON() {
44
+ return `<PublicClient network={${chain.id}} />`;
45
+ }
46
+ });
43
47
  }
44
- var EthersWebSocketProviderWrapper = class extends providers.WebSocketProvider {
45
- toJSON() {
46
- return `<WebSocketProvider network={${this.network.chainId}} />`;
47
- }
48
- };
49
48
  var accounts = [
50
49
  {
51
50
  privateKey: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
@@ -128,17 +127,30 @@ var accounts = [
128
127
  balance: "10000000000000000000000"
129
128
  }
130
129
  ];
131
- var WalletSigner = class extends Wallet {
132
- connectUnchecked() {
133
- const uncheckedSigner = this.provider.getUncheckedSigner(this.address);
134
- return uncheckedSigner;
135
- }
136
- };
137
- function getSigners() {
138
- const provider = getProvider();
139
- return accounts.map((x) => new WalletSigner(x.privateKey, provider));
130
+ function getWalletClients() {
131
+ const publicClient = getPublicClient();
132
+ publicClient.request = async ({ method, params }) => {
133
+ if (method === "personal_sign") {
134
+ method = "eth_sign";
135
+ params = [params[1], params[0]];
136
+ }
137
+ const { result } = await rpc.http(foundryMainnet.rpcUrls.default.http[0], {
138
+ body: {
139
+ method,
140
+ params
141
+ }
142
+ });
143
+ return result;
144
+ };
145
+ return accounts.map(
146
+ (x) => createWalletClient({
147
+ account: privateKeyToAccount(x.privateKey).address,
148
+ chain: publicClient.chain,
149
+ transport: custom(publicClient)
150
+ })
151
+ );
140
152
  }
141
153
  export {
142
- getSigners,
154
+ getWalletClients,
143
155
  testChains
144
156
  };
@@ -1,13 +1,11 @@
1
- import { providers } from 'ethers';
2
1
  import { Chain } from '@wagmi/chains';
3
- import { F as FallbackProviderConfig, C as ChainProviderFn } from '../index-35b6525c.js';
4
- import '@wagmi/connectors';
5
- import 'abitype';
2
+ import { C as ChainProviderFn } from '../index-fc9ab085.js';
3
+ import 'viem';
6
4
 
7
- type AlchemyProviderConfig = FallbackProviderConfig & {
5
+ type AlchemyProviderConfig = {
8
6
  /** Your Alchemy API key from the [Alchemy Dashboard](https://dashboard.alchemyapi.io/). */
9
7
  apiKey: string;
10
8
  };
11
- declare function alchemyProvider<TChain extends Chain = Chain>({ apiKey, priority, stallTimeout, weight, }: AlchemyProviderConfig): ChainProviderFn<TChain, providers.AlchemyProvider, providers.AlchemyWebSocketProvider>;
9
+ declare function alchemyProvider<TChain extends Chain = Chain>({ apiKey, }: AlchemyProviderConfig): ChainProviderFn<TChain>;
12
10
 
13
11
  export { AlchemyProviderConfig, alchemyProvider };
@@ -1,43 +1,26 @@
1
1
  import "../chunk-MQXBDTVK.js";
2
2
 
3
3
  // src/providers/alchemy.ts
4
- import { providers } from "ethers";
5
4
  function alchemyProvider({
6
- apiKey,
7
- priority,
8
- stallTimeout,
9
- weight
5
+ apiKey
10
6
  }) {
11
7
  return function(chain) {
12
- if (!chain.rpcUrls.alchemy?.http[0])
8
+ const baseHttpUrl = chain.rpcUrls.alchemy?.http[0];
9
+ const baseWsUrl = chain.rpcUrls.alchemy?.webSocket?.[0];
10
+ if (!baseHttpUrl)
13
11
  return null;
14
12
  return {
15
13
  chain: {
16
14
  ...chain,
17
15
  rpcUrls: {
18
16
  ...chain.rpcUrls,
19
- default: { http: [`${chain.rpcUrls.alchemy?.http[0]}/${apiKey}`] }
17
+ default: { http: [`${baseHttpUrl}/${apiKey}`] }
20
18
  }
21
19
  },
22
- provider: () => {
23
- const provider = new providers.AlchemyProvider(
24
- {
25
- chainId: chain.id,
26
- name: chain.network,
27
- ensAddress: chain.contracts?.ensRegistry?.address
28
- },
29
- apiKey
30
- );
31
- return Object.assign(provider, { priority, stallTimeout, weight });
32
- },
33
- webSocketProvider: () => new providers.AlchemyWebSocketProvider(
34
- {
35
- chainId: chain.id,
36
- name: chain.network,
37
- ensAddress: chain.contracts?.ensRegistry?.address
38
- },
39
- apiKey
40
- )
20
+ rpcUrls: {
21
+ http: [`${baseHttpUrl}/${apiKey}`],
22
+ webSocket: [`${baseWsUrl}/${apiKey}`]
23
+ }
41
24
  };
42
25
  };
43
26
  }
@@ -1,13 +1,11 @@
1
- import { providers } from 'ethers';
2
1
  import { Chain } from '@wagmi/chains';
3
- import { F as FallbackProviderConfig, C as ChainProviderFn } from '../index-35b6525c.js';
4
- import '@wagmi/connectors';
5
- import 'abitype';
2
+ import { C as ChainProviderFn } from '../index-fc9ab085.js';
3
+ import 'viem';
6
4
 
7
- type InfuraProviderConfig = FallbackProviderConfig & {
5
+ type InfuraProviderConfig = {
8
6
  /** Your Infura API key from the [Infura Dashboard](https://infura.io/login). */
9
7
  apiKey: string;
10
8
  };
11
- declare function infuraProvider<TChain extends Chain = Chain>({ apiKey, priority, stallTimeout, weight, }: InfuraProviderConfig): ChainProviderFn<TChain, providers.InfuraProvider, providers.InfuraWebSocketProvider>;
9
+ declare function infuraProvider<TChain extends Chain = Chain>({ apiKey, }: InfuraProviderConfig): ChainProviderFn<TChain>;
12
10
 
13
11
  export { InfuraProviderConfig, infuraProvider };
@@ -1,43 +1,26 @@
1
1
  import "../chunk-MQXBDTVK.js";
2
2
 
3
3
  // src/providers/infura.ts
4
- import { providers } from "ethers";
5
4
  function infuraProvider({
6
- apiKey,
7
- priority,
8
- stallTimeout,
9
- weight
5
+ apiKey
10
6
  }) {
11
7
  return function(chain) {
12
- if (!chain.rpcUrls.infura?.http[0])
8
+ const baseHttpUrl = chain.rpcUrls.infura?.http[0];
9
+ const baseWsUrl = chain.rpcUrls.infura?.webSocket?.[0];
10
+ if (!baseHttpUrl)
13
11
  return null;
14
12
  return {
15
13
  chain: {
16
14
  ...chain,
17
15
  rpcUrls: {
18
16
  ...chain.rpcUrls,
19
- default: { http: [`${chain.rpcUrls.infura?.http[0]}/${apiKey}`] }
17
+ default: { http: [`${baseHttpUrl}/${apiKey}`] }
20
18
  }
21
19
  },
22
- provider: () => {
23
- const provider = new providers.InfuraProvider(
24
- {
25
- chainId: chain.id,
26
- name: chain.network,
27
- ensAddress: chain.contracts?.ensRegistry?.address
28
- },
29
- apiKey
30
- );
31
- return Object.assign(provider, { priority, stallTimeout, weight });
32
- },
33
- webSocketProvider: () => new providers.InfuraWebSocketProvider(
34
- {
35
- chainId: chain.id,
36
- name: chain.network,
37
- ensAddress: chain.contracts?.ensRegistry?.address
38
- },
39
- apiKey
40
- )
20
+ rpcUrls: {
21
+ http: [`${baseHttpUrl}/${apiKey}`],
22
+ webSocket: [`${baseWsUrl}/${apiKey}`]
23
+ }
41
24
  };
42
25
  };
43
26
  }
@@ -1,16 +1,13 @@
1
- import { providers } from 'ethers';
2
1
  import { Chain } from '@wagmi/chains';
3
- import { F as FallbackProviderConfig, C as ChainProviderFn } from '../index-35b6525c.js';
4
- import '@wagmi/connectors';
5
- import 'abitype';
2
+ import { C as ChainProviderFn } from '../index-fc9ab085.js';
3
+ import 'viem';
6
4
 
7
- type JsonRpcProviderConfig = FallbackProviderConfig & {
5
+ type JsonRpcProviderConfig = {
8
6
  rpc: (chain: Chain) => {
9
7
  http: string;
10
8
  webSocket?: string;
11
9
  } | null;
12
- static?: boolean;
13
10
  };
14
- declare function jsonRpcProvider<TChain extends Chain = Chain>({ priority, rpc, stallTimeout, static: static_, weight, }: JsonRpcProviderConfig): ChainProviderFn<TChain, providers.JsonRpcProvider, providers.WebSocketProvider>;
11
+ declare function jsonRpcProvider<TChain extends Chain = Chain>({ rpc, }: JsonRpcProviderConfig): ChainProviderFn<TChain>;
15
12
 
16
13
  export { JsonRpcProviderConfig, jsonRpcProvider };
@@ -1,13 +1,8 @@
1
1
  import "../chunk-MQXBDTVK.js";
2
2
 
3
3
  // src/providers/jsonRpc.ts
4
- import { providers } from "ethers";
5
4
  function jsonRpcProvider({
6
- priority,
7
- rpc,
8
- stallTimeout,
9
- static: static_ = true,
10
- weight
5
+ rpc
11
6
  }) {
12
7
  return function(chain) {
13
8
  const rpcConfig = rpc(chain);
@@ -21,20 +16,9 @@ function jsonRpcProvider({
21
16
  default: { http: [rpcConfig.http] }
22
17
  }
23
18
  },
24
- provider: () => {
25
- const RpcProvider = static_ ? providers.StaticJsonRpcProvider : providers.JsonRpcProvider;
26
- const provider = new RpcProvider(rpcConfig.http, {
27
- ensAddress: chain.contracts?.ensRegistry?.address,
28
- chainId: chain.id,
29
- name: chain.network
30
- });
31
- return Object.assign(provider, { priority, stallTimeout, weight });
32
- },
33
- ...rpcConfig.webSocket && {
34
- webSocketProvider: () => new providers.WebSocketProvider(
35
- rpcConfig.webSocket,
36
- chain.id
37
- )
19
+ rpcUrls: {
20
+ http: [rpcConfig.http],
21
+ webSocket: rpcConfig.webSocket ? [rpcConfig.webSocket] : void 0
38
22
  }
39
23
  };
40
24
  };
@@ -1,10 +1,7 @@
1
- import { providers } from 'ethers';
2
1
  import { Chain } from '@wagmi/chains';
3
- import { F as FallbackProviderConfig, C as ChainProviderFn } from '../index-35b6525c.js';
4
- import '@wagmi/connectors';
5
- import 'abitype';
2
+ import { C as ChainProviderFn } from '../index-fc9ab085.js';
3
+ import 'viem';
6
4
 
7
- type PublicProviderConfig = FallbackProviderConfig;
8
- declare function publicProvider<TChain extends Chain = Chain>({ priority, stallTimeout, weight, }?: PublicProviderConfig): ChainProviderFn<TChain, providers.StaticJsonRpcProvider>;
5
+ declare function publicProvider<TChain extends Chain = Chain>(): ChainProviderFn<TChain>;
9
6
 
10
- export { PublicProviderConfig, publicProvider };
7
+ export { publicProvider };
@@ -1,28 +1,13 @@
1
1
  import "../chunk-MQXBDTVK.js";
2
2
 
3
3
  // src/providers/public.ts
4
- import { providers } from "ethers";
5
- function publicProvider({
6
- priority,
7
- stallTimeout,
8
- weight
9
- } = {}) {
4
+ function publicProvider() {
10
5
  return function(chain) {
11
- if (!chain.rpcUrls.default.http[0])
6
+ if (!chain.rpcUrls.public.http[0])
12
7
  return null;
13
8
  return {
14
9
  chain,
15
- provider: () => {
16
- const provider = new providers.StaticJsonRpcProvider(
17
- chain.rpcUrls.default.http[0],
18
- {
19
- chainId: chain.id,
20
- name: chain.network,
21
- ensAddress: chain.contracts?.ensRegistry?.address
22
- }
23
- );
24
- return Object.assign(provider, { priority, stallTimeout, weight });
25
- }
10
+ rpcUrls: chain.rpcUrls.public
26
11
  };
27
12
  };
28
13
  }
@@ -0,0 +1,7 @@
1
+ import { WindowProvider } from '@wagmi/connectors';
2
+
3
+ declare global {
4
+ interface Window {
5
+ ethereum?: WindowProvider;
6
+ }
7
+ }
package/dist/window.js ADDED
File without changes
@@ -0,0 +1,11 @@
1
+ // are you seeing an error that a default export doesn't exist but your source file has a default export?
2
+ // you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
3
+
4
+ // curious why you need to?
5
+ // this file exists so that you can import from the entrypoint normally
6
+ // except that it points to your source file and you don't need to run build constantly
7
+ // which means we need to re-export all of the modules from your source file
8
+ // and since export * doesn't include default exports, we need to read your source file
9
+ // to check for a default export and re-export it if it exists
10
+ // it's not ideal, but it works pretty well ¯\_(ツ)_/¯
11
+ export * from "../../src/internal";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ // this file might look strange and you might be wondering what it's for
3
+ // it's lets you import your source files by importing this entrypoint
4
+ // as you would import it if it was built with preconstruct build
5
+ // this file is slightly different to some others though
6
+ // it has a require hook which compiles your code with Babel
7
+ // this means that you don't have to set up @babel/register or anything like that
8
+ // but you can still require this module and it'll be compiled
9
+
10
+ // this bit of code imports the require hook and registers it
11
+ let unregister = require("../../../../node_modules/.pnpm/@preconstruct+hook@0.4.0/node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../../..", "../..");
12
+
13
+ // this re-exports the source file
14
+ module.exports = require("../../src/internal.ts");
15
+
16
+ unregister();
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@wagmi/core",
3
3
  "description": "Vanilla JS library for Ethereum",
4
4
  "license": "MIT",
5
- "version": "0.10.10",
5
+ "version": "1.0.0-next.1",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/wagmi-dev/wagmi.git",
@@ -95,6 +95,10 @@
95
95
  "types": "./dist/providers/public.d.ts",
96
96
  "default": "./dist/providers/public.js"
97
97
  },
98
+ "./window": {
99
+ "types": "./dist/window.d.ts",
100
+ "default": "./dist/window.js"
101
+ },
98
102
  "./package.json": "./package.json"
99
103
  },
100
104
  "sideEffects": false,
@@ -103,10 +107,11 @@
103
107
  "/connectors",
104
108
  "/internal",
105
109
  "/providers",
110
+ "/window",
106
111
  "/dist"
107
112
  ],
108
113
  "peerDependencies": {
109
- "ethers": ">=5.5.1 <6",
114
+ "viem": "~0.3.16",
110
115
  "typescript": ">=4.9.4"
111
116
  },
112
117
  "peerDependenciesMeta": {
@@ -115,14 +120,14 @@
115
120
  }
116
121
  },
117
122
  "dependencies": {
118
- "abitype": "^0.3.0",
123
+ "abitype": "^0.7.1",
119
124
  "eventemitter3": "^4.0.7",
120
125
  "zustand": "^4.3.1",
121
- "@wagmi/chains": "0.2.19",
122
- "@wagmi/connectors": "0.3.16"
126
+ "@wagmi/chains": "0.2.18",
127
+ "@wagmi/connectors": "1.0.0-next.2"
123
128
  },
124
129
  "devDependencies": {
125
- "ethers": "^5.7.1"
130
+ "viem": "~0.3.16"
126
131
  },
127
132
  "keywords": [
128
133
  "eth",
@@ -0,0 +1,11 @@
1
+ // are you seeing an error that a default export doesn't exist but your source file has a default export?
2
+ // you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
3
+
4
+ // curious why you need to?
5
+ // this file exists so that you can import from the entrypoint normally
6
+ // except that it points to your source file and you don't need to run build constantly
7
+ // which means we need to re-export all of the modules from your source file
8
+ // and since export * doesn't include default exports, we need to read your source file
9
+ // to check for a default export and re-export it if it exists
10
+ // it's not ideal, but it works pretty well ¯\_(ツ)_/¯
11
+ export * from "../../../src/providers/alchemy";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ // this file might look strange and you might be wondering what it's for
3
+ // it's lets you import your source files by importing this entrypoint
4
+ // as you would import it if it was built with preconstruct build
5
+ // this file is slightly different to some others though
6
+ // it has a require hook which compiles your code with Babel
7
+ // this means that you don't have to set up @babel/register or anything like that
8
+ // but you can still require this module and it'll be compiled
9
+
10
+ // this bit of code imports the require hook and registers it
11
+ let unregister = require("../../../../../node_modules/.pnpm/@preconstruct+hook@0.4.0/node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../../../..", "../../..");
12
+
13
+ // this re-exports the source file
14
+ module.exports = require("../../../src/providers/alchemy.ts");
15
+
16
+ unregister();
@@ -0,0 +1,11 @@
1
+ // are you seeing an error that a default export doesn't exist but your source file has a default export?
2
+ // you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
3
+
4
+ // curious why you need to?
5
+ // this file exists so that you can import from the entrypoint normally
6
+ // except that it points to your source file and you don't need to run build constantly
7
+ // which means we need to re-export all of the modules from your source file
8
+ // and since export * doesn't include default exports, we need to read your source file
9
+ // to check for a default export and re-export it if it exists
10
+ // it's not ideal, but it works pretty well ¯\_(ツ)_/¯
11
+ export * from "../../../src/providers/infura";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ // this file might look strange and you might be wondering what it's for
3
+ // it's lets you import your source files by importing this entrypoint
4
+ // as you would import it if it was built with preconstruct build
5
+ // this file is slightly different to some others though
6
+ // it has a require hook which compiles your code with Babel
7
+ // this means that you don't have to set up @babel/register or anything like that
8
+ // but you can still require this module and it'll be compiled
9
+
10
+ // this bit of code imports the require hook and registers it
11
+ let unregister = require("../../../../../node_modules/.pnpm/@preconstruct+hook@0.4.0/node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../../../..", "../../..");
12
+
13
+ // this re-exports the source file
14
+ module.exports = require("../../../src/providers/infura.ts");
15
+
16
+ unregister();
@@ -0,0 +1,11 @@
1
+ // are you seeing an error that a default export doesn't exist but your source file has a default export?
2
+ // you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
3
+
4
+ // curious why you need to?
5
+ // this file exists so that you can import from the entrypoint normally
6
+ // except that it points to your source file and you don't need to run build constantly
7
+ // which means we need to re-export all of the modules from your source file
8
+ // and since export * doesn't include default exports, we need to read your source file
9
+ // to check for a default export and re-export it if it exists
10
+ // it's not ideal, but it works pretty well ¯\_(ツ)_/¯
11
+ export * from "../../../src/providers/jsonRpc";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ // this file might look strange and you might be wondering what it's for
3
+ // it's lets you import your source files by importing this entrypoint
4
+ // as you would import it if it was built with preconstruct build
5
+ // this file is slightly different to some others though
6
+ // it has a require hook which compiles your code with Babel
7
+ // this means that you don't have to set up @babel/register or anything like that
8
+ // but you can still require this module and it'll be compiled
9
+
10
+ // this bit of code imports the require hook and registers it
11
+ let unregister = require("../../../../../node_modules/.pnpm/@preconstruct+hook@0.4.0/node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../../../..", "../../..");
12
+
13
+ // this re-exports the source file
14
+ module.exports = require("../../../src/providers/jsonRpc.ts");
15
+
16
+ unregister();
@@ -0,0 +1,11 @@
1
+ // are you seeing an error that a default export doesn't exist but your source file has a default export?
2
+ // you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
3
+
4
+ // curious why you need to?
5
+ // this file exists so that you can import from the entrypoint normally
6
+ // except that it points to your source file and you don't need to run build constantly
7
+ // which means we need to re-export all of the modules from your source file
8
+ // and since export * doesn't include default exports, we need to read your source file
9
+ // to check for a default export and re-export it if it exists
10
+ // it's not ideal, but it works pretty well ¯\_(ツ)_/¯
11
+ export * from "../../../src/providers/public";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ // this file might look strange and you might be wondering what it's for
3
+ // it's lets you import your source files by importing this entrypoint
4
+ // as you would import it if it was built with preconstruct build
5
+ // this file is slightly different to some others though
6
+ // it has a require hook which compiles your code with Babel
7
+ // this means that you don't have to set up @babel/register or anything like that
8
+ // but you can still require this module and it'll be compiled
9
+
10
+ // this bit of code imports the require hook and registers it
11
+ let unregister = require("../../../../../node_modules/.pnpm/@preconstruct+hook@0.4.0/node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../../../..", "../../..");
12
+
13
+ // this re-exports the source file
14
+ module.exports = require("../../../src/providers/public.ts");
15
+
16
+ unregister();
@@ -0,0 +1,4 @@
1
+ {
2
+ "type": "module",
3
+ "main": "../dist/window.js"
4
+ }