Skip to content

Commit 9133430

Browse files
authored
Merge pull request #62 from macalinao/igm/bundle-size
Change zod import to be tree shakeable
2 parents 27f466d + 3d64ada commit 9133430

File tree

12 files changed

+19
-13
lines changed

12 files changed

+19
-13
lines changed

.changeset/dark-dolls-jam.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@macalinao/zod-solana": patch
3+
"example-dapp": patch
4+
---
5+
6+
Update zod import to be tree shakeable

apps/example-dapp/src/routes/examples/transfer-sol.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { ArrowRight, Wallet } from "lucide-react";
1717
import { useMemo } from "react";
1818
import { useForm } from "react-hook-form";
1919
import { toast } from "sonner";
20-
import { z } from "zod";
20+
import * as z from "zod";
2121
import { Button } from "@/components/ui/button";
2222
import {
2323
Card,

packages/zod-solana/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if (result.success) {
4747
```typescript
4848
import { useForm } from "react-hook-form";
4949
import { zodResolver } from "@hookform/resolvers/zod";
50-
import { z } from "zod";
50+
import * as z from "zod";
5151
import { addressSchema } from "@macalinao/zod-solana";
5252

5353
const formSchema = z.object({
@@ -84,7 +84,7 @@ function SendTokenForm() {
8484
### Type Inference
8585

8686
```typescript
87-
import { z } from "zod";
87+
import * as z from "zod";
8888
import { addressSchema } from "@macalinao/zod-solana";
8989

9090
// Infer the Address type
@@ -125,7 +125,7 @@ A Zod schema that validates Solana addresses.
125125
### Validating Multiple Addresses
126126

127127
```typescript
128-
import { z } from "zod";
128+
import * as z from "zod";
129129
import { addressSchema } from "@macalinao/zod-solana";
130130

131131
const multiSigSchema = z.object({

packages/zod-solana/src/address-schema.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { z } from "zod";
1+
import type * as z from "zod";
22
import { describe, expect, it } from "bun:test";
33
import { address } from "@solana/kit";
44
import { addressSchema } from "./address-schema.js";

packages/zod-solana/src/address-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Address } from "@solana/kit";
22
import { address } from "@solana/kit";
3-
import { z } from "zod";
3+
import * as z from "zod";
44

55
/**
66
* A Zod schema for Solana addresses.

packages/zod-solana/src/token-metadata-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from "zod";
1+
import * as z from "zod";
22

33
/**
44
* Schema for token metadata attributes

packages/zod-solana/src/u16-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from "zod";
1+
import * as z from "zod";
22
import { U16_MAX } from "./constants.js";
33

44
/**

packages/zod-solana/src/u32-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from "zod";
1+
import * as z from "zod";
22
import { U32_MAX } from "./constants.js";
33

44
/**

packages/zod-solana/src/u64-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from "zod";
1+
import * as z from "zod";
22
import { U64_MAX } from "./constants.js";
33

44
/**

packages/zod-solana/src/u64-string-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from "zod";
1+
import * as z from "zod";
22
import { U64_MAX } from "./constants.js";
33

44
/**

0 commit comments

Comments
 (0)