@arkenv/nextjs 1.0.0-alpha.10 → 1.0.0-alpha.12
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.
- package/README.md +10 -1
- package/dist/arkenv-internal-QxkUlA5J.cjs +2 -0
- package/dist/arkenv-internal-QxkUlA5J.cjs.map +1 -0
- package/dist/arkenv-internal-Ws3srax6.js +2 -0
- package/dist/arkenv-internal-Ws3srax6.js.map +1 -0
- package/dist/auto-extend-CYzZnEvT.cjs +2 -0
- package/dist/auto-extend-CYzZnEvT.cjs.map +1 -0
- package/dist/auto-extend-DjiqIbgM.js +2 -0
- package/dist/auto-extend-DjiqIbgM.js.map +1 -0
- package/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +3 -3
- package/dist/client.d.ts +3 -3
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/config/index.cjs +1 -1
- package/dist/config/index.d.cts +2 -2
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +1 -1
- package/dist/config-Deut5Vf8.js +99 -0
- package/dist/config-Deut5Vf8.js.map +1 -0
- package/dist/config-Oq8dsEPM.cjs +99 -0
- package/dist/config-Oq8dsEPM.cjs.map +1 -0
- package/dist/empty-client-env.cjs +2 -0
- package/dist/empty-client-env.cjs.map +1 -0
- package/dist/empty-client-env.d.cts +10 -0
- package/dist/empty-client-env.d.cts.map +1 -0
- package/dist/empty-client-env.d.ts +10 -0
- package/dist/empty-client-env.d.ts.map +1 -0
- package/dist/empty-client-env.js +2 -0
- package/dist/empty-client-env.js.map +1 -0
- package/dist/{index-96RGPyfa.d.cts → index-BS1wAitS.d.cts} +91 -31
- package/dist/{index-96RGPyfa.d.cts.map → index-BS1wAitS.d.cts.map} +1 -1
- package/dist/{index-BFQlm61W.d.ts → index-CBjJM83X.d.ts} +54 -14
- package/dist/index-CBjJM83X.d.ts.map +1 -0
- package/dist/{index-bjEZwPUt.d.ts → index-Cq_qJ68V.d.ts} +91 -31
- package/dist/{index-bjEZwPUt.d.ts.map → index-Cq_qJ68V.d.ts.map} +1 -1
- package/dist/{index-CNzwVE5N.d.cts → index-RdYGBD_V.d.cts} +54 -14
- package/dist/index-RdYGBD_V.d.cts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +12 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react-server.cjs +1 -1
- package/dist/react-server.cjs.map +1 -1
- package/dist/react-server.d.cts +11 -5
- package/dist/react-server.d.cts.map +1 -1
- package/dist/react-server.d.ts +12 -6
- package/dist/react-server.d.ts.map +1 -1
- package/dist/react-server.js +1 -1
- package/dist/react-server.js.map +1 -1
- package/dist/{script-7FFqInPq.d.ts → script-Cy9x6rp9.d.ts} +1 -1
- package/dist/{script-7FFqInPq.d.ts.map → script-Cy9x6rp9.d.ts.map} +1 -1
- package/dist/{script-D-MYC2Uf.cjs → script-DAdH4IEa.cjs} +2 -2
- package/dist/{script-D-MYC2Uf.cjs.map → script-DAdH4IEa.cjs.map} +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +24 -5
- package/dist/server.d.cts.map +1 -1
- package/dist/server.d.ts +24 -5
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/standard/client.cjs +1 -1
- package/dist/standard/client.cjs.map +1 -1
- package/dist/standard/client.d.cts +3 -3
- package/dist/standard/client.d.ts +3 -3
- package/dist/standard/client.js +1 -1
- package/dist/standard/client.js.map +1 -1
- package/dist/standard/config.cjs +1 -1
- package/dist/standard/config.cjs.map +1 -1
- package/dist/standard/config.d.cts +6 -5
- package/dist/standard/config.d.cts.map +1 -1
- package/dist/standard/config.d.ts +6 -5
- package/dist/standard/config.d.ts.map +1 -1
- package/dist/standard/config.js +1 -1
- package/dist/standard/config.js.map +1 -1
- package/dist/standard/index.cjs +1 -1
- package/dist/standard/index.cjs.map +1 -1
- package/dist/standard/index.d.cts +4 -4
- package/dist/standard/index.d.ts +4 -4
- package/dist/standard/index.js +1 -1
- package/dist/standard/index.js.map +1 -1
- package/dist/standard/server.cjs +1 -1
- package/dist/standard/server.cjs.map +1 -1
- package/dist/standard/server.d.cts +27 -7
- package/dist/standard/server.d.cts.map +1 -1
- package/dist/standard/server.d.ts +28 -7
- package/dist/standard/server.d.ts.map +1 -1
- package/dist/standard/server.js +1 -1
- package/dist/standard/server.js.map +1 -1
- package/dist/standard/shared.cjs +1 -1
- package/dist/standard/shared.cjs.map +1 -1
- package/dist/standard/shared.d.cts +2 -2
- package/dist/standard/shared.d.ts +2 -2
- package/dist/standard/shared.js +1 -1
- package/dist/standard/shared.js.map +1 -1
- package/dist/strict-client-env-CHDTZoLe.js +6 -0
- package/dist/strict-client-env-CHDTZoLe.js.map +1 -0
- package/dist/strict-client-env-MouPnkRr.cjs +6 -0
- package/dist/strict-client-env-MouPnkRr.cjs.map +1 -0
- package/dist/{types-BzMGTYWv.d.ts → types-BfMBbrMm.d.ts} +2 -2
- package/dist/{types-BzMGTYWv.d.ts.map → types-BfMBbrMm.d.ts.map} +1 -1
- package/dist/{types-44R9mgTa.d.cts → types-BlRHnQwj.d.cts} +2 -2
- package/dist/{types-44R9mgTa.d.cts.map → types-BlRHnQwj.d.cts.map} +1 -1
- package/package.json +12 -5
- package/dist/arkenv-internal-Cll5pV_F.cjs +0 -2
- package/dist/arkenv-internal-Cll5pV_F.cjs.map +0 -1
- package/dist/arkenv-internal-DEN5DTmX.js +0 -2
- package/dist/arkenv-internal-DEN5DTmX.js.map +0 -1
- package/dist/config-CStvXoN3.cjs +0 -93
- package/dist/config-CStvXoN3.cjs.map +0 -1
- package/dist/config-D2j45WDh.js +0 -93
- package/dist/config-D2j45WDh.js.map +0 -1
- package/dist/index-BFQlm61W.d.ts.map +0 -1
- package/dist/index-CNzwVE5N.d.cts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script-
|
|
1
|
+
{"version":3,"file":"script-Cy9x6rp9.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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`./config-
|
|
2
|
-
//# sourceMappingURL=script-
|
|
1
|
+
require(`./config-Oq8dsEPM.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-DAdH4IEa.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script-
|
|
1
|
+
{"version":3,"file":"script-DAdH4IEa.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`}}),require(`./config-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`./config-Oq8dsEPM.cjs`);const e=require(`./arkenv-internal-QxkUlA5J.cjs`),t=require(`./strict-client-env-MouPnkRr.cjs`),n=require(`./auto-extend-CYzZnEvT.cjs`);let r=require(`@arkenv/core`);require(`server-only`);let i=require(`#arkenv/client-env`);function a(a,o){if(a&&typeof a==`object`&&(`runtimeEnv`in a||`server`in a||`shared`in a)){if(`client`in a)throw Error(`server entry point only accepts 'server' and 'shared' schemas.`);return e.t(a,!0,void 0,r.arkenv,r.getSchemaKeys)}return e.t(a,n.t(o,()=>t.i(i.env)),{isServer:!0,strictLayout:`server`},r.arkenv,r.getSchemaKeys)}exports.arkenv=a,exports.default=a;
|
|
2
2
|
//# sourceMappingURL=server.cjs.map
|
package/dist/server.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
1
|
+
{"version":3,"file":"server.cjs","names":["arkenvInternal","coreArkenv","getSchemaKeys","withAutoExtend","resolveStrictClientEnv","importedClientEnv"],"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\";\n// Static import so webpack/Turbopack can resolve the alias at bundle time.\n// Outside strict layout the package `imports` map points this at empty-client-env.\nimport { env as importedClientEnv } from \"#arkenv/client-env\";\nimport { arkenvInternal } from \"./arkenv-internal\";\nimport { withAutoExtend } from \"./auto-extend\";\nimport { resolveStrictClientEnv } from \"./strict-client-env\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Client env type auto-merged in Next.js strict layout when `extends` is omitted.\n */\ntype AutoClientEnv = typeof import(\"#arkenv/client-env\") extends {\n\tenv: infer E;\n}\n\t? E\n\t: {};\n\n/**\n * Create a validated, typesafe environment configuration for Next.js applications (Server entry point).\n *\n * With `withArkEnv` in strict layout, omitting `extends` includes the client\n * env by default. Any explicit `extends` is used as-is and opts out of that\n * default; pass `extends: []` to include no extended env.\n */\nexport function arkenv<\n\tconst TSchema extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions: {\n\t\t/**\n\t\t * Explicit envs to extend. Providing this option opts out of the default\n\t\t * strict-layout client merge; use `[]` to include no extended env.\n\t\t */\n\t\textends: [...TExtends];\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>>;\n\nexport function arkenv<const TSchema extends SchemaShape = {}>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\textends?: undefined;\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & AutoClientEnv>;\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\twithAutoExtend(optionsOrIsServer, () =>\n\t\t\tresolveStrictClientEnv(importedClientEnv),\n\t\t),\n\t\t{ isServer: true, strictLayout: \"server\" },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport default arkenv;\n"],"mappings":"iWAqEA,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,EACAG,EAAAA,EAAe,MACdC,EAAAA,EAAuBC,EAAAA,IAAkB,CACzC,CACD,CAAE,SAAU,GAAM,aAAc,SAAU,CAC1CJ,EAAAA,OACAC,EAAAA,cACA"}
|
package/dist/server.d.cts
CHANGED
|
@@ -1,15 +1,34 @@
|
|
|
1
|
-
import { a as $, i as Dict, t as SchemaShape } from "./index-
|
|
2
|
-
import { t as MergeExtends } from "./types-
|
|
1
|
+
import { a as $, i as Dict, t as SchemaShape } from "./index-BS1wAitS.cjs";
|
|
2
|
+
import { t as MergeExtends } from "./types-BlRHnQwj.cjs";
|
|
3
3
|
import { EnvSchema } from "@arkenv/core";
|
|
4
4
|
import { distill, type } from "arktype";
|
|
5
|
+
import * as _$_arkenv_client_env0 from "#arkenv/client-env";
|
|
5
6
|
//#region src/server.d.ts
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* Client env type auto-merged in Next.js strict layout when `extends` is omitted.
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
type AutoClientEnv = typeof _$_arkenv_client_env0 extends {
|
|
11
|
+
env: infer E;
|
|
12
|
+
} ? E : {};
|
|
13
|
+
/**
|
|
14
|
+
* Create a validated, typesafe environment configuration for Next.js applications (Server entry point).
|
|
15
|
+
*
|
|
16
|
+
* With `withArkEnv` in strict layout, omitting `extends` includes the client
|
|
17
|
+
* env by default. Any explicit `extends` is used as-is and opts out of that
|
|
18
|
+
* default; pass `extends: []` to include no extended env.
|
|
19
|
+
*/
|
|
20
|
+
declare function arkenv<const TSchema extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options: {
|
|
21
|
+
/**
|
|
22
|
+
* Explicit envs to extend. Providing this option opts out of the default
|
|
23
|
+
* strict-layout client merge; use `[]` to include no extended env.
|
|
24
|
+
*/
|
|
25
|
+
extends: [...TExtends];
|
|
11
26
|
runtimeEnv?: Dict<string>;
|
|
12
27
|
}): Readonly<distill.Out<type.infer<TSchema, $>> & MergeExtends<TExtends>>;
|
|
28
|
+
declare function arkenv<const TSchema extends SchemaShape = {}>(schema: EnvSchema<TSchema>, options?: {
|
|
29
|
+
extends?: undefined;
|
|
30
|
+
runtimeEnv?: Dict<string>;
|
|
31
|
+
}): Readonly<distill.Out<type.infer<TSchema, $>> & AutoClientEnv>;
|
|
13
32
|
/**
|
|
14
33
|
* @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`
|
|
15
34
|
*/
|
package/dist/server.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.cts","names":[],"sources":["../src/server.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.cts","names":[],"sources":["../src/server.ts"],"mappings":";;;;;;;;AAY4C;KAKvC,aAAA,UAAa,qBAAA;EACjB,GAAA;AAAA,IAEE,CAAA;;;;;;;AAUH;iBAAgB,MAAA,uBACO,WAAA,sDAAA,CAGtB,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EALqB;;;;EAUpB,OAAA,MAAa,QAAA;EACb,UAAA,GAAa,IAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;AAAA,iBAE7C,MAAA,uBAA6B,WAAA,MAAA,CAC5C,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EACC,OAAA;EACA,UAAA,GAAa,IAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,aAAA;;;;iBAKhC,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,16 +1,35 @@
|
|
|
1
|
-
import { a as $, i as Dict, t as SchemaShape } from "./index-
|
|
2
|
-
import { t as MergeExtends } from "./types-
|
|
1
|
+
import { a as $, i as Dict, t as SchemaShape } from "./index-Cq_qJ68V.js";
|
|
2
|
+
import { t as MergeExtends } from "./types-BfMBbrMm.js";
|
|
3
3
|
import { EnvSchema } from "@arkenv/core";
|
|
4
|
+
import * as _$_arkenv_client_env0 from "#arkenv/client-env";
|
|
4
5
|
import { distill, type } from "arktype";
|
|
5
6
|
|
|
6
7
|
//#region src/server.d.ts
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Client env type auto-merged in Next.js strict layout when `extends` is omitted.
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
type AutoClientEnv = typeof _$_arkenv_client_env0 extends {
|
|
12
|
+
env: infer E;
|
|
13
|
+
} ? E : {};
|
|
14
|
+
/**
|
|
15
|
+
* Create a validated, typesafe environment configuration for Next.js applications (Server entry point).
|
|
16
|
+
*
|
|
17
|
+
* With `withArkEnv` in strict layout, omitting `extends` includes the client
|
|
18
|
+
* env by default. Any explicit `extends` is used as-is and opts out of that
|
|
19
|
+
* default; pass `extends: []` to include no extended env.
|
|
20
|
+
*/
|
|
21
|
+
declare function arkenv<const TSchema extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options: {
|
|
22
|
+
/**
|
|
23
|
+
* Explicit envs to extend. Providing this option opts out of the default
|
|
24
|
+
* strict-layout client merge; use `[]` to include no extended env.
|
|
25
|
+
*/
|
|
26
|
+
extends: [...TExtends];
|
|
12
27
|
runtimeEnv?: Dict<string>;
|
|
13
28
|
}): Readonly<distill.Out<type.infer<TSchema, $>> & MergeExtends<TExtends>>;
|
|
29
|
+
declare function arkenv<const TSchema extends SchemaShape = {}>(schema: EnvSchema<TSchema>, options?: {
|
|
30
|
+
extends?: undefined;
|
|
31
|
+
runtimeEnv?: Dict<string>;
|
|
32
|
+
}): Readonly<distill.Out<type.infer<TSchema, $>> & AutoClientEnv>;
|
|
14
33
|
/**
|
|
15
34
|
* @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`
|
|
16
35
|
*/
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","names":[],"sources":["../src/server.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"server.d.ts","names":[],"sources":["../src/server.ts"],"mappings":";;;;;;;;;AAY4C;KAKvC,aAAA,UAAa,qBAAA;EACjB,GAAA;AAAA,IAEE,CAAA;;;;;;;AAUH;iBAAgB,MAAA,uBACO,WAAA,sDAAA,CAGtB,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EALqB;;;;EAUpB,OAAA,MAAa,QAAA;EACb,UAAA,GAAa,IAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;AAAA,iBAE7C,MAAA,uBAA6B,WAAA,MAAA,CAC5C,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EACC,OAAA;EACA,UAAA,GAAa,IAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,aAAA;;;;iBAKhC,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"./arkenv-internal-
|
|
1
|
+
import{t as e}from"./arkenv-internal-Ws3srax6.js";import{i as t}from"./strict-client-env-CHDTZoLe.js";import{t as n}from"./auto-extend-DjiqIbgM.js";import{arkenv as r,getSchemaKeys as i}from"@arkenv/core";import"server-only";import{env as a}from"#arkenv/client-env";function o(o,s){if(o&&typeof o==`object`&&(`runtimeEnv`in o||`server`in o||`shared`in o)){if(`client`in o)throw Error(`server entry point only accepts 'server' and 'shared' schemas.`);return e(o,!0,void 0,r,i)}return e(o,n(s,()=>t(a)),{isServer:!0,strictLayout:`server`},r,i)}export{o as arkenv,o as default};
|
|
2
2
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
1
|
+
{"version":3,"file":"server.js","names":["coreArkenv","importedClientEnv"],"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\";\n// Static import so webpack/Turbopack can resolve the alias at bundle time.\n// Outside strict layout the package `imports` map points this at empty-client-env.\nimport { env as importedClientEnv } from \"#arkenv/client-env\";\nimport { arkenvInternal } from \"./arkenv-internal\";\nimport { withAutoExtend } from \"./auto-extend\";\nimport { resolveStrictClientEnv } from \"./strict-client-env\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Client env type auto-merged in Next.js strict layout when `extends` is omitted.\n */\ntype AutoClientEnv = typeof import(\"#arkenv/client-env\") extends {\n\tenv: infer E;\n}\n\t? E\n\t: {};\n\n/**\n * Create a validated, typesafe environment configuration for Next.js applications (Server entry point).\n *\n * With `withArkEnv` in strict layout, omitting `extends` includes the client\n * env by default. Any explicit `extends` is used as-is and opts out of that\n * default; pass `extends: []` to include no extended env.\n */\nexport function arkenv<\n\tconst TSchema extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions: {\n\t\t/**\n\t\t * Explicit envs to extend. Providing this option opts out of the default\n\t\t * strict-layout client merge; use `[]` to include no extended env.\n\t\t */\n\t\textends: [...TExtends];\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>>;\n\nexport function arkenv<const TSchema extends SchemaShape = {}>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\textends?: undefined;\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & AutoClientEnv>;\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\twithAutoExtend(optionsOrIsServer, () =>\n\t\t\tresolveStrictClientEnv(importedClientEnv),\n\t\t),\n\t\t{ isServer: true, strictLayout: \"server\" },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport default arkenv;\n"],"mappings":"0QAqEA,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,EAAe,MACd,EAAuBC,EAAkB,CACzC,CACD,CAAE,SAAU,GAAM,aAAc,SAAU,CAC1CD,EACA,EACA"}
|
package/dist/standard/client.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../config-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../config-Oq8dsEPM.cjs`);const e=require(`../arkenv-internal-QxkUlA5J.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
2
|
//# sourceMappingURL=client.cjs.map
|
|
@@ -1 +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,
|
|
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, typesafe 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, typesafe 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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as Dict, r as StandardSchemaV1 } from "../index-
|
|
1
|
+
import { i as Dict, r as StandardSchemaV1 } from "../index-BS1wAitS.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/standard/client.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* Create a validated,
|
|
5
|
+
* Create a validated, typesafe environment configuration for Next.js applications (Client entry point, Standard Mode).
|
|
6
6
|
*
|
|
7
7
|
* @param schema A flat schema of `NEXT_PUBLIC_*` Standard Schema validators
|
|
8
8
|
* @param options Optional extends and runtimeEnv overrides
|
|
@@ -13,7 +13,7 @@ declare function arkenv<const TSchema extends Record<string, StandardSchemaV1> =
|
|
|
13
13
|
runtimeEnv: Record<keyof TSchema, string | undefined> & Dict<string>;
|
|
14
14
|
}): Readonly<{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> }>;
|
|
15
15
|
/**
|
|
16
|
-
* Create a validated,
|
|
16
|
+
* Create a validated, typesafe environment configuration for Next.js applications using
|
|
17
17
|
* the split client/shared schema pattern (Client entry point, Standard Mode).
|
|
18
18
|
*
|
|
19
19
|
* @param options The environment validation configuration with client and shared schemas
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as Dict, r as StandardSchemaV1 } from "../index-
|
|
1
|
+
import { i as Dict, r as StandardSchemaV1 } from "../index-Cq_qJ68V.js";
|
|
2
2
|
|
|
3
3
|
//#region src/standard/client.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* Create a validated,
|
|
5
|
+
* Create a validated, typesafe environment configuration for Next.js applications (Client entry point, Standard Mode).
|
|
6
6
|
*
|
|
7
7
|
* @param schema A flat schema of `NEXT_PUBLIC_*` Standard Schema validators
|
|
8
8
|
* @param options Optional extends and runtimeEnv overrides
|
|
@@ -13,7 +13,7 @@ declare function arkenv<const TSchema extends Record<string, StandardSchemaV1> =
|
|
|
13
13
|
runtimeEnv: Record<keyof TSchema, string | undefined> & Dict<string>;
|
|
14
14
|
}): Readonly<{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> }>;
|
|
15
15
|
/**
|
|
16
|
-
* Create a validated,
|
|
16
|
+
* Create a validated, typesafe environment configuration for Next.js applications using
|
|
17
17
|
* the split client/shared schema pattern (Client entry point, Standard Mode).
|
|
18
18
|
*
|
|
19
19
|
* @param options The environment validation configuration with client and shared schemas
|
package/dist/standard/client.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"../arkenv-internal-
|
|
1
|
+
import{t as e}from"../arkenv-internal-Ws3srax6.js";import{arkenv as t,getSchemaKeys as n}from"@arkenv/standard";function r(r,i){if(r&&typeof r==`object`&&(`runtimeEnv`in r||`client`in r||`shared`in r)){if(`server`in r)throw Error(`client entry point only accepts 'client' and 'shared' schemas.`);return e(r,!1,void 0,t,n)}return e(r,i,{isServer:!1},t,n)}export{r as arkenv,r as default};
|
|
2
2
|
//# sourceMappingURL=client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["coreArkenv"],"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,
|
|
1
|
+
{"version":3,"file":"client.js","names":["coreArkenv"],"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, typesafe 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, typesafe 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":"gHA+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,OAAO,EACN,EACA,GACA,IAAA,GACAA,EACA,EACA,CAGF,OAAO,EACN,EACA,EACA,CAAE,SAAU,GAAO,CACnBA,EACA,EACA"}
|
package/dist/standard/config.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../config-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../config-Oq8dsEPM.cjs`);function t(t,n){return e.n(t,{...n,standard:!0})}exports.withArkEnv=t;
|
|
2
2
|
//# sourceMappingURL=config.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.cjs","names":["originalWithArkEnv"],"sources":["../../src/standard/config.ts"],"sourcesContent":["import {\n\ttype ArkEnvConfigOptions,\n\twithArkEnv as originalWithArkEnv,\n} from \"@/config\";\n\n/**\n * Wrap a Next.js configuration object to
|
|
1
|
+
{"version":3,"file":"config.cjs","names":["originalWithArkEnv"],"sources":["../../src/standard/config.ts"],"sourcesContent":["import {\n\ttype ArkEnvConfigOptions,\n\ttype NextConfigContext,\n\ttype NextConfigFactory,\n\twithArkEnv as originalWithArkEnv,\n} from \"@/config\";\n\n/**\n * Wrap a Next.js configuration object or function to generate `env.gen.ts` (Standard Mode).\n *\n * @param nextConfig The Next.js configuration object or `(phase, context)` factory\n * @param options Optional configuration paths for schema and output files\n * @returns The Next.js configuration object, or an async factory that resolves to it\n */\nexport function withArkEnv<T extends object>(\n\tnextConfig: NextConfigFactory<T>,\n\toptions?: ArkEnvConfigOptions,\n): (phase: string, context: NextConfigContext) => Promise<T>;\nexport function withArkEnv<T extends object>(\n\tnextConfig: T,\n\toptions?: ArkEnvConfigOptions,\n): T;\nexport function withArkEnv<T extends object>(\n\tnextConfig: T | NextConfigFactory<T>,\n\toptions?: ArkEnvConfigOptions,\n): T | ((phase: string, context: NextConfigContext) => Promise<T>) {\n\treturn originalWithArkEnv(nextConfig as T, {\n\t\t...options,\n\t\tstandard: true,\n\t}) as T | ((phase: string, context: NextConfigContext) => Promise<T>);\n}\n"],"mappings":"6GAsBA,SAAgB,EACf,EACA,EACkE,CAClE,OAAOA,EAAAA,EAAmB,EAAiB,CAC1C,GAAG,EACH,SAAU,GACV,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { s as ArkEnvConfigOptions } from "../index-
|
|
1
|
+
import { c as NextConfigContext, l as NextConfigFactory, s as ArkEnvConfigOptions } from "../index-RdYGBD_V.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/standard/config.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* Wrap a Next.js configuration object to
|
|
5
|
+
* Wrap a Next.js configuration object or function to generate `env.gen.ts` (Standard Mode).
|
|
6
6
|
*
|
|
7
|
-
* @param nextConfig The Next.js configuration object or
|
|
7
|
+
* @param nextConfig The Next.js configuration object or `(phase, context)` factory
|
|
8
8
|
* @param options Optional configuration paths for schema and output files
|
|
9
|
-
* @returns The Next.js configuration object
|
|
9
|
+
* @returns The Next.js configuration object, or an async factory that resolves to it
|
|
10
10
|
*/
|
|
11
|
-
declare function withArkEnv<T>(nextConfig: T
|
|
11
|
+
declare function withArkEnv<T extends object>(nextConfig: NextConfigFactory<T>, options?: ArkEnvConfigOptions): (phase: string, context: NextConfigContext) => Promise<T>;
|
|
12
|
+
declare function withArkEnv<T extends object>(nextConfig: T, options?: ArkEnvConfigOptions): T;
|
|
12
13
|
//#endregion
|
|
13
14
|
export { withArkEnv };
|
|
14
15
|
//# sourceMappingURL=config.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.cts","names":[],"sources":["../../src/standard/config.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"config.d.cts","names":[],"sources":["../../src/standard/config.ts"],"mappings":";;;;;AAcA;;;;;iBAAgB,UAAA,kBAAA,CACf,UAAA,EAAY,iBAAA,CAAkB,CAAA,GAC9B,OAAA,GAAU,mBAAA,IACP,KAAA,UAAe,OAAA,EAAS,iBAAA,KAAsB,OAAA,CAAQ,CAAA;AAAA,iBAC1C,UAAA,kBAAA,CACf,UAAA,EAAY,CAAA,EACZ,OAAA,GAAU,mBAAA,GACR,CAAA"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { s as ArkEnvConfigOptions } from "../index-
|
|
1
|
+
import { c as NextConfigContext, l as NextConfigFactory, s as ArkEnvConfigOptions } from "../index-CBjJM83X.js";
|
|
2
2
|
|
|
3
3
|
//#region src/standard/config.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* Wrap a Next.js configuration object to
|
|
5
|
+
* Wrap a Next.js configuration object or function to generate `env.gen.ts` (Standard Mode).
|
|
6
6
|
*
|
|
7
|
-
* @param nextConfig The Next.js configuration object or
|
|
7
|
+
* @param nextConfig The Next.js configuration object or `(phase, context)` factory
|
|
8
8
|
* @param options Optional configuration paths for schema and output files
|
|
9
|
-
* @returns The Next.js configuration object
|
|
9
|
+
* @returns The Next.js configuration object, or an async factory that resolves to it
|
|
10
10
|
*/
|
|
11
|
-
declare function withArkEnv<T>(nextConfig: T
|
|
11
|
+
declare function withArkEnv<T extends object>(nextConfig: NextConfigFactory<T>, options?: ArkEnvConfigOptions): (phase: string, context: NextConfigContext) => Promise<T>;
|
|
12
|
+
declare function withArkEnv<T extends object>(nextConfig: T, options?: ArkEnvConfigOptions): T;
|
|
12
13
|
//#endregion
|
|
13
14
|
export { withArkEnv };
|
|
14
15
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","names":[],"sources":["../../src/standard/config.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"config.d.ts","names":[],"sources":["../../src/standard/config.ts"],"mappings":";;;;;AAcA;;;;;iBAAgB,UAAA,kBAAA,CACf,UAAA,EAAY,iBAAA,CAAkB,CAAA,GAC9B,OAAA,GAAU,mBAAA,IACP,KAAA,UAAe,OAAA,EAAS,iBAAA,KAAsB,OAAA,CAAQ,CAAA;AAAA,iBAC1C,UAAA,kBAAA,CACf,UAAA,EAAY,CAAA,EACZ,OAAA,GAAU,mBAAA,GACR,CAAA"}
|
package/dist/standard/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"../config-
|
|
1
|
+
import{i as e}from"../config-Deut5Vf8.js";function t(t,n){return e(t,{...n,standard:!0})}export{t as withArkEnv};
|
|
2
2
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":["originalWithArkEnv"],"sources":["../../src/standard/config.ts"],"sourcesContent":["import {\n\ttype ArkEnvConfigOptions,\n\twithArkEnv as originalWithArkEnv,\n} from \"@/config\";\n\n/**\n * Wrap a Next.js configuration object to
|
|
1
|
+
{"version":3,"file":"config.js","names":["originalWithArkEnv"],"sources":["../../src/standard/config.ts"],"sourcesContent":["import {\n\ttype ArkEnvConfigOptions,\n\ttype NextConfigContext,\n\ttype NextConfigFactory,\n\twithArkEnv as originalWithArkEnv,\n} from \"@/config\";\n\n/**\n * Wrap a Next.js configuration object or function to generate `env.gen.ts` (Standard Mode).\n *\n * @param nextConfig The Next.js configuration object or `(phase, context)` factory\n * @param options Optional configuration paths for schema and output files\n * @returns The Next.js configuration object, or an async factory that resolves to it\n */\nexport function withArkEnv<T extends object>(\n\tnextConfig: NextConfigFactory<T>,\n\toptions?: ArkEnvConfigOptions,\n): (phase: string, context: NextConfigContext) => Promise<T>;\nexport function withArkEnv<T extends object>(\n\tnextConfig: T,\n\toptions?: ArkEnvConfigOptions,\n): T;\nexport function withArkEnv<T extends object>(\n\tnextConfig: T | NextConfigFactory<T>,\n\toptions?: ArkEnvConfigOptions,\n): T | ((phase: string, context: NextConfigContext) => Promise<T>) {\n\treturn originalWithArkEnv(nextConfig as T, {\n\t\t...options,\n\t\tstandard: true,\n\t}) as T | ((phase: string, context: NextConfigContext) => Promise<T>);\n}\n"],"mappings":"0CAsBA,SAAgB,EACf,EACA,EACkE,CAClE,OAAOA,EAAmB,EAAiB,CAC1C,GAAG,EACH,SAAU,GACV,CAAC"}
|
package/dist/standard/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../config-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../config-Oq8dsEPM.cjs`);const e=require(`../arkenv-internal-QxkUlA5J.cjs`);let t=require(`@arkenv/standard`);function n(n,r){return n&&typeof n==`object`&&(`runtimeEnv`in n||`server`in n||`client`in n||`shared`in n)?e.t(n,!1,void 0,t.arkenv,t.getSchemaKeys):e.t(n,r,{isServer:!1},t.arkenv,t.getSchemaKeys)}exports.arkenv=n,exports.default=n;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["arkenvInternal","coreArkenv","getSchemaKeys"],"sources":["../../src/standard/index.ts"],"sourcesContent":["import { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/standard\";\nimport type { StandardSchemaV1 } from \"@repo/types\";\nimport { arkenvInternal } from \"@/arkenv-internal\";\nimport type { MergeExtends } from \"../types\";\n\ntype ClientVisibleKeys<\n\tTSchema extends Record<string, StandardSchemaV1>,\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,
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["arkenvInternal","coreArkenv","getSchemaKeys"],"sources":["../../src/standard/index.ts"],"sourcesContent":["import { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/standard\";\nimport type { StandardSchemaV1 } from \"@repo/types\";\nimport { arkenvInternal } from \"@/arkenv-internal\";\nimport type { MergeExtends } from \"../types\";\n\ntype ClientVisibleKeys<\n\tTSchema extends Record<string, StandardSchemaV1>,\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, typesafe environment configuration for Next.js applications in Standard Mode.\n *\n * @param schema A flat schema of environment variable Standard Schema validators\n * @param options Optional configuration including client-side variables and extends\n * @returns A validated, readonly environment variables object wrapped in a security proxy\n */\nexport function arkenv<\n\tconst TSchema extends Record<string, StandardSchemaV1> = {},\n\tconst TExpose extends keyof TSchema = never,\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: TSchema,\n\toptions?: {\n\t\texposeToClient?: readonly TExpose[];\n\t\texpose?: readonly TExpose[];\n\t\tshared?: readonly TExpose[];\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Record<string, unknown>;\n\t},\n): Readonly<\n\tPick<\n\t\t{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> },\n\t\tExtract<keyof TSchema, ClientVisibleKeys<TSchema, TExpose>>\n\t> &\n\t\tMergeExtends<TExtends>\n>;\n\n/**\n * Create a validated, typesafe environment configuration for Next.js applications in Standard Mode.\n *\n * @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`\n * @param options The environment validation configuration options\n * @returns A validated, readonly environment variables object wrapped in a security proxy\n */\nexport function arkenv<\n\tconst TServer extends Record<string, StandardSchemaV1> = {},\n\tconst TClient extends Record<string, StandardSchemaV1> = {},\n\tconst TShared extends Record<string, StandardSchemaV1> = {},\n>(options: {\n\tserver?: TServer;\n\tclient?: TClient & {\n\t\t[K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never;\n\t};\n\tshared?: TShared;\n\truntimeEnv: Record<keyof TClient | keyof TShared, unknown> &\n\t\tRecord<string, unknown>;\n}): Readonly<{\n\t[K in keyof (TServer & TClient & TShared)]: StandardSchemaV1.InferOutput<\n\t\t(TServer & 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\"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 default arkenv;\n"],"mappings":"sNAuEA,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,GAAO,CACnBC,EAAAA,OACAC,EAAAA,cACA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { r as StandardSchemaV1 } from "../index-
|
|
2
|
-
import { t as MergeExtends } from "../types-
|
|
1
|
+
import { r as StandardSchemaV1 } from "../index-BS1wAitS.cjs";
|
|
2
|
+
import { t as MergeExtends } from "../types-BlRHnQwj.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/standard/index.d.ts
|
|
5
5
|
type ClientVisibleKeys<TSchema extends Record<string, StandardSchemaV1>, 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];
|
|
6
6
|
/**
|
|
7
|
-
* Create a validated,
|
|
7
|
+
* Create a validated, typesafe environment configuration for Next.js applications in Standard Mode.
|
|
8
8
|
*
|
|
9
9
|
* @param schema A flat schema of environment variable Standard Schema validators
|
|
10
10
|
* @param options Optional configuration including client-side variables and extends
|
|
@@ -18,7 +18,7 @@ declare function arkenv<const TSchema extends Record<string, StandardSchemaV1> =
|
|
|
18
18
|
runtimeEnv?: Record<string, unknown>;
|
|
19
19
|
}): Readonly<Pick<{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> }, Extract<keyof TSchema, ClientVisibleKeys<TSchema, TExpose>>> & MergeExtends<TExtends>>;
|
|
20
20
|
/**
|
|
21
|
-
* Create a validated,
|
|
21
|
+
* Create a validated, typesafe environment configuration for Next.js applications in Standard Mode.
|
|
22
22
|
*
|
|
23
23
|
* @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`
|
|
24
24
|
* @param options The environment validation configuration options
|
package/dist/standard/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { r as StandardSchemaV1 } from "../index-
|
|
2
|
-
import { t as MergeExtends } from "../types-
|
|
1
|
+
import { r as StandardSchemaV1 } from "../index-Cq_qJ68V.js";
|
|
2
|
+
import { t as MergeExtends } from "../types-BfMBbrMm.js";
|
|
3
3
|
|
|
4
4
|
//#region src/standard/index.d.ts
|
|
5
5
|
type ClientVisibleKeys<TSchema extends Record<string, StandardSchemaV1>, 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];
|
|
6
6
|
/**
|
|
7
|
-
* Create a validated,
|
|
7
|
+
* Create a validated, typesafe environment configuration for Next.js applications in Standard Mode.
|
|
8
8
|
*
|
|
9
9
|
* @param schema A flat schema of environment variable Standard Schema validators
|
|
10
10
|
* @param options Optional configuration including client-side variables and extends
|
|
@@ -18,7 +18,7 @@ declare function arkenv<const TSchema extends Record<string, StandardSchemaV1> =
|
|
|
18
18
|
runtimeEnv?: Record<string, unknown>;
|
|
19
19
|
}): Readonly<Pick<{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> }, Extract<keyof TSchema, ClientVisibleKeys<TSchema, TExpose>>> & MergeExtends<TExtends>>;
|
|
20
20
|
/**
|
|
21
|
-
* Create a validated,
|
|
21
|
+
* Create a validated, typesafe environment configuration for Next.js applications in Standard Mode.
|
|
22
22
|
*
|
|
23
23
|
* @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`
|
|
24
24
|
* @param options The environment validation configuration options
|
package/dist/standard/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"../arkenv-internal-
|
|
1
|
+
import{t as e}from"../arkenv-internal-Ws3srax6.js";import{arkenv as t,getSchemaKeys as n}from"@arkenv/standard";function r(r,i){return r&&typeof r==`object`&&(`runtimeEnv`in r||`server`in r||`client`in r||`shared`in r)?e(r,!1,void 0,t,n):e(r,i,{isServer:!1},t,n)}export{r as arkenv,r as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["coreArkenv"],"sources":["../../src/standard/index.ts"],"sourcesContent":["import { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/standard\";\nimport type { StandardSchemaV1 } from \"@repo/types\";\nimport { arkenvInternal } from \"@/arkenv-internal\";\nimport type { MergeExtends } from \"../types\";\n\ntype ClientVisibleKeys<\n\tTSchema extends Record<string, StandardSchemaV1>,\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,
|
|
1
|
+
{"version":3,"file":"index.js","names":["coreArkenv"],"sources":["../../src/standard/index.ts"],"sourcesContent":["import { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/standard\";\nimport type { StandardSchemaV1 } from \"@repo/types\";\nimport { arkenvInternal } from \"@/arkenv-internal\";\nimport type { MergeExtends } from \"../types\";\n\ntype ClientVisibleKeys<\n\tTSchema extends Record<string, StandardSchemaV1>,\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, typesafe environment configuration for Next.js applications in Standard Mode.\n *\n * @param schema A flat schema of environment variable Standard Schema validators\n * @param options Optional configuration including client-side variables and extends\n * @returns A validated, readonly environment variables object wrapped in a security proxy\n */\nexport function arkenv<\n\tconst TSchema extends Record<string, StandardSchemaV1> = {},\n\tconst TExpose extends keyof TSchema = never,\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: TSchema,\n\toptions?: {\n\t\texposeToClient?: readonly TExpose[];\n\t\texpose?: readonly TExpose[];\n\t\tshared?: readonly TExpose[];\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Record<string, unknown>;\n\t},\n): Readonly<\n\tPick<\n\t\t{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> },\n\t\tExtract<keyof TSchema, ClientVisibleKeys<TSchema, TExpose>>\n\t> &\n\t\tMergeExtends<TExtends>\n>;\n\n/**\n * Create a validated, typesafe environment configuration for Next.js applications in Standard Mode.\n *\n * @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`\n * @param options The environment validation configuration options\n * @returns A validated, readonly environment variables object wrapped in a security proxy\n */\nexport function arkenv<\n\tconst TServer extends Record<string, StandardSchemaV1> = {},\n\tconst TClient extends Record<string, StandardSchemaV1> = {},\n\tconst TShared extends Record<string, StandardSchemaV1> = {},\n>(options: {\n\tserver?: TServer;\n\tclient?: TClient & {\n\t\t[K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never;\n\t};\n\tshared?: TShared;\n\truntimeEnv: Record<keyof TClient | keyof TShared, unknown> &\n\t\tRecord<string, unknown>;\n}): Readonly<{\n\t[K in keyof (TServer & TClient & TShared)]: StandardSchemaV1.InferOutput<\n\t\t(TServer & 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\"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 default arkenv;\n"],"mappings":"gHAuEA,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"}
|
package/dist/standard/server.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../config-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../config-Oq8dsEPM.cjs`);const e=require(`../arkenv-internal-QxkUlA5J.cjs`),t=require(`../strict-client-env-MouPnkRr.cjs`),n=require(`../auto-extend-CYzZnEvT.cjs`);require(`server-only`);let r=require(`#arkenv/client-env`),i=require(`@arkenv/standard`);function a(a,o){if(a&&typeof a==`object`&&(`runtimeEnv`in a||`server`in a||`shared`in a)){if(`client`in a)throw Error(`server entry point only accepts 'server' and 'shared' schemas.`);return e.t(a,!0,void 0,i.arkenv,i.getSchemaKeys)}return e.t(a,n.t(o,()=>t.i(r.env)),{isServer:!0,strictLayout:`server`},i.arkenv,i.getSchemaKeys)}exports.arkenv=a,exports.default=a;
|
|
2
2
|
//# sourceMappingURL=server.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.cjs","names":["arkenvInternal","coreArkenv","getSchemaKeys"],"sources":["../../src/standard/server.ts"],"sourcesContent":["import \"server-only\";\nimport { 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,
|
|
1
|
+
{"version":3,"file":"server.cjs","names":["arkenvInternal","coreArkenv","getSchemaKeys","withAutoExtend","resolveStrictClientEnv","importedClientEnv"],"sources":["../../src/standard/server.ts"],"sourcesContent":["import \"server-only\";\nimport { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/standard\";\nimport type { Dict, StandardSchemaV1 } from \"@repo/types\";\n// Static import so webpack/Turbopack can resolve the alias at bundle time.\n// Outside strict layout the package `imports` map points this at empty-client-env.\nimport { env as importedClientEnv } from \"#arkenv/client-env\";\nimport { arkenvInternal } from \"@/arkenv-internal\";\nimport { withAutoExtend } from \"@/auto-extend\";\nimport { resolveStrictClientEnv } from \"@/strict-client-env\";\nimport type { MergeExtends } from \"@/types\";\n\n/**\n * Client env type auto-merged in Next.js strict layout when `extends` is omitted.\n */\ntype AutoClientEnv = typeof import(\"#arkenv/client-env\") extends {\n\tenv: infer E;\n}\n\t? E\n\t: {};\n\n/**\n * Create a validated, typesafe environment configuration for Next.js applications (Server entry point, Standard Mode).\n *\n * With `withArkEnv` in strict layout, omitting `extends` includes the client\n * env by default. Any explicit `extends` is used as-is and opts out of that\n * default; pass `extends: []` to include no extended env.\n */\nexport function arkenv<\n\tconst TSchema extends Record<string, StandardSchemaV1> = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: TSchema,\n\toptions: {\n\t\t/**\n\t\t * Explicit envs to extend. Providing this option opts out of the default\n\t\t * strict-layout client merge; use `[]` to include no extended env.\n\t\t */\n\t\textends: [...TExtends];\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<\n\t{\n\t\t[K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]>;\n\t} & MergeExtends<TExtends>\n>;\n\nexport function arkenv<\n\tconst TSchema extends Record<string, StandardSchemaV1> = {},\n>(\n\tschema: TSchema,\n\toptions?: {\n\t\textends?: undefined;\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<\n\t{\n\t\t[K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]>;\n\t} & AutoClientEnv\n>;\n\nexport function arkenv<\n\tconst TServer extends Record<string, StandardSchemaV1> = {},\n\tconst TShared extends Record<string, StandardSchemaV1> = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(options: {\n\tserver?: TServer;\n\tshared?: TShared;\n\textends?: [...TExtends];\n\truntimeEnv?: Record<keyof TShared, string | undefined> & Dict<string>;\n}): Readonly<\n\t{\n\t\t[K in keyof (TServer & TShared)]: StandardSchemaV1.InferOutput<\n\t\t\t(TServer & TShared)[K]\n\t\t>;\n\t} & 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\twithAutoExtend(optionsOrIsServer, () =>\n\t\t\tresolveStrictClientEnv(importedClientEnv),\n\t\t),\n\t\t{ isServer: true, strictLayout: \"server\" },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport default arkenv;\n"],"mappings":"qWA6EA,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,EACAG,EAAAA,EAAe,MACdC,EAAAA,EAAuBC,EAAAA,IAAkB,CACzC,CACD,CAAE,SAAU,GAAM,aAAc,SAAU,CAC1CJ,EAAAA,OACAC,EAAAA,cACA"}
|
|
@@ -1,18 +1,38 @@
|
|
|
1
|
-
import { i as Dict, r as StandardSchemaV1 } from "../index-
|
|
1
|
+
import { i as Dict, r as StandardSchemaV1 } from "../index-BS1wAitS.cjs";
|
|
2
|
+
import { t as MergeExtends } from "../types-BlRHnQwj.cjs";
|
|
3
|
+
import * as _$_arkenv_client_env0 from "#arkenv/client-env";
|
|
2
4
|
//#region src/standard/server.d.ts
|
|
3
5
|
/**
|
|
4
|
-
*
|
|
6
|
+
* Client env type auto-merged in Next.js strict layout when `extends` is omitted.
|
|
5
7
|
*/
|
|
8
|
+
type AutoClientEnv = typeof _$_arkenv_client_env0 extends {
|
|
9
|
+
env: infer E;
|
|
10
|
+
} ? E : {};
|
|
11
|
+
/**
|
|
12
|
+
* Create a validated, typesafe environment configuration for Next.js applications (Server entry point, Standard Mode).
|
|
13
|
+
*
|
|
14
|
+
* With `withArkEnv` in strict layout, omitting `extends` includes the client
|
|
15
|
+
* env by default. Any explicit `extends` is used as-is and opts out of that
|
|
16
|
+
* default; pass `extends: []` to include no extended env.
|
|
17
|
+
*/
|
|
18
|
+
declare function arkenv<const TSchema extends Record<string, StandardSchemaV1> = {}, const TExtends extends readonly unknown[] = []>(schema: TSchema, options: {
|
|
19
|
+
/**
|
|
20
|
+
* Explicit envs to extend. Providing this option opts out of the default
|
|
21
|
+
* strict-layout client merge; use `[]` to include no extended env.
|
|
22
|
+
*/
|
|
23
|
+
extends: [...TExtends];
|
|
24
|
+
runtimeEnv?: Dict<string>;
|
|
25
|
+
}): Readonly<{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> } & MergeExtends<TExtends>>;
|
|
6
26
|
declare function arkenv<const TSchema extends Record<string, StandardSchemaV1> = {}>(schema: TSchema, options?: {
|
|
7
|
-
extends?:
|
|
27
|
+
extends?: undefined;
|
|
8
28
|
runtimeEnv?: Dict<string>;
|
|
9
|
-
}): Readonly<{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> }>;
|
|
10
|
-
declare function arkenv<const TServer extends Record<string, StandardSchemaV1> = {}, const TShared extends Record<string, StandardSchemaV1> = {}>(options: {
|
|
29
|
+
}): Readonly<{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> } & AutoClientEnv>;
|
|
30
|
+
declare function arkenv<const TServer extends Record<string, StandardSchemaV1> = {}, const TShared extends Record<string, StandardSchemaV1> = {}, const TExtends extends readonly unknown[] = []>(options: {
|
|
11
31
|
server?: TServer;
|
|
12
32
|
shared?: TShared;
|
|
13
|
-
extends?:
|
|
33
|
+
extends?: [...TExtends];
|
|
14
34
|
runtimeEnv?: Record<keyof TShared, string | undefined> & Dict<string>;
|
|
15
|
-
}): Readonly<{ [K in keyof (TServer & TShared)]: StandardSchemaV1.InferOutput<(TServer & TShared)[K]> }
|
|
35
|
+
}): Readonly<{ [K in keyof (TServer & TShared)]: StandardSchemaV1.InferOutput<(TServer & TShared)[K]> } & MergeExtends<TExtends>>;
|
|
16
36
|
//#endregion
|
|
17
37
|
export { arkenv, arkenv as default };
|
|
18
38
|
//# sourceMappingURL=server.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.cts","names":[],"sources":["../../src/standard/server.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"server.d.cts","names":[],"sources":["../../src/standard/server.ts"],"mappings":";;;;;;;KAcK,aAAA,UAAa,qBAAA;EACjB,GAAA;AAAA,IAEE,CAAA;;;;;;;;iBAUa,MAAA,uBACO,MAAA,SAAe,gBAAA,uDAAA,CAGrC,MAAA,EAAQ,OAAA,EACR,OAAA;EALqB;;;;EAUpB,OAAA,MAAa,QAAA;EACb,UAAA,GAAa,IAAA;AAAA,IAEZ,QAAA,eAEW,OAAA,GAAU,gBAAA,CAAiB,WAAA,CAAY,OAAA,CAAQ,CAAA,OACxD,YAAA,CAAa,QAAA;AAAA,iBAGF,MAAA,uBACO,MAAA,SAAe,gBAAA,OAAA,CAErC,MAAA,EAAQ,OAAA,EACR,OAAA;EACC,OAAA;EACA,UAAA,GAAa,IAAA;AAAA,IAEZ,QAAA,eAEW,OAAA,GAAU,gBAAA,CAAiB,WAAA,CAAY,OAAA,CAAQ,CAAA,OACxD,aAAA;AAAA,iBAGW,MAAA,uBACO,MAAA,SAAe,gBAAA,8BACf,MAAA,SAAe,gBAAA,uDAAA,CAEpC,OAAA;EACD,MAAA,GAAS,OAAA;EACT,MAAA,GAAS,OAAA;EACT,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA,OAAa,OAAA,wBAA+B,IAAA;AAAA,IACtD,QAAA,gBAEW,OAAA,GAAU,OAAA,IAAW,gBAAA,CAAiB,WAAA,EACjD,OAAA,GAAU,OAAA,EAAS,CAAA,OAElB,YAAA,CAAa,QAAA"}
|