@arkenv/nextjs 1.0.0-alpha.0 → 1.0.0-alpha.10

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 (139) hide show
  1. package/LICENSE +3 -0
  2. package/README.md +3 -1
  3. package/dist/arkenv-internal-Cll5pV_F.cjs +2 -0
  4. package/dist/arkenv-internal-Cll5pV_F.cjs.map +1 -0
  5. package/dist/arkenv-internal-DEN5DTmX.js +2 -0
  6. package/dist/arkenv-internal-DEN5DTmX.js.map +1 -0
  7. package/dist/client.cjs +1 -1
  8. package/dist/client.cjs.map +1 -1
  9. package/dist/client.d.cts +13 -11
  10. package/dist/client.d.cts.map +1 -1
  11. package/dist/client.d.ts +13 -11
  12. package/dist/client.d.ts.map +1 -1
  13. package/dist/client.js +1 -1
  14. package/dist/client.js.map +1 -1
  15. package/dist/config/index.cjs +1 -0
  16. package/dist/config/index.d.cts +2 -0
  17. package/dist/config/index.d.ts +2 -0
  18. package/dist/config/index.js +1 -0
  19. package/dist/config-CStvXoN3.cjs +93 -0
  20. package/dist/config-CStvXoN3.cjs.map +1 -0
  21. package/dist/config-D2j45WDh.js +93 -0
  22. package/dist/config-D2j45WDh.js.map +1 -0
  23. package/dist/dist-Bof1Std7.cjs +2 -0
  24. package/dist/dist-Bof1Std7.cjs.map +1 -0
  25. package/dist/dist-DimRGXOV.js +2 -0
  26. package/dist/dist-DimRGXOV.js.map +1 -0
  27. package/dist/{index-Bn3pRiJy.d.ts → index-96RGPyfa.d.cts} +6 -3
  28. package/dist/index-96RGPyfa.d.cts.map +1 -0
  29. package/dist/index-BFQlm61W.d.ts +155 -0
  30. package/dist/index-BFQlm61W.d.ts.map +1 -0
  31. package/dist/index-CNzwVE5N.d.cts +155 -0
  32. package/dist/index-CNzwVE5N.d.cts.map +1 -0
  33. package/dist/{index-C6bpQ5GU.d.cts → index-bjEZwPUt.d.ts} +6 -3
  34. package/dist/index-bjEZwPUt.d.ts.map +1 -0
  35. package/dist/index.cjs +1 -1
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.d.cts +32 -16
  38. package/dist/index.d.cts.map +1 -1
  39. package/dist/index.d.ts +32 -16
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +1 -1
  42. package/dist/index.js.map +1 -1
  43. package/dist/mock-server-only.cjs +2 -0
  44. package/dist/mock-server-only.cjs.map +1 -0
  45. package/dist/mock-server-only.d.cts +1 -0
  46. package/dist/mock-server-only.d.ts +1 -0
  47. package/dist/mock-server-only.js +2 -0
  48. package/dist/mock-server-only.js.map +1 -0
  49. package/dist/react-server.cjs +1 -1
  50. package/dist/react-server.cjs.map +1 -1
  51. package/dist/react-server.d.cts +25 -16
  52. package/dist/react-server.d.cts.map +1 -1
  53. package/dist/react-server.d.ts +25 -16
  54. package/dist/react-server.d.ts.map +1 -1
  55. package/dist/react-server.js +1 -1
  56. package/dist/react-server.js.map +1 -1
  57. package/dist/script-7FFqInPq.d.ts +21 -0
  58. package/dist/script-7FFqInPq.d.ts.map +1 -0
  59. package/dist/script-BHFJ0MU_.d.cts +21 -0
  60. package/dist/script-BHFJ0MU_.d.cts.map +1 -0
  61. package/dist/script-CZOPkAw3.js +2 -0
  62. package/dist/script-CZOPkAw3.js.map +1 -0
  63. package/dist/script-D-MYC2Uf.cjs +2 -0
  64. package/dist/script-D-MYC2Uf.cjs.map +1 -0
  65. package/dist/server.cjs +1 -1
  66. package/dist/server.cjs.map +1 -1
  67. package/dist/server.d.cts +14 -12
  68. package/dist/server.d.cts.map +1 -1
  69. package/dist/server.d.ts +14 -12
  70. package/dist/server.d.ts.map +1 -1
  71. package/dist/server.js +1 -1
  72. package/dist/server.js.map +1 -1
  73. package/dist/standard/client.cjs +2 -0
  74. package/dist/standard/client.cjs.map +1 -0
  75. package/dist/standard/client.d.cts +30 -0
  76. package/dist/standard/client.d.cts.map +1 -0
  77. package/dist/standard/client.d.ts +30 -0
  78. package/dist/standard/client.d.ts.map +1 -0
  79. package/dist/standard/client.js +2 -0
  80. package/dist/standard/client.js.map +1 -0
  81. package/dist/standard/config.cjs +2 -0
  82. package/dist/standard/config.cjs.map +1 -0
  83. package/dist/standard/config.d.cts +14 -0
  84. package/dist/standard/config.d.cts.map +1 -0
  85. package/dist/standard/config.d.ts +14 -0
  86. package/dist/standard/config.d.ts.map +1 -0
  87. package/dist/standard/config.js +2 -0
  88. package/dist/standard/config.js.map +1 -0
  89. package/dist/standard/index.cjs +2 -0
  90. package/dist/standard/index.cjs.map +1 -0
  91. package/dist/standard/index.d.cts +35 -0
  92. package/dist/standard/index.d.cts.map +1 -0
  93. package/dist/standard/index.d.ts +35 -0
  94. package/dist/standard/index.d.ts.map +1 -0
  95. package/dist/standard/index.js +2 -0
  96. package/dist/standard/index.js.map +1 -0
  97. package/dist/standard/server.cjs +2 -0
  98. package/dist/standard/server.cjs.map +1 -0
  99. package/dist/standard/server.d.cts +18 -0
  100. package/dist/standard/server.d.cts.map +1 -0
  101. package/dist/standard/server.d.ts +18 -0
  102. package/dist/standard/server.d.ts.map +1 -0
  103. package/dist/standard/server.js +2 -0
  104. package/dist/standard/server.js.map +1 -0
  105. package/dist/standard/shared.cjs +2 -0
  106. package/dist/standard/shared.cjs.map +1 -0
  107. package/dist/standard/shared.d.cts +13 -0
  108. package/dist/standard/shared.d.cts.map +1 -0
  109. package/dist/standard/shared.d.ts +13 -0
  110. package/dist/standard/shared.d.ts.map +1 -0
  111. package/dist/standard/shared.js +2 -0
  112. package/dist/standard/shared.js.map +1 -0
  113. package/dist/{types-DBqiLw5v.d.cts → types-44R9mgTa.d.cts} +2 -2
  114. package/dist/{types-DBqiLw5v.d.cts.map → types-44R9mgTa.d.cts.map} +1 -1
  115. package/dist/{types-BN4fEChy.d.ts → types-BzMGTYWv.d.ts} +2 -2
  116. package/dist/{types-BN4fEChy.d.ts.map → types-BzMGTYWv.d.ts.map} +1 -1
  117. package/package.json +67 -30
  118. package/dist/config.cjs +0 -78
  119. package/dist/config.cjs.map +0 -1
  120. package/dist/config.d.cts +0 -107
  121. package/dist/config.d.cts.map +0 -1
  122. package/dist/config.d.ts +0 -107
  123. package/dist/config.d.ts.map +0 -1
  124. package/dist/config.js +0 -78
  125. package/dist/config.js.map +0 -1
  126. package/dist/create-env-BfXQtLQM.js +0 -2
  127. package/dist/create-env-BfXQtLQM.js.map +0 -1
  128. package/dist/create-env-DDWVuzwL.cjs +0 -2
  129. package/dist/create-env-DDWVuzwL.cjs.map +0 -1
  130. package/dist/index-Bn3pRiJy.d.ts.map +0 -1
  131. package/dist/index-C6bpQ5GU.d.cts.map +0 -1
  132. package/dist/shared.cjs +0 -2
  133. package/dist/shared.cjs.map +0 -1
  134. package/dist/shared.d.cts +0 -17
  135. package/dist/shared.d.cts.map +0 -1
  136. package/dist/shared.d.ts +0 -17
  137. package/dist/shared.d.ts.map +0 -1
  138. package/dist/shared.js +0 -2
  139. package/dist/shared.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,27 +1,43 @@
