Skip to content

Commit 164fb2c

Browse files
committed
refact(nextjs): rename flat layout option 'expose' to 'exposeToClient'
1 parent 70513e0 commit 164fb2c

17 files changed

Lines changed: 1238 additions & 50 deletions

File tree

.agents/scratch/comments.json

Lines changed: 476 additions & 0 deletions
Large diffs are not rendered by default.

.agents/scratch/parse_pr.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import json
2+
import os
3+
4+
scratch_dir = "/Users/yamcodes/.gemini/antigravity/worktrees/arkenv/resolve-issue-1145/.agents/scratch"
5+
6+
def read_json(filename):
7+
with open(os.path.join(scratch_dir, filename), "r") as f:
8+
return json.load(f)
9+
10+
print("=== PR DETAILS ===")
11+
pr = read_json("pr.json")
12+
print(f"Title: {pr.get('title')}")
13+
print(f"State: {pr.get('state')}")
14+
print(f"User: {pr.get('user', {}).get('login')}")
15+
print(f"Body:\n{pr.get('body')}\n")
16+
17+
print("=== REVIEWS ===")
18+
reviews = read_json("reviews.json")
19+
for r in reviews:
20+
print(f"Reviewer: {r.get('user', {}).get('login')}")
21+
print(f"State: {r.get('state')}")
22+
print(f"Body: {r.get('body')}")
23+
print("-" * 40)
24+
25+
print("\n=== COMMENTS ===")
26+
comments = read_json("comments.json")
27+
for c in comments:
28+
print(f"Author: {c.get('user', {}).get('login')}")
29+
print(f"Body: {c.get('body')}")
30+
print("-" * 40)
31+
32+
print("\n=== LINE COMMENTS / REVIEW COMMENTS ===")
33+
rev_comments = read_json("review_comments.json")
34+
for rc in rev_comments:
35+
print(f"Author: {rc.get('user', {}).get('login')}")
36+
print(f"File: {rc.get('path')}")
37+
print(f"Line (diff): {rc.get('original_line') or rc.get('line')}")
38+
print(f"Body: {rc.get('body')}")
39+
print("-" * 40)

.agents/scratch/pr.json

