Skip to content

(v1) refactor(nuxt): deepen boot-gate / capture / flat thin-accessor locality #1463

Description

@yamcodes

Summary

Follow-up to #1424 / #1458. After sharing strict client/server thin-accessor wiring, three deepenings remain outside that PR’s honesty-transport contract.

Part of #1105. Precursor: #1424.

Problem

  1. Legacy schema parsing is duplicated between schema capture (boot gate / build-time validate) and the thin accessor. Nested vs flat / public-key decisions can drift.
  2. boot-gate mixes two jobs — Jiti/alias schema load via capture, and applying coerced values into live runtimeConfig / boot-gate result state — which makes each harder to reason about and test alone.
  3. Flat arkenv() entries (ArkType + Standard) still duplicate thin runtime wiring that the strict dispatcher already owns for client/server.

Desired behavior

  • One shared, cycle-safe helper decides legacy nested vs flat shape and declared/public keys for both capture and thin accessors.
  • Schema load via capture is separable from “run/ensure boot gate” (flatten, core coerce, write runtimeConfig, set boot-gate result).
  • Flat package entries become type shells over the same thin-dispatch locality as strict client/server (no behavior change).

Acceptance criteria

  • Capture and thin accessors share one legacy/flat schema-shape helper (no divergent nested detection)
  • Boot-gate apply path can be exercised without re-testing Jiti alias plumbing, and vice versa
  • Flat ArkType and Standard arkenv() runtimes share dispatch locality with strict entries; public behavior unchanged
  • Client entries remain validator-free (@arkenv/core / ArkType / @arkenv/standard stay out of the client graph)
  • Existing @arkenv/nuxt typecheck + vitest suite stays green

Out of scope

Metadata

Metadata

Assignees

No one assigned

    Labels

    @arkenv/nuxtIssues or Pull Requests involving the Nuxt integration for ArkEnvenhancementNew feature or improvementready for agentFully specified, ready for immediate implementation

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions