diff --git a/.changeset/cold-gorillas-mate.md b/.changeset/cold-gorillas-mate.md new file mode 100644 index 00000000000..4dd959f59a4 --- /dev/null +++ b/.changeset/cold-gorillas-mate.md @@ -0,0 +1,5 @@ +--- +"@builder.io/qwik-city": minor +--- + +feat: Add Standard Schema validator to qwik-city diff --git a/package.json b/package.json index e984146d841..1c083f37dae 100644 --- a/package.json +++ b/package.json @@ -124,6 +124,7 @@ "@node-rs/helper": "1.6.0", "@octokit/action": "6.1.0", "@playwright/test": "1.50.1", + "@standard-schema/spec": "1.0.0", "@types/brotli": "1.3.4", "@types/bun": "1.1.6", "@types/cross-spawn": "6.0.6", @@ -181,7 +182,7 @@ "vitest": "2.0.5", "watchlist": "0.3.1", "which-pm-runs": "1.1.0", - "zod": "3.22.4" + "zod": "3.24.2" }, "engines": { "node": ">=16.8.0 <18.0.0 || >=18.11", diff --git a/packages/docs/src/routes/api/qwik-city/api.json b/packages/docs/src/routes/api/qwik-city/api.json index 7a66897870d..123277ffa46 100644 --- a/packages/docs/src/routes/api/qwik-city/api.json +++ b/packages/docs/src/routes/api/qwik-city/api.json @@ -292,7 +292,7 @@ } ], "kind": "TypeAlias", - "content": "```typescript\nexport type GetValidatorInputType = VALIDATOR extends ValibotDataValidator ? v.InferInput : VALIDATOR extends ZodDataValidator ? z.input : never;\n```\n**References:** [TypedDataValidator](#typeddatavalidator)", + "content": "```typescript\nexport type GetValidatorInputType = VALIDATOR extends StandardSchemaDataValidator ? StandardSchemaV1.InferInput : VALIDATOR extends ValibotDataValidator ? v.InferInput : VALIDATOR extends ZodDataValidator ? z.input : never;\n```\n**References:** [TypedDataValidator](#typeddatavalidator)", "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts", "mdFile": "qwik-city.getvalidatorinputtype.md" }, @@ -306,7 +306,7 @@ } ], "kind": "TypeAlias", - "content": "```typescript\nexport type GetValidatorOutputType = VALIDATOR extends ValibotDataValidator ? v.InferOutput : VALIDATOR extends ZodDataValidator ? z.output : never;\n```\n**References:** [TypedDataValidator](#typeddatavalidator)", + "content": "```typescript\nexport type GetValidatorOutputType = VALIDATOR extends StandardSchemaDataValidator ? StandardSchemaV1.InferOutput : VALIDATOR extends ValibotDataValidator ? v.InferOutput : VALIDATOR extends ZodDataValidator ? z.output : never;\n```\n**References:** [TypedDataValidator](#typeddatavalidator)", "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts", "mdFile": "qwik-city.getvalidatoroutputtype.md" }, @@ -716,6 +716,20 @@ "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/router-outlet-component.tsx", "mdFile": "qwik-city.routeroutlet.md" }, + { + "name": "schema$", + "id": "schema_", + "hierarchy": [ + { + "name": "schema$", + "id": "schema_" + } + ], + "kind": "Variable", + "content": "```typescript\nschema$: StandardSchemaConstructor\n```", + "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts", + "mdFile": "qwik-city.schema_.md" + }, { "name": "server$", "id": "server_", @@ -786,6 +800,20 @@ "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/sw-component.tsx", "mdFile": "qwik-city.serviceworkerregister.md" }, + { + "name": "standardSchemaQrl", + "id": "standardschemaqrl", + "hierarchy": [ + { + "name": "standardSchemaQrl", + "id": "standardschemaqrl" + } + ], + "kind": "Variable", + "content": "```typescript\nstandardSchemaQrl: StandardSchemaConstructorQRL\n```", + "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts", + "mdFile": "qwik-city.standardschemaqrl.md" + }, { "name": "StaticGenerate", "id": "staticgenerate", @@ -838,7 +866,7 @@ } ], "kind": "TypeAlias", - "content": "```typescript\nexport type TypedDataValidator = ValibotDataValidator | ZodDataValidator;\n```", + "content": "```typescript\nexport type TypedDataValidator = StandardSchemaDataValidator | ValibotDataValidator | ZodDataValidator;\n```", "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts", "mdFile": "qwik-city.typeddatavalidator.md" }, diff --git a/packages/docs/src/routes/api/qwik-city/index.md b/packages/docs/src/routes/api/qwik-city/index.md index 6af6d3b358c..878f821e939 100644 --- a/packages/docs/src/routes/api/qwik-city/index.md +++ b/packages/docs/src/routes/api/qwik-city/index.md @@ -1388,11 +1388,13 @@ T ```typescript export type GetValidatorInputType = - VALIDATOR extends ValibotDataValidator - ? v.InferInput - : VALIDATOR extends ZodDataValidator - ? z.input - : never; + VALIDATOR extends StandardSchemaDataValidator + ? StandardSchemaV1.InferInput + : VALIDATOR extends ValibotDataValidator + ? v.InferInput + : VALIDATOR extends ZodDataValidator + ? z.input + : never; ``` **References:** [TypedDataValidator](#typeddatavalidator) @@ -1403,11 +1405,13 @@ export type GetValidatorInputType = ```typescript export type GetValidatorOutputType = - VALIDATOR extends ValibotDataValidator - ? v.InferOutput - : VALIDATOR extends ZodDataValidator - ? z.output - : never; + VALIDATOR extends StandardSchemaDataValidator + ? StandardSchemaV1.InferOutput + : VALIDATOR extends ValibotDataValidator + ? v.InferOutput + : VALIDATOR extends ZodDataValidator + ? z.output + : never; ``` **References:** [TypedDataValidator](#typeddatavalidator) @@ -2173,6 +2177,14 @@ RouterOutlet: import("@builder.io/qwik").Component; [Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/router-outlet-component.tsx) +## schema$ + +```typescript +schema$: StandardSchemaConstructor; +``` + +[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts) + ## server$ ```typescript @@ -2306,6 +2318,14 @@ JSXOutput [Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/sw-component.tsx) +## standardSchemaQrl + +```typescript +standardSchemaQrl: StandardSchemaConstructorQRL; +``` + +[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts) + ## StaticGenerate ```typescript @@ -2373,7 +2393,10 @@ export type StrictUnion = Prettify>; ## TypedDataValidator ```typescript -export type TypedDataValidator = ValibotDataValidator | ZodDataValidator; +export type TypedDataValidator = + | StandardSchemaDataValidator + | ValibotDataValidator + | ZodDataValidator; ``` [Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts) diff --git a/packages/docs/src/routes/api/qwik/api.json b/packages/docs/src/routes/api/qwik/api.json index d03d9d6e066..38b1dae7893 100644 --- a/packages/docs/src/routes/api/qwik/api.json +++ b/packages/docs/src/routes/api/qwik/api.json @@ -1774,7 +1774,7 @@ } ], "kind": "Function", - "content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\n> Warning: This API is now obsolete.\n> \n> This is no longer needed as the preloading happens automatically in qrl-class.ts. Leave this in your app for a while so it uninstalls existing service workers, but don't use it for new projects.\n> \n\n\n```typescript\nPrefetchServiceWorker: (opts: {\n base?: string;\n scope?: string;\n path?: string;\n verbose?: boolean;\n fetchBundleGraph?: boolean;\n nonce?: string;\n}) => JSXNode<'script'>\n```\n\n\n\n\n
\n\nParameter\n\n\n\n\nType\n\n\n\n\nDescription\n\n\n
\n\nopts\n\n\n\n\n{ base?: string; scope?: string; path?: string; verbose?: boolean; fetchBundleGraph?: boolean; nonce?: string; }\n\n\n\n\n\n
\n**Returns:**\n\nJSXNode<'script'>", + "content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\n> Warning: This API is now obsolete.\n> \n> This is no longer needed as the preloading happens automatically in qrl-class.ts. Leave this in your app for a while so it uninstalls existing service workers, but don't use it for new projects.\n> \n\n\n```typescript\nPrefetchServiceWorker: (opts: {\n base?: string;\n scope?: string;\n path?: string;\n verbose?: boolean;\n fetchBundleGraph?: boolean;\n nonce?: string;\n}) => JSXNode<'script'>\n```\n\n\n\n\n
\n\nParameter\n\n\n\n\nType\n\n\n\n\nDescription\n\n\n
\n\nopts\n\n\n\n\n{ base?: string; scope?: string; path?: string; verbose?: boolean; fetchBundleGraph?: boolean; nonce?: string; }\n\n\n\n\n\n
\n**Returns:**\n\n[JSXNode](#jsxnode)<'script'>", "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts", "mdFile": "qwik.prefetchserviceworker.md" }, diff --git a/packages/docs/src/routes/api/qwik/index.md b/packages/docs/src/routes/api/qwik/index.md index ce41430014f..b049939a8c5 100644 --- a/packages/docs/src/routes/api/qwik/index.md +++ b/packages/docs/src/routes/api/qwik/index.md @@ -3651,7 +3651,7 @@ opts **Returns:** -JSXNode<'script'> +[JSXNode](#jsxnode)<'script'> [Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts) diff --git a/packages/insights/package.json b/packages/insights/package.json index 854074b096c..7e3d2fa7580 100644 --- a/packages/insights/package.json +++ b/packages/insights/package.json @@ -39,7 +39,7 @@ "vite": "5.3.5", "vite-tsconfig-paths": "4.3.2", "vitest": "2.0.5", - "zod": "3.22.4" + "zod": "3.24.2" }, "engines": { "node": ">=16.8.0 <18.0.0 || >=18.11" diff --git a/packages/qwik-city/package.json b/packages/qwik-city/package.json index a8626d470bc..2ff30afdd93 100644 --- a/packages/qwik-city/package.json +++ b/packages/qwik-city/package.json @@ -13,7 +13,7 @@ "vfile": "6.0.2", "vite": "^5", "vite-imagetools": "^7", - "zod": "3.22.4" + "zod": "3.24.2" }, "devDependencies": { "@azure/functions": "3.5.1", diff --git a/packages/qwik-city/src/runtime/src/api.md b/packages/qwik-city/src/runtime/src/api.md index 2e8062c1de5..5bdef95fd5a 100644 --- a/packages/qwik-city/src/runtime/src/api.md +++ b/packages/qwik-city/src/runtime/src/api.md @@ -23,6 +23,7 @@ import { RequestEventCommon } from '@builder.io/qwik-city/middleware/request-han import { RequestEventLoader } from '@builder.io/qwik-city/middleware/request-handler'; import { RequestHandler } from '@builder.io/qwik-city/middleware/request-handler'; import type { ResolveSyncValue } from '@builder.io/qwik-city/middleware/request-handler'; +import type { StandardSchemaV1 } from '@standard-schema/spec'; import type * as v from 'valibot'; import type { ValueOrPromise } from '@builder.io/qwik'; import { z } from 'zod'; @@ -240,14 +241,15 @@ export interface FormSubmitSuccessDetail { value: T; } +// Warning: (ae-forgotten-export) The symbol "StandardSchemaDataValidator" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ValibotDataValidator" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ZodDataValidator" needs to be exported by the entry point index.d.ts // // @public (undocumented) -export type GetValidatorInputType = VALIDATOR extends ValibotDataValidator ? v.InferInput : VALIDATOR extends ZodDataValidator ? z_2.input : never; +export type GetValidatorInputType = VALIDATOR extends StandardSchemaDataValidator ? StandardSchemaV1.InferInput : VALIDATOR extends ValibotDataValidator ? v.InferInput : VALIDATOR extends ZodDataValidator ? z_2.input : never; // @public (undocumented) -export type GetValidatorOutputType = VALIDATOR extends ValibotDataValidator ? v.InferOutput : VALIDATOR extends ZodDataValidator ? z_2.output : never; +export type GetValidatorOutputType = VALIDATOR extends StandardSchemaDataValidator ? StandardSchemaV1.InferOutput : VALIDATOR extends ValibotDataValidator ? v.InferOutput : VALIDATOR extends ZodDataValidator ? z_2.output : never; // @public (undocumented) export type GetValidatorType = GetValidatorOutputType; @@ -429,6 +431,11 @@ export type RouteNavigate = QRL<(path?: string | number | URL, options?: { // @public (undocumented) export const RouterOutlet: Component; +// Warning: (ae-forgotten-export) The symbol "StandardSchemaConstructor" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export const schema$: StandardSchemaConstructor; + // Warning: (ae-forgotten-export) The symbol "ServerConfig" needs to be exported by the entry point index.d.ts // // @public (undocumented) @@ -451,6 +458,11 @@ export const ServiceWorkerRegister: (props: { nonce?: string; }) => JSXOutput; +// Warning: (ae-forgotten-export) The symbol "StandardSchemaConstructorQRL" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export const standardSchemaQrl: StandardSchemaConstructorQRL; + // @public (undocumented) export interface StaticGenerate { // (undocumented) @@ -469,7 +481,7 @@ export type StaticGenerateHandler = ({ env, }: { export type StrictUnion = Prettify>; // @public (undocumented) -export type TypedDataValidator = ValibotDataValidator | ZodDataValidator; +export type TypedDataValidator = StandardSchemaDataValidator | ValibotDataValidator | ZodDataValidator; // Warning: (ae-forgotten-export) The symbol "ContentState" needs to be exported by the entry point index.d.ts // diff --git a/packages/qwik-city/src/runtime/src/index.ts b/packages/qwik-city/src/runtime/src/index.ts index 9c8df57f295..07e0237dbf2 100644 --- a/packages/qwik-city/src/runtime/src/index.ts +++ b/packages/qwik-city/src/runtime/src/index.ts @@ -61,6 +61,7 @@ export { routeAction$, routeActionQrl } from './server-functions'; export { globalAction$, globalActionQrl } from './server-functions'; export { routeLoader$, routeLoaderQrl } from './server-functions'; export { server$, serverQrl } from './server-functions'; +export { schema$, standardSchemaQrl } from './server-functions'; export { valibot$, valibotQrl } from './server-functions'; export { zod$, zodQrl } from './server-functions'; export { validator$, validatorQrl } from './server-functions'; diff --git a/packages/qwik-city/src/runtime/src/server-functions.ts b/packages/qwik-city/src/runtime/src/server-functions.ts index 193362a61ab..22ccfedf4c9 100644 --- a/packages/qwik-city/src/runtime/src/server-functions.ts +++ b/packages/qwik-city/src/runtime/src/server-functions.ts @@ -13,6 +13,7 @@ import { type ValueOrPromise, } from '@builder.io/qwik'; +import type { StandardSchemaV1 } from '@standard-schema/spec'; import * as v from 'valibot'; import { z } from 'zod'; import type { RequestEventLoader } from '../../middleware/request-handler/types'; @@ -47,6 +48,9 @@ import type { ZodConstructor, ZodConstructorQRL, ZodDataValidator, + StandardSchemaDataValidator, + StandardSchemaConstructorQRL, + StandardSchemaConstructor, } from './types'; import { useAction, useLocation, useQwikCityEnv } from './use-functions'; @@ -253,6 +257,61 @@ const flattenValibotIssues = (issues: v.GenericIssue[]) => { }, {}); }; +/** @public */ +export const standardSchemaQrl: StandardSchemaConstructorQRL = ( + qrl: QRL StandardSchemaV1)> +): StandardSchemaDataValidator => { + if (isServer) { + return { + __brand: 'standard-schema', + async validate(ev, inputData) { + const schema: StandardSchemaV1 = await qrl + .resolve() + .then((obj) => ('~standard' in obj ? obj : obj(ev))); + const data = inputData ?? (await ev.parseBody()); + const result = await schema['~standard'].validate(data); + if (!result.issues) { + return { + success: true, + data: result.value, + }; + } else { + if (isDev) { + console.error('ERROR: Standard Schema validation failed', result.issues); + } + const formErrors: string[] = []; + const fieldErrors: Partial> = {}; + for (const issue of result.issues) { + const dotPath = issue.path + ?.map((item) => (typeof item === 'object' ? item.key : item)) + .join('.'); + if (dotPath) { + const sub = fieldErrors[dotPath]; + if (sub) { + sub.push(issue.message); + } else { + fieldErrors[dotPath] = [issue.message]; + } + } else { + formErrors.push(issue.message); + } + } + return { + success: false, + status: 400, + error: { formErrors, fieldErrors }, + }; + } + }, + }; + } + return undefined as never; +}; + +/** @public */ +export const schema$: StandardSchemaConstructor = + /*#__PURE__*/ implicit$FirstArg(standardSchemaQrl); + /** @alpha */ export const valibotQrl: ValibotConstructorQRL = ( qrl: QRL< diff --git a/packages/qwik-city/src/runtime/src/server-functions.unit.ts b/packages/qwik-city/src/runtime/src/server-functions.unit.ts index 2e581e62ac4..1c5f9559559 100644 --- a/packages/qwik-city/src/runtime/src/server-functions.unit.ts +++ b/packages/qwik-city/src/runtime/src/server-functions.unit.ts @@ -1,6 +1,7 @@ -import { describe, expectTypeOf, test } from 'vitest'; +import type { StandardSchemaV1 } from '@standard-schema/spec'; +import { describe, expectTypeOf, test, expect } from 'vitest'; import { z } from 'zod'; -import { server$ } from './server-functions'; +import { server$, schema$ } from './server-functions'; import type { RequestEventBase, ValidatorErrorType } from './types'; describe('types', () => { @@ -161,4 +162,86 @@ describe('types', () => { someAnyType?: string; }>(); }); + + describe('Standard schema type with zod', () => { + const Schema = z.object({ + id: z.string().uuid(), + username: z.string().min(4), + password: z + .string() + .min(8) + .regex(/^[a-zA-Z]+$/), + verified: z.boolean().default(false), + createdAt: z.date({ coerce: true }).default(new Date()), + role: z.enum(['user', 'moderator', 'admin']).default('user'), + }); + + test('Test types', () => { + type ErrorType = ValidatorErrorType< + StandardSchemaV1.InferOutput + >['fieldErrors']; + + type EqualType = { + id?: string; + username?: string; + password?: string; + verified?: string; + role?: string; + }; + + expectTypeOf().toEqualTypeOf(); + expectTypeOf().not.toEqualTypeOf<{ + someAnyType?: string; + }>(); + }); + + test('Successful validation', async () => { + const schema = schema$(Schema); + const date = new Date(); + const okResult = await schema.validate(undefined as any, { + id: '9ff695ee-6604-4db5-af25-98a6ac682705', + username: 'test', + password: 'testpassword', + role: 'moderator', + createdAt: date.toISOString(), + }); + + expect(okResult).toEqual({ + success: true, + data: { + id: '9ff695ee-6604-4db5-af25-98a6ac682705', + username: 'test', + password: 'testpassword', + verified: false, + createdAt: date, + role: 'moderator', + }, + }); + }); + test('Failed validation', async () => { + const schema = schema$(Schema); + const failResult = await schema.validate(undefined as any, { + id: 'invalid-uuid', + password: 'short1', + role: 'missing-role', + date: 'Invalid date', + }); + + expect(failResult).toEqual({ + success: false, + status: 400, + error: { + formErrors: [], + fieldErrors: { + id: ['Invalid uuid'], + password: ['String must contain at least 8 character(s)', 'Invalid'], + username: ['Required'], + role: [ + "Invalid enum value. Expected 'user' | 'moderator' | 'admin', received 'missing-role'", + ], + }, + }, + }); + }); + }); }); diff --git a/packages/qwik-city/src/runtime/src/types.ts b/packages/qwik-city/src/runtime/src/types.ts index 12845d7c9af..f3927b4933f 100644 --- a/packages/qwik-city/src/runtime/src/types.ts +++ b/packages/qwik-city/src/runtime/src/types.ts @@ -17,6 +17,7 @@ import type { } from '@builder.io/qwik-city/middleware/request-handler'; import type * as v from 'valibot'; import type * as z from 'zod'; +import type { StandardSchemaV1 } from '@standard-schema/spec'; export type { Cookie, @@ -363,19 +364,23 @@ export type JSONObject = { [x: string]: JSONValue }; /** @public */ export type GetValidatorInputType = - VALIDATOR extends ValibotDataValidator - ? v.InferInput - : VALIDATOR extends ZodDataValidator - ? z.input - : never; + VALIDATOR extends StandardSchemaDataValidator + ? StandardSchemaV1.InferInput + : VALIDATOR extends ValibotDataValidator + ? v.InferInput + : VALIDATOR extends ZodDataValidator + ? z.input + : never; /** @public */ export type GetValidatorOutputType = - VALIDATOR extends ValibotDataValidator - ? v.InferOutput - : VALIDATOR extends ZodDataValidator - ? z.output - : never; + VALIDATOR extends StandardSchemaDataValidator + ? StandardSchemaV1.InferOutput + : VALIDATOR extends ValibotDataValidator + ? v.InferOutput + : VALIDATOR extends ZodDataValidator + ? z.output + : never; /** @public */ export type GetValidatorType = @@ -826,6 +831,29 @@ export type ValidatorConstructorQRL = { ): T extends ValidatorReturnFail ? DataValidator : DataValidator; }; +/** @public */ +export type StandardSchemaDataValidator = { + readonly __brand: 'standard-schema'; + validate( + ev: RequestEvent, + data: unknown + ): Promise>>>; +}; + +/** @public */ +export type StandardSchemaConstructor = { + (schema: T): StandardSchemaDataValidator; + (schema: (ev: RequestEvent) => T): StandardSchemaDataValidator; +}; + +/** @public */ +export type StandardSchemaConstructorQRL = { + (schema: QRL): StandardSchemaDataValidator; + ( + schema: QRL<(ev: RequestEvent) => T> + ): StandardSchemaDataValidator; +}; + /** @alpha */ export type ValibotDataValidator< T extends v.GenericSchema | v.GenericSchemaAsync = v.GenericSchema | v.GenericSchemaAsync, @@ -883,7 +911,10 @@ export type ZodConstructorQRL = { }; /** @public */ -export type TypedDataValidator = ValibotDataValidator | ZodDataValidator; +export type TypedDataValidator = + | StandardSchemaDataValidator + | ValibotDataValidator + | ZodDataValidator; /** @public */ export interface ServerConfig { diff --git a/packages/qwik-labs/package.json b/packages/qwik-labs/package.json index a303bac3504..efa61245f05 100644 --- a/packages/qwik-labs/package.json +++ b/packages/qwik-labs/package.json @@ -15,7 +15,7 @@ "typescript": "5.4.5", "undici": "*", "vite": "5.3.5", - "zod": "3.22.4" + "zod": "3.24.2" }, "engines": { "node": ">=16.8.0 <18.0.0 || >=18.11" @@ -39,7 +39,7 @@ "main": "./lib/index.qwik.mjs", "peerDependencies": { "vite": "^5", - "zod": "3.22.4" + "zod": "3.24.2" }, "private": true, "qwik": "./lib/index.qwik.mjs", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aa53adba1f6..672afa91505 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -70,6 +70,9 @@ importers: '@playwright/test': specifier: 1.50.1 version: 1.50.1 + '@standard-schema/spec': + specifier: 1.0.0 + version: 1.0.0 '@types/brotli': specifier: 1.3.4 version: 1.3.4 @@ -242,8 +245,8 @@ importers: specifier: 1.1.0 version: 1.1.0 zod: - specifier: 3.22.4 - version: 3.22.4 + specifier: 3.24.2 + version: 3.24.2 e2e/adapters-e2e: {} @@ -558,8 +561,8 @@ importers: specifier: 2.0.5 version: 2.0.5(@types/node@20.14.11)(lightningcss@1.29.1)(terser@5.31.3) zod: - specifier: 3.22.4 - version: 3.22.4 + specifier: 3.24.2 + version: 3.24.2 packages/qwik: dependencies: @@ -638,8 +641,8 @@ importers: specifier: ^7 version: 7.0.4(rollup@4.39.0) zod: - specifier: 3.22.4 - version: 3.22.4 + specifier: 3.24.2 + version: 3.24.2 devDependencies: '@azure/functions': specifier: 3.5.1 @@ -761,8 +764,8 @@ importers: specifier: 5.3.5 version: 5.3.5(@types/node@20.14.11)(lightningcss@1.29.1)(terser@5.31.3) zod: - specifier: 3.22.4 - version: 3.22.4 + specifier: 3.24.2 + version: 3.24.2 packages/qwik-react: devDependencies: @@ -1111,6 +1114,7 @@ packages: '@effect/schema@0.66.5': resolution: {integrity: sha512-xfu5161JyrfAS1Ruwv0RXd4QFiCALbm3iu9nlW9N9K+52wbS0WdO6XUekPZ9V/O7LN+XmlIh5Y9xhJaIWCZ/gw==} + deprecated: this package has been merged into the main effect package peerDependencies: effect: ^3.0.3 fast-check: ^3.13.2 @@ -3336,6 +3340,9 @@ packages: resolution: {integrity: sha512-doH1gimEu3A46VX6aVxpHTeHrytJAG6HgdxntYnCFiIFHEM/ZGpG8KiZGBChchjQmG0XFIBL552kBTjVcMZXwQ==} engines: {node: '>=12'} + '@standard-schema/spec@1.0.0': + resolution: {integrity: sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==} + '@supabase/auth-helpers-shared@0.6.3': resolution: {integrity: sha512-xYQRLFeFkL4ZfwC7p9VKcarshj3FB2QJMgJPydvOY7J5czJe6xSG5/wM1z63RmAzGbCkKg+dzpq61oeSyWiGBQ==} deprecated: This package is now deprecated - please use the @supabase/ssr package instead. @@ -9419,6 +9426,9 @@ packages: ufo@1.5.4: resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} + ufo@1.6.1: + resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==} + uid-safe@2.1.5: resolution: {integrity: sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==} engines: {node: '>= 0.8'} @@ -10020,12 +10030,12 @@ packages: resolution: {integrity: sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==} engines: {node: '>= 14'} - zod@3.22.4: - resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} - zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} + zod@3.24.2: + resolution: {integrity: sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==} + zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} @@ -11936,7 +11946,7 @@ snapshots: unixify: 1.0.0 urlpattern-polyfill: 8.0.2 yargs: 17.7.2 - zod: 3.23.8 + zod: 3.24.2 transitivePeerDependencies: - encoding - supports-color @@ -12366,6 +12376,8 @@ snapshots: dependencies: escape-string-regexp: 5.0.0 + '@standard-schema/spec@1.0.0': {} + '@supabase/auth-helpers-shared@0.6.3(@supabase/supabase-js@2.44.4)': dependencies: '@supabase/supabase-js': 2.44.4 @@ -15592,7 +15604,7 @@ snapshots: iron-webcrypto: 1.0.0 ohash: 1.1.3 radix3: 1.1.0 - ufo: 1.5.4 + ufo: 1.6.1 uncrypto: 0.1.3 unenv: 1.10.0 @@ -16478,7 +16490,7 @@ snapshots: node-forge: 1.3.1 pathe: 1.1.2 std-env: 3.7.0 - ufo: 1.5.4 + ufo: 1.6.1 untun: 0.1.3 uqr: 0.1.2 @@ -17214,7 +17226,7 @@ snapshots: workerd: 1.20240718.0 ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) youch: 3.3.3 - zod: 3.22.4 + zod: 3.24.2 transitivePeerDependencies: - bufferutil - supports-color @@ -17687,7 +17699,7 @@ snapshots: dependencies: destr: 2.0.3 node-fetch-native: 1.6.6 - ufo: 1.5.4 + ufo: 1.6.1 ohash@1.1.3: {} @@ -19530,6 +19542,8 @@ snapshots: ufo@1.5.4: {} + ufo@1.6.1: {} + uid-safe@2.1.5: dependencies: random-bytes: 1.0.0 @@ -19567,7 +19581,7 @@ snapshots: mime: 3.0.0 node-fetch-native: 1.6.6 pathe: 1.1.2 - ufo: 1.5.4 + ufo: 1.6.1 unenv@1.10.0: dependencies: @@ -19657,7 +19671,7 @@ snapshots: mri: 1.2.0 node-fetch-native: 1.6.6 ofetch: 1.3.3 - ufo: 1.5.4 + ufo: 1.6.1 optionalDependencies: '@netlify/blobs': 8.1.0 transitivePeerDependencies: @@ -20206,8 +20220,8 @@ snapshots: compress-commons: 6.0.2 readable-stream: 4.5.2 - zod@3.22.4: {} - zod@3.23.8: {} + zod@3.24.2: {} + zwitch@2.0.4: {}