Skip to content

Commit

Permalink
feat: tree-shakable zod
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker committed Jan 13, 2025
1 parent 567aa81 commit 58edcda
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion scripts/i18n.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const generateTypes = async () => {
)
.join('\n\n');

const schema = `import { z } from 'zod';
const schema = `import * as z from 'zod';
${schemas}
Expand Down
2 changes: 1 addition & 1 deletion src/types/blob.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';

export const IcrcBlobSchema = z.string().refine(
(val) => {
Expand Down
2 changes: 1 addition & 1 deletion src/types/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Auto-generated definitions file ("npm run i18n")
import {z} from 'zod';
import * as z from 'zod';

export const i18nCoreSchema = z
.object({
Expand Down
2 changes: 1 addition & 1 deletion src/types/icrc-accounts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';
import {base64ToUint8Array} from '../utils/base64.utils';
import {IcrcBlobSchema} from './blob';
import {PrincipalTextSchema} from './principal';
Expand Down
2 changes: 1 addition & 1 deletion src/types/icrc-requests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {isNullish} from '@dfinity/utils';
import {z} from 'zod';
import * as z from 'zod';
import {
ICRC25_PERMISSIONS,
ICRC25_REQUEST_PERMISSIONS,
Expand Down
2 changes: 1 addition & 1 deletion src/types/icrc-responses.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';
import {IcrcBlobSchema} from './blob';
import {IcrcAccountsSchema} from './icrc-accounts';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/types/icrc-standards.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';
import {
ICRC21,
ICRC21_CALL_CONSENT_MESSAGE,
Expand Down
2 changes: 1 addition & 1 deletion src/types/post-message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';
import {UrlSchema} from './url';

export const OriginSchema = UrlSchema;
Expand Down
2 changes: 1 addition & 1 deletion src/types/principal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Principal} from '@dfinity/principal';
import {z} from 'zod';
import * as z from 'zod';

export const PrincipalTextSchema = z.string().refine(
(principal) => {
Expand Down
2 changes: 1 addition & 1 deletion src/types/relying-party-options.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';
import {UrlSchema} from './url';

const ConnectionOptionsSchema = z.object({
Expand Down
2 changes: 1 addition & 1 deletion src/types/relying-party-requests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';
import {RpcIdSchema} from './rpc';

export const RelyingPartyRequestOptionsTimeoutSchema = z.object({
Expand Down
2 changes: 1 addition & 1 deletion src/types/relying-party.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';
import {IcrcScopesSchema, IcrcSupportedStandardsSchema} from './icrc-responses';

const RelyingPartyMessageEventDataSchema = z
Expand Down
2 changes: 1 addition & 1 deletion src/types/rpc.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';
import {
JSON_RPC_VERSION_2,
RpcErrorCode,
Expand Down
2 changes: 1 addition & 1 deletion src/types/rpc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';

// JSON-RPC 2.0 Specification
// https://www.jsonrpc.org/specification
Expand Down
2 changes: 1 addition & 1 deletion src/types/signer-handlers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';
import {RpcIdSchema} from './rpc';

const NotifySchema = z.object({
Expand Down
2 changes: 1 addition & 1 deletion src/types/signer-options.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {type Identity} from '@dfinity/agent';
import {isNullish} from '@dfinity/utils';
import {z} from 'zod';
import * as z from 'zod';
import {UrlSchema} from './url';

const IdentitySchema = z.custom<Identity>((value: unknown): boolean => {
Expand Down
2 changes: 1 addition & 1 deletion src/types/signer-prompts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';
import {
ICRC21_CALL_CONSENT_MESSAGE,
ICRC25_REQUEST_PERMISSIONS,
Expand Down
2 changes: 1 addition & 1 deletion src/types/signer-sessions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';
import {IcrcScopeSchema} from './icrc-responses';

export const SessionTimestampsSchema = z.object({
Expand Down
2 changes: 1 addition & 1 deletion src/types/signer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';
import {
IcrcAccountsRequestSchema,
IcrcPermissionsRequestSchema,
Expand Down
2 changes: 1 addition & 1 deletion src/types/url.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from 'zod';
import * as z from 'zod';

export const UrlSchema = z
.string()
Expand Down

0 comments on commit 58edcda

Please sign in to comment.