1
- import { t as SchemaShape } from "./index-Bn3pRiJy.js";
2
- import { EnvSchema, Infer, Infer as Infer$1, type } from "arkenv";
1
+ import { a as $, t as SchemaShape } from "./index-bjEZwPUt.js";
2
+ import { t as MergeExtends } from "./types-BzMGTYWv.js";
3
+ import { n as ArkEnvScriptProps, t as ArkEnvScript } from "./script-7FFqInPq.js";
4
+ import { EnvSchema, Infer } from "@arkenv/core";
5
+ import { distill, type } from "arktype";
3
6
 
4
7
  //#region src/index.d.ts
8
+ /**
9
+ * Extract keys from a schema type that are visible on the client:
10
+ * - Keys prefixed with `NEXT_PUBLIC_`
11
+ * - `NODE_ENV` (implicitly shared by Next.js)
12
+ * - Keys listed in `exposeToClient`
13
+ */
14
+ type ClientVisibleKeys<TSchema extends SchemaShape, TExpose extends keyof TSchema> = { [K in keyof TSchema]: K extends `NEXT_PUBLIC_${string}` ? K : K extends "NODE_ENV" ? K : K extends TExpose ? K : never }[keyof TSchema];
5
15
  /**
6
16
  * Create a validated, type-safe environment configuration for Next.js applications (Client-side / SSR 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`
12
17
  */
13
- declare function createEnv<const TServer extends SchemaShape = {}, const TClient extends SchemaShape = {}, const TShared extends SchemaShape = {}>(options: {
18
+ declare function arkenv<const TSchema extends SchemaShape & {
19
+ runtimeEnv?: never;
20
+ } = {}, const TExpose extends keyof TSchema = never, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
21
+ /**
22
+ * Custom environment variables to expose to the client bundle.
23
+ * By default, variables prefixed with `NEXT_PUBLIC_` and `NODE_ENV` are exposed automatically.
24
+ * Use this option to expose custom variables that do not have the `NEXT_PUBLIC_` prefix.
25
+ */
26
+ exposeToClient?: readonly TExpose[]; /** @deprecated Use `exposeToClient` instead */
27
+ expose?: readonly TExpose[]; /** @deprecated Use `exposeToClient` instead */
28
+ shared?: readonly TExpose[];
29
+ extends?: [...TExtends];
30
+ runtimeEnv?: Record<string, unknown>;
31
+ }): Readonly<Pick<distill.Out<type.infer<TSchema, $>>, Extract<keyof distill.Out<type.infer<TSchema, $>>, ClientVisibleKeys<TSchema, TExpose>>> & MergeExtends<TExtends>>;
32
+ /**
33
+ * @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`
34
+ */
35
+ declare function arkenv<const TServer extends SchemaShape = {}, const TClient extends SchemaShape = {}, const TShared extends SchemaShape = {}>(options: {
14
36
  server?: EnvSchema<TServer>;
15
37
  client?: EnvSchema<TClient> & { [K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never };
16
38
  shared?: EnvSchema<TShared>;
17
39
  runtimeEnv: Record<keyof TClient | keyof TShared, unknown> & Record<string, unknown>;
18
- }): 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
- declare const arkenv: typeof createEnv;
40
+ }): Readonly<Infer<TServer & TClient & TShared>>;
25
41
  //#endregion
