@arkenv/nextjs 0.0.9 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/client.cjs +1 -1
  2. package/dist/client.cjs.map +1 -1
  3. package/dist/client.d.cts +5 -3
  4. package/dist/client.d.cts.map +1 -1
  5. package/dist/client.d.ts +5 -3
  6. package/dist/client.d.ts.map +1 -1
  7. package/dist/client.js +1 -1
  8. package/dist/client.js.map +1 -1
  9. package/dist/config.cjs +43 -33
  10. package/dist/config.cjs.map +1 -1
  11. package/dist/config.d.cts +14 -29
  12. package/dist/config.d.cts.map +1 -1
  13. package/dist/config.d.ts +14 -29
  14. package/dist/config.d.ts.map +1 -1
  15. package/dist/config.js +43 -33
  16. package/dist/config.js.map +1 -1
  17. package/dist/create-env-B6DmIK3X.js +2 -0
  18. package/dist/create-env-B6DmIK3X.js.map +1 -0
  19. package/dist/create-env-C_h541CQ.cjs +2 -0
  20. package/dist/create-env-C_h541CQ.cjs.map +1 -0
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +28 -12
  24. package/dist/index.d.cts.map +1 -1
  25. package/dist/index.d.ts +28 -12
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/react-server.cjs +1 -1
  30. package/dist/react-server.cjs.map +1 -1
  31. package/dist/react-server.d.cts +21 -12
  32. package/dist/react-server.d.cts.map +1 -1
  33. package/dist/react-server.d.ts +21 -12
  34. package/dist/react-server.d.ts.map +1 -1
  35. package/dist/react-server.js +1 -1
  36. package/dist/react-server.js.map +1 -1
  37. package/dist/script-BJ1JRyJi.cjs +2 -0
  38. package/dist/script-BJ1JRyJi.cjs.map +1 -0
  39. package/dist/script-C06S6xXP.d.cts +21 -0
  40. package/dist/script-C06S6xXP.d.cts.map +1 -0
  41. package/dist/script-CAxxM5Zm.d.ts +21 -0
  42. package/dist/script-CAxxM5Zm.d.ts.map +1 -0
  43. package/dist/script-DB7wIIvT.js +2 -0
  44. package/dist/script-DB7wIIvT.js.map +1 -0
  45. package/dist/server.cjs +1 -1
  46. package/dist/server.cjs.map +1 -1
  47. package/dist/server.d.cts +6 -4
  48. package/dist/server.d.cts.map +1 -1
  49. package/dist/server.d.ts +6 -4
  50. package/dist/server.d.ts.map +1 -1
  51. package/dist/server.js +1 -1
  52. package/dist/server.js.map +1 -1
  53. package/dist/shared.cjs +1 -1
  54. package/dist/shared.cjs.map +1 -1
  55. package/dist/shared.d.cts +2 -3
  56. package/dist/shared.d.cts.map +1 -1
  57. package/dist/shared.d.ts +2 -3
  58. package/dist/shared.d.ts.map +1 -1
  59. package/dist/shared.js +1 -1
  60. package/dist/shared.js.map +1 -1
  61. package/dist/{index-Bn3pRiJy.d.ts → types-BzoNhHhq.d.ts} +14 -3
  62. package/dist/types-BzoNhHhq.d.ts.map +1 -0
  63. package/dist/{index-C6bpQ5GU.d.cts → types-DyUrJJZq.d.cts} +14 -3
  64. package/dist/types-DyUrJJZq.d.cts.map +1 -0
  65. package/package.json +11 -7
  66. package/dist/create-env-BfXQtLQM.js +0 -2
  67. package/dist/create-env-BfXQtLQM.js.map +0 -1
  68. package/dist/create-env-DDWVuzwL.cjs +0 -2
  69. package/dist/create-env-DDWVuzwL.cjs.map +0 -1
  70. package/dist/index-Bn3pRiJy.d.ts.map +0 -1
  71. package/dist/index-C6bpQ5GU.d.cts.map +0 -1
  72. package/dist/types-BN4fEChy.d.ts +0 -12
  73. package/dist/types-BN4fEChy.d.ts.map +0 -1
  74. package/dist/types-DBqiLw5v.d.cts +0 -12
  75. package/dist/types-DBqiLw5v.d.cts.map +0 -1
@@ -1,14 +1,28 @@
1
- import { t as SchemaShape } from "./index-C6bpQ5GU.cjs";
1
+ import { i as $, n as SchemaShape, t as MergeExtends } from "./types-DyUrJJZq.cjs";
2
+ import { n as ArkEnvScriptProps, t as ArkEnvScript } from "./script-C06S6xXP.cjs";
3
+ import { distill, type as type$1 } from "arktype";
2
4
  import { EnvSchema, Infer, Infer as Infer$1, type } from "arkenv";
3
5
 
4
6
  //#region src/react-server.d.ts
5
7
  /**
6
8
  * Create a validated, type-safe environment configuration for Next.js applications (Server-side RSC entry point).
7
- *
8
- * @param options The environment validation configuration options
9
- * @returns A validated, readonly environment variables object wrapped in a security proxy
10
- * @throws An error if any client-side variable is not prefixed with `NEXT_PUBLIC_`
11
- * @throws An error if any client or shared variable is missing from `runtimeEnv`
9
+ */
10
+ declare function createEnv<const TSchema extends SchemaShape & {
11
+ runtimeEnv?: never;
12
+ } = {}, const TShared extends keyof TSchema = never, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
13
+ /**
14
+ * Custom environment variables to expose to the client bundle.
15
+ * By default, variables prefixed with `NEXT_PUBLIC_` and `NODE_ENV` are exposed automatically.
16
+ * Use this option to expose custom variables that do not have the `NEXT_PUBLIC_` prefix.
17
+ */
18
+ exposeToClient?: readonly TShared[]; /** @deprecated Use `exposeToClient` instead */
19
+ expose?: readonly TShared[]; /** @deprecated Use `exposeToClient` instead */
20
+ shared?: readonly TShared[];
21
+ extends?: [...TExtends];
22
+ runtimeEnv?: Record<string, unknown>;
23
+ }): Readonly<distill.Out<type$1.infer<TSchema, $>> & MergeExtends<TExtends>>;
24
+ /**
25
+ * @deprecated Use the unified flat layout signature instead: `createEnv(schema, options)`
12
26
  */
13
27
  declare function createEnv<const TServer extends SchemaShape = {}, const TClient extends SchemaShape = {}, const TShared extends SchemaShape = {}>(options: {
14
28
  server?: EnvSchema<TServer>;
@@ -16,12 +30,7 @@ declare function createEnv<const TServer extends SchemaShape = {}, const TClient
16
30
  shared?: EnvSchema<TShared>;
17
31
  runtimeEnv: Record<keyof TClient | keyof TShared, unknown> & Record<string, unknown>;
18
32
  }): Readonly<Infer$1<TServer & TClient & TShared>>;
19
- /**
20
- * ArkEnv's Next.js integration export, an alias for {@link createEnv}
21
- *
22
- * {@link https://arkenv.js.org | ArkEnv} is a typesafe environment variables validator from editor to runtime.
23
- */
24
33
  declare const arkenv: typeof createEnv;
25
34
  //#endregion
26
- export { type Infer, createEnv, arkenv as default, type };
35
+ export { ArkEnvScript, type ArkEnvScriptProps, type Infer, createEnv, arkenv as default, type };
27
36
  //# sourceMappingURL=react-server.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-server.d.cts","names":[],"sources":["../src/react-server.ts"],"mappings":";;;;;;AAYA;;;;;;iBAAgB,SAAA,uBACO,WAAA,6BACA,WAAA,6BACA,WAAA,MAAA,CACrB,OAAA;EACD,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,MAAA,GAAS,SAAA,CAAU,OAAA,kBACN,OAAA,GAAU,CAAA;EAEvB,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,UAAA,EAAY,MAAA,OAAa,OAAA,SAAgB,OAAA,aACxC,MAAA;AAAA,IACE,QAAA,CAAS,OAAA,CAAM,OAAA,GAAU,OAAA,GAAU,OAAA;;;;;;cAajC,MAAA,SAAM,SAAA"}
1
+ {"version":3,"file":"react-server.d.cts","names":[],"sources":["../src/react-server.ts"],"mappings":";;;;;;;AAUA;;iBAAgB,SAAA,uBACO,WAAA;EAAgB,UAAA;AAAA,oCACV,OAAA,yDAAA,CAG5B,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EADkB;;;;;EAOjB,cAAA,YAA0B,OAAA,IAMb;EAJb,MAAA,YAAkB,OAAA,IAMsB;EAJxC,MAAA,YAAkB,OAAA;EAClB,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;;;;iBAK7C,SAAA,uBACO,WAAA,6BACA,WAAA,6BACA,WAAA,MAAA,CACrB,OAAA;EACD,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,MAAA,GAAS,SAAA,CAAU,OAAA,kBACN,OAAA,GAAU,CAAA;EAEvB,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,UAAA,EAAY,MAAA,OAAa,OAAA,SAAgB,OAAA,aACxC,MAAA;AAAA,IACE,QAAA,CAAS,OAAA,CAAM,OAAA,GAAU,OAAA,GAAU,OAAA;AAAA,cAyBjC,MAAA,SAAM,SAAA"}
@@ -1,14 +1,28 @@
1
- import { t as SchemaShape } from "./index-Bn3pRiJy.js";
1
+ import { i as $, n as SchemaShape, t as MergeExtends } from "./types-BzoNhHhq.js";
2
+ import { n as ArkEnvScriptProps, t as ArkEnvScript } from "./script-CAxxM5Zm.js";
2
3
  import { EnvSchema, Infer, Infer as Infer$1, type } from "arkenv";
