@zoralabs/protocol-sdk 0.5.5 → 0.5.6

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.
@@ -3,14 +3,14 @@ $ tsup
3
3
  CLI Building entry: src/index.ts
4
4
  CLI Using tsconfig: tsconfig.build.json
5
5
  CLI tsup v7.3.0
6
- CLI Using tsup config: /home/runner/work/zora-protocol-private/zora-protocol-private/packages/protocol-sdk/tsup.config.js
6
+ CLI Using tsup config: /home/runner/work/zora-protocol-private/zora-protocol-private/packages/protocol-sdk/tsup.config.ts
7
7
  CLI Target: es2021
8
8
  CLI Cleaning output folder
9
9
  CJS Build start
10
10
  ESM Build start
11
11
  CJS dist/index.cjs 50.17 KB
12
12
  CJS dist/index.cjs.map 97.10 KB
13
- CJS ⚡️ Build success in 113ms
13
+ CJS ⚡️ Build success in 72ms
14
14
  ESM dist/index.js 46.25 KB
15
15
  ESM dist/index.js.map 97.16 KB
16
- ESM ⚡️ Build success in 115ms
16
+ ESM ⚡️ Build success in 72ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @zoralabs/protocol-sdk
2
2
 
3
+ ## 0.5.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 52b16aa: Publishing package in format that supports commonjs imports by specifying exports
8
+ - Updated dependencies [52b16aa]
9
+ - @zoralabs/protocol-deployments@0.1.2
10
+
3
11
  ## 0.5.5
4
12
 
5
13
  ### Patch Changes
package/package.json CHANGED
@@ -1,11 +1,20 @@
1
1
  {
2
2
  "name": "@zoralabs/protocol-sdk",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "repository": "https://github.com/ourzora/zora-protocol",
5
5
  "license": "MIT",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
6
  "type": "module",
7
+ "main": "./dist/index.cjs",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "sideEffects": false,
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js",
15
+ "default": "./dist/index.cjs"
16
+ }
17
+ },
9
18
  "scripts": {
10
19
  "build": "tsup",
11
20
  "prepack": "yarn build",
@@ -7,5 +7,6 @@ export default defineConfig({
7
7
  tsconfig: "tsconfig.build.json",
8
8
  dts: false,
9
9
  format: ["cjs", "esm"],
10
- onSuccess: "tsc --project tsconfig.build.json --emitDeclarationOnly --declaration --declarationMap",
10
+ onSuccess:
11
+ "tsc --project tsconfig.build.json --emitDeclarationOnly --declaration --declarationMap",
11
12
  });
package/src/anvil.ts DELETED
@@ -1,111 +0,0 @@
1
- import { spawn } from "node:child_process";
2
- import { join } from "path";
3
- import { test } from "vitest";
4
- import {
5
- Chain,
6
- PublicClient,
7
- TestClient,
8
- WalletClient,
9
- createPublicClient,
10
- createTestClient,
11
- createWalletClient,
12
- http,
13
- } from "viem";
14
- import { foundry, zora } from "viem/chains";
15
-
16
- export interface AnvilViemClientsTest {
17
- viemClients: {
18
- walletClient: WalletClient;
19
- publicClient: PublicClient;
20
- testClient: TestClient;
21
- chain: Chain;
22
- };
23
- }
24
-
25
- async function waitForAnvilInit(anvil: any) {
26
- return new Promise((resolve) => {
27
- anvil.stdout.once("data", () => {
28
- resolve(true);
29
- });
30
- });
31
- }
32
-
33
- export type AnvilTestForkSettings = {
34
- forkUrl: string;
35
- forkBlockNumber: number;
36
- anvilChainId?: number;
37
- };
38
-
39
- export const makeAnvilTest = ({
40
- forkUrl,
41
- forkBlockNumber,
42
- anvilChainId = 31337,
43
- }: AnvilTestForkSettings) =>
44
- test.extend<AnvilViemClientsTest>({
45
- viemClients: async ({ task }, use) => {
46
- console.log("setting up clients for ", task.name);
47
- const port = Math.floor(Math.random() * 2000) + 4000;
48
- const anvil = spawn(
49
- "anvil",
50
- [
51
- "--port",
52
- `${port}`,
53
- "--fork-url",
54
- forkUrl,
55
- "--fork-block-number",
56
- `${forkBlockNumber}`,
57
- "--chain-id",
58
- anvilChainId.toString(),
59
- ],
60
- {
61
- cwd: join(__dirname, ".."),
62
- killSignal: "SIGINT",
63
- },
64
- );
65
- const anvilHost = `http://0.0.0.0:${port}`;
66
- await waitForAnvilInit(anvil);
67
-
68
- const chain: Chain = {
69
- ...foundry,
70
- id: anvilChainId,
71
- };
72
-
73
- const walletClient = createWalletClient({
74
- chain,
75
- transport: http(anvilHost),
76
- });
77
-
78
- const testClient = createTestClient({
79
- chain,
80
- mode: "anvil",
81
- transport: http(anvilHost),
82
- });
83
-
84
- const publicClient = createPublicClient({
85
- chain,
86
- transport: http(anvilHost),
87
- });
88
-
89
- await use({
90
- publicClient,
91
- walletClient,
92
- testClient,
93
- chain,
94
- });
95
-
96
- // clean up function, called once after all tests run
97
- anvil.kill("SIGINT");
98
- },
99
- });
100
-
101
- export const forkUrls = {
102
- zoraMainnet: "https://rpc.zora.co/",
103
- zoraGoerli: "https://testnet.rpc.zora.co",
104
- zoraSepolia: "https://sepolia.rpc.zora.energy",
105
- };
106
-
107
- export const anvilTest = makeAnvilTest({
108
- forkUrl: forkUrls.zoraMainnet,
109
- forkBlockNumber: 7866332,
110
- anvilChainId: zora.id,
111
- });