### Project Setup and Execution Commands Source: https://github.com/yamcodes/arkenv/blob/main/apps/playgrounds/solid-start/README.md Provides essential command-line instructions for setting up and running the ArkEnv + SolidStart example project. This includes installing dependencies, starting the development server, building for production, and starting the production server. ```bash # Install dependencies pnpm install # Start dev server pnpm dev # Build for production pnpm build # Start production server pnpm start ``` -------------------------------- ### Run Bun Development Server Source: https://github.com/yamcodes/arkenv/blob/main/apps/playgrounds/bun/README.md Starts the Bun development server. This command can automatically handle dependency installation if workspace dependencies have already been installed from the root. ```bash cd apps/playgrounds/bun && bun dev ``` -------------------------------- ### Install ArkEnv Package Source: https://github.com/yamcodes/arkenv/blob/main/apps/www/content/docs/arkenv/quickstart.mdx This command installs the necessary ArkEnv packages. It uses a package manager that supports the 'package-install' command. ```bash arkenv arktype ``` -------------------------------- ### Install Dependencies with npm Source: https://github.com/yamcodes/arkenv/blob/main/apps/playgrounds/js/README.md Installs the necessary project dependencies using npm. This is a prerequisite for running the example. ```bash npm install ``` -------------------------------- ### Install Bun-Specific Dependencies Source: https://github.com/yamcodes/arkenv/blob/main/apps/playgrounds/bun/README.md Installs dependencies specifically for the Bun environment within the example. This command should be run after installing workspace dependencies from the root. ```bash cd apps/playgrounds/bun && bun install ``` -------------------------------- ### Start Development Server with npm Source: https://github.com/yamcodes/arkenv/blob/main/apps/playgrounds/js/README.md Starts the development server with hot reloading enabled using npm. This command typically triggers the execution of the ArkEnv setup and logs environment variables. ```bash npm run dev ``` -------------------------------- ### Install Workspace Dependencies with pnpm Source: https://github.com/yamcodes/arkenv/blob/main/apps/playgrounds/bun/README.md Installs all workspace dependencies from the repository root. This is a prerequisite for the ArkEnv with Bun example due to Bun's handling of the `workspace:*` protocol. ```bash cd && pnpm install ``` -------------------------------- ### Project Dependencies Installation and Execution (pnpm) Source: https://github.com/yamcodes/arkenv/blob/main/apps/playgrounds/vite/README.md Commands for installing project dependencies using pnpm and running the Vite development server, building for production, and previewing the production build. These commands assume pnpm is the package manager and are standard for Vite projects. ```bash # Install dependencies pnpm install # Start dev server pnpm dev # Build for production pnpm build # Preview production build pnpm preview ``` -------------------------------- ### Copy Environment File Example Source: https://github.com/yamcodes/arkenv/blob/main/apps/playgrounds/js/README.md Copies the example environment file (.env.example) to a new file (.env). This is a common step to start configuring environment variables for a project. ```bash cp .env.example .env ``` -------------------------------- ### Basic ArkEnv Usage in Bun Source: https://github.com/yamcodes/arkenv/blob/main/examples/README.md Provides a minimal example of using ArkEnv within a Bun application. This demonstrates the setup and basic functionality of ArkEnv in a Bun runtime environment, highlighting its compatibility and ease of use. ```typescript import { z } from "zod"; import { createArkEnv } from "@arkenv/core"; const envSchema = z.object({ BUN_ENV: z.enum(["development", "production"]), PORT: z.coerce.number().default(3000), API_URL: z.string().url().optional(), }); const env = createArkEnv(envSchema, { // For Bun, you might not need to specify envPath if using Bun's default loading behavior // or if you manage env vars differently. }); console.log(`Bun environment: ${env.BUN_ENV}`); console.log(`Server port: ${env.PORT}`); if (env.API_URL) { console.log(`API URL: ${env.API_URL}`); } ``` -------------------------------- ### Define Environment Variables in .env File Source: https://github.com/yamcodes/arkenv/blob/main/apps/www/content/docs/arkenv/quickstart.mdx This is an example of a `.env` file used to store environment variables for your project. Each line defines a variable and its value, typically used for configuration settings. ```dotenv DATABASE_HOST=localhost DATABASE_PORT=5432 DEBUG=true NODE_ENV=development API_KEY=your-secret-key ``` -------------------------------- ### Example Environment Variables Configuration (.env.production) Source: https://github.com/yamcodes/arkenv/blob/main/examples/with-solid-start/README.md This is an example `.env.production` file showcasing the format for environment variables used with ArkEnv and SolidStart. It includes variables for testing, numeric values, and booleans, which will be validated at build time. ```env VITE_TEST=Hello from SolidStart (Production) VITE_NUMERIC=3 VITE_BOOLEAN=false ``` -------------------------------- ### Run ArkEnv with Bun Source: https://github.com/yamcodes/arkenv/blob/main/apps/playgrounds/bun/README.md Executes the main entry point (index.ts) of the ArkEnv example using the Bun runtime. ```bash bun run index.ts ``` -------------------------------- ### Example Environment Variables Source: https://github.com/yamcodes/arkenv/blob/main/apps/playgrounds/solid-start/README.md Defines example environment variables in a `.env.production` file. These variables are used to test the validation and filtering capabilities of the ArkEnv Vite plugin, ensuring they match the defined schema and are filtered for client-side exposure. ```env VITE_TEST=Hello from SolidStart (Production) VITE_NUMERIC=3 VITE_BOOLEAN=false ``` -------------------------------- ### Basic ArkEnv Usage in Node.js Source: https://github.com/yamcodes/arkenv/blob/main/examples/README.md Demonstrates the fundamental use of ArkEnv within a Node.js application. This example is ideal for understanding the core concepts and setup required to manage environment variables with ArkEnv in a standard Node.js environment. ```typescript import { z } from "zod"; import { createArkEnv } from "@arkenv/core"; const envSchema = z.object({ NODE_ENV: z.enum(["development", "production"]), PORT: z.number().default(3000), }); const env = createArkEnv(envSchema, { // Optional: specify a path to your .env file // envPath: ".env", }); console.log(env.NODE_ENV); console.log(env.PORT); // Example of accessing a variable that might not be defined if not using zod defaults // console.log(env.MY_OPTIONAL_VAR); // This would throw an error if MY_OPTIONAL_VAR is not set and not in the schema ``` -------------------------------- ### Install ArkEnv Vite Plugin and ArkType Source: https://github.com/yamcodes/arkenv/blob/main/apps/www/content/docs/vite-plugin/index.mdx This snippet shows the package installation command for the ArkEnv Vite plugin and ArkType. It's a prerequisite for using the plugin in your project. ```shell npm install @arkenv/vite-plugin arktype # or yarn add @arkenv/vite-plugin arktype # or pnpm add @arkenv/vite-plugin arktype ``` -------------------------------- ### Install @arkenv/bun-plugin with Package Managers Source: https://github.com/yamcodes/arkenv/blob/main/packages/bun-plugin/README.md Installs the @arkenv/bun-plugin and arktype packages for various package managers. Ensure these dependencies are installed before using the plugin. ```sh pnpm add @arkenv/bun-plugin arktype ``` ```sh npm install @arkenv/bun-plugin arktype ``` ```sh yarn add @arkenv/bun-plugin arktype ``` ```sh bun add @arkenv/bun-plugin arktype ``` -------------------------------- ### Verify Production Server Startup Locally Source: https://github.com/yamcodes/arkenv/blob/main/tooling/playwright-www/README.md Starts the production build of the 'www' application locally. This is used for troubleshooting 'Timed out waiting from config.webServer' errors by verifying the production server can start quickly. ```bash pnpm --filter=www run start ``` -------------------------------- ### Example of Multi-Capability Change Structure Source: https://github.com/yamcodes/arkenv/blob/main/openspec/AGENTS.md Demonstrates how to organize changes across multiple capabilities within a single project directory structure. ```directory openspec/changes/add-2fa-notify/ ├── proposal.md ├── tasks.md └── specs/ ├── auth/ │ └── spec.md # ADDED: Two-Factor Authentication └── notifications/ └── spec.md # ADDED: OTP email notification ``` -------------------------------- ### Use Typed Environment Variables in Code Source: https://github.com/yamcodes/arkenv/blob/main/apps/www/content/docs/arkenv/quickstart.mdx This TypeScript code demonstrates how to import and use the validated environment variables defined by ArkEnv. It shows accessing properties like `DATABASE_HOST` and `DATABASE_PORT` for creating application configurations. ```typescript // @filename: config/env.ts import arkenv from 'arkenv'; export const env = arkenv({ DATABASE_HOST: "string.host", DATABASE_PORT: "number.port", NODE_ENV: "'development' | 'production' | 'test'", LOG_LEVEL: "'debug' | 'info' | 'warn' | 'error' = 'info'", "API_KEY?": 'string' }); // @filename: database.ts // --- import { env } from './config/env'; // Hover to see your validated config const dbConfig = { host: env.DATABASE_HOST, port: env.DATABASE_PORT, }; ``` -------------------------------- ### Environment Variables Configuration (.env file) Source: https://github.com/yamcodes/arkenv/blob/main/apps/playgrounds/vite/README.md Example `.env` file for defining environment variables used by the Vite project and validated by ArkEnv. This file includes both server-only variables (like `PORT`) and client-exposed variables prefixed with `VITE_`. ArkEnv and the Vite plugin will validate these at build time and filter them appropriately. ```env PORT=3000 VITE_MY_VAR=Hello from ArkEnv VITE_MY_NUMBER=42 VITE_MY_BOOLEAN=true ``` -------------------------------- ### Install pnpm using curl Source: https://github.com/yamcodes/arkenv/blob/main/CONTRIBUTING.md Installs the pnpm package manager by downloading and executing an installation script from the official pnpm website. This is a prerequisite for setting up the ArkEnv development environment. ```sh curl -fsSL https://get.pnpm.io/install.sh | sh - ``` -------------------------------- ### Example Usage of Typesafe Environment Variables in Solid Component Source: https://github.com/yamcodes/arkenv/blob/main/examples/with-solid-start/README.md This code snippet demonstrates how to access environment variables within a Solid component using the typesafe `import.meta.env`. The types are inferred correctly from the ArkEnv schema, ensuring compile-time checks for variable types. ```tsx const test = import.meta.env.VITE_TEST; // ✅ string const num = import.meta.env.VITE_NUMERIC; // ✅ number const bool = import.meta.env.VITE_BOOLEAN; // ✅ boolean ``` -------------------------------- ### Tool Selection Guide for Common Tasks Source: https://github.com/yamcodes/arkenv/blob/main/openspec/AGENTS.md A table outlining recommended tools for specific development tasks, including file pattern matching, code searching, and file access. ```markdown | Task | Tool | Why | |------|------|-----| | Find files by pattern | Glob | Fast pattern matching | | Search code content | Grep | Optimized regex search | | Read specific files | Read | Direct file access | | Explore unknown scope | Task | Multi-step investigation | ``` -------------------------------- ### ArkEnv in Bun + React Full-Stack App Source: https://github.com/yamcodes/arkenv/blob/main/examples/README.md Demonstrates the integration of ArkEnv in a full-stack application built with Bun and React. This example showcases how to manage environment variables across both the server and client-side components in a Bun-powered React application. ```typescript import { z } from "zod"; import { createArkEnv } from "@arkenv/core"; // Schema for server-side environment variables const serverEnvSchema = z.object({ NODE_ENV: z.enum(["development", "production"]), PORT: z.coerce.number().default(3000), SESSION_SECRET: z.string(), }); // Schema for client-side environment variables (prefixed with VITE_ for Vite compatibility) const clientEnvSchema = z.object({ VITE_API_BASE_URL: z.string().url(), VITE_APP_TITLE: z.string().default("My App"), }); // Create ArkEnv instances for server and client const serverEnv = createArkEnv(serverEnvSchema); const clientEnv = createArkEnv(clientEnvSchema, { // Ensure client variables are accessible in the browser exposeToClient: true, }); // Example usage on the server console.log(`Server Port: ${serverEnv.PORT}`); // Example usage on the client (e.g., in a React component) // console.log(clientEnv.VITE_API_BASE_URL); // console.log(clientEnv.VITE_APP_TITLE); ``` -------------------------------- ### ArkEnv in Plain JavaScript (Node.js) Source: https://github.com/yamcodes/arkenv/blob/main/examples/README.md Demonstrates how to use ArkEnv with plain JavaScript in a Node.js environment. This example addresses the tradeoffs and considerations when not using TypeScript, showing ArkEnv's flexibility. ```javascript const { createArkEnv } = require("@arkenv/core"); // Using a simple object schema for plain JavaScript const envSchema = { NODE_ENV: { type: "enum", values: ["development", "production"], default: "development" }, PORT: { type: "number", default: 8080 }, API_KEY: { type: "string", required: true }, }; const env = createArkEnv(envSchema, { // You can specify the path to your .env file if needed // envPath: ".env.js", // In plain JS, you might rely more on 'required: true' than TypeScript's strictness }); console.log("Node Environment:", env.NODE_ENV); console.log("Server Port:", env.PORT); // Accessing a required variable // console.log("API Key:", env.API_KEY); // Example of potential runtime error if API_KEY is missing // if (!process.env.API_KEY) { // console.error("FATAL ERROR: API_KEY is not defined."); // process.exit(1); // } ``` -------------------------------- ### Example of RENAMED Requirement Format Source: https://github.com/yamcodes/arkenv/blob/main/openspec/AGENTS.md Illustrates the correct format for documenting a renamed requirement, specifying the 'FROM' and 'TO' states. ```markdown ## RENAMED Requirements - FROM: `### Requirement: Login` - TO: `### Requirement: User Authentication` ``` -------------------------------- ### Example ADDED Requirement for Two-Factor Authentication Source: https://github.com/yamcodes/arkenv/blob/main/openspec/AGENTS.md Shows the markdown format for defining a new requirement related to two-factor authentication. ```markdown ## ADDED Requirements ### Requirement: Two-Factor Authentication ... ``` -------------------------------- ### Install Arkenv Bun Plugin Dependencies Source: https://github.com/yamcodes/arkenv/blob/main/apps/www/content/docs/bun-plugin/index.mdx Installs the necessary packages for using the ArkEnv plugin with Bun, including the Bun plugin itself and the core Arkenv library for schema definition and validation. ```bash npm install @arkenv/bun-plugin arkenv arktype ``` -------------------------------- ### ArkEnv Installation (npm) Source: https://github.com/yamcodes/arkenv/blob/main/README.md Standard command to install ArkEnv and its peer dependency arktype using npm. ```bash npm install arkenv arktype ``` -------------------------------- ### Install project dependencies with pnpm Source: https://github.com/yamcodes/arkenv/blob/main/CONTRIBUTING.md Installs all necessary project dependencies for ArkEnv using the pnpm package manager. This command should be run after cloning the repository and navigating into its directory. ```sh pnpm install ``` -------------------------------- ### Install Playwright Browsers Source: https://github.com/yamcodes/arkenv/blob/main/tooling/playwright-www/README.md Installs the Playwright browsers using the workspace-pinned version. This ensures the correct browser versions are available for running the tests. ```bash pnpm exec playwright install ``` -------------------------------- ### ArkEnv in Vite + React App Source: https://github.com/yamcodes/arkenv/blob/main/examples/README.md Shows how to use ArkEnv within a Vite-powered React application. This example highlights the seamless integration with Vite's build process, enabling environment variable management for both development and production builds. ```typescript import { z } from "zod"; import { createArkEnv } from "@arkenv/core"; // Define the schema for your environment variables. // Vite automatically injects variables prefixed with VITE_ into the client bundle. const envSchema = z.object({ VITE_API_URL: z.string().url(), VITE_NODE_ENV: z.enum(["development", "production"]), VITE_APP_VERSION: z.string().default("1.0.0"), }); // Create the ArkEnv instance. Vite handles the injection of VITE_* variables. const env = createArkEnv(envSchema, { // Vite automatically makes VITE_* variables available globally // You might not need exposeToClient if using Vite's built-in mechanisms // exposeToClient: true, }); // Accessing environment variables in your React components or other parts of the app console.log(`API URL: ${env.VITE_API_URL}`); console.log(`App Version: ${env.VITE_APP_VERSION}`); // Example of using in a React component: // function App() { // return ( //
//