4
+ import { distill, type as type$1 } from "arktype";
3
5
 
4
6
  //#region src/react-server.d.ts
5
7
  /**
6
8
  * Create a validated, type-safe environment configuration for Next.js applications (Server-side RSC entry point).
7
- *
8
- * @param options The environment validation configuration options
9
- * @returns A validated, readonly environment variables object wrapped in a security proxy
10
- * @throws An error if any client-side variable is not prefixed with `NEXT_PUBLIC_`
11
- * @throws An error if any client or shared variable is missing from `runtimeEnv`
9
+ */
10
+ declare function createEnv<const TSchema extends SchemaShape & {
11
+ runtimeEnv?: never;
12
+ } = {}, const TShared extends keyof TSchema = never, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
13
+ /**
14
+ * Custom environment variables to expose to the client bundle.
15
+ * By default, variables prefixed with `NEXT_PUBLIC_` and `NODE_ENV` are exposed automatically.
16
+ * Use this option to expose custom variables that do not have the `NEXT_PUBLIC_` prefix.
17
+ */
18
+ exposeToClient?: readonly TShared[]; /** @deprecated Use `exposeToClient` instead */
19
+ expose?: readonly TShared[]; /** @deprecated Use `exposeToClient` instead */
20
+ shared?: readonly TShared[];
21
+ extends?: [...TExtends];
22
+ runtimeEnv?: Record<string, unknown>;
23
+ }): Readonly<distill.Out<type$1.infer<TSchema, $>> & MergeExtends<TExtends>>;
24
+ /**
25
+ * @deprecated Use the unified flat layout signature instead: `createEnv(schema, options)`
12
26
  */
13
27
  declare function createEnv<const TServer extends SchemaShape = {}, const TClient extends SchemaShape = {}, const TShared extends SchemaShape = {}>(options: {
14
28
  server?: EnvSchema<TServer>;
@@ -16,12 +30,7 @@ declare function createEnv<const TServer extends SchemaShape = {}, const TClient
16
30
  shared?: EnvSchema<TShared>;
17
31
  runtimeEnv: Record<keyof TClient | keyof TShared, unknown> & Record<string, unknown>;
18
32
  }): Readonly<Infer$1<TServer & TClient & TShared>>;
19
- /**
20
- * ArkEnv's Next.js integration export, an alias for {@link createEnv}
21
- *
22
- * {@link https://arkenv.js.org | ArkEnv} is a typesafe environment variables validator from editor to runtime.
23
- */
24
33
  declare const arkenv: typeof createEnv;
25
34
  //#endregion
26
- export { type Infer, createEnv, arkenv as default, type };
35
+ export { ArkEnvScript, type ArkEnvScriptProps, type Infer, createEnv, arkenv as default, type };
27
36
  //# sourceMappingURL=react-server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-server.d.ts","names":[],"sources":["../src/react-server.ts"],"mappings":";;;;;;AAYA;;;;;;iBAAgB,SAAA,uBACO,WAAA,6BACA,WAAA,6BACA,WAAA,MAAA,CACrB,OAAA;EACD,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,MAAA,GAAS,SAAA,CAAU,OAAA,kBACN,OAAA,GAAU,CAAA;EAEvB,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,UAAA,EAAY,MAAA,OAAa,OAAA,SAAgB,OAAA,aACxC,MAAA;AAAA,IACE,QAAA,CAAS,OAAA,CAAM,OAAA,GAAU,OAAA,GAAU,OAAA;;;;;;cAajC,MAAA,SAAM,SAAA"}
