Skip to content

Support hosting presets in arkenv init (Phase 1) #1266

Description

@yamcodes

This was generated by AI during triage.

Agent Brief

Category: enhancement
Summary: Support hosting presets in arkenv init (Phase 1)

Current behavior:
arkenv init creates a boilerplate configuration (env.ts) with default variables (DATABASE_URL, NEXT_PUBLIC_API_URL, etc.). It does not offer any hosting-specific environment variables.

Desired behavior:

  1. During arkenv init, prompt the user: "Select a hosting provider preset (optional)" with options:
    • None (default)
    • Vercel
    • Netlify
  2. If a provider is selected:
    • Add their standard environment variables to the generated schema in env.ts (using correct framework prefixes e.g. NEXT_PUBLIC_ for Next.js, NUXT_PUBLIC_ for Nuxt, VITE_ for Vite).

Preset Schemas (for ArkType validator):

  • Vercel:
    • VERCEL: "string?"
    • VERCEL_ENV: "'production' | 'preview' | 'development'?"
    • VERCEL_URL: "string?"
    • <prefix>VERCEL_ENV: "'production' | 'preview' | 'development'?"
    • <prefix>VERCEL_URL: "string?"
  • Netlify:
    • NETLIFY: "string?"
    • CONTEXT: "'production' | 'deploy-preview' | 'branch-deploy'?"
    • URL: "string?"
    • DEPLOY_URL: "string?"
    • <prefix>CONTEXT: "'production' | 'deploy-preview' | 'branch-deploy'?"
    • <prefix>URL: "string?"

(Note: Generate equivalent schemas for Zod and Valibot validators based on the target validator chosen during init).

Key interfaces:

  • ProjectOptions type (add optional hostPreset field).
  • Prompts in init command (use @clack/prompts select).
  • Templates under packages/arkenv/src/features/scaffold/templates/ (add hostPreset variables to templates).

Acceptance criteria:

  • Running arkenv init prompts the user for a hosting provider.
  • Selecting Vercel or Netlify adds the corresponding preset variables to the generated schema.
  • Generated client-side variables dynamically use the detected framework's prefix.
  • Core package runtime remains completely untouched.

Metadata

Metadata

Labels

@arkenv/cliIssues or Pull Requests involving the ArkEnv CLIenhancementNew feature or improvementready for agentFully specified, ready for immediate implementation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions