Skip to content

Commit

Permalink
chore: expose zod from astro:actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed Apr 25, 2024
1 parent 5ce935d commit 0da8dbf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/astro/src/actions/runtime/virtual/client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
export * from './shared.js';

export function defineAction() {
throw new Error('`defineAction()` unexpectedly used on the client.');
throw new Error('[astro:action] `defineAction()` unexpectedly used on the client.');
}

export const z = new Proxy({}, {
get() {
throw new Error('[astro:action] `z` unexpectedly used on the client.');
},
})
2 changes: 2 additions & 0 deletions packages/astro/src/actions/runtime/virtual/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { ActionError, ValidationError } from './shared.js';

export * from './shared.js';

export { z } from 'astro/zod';

export function defineAction<TOutput, TInputSchema extends z.ZodType>({
input: inputSchema,
handler,
Expand Down

0 comments on commit 0da8dbf

Please sign in to comment.