26
- export { type Infer, createEnv, arkenv as default, type };
42
+ export { ArkEnvScript, type ArkEnvScriptProps, arkenv, arkenv as default };
27
43
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.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":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;AAM4C;;;;KAQvC,iBAAA,iBACY,WAAA,wBACM,OAAA,kBAEV,OAAA,GAAU,CAAA,mCACnB,CAAA,GACA,CAAA,sBACC,CAAA,GACA,CAAA,SAAU,OAAA,GACT,CAAA,iBAEE,OAAA;;;;iBAKQ,MAAA,uBACO,WAAA;EAAgB,UAAA;AAAA,oCACV,OAAA,yDAAA,CAG5B,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EAXO;;;;;EAiBN,cAAA,YAA0B,OAAA,IA1BL;EA4BrB,MAAA,YAAkB,OAAA,IA1BP;EA4BX,MAAA,YAAkB,OAAA;EAClB,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA;AAAA,IAEZ,QAAA,CACF,IAAA,CACC,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,IAC9B,OAAA,OACO,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,IACpC,iBAAA,CAAkB,OAAA,EAAS,OAAA,MAG5B,YAAA,CAAa,QAAA;;;;iBAMC,MAAA,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,KAAA,CAAM,OAAA,GAAU,OAAA,GAAU,OAAA"}
package/dist/index.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){return e(t,!1)}const r=n;export{n as createEnv,r as default,t as type};
1
+ import{t as e}from"./arkenv-internal-DEN5DTmX.js";import{t}from"./script-CZOPkAw3.js";import{arkenv as n,getSchemaKeys as r}from"@arkenv/core";function i(t,i){return t&&typeof t==`object`&&(`runtimeEnv`in t||`server`in t||`client`in t||`shared`in t)?e(t,!1,void 0,n,r):e(t,i,{isServer:!1},n,r)}export{t as ArkEnvScript,i as arkenv,i as default};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.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 (Client-side / SSR 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, false) 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,GAAM,CAWzC,MAAM,EAAS"}
1
+ {"version":3,"file":"index.js","names":["coreArkenv"],"sources":["../src/index.ts"],"sourcesContent":["import type { EnvSchema, Infer } from \"@arkenv/core\";\nimport { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/core\";\nimport type { $ } from \"@repo/scope\";\nimport type { SchemaShape } from \"@repo/types\";\nimport type { type as at, distill } from \"arktype\";\nimport { arkenvInternal } from \"./arkenv-internal\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Extract keys from a schema type that are visible on the client:\n * - Keys prefixed with `NEXT_PUBLIC_`\n * - `NODE_ENV` (implicitly shared by Next.js)\n * - Keys listed in `exposeToClient`\n */\ntype ClientVisibleKeys<\n\tTSchema extends SchemaShape,\n\tTExpose extends keyof TSchema,\n> = {\n\t[K in keyof TSchema]: K extends `NEXT_PUBLIC_${string}`\n\t\t? K\n\t\t: K extends \"NODE_ENV\"\n\t\t\t? K\n\t\t\t: K extends TExpose\n\t\t\t\t? K\n\t\t\t\t: never;\n}[keyof TSchema];\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Client-side / SSR entry point).\n */\nexport function arkenv<\n\tconst TSchema extends SchemaShape & { runtimeEnv?: never } = {},\n\tconst TExpose 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 TExpose[];\n\t\t/** @deprecated Use `exposeToClient` instead */\n\t\texpose?: readonly TExpose[];\n\t\t/** @deprecated Use `exposeToClient` instead */\n\t\tshared?: readonly TExpose[];\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Record<string, unknown>;\n\t},\n): Readonly<\n\tPick<\n\t\tdistill.Out<at.infer<TSchema, $>>,\n\t\tExtract<\n\t\t\tkeyof distill.Out<at.infer<TSchema, $>>,\n\t\t\tClientVisibleKeys<TSchema, TExpose>\n\t\t>\n\t> &\n\t\tMergeExtends<TExtends>\n>;\n\n/**\n * @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`\n */\nexport function arkenv<\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 arkenv(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 arkenvInternal(\n\t\t\tschemaOrOptions,\n\t\t\tfalse,\n\t\t\tundefined,\n\t\t\tcoreArkenv,\n\t\t\tgetSchemaKeys,\n\t\t);\n\t}\n\n\treturn arkenvInternal(\n\t\tschemaOrOptions,\n\t\toptionsOrIsServer,\n\t\t{ isServer: false },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport type { ArkEnvScriptProps } from \"./script\";\nexport { ArkEnvScript } from \"./script\";\n\n/**\n * ArkEnv's Next.js integration export\n *\n * {@link https://arkenv.js.org | ArkEnv} is a typesafe environment variables validator from editor to runtime.\n */\nexport default arkenv;\n"],"mappings":"+IA8EA,SAAgB,EAAO,EAAsB,EAA8B,CAmB1E,OAjBC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GACZ,WAAY,GAGN,EACN,EACA,GACA,IAAA,GACAA,EACA,EACA,CAGK,EACN,EACA,EACA,CAAE,SAAU,GAAO,CACnBA,EACA,EACA"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=mock-server-only.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-server-only.cjs","names":[],"sources":["../src/mock-server-only.ts"],"sourcesContent":["/**\n * No-op stub used as a jiti alias for the `server-only` package during build-time validation.\n */\n"],"mappings":""}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,2 @@
1
+ export{};
2
+ //# sourceMappingURL=mock-server-only.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-server-only.js","names":[],"sources":["../src/mock-server-only.ts"],"sourcesContent":["/**\n * No-op stub used as a jiti alias for the `server-only` package during build-time validation.\n */\n"],"mappings":""}
@@ -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){return e.t(t,!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`}}),require(`./config-CStvXoN3.cjs`);const e=require(`./arkenv-internal-Cll5pV_F.cjs`),t=require(`./script-D-MYC2Uf.cjs`);let n=require(`@arkenv/core`);function r(t,r){return t&&typeof t==`object`&&(`runtimeEnv`in t||`server`in t||`client`in t||`shared`in t)?e.t(t,!0,void 0,n.arkenv,n.getSchemaKeys):e.t(t,r,{isServer:!0},n.arkenv,n.getSchemaKeys)}exports.ArkEnvScript=t.t,exports.arkenv=r,exports.default=r;
2
2
  //# sourceMappingURL=react-server.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-server.cjs","names":["createEnvInternal","arkenv"],"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":"4LAYA,SAAgB,EAId,EAQ+C,CAEhD,OAAOA,EAAAA,EAAkB,EAAS,GAAK,CAWxC,MAAMC,EAAS"}
1
+ {"version":3,"file":"react-server.cjs","names":["arkenvInternal","coreArkenv","getSchemaKeys"],"sources":["../src/react-server.ts"],"sourcesContent":["import type { EnvSchema, Infer } from \"@arkenv/core\";\nimport { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/core\";\nimport type { $ } from \"@repo/scope\";\nimport type { SchemaShape } from \"@repo/types\";\nimport type { type as at, distill } from \"arktype\";\nimport { arkenvInternal } from \"./arkenv-internal\";\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 arkenv<\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: `arkenv(schema, options)`\n */\nexport function arkenv<\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 arkenv(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 arkenvInternal(\n\t\t\tschemaOrOptions,\n\t\t\ttrue,\n\t\t\tundefined,\n\t\t\tcoreArkenv,\n\t\t\tgetSchemaKeys,\n\t\t);\n\t}\n\n\treturn arkenvInternal(\n\t\tschemaOrOptions,\n\t\toptionsOrIsServer,\n\t\t{ isServer: true },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport type { ArkEnvScriptProps } from \"./script\";\nexport { ArkEnvScript } from \"./script\";\n\n/**\n * ArkEnv's Next.js integration export\n *\n * {@link https://arkenv.js.org | ArkEnv} is a typesafe environment variables validator from editor to runtime.\n */\nexport default arkenv;\n"],"mappings":"mPAkDA,SAAgB,EAAO,EAAsB,EAA8B,CAmB1E,OAjBC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GACZ,WAAY,GAGNA,EAAAA,EACN,EACA,GACA,IAAA,GACAC,EAAAA,OACAC,EAAAA,cACA,CAGKF,EAAAA,EACN,EACA,EACA,CAAE,SAAU,GAAM,CAClBC,EAAAA,OACAC,EAAAA,cACA"}
@@ -1,27 +1,36 @@
1
- import { t as SchemaShape } from "./index-C6bpQ5GU.cjs";
2
- import { EnvSchema, Infer, Infer as Infer$1, type } from "arkenv";
1
+ import { a as $, t as SchemaShape } from "./index-96RGPyfa.cjs";
2
+ import { t as MergeExtends } from "./types-44R9mgTa.cjs";
3
+ import { n as ArkEnvScriptProps, t as ArkEnvScript } from "./script-BHFJ0MU_.cjs";
4
+ import { EnvSchema, Infer } from "@arkenv/core";
5
+ import { distill, type } from "arktype";
3
6
 
4
7
  //#region src/react-server.d.ts
5
8
  /**
6
9
  * 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`
12
10
  */
13
- declare function createEnv<const TServer extends SchemaShape = {}, const TClient extends SchemaShape = {}, const TShared extends SchemaShape = {}>(options: {
11
+ declare function arkenv<const TSchema extends SchemaShape & {
12
+ runtimeEnv?: never;
13
+ } = {}, const TShared extends keyof TSchema = never, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
14
+ /**
15
+ * Custom environment variables to expose to the client bundle.
16
+ * By default, variables prefixed with `NEXT_PUBLIC_` and `NODE_ENV` are exposed automatically.
17
+ * Use this option to expose custom variables that do not have the `NEXT_PUBLIC_` prefix.
18
+ */
19
+ exposeToClient?: readonly TShared[]; /** @deprecated Use `exposeToClient` instead */
20
+ expose?: readonly TShared[]; /** @deprecated Use `exposeToClient` instead */
21
+ shared?: readonly TShared[];
22
+ extends?: [...TExtends];
23
+ runtimeEnv?: Record<string, unknown>;
24
+ }): Readonly<distill.Out<type.infer<TSchema, $>> & MergeExtends<TExtends>>;
25
+ /**
26
+ * @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`
27
+ */
28
+ declare function arkenv<const TServer extends SchemaShape = {}, const TClient extends SchemaShape = {}, const TShared extends SchemaShape = {}>(options: {
14
29
  server?: EnvSchema<TServer>;
15
30
  client?: EnvSchema<TClient> & { [K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never };
16
31
  shared?: EnvSchema<TShared>;
17
32
  runtimeEnv: Record<keyof TClient | keyof TShared, unknown> & Record<string, unknown>;
18
- }): 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
- declare const arkenv: typeof createEnv;
33
+ }): Readonly<Infer<TServer & TClient & TShared>>;
25
34
  //#endregion
26
- export { type Infer, createEnv, arkenv as default, type };
35
+ export { ArkEnvScript, type ArkEnvScriptProps, arkenv, arkenv as default };
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":";;;;;;;;;AAWA;iBAAgB,MAAA,uBACO,WAAA;EAAgB,UAAA;AAAA,oCACV,OAAA,yDAAA,CAG5B,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EAJ4B;;;;;EAU3B,cAAA,YAA0B,OAAA,IAKZ;EAHd,MAAA,YAAkB,OAAA,IAMa;EAJ/B,MAAA,YAAkB,OAAA;EAClB,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;;;;iBAK7C,MAAA,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,KAAA,CAAM,OAAA,GAAU,OAAA,GAAU,OAAA"}
@@ -1,27 +1,36 @@
1
- import { t as SchemaShape } from "./index-Bn3pRiJy.js";
2
- import { EnvSchema, Infer, Infer as Infer$1, type } from "arkenv";
1
+ import { a as $, t as SchemaShape } from "./index-bjEZwPUt.js";
2
+ import { t as MergeExtends } from "./types-BzMGTYWv.js";
3
+ import { n as ArkEnvScriptProps, t as ArkEnvScript } from "./script-7FFqInPq.js";
4
+ import { EnvSchema, Infer } from "@arkenv/core";
5
+ import { distill, type } from "arktype";
3
6
 
4
7
  //#region src/react-server.d.ts
5
8
  /**
6
9
  * 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`
12
10
  */
13
- declare function createEnv<const TServer extends SchemaShape = {}, const TClient extends SchemaShape = {}, const TShared extends SchemaShape = {}>(options: {
11
+ declare function arkenv<const TSchema extends SchemaShape & {
12
+ runtimeEnv?: never;
13
+ } = {}, const TShared extends keyof TSchema = never, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
14
+ /**
15
+ * Custom environment variables to expose to the client bundle.
16
+ * By default, variables prefixed with `NEXT_PUBLIC_` and `NODE_ENV` are exposed automatically.
17
+ * Use this option to expose custom variables that do not have the `NEXT_PUBLIC_` prefix.
18
+ */
19
+ exposeToClient?: readonly TShared[]; /** @deprecated Use `exposeToClient` instead */
20
+ expose?: readonly TShared[]; /** @deprecated Use `exposeToClient` instead */
21
+ shared?: readonly TShared[];
22
+ extends?: [...TExtends];
23
+ runtimeEnv?: Record<string, unknown>;
24
+ }): Readonly<distill.Out<type.infer<TSchema, $>> & MergeExtends<TExtends>>;
25
+ /**
26
+ * @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`
27
+ */
28
+ declare function arkenv<const TServer extends SchemaShape = {}, const TClient extends SchemaShape = {}, const TShared extends SchemaShape = {}>(options: {
14
29
  server?: EnvSchema<TServer>;
15
30
  client?: EnvSchema<TClient> & { [K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never };
16
31
  shared?: EnvSchema<TShared>;
17
32
  runtimeEnv: Record<keyof TClient | keyof TShared, unknown> & Record<string, unknown>;
18
- }): 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
- declare const arkenv: typeof createEnv;
33
+ }): Readonly<Infer<TServer & TClient & TShared>>;
25
34
  //#endregion
