@arkenv/nextjs 1.0.0-alpha.10 → 1.0.0-alpha.11
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 +1 -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 +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config-Bnir9dSk.js +97 -0
- package/dist/config-Bnir9dSk.js.map +1 -0
- package/dist/config-CU-9fwxw.cjs +97 -0
- package/dist/config-CU-9fwxw.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-CNzwVE5N.d.cts → index-CL9MPCBA.d.cts} +24 -10
- package/dist/index-CL9MPCBA.d.cts.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-BFQlm61W.d.ts → index-DLwzgCyF.d.ts} +24 -10
- package/dist/index-DLwzgCyF.d.ts.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-D-MYC2Uf.cjs → script-BBfmzIh4.cjs} +2 -2
- package/dist/{script-D-MYC2Uf.cjs.map → script-BBfmzIh4.cjs.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/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.d.cts +1 -1
- package/dist/standard/config.d.ts +1 -1
- package/dist/standard/config.js +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
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-CU-9fwxw.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-CU-9fwxw.cjs`);function t(t,n){return e.n(t,{...n,standard:!0})}exports.withArkEnv=t;
|
|
2
2
|
//# sourceMappingURL=config.cjs.map
|
package/dist/standard/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"../config-
|
|
1
|
+
import{i as e}from"../config-Bnir9dSk.js";function t(t,n){return e(t,{...n,standard:!0})}export{t as withArkEnv};
|
|
2
2
|
//# sourceMappingURL=config.js.map
|
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-CU-9fwxw.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-CU-9fwxw.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"}
|
|
@@ -1,18 +1,39 @@
|
|
|
1
|
-
import { i as Dict, r as StandardSchemaV1 } from "../index-
|
|
1
|
+
import { i as Dict, r as StandardSchemaV1 } from "../index-Cq_qJ68V.js";
|
|
2
|
+
import { t as MergeExtends } from "../types-BfMBbrMm.js";
|
|
3
|
+
import * as _$_arkenv_client_env0 from "#arkenv/client-env";
|
|
4
|
+
|
|
2
5
|
//#region src/standard/server.d.ts
|
|
3
6
|
/**
|
|
4
|
-
*
|
|
7
|
+
* Client env type auto-merged in Next.js strict layout when `extends` is omitted.
|
|
5
8
|
*/
|
|
9
|
+
type AutoClientEnv = typeof _$_arkenv_client_env0 extends {
|
|
10
|
+
env: infer E;
|
|
11
|
+
} ? E : {};
|
|
12
|
+
/**
|
|
13
|
+
* Create a validated, typesafe environment configuration for Next.js applications (Server entry point, Standard Mode).
|
|
14
|
+
*
|
|
15
|
+
* With `withArkEnv` in strict layout, omitting `extends` includes the client
|
|
16
|
+
* env by default. Any explicit `extends` is used as-is and opts out of that
|
|
17
|
+
* default; pass `extends: []` to include no extended env.
|
|
18
|
+
*/
|
|
19
|
+
declare function arkenv<const TSchema extends Record<string, StandardSchemaV1> = {}, const TExtends extends readonly unknown[] = []>(schema: TSchema, options: {
|
|
20
|
+
/**
|
|
21
|
+
* Explicit envs to extend. Providing this option opts out of the default
|
|
22
|
+
* strict-layout client merge; use `[]` to include no extended env.
|
|
23
|
+
*/
|
|
24
|
+
extends: [...TExtends];
|
|
25
|
+
runtimeEnv?: Dict<string>;
|
|
26
|
+
}): Readonly<{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> } & MergeExtends<TExtends>>;
|
|
6
27
|
declare function arkenv<const TSchema extends Record<string, StandardSchemaV1> = {}>(schema: TSchema, options?: {
|
|
7
|
-
extends?:
|
|
28
|
+
extends?: undefined;
|
|
8
29
|
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: {
|
|
30
|
+
}): Readonly<{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> } & AutoClientEnv>;
|
|
31
|
+
declare function arkenv<const TServer extends Record<string, StandardSchemaV1> = {}, const TShared extends Record<string, StandardSchemaV1> = {}, const TExtends extends readonly unknown[] = []>(options: {
|
|
11
32
|
server?: TServer;
|
|
12
33
|
shared?: TShared;
|
|
13
|
-
extends?:
|
|
34
|
+
extends?: [...TExtends];
|
|
14
35
|
runtimeEnv?: Record<keyof TShared, string | undefined> & Dict<string>;
|
|
15
|
-
}): Readonly<{ [K in keyof (TServer & TShared)]: StandardSchemaV1.InferOutput<(TServer & TShared)[K]> }
|
|
36
|
+
}): Readonly<{ [K in keyof (TServer & TShared)]: StandardSchemaV1.InferOutput<(TServer & TShared)[K]> } & MergeExtends<TExtends>>;
|
|
16
37
|
//#endregion
|
|
17
38
|
export { arkenv, arkenv as default };
|
|
18
39
|
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","names":[],"sources":["../../src/standard/server.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"server.d.ts","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"}
|
package/dist/standard/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"server-only";import{env as r}from"#arkenv/client-env";import{arkenv as i,getSchemaKeys as a}from"@arkenv/standard";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,i,a)}return e(o,n(s,()=>t(r)),{isServer:!0,strictLayout:`server`},i,a)}export{o as arkenv,o as default};
|
|
2
2
|
//# sourceMappingURL=server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","names":["coreArkenv"],"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.js","names":["coreArkenv","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":"iRA6EA,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/shared.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-CU-9fwxw.cjs`);const e=require(`../arkenv-internal-QxkUlA5J.cjs`);let t=require(`@arkenv/standard`);function n(n,r){return e.t(n,r,{isServer:typeof window>`u`,isShared:!0},t.arkenv,t.getSchemaKeys)}exports.arkenv=n,exports.default=n;
|
|
2
2
|
//# sourceMappingURL=shared.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.cjs","names":["arkenvInternal","coreArkenv","getSchemaKeys"],"sources":["../../src/standard/shared.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":"shared.cjs","names":["arkenvInternal","coreArkenv","getSchemaKeys"],"sources":["../../src/standard/shared.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 (Shared entry point, Standard Mode).\n */\nexport function arkenv<\n\tconst TSchema extends Record<string, StandardSchemaV1> = {},\n>(\n\tschema: TSchema,\n\toptions?: {\n\t\textends?: readonly unknown[];\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<{\n\t[K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]>;\n}> {\n\tconst isServer = typeof window === \"undefined\";\n\treturn arkenvInternal(\n\t\tschema,\n\t\toptions,\n\t\t{\n\t\t\tisServer,\n\t\t\tisShared: true,\n\t\t},\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t) as any;\n}\n\nexport default arkenv;\n"],"mappings":"sNAOA,SAAgB,EAGf,EACA,EAME,CAEF,OAAOA,EAAAA,EACN,EACA,EACA,CACC,SALe,OAAO,OAAW,IAMjC,SAAU,GACV,CACDC,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/shared.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* Create a validated,
|
|
5
|
+
* Create a validated, typesafe environment configuration for Next.js applications (Shared entry point, Standard Mode).
|
|
6
6
|
*/
|
|
7
7
|
declare function arkenv<const TSchema extends Record<string, StandardSchemaV1> = {}>(schema: TSchema, options?: {
|
|
8
8
|
extends?: readonly unknown[];
|
|
@@ -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/shared.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* Create a validated,
|
|
5
|
+
* Create a validated, typesafe environment configuration for Next.js applications (Shared entry point, Standard Mode).
|
|
6
6
|
*/
|
|
7
7
|
declare function arkenv<const TSchema extends Record<string, StandardSchemaV1> = {}>(schema: TSchema, options?: {
|
|
8
8
|
extends?: readonly unknown[];
|
package/dist/standard/shared.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 e(r,i,{isServer:typeof window>`u`,isShared:!0},t,n)}export{r as arkenv,r as default};
|
|
2
2
|
//# sourceMappingURL=shared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","names":["coreArkenv"],"sources":["../../src/standard/shared.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":"shared.js","names":["coreArkenv"],"sources":["../../src/standard/shared.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 (Shared entry point, Standard Mode).\n */\nexport function arkenv<\n\tconst TSchema extends Record<string, StandardSchemaV1> = {},\n>(\n\tschema: TSchema,\n\toptions?: {\n\t\textends?: readonly unknown[];\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<{\n\t[K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]>;\n}> {\n\tconst isServer = typeof window === \"undefined\";\n\treturn arkenvInternal(\n\t\tschema,\n\t\toptions,\n\t\t{\n\t\t\tisServer,\n\t\t\tisShared: true,\n\t\t},\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t) as any;\n}\n\nexport default arkenv;\n"],"mappings":"gHAOA,SAAgB,EAGf,EACA,EAME,CAEF,OAAO,EACN,EACA,EACA,CACC,SALe,OAAO,OAAW,IAMjC,SAAU,GACV,CACDA,EACA,EACA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{r as e}from"./dist-DimRGXOV.js";const t=`#arkenv/client-env`;function n(){return typeof __ARKENV_STRICT_LAYOUT__<`u`&&__ARKENV_STRICT_LAYOUT__||globalThis.__ARKENV_STRICT_LAYOUT__===!0?!0:process.env.ARKENV_STRICT_LAYOUT===`true`}function r(e){let t=globalThis.__ARKENV_CLIENT_ENV__;if(t!==void 0)return t;if(e!=null)return e;throw Error(`[arkenv] Could not resolve #arkenv/client-env.
|
|
2
|
+
Ensure withArkEnv is registered in next.config and env/client.ts exists,
|
|
3
|
+
or pass extends: [clientEnv] explicitly.`)}function i(t,n){return e(`Strict layout requires "client.ts" but it was not found at "${t}".\nExpected strict layout structure under "${n}":\n ├── internal/shared.ts
|
|
4
|
+
├── client.ts
|
|
5
|
+
└── server.ts`)}export{r as i,n,i as r,t};
|
|
6
|
+
//# sourceMappingURL=strict-client-env-CHDTZoLe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strict-client-env-CHDTZoLe.js","names":["formatBuildError"],"sources":["../src/strict-client-env.ts"],"sourcesContent":["import { formatBuildError } from \"@repo/log\";\n\nexport const CLIENT_ENV_SPECIFIER = \"#arkenv/client-env\";\n\nexport const UNRESOLVED_CLIENT_ENV_ERROR =\n\t\"[arkenv] Could not resolve #arkenv/client-env.\\n\" +\n\t\"Ensure withArkEnv is registered in next.config and env/client.ts exists,\\n\" +\n\t\"or pass extends: [clientEnv] explicitly.\";\n\ndeclare const __ARKENV_STRICT_LAYOUT__: boolean | undefined;\n\ntype GlobalStrictState = {\n\t__ARKENV_STRICT_LAYOUT__?: boolean;\n\t__ARKENV_CLIENT_ENV__?: unknown;\n};\n\n/**\n * Report whether Next.js strict layout auto-extend is active.\n *\n * Prefers the bundler `define` flag when present; falls back to the\n * `globalThis` marker set during Jiti build-time validation, then to\n * `process.env.ARKENV_STRICT_LAYOUT` injected via `nextConfig.env`\n * (Turbopack and other non-DefinePlugin paths).\n *\n * @returns `true` when strict-layout auto-extend should run\n */\nexport function isStrictLayoutActive(): boolean {\n\tif (\n\t\ttypeof __ARKENV_STRICT_LAYOUT__ !== \"undefined\" &&\n\t\t__ARKENV_STRICT_LAYOUT__\n\t) {\n\t\treturn true;\n\t}\n\tif ((globalThis as GlobalStrictState).__ARKENV_STRICT_LAYOUT__ === true) {\n\t\treturn true;\n\t}\n\treturn process.env.ARKENV_STRICT_LAYOUT === \"true\";\n}\n\n/**\n * Resolve the auto-extend client env for strict layout.\n *\n * Prefers the Jiti validation injection on `globalThis`, then falls back to\n * the statically imported `#arkenv/client-env` module (aliased by `withArkEnv`).\n * Never uses `node:module` / `createRequire`.\n *\n * @param importedClientEnv The `env` export from `#arkenv/client-env`\n * @returns The client env object to pass through `extends`\n * @throws An arkenv-specific error when no client env is available in strict mode\n */\nexport function resolveStrictClientEnv(importedClientEnv: unknown): unknown {\n\tconst injected = (globalThis as GlobalStrictState).__ARKENV_CLIENT_ENV__;\n\tif (injected !== undefined) {\n\t\treturn injected;\n\t}\n\n\tif (importedClientEnv !== undefined && importedClientEnv !== null) {\n\t\treturn importedClientEnv;\n\t}\n\n\tthrow new Error(UNRESOLVED_CLIENT_ENV_ERROR);\n}\n\n/**\n * Build the fail-fast error for a missing strict-layout `client.ts`.\n *\n * @param clientPath The absolute path where `client.ts` was expected\n * @param baseDir The strict layout base directory\n * @returns A formatted ArkEnv build error message\n */\nexport function missingClientTsError(\n\tclientPath: string,\n\tbaseDir: string,\n): string {\n\treturn formatBuildError(\n\t\t`Strict layout requires \"client.ts\" but it was not found at \"${clientPath}\".\\n` +\n\t\t\t`Expected strict layout structure under \"${baseDir}\":\\n` +\n\t\t\t\" ├── internal/shared.ts\\n\" +\n\t\t\t\" ├── client.ts\\n\" +\n\t\t\t\" └── server.ts\",\n\t);\n}\n"],"mappings":"uCAEA,MAAa,EAAuB,qBAwBpC,SAAgB,GAAgC,CAU/C,OARC,OAAO,yBAA6B,KACpC,0BAII,WAAiC,2BAA6B,GAC3D,GAED,QAAQ,IAAI,uBAAyB,OAc7C,SAAgB,EAAuB,EAAqC,CAC3E,IAAM,EAAY,WAAiC,sBACnD,GAAI,IAAa,IAAA,GAChB,OAAO,EAGR,GAAI,GAAyD,KAC5D,OAAO,EAGR,MAAU,MAAM;;0CAA4B,CAU7C,SAAgB,EACf,EACA,EACS,CACT,OAAOA,EACN,+DAA+D,EAAW,8CAC9B,EAAQ;;iBAIpD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const e=require(`./dist-Bof1Std7.cjs`);function t(){return typeof __ARKENV_STRICT_LAYOUT__<`u`&&__ARKENV_STRICT_LAYOUT__||globalThis.__ARKENV_STRICT_LAYOUT__===!0?!0:process.env.ARKENV_STRICT_LAYOUT===`true`}function n(e){let t=globalThis.__ARKENV_CLIENT_ENV__;if(t!==void 0)return t;if(e!=null)return e;throw Error(`[arkenv] Could not resolve #arkenv/client-env.
|
|
2
|
+
Ensure withArkEnv is registered in next.config and env/client.ts exists,
|
|
3
|
+
or pass extends: [clientEnv] explicitly.`)}function r(t,n){return e.r(`Strict layout requires "client.ts" but it was not found at "${t}".\nExpected strict layout structure under "${n}":\n ├── internal/shared.ts
|
|
4
|
+
├── client.ts
|
|
5
|
+
└── server.ts`)}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return`#arkenv/client-env`}});
|
|
6
|
+
//# sourceMappingURL=strict-client-env-MouPnkRr.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strict-client-env-MouPnkRr.cjs","names":["formatBuildError"],"sources":["../src/strict-client-env.ts"],"sourcesContent":["import { formatBuildError } from \"@repo/log\";\n\nexport const CLIENT_ENV_SPECIFIER = \"#arkenv/client-env\";\n\nexport const UNRESOLVED_CLIENT_ENV_ERROR =\n\t\"[arkenv] Could not resolve #arkenv/client-env.\\n\" +\n\t\"Ensure withArkEnv is registered in next.config and env/client.ts exists,\\n\" +\n\t\"or pass extends: [clientEnv] explicitly.\";\n\ndeclare const __ARKENV_STRICT_LAYOUT__: boolean | undefined;\n\ntype GlobalStrictState = {\n\t__ARKENV_STRICT_LAYOUT__?: boolean;\n\t__ARKENV_CLIENT_ENV__?: unknown;\n};\n\n/**\n * Report whether Next.js strict layout auto-extend is active.\n *\n * Prefers the bundler `define` flag when present; falls back to the\n * `globalThis` marker set during Jiti build-time validation, then to\n * `process.env.ARKENV_STRICT_LAYOUT` injected via `nextConfig.env`\n * (Turbopack and other non-DefinePlugin paths).\n *\n * @returns `true` when strict-layout auto-extend should run\n */\nexport function isStrictLayoutActive(): boolean {\n\tif (\n\t\ttypeof __ARKENV_STRICT_LAYOUT__ !== \"undefined\" &&\n\t\t__ARKENV_STRICT_LAYOUT__\n\t) {\n\t\treturn true;\n\t}\n\tif ((globalThis as GlobalStrictState).__ARKENV_STRICT_LAYOUT__ === true) {\n\t\treturn true;\n\t}\n\treturn process.env.ARKENV_STRICT_LAYOUT === \"true\";\n}\n\n/**\n * Resolve the auto-extend client env for strict layout.\n *\n * Prefers the Jiti validation injection on `globalThis`, then falls back to\n * the statically imported `#arkenv/client-env` module (aliased by `withArkEnv`).\n * Never uses `node:module` / `createRequire`.\n *\n * @param importedClientEnv The `env` export from `#arkenv/client-env`\n * @returns The client env object to pass through `extends`\n * @throws An arkenv-specific error when no client env is available in strict mode\n */\nexport function resolveStrictClientEnv(importedClientEnv: unknown): unknown {\n\tconst injected = (globalThis as GlobalStrictState).__ARKENV_CLIENT_ENV__;\n\tif (injected !== undefined) {\n\t\treturn injected;\n\t}\n\n\tif (importedClientEnv !== undefined && importedClientEnv !== null) {\n\t\treturn importedClientEnv;\n\t}\n\n\tthrow new Error(UNRESOLVED_CLIENT_ENV_ERROR);\n}\n\n/**\n * Build the fail-fast error for a missing strict-layout `client.ts`.\n *\n * @param clientPath The absolute path where `client.ts` was expected\n * @param baseDir The strict layout base directory\n * @returns A formatted ArkEnv build error message\n */\nexport function missingClientTsError(\n\tclientPath: string,\n\tbaseDir: string,\n): string {\n\treturn formatBuildError(\n\t\t`Strict layout requires \"client.ts\" but it was not found at \"${clientPath}\".\\n` +\n\t\t\t`Expected strict layout structure under \"${baseDir}\":\\n` +\n\t\t\t\" ├── internal/shared.ts\\n\" +\n\t\t\t\" ├── client.ts\\n\" +\n\t\t\t\" └── server.ts\",\n\t);\n}\n"],"mappings":"uCA0BA,SAAgB,GAAgC,CAU/C,OARC,OAAO,yBAA6B,KACpC,0BAII,WAAiC,2BAA6B,GAC3D,GAED,QAAQ,IAAI,uBAAyB,OAc7C,SAAgB,EAAuB,EAAqC,CAC3E,IAAM,EAAY,WAAiC,sBACnD,GAAI,IAAa,IAAA,GAChB,OAAO,EAGR,GAAI,GAAyD,KAC5D,OAAO,EAGR,MAAU,MAAM;;0CAA4B,CAU7C,SAAgB,EACf,EACA,EACS,CACT,OAAOA,EAAAA,EACN,+DAA+D,EAAW,8CAC9B,EAAQ;;iBAIpD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as InferType } from "./index-
|
|
1
|
+
import { n as InferType } from "./index-Cq_qJ68V.js";
|
|
2
2
|
|
|
3
3
|
//#region src/types.d.ts
|
|
4
4
|
/**
|
|
@@ -9,4 +9,4 @@ type ResolveExtendsElement<T> = [InferType<T>] extends [never] ? T : InferType<T
|
|
|
9
9
|
type MergeExtends<TExtends extends readonly unknown[] | undefined> = TExtends extends readonly unknown[] ? UnionToIntersection<ResolveExtendsElement<TExtends[number]>> : {};
|
|
10
10
|
//#endregion
|
|
11
11
|
export { MergeExtends as t };
|
|
12
|
-
//# sourceMappingURL=types-
|
|
12
|
+
//# sourceMappingURL=types-BfMBbrMm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-BfMBbrMm.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;AAMA;KAAY,mBAAA,OACX,CAAA,gBACI,CAAA,EAAG,CAAA,6BAEG,CAAA,sBACR,CAAA;AAAA,KAGS,qBAAA,OAA4B,SAAA,CAAU,CAAA,qBAC/C,CAAA,GACA,SAAA,CAAU,CAAA;AAAA,KAED,YAAA,oDACX,QAAA,8BACG,mBAAA,CAAoB,qBAAA,CAAsB,QAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as InferType } from "./index-
|
|
1
|
+
import { n as InferType } from "./index-BS1wAitS.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/types.d.ts
|
|
4
4
|
/**
|
|
@@ -9,4 +9,4 @@ type ResolveExtendsElement<T> = [InferType<T>] extends [never] ? T : InferType<T
|
|
|
9
9
|
type MergeExtends<TExtends extends readonly unknown[] | undefined> = TExtends extends readonly unknown[] ? UnionToIntersection<ResolveExtendsElement<TExtends[number]>> : {};
|
|
10
10
|
//#endregion
|
|
11
11
|
export { MergeExtends as t };
|
|
12
|
-
//# sourceMappingURL=types-
|
|
12
|
+
//# sourceMappingURL=types-BlRHnQwj.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-BlRHnQwj.d.cts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;AAMA;KAAY,mBAAA,OACX,CAAA,gBACI,CAAA,EAAG,CAAA,6BAEG,CAAA,sBACR,CAAA;AAAA,KAGS,qBAAA,OAA4B,SAAA,CAAU,CAAA,qBAC/C,CAAA,GACA,SAAA,CAAU,CAAA;AAAA,KAED,YAAA,oDACX,QAAA,8BACG,mBAAA,CAAoB,qBAAA,CAAsB,QAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkenv/nextjs",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.11",
|
|
4
4
|
"author": "Yam Borodetsky <yam@yam.codes>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"chokidar": "^4.0.3",
|
|
13
13
|
"jiti": "2.7.0",
|
|
14
14
|
"server-only": "^0.0.1",
|
|
15
|
-
"@arkenv/build": "0.0
|
|
15
|
+
"@arkenv/build": "0.1.0-alpha.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@size-limit/preset-small-lib": "12.1.0",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"tsdown": "0.21.10",
|
|
26
26
|
"typescript": "6.0.3",
|
|
27
27
|
"vitest": "4.1.5",
|
|
28
|
-
"@arkenv/core": "1.0.0-alpha.
|
|
29
|
-
"@arkenv/standard": "1.0.0-alpha.
|
|
28
|
+
"@arkenv/core": "1.0.0-alpha.5",
|
|
29
|
+
"@arkenv/standard": "1.0.0-alpha.5",
|
|
30
30
|
"@repo/log": "0.0.1",
|
|
31
31
|
"@repo/scope": "0.1.3",
|
|
32
32
|
"@repo/types": "0.1.0",
|
|
@@ -126,6 +126,13 @@
|
|
|
126
126
|
"license": "MIT",
|
|
127
127
|
"type": "module",
|
|
128
128
|
"types": "./dist/index.d.ts",
|
|
129
|
+
"imports": {
|
|
130
|
+
"#arkenv/client-env": {
|
|
131
|
+
"types": "./dist/empty-client-env.d.ts",
|
|
132
|
+
"import": "./dist/empty-client-env.js",
|
|
133
|
+
"require": "./dist/empty-client-env.cjs"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
129
136
|
"size-limit": [
|
|
130
137
|
{
|
|
131
138
|
"name": "@arkenv/nextjs",
|
|
@@ -164,7 +171,7 @@
|
|
|
164
171
|
{
|
|
165
172
|
"name": "@arkenv/nextjs/config",
|
|
166
173
|
"path": "dist/config/index.js",
|
|
167
|
-
"limit": "
|
|
174
|
+
"limit": "6 kB",
|
|
168
175
|
"import": "*",
|
|
169
176
|
"ignore": [
|
|
170
177
|
"next",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require(`./dist-Bof1Std7.cjs`),t=Symbol.for(`arkenv.extended_env`),n=Symbol.for(`arkenv.keys`),r=Symbol.for(`arkenv.server_only_keys`);let i=!1;function a(a,o,s,c,l){let u={},d={},f={},p=[],m={},h=!1;if(typeof o==`boolean`){process.env.NODE_ENV===`development`&&!i&&(i=!0,e.i(`Deprecated: The nested layout structure (specifying 'server', 'client', or 'shared' keys in arkenv) is deprecated and will be removed in the next major version. Please migrate to the flat layout. See guide: https://arkenv.js.org/docs/nextjs/faq#how-do-i-define-client-side-variables`));let t=a;u=t?.server||{},d=t?.client||{},f=t?.shared||{},p=t?.extends||[],m=t?.runtimeEnv||{},h=globalThis.__arkenv_force_server__===!0||!!o}else{let e=a||{},t=o||{};if(p=t.extends||[],m=t.runtimeEnv||{},h=globalThis.__arkenv_force_server__===!0||!!s?.isServer,s?.isShared)f=e;else if(s?.strictLayout===`client`)d=e;else if(s?.strictLayout===`server`)u=e;else{let n=t.exposeToClient||t.expose||t.shared||[];for(let t of Object.keys(e))n.includes(t)||t===`NODE_ENV`?f[t]=e[t]:t.startsWith(`NEXT_PUBLIC_`)?d[t]=e[t]:u[t]=e[t]}}let g={},_=new Set,v=new Set;for(let e of Object.keys(u))_.add(e),!(e in d)&&!(e in f)&&v.add(e);for(let e of Object.keys(d))_.add(e);for(let e of Object.keys(f))_.add(e);let y={};if(p&&Array.isArray(p)){for(let e of p)if(e&&(typeof e==`object`||typeof e==`function`)){let i=e[t];if(i){g={...g,...i};let t=e[n];if(t instanceof Set)for(let e of t)_.add(e);let a=e[r];if(a instanceof Set)for(let e of a)v.add(e)}else{for(let e of Object.keys(g))g[e]!==void 0&&(y[e]=g[e]);for(let e of Object.keys(m))m[e]!==void 0&&(y[e]=m[e]);if(h)for(let e of Object.keys(u))y[e]===void 0&&process.env[e]!==void 0&&(y[e]=process.env[e]);let t=c(e,{env:y,safe:!1});g={...g,...t};let n=l(e);for(let e of n)_.add(e),h&&!e.startsWith(`NEXT_PUBLIC_`)&&!s?.isShared&&v.add(e)}}}for(let e of Object.keys(d))v.delete(e);for(let e of Object.keys(f))v.delete(e);for(let e of Object.keys(d))if(!e.startsWith(`NEXT_PUBLIC_`))throw Error(`Client-side environment variables must be prefixed with 'NEXT_PUBLIC_'. Found invalid key: ${e}`);let b=[...Object.keys(d),...Object.keys(f)];for(let e of b)if(!(e in m))throw Error(`Missing key in runtimeEnv: ${e}. All client and shared environment variables must be explicitly destructured in runtimeEnv.`);for(let e of Object.keys(m))if(!_.has(e))throw Error(`Environment variable '${e}' is passed to runtimeEnv but is not defined in the schema.`);for(let e of Object.keys(g))g[e]!==void 0&&(y[e]=g[e]);let x=typeof globalThis<`u`?globalThis.__arkenv_env__:void 0;for(let e of Object.keys(m))m[e]!==void 0&&(y[e]=m[e]),x&&x[e]!==void 0&&(e.startsWith(`NEXT_PUBLIC_`)||e in d||e in f)&&(y[e]=x[e]);if(h)for(let e of Object.keys(u))y[e]===void 0&&process.env[e]!==void 0&&(y[e]=process.env[e]);let S=c(h?{...u,...d,...f}:{...d,...f},{env:y,safe:!1}),C={...g,...S};return new Proxy(C,{get(e,i,a){if(i===t)return e;if(i===n)return _;if(i===r)return v;if(typeof i==`symbol`)return Reflect.get(e,i,a);if(typeof i==`string`){if(v.has(i)&&!h)throw Error(`ArkEnv Error: Attempted to access server environment variable '${i}' on the client.`);if(!_.has(i)&&!(i in Object.prototype)&&!(i===`__esModule`||i===`$$typeof`||i===`toJSON`||i===`inspect`))throw Error(`Environment variable '${i}' is not defined in the schema.`)}return Reflect.get(e,i,a)}})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
2
|
-
//# sourceMappingURL=arkenv-internal-Cll5pV_F.cjs.map
|