1
+ {"version":3,"file":"react-server.d.ts","names":[],"sources":["../src/react-server.ts"],"mappings":";;;;;;;AAUA;;iBAAgB,SAAA,uBACO,WAAA;EAAgB,UAAA;AAAA,oCACV,OAAA,yDAAA,CAG5B,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EADkB;;;;;EAOjB,cAAA,YAA0B,OAAA,IAMb;EAJb,MAAA,YAAkB,OAAA,IAMsB;EAJxC,MAAA,YAAkB,OAAA;EAClB,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;;;;iBAK7C,SAAA,uBACO,WAAA,6BACA,WAAA,6BACA,WAAA,MAAA,CACrB,OAAA;EACD,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,MAAA,GAAS,SAAA,CAAU,OAAA,kBACN,OAAA,GAAU,CAAA;EAEvB,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,UAAA,EAAY,MAAA,OAAa,OAAA,SAAgB,OAAA,aACxC,MAAA;AAAA,IACE,QAAA,CAAS,OAAA,CAAM,OAAA,GAAU,OAAA,GAAU,OAAA;AAAA,cAyBjC,MAAA,SAAM,SAAA"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./create-env-BfXQtLQM.js";import{type as t}from"arkenv";function n(t){return e(t,!0)}const r=n;export{n as createEnv,r as default,t as type};
1
+ import{t as e}from"./create-env-B6DmIK3X.js";import{t}from"./script-DB7wIIvT.js";import{type as n}from"arkenv";function r(t,n){return t&&typeof t==`object`&&(`runtimeEnv`in t||`server`in t||`client`in t||`shared`in t)?e(t,!0):e(t,n,{isServer:!0})}const i=r;export{t as ArkEnvScript,r as createEnv,i as default,n as type};
2
2
  //# sourceMappingURL=react-server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-server.js","names":[],"sources":["../src/react-server.ts"],"sourcesContent":["import type { SchemaShape } from \"@repo/types\";\nimport type { EnvSchema, Infer } from \"arkenv\";\nimport { createEnvInternal } from \"./create-env\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Server-side RSC entry point).\n *\n * @param options The environment validation configuration options\n * @returns A validated, readonly environment variables object wrapped in a security proxy\n * @throws An error if any client-side variable is not prefixed with `NEXT_PUBLIC_`\n * @throws An error if any client or shared variable is missing from `runtimeEnv`\n */\nexport function createEnv<\n\tconst TServer extends SchemaShape = {},\n\tconst TClient extends SchemaShape = {},\n\tconst TShared extends SchemaShape = {},\n>(options: {\n\tserver?: EnvSchema<TServer>;\n\tclient?: EnvSchema<TClient> & {\n\t\t[K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never;\n\t};\n\tshared?: EnvSchema<TShared>;\n\truntimeEnv: Record<keyof TClient | keyof TShared, unknown> &\n\t\tRecord<string, unknown>;\n}): Readonly<Infer<TServer & TClient & TShared>> {\n\ttype ReturnType = Readonly<Infer<TServer & TClient & TShared>>;\n\treturn createEnvInternal(options, true) as ReturnType;\n}\n\nexport type { Infer } from \"arkenv\";\nexport { type } from \"arkenv\";\n\n/**\n * ArkEnv's Next.js integration export, an alias for {@link createEnv}\n *\n * {@link https://arkenv.js.org | ArkEnv} is a typesafe environment variables validator from editor to runtime.\n */\nconst arkenv = createEnv;\nexport default arkenv;\n"],"mappings":"2EAYA,SAAgB,EAId,EAQ+C,CAEhD,OAAO,EAAkB,EAAS,GAAK,CAWxC,MAAM,EAAS"}
1
+ {"version":3,"file":"react-server.js","names":[],"sources":["../src/react-server.ts"],"sourcesContent":["import type { $ } from \"@repo/scope\";\nimport type { SchemaShape } from \"@repo/types\";\nimport type { EnvSchema, Infer } from \"arkenv\";\nimport type { type as at, distill } from \"arktype\";\nimport { createEnvInternal } from \"./create-env\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Server-side RSC entry point).\n */\nexport function createEnv<\n\tconst TSchema extends SchemaShape & { runtimeEnv?: never } = {},\n\tconst TShared extends keyof TSchema = never,\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\t/**\n\t\t * Custom environment variables to expose to the client bundle.\n\t\t * By default, variables prefixed with `NEXT_PUBLIC_` and `NODE_ENV` are exposed automatically.\n\t\t * Use this option to expose custom variables that do not have the `NEXT_PUBLIC_` prefix.\n\t\t */\n\t\texposeToClient?: readonly TShared[];\n\t\t/** @deprecated Use `exposeToClient` instead */\n\t\texpose?: readonly TShared[];\n\t\t/** @deprecated Use `exposeToClient` instead */\n\t\tshared?: readonly TShared[];\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Record<string, unknown>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>>;\n\n/**\n * @deprecated Use the unified flat layout signature instead: `createEnv(schema, options)`\n */\nexport function createEnv<\n\tconst TServer extends SchemaShape = {},\n\tconst TClient extends SchemaShape = {},\n\tconst TShared extends SchemaShape = {},\n>(options: {\n\tserver?: EnvSchema<TServer>;\n\tclient?: EnvSchema<TClient> & {\n\t\t[K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never;\n\t};\n\tshared?: EnvSchema<TShared>;\n\truntimeEnv: Record<keyof TClient | keyof TShared, unknown> &\n\t\tRecord<string, unknown>;\n}): Readonly<Infer<TServer & TClient & TShared>>;\n\nexport function createEnv(schemaOrOptions: any, optionsOrIsServer?: any): any {\n\tconst isLegacy =\n\t\tschemaOrOptions &&\n\t\ttypeof schemaOrOptions === \"object\" &&\n\t\t(\"runtimeEnv\" in schemaOrOptions ||\n\t\t\t\"server\" in schemaOrOptions ||\n\t\t\t\"client\" in schemaOrOptions ||\n\t\t\t\"shared\" in schemaOrOptions);\n\n\tif (isLegacy) {\n\t\treturn createEnvInternal(schemaOrOptions, true);\n\t}\n\n\treturn createEnvInternal(schemaOrOptions, optionsOrIsServer, {\n\t\tisServer: true,\n\t});\n}\n\nexport type { Infer } from \"arkenv\";\nexport { type } from \"arkenv\";\nexport type { ArkEnvScriptProps } from \"./script\";\nexport { ArkEnvScript } from \"./script\";\n\nconst arkenv = createEnv;\nexport default arkenv;\n"],"mappings":"+GAiDA,SAAgB,EAAU,EAAsB,EAA8B,CAa7E,OAXC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GACZ,WAAY,GAGN,EAAkB,EAAiB,GAAK,CAGzC,EAAkB,EAAiB,EAAmB,CAC5D,SAAU,GACV,CAAC,CAQH,MAAM,EAAS"}
@@ -0,0 +1,2 @@
1
+ require(`./config.cjs`);let e=require(`react/jsx-runtime`);function t({env:t}={}){let n={};if(typeof process<`u`&&process.env)for(let e of Object.keys(process.env))e.startsWith(`NEXT_PUBLIC_`)&&(n[e]=process.env[e]);if(t)for(let e of Object.keys(t))e.startsWith(`NEXT_PUBLIC_`)&&(n[e]=t[e]);return(0,e.jsx)(`script`,{id:`arkenv-script`,dangerouslySetInnerHTML:{__html:`globalThis.__arkenv_env__ = ${JSON.stringify(n).replace(/</g,`\\u003c`)};`}})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
2
+ //# sourceMappingURL=script-BJ1JRyJi.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-BJ1JRyJi.cjs","names":[],"sources":["../src/script.tsx"],"sourcesContent":["import type React from \"react\";\n\nexport type ArkEnvScriptProps = {\n\t/**\n\t * Optional custom environment variable map. If provided, any keys starting\n\t * with `NEXT_PUBLIC_` will be merged with public keys from `process.env`.\n\t */\n\tenv?: Record<string, string | undefined>;\n};\n\n/**\n * A React Component to serialize and inject NEXT_PUBLIC_* environment variables into the browser\n * during Server-Side Rendering (SSR). Placed in your root layout (layout.tsx), it sets\n * globalThis.__arkenv_env__ to ensure client-side components have access to runtime environment values.\n */\nexport function ArkEnvScript({\n\tenv,\n}: ArkEnvScriptProps = {}): React.ReactElement {\n\tconst publicEnv: Record<string, string | undefined> = {};\n\n\tif (typeof process !== \"undefined\" && process.env) {\n\t\tfor (const key of Object.keys(process.env)) {\n\t\t\tif (key.startsWith(\"NEXT_PUBLIC_\")) {\n\t\t\t\tpublicEnv[key] = process.env[key];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (env) {\n\t\tfor (const key of Object.keys(env)) {\n\t\t\tif (key.startsWith(\"NEXT_PUBLIC_\")) {\n\t\t\t\tpublicEnv[key] = env[key];\n\t\t\t}\n\t\t}\n\t}\n\n\tconst scriptContent = `globalThis.__arkenv_env__ = ${JSON.stringify(publicEnv).replace(/</g, \"\\\\u003c\")};`;\n\n\treturn (\n\t\t<script\n\t\t\tid=\"arkenv-script\"\n\t\t\tdangerouslySetInnerHTML={{ __html: scriptContent }}\n\t\t/>\n\t);\n}\n"],"mappings":"2DAeA,SAAgB,EAAa,CAC5B,OACsB,EAAE,CAAsB,CAC9C,IAAM,EAAgD,EAAE,CAExD,GAAI,OAAO,QAAY,KAAe,QAAQ,QACxC,IAAM,KAAO,OAAO,KAAK,QAAQ,IAAI,CACrC,EAAI,WAAW,eAAe,GACjC,EAAU,GAAO,QAAQ,IAAI,IAKhC,GAAI,MACE,IAAM,KAAO,OAAO,KAAK,EAAI,CAC7B,EAAI,WAAW,eAAe,GACjC,EAAU,GAAO,EAAI,IAOxB,OACC,EAAA,EAAA,KAAC,SAAD,CACC,GAAG,gBACH,wBAAyB,CAAE,OAAQ,+BALgB,KAAK,UAAU,EAAU,CAAC,QAAQ,KAAM,UAAU,CAAC,GAKpD,CACjD,CAAA"}
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+
3
+ //#region src/script.d.ts
4
+ type ArkEnvScriptProps = {
5
+ /**
6
+ * Optional custom environment variable map. If provided, any keys starting
7
+ * with `NEXT_PUBLIC_` will be merged with public keys from `process.env`.
8
+ */
9
+ env?: Record<string, string | undefined>;
10
+ };
11
+ /**
12
+ * A React Component to serialize and inject NEXT_PUBLIC_* environment variables into the browser
13
+ * during Server-Side Rendering (SSR). Placed in your root layout (layout.tsx), it sets
14
+ * globalThis.__arkenv_env__ to ensure client-side components have access to runtime environment values.
15
+ */
16
+ declare function ArkEnvScript({
17
+ env
18
+ }?: ArkEnvScriptProps): React.ReactElement;
19
+ //#endregion
20
+ export { ArkEnvScriptProps as n, ArkEnvScript as t };
21
+ //# sourceMappingURL=script-C06S6xXP.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-C06S6xXP.d.cts","names":[],"sources":["../src/script.tsx"],"mappings":";;;KAEY,iBAAA;;AAAZ;;;EAKC,GAAA,GAAM,MAAA;AAAA;AAQP;;;;;AAAA,iBAAgB,YAAA,CAAA;EACf;AAAA,IACE,iBAAA,GAAyB,KAAA,CAAM,YAAA"}
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+
3
+ //#region src/script.d.ts
4
+ type ArkEnvScriptProps = {
5
+ /**
6
+ * Optional custom environment variable map. If provided, any keys starting
7
+ * with `NEXT_PUBLIC_` will be merged with public keys from `process.env`.
8
+ */
9
+ env?: Record<string, string | undefined>;
10
+ };
11
+ /**
12
+ * A React Component to serialize and inject NEXT_PUBLIC_* environment variables into the browser
13
+ * during Server-Side Rendering (SSR). Placed in your root layout (layout.tsx), it sets
14
+ * globalThis.__arkenv_env__ to ensure client-side components have access to runtime environment values.
15
+ */
16
+ declare function ArkEnvScript({
17
+ env
18
+ }?: ArkEnvScriptProps): React.ReactElement;
19
+ //#endregion
20
+ export { ArkEnvScriptProps as n, ArkEnvScript as t };
21
+ //# sourceMappingURL=script-CAxxM5Zm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-CAxxM5Zm.d.ts","names":[],"sources":["../src/script.tsx"],"mappings":";;;KAEY,iBAAA;;AAAZ;;;EAKC,GAAA,GAAM,MAAA;AAAA;AAQP;;;;;AAAA,iBAAgB,YAAA,CAAA;EACf;AAAA,IACE,iBAAA,GAAyB,KAAA,CAAM,YAAA"}
@@ -0,0 +1,2 @@
1
+ import{jsx as e}from"react/jsx-runtime";function t({env:t}={}){let n={};if(typeof process<`u`&&process.env)for(let e of Object.keys(process.env))e.startsWith(`NEXT_PUBLIC_`)&&(n[e]=process.env[e]);if(t)for(let e of Object.keys(t))e.startsWith(`NEXT_PUBLIC_`)&&(n[e]=t[e]);return e(`script`,{id:`arkenv-script`,dangerouslySetInnerHTML:{__html:`globalThis.__arkenv_env__ = ${JSON.stringify(n).replace(/</g,`\\u003c`)};`}})}export{t};
2
+ //# sourceMappingURL=script-DB7wIIvT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-DB7wIIvT.js","names":[],"sources":["../src/script.tsx"],"sourcesContent":["import type React from \"react\";\n\nexport type ArkEnvScriptProps = {\n\t/**\n\t * Optional custom environment variable map. If provided, any keys starting\n\t * with `NEXT_PUBLIC_` will be merged with public keys from `process.env`.\n\t */\n\tenv?: Record<string, string | undefined>;\n};\n\n/**\n * A React Component to serialize and inject NEXT_PUBLIC_* environment variables into the browser\n * during Server-Side Rendering (SSR). Placed in your root layout (layout.tsx), it sets\n * globalThis.__arkenv_env__ to ensure client-side components have access to runtime environment values.\n */\nexport function ArkEnvScript({\n\tenv,\n}: ArkEnvScriptProps = {}): React.ReactElement {\n\tconst publicEnv: Record<string, string | undefined> = {};\n\n\tif (typeof process !== \"undefined\" && process.env) {\n\t\tfor (const key of Object.keys(process.env)) {\n\t\t\tif (key.startsWith(\"NEXT_PUBLIC_\")) {\n\t\t\t\tpublicEnv[key] = process.env[key];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (env) {\n\t\tfor (const key of Object.keys(env)) {\n\t\t\tif (key.startsWith(\"NEXT_PUBLIC_\")) {\n\t\t\t\tpublicEnv[key] = env[key];\n\t\t\t}\n\t\t}\n\t}\n\n\tconst scriptContent = `globalThis.__arkenv_env__ = ${JSON.stringify(publicEnv).replace(/</g, \"\\\\u003c\")};`;\n\n\treturn (\n\t\t<script\n\t\t\tid=\"arkenv-script\"\n\t\t\tdangerouslySetInnerHTML={{ __html: scriptContent }}\n\t\t/>\n\t);\n}\n"],"mappings":"wCAeA,SAAgB,EAAa,CAC5B,OACsB,EAAE,CAAsB,CAC9C,IAAM,EAAgD,EAAE,CAExD,GAAI,OAAO,QAAY,KAAe,QAAQ,QACxC,IAAM,KAAO,OAAO,KAAK,QAAQ,IAAI,CACrC,EAAI,WAAW,eAAe,GACjC,EAAU,GAAO,QAAQ,IAAI,IAKhC,GAAI,MACE,IAAM,KAAO,OAAO,KAAK,EAAI,CAC7B,EAAI,WAAW,eAAe,GACjC,EAAU,GAAO,EAAI,IAOxB,OACC,EAAC,SAAD,CACC,GAAG,gBACH,wBAAyB,CAAE,OAAQ,+BALgB,KAAK,UAAU,EAAU,CAAC,QAAQ,KAAM,UAAU,CAAC,GAKpD,CACjD,CAAA"}
package/dist/server.cjs CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./create-env-DDWVuzwL.cjs`);require(`./config.cjs`);let t=require(`arkenv`);require(`server-only`);function n(t,n){if(t&&typeof t==`object`&&(`runtimeEnv`in t||`server`in t||`shared`in t)){if(`client`in t)throw Error(`server entry point only accepts 'server' and 'shared' schemas.`);return e.t(t,!0)}return e.t(t,n,{isServer:!0})}const r=n;exports.createEnv=n,exports.default=r,Object.defineProperty(exports,`type`,{enumerable:!0,get:function(){return t.type}});
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./create-env-C_h541CQ.cjs`);require(`./config.cjs`);let t=require(`arkenv`);require(`server-only`);function n(t,n){if(t&&typeof t==`object`&&(`runtimeEnv`in t||`server`in t||`shared`in t)){if(`client`in t)throw Error(`server entry point only accepts 'server' and 'shared' schemas.`);return e.t(t,!0)}return e.t(t,n,{isServer:!0,strictLayout:`server`})}const r=n;exports.createEnv=n,exports.default=r,Object.defineProperty(exports,`type`,{enumerable:!0,get:function(){return t.type}});
2
2
  //# sourceMappingURL=server.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.cjs","names":["createEnvInternal","arkenv"],"sources":["../src/server.ts"],"sourcesContent":["import \"server-only\";\nimport type { $ } from \"@repo/scope\";\nimport type { SchemaShape } from \"@repo/types\";\nimport type { EnvSchema } from \"arkenv\";\nimport type { type as at, distill } from \"arktype\";\nimport { createEnvInternal } from \"./create-env\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Server entry point).\n */\nexport function createEnv<\n\tconst TSchema extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Record<keyof TSchema | string, unknown>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>>;\n\nexport function createEnv<\n\tconst TServer extends SchemaShape = {},\n\tconst TShared extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(options: {\n\tserver?: EnvSchema<TServer>;\n\tshared?: EnvSchema<TShared>;\n\textends?: [...TExtends];\n\truntimeEnv?: Record<keyof TShared, unknown> & Record<string, unknown>;\n}): Readonly<\n\tdistill.Out<at.infer<TServer & TShared, $>> & MergeExtends<TExtends>\n>;\n\nexport function createEnv(schemaOrOptions: any, optionsOrIsServer?: any): any {\n\tconst isLegacy =\n\t\tschemaOrOptions &&\n\t\ttypeof schemaOrOptions === \"object\" &&\n\t\t(\"runtimeEnv\" in schemaOrOptions ||\n\t\t\t\"server\" in schemaOrOptions ||\n\t\t\t\"shared\" in schemaOrOptions);\n\n\tif (isLegacy) {\n\t\tif (\"client\" in schemaOrOptions) {\n\t\t\tthrow new Error(\n\t\t\t\t\"server entry point only accepts 'server' and 'shared' schemas.\",\n\t\t\t);\n\t\t}\n\t\treturn createEnvInternal(schemaOrOptions, true);\n\t}\n\n\treturn createEnvInternal(schemaOrOptions, optionsOrIsServer, {\n\t\tisServer: true,\n\t});\n}\n\nexport { type } from \"arkenv\";\n\nconst arkenv = createEnv;\nexport default arkenv;\n"],"mappings":"mNAmCA,SAAgB,EAAU,EAAsB,EAA8B,CAQ7E,GANC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GAEA,CACb,GAAI,WAAY,EACf,MAAU,MACT,iEACA,CAEF,OAAOA,EAAAA,EAAkB,EAAiB,GAAK,CAGhD,OAAOA,EAAAA,EAAkB,EAAiB,EAAmB,CAC5D,SAAU,GACV,CAAC,CAKH,MAAMC,EAAS"}
1
+ {"version":3,"file":"server.cjs","names":["createEnvInternal","arkenv"],"sources":["../src/server.ts"],"sourcesContent":["import \"server-only\";\nimport type { $ } from \"@repo/scope\";\nimport type { Dict, SchemaShape } from \"@repo/types\";\nimport type { EnvSchema } from \"arkenv\";\nimport type { type as at, distill } from \"arktype\";\nimport { createEnvInternal } from \"./create-env\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Server entry point).\n */\nexport function createEnv<\n\tconst TSchema extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>>;\n\n/**\n * @deprecated Use the unified flat layout signature instead: `createEnv(schema, options)`\n */\nexport function createEnv<\n\tconst TServer extends SchemaShape = {},\n\tconst TShared extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(options: {\n\tserver?: EnvSchema<TServer>;\n\tshared?: EnvSchema<TShared>;\n\textends?: [...TExtends];\n\truntimeEnv?: Record<keyof TShared, string | undefined> & Dict<string>;\n}): Readonly<\n\tdistill.Out<at.infer<TServer & TShared, $>> & MergeExtends<TExtends>\n>;\n\nexport function createEnv(schemaOrOptions: any, optionsOrIsServer?: any): any {\n\tconst isLegacy =\n\t\tschemaOrOptions &&\n\t\ttypeof schemaOrOptions === \"object\" &&\n\t\t(\"runtimeEnv\" in schemaOrOptions ||\n\t\t\t\"server\" in schemaOrOptions ||\n\t\t\t\"shared\" in schemaOrOptions);\n\n\tif (isLegacy) {\n\t\tif (\"client\" in schemaOrOptions) {\n\t\t\tthrow new Error(\n\t\t\t\t\"server entry point only accepts 'server' and 'shared' schemas.\",\n\t\t\t);\n\t\t}\n\t\treturn createEnvInternal(schemaOrOptions, true);\n\t}\n\n\treturn createEnvInternal(schemaOrOptions, optionsOrIsServer, {\n\t\tisServer: true,\n\t\tstrictLayout: \"server\",\n\t});\n}\n\nexport { type } from \"arkenv\";\n\nconst arkenv = createEnv;\nexport default arkenv;\n"],"mappings":"mNAsCA,SAAgB,EAAU,EAAsB,EAA8B,CAQ7E,GANC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GAEA,CACb,GAAI,WAAY,EACf,MAAU,MACT,iEACA,CAEF,OAAOA,EAAAA,EAAkB,EAAiB,GAAK,CAGhD,OAAOA,EAAAA,EAAkB,EAAiB,EAAmB,CAC5D,SAAU,GACV,aAAc,SACd,CAAC,CAKH,MAAMC,EAAS"}
package/dist/server.d.cts CHANGED
@@ -1,5 +1,4 @@
1
- import { r as $, t as SchemaShape } from "./index-C6bpQ5GU.cjs";
2
- import { t as MergeExtends } from "./types-DBqiLw5v.cjs";
1
+ import { i as $, n as SchemaShape, r as Dict, t as MergeExtends } from "./types-DyUrJJZq.cjs";
3
2
  import { distill, type as type$1 } from "arktype";
4
3
  import { EnvSchema, type } from "arkenv";
5
4
  //#region src/server.d.ts
@@ -8,13 +7,16 @@ import { EnvSchema, type } from "arkenv";
8
7
  */
9
8
  declare function createEnv<const TSchema extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
10
9
  extends?: [...TExtends];
11
- runtimeEnv?: Record<keyof TSchema | string, unknown>;
10
+ runtimeEnv?: Dict<string>;
12
11
  }): Readonly<distill.Out<type$1.infer<TSchema, $>> & MergeExtends<TExtends>>;