26
- export { type Infer, createEnv, arkenv as default, type };
35
+ export { ArkEnvScript, type ArkEnvScriptProps, arkenv, arkenv as default };
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":";;;;;;;;;AAWA;iBAAgB,MAAA,uBACO,WAAA;EAAgB,UAAA;AAAA,oCACV,OAAA,yDAAA,CAG5B,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EAJ4B;;;;;EAU3B,cAAA,YAA0B,OAAA,IAKZ;EAHd,MAAA,YAAkB,OAAA,IAMa;EAJ/B,MAAA,YAAkB,OAAA;EAClB,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;;;;iBAK7C,MAAA,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,KAAA,CAAM,OAAA,GAAU,OAAA,GAAU,OAAA"}
@@ -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"./arkenv-internal-DEN5DTmX.js";import{t}from"./script-CZOPkAw3.js";import{arkenv as n,getSchemaKeys as r}from"@arkenv/core";function i(t,i){return t&&typeof t==`object`&&(`runtimeEnv`in t||`server`in t||`client`in t||`shared`in t)?e(t,!0,void 0,n,r):e(t,i,{isServer:!0},n,r)}export{t as ArkEnvScript,i as arkenv,i as default};
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":["coreArkenv"],"sources":["../src/react-server.ts"],"sourcesContent":["import type { EnvSchema, Infer } from \"@arkenv/core\";\nimport { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/core\";\nimport type { $ } from \"@repo/scope\";\nimport type { SchemaShape } from \"@repo/types\";\nimport type { type as at, distill } from \"arktype\";\nimport { arkenvInternal } from \"./arkenv-internal\";\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 arkenv<\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: `arkenv(schema, options)`\n */\nexport function arkenv<\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 arkenv(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 arkenvInternal(\n\t\t\tschemaOrOptions,\n\t\t\ttrue,\n\t\t\tundefined,\n\t\t\tcoreArkenv,\n\t\t\tgetSchemaKeys,\n\t\t);\n\t}\n\n\treturn arkenvInternal(\n\t\tschemaOrOptions,\n\t\toptionsOrIsServer,\n\t\t{ isServer: true },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport type { ArkEnvScriptProps } from \"./script\";\nexport { ArkEnvScript } from \"./script\";\n\n/**\n * ArkEnv's Next.js integration export\n *\n * {@link https://arkenv.js.org | ArkEnv} is a typesafe environment variables validator from editor to runtime.\n */\nexport default arkenv;\n"],"mappings":"+IAkDA,SAAgB,EAAO,EAAsB,EAA8B,CAmB1E,OAjBC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GACZ,WAAY,GAGN,EACN,EACA,GACA,IAAA,GACAA,EACA,EACA,CAGK,EACN,EACA,EACA,CAAE,SAAU,GAAM,CAClBA,EACA,EACA"}
@@ -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-7FFqInPq.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-7FFqInPq.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,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-BHFJ0MU_.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-BHFJ0MU_.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,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-CZOPkAw3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-CZOPkAw3.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"}
@@ -0,0 +1,2 @@
1
+ require(`./config-CStvXoN3.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-D-MYC2Uf.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-D-MYC2Uf.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":"oEAeA,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"}
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`}}),require(`./config-CStvXoN3.cjs`);const e=require(`./arkenv-internal-Cll5pV_F.cjs`);let t=require(`@arkenv/core`);require(`server-only`);function n(n,r){if(n&&typeof n==`object`&&(`runtimeEnv`in n||`server`in n||`shared`in n)){if(`client`in n)throw Error(`server entry point only accepts 'server' and 'shared' schemas.`);return e.t(n,!0,void 0,t.arkenv,t.getSchemaKeys)}return e.t(n,r,{isServer:!0,strictLayout:`server`},t.arkenv,t.getSchemaKeys)}exports.arkenv=n,exports.default=n;
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":["arkenvInternal","coreArkenv","getSchemaKeys"],"sources":["../src/server.ts"],"sourcesContent":["import \"server-only\";\nimport type { EnvSchema } from \"@arkenv/core\";\nimport { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/core\";\nimport type { $ } from \"@repo/scope\";\nimport type { Dict, SchemaShape } from \"@repo/types\";\nimport type { type as at, distill } from \"arktype\";\nimport { arkenvInternal } from \"./arkenv-internal\";\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 arkenv<\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: `arkenv(schema, options)`\n */\nexport function arkenv<\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 arkenv(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 arkenvInternal(\n\t\t\tschemaOrOptions,\n\t\t\ttrue,\n\t\t\tundefined,\n\t\t\tcoreArkenv,\n\t\t\tgetSchemaKeys,\n\t\t);\n\t}\n\n\treturn arkenvInternal(\n\t\tschemaOrOptions,\n\t\toptionsOrIsServer,\n\t\t{ isServer: true, strictLayout: \"server\" },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport default arkenv;\n"],"mappings":"uOAuCA,SAAgB,EAAO,EAAsB,EAA8B,CAQ1E,GANC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GAEA,CACb,GAAI,WAAY,EACf,MAAU,MACT,iEACA,CAEF,OAAOA,EAAAA,EACN,EACA,GACA,IAAA,GACAC,EAAAA,OACAC,EAAAA,cACA,CAGF,OAAOF,EAAAA,EACN,EACA,EACA,CAAE,SAAU,GAAM,aAAc,SAAU,CAC1CC,EAAAA,OACAC,EAAAA,cACA"}
package/dist/server.d.cts CHANGED
@@ -1,22 +1,24 @@
1
- import { r as $, t as SchemaShape } from "./index-C6bpQ5GU.cjs";
2
- import { t as MergeExtends } from "./types-DBqiLw5v.cjs";
3
- import { distill, type as type$1 } from "arktype";
4
- import { EnvSchema, type } from "arkenv";
1
+ import { a as $, i as Dict, t as SchemaShape } from "./index-96RGPyfa.cjs";
2
+ import { t as MergeExtends } from "./types-44R9mgTa.cjs";
3
+ import { EnvSchema } from "@arkenv/core";
4
+ import { distill, type } from "arktype";
5
5
  //#region src/server.d.ts
