Skip to content

feat: Forward-port add host command from #1324 - #1419

Merged
yamcodes merged 4 commits into
v1from
forward-port/add-host-from-1324
Jul 20, 2026
Merged

feat: Forward-port add host command from #1324#1419
yamcodes merged 4 commits into
v1from
forward-port/add-host-from-1324

Conversation

@yamcodes

Copy link
Copy Markdown
Owner

Summary

  • Forward-ports #1324 (arkenv add host [provider]) from dev onto v1
  • Re-implements under packages/arkenv/ (v1 CLI) with dialect-based field rendering via DIALECTS / tryFormatPresetFieldValue and FRAMEWORK_CLIENT_PREFIXES
  • Adds mutateEnvConfig, prompt select, help/parser coverage, and a minor changeset for arkenv

Fixes #1267 (v1 parity)

Test plan

  • pnpm --filter arkenv exec vitest run (342 tests)
  • pnpm --filter arkenv typecheck
  • Manually: arkenv add host vercel against a flat env.ts
  • Manually: arkenv add host interactive prompt and missing-env.ts fallback

Made with Cursor

Bring arkenv add host [provider] onto v1, adapting field rendering to
dialects and FRAMEWORK_CLIENT_PREFIXES instead of the v0 template helpers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@yamcodes yamcodes added enhancement New feature or improvement arkenv Changes to the `arkenv` npm package. tests This issue or PR is about adding, removing or changing tests labels Jul 20, 2026
@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c655f28

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

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

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

@github-actions github-actions Bot added the docs Adds or changes documentation, or acts as documentation in and of itself label Jul 20, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

arkenv

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

@arkenv/build

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

@arkenv/bun-plugin

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

@arkenv/core

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

@arkenv/fumadocs-ui

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

@arkenv/nextjs

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

@arkenv/nuxt

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

@arkenv/standard

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

@arkenv/vite-plugin

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

commit: c655f28

@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 feature is well-tested and cleanly wired.

Reviewed changes — forward-port of the add host command from #1324, re-implemented on the v1 CLI using v1 dialects and framework prefixes.

  • Add arkenv add host [provider] command with --yes/--agent support and a missing-provider prompt.
  • Add mutateEnvConfig to merge Vercel/Netlify preset keys into an existing flat env.ts via magicast + dialect rendering.
  • Add PromptPort.select and ClackPromptAdapter.select for the interactive provider prompt.
  • Update CLI dispatch, composition, help, and parser to route both init and add commands.
  • Add tests for CLI parsing, AddUseCase, mutateEnvConfig, and help output.
  • Add a minor changeset for the arkenv package.

ℹ️ Nitpicks

  • Consider updating apps/www/content/docs/cli/hosting-presets.mdx (or index.mdx) to document arkenv add host [provider] alongside the existing init --host-preset flow.

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

Comment thread packages/arkenv/src/cli/cli.ts Outdated
Comment thread packages/arkenv/src/features/config-mutation/config-mutation.ts Outdated
Comment thread packages/arkenv/src/adapters/prompt.adapter.ts Outdated
Clarify bare `add` errors, share getFieldDefinition, avoid `as any`
for clack select, and document `add host` in the CLI docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@yamcodes

Copy link
Copy Markdown
Owner Author

Addressed the Pullfrog review:

  1. Bare arkenv addMissing subcommand
  2. Shared getFieldDefinition via config-mutation
  3. Dropped as any on clack select (cast through unknown)
  4. Documented arkenv add host in hosting-presets + CLI intro docs

@github-actions github-actions Bot added the www Improvements or additions to arkenv.js.org label Jul 20, 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.

✅ No new issues found.

Reviewed changes — the follow-up commits address every thread from the prior review, plus a small autofix formatting pass.

  • Updated CLI docs to describe arkenv add host [provider] for existing flat env.ts schemas in both hosting-presets.mdx and index.mdx.
  • Fixed bare arkenv add parsing so it now reports Missing subcommand instead of Unknown argument: .
  • Removed the as any cast in ClackPromptAdapter.select, routing through unknown to satisfy Biome under exactOptionalPropertyTypes.
  • Deduplicated getFieldDefinition by exporting it from features/config-mutation and importing it into AddUseCase.
  • Retired all three prior Pullfrog review threads after verifying the fixes.

Pullfrog  | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@yamcodes yamcodes added the preview Opt-in gate for PR preview deployments label Jul 20, 2026
Support adding a hosting provider preset (Vercel or Netlify) to an existing `env.ts` configuration file:

```bash
npx arkenv@next add host [provider]

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

isnt this supposed to be @alpha not @next ? double echeck

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

You're right — .changeset/pre.json sets "tag": "alpha", and existing v1 changelogs/changesets use npx arkenv@alpha. Updated the changeset from @next to @alpha.

v1 packages publish under the alpha dist-tag, not next.

Co-authored-by: Cursor <cursoragent@cursor.com>
@arkenv-bot

arkenv-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (Asia/Almaty)
arkenv Ready Ready Preview, Comment Jul 21 2026, 12:32 AM (Asia/Almaty)

@yamcodes
yamcodes merged commit 0a559ce into v1 Jul 20, 2026
19 checks passed
@yamcodes
yamcodes deleted the forward-port/add-host-from-1324 branch July 20, 2026 19:39
@arkenv-bot arkenv-bot Bot mentioned this pull request Jul 20, 2026
yamcodes pushed a commit that referenced this pull request Jul 20, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to v1, this PR will
be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`v1` is currently in **pre mode** so this branch has prereleases rather
than normal releases. If you want to exit prereleases, run `changeset
pre exit` on `v1`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases
## arkenv@1.0.0-alpha.9

### Minor Changes

- #### Add `add host` command to CLI for adding hosting presets to
existing schemas
_[`#1419`](#1419)
[`0a559ce`](0a559ce)
[@yamcodes](https://github.com/yamcodes)_

Support adding a hosting provider preset (Vercel or Netlify) to an
existing `env.ts` configuration file:

  ```bash
  npx arkenv@alpha add host [provider]
  ```

- Prompts interactively to select Vercel or Netlify if the provider is
omitted.
- Auto-detects the framework (Next.js, Nuxt, Vite, Bun) and the
validator engine (Zod, Valibot, or ArkType) to inject the preset fields
with the correct syntax.
- Fallback to logging the generated variable schemas to stdout with
manual configuration instructions if `env.ts` is missing or unparseable.
## @arkenv/nuxt@1.0.0-alpha.9

### Patch Changes

- #### Keep coerced number and boolean env values through the security
proxy _[`#1429`](#1429)
[`6be63f7`](6be63f7)
[@yamcodes](https://github.com/yamcodes)_

Lock the Nuxt security proxy so schema-key reads return the coerced
validation target. A key declared as `"number"` or `"boolean"` returns a
number or boolean at runtime, not a raw string from Nuxt runtime config
/ `__NUXT__`.

  ```ts
  import { arkenv } from "@arkenv/nuxt";

  export const env = arkenv({
    NUXT_PUBLIC_PORT: "number",
    PORT: "number",
  });

  // 3000 (number), not "3000" (string)
  env.NUXT_PUBLIC_PORT;
  env.PORT;
  ```

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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 preview Opt-in gate for PR preview deployments 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