12
+ /**
13
+ * @deprecated Use the unified flat layout signature instead: `createEnv(schema, options)`
14
+ */
13
15
  declare function createEnv<const TServer extends SchemaShape = {}, const TShared extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(options: {
14
16
  server?: EnvSchema<TServer>;
15
17
  shared?: EnvSchema<TShared>;
16
18
  extends?: [...TExtends];
17
- runtimeEnv?: Record<keyof TShared, unknown> & Record<string, unknown>;
19
+ runtimeEnv?: Record<keyof TShared, string | undefined> & Dict<string>;
18
20
  }): Readonly<distill.Out<type$1.infer<TServer & TShared, $>> & MergeExtends<TExtends>>;
19
21
  declare const arkenv: typeof createEnv;
20
22
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.cts","names":[],"sources":["../src/server.ts"],"mappings":";;;;;;AAWA;;iBAAgB,SAAA,uBACO,WAAA,sDAAA,CAGtB,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EACC,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA,OAAa,OAAA;AAAA,IAEzB,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;AAAA,iBAE7C,SAAA,uBACO,WAAA,6BACA,WAAA,sDAAA,CAErB,OAAA;EACD,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA,OAAa,OAAA,aAAoB,MAAA;AAAA,IAC3C,QAAA,CACH,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,GAAU,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;AAAA,cA2BtD,MAAA,SAAM,SAAA"}
1
+ {"version":3,"file":"server.d.cts","names":[],"sources":["../src/server.ts"],"mappings":";;;;AAWA;;;AAAA,iBAAgB,SAAA,uBACO,WAAA,sDAAA,CAGtB,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EACC,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,IAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;;;;iBAK7C,SAAA,uBACO,WAAA,6BACA,WAAA,sDAAA,CAErB,OAAA;EACD,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA,OAAa,OAAA,wBAA+B,IAAA;AAAA,IACtD,QAAA,CACH,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,GAAU,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;AAAA,cA4BtD,MAAA,SAAM,SAAA"}
package/dist/server.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { r as $, t as SchemaShape } from "./index-Bn3pRiJy.js";
2
- import { t as MergeExtends } from "./types-BN4fEChy.js";
1
+ import { i as $, n as SchemaShape, r as Dict, t as MergeExtends } from "./types-BzoNhHhq.js";
3
2
  import { EnvSchema, type } from "arkenv";
4
3
  import { distill, type as type$1 } from "arktype";
5
4
 
@@ -9,13 +8,16 @@ import { distill, type as type$1 } from "arktype";
9
8
  */
10
9
  declare function createEnv<const TSchema extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
11
10
  extends?: [...TExtends];
12
- runtimeEnv?: Record<keyof TSchema | string, unknown>;
11
+ runtimeEnv?: Dict<string>;
13
12
  }): Readonly<distill.Out<type$1.infer<TSchema, $>> & MergeExtends<TExtends>>;
13
+ /**
14
+ * @deprecated Use the unified flat layout signature instead: `createEnv(schema, options)`
15
+ */
14
16
  declare function createEnv<const TServer extends SchemaShape = {}, const TShared extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(options: {
15
17
  server?: EnvSchema<TServer>;
16
18
  shared?: EnvSchema<TShared>;
17
19
  extends?: [...TExtends];
18
- runtimeEnv?: Record<keyof TShared, unknown> & Record<string, unknown>;
20
+ runtimeEnv?: Record<keyof TShared, string | undefined> & Dict<string>;
19
21
  }): Readonly<distill.Out<type$1.infer<TServer & TShared, $>> & MergeExtends<TExtends>>;
20
22
  declare const arkenv: typeof createEnv;
21
23
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","names":[],"sources":["../src/server.ts"],"mappings":";;;;;;;AAWA;;iBAAgB,SAAA,uBACO,WAAA,sDAAA,CAGtB,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EACC,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA,OAAa,OAAA;AAAA,IAEzB,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;AAAA,iBAE7C,SAAA,uBACO,WAAA,6BACA,WAAA,sDAAA,CAErB,OAAA;EACD,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA,OAAa,OAAA,aAAoB,MAAA;AAAA,IAC3C,QAAA,CACH,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,GAAU,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;AAAA,cA2BtD,MAAA,SAAM,SAAA"}
1
+ {"version":3,"file":"server.d.ts","names":[],"sources":["../src/server.ts"],"mappings":";;;;;AAWA;;;AAAA,iBAAgB,SAAA,uBACO,WAAA,sDAAA,CAGtB,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EACC,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,IAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;;;;iBAK7C,SAAA,uBACO,WAAA,6BACA,WAAA,sDAAA,CAErB,OAAA;EACD,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA,OAAa,OAAA,wBAA+B,IAAA;AAAA,IACtD,QAAA,CACH,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,GAAU,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;AAAA,cA4BtD,MAAA,SAAM,SAAA"}
package/dist/server.js CHANGED
@@ -1,2 +1,2 @@
1
- import{t as e}from"./create-env-BfXQtLQM.js";import{type as t}from"arkenv";import"server-only";function n(t,n){if(t&&typeof t==`object`&&(`runtimeEnv`in t||`server`in t||`shared`in t)){if(`client`in t)throw Error(`server entry point only accepts 'server' and 'shared' schemas.`);return e(t,!0)}return e(t,n,{isServer:!0})}const r=n;export{n as createEnv,r as default,t as type};
1
+ import{t as e}from"./create-env-B6DmIK3X.js";import{type as t}from"arkenv";import"server-only";function n(t,n){if(t&&typeof t==`object`&&(`runtimeEnv`in t||`server`in t||`shared`in t)){if(`client`in t)throw Error(`server entry point only accepts 'server' and 'shared' schemas.`);return e(t,!0)}return e(t,n,{isServer:!0,strictLayout:`server`})}const r=n;export{n as createEnv,r as default,t as type};
2
2
  //# sourceMappingURL=server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","names":[],"sources":["../src/server.ts"],"sourcesContent":["import \"server-only\";\nimport type { $ } from \"@repo/scope\";\nimport type { SchemaShape } from \"@repo/types\";\nimport type { EnvSchema } from \"arkenv\";\nimport type { type as at, distill } from \"arktype\";\nimport { createEnvInternal } from \"./create-env\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Server entry point).\n */\nexport function createEnv<\n\tconst TSchema extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Record<keyof TSchema | string, unknown>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>>;\n\nexport function createEnv<\n\tconst TServer extends SchemaShape = {},\n\tconst TShared extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(options: {\n\tserver?: EnvSchema<TServer>;\n\tshared?: EnvSchema<TShared>;\n\textends?: [...TExtends];\n\truntimeEnv?: Record<keyof TShared, unknown> & Record<string, unknown>;\n}): Readonly<\n\tdistill.Out<at.infer<TServer & TShared, $>> & MergeExtends<TExtends>\n>;\n\nexport function createEnv(schemaOrOptions: any, optionsOrIsServer?: any): any {\n\tconst isLegacy =\n\t\tschemaOrOptions &&\n\t\ttypeof schemaOrOptions === \"object\" &&\n\t\t(\"runtimeEnv\" in schemaOrOptions ||\n\t\t\t\"server\" in schemaOrOptions ||\n\t\t\t\"shared\" in schemaOrOptions);\n\n\tif (isLegacy) {\n\t\tif (\"client\" in schemaOrOptions) {\n\t\t\tthrow new Error(\n\t\t\t\t\"server entry point only accepts 'server' and 'shared' schemas.\",\n\t\t\t);\n\t\t}\n\t\treturn createEnvInternal(schemaOrOptions, true);\n\t}\n\n\treturn createEnvInternal(schemaOrOptions, optionsOrIsServer, {\n\t\tisServer: true,\n\t});\n}\n\nexport { type } from \"arkenv\";\n\nconst arkenv = createEnv;\nexport default arkenv;\n"],"mappings":"+FAmCA,SAAgB,EAAU,EAAsB,EAA8B,CAQ7E,GANC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GAEA,CACb,GAAI,WAAY,EACf,MAAU,MACT,iEACA,CAEF,OAAO,EAAkB,EAAiB,GAAK,CAGhD,OAAO,EAAkB,EAAiB,EAAmB,CAC5D,SAAU,GACV,CAAC,CAKH,MAAM,EAAS"}