6
6
  /**
7
7
  * Create a validated, type-safe environment configuration for Next.js applications (Server entry point).
8
8
  */
9
- declare function createEnv<const TSchema extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
9
+ declare function arkenv<const TSchema extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
10
10
  extends?: [...TExtends];
11
- runtimeEnv?: Record<keyof TSchema | string, unknown>;
12
- }): Readonly<distill.Out<type$1.infer<TSchema, $>> & MergeExtends<TExtends>>;
13
- declare function createEnv<const TServer extends SchemaShape = {}, const TShared extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(options: {
11
+ runtimeEnv?: Dict<string>;
12
+ }): Readonly<distill.Out<type.infer<TSchema, $>> & MergeExtends<TExtends>>;
13
+ /**
14
+ * @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`
15
+ */
16
+ declare function arkenv<const TServer extends SchemaShape = {}, const TShared extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(options: {
14
17
  server?: EnvSchema<TServer>;
15
18
  shared?: EnvSchema<TShared>;
16
19
  extends?: [...TExtends];
17
- runtimeEnv?: Record<keyof TShared, unknown> & Record<string, unknown>;
18
- }): Readonly<distill.Out<type$1.infer<TServer & TShared, $>> & MergeExtends<TExtends>>;
19
- declare const arkenv: typeof createEnv;
20
+ runtimeEnv?: Record<keyof TShared, string | undefined> & Dict<string>;
21
+ }): Readonly<distill.Out<type.infer<TServer & TShared, $>> & MergeExtends<TExtends>>;
20
22
  //#endregion
