From 2a21729fd93266b4a7669a42987a673a989a598a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 5 Dec 2025 18:59:58 +0000 Subject: [PATCH 1/3] chore(deps): update dependency arktype to v2.1.28 --- pnpm-lock.yaml | 45 +++++++++++---------------------------------- pnpm-workspace.yaml | 2 +- 2 files changed, 12 insertions(+), 35 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6e78b2887..fb380d677 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,8 +34,8 @@ catalogs: specifier: 4.0.15 version: 4.0.15 arktype: - specifier: 2.1.27 - version: 2.1.27 + specifier: 2.1.28 + version: 2.1.28 bun: specifier: 1.3.3 version: 1.3.3 @@ -120,7 +120,7 @@ importers: version: link:../../../packages/arkenv arktype: specifier: 'catalog:' - version: 2.1.27 + version: 2.1.28 devDependencies: '@types/bun': specifier: 'catalog:' @@ -139,7 +139,7 @@ importers: version: link:../../../packages/arkenv arktype: specifier: 'catalog:' - version: 2.1.27 + version: 2.1.28 react: specifier: 'catalog:' version: 19.2.1 @@ -164,7 +164,7 @@ importers: version: link:../../../packages/arkenv arktype: specifier: 'catalog:' - version: 2.1.27 + version: 2.1.28 devDependencies: '@types/node': specifier: 'catalog:' @@ -186,7 +186,7 @@ importers: version: link:../../../packages/arkenv arktype: specifier: 'catalog:' - version: 2.1.27 + version: 2.1.28 solid-js: specifier: 1.9.10 version: 1.9.10 @@ -204,7 +204,7 @@ importers: version: link:../../../packages/arkenv arktype: specifier: 'catalog:' - version: 2.1.27 + version: 2.1.28 react: specifier: 'catalog:' version: 19.2.1 @@ -419,7 +419,7 @@ importers: version: 24.10.1 arktype: specifier: 'catalog:' - version: 2.1.27 + version: 2.1.28 size-limit: specifier: 'catalog:' version: 11.2.0 @@ -453,7 +453,7 @@ importers: version: 1.3.3 arktype: specifier: 'catalog:' - version: 2.1.27 + version: 2.1.28 bun: specifier: 'catalog:' version: 1.3.3 @@ -474,7 +474,7 @@ importers: devDependencies: arktype: specifier: 'catalog:' - version: 2.1.27 + version: 2.1.28 typescript: specifier: 'catalog:' version: 5.9.3 @@ -493,7 +493,7 @@ importers: version: 11.2.0(size-limit@11.2.0) arktype: specifier: 'catalog:' - version: 2.1.27 + version: 2.1.28 size-limit: specifier: 'catalog:' version: 11.2.0 @@ -550,9 +550,6 @@ packages: '@apm-js-collab/tracing-hooks@0.3.1': resolution: {integrity: sha512-Vu1CbmPURlN5fTboVuKMoJjbO5qcq9fA5YXpskx3dXe/zTBvjODFoerw+69rVBlRLrJpwPqSDqEuJDEKIrTldw==} - '@ark/schema@0.55.0': - resolution: {integrity: sha512-IlSIc0FmLKTDGr4I/FzNHauMn0MADA6bCjT1wauu4k6MyxhC1R9gz0olNpIRvK7lGGDwtc/VO0RUDNvVQW5WFg==} - '@ark/schema@0.56.0': resolution: {integrity: sha512-ECg3hox/6Z/nLajxXqNhgPtNdHWC9zNsDyskwO28WinoFEnWow4IsERNz9AnXRhTZJnYIlAJ4uGn3nlLk65vZA==} @@ -3871,15 +3868,9 @@ packages: peerDependencies: arktype: ^2.1.22 - arkregex@0.0.3: - resolution: {integrity: sha512-bU21QJOJEFJK+BPNgv+5bVXkvRxyAvgnon75D92newgHxkBJTgiFwQxusyViYyJkETsddPlHyspshDQcCzmkNg==} - arkregex@0.0.4: resolution: {integrity: sha512-biS/FkvSwQq59TZ453piUp8bxMui11pgOMV9WHAnli1F8o0ayNCZzUwQadL/bGIUic5TkS/QlPcyMuI8ZIwedQ==} - arktype@2.1.27: - resolution: {integrity: sha512-enctOHxI4SULBv/TDtCVi5M8oLd4J5SVlPUblXDzSsOYQNMzmVbUosGBnJuZDKmFlN5Ie0/QVEuTE+Z5X1UhsQ==} - arktype@2.1.28: resolution: {integrity: sha512-LVZqXl2zWRpNFnbITrtFmqeqNkPPo+KemuzbGSY6jvJwCb4v8NsDzrWOLHnQgWl26TkJeWWcUNUeBpq2Mst1/Q==} @@ -7625,10 +7616,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@ark/schema@0.55.0': - dependencies: - '@ark/util': 0.55.0 - '@ark/schema@0.56.0': dependencies: '@ark/util': 0.56.0 @@ -11565,20 +11552,10 @@ snapshots: dependencies: arktype: 2.1.28 - arkregex@0.0.3: - dependencies: - '@ark/util': 0.55.0 - arkregex@0.0.4: dependencies: '@ark/util': 0.56.0 - arktype@2.1.27: - dependencies: - '@ark/schema': 0.55.0 - '@ark/util': 0.55.0 - arkregex: 0.0.3 - arktype@2.1.28: dependencies: '@ark/schema': 0.56.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 5b41a18cd..3c10c2136 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -18,7 +18,7 @@ catalog: "@types/react-dom": 19.2.3 "@vitejs/plugin-react": 5.1.1 "@vitest/ui": 4.0.15 - arktype: 2.1.27 + arktype: 2.1.28 bun: 1.3.3 concurrently: 9.2.1 globals: 16.5.0 From 3a80c0d269cb49fe117cb8d9c570978670fa25c7 Mon Sep 17 00:00:00 2001 From: Yam C Borodetsky Date: Sat, 6 Dec 2025 01:02:21 +0500 Subject: [PATCH 2/3] feat: Refactor playground environment schema to use Zod directly with arkenv and add Zod dependency, along with a type assertion in the Vite plugin. --- apps/playgrounds/node/.env.example | 1 + apps/playgrounds/node/index.ts | 8 +++++--- apps/playgrounds/node/package.json | 3 ++- packages/vite-plugin/src/index.ts | 2 +- pnpm-lock.yaml | 8 ++++++++ 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/apps/playgrounds/node/.env.example b/apps/playgrounds/node/.env.example index d9aad752d..cef375671 100644 --- a/apps/playgrounds/node/.env.example +++ b/apps/playgrounds/node/.env.example @@ -2,3 +2,4 @@ HOST=localhost PORT=3000 NODE_ENV=development DEBUG=true +ZED_ENV=development diff --git a/apps/playgrounds/node/index.ts b/apps/playgrounds/node/index.ts index b75715972..a0ee893b2 100644 --- a/apps/playgrounds/node/index.ts +++ b/apps/playgrounds/node/index.ts @@ -1,15 +1,15 @@ import arkenv, { type } from "arkenv"; +import * as z from "zod"; -const Env = type({ +const env = arkenv({ HOST: "string.host", PORT: "number.port", NODE_ENV: "'development' | 'production' | 'test' = 'development'", ALLOWED_ORIGINS: type("string[]").default(() => []), DEBUG: "boolean = true", + ZED_ENV: z.string(), }); -const env = arkenv(Env, process.env); - // Automatically validate and parse process.env // TypeScript knows the ✨exact✨ types! const host = env.HOST; @@ -17,12 +17,14 @@ const port = env.PORT; const nodeEnv = env.NODE_ENV; const allowedOrigins = env.ALLOWED_ORIGINS; const debug = env.DEBUG; +const zedEnv = env.ZED_ENV; console.log({ host, port, nodeEnv, allowedOrigins, debug, + zedEnv, }); export default env; diff --git a/apps/playgrounds/node/package.json b/apps/playgrounds/node/package.json index 2e8589022..b38ff684f 100644 --- a/apps/playgrounds/node/package.json +++ b/apps/playgrounds/node/package.json @@ -10,7 +10,8 @@ }, "dependencies": { "arkenv": "workspace:*", - "arktype": "catalog:" + "arktype": "catalog:", + "zod": "^4.1.13" }, "devDependencies": { "@types/node": "catalog:", diff --git a/packages/vite-plugin/src/index.ts b/packages/vite-plugin/src/index.ts index a629b239d..7323cd292 100644 --- a/packages/vite-plugin/src/index.ts +++ b/packages/vite-plugin/src/index.ts @@ -61,7 +61,7 @@ export default function arkenv>( // createEnv accepts both EnvSchema and type.Any at runtime // We use overloads above to provide external type precision - const env = createEnv(options, loadEnv(mode, process.cwd(), "")); + const env = createEnv(options as any, loadEnv(mode, process.cwd(), "")); // Filter to only include environment variables matching the prefix // This prevents server-only variables from being exposed to client code diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fb380d677..727c0d503 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -165,6 +165,9 @@ importers: arktype: specifier: 'catalog:' version: 2.1.28 + zod: + specifier: ^4.1.13 + version: 4.1.13 devDependencies: '@types/node': specifier: 'catalog:' @@ -7595,6 +7598,9 @@ packages: zod@4.1.12: resolution: {integrity: sha512-JInaHOamG8pt5+Ey8kGmdcAcg3OL9reK8ltczgHTAwNhMys/6ThXHityHxVV2p3fkw/c+MAvBHFVYHFZDmjMCQ==} + zod@4.1.13: + resolution: {integrity: sha512-AvvthqfqrAhNH9dnfmrfKzX5upOdjUVJYFqNSlkmGf64gRaTzlPwz99IHYnVs28qYAybvAlBV+H7pn0saFY4Ig==} + zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} @@ -15801,4 +15807,6 @@ snapshots: zod@4.1.12: {} + zod@4.1.13: {} + zwitch@2.0.4: {} From 8decc65e0b80443ea9c2918759227f7b6a6bdd3e Mon Sep 17 00:00:00 2001 From: Yam C Borodetsky Date: Sat, 6 Dec 2025 01:36:01 +0500 Subject: [PATCH 3/3] fix: Adjust `createEnv` type assertion from `any` to `never` and add a TODO comment for type improvement. --- packages/vite-plugin/src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vite-plugin/src/index.ts b/packages/vite-plugin/src/index.ts index 7323cd292..06eae7cff 100644 --- a/packages/vite-plugin/src/index.ts +++ b/packages/vite-plugin/src/index.ts @@ -61,7 +61,8 @@ export default function arkenv>( // createEnv accepts both EnvSchema and type.Any at runtime // We use overloads above to provide external type precision - const env = createEnv(options as any, loadEnv(mode, process.cwd(), "")); + // TODO: Improve the `EnvSchema` type rather than using `as never`. See #501. + const env = createEnv(options as never, loadEnv(mode, process.cwd(), "")); // Filter to only include environment variables matching the prefix // This prevents server-only variables from being exposed to client code