1
+ {"version":3,"file":"server.js","names":[],"sources":["../src/server.ts"],"sourcesContent":["import \"server-only\";\nimport type { $ } from \"@repo/scope\";\nimport type { Dict, SchemaShape } from \"@repo/types\";\nimport type { EnvSchema } from \"arkenv\";\nimport type { type as at, distill } from \"arktype\";\nimport { createEnvInternal } from \"./create-env\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Server entry point).\n */\nexport function createEnv<\n\tconst TSchema extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>>;\n\n/**\n * @deprecated Use the unified flat layout signature instead: `createEnv(schema, options)`\n */\nexport function createEnv<\n\tconst TServer extends SchemaShape = {},\n\tconst TShared extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(options: {\n\tserver?: EnvSchema<TServer>;\n\tshared?: EnvSchema<TShared>;\n\textends?: [...TExtends];\n\truntimeEnv?: Record<keyof TShared, string | undefined> & Dict<string>;\n}): Readonly<\n\tdistill.Out<at.infer<TServer & TShared, $>> & MergeExtends<TExtends>\n>;\n\nexport function createEnv(schemaOrOptions: any, optionsOrIsServer?: any): any {\n\tconst isLegacy =\n\t\tschemaOrOptions &&\n\t\ttypeof schemaOrOptions === \"object\" &&\n\t\t(\"runtimeEnv\" in schemaOrOptions ||\n\t\t\t\"server\" in schemaOrOptions ||\n\t\t\t\"shared\" in schemaOrOptions);\n\n\tif (isLegacy) {\n\t\tif (\"client\" in schemaOrOptions) {\n\t\t\tthrow new Error(\n\t\t\t\t\"server entry point only accepts 'server' and 'shared' schemas.\",\n\t\t\t);\n\t\t}\n\t\treturn createEnvInternal(schemaOrOptions, true);\n\t}\n\n\treturn createEnvInternal(schemaOrOptions, optionsOrIsServer, {\n\t\tisServer: true,\n\t\tstrictLayout: \"server\",\n\t});\n}\n\nexport { type } from \"arkenv\";\n\nconst arkenv = createEnv;\nexport default arkenv;\n"],"mappings":"+FAsCA,SAAgB,EAAU,EAAsB,EAA8B,CAQ7E,GANC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GAEA,CACb,GAAI,WAAY,EACf,MAAU,MACT,iEACA,CAEF,OAAO,EAAkB,EAAiB,GAAK,CAGhD,OAAO,EAAkB,EAAiB,EAAmB,CAC5D,SAAU,GACV,aAAc,SACd,CAAC,CAKH,MAAM,EAAS"}
package/dist/shared.cjs CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./create-env-DDWVuzwL.cjs`);require(`./config.cjs`);let t=require(`arkenv`);function n(t,n){return e.t(t,n,{isServer:typeof window>`u`,isShared:!0})}const r=n;exports.createEnv=n,exports.default=r,Object.defineProperty(exports,`type`,{enumerable:!0,get:function(){return t.type}});
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./create-env-C_h541CQ.cjs`);require(`./config.cjs`);let t=require(`arkenv`);function n(t,n){return e.t(t,n,{isServer:typeof window>`u`,isShared:!0})}const r=n;exports.createEnv=n,exports.default=r,Object.defineProperty(exports,`type`,{enumerable:!0,get:function(){return t.type}});
2
2
  //# sourceMappingURL=shared.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.cjs","names":["createEnvInternal","arkenv"],"sources":["../src/shared.ts"],"sourcesContent":["import type { $ } from \"@repo/scope\";\nimport type { SchemaShape } from \"@repo/types\";\nimport type { EnvSchema } from \"arkenv\";\nimport type { type as at, distill } from \"arktype\";\nimport { createEnvInternal } from \"./create-env\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Shared entry point).\n */\nexport function createEnv<\n\tconst TSchema extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Record<keyof TSchema | string, unknown>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>> {\n\tconst isServer = typeof window === \"undefined\";\n\treturn createEnvInternal(schema, options, {\n\t\tisServer,\n\t\tisShared: true,\n\t}) as any;\n}\n\nexport { type } from \"arkenv\";\n\nconst arkenv = createEnv;\nexport default arkenv;\n"],"mappings":"4LAUA,SAAgB,EAIf,EACA,EAIuE,CAEvE,OAAOA,EAAAA,EAAkB,EAAQ,EAAS,CACzC,SAFgB,OAAO,OAAW,IAGlC,SAAU,GACV,CAAC,CAKH,MAAMC,EAAS"}
1
+ {"version":3,"file":"shared.cjs","names":["createEnvInternal","arkenv"],"sources":["../src/shared.ts"],"sourcesContent":["import type { $ } from \"@repo/scope\";\nimport type { Dict, SchemaShape } from \"@repo/types\";\nimport type { EnvSchema } from \"arkenv\";\nimport type { type as at, distill } from \"arktype\";\nimport { createEnvInternal } from \"./create-env\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Shared entry point).\n */\nexport function createEnv<\n\tconst TSchema extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>> {\n\tconst isServer = typeof window === \"undefined\";\n\treturn createEnvInternal(schema, options, {\n\t\tisServer,\n\t\tisShared: true,\n\t}) as any;\n}\n\nexport { type } from \"arkenv\";\n\nconst arkenv = createEnv;\nexport default arkenv;\n"],"mappings":"4LAUA,SAAgB,EAIf,EACA,EAIuE,CAEvE,OAAOA,EAAAA,EAAkB,EAAQ,EAAS,CACzC,SAFgB,OAAO,OAAW,IAGlC,SAAU,GACV,CAAC,CAKH,MAAMC,EAAS"}
package/dist/shared.d.cts CHANGED
@@ -1,5 +1,4 @@
1
- import { r as $, t as SchemaShape } from "./index-C6bpQ5GU.cjs";
2
- import { t as MergeExtends } from "./types-DBqiLw5v.cjs";
1
+ import { i as $, n as SchemaShape, r as Dict, t as MergeExtends } from "./types-DyUrJJZq.cjs";
3
2
  import { distill, type as type$1 } from "arktype";
4
3
  import { EnvSchema, type } from "arkenv";
5
4
 
@@ -9,7 +8,7 @@ import { EnvSchema, type } from "arkenv";
9
8
  */
10
9
  declare function createEnv<const TSchema extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
11
10
  extends?: [...TExtends];
12
- runtimeEnv?: Record<keyof TSchema | string, unknown>;
11
+ runtimeEnv?: Dict<string>;
13
12
  }): Readonly<distill.Out<type$1.infer<TSchema, $>> & MergeExtends<TExtends>>;
14
13
  declare const arkenv: typeof createEnv;
15
14
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.cts","names":[],"sources":["../src/shared.ts"],"mappings":";;;;;;;AAUA;;iBAAgB,SAAA,uBACO,WAAA,sDAAA,CAGtB,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EACC,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA,OAAa,OAAA;AAAA,IAEzB,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;AAAA,cAUvD,MAAA,SAAM,SAAA"}
1
+ {"version":3,"file":"shared.d.cts","names":[],"sources":["../src/shared.ts"],"mappings":";;;;;AAUA;;;AAAA,iBAAgB,SAAA,uBACO,WAAA,sDAAA,CAGtB,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EACC,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,IAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;AAAA,cAUvD,MAAA,SAAM,SAAA"}
package/dist/shared.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { r as $, t as SchemaShape } from "./index-Bn3pRiJy.js";
2
- import { t as MergeExtends } from "./types-BN4fEChy.js";
1
+ import { i as $, n as SchemaShape, r as Dict, t as MergeExtends } from "./types-BzoNhHhq.js";
3
2
  import { EnvSchema, type } from "arkenv";
4
3
  import { distill, type as type$1 } from "arktype";
5
4
 
@@ -9,7 +8,7 @@ import { distill, type as type$1 } from "arktype";
9
8
  */
10
9
  declare function createEnv<const TSchema extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
11
10
  extends?: [...TExtends];
12
- runtimeEnv?: Record<keyof TSchema | string, unknown>;
11
+ runtimeEnv?: Dict<string>;
13
12
  }): Readonly<distill.Out<type$1.infer<TSchema, $>> & MergeExtends<TExtends>>;
14
13
  declare const arkenv: typeof createEnv;
15
14
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","names":[],"sources":["../src/shared.ts"],"mappings":";;;;;;;AAUA;;iBAAgB,SAAA,uBACO,WAAA,sDAAA,CAGtB,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EACC,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA,OAAa,OAAA;AAAA,IAEzB,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;AAAA,cAUvD,MAAA,SAAM,SAAA"}
1
+ {"version":3,"file":"shared.d.ts","names":[],"sources":["../src/shared.ts"],"mappings":";;;;;AAUA;;;AAAA,iBAAgB,SAAA,uBACO,WAAA,sDAAA,CAGtB,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EACC,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,IAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;AAAA,cAUvD,MAAA,SAAM,SAAA"}
package/dist/shared.js CHANGED
@@ -1,2 +1,2 @@
1
- import{t as e}from"./create-env-BfXQtLQM.js";import{type as t}from"arkenv";function n(t,n){return e(t,n,{isServer:typeof window>`u`,isShared:!0})}const r=n;export{n as createEnv,r as default,t as type};
1
+ import{t as e}from"./create-env-B6DmIK3X.js";import{type as t}from"arkenv";function n(t,n){return e(t,n,{isServer:typeof window>`u`,isShared:!0})}const r=n;export{n as createEnv,r as default,t as type};
2
2
  //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","names":[],"sources":["../src/shared.ts"],"sourcesContent":["import type { $ } from \"@repo/scope\";\nimport type { SchemaShape } from \"@repo/types\";\nimport type { EnvSchema } from \"arkenv\";\nimport type { type as at, distill } from \"arktype\";\nimport { createEnvInternal } from \"./create-env\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Shared entry point).\n */\nexport function createEnv<\n\tconst TSchema extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Record<keyof TSchema | string, unknown>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>> {\n\tconst isServer = typeof window === \"undefined\";\n\treturn createEnvInternal(schema, options, {\n\t\tisServer,\n\t\tisShared: true,\n\t}) as any;\n}\n\nexport { type } from \"arkenv\";\n\nconst arkenv = createEnv;\nexport default arkenv;\n"],"mappings":"2EAUA,SAAgB,EAIf,EACA,EAIuE,CAEvE,OAAO,EAAkB,EAAQ,EAAS,CACzC,SAFgB,OAAO,OAAW,IAGlC,SAAU,GACV,CAAC,CAKH,MAAM,EAAS"}
1
+ {"version":3,"file":"shared.js","names":[],"sources":["../src/shared.ts"],"sourcesContent":["import type { $ } from \"@repo/scope\";\nimport type { Dict, SchemaShape } from \"@repo/types\";\nimport type { EnvSchema } from \"arkenv\";\nimport type { type as at, distill } from \"arktype\";\nimport { createEnvInternal } from \"./create-env\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Shared entry point).\n */\nexport function createEnv<\n\tconst TSchema extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>> {\n\tconst isServer = typeof window === \"undefined\";\n\treturn createEnvInternal(schema, options, {\n\t\tisServer,\n\t\tisShared: true,\n\t}) as any;\n}\n\nexport { type } from \"arkenv\";\n\nconst arkenv = createEnv;\nexport default arkenv;\n"],"mappings":"2EAUA,SAAgB,EAIf,EACA,EAIuE,CAEvE,OAAO,EAAkB,EAAQ,EAAS,CACzC,SAFgB,OAAO,OAAW,IAGlC,SAAU,GACV,CAAC,CAKH,MAAM,EAAS"}
@@ -83,6 +83,9 @@ declare const $: _$arktype.Scope<{
83
83
  }>;