21
- export { createEnv, arkenv as default, type };
23
+ export { arkenv, arkenv as default };
22
24
  //# sourceMappingURL=server.d.cts.map
@@ -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":";;;;;;AAYA;;iBAAgB,MAAA,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,IAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;;;;iBAK7C,MAAA,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,IAAA,CAAG,KAAA,CAAM,OAAA,GAAU,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA"}
package/dist/server.d.ts CHANGED
@@ -1,23 +1,25 @@
1
- import { r as $, t as SchemaShape } from "./index-Bn3pRiJy.js";
2
- import { t as MergeExtends } from "./types-BN4fEChy.js";
3
- import { EnvSchema, type } from "arkenv";
4
- import { distill, type as type$1 } from "arktype";
1
+ import { a as $, i as Dict, t as SchemaShape } from "./index-bjEZwPUt.js";
2
+ import { t as MergeExtends } from "./types-BzMGTYWv.js";
3
+ import { EnvSchema } from "@arkenv/core";
4
+ import { distill, type } from "arktype";
5
5
 
6
6
  //#region src/server.d.ts
7
7
  /**
8
8
  * Create a validated, type-safe environment configuration for Next.js applications (Server entry point).
9
9
  */
10
- declare function createEnv<const TSchema extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
10
+ declare function arkenv<const TSchema extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
11
11
  extends?: [...TExtends];
