Releases: yamcodes/arkenv
arkenv@0.12.0
Minor Changes
-
Add Standard JSON Schema coercion to
arkenv/standard#115488b0eee@yamcodesIntroduce opt-out type coercion for standard mode (
arkenv/standard). This coercion only works if the validator is a standard JSON Schema compliant validator (e.g., Zod, Valibot, or custom schemas that implement theStandardJSONSchemaV1interface). This automatically enables coercion for environment variables without relying on ArkType's runtime footprint.If you need to disable coercion, explicitly pass
{ coerce: false }in your configuration:import arkenv from "arkenv/standard"; import { z } from "zod"; const env = arkenv({ PORT: z.number() }, { coerce: false });
BREAKING CHANGE: Coercion is now enabled by default in
arkenv/standard. This will automatically coerce environment variables to their expected types (e.g., strings containing numbers, booleans, or dates will be converted to their respective types) based on the JSON Schema of your validators. It's unlikely to affect you unless you were relying on validation failing for uncoerced string inputs, or have custom schemas that expect raw strings instead of coerced values.
@arkenv/vite-plugin@0.1.2
Patch Changes
@arkenv/nextjs@0.0.8
Patch Changes
@arkenv/bun-plugin@0.1.8
Patch Changes
@arkenv/cli@0.2.10
Patch Changes
-
Check git working tree is clean before
arkenv init#11514e6300c@yamcodesThe CLI now verifies the git working tree is clean before modifying files in the existing-project flow. If the working tree is dirty and
--forceis not provided, the command aborts with a clear error message. Use--forceto bypass this check.Non-git repositories and clean working trees proceed normally without any extra prompts.
-
Automatically wrap Next.js config with
withArkEnvduringarkenv init#11504a267e5@yamcodesRunning
arkenv initin a Next.js project now auto-detectsnext.config.ts(or.js/.mts/.mjs) and wraps the default export withwithArkEnv:// next.config.ts - before export default { experimental: {}, }; // next.config.ts - after import { withArkEnv } from "@arkenv/nextjs/config"; export default withArkEnv({ experimental: {}, });
- Add
transformNextjsConfigAST transformer to wrap default exports withwithArkEnvusing magicast - Add
findNextjsConfigandbootstrapNextjsConfigutilities for Next.js config discovery and mutation - Integrate Next.js config bootstrapping into the CLI executor during
arkenv init - Fix next-steps suppression: show manual
withArkEnvinstructions even when the AI skill is detected if auto-bootstrapping failed
- Add
@arkenv/nextjs@0.0.7
Patch Changes
-
Fix development watcher memory and file descriptor leak
#1136593509a@yamcodesStore the active
chokidarwatcher instance onglobalThis.__arkenv_watcher__and close it when configuring a new watcher instance. -
Remove
@deprecatedJSDoc tag fromcreateEnvandarkenvin the main and react-server entries#1139fae4c1f@yamcodesAvoid warning users when they call
createEnvmanually without using the codegen workflow.
@arkenv/cli@0.2.9
Patch Changes
-
Update Next.js scaffold templates to use default import
arkenv#1140befcefa@yamcodesChange the generated
env.tstemplates to import the defaultarkenvfactory from the generated config helper instead of the namedcreateEnvimport, ensuring compatibility with the ArkType IDE extension. -
Improve readability of recommended framework option in init wizard
2bd5cd4@yamcodesMove the "(Recommended)" text from the framework selection hint to the option label to make the recommendation more prominent during initialization.
-
Restrict Next.js shared scaffold templates to NODE_ENV _
#11352ab778e@yamcodes_Treat
PORTas a server-only variable instead of a shared variable in scaffold templates and strict layout generators. This ensures that custom variables or variables likePORTare not placed insharedsections, avoiding potential client-side hydration mismatches in Next.js applications.
arkenv@0.11.1
Patch Changes
-
Add
Infer<T>helper to resolve environment variable types#1092c6c30ab@yamcodesIntroduce the
Infer<T>type helper, allowing developers to extract the inferred output types of their environment schemas. It supports both declarative schema shapes and compiled schemas (like Zod or ArkType types).Usage:
import { createEnv, type Infer } from "arkenv"; import { type } from "arktype"; const schema = { PORT: type.number, }; export type Env = Infer<typeof schema>;