Lines changed: 436 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
[
2+
{
3+
"url": "https://api.github.com/repos/yamcodes/arkenv/pulls/comments/3443631309",
4+
"pull_request_review_id": 4534203043,
5+
"id": 3443631309,
6+
"node_id": "PRRC_kwDONvYw487NQaTN",
7+
"diff_hunk": "@@ -220,10 +235,20 @@ export function createEnvInternal(\n \t\t}\n \t}\n \n+\tconst globalEnv =\n+\t\ttypeof globalThis !== \"undefined\"\n+\t\t\t? (globalThis as any).__arkenv_env__\n+\t\t\t: undefined;\n+\n \tfor (const key of Object.keys(runtimeEnv)) {\n \t\tif (runtimeEnv[key] !== undefined) {\n \t\t\tcombinedEnv[key] = runtimeEnv[key];\n \t\t}\n+\t\tif (globalEnv && globalEnv[key] !== undefined) {",
8+
"path": "packages/nextjs/src/create-env.ts",
9+
"commit_id": "76b99f8d62c50553839deaa1d21c378fdcf4d6e7",
10+
"original_commit_id": "76b99f8d62c50553839deaa1d21c378fdcf4d6e7",
11+
"user": {
12+
"login": "pullfrog[bot]",
13+
"id": 226033991,
14+
"node_id": "BOT_kgDODXkBRw",
15+
"avatar_url": "https://avatars.githubusercontent.com/in/1768019?v=4",
16+
"gravatar_id": "",
17+
"url": "https://api.github.com/users/pullfrog%5Bbot%5D",
18+
"html_url": "https://github.com/apps/pullfrog",
19+
"followers_url": "https://api.github.com/users/pullfrog%5Bbot%5D/followers",
20+
"following_url": "https://api.github.com/users/pullfrog%5Bbot%5D/following{/other_user}",
21+
"gists_url": "https://api.github.com/users/pullfrog%5Bbot%5D/gists{/gist_id}",
22+
"starred_url": "https://api.github.com/users/pullfrog%5Bbot%5D/starred{/owner}{/repo}",
23+
"subscriptions_url": "https://api.github.com/users/pullfrog%5Bbot%5D/subscriptions",
24+
"organizations_url": "https://api.github.com/users/pullfrog%5Bbot%5D/orgs",
25+
"repos_url": "https://api.github.com/users/pullfrog%5Bbot%5D/repos",
26+
"events_url": "https://api.github.com/users/pullfrog%5Bbot%5D/events{/privacy}",
27+
"received_events_url": "https://api.github.com/users/pullfrog%5Bbot%5D/received_events",
28+
"type": "Bot",
29+
"user_view_type": "public",
30+
"site_admin": false
31+
},
32+
"body": "ℹ️ `globalThis.__arkenv_env__` values are applied in `createEnvInternal` (here) AND already embedded in the generated `runtimeEnv` template strings (e.g. `typeof window !== \"undefined\" ? (globalThis as any).__arkenv_env__?.${key} ?? process.env.${key} : process.env.${key}`). This means `__arkenv_env__` values are written into `combinedEnv` twice — once via the resolved `runtimeEnv` value and once directly from `globalEnv`. The result is the same value written twice, so it's harmless, but worth noting the double path exists.",
33+
"created_at": "2026-06-19T16:27:41Z",
34+
"updated_at": "2026-06-19T16:27:42Z",
35+
"html_url": "https://github.com/yamcodes/arkenv/pull/1218#discussion_r3443631309",
36+
"pull_request_url": "https://api.github.com/repos/yamcodes/arkenv/pulls/1218",
37+
"_links": {
38+
"self": {
39+
"href": "https://api.github.com/repos/yamcodes/arkenv/pulls/comments/3443631309"
40+
},
41+
"html": {
42+
"href": "https://github.com/yamcodes/arkenv/pull/1218#discussion_r3443631309"
43+
},
44+
"pull_request": {
45+
"href": "https://api.github.com/repos/yamcodes/arkenv/pulls/1218"
46+
}
47+
},
48+
"reactions": {
49+
"url": "https://api.github.com/repos/yamcodes/arkenv/pulls/comments/3443631309/reactions",
50+
"total_count": 0,
51+
"+1": 0,
52+
"-1": 0,
53+
"laugh": 0,
54+
"hooray": 0,
55+
"confused": 0,
56+
"heart": 0,
57+
"rocket": 0,
58+
"eyes": 0
59+
},
60+
"start_line": null,
61+
"original_start_line": null,
62+
"start_side": null,
63+
"line": 247,
64+
"original_line": 247,
65+
"side": "RIGHT",
66+
"author_association": "CONTRIBUTOR",
67+
"original_position": 50,
68+
"position": 50,
69+
"subject_type": "line"
70+
},
71+
{
72+
"url": "https://api.github.com/repos/yamcodes/arkenv/pulls/comments/3443642776",
73+
"pull_request_review_id": 4534215833,
74+
"id": 3443642776,
75+
"node_id": "PRRC_kwDONvYw487NQdGY",
76+
"diff_hunk": "@@ -0,0 +1,25 @@\n+---\n+\"@arkenv/nextjs\": patch\n+\"@arkenv/cli\": patch\n+---\n+\n+#### Add Flat Layout Mode for Next.js integration\n+\n+Introduce a new \"Flat\" layout mode for `@arkenv/nextjs`. The Flat API allows developers to define a flat schema mapping directly to their `.env` file structure:\n+\n+```ts\n+import arkenv from \"./generated/env.gen\";\n+\n+export const env = arkenv({\n+\tDATABASE_URL: \"string\",\n+\tNEXT_PUBLIC_API_URL: \"string\",\n+\tNODE_ENV: \"'development' | 'production' | 'test' = 'development'\",\n+}, {\n+\tshared: [\"NODE_ENV\"]\n+});",
77+
"path": ".changeset/flat-layout-mode.md",
78+
"commit_id": "76b99f8d62c50553839deaa1d21c378fdcf4d6e7",
79+
"original_commit_id": "76b99f8d62c50553839deaa1d21c378fdcf4d6e7",
80+
"user": {
81+
"login": "yamcodes",
82+
"id": 2014360,
83+
"node_id": "MDQ6VXNlcjIwMTQzNjA=",
84+
"avatar_url": "https://avatars.githubusercontent.com/u/2014360?v=4",
85+
"gravatar_id": "",
86+
"url": "https://api.github.com/users/yamcodes",
87+
"html_url": "https://github.com/yamcodes",
88+
"followers_url": "https://api.github.com/users/yamcodes/followers",
89+
"following_url": "https://api.github.com/users/yamcodes/following{/other_user}",
90+
"gists_url": "https://api.github.com/users/yamcodes/gists{/gist_id}",
91+
"starred_url": "https://api.github.com/users/yamcodes/starred{/owner}{/repo}",
92+
"subscriptions_url": "https://api.github.com/users/yamcodes/subscriptions",
93+
"organizations_url": "https://api.github.com/users/yamcodes/orgs",
94+
"repos_url": "https://api.github.com/users/yamcodes/repos",
95+
"events_url": "https://api.github.com/users/yamcodes/events{/privacy}",
96+
"received_events_url": "https://api.github.com/users/yamcodes/received_events",
97+
"type": "User",
98+
"user_view_type": "public",
99+
"site_admin": false
100+
},
101+
"body": "doubting we even need `shared` now, thoughts ? ",
102+
"created_at": "2026-06-19T16:30:56Z",
103+
"updated_at": "2026-06-19T16:30:56Z",
104+
"html_url": "https://github.com/yamcodes/arkenv/pull/1218#discussion_r3443642776",
105+
"pull_request_url": "https://api.github.com/repos/yamcodes/arkenv/pulls/1218",
106+
"_links": {
107+
"self": {
108+
"href": "https://api.github.com/repos/yamcodes/arkenv/pulls/comments/3443642776"
109+
},
110+
"html": {
111+
"href": "https://github.com/yamcodes/arkenv/pull/1218#discussion_r3443642776"
112+
},
113+
"pull_request": {
114+
"href": "https://api.github.com/repos/yamcodes/arkenv/pulls/1218"
115+
}
116+
},
117+
"reactions": {
118+
"url": "https://api.github.com/repos/yamcodes/arkenv/pulls/comments/3443642776/reactions",
119+
"total_count": 0,
120+
"+1": 0,
121+
"-1": 0,
122+
"laugh": 0,
123+
"hooray": 0,
124+
"confused": 0,
125+
"heart": 0,
126+
"rocket": 0,
127+
"eyes": 0
128+
},
129+
"start_line": 17,
130+
"original_start_line": 17,
131+
"start_side": "RIGHT",
132+
"line": 19,
133+
"original_line": 19,
134+
"side": "RIGHT",
135+
"author_association": "OWNER",
136+
"original_position": 19,
137+
"position": 19,
138+
"subject_type": "line"
139+
}
140+
]

.agents/scratch/reviews.json

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
[
2+
{
3+
"id": 4534203043,
4+
"node_id": "PRR_kwDONvYw488AAAABDkJyow",
5+
"user": {
6+
"login": "pullfrog[bot]",
7+
"id": 226033991,
8+
"node_id": "BOT_kgDODXkBRw",
9+
"avatar_url": "https://avatars.githubusercontent.com/in/1768019?v=4",
10+
"gravatar_id": "",
11+
"url": "https://api.github.com/users/pullfrog%5Bbot%5D",
12+
"html_url": "https://github.com/apps/pullfrog",
13+
"followers_url": "https://api.github.com/users/pullfrog%5Bbot%5D/followers",
14+
"following_url": "https://api.github.com/users/pullfrog%5Bbot%5D/following{/other_user}",
15+
"gists_url": "https://api.github.com/users/pullfrog%5Bbot%5D/gists{/gist_id}",
16+
"starred_url": "https://api.github.com/users/pullfrog%5Bbot%5D/starred{/owner}{/repo}",
17+
"subscriptions_url": "https://api.github.com/users/pullfrog%5Bbot%5D/subscriptions",
18+
"organizations_url": "https://api.github.com/users/pullfrog%5Bbot%5D/orgs",
19+
"repos_url": "https://api.github.com/users/pullfrog%5Bbot%5D/repos",
20+
"events_url": "https://api.github.com/users/pullfrog%5Bbot%5D/events{/privacy}",
21+
"received_events_url": "https://api.github.com/users/pullfrog%5Bbot%5D/received_events",
22+
"type": "Bot",
23+
"user_view_type": "public",
24+
"site_admin": false
25+
},
26+
"body": "> ℹ️ No critical issues — minor suggestions inline.\n\n**Reviewed changes** — introduces a new Flat layout mode, a non-wrapping `setupArkEnv` API + side-effect `register` entry point, an `<ArkEnvScript />` SSR component for dynamic client env vars, and refactors `config.ts` to consume `@arkenv/build` for shared parser/watcher/resolver helpers.\n\n- **Flat Layout Mode** — new schema-less API where `arkenv({ DATABASE_URL: \"string\", NEXT_PUBLIC_API_URL: \"string\" }, { shared: [\"NODE_ENV\"] })` replaces `server/client/shared` blocks, with codegen detecting layout from parser\n- **Non-wrapping `setupArkEnv` + `register`** — `setupArkEnv(options)` runs codegen and file-watching without wrapping `nextConfig`; `@arkenv/nextjs/register` side-effect-imports `setupArkEnv()`\n- **`<ArkEnvScript />`** — SSR component injects `NEXT_PUBLIC_*` values into `globalThis.__arkenv_env__` for runtime-overridable client env vars in containerized deployments\n- **Shared parser via `@arkenv/build`** — `config.ts` now imports `resolveLayout`, `findSchemaPath`, `parseBlockKeys`, `extractBlock`, `watchSchema`, and `extractClientKeys`/`extractSharedKeys` from `@arkenv/build` instead of duplicating them locally\n\n<!--\nPullfrog review metadata — for any agent (or human-with-agent) reading this\nreview. Incorporate the fields below into your understanding of the context\nthis review was made in. The findings below were written against\n76b99f8d; if new commits have landed on 1194-featnextjs-nextjs-integration-improvements-dx-setup-dynamic-client-runtime-variables-and-shared-parser-refactoring since this review\nwas submitted, treat any specific bug, file, or line callout as POTENTIALLY\nSTALE — re-diff against 76b99f8d (or trigger a fresh review) and\nfactor commits past 76b99f8d into your understanding of the current\nstate before acting on findings.\n\n- Mode: Review (initial)\n- Files reviewed: 23\n- Commits reviewed: 2\n- Base: dev (12f6090)\n- Head: 1194-featnextjs-nextjs-integration-improvements-dx-setup-dynamic-client-runtime-variables-and-shared-parser-refactoring (76b99f8d)\n- Reviewed commits:\n - 76b99f8d — fix(nextjs): clean up config parsing matches and remove lint comment\n - 6c0aa378 — feat(nextjs): implement flat layout mode and setup standalone API\n- Prior pullfrog review: none\n- Submitted at: 2026-06-19T00:00:00Z\n-->\n\n---\n\n**Note:** 1 inline comment(s) dropped because they did not anchor to lines inside the PR diff:\n- `packages/nextjs/src/config.ts:534` (RIGHT) — line 534 (RIGHT) is not inside a diff hunk\n\n<!-- PULLFROG_DIVIDER_DO_NOT_REMOVE_PLZ -->\n<sup><a href=\"https://pullfrog.com\"><picture><source media=\"(prefers-color-scheme: dark)\" srcset=\"https://pullfrog.com/logos/frog-white-full-18px.png\"><img src=\"https://pullfrog.com/logos/frog-green-full-18px.png\" width=\"9px\" height=\"9px\" style=\"vertical-align: middle; \" alt=\"Pullfrog\"></picture></a>&nbsp;&nbsp;| [Fix all ➔](https://pullfrog.com/trigger/yamcodes/arkenv/1218?action=fix&review_id=4534203043) | [Fix 👍s ➔](https://pullfrog.com/trigger/yamcodes/arkenv/1218?action=fix-approved&review_id=4534203043) | [View workflow run](https://github.com/yamcodes/arkenv/actions/runs/27837092273/job/82387543166) | Using `DeepSeek Pro` (free via [Pullfrog for OSS](https://pullfrog.com/for-oss)) | [𝕏](https://x.com/pullfrogai)</sup>",
27+
"state": "COMMENTED",
28+
"html_url": "https://github.com/yamcodes/arkenv/pull/1218#pullrequestreview-4534203043",
29+
"pull_request_url": "https://api.github.com/repos/yamcodes/arkenv/pulls/1218",
30+
"author_association": "CONTRIBUTOR",
31+
"_links": {
32+
"html": {
33+
"href": "https://github.com/yamcodes/arkenv/pull/1218#pullrequestreview-4534203043"
34+
},
35+
"pull_request": {
36+
"href": "https://api.github.com/repos/yamcodes/arkenv/pulls/1218"
37+
}
38+
},
39+
"submitted_at": "2026-06-19T16:27:42Z",
40+
"commit_id": "76b99f8d62c50553839deaa1d21c378fdcf4d6e7"
41+
},
42+
{
43+
"id": 4534215833,
44+
"node_id": "PRR_kwDONvYw488AAAABDkKkmQ",
45+
"user": {
46+
"login": "yamcodes",
47+
"id": 2014360,
48+
"node_id": "MDQ6VXNlcjIwMTQzNjA=",
49+
"avatar_url": "https://avatars.githubusercontent.com/u/2014360?u=64a1b7ce92773bf15a70dfcbf2eda05343ea93a6&v=4",
50+
"gravatar_id": "",
51+
"url": "https://api.github.com/users/yamcodes",
52+
"html_url": "https://github.com/yamcodes",
53+
"followers_url": "https://api.github.com/users/yamcodes/followers",
54+
"following_url": "https://api.github.com/users/yamcodes/following{/other_user}",
55+
"gists_url": "https://api.github.com/users/yamcodes/gists{/gist_id}",
56+
"starred_url": "https://api.github.com/users/yamcodes/starred{/owner}{/repo}",
57+
"subscriptions_url": "https://api.github.com/users/yamcodes/subscriptions",
58+
"organizations_url": "https://api.github.com/users/yamcodes/orgs",
59+
"repos_url": "https://api.github.com/users/yamcodes/repos",
60+
"events_url": "https://api.github.com/users/yamcodes/events{/privacy}",
61+
"received_events_url": "https://api.github.com/users/yamcodes/received_events",
62+
"type": "User",
63+
"user_view_type": "public",
64+
"site_admin": false
65+
},
66+
"body": "",
67+
"state": "COMMENTED",
68+
"html_url": "https://github.com/yamcodes/arkenv/pull/1218#pullrequestreview-4534215833",
69+
"pull_request_url": "https://api.github.com/repos/yamcodes/arkenv/pulls/1218",
70+
"author_association": "OWNER",
71+
"_links": {
72+
"html": {
73+
"href": "https://github.com/yamcodes/arkenv/pull/1218#pullrequestreview-4534215833"
74+
},
75+
"pull_request": {
76+
"href": "https://api.github.com/repos/yamcodes/arkenv/pulls/1218"
77+
}
78+
},
79+
"submitted_at": "2026-06-19T16:30:56Z",
80+
"commit_id": "76b99f8d62c50553839deaa1d21c378fdcf4d6e7"
81+
}
82+
]