12
- runtimeEnv?: Record<keyof TSchema | string, unknown>;
13
- }): Readonly<distill.Out<type$1.infer<TSchema, $>> & MergeExtends<TExtends>>;
14
- declare function createEnv<const TServer extends SchemaShape = {}, const TShared extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(options: {
12
+ runtimeEnv?: Dict<string>;
13
+ }): Readonly<distill.Out<type.infer<TSchema, $>> & MergeExtends<TExtends>>;
14
+ /**
15
+ * @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`
16
+ */
17
+ declare function arkenv<const TServer extends SchemaShape = {}, const TShared extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(options: {
15
18
  server?: EnvSchema<TServer>;
16
19
  shared?: EnvSchema<TShared>;
17
20
  extends?: [...TExtends];
18
- runtimeEnv?: Record<keyof TShared, unknown> & Record<string, unknown>;
19
- }): Readonly<distill.Out<type$1.infer<TServer & TShared, $>> & MergeExtends<TExtends>>;
20
- declare const arkenv: typeof createEnv;
21
+ runtimeEnv?: Record<keyof TShared, string | undefined> & Dict<string>;
22
+ }): Readonly<distill.Out<type.infer<TServer & TShared, $>> & MergeExtends<TExtends>>;
21
23
  //#endregion
22
- export { createEnv, arkenv as default, type };
24
+ export { arkenv, arkenv as default };
23
25
  //# sourceMappingURL=server.d.ts.map
