@arkenv/nextjs 1.0.0-alpha.3 → 1.0.0-alpha.5
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/dist/arkenv-internal-Do5bRP26.js +2 -0
- package/dist/arkenv-internal-Do5bRP26.js.map +1 -0
- package/dist/arkenv-internal-Dz0mDRKT.cjs +2 -0
- package/dist/arkenv-internal-Dz0mDRKT.cjs.map +1 -0
- package/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +6 -3
- package/dist/client.d.cts.map +1 -1
- package/dist/client.d.ts +6 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/config-DNJIS9zz.cjs +103 -0
- package/dist/config-DNJIS9zz.cjs.map +1 -0
- package/dist/config.cjs +1 -76
- package/dist/config.d.cts +41 -29
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.ts +41 -29
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +66 -39
- package/dist/config.js.map +1 -1
- package/dist/{index-DvODqC0J.d.ts → index-96RGPyfa.d.cts} +2 -2
- package/dist/{index-CRUkF6-E.d.cts.map → index-96RGPyfa.d.cts.map} +1 -1
- package/dist/{index-CRUkF6-E.d.cts → index-Dypl5Zzg.d.ts} +2 -2
- package/dist/{index-DvODqC0J.d.ts.map → index-Dypl5Zzg.d.ts.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -8
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +30 -8
- 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 +23 -8
- package/dist/react-server.d.cts.map +1 -1
- package/dist/react-server.d.ts +23 -8
- 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-CUpLLTKJ.cjs +2 -0
- package/dist/script-CUpLLTKJ.cjs.map +1 -0
- package/dist/script-DB7wIIvT.js +2 -0
- package/dist/script-DB7wIIvT.js.map +1 -0
- package/dist/script-DSWuhk88.d.cts +21 -0
- package/dist/script-DSWuhk88.d.cts.map +1 -0
- package/dist/script-Ii42Y-xZ.d.ts +21 -0
- package/dist/script-Ii42Y-xZ.d.ts.map +1 -0
- package/dist/server.cjs +1 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +6 -3
- package/dist/server.d.cts.map +1 -1
- package/dist/server.d.ts +6 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/shared.cjs +1 -1
- package/dist/shared.cjs.map +1 -1
- package/dist/shared.d.cts +3 -3
- package/dist/shared.d.cts.map +1 -1
- package/dist/shared.d.ts +3 -3
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +1 -1
- package/dist/shared.js.map +1 -1
- package/dist/standard/client.cjs +2 -0
- package/dist/standard/client.cjs.map +1 -0
- package/dist/standard/client.d.cts +30 -0
- package/dist/standard/client.d.cts.map +1 -0
- package/dist/standard/client.d.ts +30 -0
- package/dist/standard/client.d.ts.map +1 -0
- package/dist/standard/client.js +2 -0
- package/dist/standard/client.js.map +1 -0
- package/dist/standard/config.cjs +2 -0
- package/dist/standard/config.cjs.map +1 -0
- package/dist/standard/config.d.cts +14 -0
- package/dist/standard/config.d.cts.map +1 -0
- package/dist/standard/config.d.ts +14 -0
- package/dist/standard/config.d.ts.map +1 -0
- package/dist/standard/config.js +2 -0
- package/dist/standard/config.js.map +1 -0
- package/dist/standard/index.cjs +2 -0
- package/dist/standard/index.cjs.map +1 -0
- package/dist/standard/index.d.cts +35 -0
- package/dist/standard/index.d.cts.map +1 -0
- package/dist/standard/index.d.ts +35 -0
- package/dist/standard/index.d.ts.map +1 -0
- package/dist/standard/index.js +2 -0
- package/dist/standard/index.js.map +1 -0
- package/dist/standard/server.cjs +2 -0
- package/dist/standard/server.cjs.map +1 -0
- package/dist/standard/server.d.cts +18 -0
- package/dist/standard/server.d.cts.map +1 -0
- package/dist/standard/server.d.ts +18 -0
- package/dist/standard/server.d.ts.map +1 -0
- package/dist/standard/server.js +2 -0
- package/dist/standard/server.js.map +1 -0
- package/dist/standard/shared.cjs +2 -0
- package/dist/standard/shared.cjs.map +1 -0
- package/dist/standard/shared.d.cts +13 -0
- package/dist/standard/shared.d.cts.map +1 -0
- package/dist/standard/shared.d.ts +13 -0
- package/dist/standard/shared.d.ts.map +1 -0
- package/dist/standard/shared.js +2 -0
- package/dist/standard/shared.js.map +1 -0
- package/dist/{types-BTG7L0mq.d.cts → types-44R9mgTa.d.cts} +2 -2
- package/dist/{types-BTG7L0mq.d.cts.map → types-44R9mgTa.d.cts.map} +1 -1
- package/dist/{types-8YUW70UX.d.ts → types-gP-eTDyz.d.ts} +2 -2
- package/dist/{types-8YUW70UX.d.ts.map → types-gP-eTDyz.d.ts.map} +1 -1
- package/package.json +54 -9
- package/dist/arkenv-internal-BI25fuIK.cjs +0 -2
- package/dist/arkenv-internal-BI25fuIK.cjs.map +0 -1
- package/dist/arkenv-internal-DOhvmOZ_.js +0 -2
- package/dist/arkenv-internal-DOhvmOZ_.js.map +0 -1
- package/dist/config.cjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,36 @@
|
|
|
1
|
-
import { t as SchemaShape } from "./index-
|
|
2
|
-
import {
|
|
1
|
+
import { a as $, t as SchemaShape } from "./index-Dypl5Zzg.js";
|
|
2
|
+
import { t as MergeExtends } from "./types-gP-eTDyz.js";
|
|
3
|
+
import { n as ArkEnvScriptProps, t as ArkEnvScript } from "./script-Ii42Y-xZ.js";
|
|
4
|
+
import { EnvSchema, Infer, Infer as Infer$1, type } from "@arkenv/core";
|
|
5
|
+
import { distill, type as type$1 } from "arktype";
|
|
3
6
|
|
|
4
7
|
//#region src/index.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Extract keys from a schema type that are visible on the client:
|
|
10
|
+
* - Keys prefixed with `NEXT_PUBLIC_`
|
|
11
|
+
* - `NODE_ENV` (implicitly shared by Next.js)
|
|
12
|
+
* - Keys listed in `exposeToClient`
|
|
13
|
+
*/
|
|
14
|
+
type ClientVisibleKeys<TSchema extends SchemaShape, TExpose extends keyof TSchema> = { [K in keyof TSchema]: K extends `NEXT_PUBLIC_${string}` ? K : K extends "NODE_ENV" ? K : K extends TExpose ? K : never }[keyof TSchema];
|
|
5
15
|
/**
|
|
6
16
|
* Create a validated, type-safe environment configuration for Next.js applications (Client-side / SSR entry point).
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
*/
|
|
18
|
+
declare function arkenv<const TSchema extends SchemaShape & {
|
|
19
|
+
runtimeEnv?: never;
|
|
20
|
+
} = {}, const TExpose extends keyof TSchema = never, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
|
|
21
|
+
/**
|
|
22
|
+
* Custom environment variables to expose to the client bundle.
|
|
23
|
+
* By default, variables prefixed with `NEXT_PUBLIC_` and `NODE_ENV` are exposed automatically.
|
|
24
|
+
* Use this option to expose custom variables that do not have the `NEXT_PUBLIC_` prefix.
|
|
25
|
+
*/
|
|
26
|
+
exposeToClient?: readonly TExpose[]; /** @deprecated Use `exposeToClient` instead */
|
|
27
|
+
expose?: readonly TExpose[]; /** @deprecated Use `exposeToClient` instead */
|
|
28
|
+
shared?: readonly TExpose[];
|
|
29
|
+
extends?: [...TExtends];
|
|
30
|
+
runtimeEnv?: Record<string, unknown>;
|
|
31
|
+
}): Readonly<Pick<distill.Out<type$1.infer<TSchema, $>>, Extract<keyof distill.Out<type$1.infer<TSchema, $>>, ClientVisibleKeys<TSchema, TExpose>>> & MergeExtends<TExtends>>;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`
|
|
12
34
|
*/
|
|
13
35
|
declare function arkenv<const TServer extends SchemaShape = {}, const TClient extends SchemaShape = {}, const TShared extends SchemaShape = {}>(options: {
|
|
14
36
|
server?: EnvSchema<TServer>;
|
|
@@ -17,5 +39,5 @@ declare function arkenv<const TServer extends SchemaShape = {}, const TClient ex
|
|
|
17
39
|
runtimeEnv: Record<keyof TClient | keyof TShared, unknown> & Record<string, unknown>;
|
|
18
40
|
}): Readonly<Infer$1<TServer & TClient & TShared>>;
|
|
19
41
|
//#endregion
|
|
20
|
-
export { type Infer, arkenv, arkenv as default, type };
|
|
42
|
+
export { ArkEnvScript, type ArkEnvScriptProps, type Infer, arkenv, arkenv as default, type };
|
|
21
43
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;AAM4C;;;;KAQvC,iBAAA,iBACY,WAAA,wBACM,OAAA,kBAEV,OAAA,GAAU,CAAA,mCACnB,CAAA,GACA,CAAA,sBACC,CAAA,GACA,CAAA,SAAU,OAAA,GACT,CAAA,iBAEE,OAAA;;;;iBAKQ,MAAA,uBACO,WAAA;EAAgB,UAAA;AAAA,oCACV,OAAA,yDAAA,CAG5B,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EAXO;;;;;EAiBN,cAAA,YAA0B,OAAA,IA1BL;EA4BrB,MAAA,YAAkB,OAAA,IA1BP;EA4BX,MAAA,YAAkB,OAAA;EAClB,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA;AAAA,IAEZ,QAAA,CACF,IAAA,CACC,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,IAC9B,OAAA,OACO,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,IACpC,iBAAA,CAAkB,OAAA,EAAS,OAAA,MAG5B,YAAA,CAAa,QAAA;;;;iBAMC,MAAA,uBACO,WAAA,6BACA,WAAA,6BACA,WAAA,MAAA,CACrB,OAAA;EACD,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,MAAA,GAAS,SAAA,CAAU,OAAA,kBACN,OAAA,GAAU,CAAA;EAEvB,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,UAAA,EAAY,MAAA,OAAa,OAAA,SAAgB,OAAA,aACxC,MAAA;AAAA,IACE,QAAA,CAAS,OAAA,CAAM,OAAA,GAAU,OAAA,GAAU,OAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./arkenv-internal-
|
|
1
|
+
import{t as e}from"./arkenv-internal-Do5bRP26.js";import{t}from"./script-DB7wIIvT.js";import{arkenv as n,getSchemaKeys as r,type as i}from"@arkenv/core";function a(t,i){return t&&typeof t==`object`&&(`runtimeEnv`in t||`server`in t||`client`in t||`shared`in t)?e(t,!1,void 0,n,r):e(t,i,{isServer:!1},n,r)}export{t as ArkEnvScript,a as arkenv,a as default,i as type};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { SchemaShape } from \"@repo/types\";\nimport type {
|
|
1
|
+
{"version":3,"file":"index.js","names":["coreArkenv"],"sources":["../src/index.ts"],"sourcesContent":["import type { EnvSchema, Infer } from \"@arkenv/core\";\nimport { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/core\";\nimport type { $ } from \"@repo/scope\";\nimport type { SchemaShape } from \"@repo/types\";\nimport type { type as at, distill } from \"arktype\";\nimport { arkenvInternal } from \"./arkenv-internal\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Extract keys from a schema type that are visible on the client:\n * - Keys prefixed with `NEXT_PUBLIC_`\n * - `NODE_ENV` (implicitly shared by Next.js)\n * - Keys listed in `exposeToClient`\n */\ntype ClientVisibleKeys<\n\tTSchema extends SchemaShape,\n\tTExpose extends keyof TSchema,\n> = {\n\t[K in keyof TSchema]: K extends `NEXT_PUBLIC_${string}`\n\t\t? K\n\t\t: K extends \"NODE_ENV\"\n\t\t\t? K\n\t\t\t: K extends TExpose\n\t\t\t\t? K\n\t\t\t\t: never;\n}[keyof TSchema];\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Client-side / SSR entry point).\n */\nexport function arkenv<\n\tconst TSchema extends SchemaShape & { runtimeEnv?: never } = {},\n\tconst TExpose extends keyof TSchema = never,\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\t/**\n\t\t * Custom environment variables to expose to the client bundle.\n\t\t * By default, variables prefixed with `NEXT_PUBLIC_` and `NODE_ENV` are exposed automatically.\n\t\t * Use this option to expose custom variables that do not have the `NEXT_PUBLIC_` prefix.\n\t\t */\n\t\texposeToClient?: readonly TExpose[];\n\t\t/** @deprecated Use `exposeToClient` instead */\n\t\texpose?: readonly TExpose[];\n\t\t/** @deprecated Use `exposeToClient` instead */\n\t\tshared?: readonly TExpose[];\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Record<string, unknown>;\n\t},\n): Readonly<\n\tPick<\n\t\tdistill.Out<at.infer<TSchema, $>>,\n\t\tExtract<\n\t\t\tkeyof distill.Out<at.infer<TSchema, $>>,\n\t\t\tClientVisibleKeys<TSchema, TExpose>\n\t\t>\n\t> &\n\t\tMergeExtends<TExtends>\n>;\n\n/**\n * @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`\n */\nexport function arkenv<\n\tconst TServer extends SchemaShape = {},\n\tconst TClient extends SchemaShape = {},\n\tconst TShared extends SchemaShape = {},\n>(options: {\n\tserver?: EnvSchema<TServer>;\n\tclient?: EnvSchema<TClient> & {\n\t\t[K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never;\n\t};\n\tshared?: EnvSchema<TShared>;\n\truntimeEnv: Record<keyof TClient | keyof TShared, unknown> &\n\t\tRecord<string, unknown>;\n}): Readonly<Infer<TServer & TClient & TShared>>;\n\nexport function arkenv(schemaOrOptions: any, optionsOrIsServer?: any): any {\n\tconst isLegacy =\n\t\tschemaOrOptions &&\n\t\ttypeof schemaOrOptions === \"object\" &&\n\t\t(\"runtimeEnv\" in schemaOrOptions ||\n\t\t\t\"server\" in schemaOrOptions ||\n\t\t\t\"client\" in schemaOrOptions ||\n\t\t\t\"shared\" in schemaOrOptions);\n\n\tif (isLegacy) {\n\t\treturn arkenvInternal(\n\t\t\tschemaOrOptions,\n\t\t\tfalse,\n\t\t\tundefined,\n\t\t\tcoreArkenv,\n\t\t\tgetSchemaKeys,\n\t\t);\n\t}\n\n\treturn arkenvInternal(\n\t\tschemaOrOptions,\n\t\toptionsOrIsServer,\n\t\t{ isServer: false },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport type { Infer } from \"@arkenv/core\";\nexport { type } from \"@arkenv/core\";\nexport type { ArkEnvScriptProps } from \"./script\";\nexport { ArkEnvScript } from \"./script\";\n\n/**\n * ArkEnv's Next.js integration export\n *\n * {@link https://arkenv.js.org | ArkEnv} is a typesafe environment variables validator from editor to runtime.\n */\nexport default arkenv;\n"],"mappings":"yJA8EA,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/react-server.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./arkenv-internal-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`./config-DNJIS9zz.cjs`);const e=require(`./arkenv-internal-Dz0mDRKT.cjs`),t=require(`./script-CUpLLTKJ.cjs`);let n=require(`@arkenv/core`);function r(t,r){return t&&typeof t==`object`&&(`runtimeEnv`in t||`server`in t||`client`in t||`shared`in t)?e.t(t,!0,void 0,n.arkenv,n.getSchemaKeys):e.t(t,r,{isServer:!0},n.arkenv,n.getSchemaKeys)}exports.ArkEnvScript=t.t,exports.arkenv=r,exports.default=r,Object.defineProperty(exports,`type`,{enumerable:!0,get:function(){return n.type}});
|
|
2
2
|
//# sourceMappingURL=react-server.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-server.cjs","names":["
|
|
1
|
+
{"version":3,"file":"react-server.cjs","names":["arkenvInternal","coreArkenv","getSchemaKeys"],"sources":["../src/react-server.ts"],"sourcesContent":["import type { EnvSchema, Infer } from \"@arkenv/core\";\nimport { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/core\";\nimport type { $ } from \"@repo/scope\";\nimport type { SchemaShape } from \"@repo/types\";\nimport type { type as at, distill } from \"arktype\";\nimport { arkenvInternal } from \"./arkenv-internal\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Server-side RSC entry point).\n */\nexport function arkenv<\n\tconst TSchema extends SchemaShape & { runtimeEnv?: never } = {},\n\tconst TShared extends keyof TSchema = never,\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\t/**\n\t\t * Custom environment variables to expose to the client bundle.\n\t\t * By default, variables prefixed with `NEXT_PUBLIC_` and `NODE_ENV` are exposed automatically.\n\t\t * Use this option to expose custom variables that do not have the `NEXT_PUBLIC_` prefix.\n\t\t */\n\t\texposeToClient?: readonly TShared[];\n\t\t/** @deprecated Use `exposeToClient` instead */\n\t\texpose?: readonly TShared[];\n\t\t/** @deprecated Use `exposeToClient` instead */\n\t\tshared?: readonly TShared[];\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Record<string, unknown>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>>;\n\n/**\n * @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`\n */\nexport function arkenv<\n\tconst TServer extends SchemaShape = {},\n\tconst TClient extends SchemaShape = {},\n\tconst TShared extends SchemaShape = {},\n>(options: {\n\tserver?: EnvSchema<TServer>;\n\tclient?: EnvSchema<TClient> & {\n\t\t[K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never;\n\t};\n\tshared?: EnvSchema<TShared>;\n\truntimeEnv: Record<keyof TClient | keyof TShared, unknown> &\n\t\tRecord<string, unknown>;\n}): Readonly<Infer<TServer & TClient & TShared>>;\n\nexport function arkenv(schemaOrOptions: any, optionsOrIsServer?: any): any {\n\tconst isLegacy =\n\t\tschemaOrOptions &&\n\t\ttypeof schemaOrOptions === \"object\" &&\n\t\t(\"runtimeEnv\" in schemaOrOptions ||\n\t\t\t\"server\" in schemaOrOptions ||\n\t\t\t\"client\" in schemaOrOptions ||\n\t\t\t\"shared\" in schemaOrOptions);\n\n\tif (isLegacy) {\n\t\treturn arkenvInternal(\n\t\t\tschemaOrOptions,\n\t\t\ttrue,\n\t\t\tundefined,\n\t\t\tcoreArkenv,\n\t\t\tgetSchemaKeys,\n\t\t);\n\t}\n\n\treturn arkenvInternal(\n\t\tschemaOrOptions,\n\t\toptionsOrIsServer,\n\t\t{ isServer: true },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport type { Infer } from \"@arkenv/core\";\nexport { type } from \"@arkenv/core\";\nexport type { ArkEnvScriptProps } from \"./script\";\nexport { ArkEnvScript } from \"./script\";\n\n/**\n * ArkEnv's Next.js integration export\n *\n * {@link https://arkenv.js.org | ArkEnv} is a typesafe environment variables validator from editor to runtime.\n */\nexport default arkenv;\n"],"mappings":"mPAkDA,SAAgB,EAAO,EAAsB,EAA8B,CAmB1E,OAjBC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GACZ,WAAY,GAGNA,EAAAA,EACN,EACA,GACA,IAAA,GACAC,EAAAA,OACAC,EAAAA,cACA,CAGKF,EAAAA,EACN,EACA,EACA,CAAE,SAAU,GAAM,CAClBC,EAAAA,OACAC,EAAAA,cACA"}
|
package/dist/react-server.d.cts
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
|
-
import { t as SchemaShape } from "./index-
|
|
2
|
-
import {
|
|
1
|
+
import { a as $, t as SchemaShape } from "./index-96RGPyfa.cjs";
|
|
2
|
+
import { t as MergeExtends } from "./types-44R9mgTa.cjs";
|
|
3
|
+
import { n as ArkEnvScriptProps, t as ArkEnvScript } from "./script-DSWuhk88.cjs";
|
|
4
|
+
import { EnvSchema, Infer, Infer as Infer$1, type } from "@arkenv/core";
|
|
5
|
+
import { distill, type as type$1 } from "arktype";
|
|
3
6
|
|
|
4
7
|
//#region src/react-server.d.ts
|
|
5
8
|
/**
|
|
6
9
|
* Create a validated, type-safe environment configuration for Next.js applications (Server-side RSC entry point).
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
*/
|
|
11
|
+
declare function arkenv<const TSchema extends SchemaShape & {
|
|
12
|
+
runtimeEnv?: never;
|
|
13
|
+
} = {}, const TShared extends keyof TSchema = never, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
|
|
14
|
+
/**
|
|
15
|
+
* Custom environment variables to expose to the client bundle.
|
|
16
|
+
* By default, variables prefixed with `NEXT_PUBLIC_` and `NODE_ENV` are exposed automatically.
|
|
17
|
+
* Use this option to expose custom variables that do not have the `NEXT_PUBLIC_` prefix.
|
|
18
|
+
*/
|
|
19
|
+
exposeToClient?: readonly TShared[]; /** @deprecated Use `exposeToClient` instead */
|
|
20
|
+
expose?: readonly TShared[]; /** @deprecated Use `exposeToClient` instead */
|
|
21
|
+
shared?: readonly TShared[];
|
|
22
|
+
extends?: [...TExtends];
|
|
23
|
+
runtimeEnv?: Record<string, unknown>;
|
|
24
|
+
}): Readonly<distill.Out<type$1.infer<TSchema, $>> & MergeExtends<TExtends>>;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`
|
|
12
27
|
*/
|
|
13
28
|
declare function arkenv<const TServer extends SchemaShape = {}, const TClient extends SchemaShape = {}, const TShared extends SchemaShape = {}>(options: {
|
|
14
29
|
server?: EnvSchema<TServer>;
|
|
@@ -17,5 +32,5 @@ declare function arkenv<const TServer extends SchemaShape = {}, const TClient ex
|
|
|
17
32
|
runtimeEnv: Record<keyof TClient | keyof TShared, unknown> & Record<string, unknown>;
|
|
18
33
|
}): Readonly<Infer$1<TServer & TClient & TShared>>;
|
|
19
34
|
//#endregion
|
|
20
|
-
export { type Infer, arkenv, arkenv as default, type };
|
|
35
|
+
export { ArkEnvScript, type ArkEnvScriptProps, type Infer, arkenv, arkenv as default, type };
|
|
21
36
|
//# sourceMappingURL=react-server.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-server.d.cts","names":[],"sources":["../src/react-server.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"react-server.d.cts","names":[],"sources":["../src/react-server.ts"],"mappings":";;;;;;;;;AAWA;iBAAgB,MAAA,uBACO,WAAA;EAAgB,UAAA;AAAA,oCACV,OAAA,yDAAA,CAG5B,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EAJ4B;;;;;EAU3B,cAAA,YAA0B,OAAA,IAKZ;EAHd,MAAA,YAAkB,OAAA,IAMa;EAJ/B,MAAA,YAAkB,OAAA;EAClB,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;;;;iBAK7C,MAAA,uBACO,WAAA,6BACA,WAAA,6BACA,WAAA,MAAA,CACrB,OAAA;EACD,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,MAAA,GAAS,SAAA,CAAU,OAAA,kBACN,OAAA,GAAU,CAAA;EAEvB,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,UAAA,EAAY,MAAA,OAAa,OAAA,SAAgB,OAAA,aACxC,MAAA;AAAA,IACE,QAAA,CAAS,OAAA,CAAM,OAAA,GAAU,OAAA,GAAU,OAAA"}
|
package/dist/react-server.d.ts
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
|
-
import { t as SchemaShape } from "./index-
|
|
2
|
-
import {
|
|
1
|
+
import { a as $, t as SchemaShape } from "./index-Dypl5Zzg.js";
|
|
2
|
+
import { t as MergeExtends } from "./types-gP-eTDyz.js";
|
|
3
|
+
import { n as ArkEnvScriptProps, t as ArkEnvScript } from "./script-Ii42Y-xZ.js";
|
|
4
|
+
import { EnvSchema, Infer, Infer as Infer$1, type } from "@arkenv/core";
|
|
5
|
+
import { distill, type as type$1 } from "arktype";
|
|
3
6
|
|
|
4
7
|
//#region src/react-server.d.ts
|
|
5
8
|
/**
|
|
6
9
|
* Create a validated, type-safe environment configuration for Next.js applications (Server-side RSC entry point).
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
*/
|
|
11
|
+
declare function arkenv<const TSchema extends SchemaShape & {
|
|
12
|
+
runtimeEnv?: never;
|
|
13
|
+
} = {}, const TShared extends keyof TSchema = never, const TExtends extends readonly unknown[] = []>(schema: EnvSchema<TSchema>, options?: {
|
|
14
|
+
/**
|
|
15
|
+
* Custom environment variables to expose to the client bundle.
|
|
16
|
+
* By default, variables prefixed with `NEXT_PUBLIC_` and `NODE_ENV` are exposed automatically.
|
|
17
|
+
* Use this option to expose custom variables that do not have the `NEXT_PUBLIC_` prefix.
|
|
18
|
+
*/
|
|
19
|
+
exposeToClient?: readonly TShared[]; /** @deprecated Use `exposeToClient` instead */
|
|
20
|
+
expose?: readonly TShared[]; /** @deprecated Use `exposeToClient` instead */
|
|
21
|
+
shared?: readonly TShared[];
|
|
22
|
+
extends?: [...TExtends];
|
|
23
|
+
runtimeEnv?: Record<string, unknown>;
|
|
24
|
+
}): Readonly<distill.Out<type$1.infer<TSchema, $>> & MergeExtends<TExtends>>;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`
|
|
12
27
|
*/
|
|
13
28
|
declare function arkenv<const TServer extends SchemaShape = {}, const TClient extends SchemaShape = {}, const TShared extends SchemaShape = {}>(options: {
|
|
14
29
|
server?: EnvSchema<TServer>;
|
|
@@ -17,5 +32,5 @@ declare function arkenv<const TServer extends SchemaShape = {}, const TClient ex
|
|
|
17
32
|
runtimeEnv: Record<keyof TClient | keyof TShared, unknown> & Record<string, unknown>;
|
|
18
33
|
}): Readonly<Infer$1<TServer & TClient & TShared>>;
|
|
19
34
|
//#endregion
|
|
20
|
-
export { type Infer, arkenv, arkenv as default, type };
|
|
35
|
+
export { ArkEnvScript, type ArkEnvScriptProps, type Infer, arkenv, arkenv as default, type };
|
|
21
36
|
//# sourceMappingURL=react-server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-server.d.ts","names":[],"sources":["../src/react-server.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"react-server.d.ts","names":[],"sources":["../src/react-server.ts"],"mappings":";;;;;;;;;AAWA;iBAAgB,MAAA,uBACO,WAAA;EAAgB,UAAA;AAAA,oCACV,OAAA,yDAAA,CAG5B,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EAJ4B;;;;;EAU3B,cAAA,YAA0B,OAAA,IAKZ;EAHd,MAAA,YAAkB,OAAA,IAMa;EAJ/B,MAAA,YAAkB,OAAA;EAClB,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;;;;iBAK7C,MAAA,uBACO,WAAA,6BACA,WAAA,6BACA,WAAA,MAAA,CACrB,OAAA;EACD,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,MAAA,GAAS,SAAA,CAAU,OAAA,kBACN,OAAA,GAAU,CAAA;EAEvB,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,UAAA,EAAY,MAAA,OAAa,OAAA,SAAgB,OAAA,aACxC,MAAA;AAAA,IACE,QAAA,CAAS,OAAA,CAAM,OAAA,GAAU,OAAA,GAAU,OAAA"}
|
package/dist/react-server.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./arkenv-internal-
|
|
1
|
+
import{t as e}from"./arkenv-internal-Do5bRP26.js";import{t}from"./script-DB7wIIvT.js";import{arkenv as n,getSchemaKeys as r,type as i}from"@arkenv/core";function a(t,i){return t&&typeof t==`object`&&(`runtimeEnv`in t||`server`in t||`client`in t||`shared`in t)?e(t,!0,void 0,n,r):e(t,i,{isServer:!0},n,r)}export{t as ArkEnvScript,a as arkenv,a as default,i as type};
|
|
2
2
|
//# sourceMappingURL=react-server.js.map
|
package/dist/react-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-server.js","names":[],"sources":["../src/react-server.ts"],"sourcesContent":["import type { SchemaShape } from \"@repo/types\";\nimport type {
|
|
1
|
+
{"version":3,"file":"react-server.js","names":["coreArkenv"],"sources":["../src/react-server.ts"],"sourcesContent":["import type { EnvSchema, Infer } from \"@arkenv/core\";\nimport { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/core\";\nimport type { $ } from \"@repo/scope\";\nimport type { SchemaShape } from \"@repo/types\";\nimport type { type as at, distill } from \"arktype\";\nimport { arkenvInternal } from \"./arkenv-internal\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Server-side RSC entry point).\n */\nexport function arkenv<\n\tconst TSchema extends SchemaShape & { runtimeEnv?: never } = {},\n\tconst TShared extends keyof TSchema = never,\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\t/**\n\t\t * Custom environment variables to expose to the client bundle.\n\t\t * By default, variables prefixed with `NEXT_PUBLIC_` and `NODE_ENV` are exposed automatically.\n\t\t * Use this option to expose custom variables that do not have the `NEXT_PUBLIC_` prefix.\n\t\t */\n\t\texposeToClient?: readonly TShared[];\n\t\t/** @deprecated Use `exposeToClient` instead */\n\t\texpose?: readonly TShared[];\n\t\t/** @deprecated Use `exposeToClient` instead */\n\t\tshared?: readonly TShared[];\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Record<string, unknown>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>>;\n\n/**\n * @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`\n */\nexport function arkenv<\n\tconst TServer extends SchemaShape = {},\n\tconst TClient extends SchemaShape = {},\n\tconst TShared extends SchemaShape = {},\n>(options: {\n\tserver?: EnvSchema<TServer>;\n\tclient?: EnvSchema<TClient> & {\n\t\t[K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never;\n\t};\n\tshared?: EnvSchema<TShared>;\n\truntimeEnv: Record<keyof TClient | keyof TShared, unknown> &\n\t\tRecord<string, unknown>;\n}): Readonly<Infer<TServer & TClient & TShared>>;\n\nexport function arkenv(schemaOrOptions: any, optionsOrIsServer?: any): any {\n\tconst isLegacy =\n\t\tschemaOrOptions &&\n\t\ttypeof schemaOrOptions === \"object\" &&\n\t\t(\"runtimeEnv\" in schemaOrOptions ||\n\t\t\t\"server\" in schemaOrOptions ||\n\t\t\t\"client\" in schemaOrOptions ||\n\t\t\t\"shared\" in schemaOrOptions);\n\n\tif (isLegacy) {\n\t\treturn arkenvInternal(\n\t\t\tschemaOrOptions,\n\t\t\ttrue,\n\t\t\tundefined,\n\t\t\tcoreArkenv,\n\t\t\tgetSchemaKeys,\n\t\t);\n\t}\n\n\treturn arkenvInternal(\n\t\tschemaOrOptions,\n\t\toptionsOrIsServer,\n\t\t{ isServer: true },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport type { Infer } from \"@arkenv/core\";\nexport { type } from \"@arkenv/core\";\nexport type { ArkEnvScriptProps } from \"./script\";\nexport { ArkEnvScript } from \"./script\";\n\n/**\n * ArkEnv's Next.js integration export\n *\n * {@link https://arkenv.js.org | ArkEnv} is a typesafe environment variables validator from editor to runtime.\n */\nexport default arkenv;\n"],"mappings":"yJAkDA,SAAgB,EAAO,EAAsB,EAA8B,CAmB1E,OAjBC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GACZ,WAAY,GAGN,EACN,EACA,GACA,IAAA,GACAA,EACA,EACA,CAGK,EACN,EACA,EACA,CAAE,SAAU,GAAM,CAClBA,EACA,EACA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`./config-DNJIS9zz.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-CUpLLTKJ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-CUpLLTKJ.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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";function t({env:t}={}){let n={};if(typeof process<`u`&&process.env)for(let e of Object.keys(process.env))e.startsWith(`NEXT_PUBLIC_`)&&(n[e]=process.env[e]);if(t)for(let e of Object.keys(t))e.startsWith(`NEXT_PUBLIC_`)&&(n[e]=t[e]);return e(`script`,{id:`arkenv-script`,dangerouslySetInnerHTML:{__html:`globalThis.__arkenv_env__ = ${JSON.stringify(n).replace(/</g,`\\u003c`)};`}})}export{t};
|
|
2
|
+
//# sourceMappingURL=script-DB7wIIvT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-DB7wIIvT.js","names":[],"sources":["../src/script.tsx"],"sourcesContent":["import type React from \"react\";\n\nexport type ArkEnvScriptProps = {\n\t/**\n\t * Optional custom environment variable map. If provided, any keys starting\n\t * with `NEXT_PUBLIC_` will be merged with public keys from `process.env`.\n\t */\n\tenv?: Record<string, string | undefined>;\n};\n\n/**\n * A React Component to serialize and inject NEXT_PUBLIC_* environment variables into the browser\n * during Server-Side Rendering (SSR). Placed in your root layout (layout.tsx), it sets\n * globalThis.__arkenv_env__ to ensure client-side components have access to runtime environment values.\n */\nexport function ArkEnvScript({\n\tenv,\n}: ArkEnvScriptProps = {}): React.ReactElement {\n\tconst publicEnv: Record<string, string | undefined> = {};\n\n\tif (typeof process !== \"undefined\" && process.env) {\n\t\tfor (const key of Object.keys(process.env)) {\n\t\t\tif (key.startsWith(\"NEXT_PUBLIC_\")) {\n\t\t\t\tpublicEnv[key] = process.env[key];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (env) {\n\t\tfor (const key of Object.keys(env)) {\n\t\t\tif (key.startsWith(\"NEXT_PUBLIC_\")) {\n\t\t\t\tpublicEnv[key] = env[key];\n\t\t\t}\n\t\t}\n\t}\n\n\tconst scriptContent = `globalThis.__arkenv_env__ = ${JSON.stringify(publicEnv).replace(/</g, \"\\\\u003c\")};`;\n\n\treturn (\n\t\t<script\n\t\t\tid=\"arkenv-script\"\n\t\t\tdangerouslySetInnerHTML={{ __html: scriptContent }}\n\t\t/>\n\t);\n}\n"],"mappings":"wCAeA,SAAgB,EAAa,CAC5B,OACsB,EAAE,CAAsB,CAC9C,IAAM,EAAgD,EAAE,CAExD,GAAI,OAAO,QAAY,KAAe,QAAQ,QACxC,IAAM,KAAO,OAAO,KAAK,QAAQ,IAAI,CACrC,EAAI,WAAW,eAAe,GACjC,EAAU,GAAO,QAAQ,IAAI,IAKhC,GAAI,MACE,IAAM,KAAO,OAAO,KAAK,EAAI,CAC7B,EAAI,WAAW,eAAe,GACjC,EAAU,GAAO,EAAI,IAOxB,OACC,EAAC,SAAD,CACC,GAAG,gBACH,wBAAyB,CAAE,OAAQ,+BALgB,KAAK,UAAU,EAAU,CAAC,QAAQ,KAAM,UAAU,CAAC,GAKpD,CACjD,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/script.d.ts
|
|
4
|
+
type ArkEnvScriptProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Optional custom environment variable map. If provided, any keys starting
|
|
7
|
+
* with `NEXT_PUBLIC_` will be merged with public keys from `process.env`.
|
|
8
|
+
*/
|
|
9
|
+
env?: Record<string, string | undefined>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* A React Component to serialize and inject NEXT_PUBLIC_* environment variables into the browser
|
|
13
|
+
* during Server-Side Rendering (SSR). Placed in your root layout (layout.tsx), it sets
|
|
14
|
+
* globalThis.__arkenv_env__ to ensure client-side components have access to runtime environment values.
|
|
15
|
+
*/
|
|
16
|
+
declare function ArkEnvScript({
|
|
17
|
+
env
|
|
18
|
+
}?: ArkEnvScriptProps): React.ReactElement;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { ArkEnvScriptProps as n, ArkEnvScript as t };
|
|
21
|
+
//# sourceMappingURL=script-DSWuhk88.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-DSWuhk88.d.cts","names":[],"sources":["../src/script.tsx"],"mappings":";;;KAEY,iBAAA;;AAAZ;;;EAKC,GAAA,GAAM,MAAA;AAAA;AAQP;;;;;AAAA,iBAAgB,YAAA,CAAA;EACf;AAAA,IACE,iBAAA,GAAyB,KAAA,CAAM,YAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/script.d.ts
|
|
4
|
+
type ArkEnvScriptProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Optional custom environment variable map. If provided, any keys starting
|
|
7
|
+
* with `NEXT_PUBLIC_` will be merged with public keys from `process.env`.
|
|
8
|
+
*/
|
|
9
|
+
env?: Record<string, string | undefined>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* A React Component to serialize and inject NEXT_PUBLIC_* environment variables into the browser
|
|
13
|
+
* during Server-Side Rendering (SSR). Placed in your root layout (layout.tsx), it sets
|
|
14
|
+
* globalThis.__arkenv_env__ to ensure client-side components have access to runtime environment values.
|
|
15
|
+
*/
|
|
16
|
+
declare function ArkEnvScript({
|
|
17
|
+
env
|
|
18
|
+
}?: ArkEnvScriptProps): React.ReactElement;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { ArkEnvScriptProps as n, ArkEnvScript as t };
|
|
21
|
+
//# sourceMappingURL=script-Ii42Y-xZ.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-Ii42Y-xZ.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"}
|
package/dist/server.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./arkenv-internal-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`./config-DNJIS9zz.cjs`);const e=require(`./arkenv-internal-Dz0mDRKT.cjs`);let t=require(`@arkenv/core`);require(`server-only`);function n(n,r){if(n&&typeof n==`object`&&(`runtimeEnv`in n||`server`in n||`shared`in n)){if(`client`in n)throw Error(`server entry point only accepts 'server' and 'shared' schemas.`);return e.t(n,!0,void 0,t.arkenv,t.getSchemaKeys)}return e.t(n,r,{isServer:!0,strictLayout:`server`},t.arkenv,t.getSchemaKeys)}exports.arkenv=n,exports.default=n,Object.defineProperty(exports,`type`,{enumerable:!0,get:function(){return t.type}});
|
|
2
2
|
//# sourceMappingURL=server.cjs.map
|
package/dist/server.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.cjs","names":["
|
|
1
|
+
{"version":3,"file":"server.cjs","names":["arkenvInternal","coreArkenv","getSchemaKeys"],"sources":["../src/server.ts"],"sourcesContent":["import \"server-only\";\nimport type { EnvSchema } from \"@arkenv/core\";\nimport { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/core\";\nimport type { $ } from \"@repo/scope\";\nimport type { Dict, SchemaShape } from \"@repo/types\";\nimport type { type as at, distill } from \"arktype\";\nimport { arkenvInternal } from \"./arkenv-internal\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Server entry point).\n */\nexport function arkenv<\n\tconst TSchema extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>>;\n\n/**\n * @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`\n */\nexport function arkenv<\n\tconst TServer extends SchemaShape = {},\n\tconst TShared extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(options: {\n\tserver?: EnvSchema<TServer>;\n\tshared?: EnvSchema<TShared>;\n\textends?: [...TExtends];\n\truntimeEnv?: Record<keyof TShared, string | undefined> & Dict<string>;\n}): Readonly<\n\tdistill.Out<at.infer<TServer & TShared, $>> & MergeExtends<TExtends>\n>;\n\nexport function arkenv(schemaOrOptions: any, optionsOrIsServer?: any): any {\n\tconst isLegacy =\n\t\tschemaOrOptions &&\n\t\ttypeof schemaOrOptions === \"object\" &&\n\t\t(\"runtimeEnv\" in schemaOrOptions ||\n\t\t\t\"server\" in schemaOrOptions ||\n\t\t\t\"shared\" in schemaOrOptions);\n\n\tif (isLegacy) {\n\t\tif (\"client\" in schemaOrOptions) {\n\t\t\tthrow new Error(\n\t\t\t\t\"server entry point only accepts 'server' and 'shared' schemas.\",\n\t\t\t);\n\t\t}\n\t\treturn arkenvInternal(\n\t\t\tschemaOrOptions,\n\t\t\ttrue,\n\t\t\tundefined,\n\t\t\tcoreArkenv,\n\t\t\tgetSchemaKeys,\n\t\t);\n\t}\n\n\treturn arkenvInternal(\n\t\tschemaOrOptions,\n\t\toptionsOrIsServer,\n\t\t{ isServer: true, strictLayout: \"server\" },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport { type } from \"@arkenv/core\";\n\nexport default arkenv;\n"],"mappings":"uOAuCA,SAAgB,EAAO,EAAsB,EAA8B,CAQ1E,GANC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GAEA,CACb,GAAI,WAAY,EACf,MAAU,MACT,iEACA,CAEF,OAAOA,EAAAA,EACN,EACA,GACA,IAAA,GACAC,EAAAA,OACAC,EAAAA,cACA,CAGF,OAAOF,EAAAA,EACN,EACA,EACA,CAAE,SAAU,GAAM,aAAc,SAAU,CAC1CC,EAAAA,OACAC,EAAAA,cACA"}
|
package/dist/server.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as MergeExtends } from "./types-
|
|
1
|
+
import { a as $, i as Dict, t as SchemaShape } from "./index-96RGPyfa.cjs";
|
|
2
|
+
import { t as MergeExtends } from "./types-44R9mgTa.cjs";
|
|
3
|
+
import { EnvSchema, type } from "@arkenv/core";
|
|
3
4
|
import { distill, type as type$1 } from "arktype";
|
|
4
|
-
import { EnvSchema, type } from "arkenv";
|
|
5
5
|
//#region src/server.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Create a validated, type-safe environment configuration for Next.js applications (Server entry point).
|
|
@@ -10,6 +10,9 @@ declare function arkenv<const TSchema extends SchemaShape = {}, const TExtends e
|
|
|
10
10
|
extends?: [...TExtends];
|
|
11
11
|
runtimeEnv?: Dict<string>;
|
|
12
12
|
}): Readonly<distill.Out<type$1.infer<TSchema, $>> & MergeExtends<TExtends>>;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`
|
|
15
|
+
*/
|
|
13
16
|
declare function arkenv<const TServer extends SchemaShape = {}, const TShared extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(options: {
|
|
14
17
|
server?: EnvSchema<TServer>;
|
|
15
18
|
shared?: EnvSchema<TShared>;
|
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":";;;;;;AAYA;;iBAAgB,MAAA,uBACO,WAAA,sDAAA,CAGtB,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EACC,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,IAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;;;;iBAK7C,MAAA,uBACO,WAAA,6BACA,WAAA,sDAAA,CAErB,OAAA;EACD,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA,OAAa,OAAA,wBAA+B,IAAA;AAAA,IACtD,QAAA,CACH,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,GAAU,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as MergeExtends } from "./types-
|
|
3
|
-
import { EnvSchema, type } from "arkenv";
|
|
1
|
+
import { a as $, i as Dict, t as SchemaShape } from "./index-Dypl5Zzg.js";
|
|
2
|
+
import { t as MergeExtends } from "./types-gP-eTDyz.js";
|
|
3
|
+
import { EnvSchema, type } from "@arkenv/core";
|
|
4
4
|
import { distill, type as type$1 } from "arktype";
|
|
5
5
|
|
|
6
6
|
//#region src/server.d.ts
|
|
@@ -11,6 +11,9 @@ declare function arkenv<const TSchema extends SchemaShape = {}, const TExtends e
|
|
|
11
11
|
extends?: [...TExtends];
|
|
12
12
|
runtimeEnv?: Dict<string>;
|
|
13
13
|
}): Readonly<distill.Out<type$1.infer<TSchema, $>> & MergeExtends<TExtends>>;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`
|
|
16
|
+
*/
|
|
14
17
|
declare function arkenv<const TServer extends SchemaShape = {}, const TShared extends SchemaShape = {}, const TExtends extends readonly unknown[] = []>(options: {
|
|
15
18
|
server?: EnvSchema<TServer>;
|
|
16
19
|
shared?: EnvSchema<TShared>;
|
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":";;;;;;;AAYA;;iBAAgB,MAAA,uBACO,WAAA,sDAAA,CAGtB,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EACC,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,IAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA;;;;iBAK7C,MAAA,uBACO,WAAA,6BACA,WAAA,sDAAA,CAErB,OAAA;EACD,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,MAAA,GAAS,SAAA,CAAU,OAAA;EACnB,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,MAAA,OAAa,OAAA,wBAA+B,IAAA;AAAA,IACtD,QAAA,CACH,OAAA,CAAQ,GAAA,CAAI,MAAA,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-Do5bRP26.js";import{arkenv as t,getSchemaKeys as n,type as r}from"@arkenv/core";import"server-only";function i(r,i){if(r&&typeof r==`object`&&(`runtimeEnv`in r||`server`in r||`shared`in r)){if(`client`in r)throw Error(`server entry point only accepts 'server' and 'shared' schemas.`);return e(r,!0,void 0,t,n)}return e(r,i,{isServer:!0,strictLayout:`server`},t,n)}export{i as arkenv,i as default,r as type};
|
|
2
2
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","names":[],"sources":["../src/server.ts"],"sourcesContent":["import \"server-only\";\nimport type {
|
|
1
|
+
{"version":3,"file":"server.js","names":["coreArkenv"],"sources":["../src/server.ts"],"sourcesContent":["import \"server-only\";\nimport type { EnvSchema } from \"@arkenv/core\";\nimport { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/core\";\nimport type { $ } from \"@repo/scope\";\nimport type { Dict, SchemaShape } from \"@repo/types\";\nimport type { type as at, distill } from \"arktype\";\nimport { arkenvInternal } from \"./arkenv-internal\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Server entry point).\n */\nexport function arkenv<\n\tconst TSchema extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>>;\n\n/**\n * @deprecated Use the unified flat layout signature instead: `arkenv(schema, options)`\n */\nexport function arkenv<\n\tconst TServer extends SchemaShape = {},\n\tconst TShared extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(options: {\n\tserver?: EnvSchema<TServer>;\n\tshared?: EnvSchema<TShared>;\n\textends?: [...TExtends];\n\truntimeEnv?: Record<keyof TShared, string | undefined> & Dict<string>;\n}): Readonly<\n\tdistill.Out<at.infer<TServer & TShared, $>> & MergeExtends<TExtends>\n>;\n\nexport function arkenv(schemaOrOptions: any, optionsOrIsServer?: any): any {\n\tconst isLegacy =\n\t\tschemaOrOptions &&\n\t\ttypeof schemaOrOptions === \"object\" &&\n\t\t(\"runtimeEnv\" in schemaOrOptions ||\n\t\t\t\"server\" in schemaOrOptions ||\n\t\t\t\"shared\" in schemaOrOptions);\n\n\tif (isLegacy) {\n\t\tif (\"client\" in schemaOrOptions) {\n\t\t\tthrow new Error(\n\t\t\t\t\"server entry point only accepts 'server' and 'shared' schemas.\",\n\t\t\t);\n\t\t}\n\t\treturn arkenvInternal(\n\t\t\tschemaOrOptions,\n\t\t\ttrue,\n\t\t\tundefined,\n\t\t\tcoreArkenv,\n\t\t\tgetSchemaKeys,\n\t\t);\n\t}\n\n\treturn arkenvInternal(\n\t\tschemaOrOptions,\n\t\toptionsOrIsServer,\n\t\t{ isServer: true, strictLayout: \"server\" },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport { type } from \"@arkenv/core\";\n\nexport default arkenv;\n"],"mappings":"yIAuCA,SAAgB,EAAO,EAAsB,EAA8B,CAQ1E,GANC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GAEA,CACb,GAAI,WAAY,EACf,MAAU,MACT,iEACA,CAEF,OAAO,EACN,EACA,GACA,IAAA,GACAA,EACA,EACA,CAGF,OAAO,EACN,EACA,EACA,CAAE,SAAU,GAAM,aAAc,SAAU,CAC1CA,EACA,EACA"}
|
package/dist/shared.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./arkenv-internal-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`./config-DNJIS9zz.cjs`);const e=require(`./arkenv-internal-Dz0mDRKT.cjs`);let t=require(`@arkenv/core`);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,Object.defineProperty(exports,`type`,{enumerable:!0,get:function(){return t.type}});
|
|
2
2
|
//# sourceMappingURL=shared.cjs.map
|
package/dist/shared.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.cjs","names":["
|
|
1
|
+
{"version":3,"file":"shared.cjs","names":["arkenvInternal","coreArkenv","getSchemaKeys"],"sources":["../src/shared.ts"],"sourcesContent":["import type { EnvSchema } from \"@arkenv/core\";\nimport { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/core\";\nimport type { $ } from \"@repo/scope\";\nimport type { Dict, SchemaShape } from \"@repo/types\";\nimport type { type as at, distill } from \"arktype\";\nimport { arkenvInternal } from \"./arkenv-internal\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Shared entry point).\n */\nexport function arkenv<\n\tconst TSchema extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>> {\n\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 { type } from \"@arkenv/core\";\n\nexport default arkenv;\n"],"mappings":"gNAWA,SAAgB,EAIf,EACA,EAIuE,CAEvE,OAAOA,EAAAA,EACN,EACA,EACA,CACC,SALe,OAAO,OAAW,IAMjC,SAAU,GACV,CACDC,EAAAA,OACAC,EAAAA,cACA"}
|
package/dist/shared.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as MergeExtends } from "./types-
|
|
1
|
+
import { a as $, i as Dict, t as SchemaShape } from "./index-96RGPyfa.cjs";
|
|
2
|
+
import { t as MergeExtends } from "./types-44R9mgTa.cjs";
|
|
3
|
+
import { EnvSchema, type } from "@arkenv/core";
|
|
3
4
|
import { distill, type as type$1 } from "arktype";
|
|
4
|
-
import { EnvSchema, type } from "arkenv";
|
|
5
5
|
|
|
6
6
|
//#region src/shared.d.ts
|
|
7
7
|
/**
|
package/dist/shared.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.cts","names":[],"sources":["../src/shared.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"shared.d.cts","names":[],"sources":["../src/shared.ts"],"mappings":";;;;;;;AAWA;;iBAAgB,MAAA,uBACO,WAAA,sDAAA,CAGtB,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EACC,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,IAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA"}
|
package/dist/shared.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as MergeExtends } from "./types-
|
|
3
|
-
import { EnvSchema, type } from "arkenv";
|
|
1
|
+
import { a as $, i as Dict, t as SchemaShape } from "./index-Dypl5Zzg.js";
|
|
2
|
+
import { t as MergeExtends } from "./types-gP-eTDyz.js";
|
|
3
|
+
import { EnvSchema, type } from "@arkenv/core";
|
|
4
4
|
import { distill, type as type$1 } from "arktype";
|
|
5
5
|
|
|
6
6
|
//#region src/shared.d.ts
|
package/dist/shared.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","names":[],"sources":["../src/shared.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"shared.d.ts","names":[],"sources":["../src/shared.ts"],"mappings":";;;;;;;AAWA;;iBAAgB,MAAA,uBACO,WAAA,sDAAA,CAGtB,MAAA,EAAQ,SAAA,CAAU,OAAA,GAClB,OAAA;EACC,OAAA,OAAc,QAAA;EACd,UAAA,GAAa,IAAA;AAAA,IAEZ,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAG,KAAA,CAAM,OAAA,EAAS,CAAA,KAAM,YAAA,CAAa,QAAA"}
|
package/dist/shared.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./arkenv-internal-
|
|
1
|
+
import{t as e}from"./arkenv-internal-Do5bRP26.js";import{arkenv as t,getSchemaKeys as n,type as r}from"@arkenv/core";function i(r,i){return e(r,i,{isServer:typeof window>`u`,isShared:!0},t,n)}export{i as arkenv,i as default,r as type};
|
|
2
2
|
//# sourceMappingURL=shared.js.map
|
package/dist/shared.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","names":[],"sources":["../src/shared.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"shared.js","names":["coreArkenv"],"sources":["../src/shared.ts"],"sourcesContent":["import type { EnvSchema } from \"@arkenv/core\";\nimport { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/core\";\nimport type { $ } from \"@repo/scope\";\nimport type { Dict, SchemaShape } from \"@repo/types\";\nimport type { type as at, distill } from \"arktype\";\nimport { arkenvInternal } from \"./arkenv-internal\";\nimport type { MergeExtends } from \"./types\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Shared entry point).\n */\nexport function arkenv<\n\tconst TSchema extends SchemaShape = {},\n\tconst TExtends extends readonly unknown[] = [],\n>(\n\tschema: EnvSchema<TSchema>,\n\toptions?: {\n\t\textends?: [...TExtends];\n\t\truntimeEnv?: Dict<string>;\n\t},\n): Readonly<distill.Out<at.infer<TSchema, $>> & MergeExtends<TExtends>> {\n\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 { type } from \"@arkenv/core\";\n\nexport default arkenv;\n"],"mappings":"qHAWA,SAAgB,EAIf,EACA,EAIuE,CAEvE,OAAO,EACN,EACA,EACA,CACC,SALe,OAAO,OAAW,IAMjC,SAAU,GACV,CACDA,EACA,EACA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../config-DNJIS9zz.cjs`);const e=require(`../arkenv-internal-Dz0mDRKT.cjs`);let t=require(`@arkenv/standard`);function n(n,r){if(n&&typeof n==`object`&&(`runtimeEnv`in n||`client`in n||`shared`in n)){if(`server`in n)throw Error(`client entry point only accepts 'client' and 'shared' schemas.`);return e.t(n,!1,void 0,t.arkenv,t.getSchemaKeys)}return e.t(n,r,{isServer:!1},t.arkenv,t.getSchemaKeys)}exports.arkenv=n,exports.default=n;
|
|
2
|
+
//# sourceMappingURL=client.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.cjs","names":["arkenvInternal","coreArkenv","getSchemaKeys"],"sources":["../../src/standard/client.ts"],"sourcesContent":["import { arkenv as coreArkenv, getSchemaKeys } from \"@arkenv/standard\";\nimport type { Dict, StandardSchemaV1 } from \"@repo/types\";\nimport { arkenvInternal } from \"@/arkenv-internal\";\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications (Client entry point, Standard Mode).\n *\n * @param schema A flat schema of `NEXT_PUBLIC_*` Standard Schema validators\n * @param options Optional extends and runtimeEnv overrides\n * @returns A validated, readonly environment variables object\n */\nexport function arkenv<\n\tconst TSchema extends Record<string, StandardSchemaV1> = {},\n>(\n\tschema: TSchema & {\n\t\t[K in keyof TSchema]: K extends `NEXT_PUBLIC_${string}` ? unknown : never;\n\t},\n\toptions?: {\n\t\textends?: readonly unknown[];\n\t\truntimeEnv: Record<keyof TSchema, string | undefined> & Dict<string>;\n\t},\n): Readonly<{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> }>;\n\n/**\n * Create a validated, type-safe environment configuration for Next.js applications using\n * the split client/shared schema pattern (Client entry point, Standard Mode).\n *\n * @param options The environment validation configuration with client and shared schemas\n * @returns A validated, readonly environment variables object\n */\nexport function arkenv<\n\tconst TClient extends Record<string, StandardSchemaV1> = {},\n\tconst TShared extends Record<string, StandardSchemaV1> = {},\n>(options: {\n\tclient?: TClient & {\n\t\t[K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never;\n\t};\n\tshared?: TShared;\n\textends?: readonly unknown[];\n\truntimeEnv: Record<keyof TClient | keyof TShared, unknown> &\n\t\tRecord<string, unknown>;\n}): Readonly<{\n\t[K in keyof (TClient & TShared)]: StandardSchemaV1.InferOutput<\n\t\t(TClient & TShared)[K]\n\t>;\n}>;\n\nexport function arkenv(schemaOrOptions: any, optionsOrIsServer?: any): any {\n\tconst isLegacy =\n\t\tschemaOrOptions &&\n\t\ttypeof schemaOrOptions === \"object\" &&\n\t\t(\"runtimeEnv\" in schemaOrOptions ||\n\t\t\t\"client\" in schemaOrOptions ||\n\t\t\t\"shared\" in schemaOrOptions);\n\n\tif (isLegacy) {\n\t\tif (\"server\" in schemaOrOptions) {\n\t\t\tthrow new Error(\n\t\t\t\t\"client entry point only accepts 'client' and 'shared' schemas.\",\n\t\t\t);\n\t\t}\n\t\treturn arkenvInternal(\n\t\t\tschemaOrOptions,\n\t\t\tfalse,\n\t\t\tundefined,\n\t\t\tcoreArkenv,\n\t\t\tgetSchemaKeys,\n\t\t);\n\t}\n\n\treturn arkenvInternal(\n\t\tschemaOrOptions,\n\t\toptionsOrIsServer,\n\t\t{ isServer: false },\n\t\tcoreArkenv,\n\t\tgetSchemaKeys,\n\t);\n}\n\nexport default arkenv;\n"],"mappings":"sNA+CA,SAAgB,EAAO,EAAsB,EAA8B,CAQ1E,GANC,GACA,OAAO,GAAoB,WAC1B,eAAgB,GAChB,WAAY,GACZ,WAAY,GAEA,CACb,GAAI,WAAY,EACf,MAAU,MACT,iEACA,CAEF,OAAOA,EAAAA,EACN,EACA,GACA,IAAA,GACAC,EAAAA,OACAC,EAAAA,cACA,CAGF,OAAOF,EAAAA,EACN,EACA,EACA,CAAE,SAAU,GAAO,CACnBC,EAAAA,OACAC,EAAAA,cACA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { i as Dict, r as StandardSchemaV1 } from "../index-96RGPyfa.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/standard/client.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Create a validated, type-safe environment configuration for Next.js applications (Client entry point, Standard Mode).
|
|
6
|
+
*
|
|
7
|
+
* @param schema A flat schema of `NEXT_PUBLIC_*` Standard Schema validators
|
|
8
|
+
* @param options Optional extends and runtimeEnv overrides
|
|
9
|
+
* @returns A validated, readonly environment variables object
|
|
10
|
+
*/
|
|
11
|
+
declare function arkenv<const TSchema extends Record<string, StandardSchemaV1> = {}>(schema: TSchema & { [K in keyof TSchema]: K extends `NEXT_PUBLIC_${string}` ? unknown : never }, options?: {
|
|
12
|
+
extends?: readonly unknown[];
|
|
13
|
+
runtimeEnv: Record<keyof TSchema, string | undefined> & Dict<string>;
|
|
14
|
+
}): Readonly<{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> }>;
|
|
15
|
+
/**
|
|
16
|
+
* Create a validated, type-safe environment configuration for Next.js applications using
|
|
17
|
+
* the split client/shared schema pattern (Client entry point, Standard Mode).
|
|
18
|
+
*
|
|
19
|
+
* @param options The environment validation configuration with client and shared schemas
|
|
20
|
+
* @returns A validated, readonly environment variables object
|
|
21
|
+
*/
|
|
22
|
+
declare function arkenv<const TClient extends Record<string, StandardSchemaV1> = {}, const TShared extends Record<string, StandardSchemaV1> = {}>(options: {
|
|
23
|
+
client?: TClient & { [K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never };
|
|
24
|
+
shared?: TShared;
|
|
25
|
+
extends?: readonly unknown[];
|
|
26
|
+
runtimeEnv: Record<keyof TClient | keyof TShared, unknown> & Record<string, unknown>;
|
|
27
|
+
}): Readonly<{ [K in keyof (TClient & TShared)]: StandardSchemaV1.InferOutput<(TClient & TShared)[K]> }>;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { arkenv, arkenv as default };
|
|
30
|
+
//# sourceMappingURL=client.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.cts","names":[],"sources":["../../src/standard/client.ts"],"mappings":";;;;;AAWA;;;;;iBAAgB,MAAA,uBACO,MAAA,SAAe,gBAAA,OAAA,CAErC,MAAA,EAAQ,OAAA,iBACK,OAAA,GAAU,CAAA,sDAEvB,OAAA;EACC,OAAA;EACA,UAAA,EAAY,MAAA,OAAa,OAAA,wBAA+B,IAAA;AAAA,IAEvD,QAAA,eAAuB,OAAA,GAAU,gBAAA,CAAiB,WAAA,CAAY,OAAA,CAAQ,CAAA;;;;;;;;iBASzD,MAAA,uBACO,MAAA,SAAe,gBAAA,8BACf,MAAA,SAAe,gBAAA,OAAA,CACpC,OAAA;EACD,MAAA,GAAS,OAAA,iBACI,OAAA,GAAU,CAAA;EAEvB,MAAA,GAAS,OAAA;EACT,OAAA;EACA,UAAA,EAAY,MAAA,OAAa,OAAA,SAAgB,OAAA,aACxC,MAAA;AAAA,IACE,QAAA,gBACU,OAAA,GAAU,OAAA,IAAW,gBAAA,CAAiB,WAAA,EACjD,OAAA,GAAU,OAAA,EAAS,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { i as Dict, r as StandardSchemaV1 } from "../index-Dypl5Zzg.js";
|
|
2
|
+
|
|
3
|
+
//#region src/standard/client.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Create a validated, type-safe environment configuration for Next.js applications (Client entry point, Standard Mode).
|
|
6
|
+
*
|
|
7
|
+
* @param schema A flat schema of `NEXT_PUBLIC_*` Standard Schema validators
|
|
8
|
+
* @param options Optional extends and runtimeEnv overrides
|
|
9
|
+
* @returns A validated, readonly environment variables object
|
|
10
|
+
*/
|
|
11
|
+
declare function arkenv<const TSchema extends Record<string, StandardSchemaV1> = {}>(schema: TSchema & { [K in keyof TSchema]: K extends `NEXT_PUBLIC_${string}` ? unknown : never }, options?: {
|
|
12
|
+
extends?: readonly unknown[];
|
|
13
|
+
runtimeEnv: Record<keyof TSchema, string | undefined> & Dict<string>;
|
|
14
|
+
}): Readonly<{ [K in keyof TSchema]: StandardSchemaV1.InferOutput<TSchema[K]> }>;
|
|
15
|
+
/**
|
|
16
|
+
* Create a validated, type-safe environment configuration for Next.js applications using
|
|
17
|
+
* the split client/shared schema pattern (Client entry point, Standard Mode).
|
|
18
|
+
*
|
|
19
|
+
* @param options The environment validation configuration with client and shared schemas
|
|
20
|
+
* @returns A validated, readonly environment variables object
|
|
21
|
+
*/
|
|
22
|
+
declare function arkenv<const TClient extends Record<string, StandardSchemaV1> = {}, const TShared extends Record<string, StandardSchemaV1> = {}>(options: {
|
|
23
|
+
client?: TClient & { [K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never };
|
|
24
|
+
shared?: TShared;
|
|
25
|
+
extends?: readonly unknown[];
|
|
26
|
+
runtimeEnv: Record<keyof TClient | keyof TShared, unknown> & Record<string, unknown>;
|
|
27
|
+
}): Readonly<{ [K in keyof (TClient & TShared)]: StandardSchemaV1.InferOutput<(TClient & TShared)[K]> }>;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { arkenv, arkenv as default };
|
|
30
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","names":[],"sources":["../../src/standard/client.ts"],"mappings":";;;;;AAWA;;;;;iBAAgB,MAAA,uBACO,MAAA,SAAe,gBAAA,OAAA,CAErC,MAAA,EAAQ,OAAA,iBACK,OAAA,GAAU,CAAA,sDAEvB,OAAA;EACC,OAAA;EACA,UAAA,EAAY,MAAA,OAAa,OAAA,wBAA+B,IAAA;AAAA,IAEvD,QAAA,eAAuB,OAAA,GAAU,gBAAA,CAAiB,WAAA,CAAY,OAAA,CAAQ,CAAA;;;;;;;;iBASzD,MAAA,uBACO,MAAA,SAAe,gBAAA,8BACf,MAAA,SAAe,gBAAA,OAAA,CACpC,OAAA;EACD,MAAA,GAAS,OAAA,iBACI,OAAA,GAAU,CAAA;EAEvB,MAAA,GAAS,OAAA;EACT,OAAA;EACA,UAAA,EAAY,MAAA,OAAa,OAAA,SAAgB,OAAA,aACxC,MAAA;AAAA,IACE,QAAA,gBACU,OAAA,GAAU,OAAA,IAAW,gBAAA,CAAiB,WAAA,EACjD,OAAA,GAAU,OAAA,EAAS,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"../arkenv-internal-Do5bRP26.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
|
+
//# sourceMappingURL=client.js.map
|