.changeset/flat-layout-mode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const env = arkenv({
1717
});
1818
```
1919

20-
- Filter client-safe keys starting with `NEXT_PUBLIC_` and exposed keys specified in `options.expose`. `NODE_ENV` is implicitly shared.
20+
- Filter client-safe keys starting with `NEXT_PUBLIC_` and exposed keys specified in `options.exposeToClient`. `NODE_ENV` is implicitly shared.
2121
- Exclude server-only keys from autocomplete on the client using TypeScript `Pick`.
2222
- Wrap the returned variables in a Proxy that throws an error at runtime when a server-only variable is accessed on the client.
2323
- Update CLI scaffolding to generate the Flat layout by default.

apps/playgrounds/nextjs-strict/env/generated/env.gen.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
/* eslint-disable */
2-
// prettier-ignore
32
// biome-ignore format: auto-generated
4-
/**
5-
* @file env.gen.ts
6-
* @note This file is auto-generated by ArkEnv. DO NOT EDIT DIRECTLY.
7-
* @see https://arkenv.js.org
8-
*/
3+
// Generated by ArkEnv. DO NOT EDIT DIRECTLY.
94

105
import { createEnv as coreCreateEnv } from "@arkenv/nextjs/client";
116

@@ -31,5 +26,4 @@ export function createEnv<
3126
} as any);
3227
}
3328

34-
const arkenv = createEnv;
35-
export default arkenv;
29+
export default createEnv;
Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
/* eslint-disable */
2-
// prettier-ignore
32
// biome-ignore format: auto-generated
4-
/**
5-
* @file env.gen.ts
6-
* @note This file is auto-generated by ArkEnv. DO NOT EDIT DIRECTLY.
7-
* @see https://arkenv.js.org
8-
*/
3+
// Generated by ArkEnv. DO NOT EDIT DIRECTLY.
94

105
import { createEnv as coreCreateEnv } from "@arkenv/nextjs";
11-
import type { Infer } from "@arkenv/nextjs";
126

137
export { type } from "@arkenv/nextjs";
148

@@ -22,7 +16,7 @@ export function createEnv<
2216
[K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never;
2317
};
2418
shared?: TShared;
25-
}): Readonly<Infer<TServer & TClient & TShared>> {
19+
}) {
2620
return coreCreateEnv({
2721
...options,
2822
runtimeEnv: {
@@ -32,5 +26,4 @@ export function createEnv<
3226
} as any) as any;
3327
}
3428

35-
const arkenv = createEnv;
36-
export default arkenv;
29+
export default createEnv;

examples/with-nextjs-strict/env/generated/env.gen.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
/* eslint-disable */
2-
// prettier-ignore
32
// biome-ignore format: auto-generated
4-
/**
5-
* @file env.gen.ts
6-
* @note This file is auto-generated by ArkEnv. DO NOT EDIT DIRECTLY.
7-
* @see https://arkenv.js.org
8-
*/
3+
// Generated by ArkEnv. DO NOT EDIT DIRECTLY.
94

105
import { createEnv as coreCreateEnv } from "@arkenv/nextjs/client";
116

@@ -25,11 +20,10 @@ export function createEnv<
2520
return coreCreateEnv<TSchema, TExtends>(schema as any, {
2621
...options,
2722
runtimeEnv: {
28-
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
29-
NODE_ENV: process.env.NODE_ENV,
23+
NEXT_PUBLIC_API_URL: typeof window !== "undefined" ? (globalThis as any).__arkenv_env__?.NEXT_PUBLIC_API_URL ?? process.env.NEXT_PUBLIC_API_URL : process.env.NEXT_PUBLIC_API_URL,
24+
NODE_ENV: typeof window !== "undefined" ? (globalThis as any).__arkenv_env__?.NODE_ENV ?? process.env.NODE_ENV : process.env.NODE_ENV,
3025
},
3126
} as any);
3227
}
3328

34-
const arkenv = createEnv;
35-
export default arkenv;
29+
export default createEnv;
Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
/* eslint-disable */
2-
// prettier-ignore
32
// biome-ignore format: auto-generated
4-
/**
5-
* @file env.gen.ts
6-
* @note This file is auto-generated by ArkEnv. DO NOT EDIT DIRECTLY.
7-
* @see https://arkenv.js.org
8-
*/
3+
// Generated by ArkEnv. DO NOT EDIT DIRECTLY.
94

105
import { createEnv as coreCreateEnv } from "@arkenv/nextjs";
11-
import type { Infer } from "@arkenv/nextjs";
126

137
export { type } from "@arkenv/nextjs";
148

@@ -22,15 +16,14 @@ export function createEnv<
2216
[K in keyof TClient]: K extends `NEXT_PUBLIC_${string}` ? unknown : never;
2317
};
2418
shared?: TShared;
25-
}): Readonly<Infer<TServer & TClient & TShared>> {
19+
}) {
2620
return coreCreateEnv({
2721
...options,
2822
runtimeEnv: {
29-
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
30-
NODE_ENV: process.env.NODE_ENV,
23+
NEXT_PUBLIC_API_URL: typeof window !== "undefined" ? (globalThis as any).__arkenv_env__?.NEXT_PUBLIC_API_URL ?? process.env.NEXT_PUBLIC_API_URL : process.env.NEXT_PUBLIC_API_URL,
24+
NODE_ENV: typeof window !== "undefined" ? (globalThis as any).__arkenv_env__?.NODE_ENV ?? process.env.NODE_ENV : process.env.NODE_ENV,
3125
},
3226
} as any) as any;
3327
}
3428

35-
const arkenv = createEnv;
36-
export default arkenv;
29+
export default createEnv;

0 commit comments

Comments
 (0)