Skip to content

fix: Collapse init --host-preset/-H into --preset/-P only - #1927

Merged
yamcodes merged 3 commits into
v1from
cursor/collapse-host-preset-e721
Sep 21, 2026
Merged

yamcodes merged 3 commits into
v1from
cursor/collapse-host-preset-e721

Conversation

@yamcodes

@yamcodes yamcodes commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Fixes #1914

Collapse the duplicate hosting-preset flag surface on arkenv init to the canonical --preset / -P pair.

Changes

  • Remove --host-preset / -H from CLI flag parsing (unknown-argument behavior)
  • Keep --preset / -P for all presets including none
  • Update docs, skill copy, and pre-mode changeset examples
  • Delete the unreleased -H alias changeset; add a breaking arkenv major changeset

Deduped against #1922

Kept this PR (targets open #1914 + reconciles .changeset/pre/). Adopted from #1922: bundled -yH test assertions, hosting-presets wording, and the breaking-change diff. Closed #1922 as duplicate.

Evidence

init --preset vercel => hostPreset: vercel
init -P none => hostPreset: none
init --host-preset vercel => Unknown argument: --host-preset
init -H vercel => Unknown argument: -H
init -yH => Unknown argument: -H (isYes still true)

Help lists only --preset, -P <preset>.

Open in Web Open in Cursor 

Keep only --preset / -P for hosting presets on arkenv init. Reject the
legacy --host-preset / -H aliases as unknown arguments, update docs and
tests, and add a breaking changeset for the arkenv CLI.

Fixes #1914

Co-authored-by: Yam Borodetsky <[email protected]>
@changeset-bot

changeset-bot Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2d63338

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
arkenv Major

Not sure what this means? Click here to learn what changesets are.

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

@yamcodes yamcodes added @arkenv/cli Issues or Pull Requests involving the ArkEnv CLI arkenv Changes to the `arkenv` npm package. docs Adds or changes documentation, or acts as documentation in and of itself enhancement New feature or improvement labels Sep 21, 2026 — with Cursor
@pkg-pr-new

pkg-pr-new Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@arkenv/agent-plugin

npm i https://pkg.pr.new/@arkenv/agent-plugin@1927

arkenv

npm i https://pkg.pr.new/arkenv@1927

@arkenv/build

npm i https://pkg.pr.new/@arkenv/build@1927

@arkenv/bun-plugin

npm i https://pkg.pr.new/@arkenv/bun-plugin@1927

@arkenv/core

npm i https://pkg.pr.new/@arkenv/core@1927

@arkenv/fumadocs-ui

npm i https://pkg.pr.new/@arkenv/fumadocs-ui@1927

@arkenv/nextjs

npm i https://pkg.pr.new/@arkenv/nextjs@1927

@arkenv/nuxt

npm i https://pkg.pr.new/@arkenv/nuxt@1927

@arkenv/rsbuild-plugin

npm i https://pkg.pr.new/@arkenv/rsbuild-plugin@1927

@arkenv/standard

npm i https://pkg.pr.new/@arkenv/standard@1927

@arkenv/tanstack-addon

npm i https://pkg.pr.new/@arkenv/tanstack-addon@1927

@arkenv/vite-plugin

npm i https://pkg.pr.new/@arkenv/vite-plugin@1927

commit: 2d63338

@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 and removed @arkenv/cli Issues or Pull Requests involving the ArkEnv CLI labels Sep 21, 2026
Pull in the bundled -yH unknown-argument assertions, tighter
hosting-presets wording, and a clearer breaking-change diff.

Co-authored-by: Yam Borodetsky <[email protected]>

@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 new issues found.

Reviewed changes

  • Parser collapse — hostPreset is removed from FLAG_CONFIG in packages/arkenv/src/cli/cli.ts, so --host-preset and -H (including bundled -yqH) now fall through to the standard Unknown argument: … path. Preset validation and the hostPreset getter read only FLAG_CONFIG.preset, while the internal hostPreset contract (InitInput, scaffold IR) is deliberately untouched.
  • Tests — value-taking-flag expansion cases move from -H to -P; a new Removed host-preset aliases describe asserts exact errors for --host-preset, -H, and bundled -yqH; --preset / -P happy-path coverage across all presets (including none and the invalid-value error) is retained. Verified locally: cli.test.ts (42) and help.test.ts (1) pass.
  • Docs and skill copy — installation.mdx, reference/init.mdx, hosting-presets.mdx, and skills/arkenv/SKILL.md drop the removed aliases. .agents/skills is a symlink to skills/, so there is no duplicate to update.
  • Changesets — adds a breaking arkenv: major changeset, deletes the pending -H alias changeset, and updates stale --host-preset examples in the pre-mode notes.

Two things worth recording, both in the PR's favour: -H was already released (#1362, packages/arkenv/CHANGELOG.md), so a major changeset is the correct call rather than an overstatement; and changesets 3 reads both .changeset/*.md and .changeset/pre/*.md (confirmed in @changesets/read), so the edits to the pre/ notes are release-relevant. No remaining --host-preset / -H references exist outside the new tests and changeset.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@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 new issues found.

Reviewed changes (delta since the prior review of cc747cc)

  • Changeset copy — #### Remove the --host-preset/-H init aliases; tighter prose, and the rename example now shows both --host-preset → --preset and -H → -P. Accurate.
  • Hosting-presets docs — the alias sentence becomes "The short form is -P." Same meaning, cleaner.
  • Bundled--H test — replaces the -yqH vercel case with -yH, and now additionally asserts cli.args equals ["init", "-y", "-H"] and isYes stays true alongside the Unknown argument: -H error. This is stronger than the previous assertion and still fails if -H were re-registered.

The rest of the commit is reconciliation with the closed duplicate #1922 and does not change behaviour. No further concerns.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

test (lts) timed out in env-module HMR revalidation (5s); prior commit
on this branch was fully green.

Co-authored-by: Yam Borodetsky <[email protected]>
@yamcodes
yamcodes merged commit 9fd608a into v1 Sep 21, 2026
19 checks passed
@yamcodes
yamcodes deleted the cursor/collapse-host-preset-e721 branch September 21, 2026 09:37
@arkenv-bot arkenv-bot Bot mentioned this pull request Sep 21, 2026
yamcodes added a commit that referenced this pull request Sep 21, 2026
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Fixes #1913

## Summary

CLI schema discovery no longer auto-picks leftover strict-layout
filenames (`env/server.ts`, `src/env/server.ts`). Discovery stays
`--schema` → flat convention only (`env.ts`, `src/env.ts`, and related
extensions), matching [ADR
0020](https://github.com/yamcodes/arkenv/blob/v1/docs/adr/0020-strict-layout-complexity-budget.md).

Split-recipe projects keep working by pointing `--schema` at a loadable
module (typically the client schema or a flat `env.ts`). Server modules
that import `server-only` cannot be evaluated by the CLI's plain-Node
Jiti loader.

## Changes

- Remove `env/server.ts` / `src/env/server.ts` from `resolveSchemaPath`
candidates
- Unit + integration tests for ignored leftovers, flat convention (incl.
`.mjs`), and `--schema` escape hatch
- Clarify flat-only discovery in `reference/check.mdx`, ADR 0033, and
the ArkEnv skill
- Major changeset on `arkenv` with migration note (client/flat target;
`server-only` caveat)

## Duplicate handling

Absorbed ADR/skill/docs notes from parallel #1921 (closed as duplicate).
Surviving PR for this cleanup.

## Review follow-up

- Migration/`check` docs no longer recommend `--schema env/server.ts`
when that file imports `server-only`

## Rebase

Rebased onto latest `v1` (resolved `skills/arkenv/SKILL.md` conflict
with collapsed `--preset` from #1927).

## Validation

- Focused `resolve-schema-path` tests pass after rebase
- Full CI pending after conflict resolution

## Test plan

- [x] Unit tests assert `env/server.ts` / `src/env/server.ts` alone are
not discovered
- [x] Flat `env.ts` / `src/env.mjs` and explicit `--schema` still
resolve
- [x] Integration: only `env/server.ts` present → exit `2` /
`CLI.SCHEMA_NOT_FOUND`

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-c911a2ec-a056-47e1-9304-a4ec396af30c?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-c911a2ec-a056-47e1-9304-a4ec396af30c&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

---------

Co-authored-by: Cursor Agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arkenv Changes to the `arkenv` npm package. docs Adds or changes documentation, or acts as documentation in and of itself enhancement New feature or improvement 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.

Collapse init --host-preset/-H into --preset/-P only

2 participants