ArkEnv now runs on Nub #980
yamcodes
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
ArkEnv is a TypeScript library for typesafe environment variables. You keep ArkType, Zod, Valibot, or any Standard Schema, and you get a typed
envobject that fails at startup when a value is missing or wrong.The monorepo now uses Nub for the work that used to be split across pnpm, tsx, dotenv, and nvm. Repo: yamcodes/arkenv (
v1).Package manager. Root
packageManagerisnub@0.9.3, the lockfile isnub.lock, andnub.jsoncuses an isolated linker. Apreinstallscript exits if someone runspnpm,npm, oryarninstall in that tree. Node is pinned to24.21.0in.node-version; the nextnubcommand provisions that version.Scripts and TypeScript. Day-to-day commands are
nub install,nub run www,nub run test, andnub run changeset. The examples start withnub src/index.tsandnub watch. Nub loads.env*and runs the TypeScript entry. ArkEnv does not load dotenv files itself.CI. Workflows go through a composite action that calls
nubjs/setup-nub@v0(shim on, Node from.node-version) and thennub install. That covers tests, release, and the docs deploy.If a project already runs under Nub. Nub loads the env files. ArkEnv validates on
import { env } from "./env". To fail before application code runs, pointpreloadat the schema:{ "preload": ["./env.ts"] }nubx arkenv checkruns the same check without starting the app, and it inherits Nub's.env*loading. Guide: Use with Nub.Nub stays optional for people using ArkEnv. Getting started still shows
npxandnode --env-file. There is nonub-arkenvplugin and no Varlock-style hand-off:nubx arkenvalready runs the CLI, and validation stays on the importedenvobject. Write-up: ADR 0035.One sharp edge on deploy: Corepack does not know
nub, and the Vercel CLI does not treatnub.lockas a lockfile. CI runsnub installfirst, then a small wrapper setsVERCEL_INSTALL_COMPLETED=1sovercel builddoes not trycorepack enable nubor fall back tonpm install.All reactions