My Vite React App

//

API Base URL: {env.VITE_API_URL}

//
// ); // } ``` -------------------------------- ### Example ADDED Requirement for OTP Email Notification Source: https://github.com/yamcodes/arkenv/blob/main/openspec/AGENTS.md Shows the markdown format for defining a new requirement related to OTP email notifications. ```markdown ## ADDED Requirements ### Requirement: OTP Email Notification ... ``` -------------------------------- ### Example ArkEnv Validation Error Source: https://github.com/yamcodes/arkenv/blob/main/apps/www/content/docs/vite-plugin/index.mdx This snippet displays an example of the error message that ArkEnv will produce if environment variables fail validation. It clearly indicates which variables are invalid and provides a description of the expected format or range, helping developers quickly identify and fix issues. ```bash ArkEnvError: Errors found while validating environment variables VITE_MY_VAR must be a string (was missing) PORT must be an integer between 0 and 65535 (was "hello") ``` -------------------------------- ### Configure tsconfig.json for Strict TypeScript Source: https://github.com/yamcodes/arkenv/blob/main/apps/www/content/docs/arkenv/quickstart.mdx This JSON configuration enables strict mode and specifies a modern module resolution strategy for improved type safety in your TypeScript project. Ensure your `tsconfig.json` includes these compiler options. ```json { "compilerOptions": { "strict": true, "moduleResolution": "bundler" } } ``` -------------------------------- ### Using Valibot Validators with ArkEnv Source: https://github.com/yamcodes/arkenv/blob/main/apps/www/content/docs/arkenv/integrations/standard-schema.mdx Illustrates the integration of Valibot validators into an ArkEnv schema alongside native ArkType validators. Ensure Valibot is installed. This example shows specific Valibot schemas for email and timeout configurations. ```typescript import arkenv from 'arkenv'; import * as v from 'valibot'; const env = arkenv({ // ArkType validators HOST: "string.host", PORT: "number.port", // Valibot validators EMAIL: v.pipe(v.string(), v.email()), TIMEOUT: v.pipe(v.number(), v.minValue(0), v.maxValue(30000)), }); ``` -------------------------------- ### ArkEnv Error Handling Example (Bash) Source: https://github.com/yamcodes/arkenv/blob/main/README.md Illustrates the error output from ArkEnv when environment variables fail validation. Shows how ArkEnv provides clear messages about missing or incorrectly typed variables, preventing the application from starting. ```bash ❯ PORT=hello npm start ArkEnvError: Errors found while validating environment variables HOST must be a string or "localhost" (was missing) PORT must be a number (was a string) ``` -------------------------------- ### Define Environment Variable Schema with ArkEnv Source: https://github.com/yamcodes/arkenv/blob/main/apps/www/content/docs/arkenv/quickstart.mdx This TypeScript code defines a validation schema for environment variables using ArkEnv. It includes built-in validators for common types like host and port, boolean conversion, custom string literals, optional variables, and default values for arrays. ```typescript import arkenv, { type } from 'arkenv'; export const env = arkenv({ // Built-in validators DATABASE_HOST: "string.host", DATABASE_PORT: "number.port", // Boolean values (accepts "true"/"false" strings, converts to boolean) DEBUG: "boolean", // Custom string literals NODE_ENV: "'development' | 'production' | 'test'", // Optional variables with defaults LOG_LEVEL: "'debug' | 'info' | 'warn' | 'error' = 'info'", // Array defaults using type function ALLOWED_ORIGINS: type("string[]").default(() => ["localhost"]), FEATURE_FLAGS: type("string[]").default(() => []), // Optional environment variable "API_KEY?": 'string' }); ``` -------------------------------- ### Accessing Typesafe Environment Variables in Vite (TypeScript) Source: https://github.com/yamcodes/arkenv/blob/main/apps/www/content/docs/vite-plugin/typing-import-meta-env.mdx This example shows how to access environment variables that have been made typesafe via ArkEnv's setup. It highlights correct access for typed variables (e.g., `VITE_API_URL`) and incorrect access for untyped or server-only variables (e.g., `PORT`). Autocompletion is also supported. ```typescript // TypeScript knows about your VITE_* variables const apiUrl = import.meta.env.VITE_API_URL; // ✅ Typesafe const port = import.meta.env.PORT; // ❌ Error: PORT is not in ImportMetaEnv // Autocomplete works too! import.meta.env.VITE_ // Shows all your VITE_* variables ``` -------------------------------- ### Define ArkEnv Schema and Vite Plugin Configuration Source: https://github.com/yamcodes/arkenv/blob/main/apps/playgrounds/solid-start/README.md Defines the environment variable schema using `arkenv.type` and integrates the `arkenvVitePlugin` into the SolidStart Vite configuration. This ensures environment variables are validated at build time according to the defined schema. ```typescript import arkenvVitePlugin from "@arkenv/vite-plugin"; import { defineConfig } from "@solidjs/start/config"; import { type } from "arkenv"; // Define the schema export const Env = type({ VITE_TEST: "string", VITE_NUMERIC: "string.numeric", VITE_BOOLEAN: "boolean", }); export default defineConfig({ vite: { // Pass the schema to the plugin plugins: [arkenvVitePlugin(Env)], }, }); ``` -------------------------------- ### ArkEnv Installation (Bun) Source: https://github.com/yamcodes/arkenv/blob/main/README.md Command to install ArkEnv and its peer dependency arktype using Bun. ```bash bun add arkenv arktype ``` -------------------------------- ### Running Tests with PNPM Source: https://github.com/yamcodes/arkenv/blob/main/openspec/project.md This snippet shows commands for running tests within the project using PNPM. It covers running all tests, tests for a specific package, filtering by test type, and running E2E tests. ```bash pnpm test -- --run # All tests pnpm test --project arkenv -- --run # Specific package pnpm test -- --run "integration" # Integration tests only pnpm run test:e2e # E2E tests ``` -------------------------------- ### ArkEnv Installation (Yarn) Source: https://github.com/yamcodes/arkenv/blob/main/README.md Command to install ArkEnv and its peer dependency arktype using Yarn. ```bash yarn add arkenv arktype ``` -------------------------------- ### ArkEnv Installation (pnpm) Source: https://github.com/yamcodes/arkenv/blob/main/README.md Command to install ArkEnv and its peer dependency arktype using pnpm. ```bash pnpm add arkenv arktype ``` -------------------------------- ### Augment import.meta.env for Typesafe Access Source: https://github.com/yamcodes/arkenv/blob/main/apps/playgrounds/solid-start/README.md Provides type augmentation for `import.meta.env` in `src/global.d.ts` to ensure correct TypeScript inference for environment variables defined in the ArkEnv schema. It includes only `VITE_*` prefixed variables for client-side use. ```typescript /// type ImportMetaEnvAugmented = import("@arkenv/vite-plugin").ImportMetaEnvAugmented< typeof import("../app.config").Env >; // Augment import.meta.env with your schema // Only `VITE_*` prefixed variables will be included interface ImportMetaEnv extends ImportMetaEnvAugmented {} // Example usage in Solid components: // const test = import.meta.env.VITE_TEST; // ✅ string // const num = import.meta.env.VITE_NUMERIC; // ✅ number // const bool = import.meta.env.VITE_BOOLEAN; // ✅ boolean ``` -------------------------------- ### Import and Initialize ArkEnv for Syntax Highlighting Source: https://github.com/yamcodes/arkenv/blob/main/apps/www/content/docs/arkenv/integrations/import-guide.mdx This snippet shows the default import of the ArkEnv library and its initialization. It takes an object where keys are environment variable names and values are their expected types or string literals. This setup enables syntax highlighting within the code editor. ```ts import arkenv from 'arkenv'; const env = arkenv({ PORT: "number.port", NODE_ENV: "'development' | 'production' | 'test'", }); ``` -------------------------------- ### DIY Environment Validation with ArkType Source: https://github.com/yamcodes/arkenv/blob/main/apps/www/content/docs/arkenv/comparison.mdx Demonstrates a do-it-yourself approach to environment variable validation using ArkType. This method involves defining a schema, asserting process.env against it, and handling validation, typesafety, defaults, and type morphs manually. It's simple for basic cases but can become tedious for complex applications due to manual parsing, verbose errors, and boilerplate. ```typescript import { type } from "arktype"; const Env = type({ PORT: type("string.integer.parse").to("0 <= number <= 65535").default("3000"), NODE_ENV: "'development' | 'production' | 'test' = 'development'", }); export const env = Env.assert(process.env); ``` -------------------------------- ### Create Custom Arkenv Plugin for Bun.serve Source: https://github.com/yamcodes/arkenv/blob/main/apps/www/content/docs/bun-plugin/index.mdx Creates a custom plugin file for Bun.serve that integrates the ArkEnv plugin with an explicit schema. This file can then be referenced in bunfig.toml. Requires 'arkenv' and '@arkenv/bun-plugin'. ```typescript import arkenv from "@arkenv/bun-plugin"; import { type } from "arkenv"; const Env = type({ BUN_PUBLIC_API_URL: "string", BUN_PUBLIC_DEBUG: "boolean", }); export default arkenv(Env); ``` -------------------------------- ### Install @arkenv/vite-plugin and arktype Source: https://github.com/yamcodes/arkenv/blob/main/packages/vite-plugin/README.md Installs the necessary packages for the Vite plugin and the ArkType library. This typically involves using a package manager like npm, pnpm, Yarn, or Bun. ```sh npm install @arkenv/vite-plugin arktype ``` ```sh pnpm add @arkenv/vite-plugin arktype ``` ```sh yarn add @arkenv/vite-plugin arktype ``` ```sh bun add @arkenv/vite-plugin arktype ``` -------------------------------- ### Build www and Dependencies Source: https://github.com/yamcodes/arkenv/blob/main/tooling/playwright-www/README.md Builds the 'www' application and all its dependencies, including 'arkenv'. This is a crucial step before running tests locally or in CI, as it ensures type checking for MDX files. ```bash pnpm run build --filter=www... ```