Skip to content

(v1) Strict layout for Vite/Bun via ADR 0013 import blocking #1330

Description

@yamcodes

Summary

Bring the strict layout (env/client.ts, env/server.ts) to Vite and Bun with compile-time import blocking, reusing the ADR 0013 mechanism.

Scope

  • Vite: the ADR 0013 client-import blocker is already a Vite plugin (built for @arkenv/nuxt) — generalize it so client-graph imports of /server schema files fail the build with a descriptive error.
  • Bun: equivalent enforcement via onResolve hooks for Bun.build client targets.
  • Layout resolution shared through @arkenv/build (resolveLayout, per ADR 0009 / (v1) Consolidate Vite/Bun plugin plumbing into @arkenv/build #1331).
  • Flat layout remains runtime-guard-only (trust the proxy, ADR 0010); strict layout is the compile-time escape hatch for the name/type-leak consequence inherited from ADR 0012.

Acceptance criteria

  • Importing env/server (or any /server schema file) from client-graph code fails the Vite build and the Bun.build client target with a descriptive error.
  • Server code imports env/server normally with boot-time validation.
  • Flat-layout behavior is unchanged.

Landing

v1 branch only — see ADR 0015 landing strategy. Depends on #1328 / #1329. Part of #1105 (ADR: #1326).

Metadata

Metadata

Assignees

No one assigned

    Labels

    @arkenv/bun-pluginIssues or Pull Requests involving the Bun plugin for ArkEnv@arkenv/vite-pluginIssues or Pull Requests involving the Vite plugin for ArkEnvblockedWork cannot proceed; waiting on something elseenhancementNew 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