Skip to content

fix(www): use v1 docs URL in agent onboarding prompt during pre-release - #1816

Merged
yamcodes merged 6 commits into
v1from
fix_copy_prompt_url
Sep 11, 2026
Merged

yamcodes merged 6 commits into
v1from
fix_copy_prompt_url

Conversation

@yamcodes

@yamcodes yamcodes commented Sep 6, 2026

Copy link
Copy Markdown
Owner

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

  • pnpm --filter=www test -- lib/config/release.test.ts components/page/install-panel.test.tsx --run
  • pnpm typecheck
  • pnpm biome check apps/www/lib/config/release.ts apps/www/lib/config/release.test.ts

@changeset-bot

changeset-bot Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0340a78

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added www Improvements or additions to arkenv.js.org tests This issue or PR is about adding, removing or changing tests labels Sep 6, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Minor suggestions only — the fix resolves the reported bug and the tests pin it.

Reviewed changes

  • Dynamic FALLBACK_DOCS_URL (arkenv-v1.vercel.app during pre-release, arkenv.js.org for GA) so copied agent prompts reference the v1 docs site while alpha/rc is active.
  • getDocsUrl now reads NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL / NEXT_PUBLIC_VERCEL_URL (client-bundle carried) alongside the server-side Vercel vars, and skips a arkenv.js.org production host while a release tag is set.
  • Unit tests extended — new coverage for the NEXT_PUBLIC_* client path, the arkenv.js.org skip, and the v1 fallback. Verified green (227 passed in the www suite).

I confirmed the premise live before merging: https://arkenv-v1.vercel.app/llms.txt serves the v1 docs (Core concepts, @arkenv/core/@arkenv/standard) while https://arkenv.js.org/llms.txt still serves v0 (@arkenv/cli) — consistent with the preview workflow aliasing v1 branch builds to arkenv-v1.vercel.app while deploy-www.yml only promotes main.

ℹ️ GA flip depends on an explicit empty RELEASE_TAG

RELEASE_TAG defaults to "alpha" when unset, and the new FALLBACK_DOCS_URL is keyed off it. At GA, returning the fallback to arkenv.js.org requires the release-tag env var to be explicitly set to an empty string — not just removed — or copied prompts keep pointing at arkenv-v1.vercel.app (and the CLI tag stays @alpha). This mirrors the existing initCommand mechanism, so it's likely already in the plan; worth confirming the runbook says "set to empty", not "remove".

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread apps/www/lib/config/release.ts Outdated
Comment thread apps/www/lib/config/release.test.ts
yamcodes and others added 2 commits September 11, 2026 21:30
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@yamcodes

Copy link
Copy Markdown
Owner Author

@pullfrog review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one formatting nit inline.

Reviewed changes (incremental since the prior pullfrog review of 2aa03f7)

  • Extracted a firstNonEmpty helper in getDocsUrl that prefers the first non-empty trimmed value across the NEXT_PUBLIC_* / server-side var pairs, replacing the ?? chains (this also lets an empty-string NEXT_PUBLIC_* fall through to the server var instead of short-circuiting).
  • Hardened the pre-release guard to strip an http:///https:// scheme before comparing the production host to arkenv.js.org — addressing the prior review's scheme-prefixed-host finding — with a new regression test for https://arkenv.js.org.
  • Added NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL / NEXT_PUBLIC_VERCEL_URL to beforeEach stubs (test isolation fix) and a new client-side NEXT_PUBLIC_VERCEL_URL resolution test.

Verified locally: full www suite 228 passed (includes release.test.ts + install-panel.test.tsx). Both prior Pullfrog threads were resolved by the author and the underlying concerns are addressed in the new commit.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread apps/www/lib/config/release.ts Outdated

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Minor suggestions only — the fix is correct and the tests pin it; one coverage gap worth closing (inline).

Reviewed changes (re-review of the current head; the prior pullfrog review was against 2aa03f75, these bullets highlight what's new since)

  • Pre-release docs-host guard — getDocsUrl now ignores a arkenv.js.org production host (bare or scheme-prefixed) while a release tag is set, so v1 deploy servers resolve the preview host instead of the v0 domain.
  • firstNonEmpty normalization — the ??/trim/trailing-slash handling is consolidated into one helper applied to the site, production, and preview hosts, and now reads NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL / NEXT_PUBLIC_VERCEL_URL ahead of the server-side Vercel vars.
  • Dynamic fallback — FALLBACK_DOCS_URL is tag-driven (arkenv-v1.vercel.app during alpha/rc, arkenv.js.org at GA) instead of hardcoded.
  • Test coverage — the client-side NEXT_PUBLIC_* path, the arkenv.js.org skip (both bare and https:// forms), and the v1 fallback are all pinned; these assertions fail against the pre-fix behavior.

I verified the tests green locally (release.test.ts + install-panel.test.tsx, 19 passed) after building the workspace deps. The prior review's GA note (an explicit empty RELEASE_TAG, not removal) is already covered by docs/LAUNCH_RUNBOOK.md:22 ("Set RELEASE_TAG = \"\"") and the Vercel domain cutover at docs/LAUNCH_RUNBOOK.md:70.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread apps/www/lib/config/release.ts
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@yamcodes

Copy link
Copy Markdown
Owner Author

No changeset is needed here: this PR only updates the private www application, which is explicitly ignored by Changesets. The release-prompt fix does not change any published package.

@yamcodes

Copy link
Copy Markdown
Owner Author

Acknowledged - this is a review trigger rather than an actionable code comment. No code change or changeset is needed.

autofix-ci Bot and others added 2 commits September 11, 2026 18:53
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yamcodes
yamcodes merged commit 98707c2 into v1 Sep 11, 2026
16 checks passed
@yamcodes
yamcodes deleted the fix_copy_prompt_url branch September 11, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests This issue or PR is about adding, removing or changing tests www Improvements or additions to arkenv.js.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant