Commit 98707c2
fix(www): use v1 docs URL in agent onboarding prompt during pre-release (#1816)
## Summary
Resolves an issue where the "Copy prompt" button copied an onboarding
prompt linking to `https://arkenv.js.org/llms.txt` (the v0 docs site)
instead of `https://arkenv-v1.vercel.app/llms.txt` (the v1 site during
pre-release).
### Root Causes
1. `FALLBACK_DOCS_URL` in `apps/www/lib/config/release.ts` was hardcoded
to `https://arkenv.js.org`.
2. In Next.js client components (`InstallPanel` is `"use client"`),
non-`NEXT_PUBLIC_*` variables (`VERCEL_PROJECT_PRODUCTION_URL` and
`VERCEL_URL`) are omitted from client bundles and evaluate to
`undefined`, always triggering the fallback.
3. On Vercel, `VERCEL_PROJECT_PRODUCTION_URL` is populated with
`arkenv.js.org` (the primary domain of the v0 deployment) across all
deployments. Because `getDocsUrl` checked
`VERCEL_PROJECT_PRODUCTION_URL` before preview URLs, it resolved to the
v0 domain.
### Changes
- Updated `FALLBACK_DOCS_URL` to dynamically resolve based on
`RELEASE_TAG`:
- `https://arkenv-v1.vercel.app` during pre-release (`alpha` / `rc`).
- `https://arkenv.js.org` when graduating to GA (empty `RELEASE_TAG`).
- Added a guard in `getDocsUrl` to ignore `arkenv.js.org` from
`VERCEL_PROJECT_PRODUCTION_URL` while `RELEASE_TAG` is set, preventing
pre-release prompt copy from referencing v0 docs.
- Checked `NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL` and
`NEXT_PUBLIC_VERCEL_URL` alongside server environment variables.
- Updated unit tests in `apps/www/lib/config/release.test.ts`.
## Test Plan
- [x] `pnpm --filter=www test -- lib/config/release.test.ts
components/page/install-panel.test.tsx --run`
- [x] `pnpm typecheck`
- [x] `pnpm biome check apps/www/lib/config/release.ts
apps/www/lib/config/release.test.ts`
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>1 parent 232446b commit 98707c2
2 files changed
Lines changed: 84 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
75 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| |||
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
100 | 111 | | |
101 | 112 | | |
102 | | - | |
103 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
104 | 122 | | |
105 | 123 | | |
106 | 124 | | |
| |||
110 | 128 | | |
111 | 129 | | |
112 | 130 | | |
113 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
114 | 138 | | |
115 | 139 | | |
116 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
117 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
118 | 158 | | |
119 | 159 | | |
120 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
19 | 27 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
23 | 31 | | |
24 | 32 | | |
25 | | - | |
26 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
27 | 36 | | |
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
31 | 51 | | |
32 | | - | |
| 52 | + | |
33 | 53 | | |
34 | 54 | | |
35 | 55 | | |
36 | 56 | | |
37 | 57 | | |
38 | 58 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
42 | 62 | | |
43 | 63 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
48 | 73 | | |
49 | 74 | | |
50 | | - | |
| 75 | + | |
51 | 76 | | |
52 | 77 | | |
53 | 78 | | |
| |||
0 commit comments