Skip to content

Releases: yamcodes/arkenv

arkenv@0.11.1

31 May 09:21
ce6a96e

Choose a tag to compare

Patch Changes

  • Add Infer<T> helper to resolve environment variable types #1092 c6c30ab @yamcodes

    Introduce 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>;

@arkenv/vite-plugin@0.1.1

31 May 09:21
ce6a96e

Choose a tag to compare

Patch Changes

Updated 1 dependency

c6c30ab

  • arkenv@0.11.1

@arkenv/nextjs@0.0.6

31 May 17:17
8639b5c

Choose a tag to compare

Patch Changes

  • Fix env.gen import path in strict layout and export default alias #1121 e75194e @yamcodes

    Correct the hardcoded import path to generated factory in Next.js 3-file strict mode client template. Also export createEnv as default export (aliased as arkenv) in the generated env.gen.ts file.

@arkenv/nextjs@0.0.5

31 May 10:27
0705afe

Choose a tag to compare

Patch Changes

  • Generate tailored createEnv factory in Next.js strict layout #1116 b62ebbd @yamcodes

    Generate a tailored createEnv factory helper in env.gen.ts when using the strict split-schema layout (instead of exporting a raw runtimeEnv object).

    This eliminates the need to manually declare or reference the runtimeEnv object inside the client schema client.ts file, aligning it closer to the core arkenv experience of simply calling createEnv(schema, options).

    Example usage in client.ts:

    import { createEnv } from "./generated/env.gen";
    import { SharedSchema } from "./internal/shared";
    
    export const env = createEnv(
      {
        NEXT_PUBLIC_API_URL: "string",
      },
      {
        extends: [SharedSchema],
      }
    );
  • Support split schema layout in Next.js config wrapper #1116 b62ebbd @yamcodes

    Add support for the strict split schema layout in the Next.js withArkEnv configuration wrapper and update CLI scaffolding instructions:

    • Add a layout option ("simple" | "strict") to withArkEnv configuration, which defaults to auto-detecting the strict layout if split files (env/internal/shared.ts, env/client.ts, env/server.ts) exist.
    • Implement key extraction from strict client and shared schema files.
    • Update CLI next-steps messages to include withArkEnv wrapping instructions for strict layout nextjs projects.

@arkenv/nextjs@0.0.4

31 May 09:21
ce6a96e

Choose a tag to compare

Patch Changes

  • Implement Next.js separate files mode, shared entry point, and native extends API #1084 d921785 @yamcodes

    Introduce dedicated entry points for @arkenv/nextjs/server, @arkenv/nextjs/client, and @arkenv/nextjs/shared to prevent metadata leakage and support compile-time bundler-enforced isolation. Add a native extends API to merge validated outputs of extended proxies while maintaining proxy-level protections.

    Also update the CLI init wizard to support interactive layout selection (Strict 3-file vs Simple 1-file) and --strict / --simple flags to bypass interactive selection.

    Example server usage:

    import { createEnv } from "@arkenv/nextjs/server";
    import { env as clientEnv } from "./env.client";
    
    export const env = createEnv(
      { DATABASE_URL: "string" },
      { extends: [clientEnv] }
    );

    Example client usage:

    import { createEnv } from "@arkenv/nextjs/client";
    
    export const env = createEnv(
      { NEXT_PUBLIC_API_URL: "string" },
      {
        runtimeEnv: {
          NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
        },
      }
    );
  • Add withArkEnv configuration helper for Next.js #1092 c6c30ab @yamcodes

    Add a Next.js configuration wrapper in @arkenv/nextjs/config that automates client-side and shared environment variable destructuring in the runtimeEnv block:

    // next.config.ts
    import { withArkEnv } from "@arkenv/nextjs/config";
    import type { NextConfig } from "next";
    
    const nextConfig: NextConfig = {
      reactStrictMode: true,
    };
    
    export default withArkEnv(nextConfig);

    Key features:

    • Zero-Boilerplate Destructuring: Statically extract client and shared keys from your env.ts schema and generate a tailored createEnv factory in generated/env.gen.ts that pre-fills the runtimeEnv block.
    • Development Watcher: Automatically start a lightweight file watcher in development mode to regenerate generated/env.gen.ts on the fly when env.ts changes.
    • Customizable Output: Support custom schema and output paths, enabling developers to write generated files to a dedicated folder (e.g., src/generated/env.gen.ts).
    • Deprecate Direct Exports: Mark direct createEnv and default arkenv exports from the main and react-server entry points as deprecated to steer developers toward the new codegen workflow.

    Example usage in env.ts:

    // env.ts
    import { createEnv } from "./generated/env.gen";
    
    export const env = createEnv({
      client: {
        NEXT_PUBLIC_API_URL: "string",
      },
      shared: {
        NODE_ENV: "string",
      },
    });
Updated 1 dependency

c6c30ab

  • arkenv@0.11.1

@arkenv/cli@0.2.8

31 May 17:17
8639b5c

Choose a tag to compare

Patch Changes

  • Default Next.js layout selection to Simple (1-file) layout #1120 9563b47 @yamcodes

    Change the CLI prompt layout selection ordering to present "Simple" as the recommended first choice and "Strict" as the second choice. Update the non-interactive wizard flow to default to the simple (Unified) layout.

  • Fix env.gen import path in strict layout and export default alias #1121 e75194e @yamcodes

    Correct the hardcoded import path to generated factory in Next.js 3-file strict mode client template. Also export createEnv as default export (aliased as arkenv) in the generated env.gen.ts file.

@arkenv/cli@0.2.7

31 May 10:27
0705afe

Choose a tag to compare

Patch Changes

  • Format empty schema objects cleanly in scaffolding #1116 b62ebbd @yamcodes

    Format empty schema objects cleanly as {} on a single line (instead of multi-line empty blocks with trailing whitespace) during project scaffolding.

  • Generate tailored createEnv factory in Next.js strict layout #1116 b62ebbd @yamcodes

    Generate a tailored createEnv factory helper in env.gen.ts when using the strict split-schema layout (instead of exporting a raw runtimeEnv object).

    This eliminates the need to manually declare or reference the runtimeEnv object inside the client schema client.ts file, aligning it closer to the core arkenv experience of simply calling createEnv(schema, options).

    Example usage in client.ts:

    import { createEnv } from "./generated/env.gen";
    import { SharedSchema } from "./internal/shared";
    
    export const env = createEnv(
      {
        NEXT_PUBLIC_API_URL: "string",
      },
      {
        extends: [SharedSchema],
      }
    );
  • Support split schema layout in Next.js config wrapper #1116 b62ebbd @yamcodes

    Add support for the strict split schema layout in the Next.js withArkEnv configuration wrapper and update CLI scaffolding instructions:

    • Add a layout option ("simple" | "strict") to withArkEnv configuration, which defaults to auto-detecting the strict layout if split files (env/internal/shared.ts, env/client.ts, env/server.ts) exist.
    • Implement key extraction from strict client and shared schema files.
    • Update CLI next-steps messages to include withArkEnv wrapping instructions for strict layout nextjs projects.

@arkenv/cli@0.2.6

31 May 09:21
ce6a96e

Choose a tag to compare

Patch Changes

  • Implement Next.js separate files mode, shared entry point, and native extends API #1084 d921785 @yamcodes

    Introduce dedicated entry points for @arkenv/nextjs/server, @arkenv/nextjs/client, and @arkenv/nextjs/shared to prevent metadata leakage and support compile-time bundler-enforced isolation. Add a native extends API to merge validated outputs of extended proxies while maintaining proxy-level protections.

    Also update the CLI init wizard to support interactive layout selection (Strict 3-file vs Simple 1-file) and --strict / --simple flags to bypass interactive selection.

    Example server usage:

    import { createEnv } from "@arkenv/nextjs/server";
    import { env as clientEnv } from "./env.client";
    
    export const env = createEnv(
      { DATABASE_URL: "string" },
      { extends: [clientEnv] }
    );

    Example client usage:

    import { createEnv } from "@arkenv/nextjs/client";
    
    export const env = createEnv(
      { NEXT_PUBLIC_API_URL: "string" },
      {
        runtimeEnv: {
          NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
        },
      }
    );
  • Update Next.js scaffolding template to use codegen workflow #1092 c6c30ab @yamcodes

    Update the CLI nextjs scaffolding template to adopt the new @arkenv/nextjs/config codegen workflow. The generated env.ts file now imports the auto-generated createEnv factory from env.gen.ts instead of directly importing from @arkenv/nextjs, which eliminates the need to manually destructure runtimeEnv variables.

    Additionally, update the CLI usage instructions to guide developers on wrapping their Next.js configuration using the withArkEnv helper inside next.config.ts.

    Add --no-codegen CLI option and dedicated prompt for Next.js scaffolding

    Introduce a --no-codegen (or -C) option and an interactive prompt to allow developers to opt out of the Next.js automatic environment variable code generation workflow. When opted out, the CLI scaffolds the project to use standard runtimeEnv destructuring and skips post-scaffold code generation bootstrapping.

@arkenv/bun-plugin@0.1.7

31 May 09:21
ce6a96e

Choose a tag to compare

Patch Changes

Updated 1 dependency

c6c30ab

  • arkenv@0.11.1

@arkenv/vite-plugin@0.1.0

30 May 13:40
ca73038

Choose a tag to compare

Minor Changes

  • Update Vite peer dependency floor to ^4.0.0 #1087 e508608 @yamcodes

    BREAKING CHANGE: Drop support for Vite 2 and Vite 3. Limit the supported Vite range to versions actually validated in CI (Vite 4, 5, 6, 7, and 8).