84
84
  type $ = (typeof $)["t"]; //#endregion
85
85
  //#endregion
86
+ //#region ../internal/types/dist/helpers.d.ts
87
+ type Dict<T> = Record<string, T | undefined>;
88
+ //#endregion
86
89
  //#region ../internal/types/dist/standard-schema.d.ts
87
90
  /**
88
91
  * @see https://github.com/standard-schema/standard-schema/tree/3130ce43fdd848d9ab49dbb0458d04f18459961c/packages/spec
@@ -176,12 +179,20 @@ declare namespace StandardSchemaV1 {
176
179
  *
177
180
  * @template T - The schema definition to infer from
178
181
  */
179
- type InferType<T> = T extends StandardSchemaV1<infer _Input, infer Output> ? Output : T extends ((value: Record<string, string | undefined>) => infer R) ? R extends type.errors ? never : R : T extends {
182
+ type InferType<T> = T extends StandardSchemaV1<infer _Input, infer Output> ? Output : T extends ((value: Dict<string>) => infer R) ? R extends type.errors ? never : R : T extends {
180
183
  t: infer U;
181
184
  } ? U : T extends type.Any<infer U, infer _Scope> ? U : never;
182
185
  //#endregion
183
186
  //#region ../internal/types/dist/schema.d.ts
184
187
  type SchemaShape = Record<string, unknown>;
185
188
  //#endregion
186
- export { InferType as n, $ as r, SchemaShape as t };
187
- //# sourceMappingURL=index-Bn3pRiJy.d.ts.map
189
+ //#region src/types.d.ts
190
+ /**
191
+ * Shared type utilities for Next.js entry points.
192
+ */
193
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
194
+ type ResolveExtendsElement<T> = [InferType<T>] extends [never] ? T : InferType<T>;
195
+ type MergeExtends<TExtends extends readonly unknown[] | undefined> = TExtends extends readonly unknown[] ? UnionToIntersection<ResolveExtendsElement<TExtends[number]>> : {};
196
+ //#endregion
197
+ export { $ as i, SchemaShape as n, Dict as r, MergeExtends as t };
198
+ //# sourceMappingURL=types-BzoNhHhq.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-BzoNhHhq.d.ts","names":["_$arktype","_$arktype_internal_keywords_string_ts0","_$arktype_internal_attributes_ts0","$","trim","To","Submodule","normalize","capitalize","stringDate","stringInteger","ip","stringJson","lower","stringNumeric","url","uuid","Scope","string","In","root","alpha","alphanumeric","hex","base64","creditCard","date","digits","email","integer","json","numeric","regex","semver","upper","preformatted","host","number","NaN","Infinity","epoch","safe","NegativeInfinity","port","Dict","T","Record","StandardTypedV1","Input","Output","Props","Schema","Types","NonNullable","version","vendor","types","input","output","InferInput","InferOutput","StandardSchemaV1","Options","Result","Promise","SuccessResult","FailureResult","Record","Issue","ReadonlyArray","PropertyKey","PathSegment","validate","value","options","issues","libraryOptions","message","path","key","StandardJSONSchemaV1","Converter","Target","jsonSchema","target","type","Dict","StandardSchemaV1","InferType","T","errors","Any","_Input","Output","value","R","t","U","_Scope","$","Type","SchemaShape","Record","CompiledEnvSchema"],"sources":["../../internal/scope/dist/index.d.ts","../../internal/types/dist/helpers.d.ts","../../internal/types/dist/standard-schema.d.ts","../../internal/types/dist/infer-type.d.ts","../../internal/types/dist/schema.d.ts","../src/types.ts"],"mappings":";;;;;;;;AAEoF;;;;cAQtEG,CAAAA,EAAGH,SAAAA,CAAUiB,KAAAA;EACzBC,MAAAA,EAAQlB,SAAAA,CAAUM,SAAAA;IAChBF,IAAAA,EAAMJ,SAAAA,CAAUM,SAAAA,CAAUL,sCAAAA,CAAuCG,IAAAA,CAAKD,CAAAA;MACpE,cAAA,GAAiBgB,EAAAA,aAAejB,iCAAAA,CAAkCG,EAAAA;IAAAA;IAEpEE,SAAAA,EAAWP,SAAAA,CAAUM,SAAAA,CAAUL,sCAAAA,CAAuCM,SAAAA,CAAUJ,CAAAA;MAC9E,cAAA,GAAiBgB,EAAAA,aAAejB,iCAAAA,CAAkCG,EAAAA;IAAAA;IAEpEe,IAAAA;IACAC,KAAAA;IACAC,YAAAA;IACAC,GAAAA;IACAC,MAAAA,EAAQxB,SAAAA,CAAUM,SAAAA;MAChBc,IAAAA;MACAL,GAAAA;IAAAA;MAEA,cAAA;IAAA;IAEFP,UAAAA,EAAYR,SAAAA,CAAUM,SAAAA,CAAUL,sCAAAA,CAAuCO,UAAAA,CAAWL,CAAAA;MAChF,cAAA,GAAiBgB,EAAAA,aAAejB,iCAAAA,CAAkCG,EAAAA;IAAAA;IAEpEoB,UAAAA;IACAC,IAAAA,EAAM1B,SAAAA,CAAUM,SAAAA,CAAUL,sCAAAA,CAAuCQ,UAAAA,CAAWN,CAAAA;MAC1E,cAAA;IAAA;IAEFwB,MAAAA;IACAC,KAAAA;IACAC,OAAAA,EAAS7B,SAAAA,CAAUM,SAAAA,CAAUL,sCAAAA,CAAuCS,aAAAA,CAAcP,CAAAA;MAChF,cAAA;IAAA;IAEFQ,EAAAA,EAAIX,SAAAA,CAAUM,SAAAA,CAAUL,sCAAAA,CAAuCU,EAAAA,CAAGR,CAAAA;MAChE,cAAA;IA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;AAAA,KAED,YAAA,oDACX,QAAA,8BACG,mBAAA,CAAoB,qBAAA,CAAsB,QAAA"}
@@ -83,6 +83,9 @@ declare const $: _$arktype.Scope<{
83
83
  }>;
84
84
  type $ = (typeof $)["t"]; //#endregion
85
85
  //#endregion
86
+ //#region ../internal/types/dist/helpers.d.ts
87
+ type Dict<T> = Record<string, T | undefined>;
88
+ //#endregion
86
89
  //#region ../internal/types/dist/standard-schema.d.ts
87
90
  /**
88
91
  * @see https://github.com/standard-schema/standard-schema/tree/3130ce43fdd848d9ab49dbb0458d04f18459961c/packages/spec
@@ -176,12 +179,20 @@ declare namespace StandardSchemaV1 {
176
179
  *
177
180
  * @template T - The schema definition to infer from
178
181
  */
179
- type InferType<T> = T extends StandardSchemaV1<infer _Input, infer Output> ? Output : T extends ((value: Record<string, string | undefined>) => infer R) ? R extends type.errors ? never : R : T extends {
182
+ type InferType<T> = T extends StandardSchemaV1<infer _Input, infer Output> ? Output : T extends ((value: Dict<string>) => infer R) ? R extends type.errors ? never : R : T extends {
180
183
  t: infer U;
181
184
  } ? U : T extends type.Any<infer U, infer _Scope> ? U : never;
182
185
  //#endregion
183
186
  //#region ../internal/types/dist/schema.d.ts
184
187
  type SchemaShape = Record<string, unknown>;
185
188
  //#endregion
186
- export { InferType as n, $ as r, SchemaShape as t };
187
- //# sourceMappingURL=index-C6bpQ5GU.d.cts.map
189
+ //#region src/types.d.ts
190
+ /**
191
+ * Shared type utilities for Next.js entry points.
192
+ */
193
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
194
+ type ResolveExtendsElement<T> = [InferType<T>] extends [never] ? T : InferType<T>;
195
+ type MergeExtends<TExtends extends readonly unknown[] | undefined> = TExtends extends readonly unknown[] ? UnionToIntersection<ResolveExtendsElement<TExtends[number]>> : {};
196
+ //#endregion
197
+ export { $ as i, SchemaShape as n, Dict as r, MergeExtends as t };
198
+ //# sourceMappingURL=types-DyUrJJZq.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-DyUrJJZq.d.cts","names":["_$arktype","_$arktype_internal_keywords_string_ts0","_$arktype_internal_attributes_ts0","$","trim","To","Submodule","normalize","capitalize","stringDate","stringInteger","ip","stringJson","lower","stringNumeric","url","uuid","Scope","string","In","root","alpha","alphanumeric","hex","base64","creditCard","date","digits","email","integer","json","numeric","regex","semver","upper","preformatted","host","number","NaN","Infinity","epoch","safe","NegativeInfinity","port","Dict","T","Record","StandardTypedV1","Input","Output","Props","Schema","Types","NonNullable","version","vendor","types","input","output","InferInput","InferOutput","StandardSchemaV1","Options","Result","Promise","SuccessResult","FailureResult","Record","Issue","ReadonlyArray","PropertyKey","PathSegment","validate","value","options","issues","libraryOptions","message","path","key","StandardJSONSchemaV1","Converter","Target","jsonSchema","target","type","Dict","StandardSchemaV1","InferType","T","errors","Any","_Input","Output","value","R","t","U","_Scope","$","Type","SchemaShape","Record","CompiledEnvSchema"],"sources":["../../internal/scope/dist/index.d.ts","../../internal/types/dist/helpers.d.ts","../../internal/types/dist/standard-schema.d.ts","../../internal/types/dist/infer-type.d.ts","../../internal/types/dist/schema.d.ts","../src/types.ts"],"mappings":";;;;;;;;AAEoF;;;;cAQtEG,CAAAA,EAAGH,SAAAA,CAAUiB,KAAAA;EACzBC,MAAAA,EAAQlB,SAAAA,CAAUM,SAAAA;IAChBF,IAAAA,EAAMJ,SAAAA,CAAUM,SAAAA,CAAUL,sCAAAA,CAAuCG,IAAAA,CAAKD,CAAAA;MACpE,cAAA,GAAiBgB,EAAAA,aAAejB,iCAAAA,CAAkCG,EAAAA;IAAAA;IAEpEE,SAAAA,EAAWP,SAAAA,CAAUM,SAAAA,CAAUL,sCAAAA,CAAuCM,SAAAA,CAAUJ,CAAAA;MAC9E,cAAA,GAAiBgB,EAAAA,aAAejB,iCAAAA,CAAkCG,EAAAA;IAAAA;IAEpEe,IAAAA;IACAC,KAAAA;IACAC,YAAAA;IACAC,GAAAA;IACAC,MAAAA,EAAQxB,SAAA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D7E3C;EAAAA,KEoDKoD,WAAAA,gBAA2Bb,eAAAA,IAAmBA,eAAAA,CAAgBa,WAAAA,CAAYT,MAAAA;AAAAA;;;;;;AF9EC;;;;;;KGUxEqC,SAAAA,MAAeC,CAAAA,SAAUF,gBAAAA,+BAA+CM,MAAAA,GAASJ,CAAAA,WAAWK,KAAAA,EAAOR,IAAAA,wBAA2BS,CAAAA,SAAUV,IAAAA,CAAKK,MAAAA,WAAiBK,CAAAA,GAAIN,CAAAA;EAC1KO,CAAAA;AAAAA,IACAC,CAAAA,GAAIR,CAAAA,SAAUJ,IAAAA,CAAKM,GAAAA,0BAA6BM,CAAAA;;;KCZxCI,WAAAA,GAAcC,MAAAA;;;;;;KCId,mBAAA,OACX,CAAA,gBACI,CAAA,EAAG,CAAA,6BAEG,CAAA,sBACR,CAAA;AAAA,KAGS,qBAAA,OAA4B,SAAA,CAAU,CAAA,qBAC/C,CAAA,GACA,SAAA,CAAU,CAAA;AAAA,KAED,YAAA,oDACX,QAAA,8BACG,mBAAA,CAAoB,qBAAA,CAAsB,QAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkenv/nextjs",
3
- "version": "0.0.9",
3
+ "version": "0.1.1",
4
4
  "author": "Yam Borodetsky <yam@yam.codes>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,23 +11,27 @@
11
11
  "dependencies": {
12
12
  "chokidar": "^4.0.3",
13
13
  "server-only": "^0.0.1",
14
- "arkenv": "0.12.1"
14
+ "@arkenv/build": "0.0.1",
15
+ "arkenv": "0.12.2"
15
16
  },
16
17
  "devDependencies": {
17
18
  "@size-limit/preset-small-lib": "12.1.0",
19
+ "@types/react": "19.2.14",
18
20
  "arktype": "2.2.0",
19
21
  "next": "16.2.6",
22
+ "react": "19.2.5",
20
23
  "rimraf": "6.1.3",
21
24
  "size-limit": "12.1.0",
22
25
  "tsdown": "0.21.10",
23
26
  "typescript": "6.0.3",
24
27
  "vitest": "4.1.5",
25
- "@repo/scope": "0.1.3",
26
- "@repo/types": "0.1.0"
28
+ "@repo/types": "0.1.0",
29
+ "@repo/scope": "0.1.3"
27
30
  },
28
31
  "peerDependencies": {
29
32
  "arktype": "^2.1.22",
30
- "next": "^13.4.0 || ^14.0.0 || ^15.0.0 || ^16.0.0-0"
33
+ "next": "^13.4.0 || ^14.0.0 || ^15.0.0 || ^16.0.0-0",
34
+ "react": "19.2.5"
31
35
  },
32
36
  "exports": {
33
37
  "./shared": {
@@ -47,7 +51,7 @@
47
51
  },
48
52
  ".": {
49
53
  "react-server": {
50
- "types": "./dist/index.d.ts",
54
+ "types": "./dist/react-server.d.ts",
51
55
  "import": "./dist/react-server.js",
52
56
  "require": "./dist/react-server.cjs"
53
57
  },
@@ -129,7 +133,7 @@
129
133
  {
130
134
  "name": "@arkenv/nextjs/config",
131
135
  "path": "dist/config.js",
132
- "limit": "3 kB",
136
+ "limit": "3.5 kB",
133
137
  "import": "*",
134
138
  "ignore": [
135
139
  "next",
@@ -1,2 +0,0 @@
1
- import{createEnv as e}from"arkenv";const t=Symbol.for(`arkenv.extended_env`),n=Symbol.for(`arkenv.keys`),r=Symbol.for(`arkenv.server_only_keys`);function i(e){if(!e||typeof e!=`object`&&typeof e!=`function`)return[];if(e.json&&typeof e.json==`object`&&e.json.domain===`object`){let t=[];if(Array.isArray(e.json.required))for(let n of e.json.required)n&&typeof n==`object`&&`key`in n&&t.push(n.key);if(Array.isArray(e.json.optional))for(let n of e.json.optional)n&&typeof n==`object`&&`key`in n&&t.push(n.key);return t}return`shape`in e&&e.shape&&typeof e.shape==`object`?Object.keys(e.shape):`entries`in e&&e.entries&&typeof e.entries==`object`?Object.keys(e.entries):Object.keys(e)}function a(a,o,s){let c={},l={},u={},d=[],f={},p=!1;if(typeof o==`boolean`)c=a.server||{},l=a.client||{},u=a.shared||{},d=a.extends||[],f=a.runtimeEnv||{},p=o;else{let e=a||{},t=o||{};d=t.extends||[],f=t.runtimeEnv||{},p=!!s?.isServer,s?.isShared?u=e:p?c=e:l=e}let m={},h=new Set,g=new Set;for(let e of Object.keys(c))h.add(e),!(e in l)&&!(e in u)&&g.add(e);for(let e of Object.keys(l))h.add(e);for(let e of Object.keys(u))h.add(e);let _={};if(d&&Array.isArray(d)){for(let a of d)if(a&&(typeof a==`object`||typeof a==`function`)){let o=a[t];if(o){m={...m,...o};let e=a[n];if(e instanceof Set)for(let t of e)h.add(t);let t=a[r];if(t instanceof Set)for(let e of t)g.add(e)}else{for(let e of Object.keys(m))m[e]!==void 0&&(_[e]=String(m[e]));for(let e of Object.keys(f))f[e]!==void 0&&(_[e]=f[e]);if(p)for(let e of Object.keys(c))_[e]===void 0&&process.env[e]!==void 0&&(_[e]=process.env[e]);let t=e(a,{env:_});m={...m,...t};let n=i(a);for(let e of n)h.add(e),p&&!e.startsWith(`NEXT_PUBLIC_`)&&!s?.isShared&&g.add(e)}}}for(let e of Object.keys(l))g.delete(e);for(let e of Object.keys(u))g.delete(e);for(let e of Object.keys(l))if(!e.startsWith(`NEXT_PUBLIC_`))throw Error(`Client-side environment variables must be prefixed with 'NEXT_PUBLIC_'. Found invalid key: ${e}`);let v=[...Object.keys(l),...Object.keys(u)];for(let e of v)if(!(e in f))throw Error(`Missing key in runtimeEnv: ${e}. All client and shared environment variables must be explicitly destructured in runtimeEnv.`);for(let e of Object.keys(f))if(!h.has(e))throw Error(`Environment variable '${e}' is passed to runtimeEnv but is not defined in the schema.`);for(let e of Object.keys(m))m[e]!==void 0&&(_[e]=String(m[e]));for(let e of Object.keys(f))f[e]!==void 0&&(_[e]=f[e]);if(p)for(let e of Object.keys(c))_[e]===void 0&&process.env[e]!==void 0&&(_[e]=process.env[e]);let y=e(p?{...c,...l,...u}:{...l,...u},{env:_}),b={...m,...y};return new Proxy(b,{get(e,i,a){if(i===t)return e;if(i===n)return h;if(i===r)return g;if(typeof i==`symbol`)return Reflect.get(e,i,a);if(typeof i==`string`){if(g.has(i)&&!p)throw Error(`Accessing server-side environment variable '${i}' on the client is not allowed.`);if(!h.has(i)&&!(i in Object.prototype)&&!(i===`__esModule`||i===`$$typeof`||i===`toJSON`||i===`inspect`))throw Error(`Environment variable '${i}' is not defined in the schema.`)}return Reflect.get(e,i,a)}})}export{a as t};
2
- //# sourceMappingURL=create-env-BfXQtLQM.js.map