@@ -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":";;;;;;;AAYA;;iBAAgB,MAAA,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,IAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;;;;iBAK7C,MAAA,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,IAAA,CAAG,KAAA,CAAM,OAAA,GAAU,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA"}
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"./arkenv-internal-DEN5DTmX.js";import{arkenv as t,getSchemaKeys as n}from"@arkenv/core";import"server-only";function r(r,i){if(r&&typeof r==`object`&&(`runtimeEnv`in r||`server`in r||`shared`in r)){if(`client`in r)throw Error(`server entry point only accepts 'server' and 'shared' schemas.`);return e(r,!0,void 0,t,n)}return e(r,i,{isServer:!0,strictLayout:`server`},t,n)}export{r as arkenv,r as default};
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":["coreArkenv"],"sources":["../src/server.ts"],"sourcesContent":["import \"server-only\";\nimport type { EnvSchema } from \"@arkenv/core\";\nimport { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/core\";\nimport type { $ } from \"@repo/scope\";\nimport type { Dict, SchemaShape } from \"@repo/types\";\nimport type { type as at, distill } from \"arktype\";\nimport { arkenvInternal } from \"./arkenv-internal\";\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 arkenv<\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: `arkenv(schema, options)`\n */\nexport function arkenv<\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 arkenv(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 arkenvInternal(\n\t\t\tschemaOrOptions,\n\t\t\ttrue,\n\t\t\tundefined,\n\t\t\tcoreArkenv,\n\t\t\tgetSchemaKeys,\n\t\t);\n\t}\n\n\treturn arkenvInternal(\n\t\tschemaOrOptions,\n\t\toptionsOrIsServer,\n\t\t{ isServer: true, strictLayout: \"server\" },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport default arkenv;\n"],"mappings":"+HAuCA,SAAgB,EAAO,EAAsB,EAA8B,CAQ1E,GANC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GAEA,CACb,GAAI,WAAY,EACf,MAAU,MACT,iEACA,CAEF,OAAO,EACN,EACA,GACA,IAAA,GACAA,EACA,EACA,CAGF,OAAO,EACN,EACA,EACA,CAAE,SAAU,GAAM,aAAc,SAAU,CAC1CA,EACA,EACA"}
@@ -0,0 +1,2 @@
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../config-CStvXoN3.cjs`);const e=require(`../arkenv-internal-Cll5pV_F.cjs`);let t=require(`@arkenv/standard`);function n(n,r){if(n&&typeof n==`object`&&(`runtimeEnv`in n||`client`in n||`shared`in n)){if(`server`in n)throw Error(`client entry point only accepts 'client' and 'shared' schemas.`);return e.t(n,!1,void 0,t.arkenv,t.getSchemaKeys)}return e.t(n,r,{isServer:!1},t.arkenv,t.getSchemaKeys)}exports.arkenv=n,exports.default=n;
2
+ //# sourceMappingURL=client.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.cjs","names":["arkenvInternal","coreArkenv","getSchemaKeys"],"sources":["../../src/standard/client.ts"],"sourcesContent":["import { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/standard\";\nimport type { Dict, StandardSchemaV1 } from \"@repo/types\";\nimport { arkenvInternal } from \"@/arkenv-internal\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Client entry point, Standard Mode).\n *\n * @param schema A flat schema of `NEXT_PUBLIC_*` Standard Schema validators\n * @param options Optional extends and runtimeEnv overrides\n * @returns A validated, readonly environment variables object\n */\nexport function arkenv<\n\tconst TSchema extends Record<string, StandardSchemaV1> = {},\n>(\n\tschema: TSchema & {\n\t\t[K in keyof TSchema]: K extends `NEXT_PUBLIC_${string}` ? unknown : never;\n\t},\n\toptions?: {\n\t\textends?: readonly unknown[];\n\t\truntimeEnv: Record<keyof TSchema, string | undefined> & Dict<string>;\n\t},\n): Readonly<{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> }>;\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications using\n * the split client/shared schema pattern (Client entry point, Standard Mode).\n *\n * @param options The environment validation configuration with client and shared schemas\n * @returns A validated, readonly environment variables object\n */\nexport function arkenv<\n\tconst TClient extends Record<string, StandardSchemaV1> = {},\n\tconst TShared extends Record<string, StandardSchemaV1> = {},\n>(options: {\n\tclient?: TClient & {\n\t\t[K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never;\n\t};\n\tshared?: TShared;\n\textends?: readonly unknown[];\n\truntimeEnv: Record<keyof TClient | keyof TShared, unknown> &\n\t\tRecord<string, unknown>;\n}): Readonly<{\n\t[K in keyof (TClient & TShared)]: StandardSchemaV1.InferOutput<\n\t\t(TClient & TShared)[K]\n\t>;\n}>;\n\nexport function arkenv(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\"client\" in schemaOrOptions ||\n\t\t\t\"shared\" in schemaOrOptions);\n\n\tif (isLegacy) {\n\t\tif (\"server\" in schemaOrOptions) {\n\t\t\tthrow new Error(\n\t\t\t\t\"client entry point only accepts 'client' and 'shared' schemas.\",\n\t\t\t);\n\t\t}\n\t\treturn arkenvInternal(\n\t\t\tschemaOrOptions,\n\t\t\tfalse,\n\t\t\tundefined,\n\t\t\tcoreArkenv,\n\t\t\tgetSchemaKeys,\n\t\t);\n\t}\n\n\treturn arkenvInternal(\n\t\tschemaOrOptions,\n\t\toptionsOrIsServer,\n\t\t{ isServer: false },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport default arkenv;\n"],"mappings":"sNA+CA,SAAgB,EAAO,EAAsB,EAA8B,CAQ1E,GANC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GAEA,CACb,GAAI,WAAY,EACf,MAAU,MACT,iEACA,CAEF,OAAOA,EAAAA,EACN,EACA,GACA,IAAA,GACAC,EAAAA,OACAC,EAAAA,cACA,CAGF,OAAOF,EAAAA,EACN,EACA,EACA,CAAE,SAAU,GAAO,CACnBC,EAAAA,OACAC,EAAAA,cACA"}
@@ -0,0 +1,30 @@
1
+ import { i as Dict, r as StandardSchemaV1 } from "../index-96RGPyfa.cjs";
2
+
3
+ //#region src/standard/client.d.ts
4
+ /**
5
+ * Create a validated, type-safe environment configuration for Next.js applications (Client entry point, Standard Mode).
6
+ *
7
+ * @param schema A flat schema of `NEXT_PUBLIC_*` Standard Schema validators
8
+ * @param options Optional extends and runtimeEnv overrides
9
+ * @returns A validated, readonly environment variables object
10
+ */
11
+ declare function arkenv<const TSchema extends Record<string, StandardSchemaV1> = {}>(schema: TSchema & { [K in keyof TSchema]: K extends `NEXT_PUBLIC_${string}` ? unknown : never }, options?: {
12
+ extends?: readonly unknown[];
13
+ runtimeEnv: Record<keyof TSchema, string | undefined> & Dict<string>;
14
+ }): Readonly<{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> }>;
15
+ /**
16
+ * Create a validated, type-safe environment configuration for Next.js applications using
17
+ * the split client/shared schema pattern (Client entry point, Standard Mode).
18
+ *
19
+ * @param options The environment validation configuration with client and shared schemas
20
+ * @returns A validated, readonly environment variables object
21
+ */
22
+ declare function arkenv<const TClient extends Record<string, StandardSchemaV1> = {}, const TShared extends Record<string, StandardSchemaV1> = {}>(options: {
23
+ client?: TClient & { [K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never };
24
+ shared?: TShared;
25
+ extends?: readonly unknown[];
26
+ runtimeEnv: Record<keyof TClient | keyof TShared, unknown> & Record<string, unknown>;
27
+ }): Readonly<{ [K in keyof (TClient & TShared)]: StandardSchemaV1.InferOutput<(TClient & TShared)[K]> }>;
28
+ //#endregion
29
+ export { arkenv, arkenv as default };
30
+ //# sourceMappingURL=client.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.cts","names":[],"sources":["../../src/standard/client.ts"],"mappings":";;;;;AAWA;;;;;iBAAgB,MAAA,uBACO,MAAA,SAAe,gBAAA,OAAA,CAErC,MAAA,EAAQ,OAAA,iBACK,OAAA,GAAU,CAAA,sDAEvB,OAAA;EACC,OAAA;EACA,UAAA,EAAY,MAAA,OAAa,OAAA,wBAA+B,IAAA;AAAA,IAEvD,QAAA,eAAuB,OAAA,GAAU,gBAAA,CAAiB,WAAA,CAAY,OAAA,CAAQ,CAAA;;;;;;;;iBASzD,MAAA,uBACO,MAAA,SAAe,gBAAA,8BACf,MAAA,SAAe,gBAAA,OAAA,CACpC,OAAA;EACD,MAAA,GAAS,OAAA,iBACI,OAAA,GAAU,CAAA;EAEvB,MAAA,GAAS,OAAA;EACT,OAAA;EACA,UAAA,EAAY,MAAA,OAAa,OAAA,SAAgB,OAAA,aACxC,MAAA;AAAA,IACE,QAAA,gBACU,OAAA,GAAU,OAAA,IAAW,gBAAA,CAAiB,WAAA,EACjD,OAAA,GAAU,OAAA,EAAS,CAAA"}