Skip to content

Update Bun example for plugin and add Bun+React example#459

Merged
yamcodes merged 10 commits intomainfrom
455-update-bun-examples-for-bun-plugin
Nov 29, 2025
Merged

Update Bun example for plugin and add Bun+React example#459
yamcodes merged 10 commits intomainfrom
455-update-bun-examples-for-bun-plugin

Conversation

@yamcodes
Copy link
Owner

@yamcodes yamcodes commented Nov 29, 2025

Closes #455

Summary by CodeRabbit

  • New Features
    • Added a new Bun+React example showcasing a full-stack app: React UI, API tester, dev server with HMR, and production build/serve flow.
  • Documentation
    • Added comprehensive example docs and README describing setup, scripts, env usage, and examples for server/frontend.
  • Chores
    • Added example workspace entry, environment files, package manifest, build script, type declarations, styles, and gitignore for the example project.

✏️ Tip: You can customize this high-level summary in your review settings.

@yamcodes yamcodes linked an issue Nov 29, 2025 that may be closed by this pull request
@changeset-bot
Copy link

changeset-bot bot commented Nov 29, 2025

⚠️ No Changeset found

Latest commit: 209f3e1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Nov 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
arkenv Ready Ready Preview Comment Nov 29, 2025 8:54am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 29, 2025

Walkthrough

Removes explicit BUN_PUBLIC properties from the playground ambient types and adds a new examples/with-bun-react full‑stack example that integrates the ArkEnv Bun plugin: Bun server, React frontend, HMR, ArkEnv schema, build script, and supporting configs/docs.

Changes

Cohort / File(s) Summary
Playground type updates
apps/playgrounds/bun-react/bun-env.d.ts
Removed explicit BUN_PUBLIC_API_URL and BUN_PUBLIC_DEBUG from NodeJS.ProcessEnv; now extends ProcessEnvAugmented only.
Workspace configuration
arkenv.code-workspace
Added workspace folder entry for examples/with-bun-react.
Examples index
examples/README.md
Replaced previous Bun example entry with new with-bun-react description and adjusted formatting.
with-bun-react configs & build
examples/with-bun-react/build.ts, examples/with-bun-react/bunfig.toml, examples/with-bun-react/package.json, examples/with-bun-react/tsconfig.json
Added Bun build script using @arkenv/bun-plugin, bunfig static config exposing BUN_PUBLIC_*, package manifest and scripts, and TS config for the example.
with-bun-react env & types
examples/with-bun-react/bun-env.d.ts, examples/with-bun-react/.env.development, examples/with-bun-react/.env.production, examples/with-bun-react/src/env.ts
Added ambient declarations importing ProcessEnvAugmented from @arkenv/bun-plugin, module declarations for assets/CSS, dev/prod env files, and ArkEnv schema + exported env.
with-bun-react server
examples/with-bun-react/src/index.ts
New Bun HTTP server: serves index.html, /api/hello (GET/PUT), /api/hello/:name, reads env.PORT, and enables HMR/console forwarding in dev.
with-bun-react frontend
examples/with-bun-react/src/App.tsx, examples/with-bun-react/src/api-tester.tsx, examples/with-bun-react/src/frontend.tsx, examples/with-bun-react/src/index.html
Added React App component showing env values, API tester component, React entry with HMR-safe root handling, and HTML entrypoint.
with-bun-react styling & docs
examples/with-bun-react/src/index.css, examples/with-bun-react/.gitignore, examples/with-bun-react/README.md, examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
Added comprehensive stylesheet, .gitignore, README documenting ArkEnv + Bun plugin usage, and a Bun-focused usage guide.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Files: 15+ new/modified files but cohesive as a single example.
  • Focus review on:
    • examples/with-bun-react/src/env.ts (ArkEnv schema and exports)
    • examples/with-bun-react/src/index.ts (server routing, HMR, console forwarding)
    • apps/playgrounds/bun-react/bun-env.d.ts and examples/with-bun-react/bun-env.d.ts (ambient types and compatibility with @arkenv/bun-plugin)

Possibly related PRs

Suggested labels

@arkenv/bun-plugin

Poem

🐰 a rabbit's jackrabbit jig
Springing code and hops of cheer,
Bun and React have gathered here.
Types aligned and envs in tune,
HMR hums a lively tune.
Build and run — the carrots near!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main changes: updating the Bun example for the plugin and adding a new Bun+React example.
Linked Issues check ✅ Passed The PR addresses all requirements from #455: updates the existing Bun example with the plugin and adds a new with-bun-react example showcasing the plugin's capabilities.
Out of Scope Changes check ✅ Passed All changes are directly related to updating the Bun example and adding the new Bun+React example. No unrelated or out-of-scope changes detected.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 455-update-bun-examples-for-bun-plugin

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a97201c and 209f3e1.

📒 Files selected for processing (2)
  • examples/with-bun-react/README.md (1 hunks)
  • examples/with-bun-react/src/frontend.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/README.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test-e2e (e2e)
  • GitHub Check: test-e2e (a11y)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added docs Improvements or additions to documentation example Issues or Pull Requests concerning at least one ArkEnv example. (Found in the `examples/` directory) labels Nov 29, 2025
@yamcodes yamcodes changed the title feat: add new Bun + React example with API testing capabilities Update Bun example for plugin and add Bun+React example Nov 29, 2025
…s in `with-bun-react` example, and correct `with-vite-react` workspace path.
@yamcodes yamcodes marked this pull request as ready for review November 29, 2025 08:43
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (5)
examples/with-bun-react/src/api-tester.tsx (1)

15-18: Consider adding response status check.

The code assumes the response is always JSON-parseable without checking the response status or content-type. While the error handling will catch failures, it would be more user-friendly to check res.ok and provide specific error messages.

 const res = await fetch(url, { method });

+if (!res.ok) {
+	throw new Error(`HTTP ${res.status}: ${res.statusText}`);
+}
+
 const data = await res.json();
 responseInputRef.current!.value = JSON.stringify(data, null, 2);
examples/with-bun-react/src/App.tsx (1)

31-37: Environment variables display as strings after build transformation.

The code displays process.env.BUN_PUBLIC_TEST and process.env.BUN_PUBLIC_BOOLEAN directly. The ArkEnv Bun plugin replaces these references with JSON-stringified values at build time, so typeof will always show "string" even for boolean values.

If the goal is to demonstrate type-safe environment access, consider importing and displaying the validated env object from ./env instead:

import { env } from "./env";

// Then in the table:
<td>{String(env.BUN_PUBLIC_TEST)}</td>
<td>{typeof env.BUN_PUBLIC_TEST}</td>

This would show the actual types after validation. However, if the intent is to demonstrate the plugin's variable replacement behavior, the current approach is correct.

examples/with-bun-react/src/env.ts (1)

3-7: Consider adding default values for better developer experience.

The schema requires all variables without defaults. For an example demonstrating ArkEnv capabilities, consider showing optional variables with defaults using ArkType's default syntax:

 const Env = type({
-	PORT: "number.port",
+	PORT: "number.port = 3000",
 	BUN_PUBLIC_TEST: "string",
-	BUN_PUBLIC_BOOLEAN: "boolean",
+	BUN_PUBLIC_BOOLEAN: "boolean = false",
 });

This would demonstrate ArkType's default value feature (per coding guidelines) and provide a better developer experience. However, if the intent is to show strict validation, the current approach is fine.

examples/with-bun-react/src/index.ts (2)

12-23: Consider removing or prefixing unused req parameter.

The req parameter in both GET and PUT handlers is declared but never used. You can either remove it or prefix it with an underscore to indicate it's intentionally unused.

Apply this diff to remove the unused parameter:

 "/api/hello": {
-	async GET(req) {
+	async GET() {
 		return Response.json({
 			message: "Hello, world!",
 			method: "GET",
 		});
 	},
-	async PUT(req) {
+	async PUT() {
 		return Response.json({
 			message: "Hello, world!",
 			method: "PUT",
 		});
 	},
 },

34-34: Consider validating NODE_ENV through the env schema.

Direct access to process.env.NODE_ENV bypasses ArkEnv validation. For consistency, consider adding NODE_ENV to your environment schema with appropriate defaults.

Example addition to your env schema:

NODE_ENV: "'development' | 'production' | 'test' = 'development'"

Then update the condition:

-development: process.env.NODE_ENV !== "production" && {
+development: env.NODE_ENV !== "production" && {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 11b1c00 and a97201c.

⛔ Files ignored due to path filters (3)
  • examples/with-bun-react/bun.lock is excluded by !**/*.lock
  • examples/with-bun-react/src/logo.svg is excluded by !**/*.svg
  • examples/with-bun-react/src/react.svg is excluded by !**/*.svg
📒 Files selected for processing (20)
  • apps/playgrounds/bun-react/bun-env.d.ts (1 hunks)
  • arkenv.code-workspace (1 hunks)
  • examples/README.md (1 hunks)
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc (1 hunks)
  • examples/with-bun-react/.env.development (1 hunks)
  • examples/with-bun-react/.env.production (1 hunks)
  • examples/with-bun-react/.gitignore (1 hunks)
  • examples/with-bun-react/README.md (1 hunks)
  • examples/with-bun-react/build.ts (1 hunks)
  • examples/with-bun-react/bun-env.d.ts (1 hunks)
  • examples/with-bun-react/bunfig.toml (1 hunks)
  • examples/with-bun-react/package.json (1 hunks)
  • examples/with-bun-react/src/App.tsx (1 hunks)
  • examples/with-bun-react/src/api-tester.tsx (1 hunks)
  • examples/with-bun-react/src/env.ts (1 hunks)
  • examples/with-bun-react/src/frontend.tsx (1 hunks)
  • examples/with-bun-react/src/index.css (1 hunks)
  • examples/with-bun-react/src/index.html (1 hunks)
  • examples/with-bun-react/src/index.ts (1 hunks)
  • examples/with-bun-react/tsconfig.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

**/*.{ts,tsx}: Prefer type over interface for type definitions in TypeScript
Use TypeScript 5.1+ features when appropriate
Leverage const type parameters for better inference in TypeScript
Use JSDoc comments for public APIs
Use tabs for indentation (configured in Biome)
Use double quotes for strings (configured in Biome)
Organize imports automatically (Biome handles this)
Avoid explicit types when TypeScript can infer them (noInferrableTypes error)
Use as const where appropriate for immutable values (useAsConstAssertion error)
Don't reassign function parameters (noParameterAssign error)
Place default parameters last in function signatures (useDefaultParameterLast error)
Always initialize enum values (useEnumInitializers error)
Declare one variable per statement (useSingleVarDeclarator error)
Avoid unnecessary template literals (noUnusedTemplateLiteral error)
Prefer Number.parseInt over global parseInt (useNumberNamespace error)
Use kebab-case for TypeScript filenames (e.g., create-env.ts)
Use camelCase for function names (e.g., createEnv)
Use PascalCase for type names (e.g., ArkEnvError)
Use UPPER_SNAKE_CASE for environment variables and constants
Include examples in JSDoc comments when helpful for public APIs
Document complex type logic with JSDoc comments
Use ArkEnvError for environment variable validation errors
Provide clear, actionable error messages that include the variable name and expected type

Files:

  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/src/env.ts
  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/src/index.ts
  • apps/playgrounds/bun-react/bun-env.d.ts
  • examples/with-bun-react/build.ts
  • examples/with-bun-react/bun-env.d.ts
  • examples/with-bun-react/src/api-tester.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

Use self-closing JSX elements (useSelfClosingElements error)

Files:

  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/src/api-tester.tsx
{bin,examples,playgrounds}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

Console usage is allowed in bin/ and example/playground directories, otherwise treated as warning

Files:

  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/src/env.ts
  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/src/index.ts
  • examples/with-bun-react/build.ts
  • examples/with-bun-react/bun-env.d.ts
  • examples/with-bun-react/src/api-tester.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx,js,jsx}: Use the main function createEnv(schema) or default import arkenv to create validated environment objects with TypeScript type inference from ArkType schemas
Use built-in validators (host, port, url, email) from src/types.ts when available instead of writing custom validation logic
Provide descriptive variable names that indicate purpose and format in environment schema definitions
Group related environment variables in logical schemas for better organization and maintainability
Provide default values for optional environment variables using ArkType's default value syntax (e.g., "boolean = false")

Files:

  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/src/env.ts
  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/src/index.ts
  • apps/playgrounds/bun-react/bun-env.d.ts
  • examples/with-bun-react/build.ts
  • examples/with-bun-react/bun-env.d.ts
  • examples/with-bun-react/src/api-tester.tsx
examples/*/package.json

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Examples in examples/ directory are not published, may have their own lock files, and are used as test fixtures

Files:

  • examples/with-bun-react/package.json
**/package.json

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use workspace:* protocol for workspace dependencies between packages

Files:

  • examples/with-bun-react/package.json
**/index.ts

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

Use barrel exports (index.ts) for package entry points

Files:

  • examples/with-bun-react/src/index.ts
apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript and JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() with built-in WebSocket, HTTPS, and route support instead of express
Use bun:sqlite for SQLite database operations instead of better-sqlite3
Use Bun.redis for Redis operations instead of ioredis
Use Bun.sql for Postgres database operations instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods for file operations
Use Bun.$ template literal syntax for shell commands instead of execa

Files:

  • apps/playgrounds/bun-react/bun-env.d.ts
apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx,html,css}

📄 CodeRabbit inference engine (apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file.html|file.ts|file.css> instead of webpack or esbuild for bundling

Files:

  • apps/playgrounds/bun-react/bun-env.d.ts
apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx,html}

📄 CodeRabbit inference engine (apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

CSS files can be imported directly in TypeScript/JavaScript or referenced in HTML <link> tags, and Bun will automatically bundle them

Files:

  • apps/playgrounds/bun-react/bun-env.d.ts
apps/playgrounds/bun-react/**/*.ts

📄 CodeRabbit inference engine (apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun --hot to run TypeScript entry files with hot module reloading enabled

Files:

  • apps/playgrounds/bun-react/bun-env.d.ts
🧠 Learnings (64)
📓 Common learnings
Learnt from: yamcodes
Repo: yamcodes/arkenv PR: 132
File: packages/arkenv/README.md:13-14
Timestamp: 2025-09-09T17:37:19.650Z
Learning: For yamcodes/arkenv project: Runtime support documentation should link to specific examples: Node.js (examples/basic), Bun (examples/with-bun), Vite (examples/with-vite-react-ts).
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx} : Bun automatically loads .env files, so don't use the dotenv package
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx} : Use `Bun.redis` for Redis operations instead of `ioredis`
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.ts : Use `bun --hot` to run TypeScript entry files with hot module reloading enabled
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx} : Use `bun <file>` instead of `node <file>` or `ts-node <file>` for running TypeScript and JavaScript files
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx} : Use `Bun.serve()` with built-in WebSocket, HTTPS, and route support instead of `express`
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.{ts,tsx,js,jsx} : Bun automatically loads .env files, so don't use `dotenv` library
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.{ts,tsx,js,jsx} : Use `Bun.redis` for Redis operations instead of `ioredis`
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/index.ts : Run frontend development with `bun --hot ./index.ts` for hot module reloading
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx,html,css} : Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild` for bundling
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.html : Use HTML imports with `Bun.serve()` and don't use Vite for frontend bundling and development
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx,html} : CSS files can be imported directly in TypeScript/JavaScript or referenced in HTML `<link>` tags, and Bun will automatically bundle them

Applied to files:

  • examples/with-bun-react/src/index.css
  • arkenv.code-workspace
  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/tsconfig.json
  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/build.ts
  • examples/with-bun-react/src/index.html
  • examples/with-bun-react/bun-env.d.ts
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx,html,css} : Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild` for bundling

Applied to files:

  • examples/with-bun-react/src/index.css
  • arkenv.code-workspace
  • examples/with-bun-react/README.md
  • examples/with-bun-react/.gitignore
  • examples/with-bun-react/.env.production
  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/package.json
  • examples/with-bun-react/.env.development
  • examples/with-bun-react/tsconfig.json
  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/src/index.ts
  • examples/with-bun-react/bunfig.toml
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
  • apps/playgrounds/bun-react/bun-env.d.ts
  • examples/with-bun-react/build.ts
  • examples/with-bun-react/src/index.html
  • examples/with-bun-react/bun-env.d.ts
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.html : Use HTML imports with `Bun.serve()` and don't use Vite for frontend bundling and development

Applied to files:

  • examples/with-bun-react/src/index.css
  • arkenv.code-workspace
  • examples/with-bun-react/README.md
  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/.env.development
  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/src/index.ts
  • examples/with-bun-react/bunfig.toml
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
  • examples/with-bun-react/build.ts
  • examples/with-bun-react/src/index.html
  • examples/README.md
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.html : Use `<link>` tags in HTML for stylesheets; Bun's CSS bundler will handle bundling automatically

Applied to files:

  • examples/with-bun-react/src/index.css
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.html : HTML files can import `.tsx`, `.jsx`, or `.js` files directly as modules, and Bun will automatically transpile and bundle them

Applied to files:

  • examples/with-bun-react/src/index.css
  • examples/with-bun-react/README.md
  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/package.json
  • examples/with-bun-react/tsconfig.json
  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/build.ts
  • examples/with-bun-react/src/index.html
  • examples/with-bun-react/bun-env.d.ts
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx} : Bun automatically loads .env files, so don't use the dotenv package

Applied to files:

  • examples/with-bun-react/src/index.css
  • examples/with-bun-react/.gitignore
  • examples/with-bun-react/.env.production
  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/src/env.ts
  • examples/with-bun-react/package.json
  • examples/with-bun-react/.env.development
  • examples/with-bun-react/bunfig.toml
  • apps/playgrounds/bun-react/bun-env.d.ts
  • examples/with-bun-react/bun-env.d.ts
  • examples/README.md
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.{html,ts,tsx,css} : Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild` for bundling

Applied to files:

  • examples/with-bun-react/src/index.css
  • arkenv.code-workspace
  • examples/with-bun-react/README.md
  • examples/with-bun-react/.gitignore
  • examples/with-bun-react/tsconfig.json
  • examples/with-bun-react/src/index.ts
  • examples/with-bun-react/bunfig.toml
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
  • examples/with-bun-react/build.ts
  • examples/with-bun-react/src/index.html
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.{ts,tsx,js,jsx} : Bun automatically loads .env files, so don't use `dotenv` library

Applied to files:

  • examples/with-bun-react/src/index.css
  • examples/with-bun-react/.gitignore
  • examples/with-bun-react/.env.production
  • examples/with-bun-react/src/env.ts
  • examples/with-bun-react/.env.development
  • examples/with-bun-react/bunfig.toml
  • apps/playgrounds/bun-react/bun-env.d.ts
  • examples/with-bun-react/build.ts
  • examples/with-bun-react/bun-env.d.ts
  • examples/README.md
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.{html,tsx,jsx} : Use HTML imports with `Bun.serve()` instead of Vite for frontend development

Applied to files:

  • examples/with-bun-react/src/index.css
  • arkenv.code-workspace
  • examples/with-bun-react/README.md
  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/src/index.ts
  • examples/with-bun-react/bunfig.toml
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
  • examples/with-bun-react/src/index.html
  • examples/README.md
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.html : HTML files can import .tsx, .jsx, or .js files directly; Bun will automatically transpile and bundle

Applied to files:

  • examples/with-bun-react/src/index.css
  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/tsconfig.json
  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/src/index.html
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/index.ts : Run frontend development with `bun --hot ./index.ts` for hot module reloading

Applied to files:

  • examples/with-bun-react/src/index.css
  • examples/with-bun-react/README.md
  • examples/with-bun-react/.env.production
  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/package.json
  • examples/with-bun-react/.env.development
  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/src/index.ts
  • examples/with-bun-react/bunfig.toml
  • examples/with-bun-react/build.ts
  • examples/with-bun-react/src/index.html
📚 Learning: 2025-09-09T17:37:19.650Z
Learnt from: yamcodes
Repo: yamcodes/arkenv PR: 132
File: packages/arkenv/README.md:13-14
Timestamp: 2025-09-09T17:37:19.650Z
Learning: For yamcodes/arkenv project: Runtime support documentation should link to specific examples: Node.js (examples/basic), Bun (examples/with-bun), Vite (examples/with-vite-react-ts).

Applied to files:

  • arkenv.code-workspace
  • examples/with-bun-react/package.json
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
  • examples/README.md
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.ts : Use `bun --hot` to run TypeScript entry files with hot module reloading enabled

Applied to files:

  • arkenv.code-workspace
  • examples/with-bun-react/README.md
  • examples/with-bun-react/.env.production
  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/package.json
  • examples/with-bun-react/.env.development
  • examples/with-bun-react/tsconfig.json
  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/src/index.ts
  • apps/playgrounds/bun-react/bun-env.d.ts
  • examples/with-bun-react/build.ts
  • examples/with-bun-react/src/index.html
  • examples/with-bun-react/bun-env.d.ts
📚 Learning: 2025-11-24T16:04:36.939Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/test-patterns.mdc:0-0
Timestamp: 2025-11-24T16:04:36.939Z
Learning: Applies to packages/vite-plugin/src/**/*.test.ts : Test Vite plugin using the `with-vite-react-ts` example as a fixture and validate plugin works with real Vite projects

Applied to files:

  • arkenv.code-workspace
  • examples/with-bun-react/src/api-tester.tsx
  • examples/README.md
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.test.{ts,tsx,js,jsx} : Use `bun test` instead of `jest` or `vitest` for running tests

Applied to files:

  • arkenv.code-workspace
  • examples/with-bun-react/.env.production
  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/.env.development
  • examples/with-bun-react/src/api-tester.tsx
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx} : Use `bun <file>` instead of `node <file>` or `ts-node <file>` for running TypeScript and JavaScript files

Applied to files:

  • arkenv.code-workspace
  • examples/with-bun-react/README.md
  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/package.json
  • examples/with-bun-react/.env.development
  • examples/with-bun-react/tsconfig.json
  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/src/index.ts
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
  • apps/playgrounds/bun-react/bun-env.d.ts
  • examples/with-bun-react/build.ts
  • examples/with-bun-react/src/index.html
  • examples/with-bun-react/bun-env.d.ts
  • examples/README.md
📚 Learning: 2025-11-29T07:55:19.139Z
Learnt from: yamcodes
Repo: yamcodes/arkenv PR: 457
File: examples/basic-js/package.json:15-15
Timestamp: 2025-11-29T07:55:19.139Z
Learning: Examples in the examples/ directory are standalone projects and can use their own package managers (npm, bun, etc.) instead of being required to use pnpm.

Applied to files:

  • arkenv.code-workspace
  • examples/with-bun-react/package.json
  • examples/README.md
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/package.json : Use `bun install` instead of `npm install`, `yarn install`, or `pnpm install` in package.json scripts

Applied to files:

  • examples/with-bun-react/README.md
  • examples/with-bun-react/package.json
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
  • examples/with-bun-react/build.ts
📚 Learning: 2025-11-29T07:59:59.400Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T07:59:59.400Z
Learning: Document environment requirements and new features in README files, and provide examples in the `examples/` directory for new functionality

Applied to files:

  • examples/with-bun-react/README.md
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/package.json : Use `bun install` instead of `npm install`, `yarn install`, or `pnpm install` for dependency management

Applied to files:

  • examples/with-bun-react/README.md
  • examples/with-bun-react/package.json
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
  • examples/with-bun-react/build.ts
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/package.json : Use `bun run <script>` instead of `npm run <script>`, `yarn run <script>`, or `pnpm run <script>` in package.json scripts

Applied to files:

  • examples/with-bun-react/README.md
  • examples/with-bun-react/package.json
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.{ts,js} : Use `bun <file>` instead of `node <file>` or `ts-node <file>` for running scripts

Applied to files:

  • examples/with-bun-react/README.md
  • examples/with-bun-react/.gitignore
  • examples/with-bun-react/.env.production
  • examples/with-bun-react/.env.development
  • examples/with-bun-react/src/index.ts
  • examples/with-bun-react/bunfig.toml
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
  • apps/playgrounds/bun-react/bun-env.d.ts
  • examples/with-bun-react/build.ts
📚 Learning: 2025-11-24T16:04:11.901Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/monorepo.mdc:0-0
Timestamp: 2025-11-24T16:04:11.901Z
Learning: Build output should go to dist/ directory and be gitignored; source files should be in src/ directory

Applied to files:

  • examples/with-bun-react/.gitignore
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx} : Prefer `Bun.file` over `node:fs` readFile/writeFile methods for file operations

Applied to files:

  • examples/with-bun-react/.gitignore
  • apps/playgrounds/bun-react/bun-env.d.ts
📚 Learning: 2025-11-24T16:04:11.901Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/monorepo.mdc:0-0
Timestamp: 2025-11-24T16:04:11.901Z
Learning: Applies to tooling/*/package.json : Tooling in tooling/ directory contains development and testing tools that are not published to npm and excluded from changesets

Applied to files:

  • examples/with-bun-react/.gitignore
📚 Learning: 2025-11-24T16:04:11.901Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/monorepo.mdc:0-0
Timestamp: 2025-11-24T16:04:11.901Z
Learning: Monorepo directory structure must follow: packages/ (published npm packages), apps/ (applications), examples/ (example projects), tooling/ (development tools), and turbo.json at root

Applied to files:

  • examples/with-bun-react/.gitignore
📚 Learning: 2025-11-29T08:00:08.031Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/pnpm.mdc:0-0
Timestamp: 2025-11-29T08:00:08.031Z
Learning: Applies to package.json : Configure only built dependencies (native modules) in `pnpm.onlyBuiltDependencies`, including: biomejs/biome, sentry/cli, swc/core, tailwindcss/oxide, vercel/speed-insights, esbuild, and sharp

Applied to files:

  • examples/with-bun-react/.gitignore
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.{ts,tsx,js,jsx} : Prefer `Bun.file` over `node:fs` readFile/writeFile for file operations

Applied to files:

  • examples/with-bun-react/.gitignore
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx} : Use `Bun.redis` for Redis operations instead of `ioredis`

Applied to files:

  • examples/with-bun-react/.env.production
  • apps/playgrounds/bun-react/bun-env.d.ts
📚 Learning: 2025-11-29T07:59:59.399Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T07:59:59.399Z
Learning: Applies to **/packages/**/*.{test,integration.test}.{ts,tsx} : Mock `process.env` in tests to simulate different environment scenarios with both valid and invalid values

Applied to files:

  • examples/with-bun-react/.env.production
  • examples/with-bun-react/.env.development
  • apps/playgrounds/bun-react/bun-env.d.ts
  • examples/with-bun-react/bun-env.d.ts
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.test.{ts,tsx,js,jsx} : Use `bun:test` for unit and integration testing with `test` and `expect` from the built-in test module

Applied to files:

  • examples/with-bun-react/.env.production
  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/package.json
  • examples/with-bun-react/.env.development
  • examples/with-bun-react/tsconfig.json
  • examples/with-bun-react/build.ts
  • examples/with-bun-react/src/api-tester.tsx
  • examples/README.md
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.test.{ts,tsx,js,jsx} : Use `bun test` instead of `jest` or `vitest` for running tests

Applied to files:

  • examples/with-bun-react/.env.production
  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/.env.development
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.test.{ts,tsx,js,jsx} : Use `import { test, expect } from "bun:test"` for writing tests

Applied to files:

  • examples/with-bun-react/src/App.tsx
  • examples/with-bun-react/src/api-tester.tsx
📚 Learning: 2025-11-29T07:59:59.399Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T07:59:59.399Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use the main function `createEnv(schema)` or default import `arkenv` to create validated environment objects with TypeScript type inference from ArkType schemas

Applied to files:

  • examples/with-bun-react/src/env.ts
  • examples/with-bun-react/package.json
  • examples/with-bun-react/build.ts
  • examples/with-bun-react/bun-env.d.ts
  • examples/README.md
📚 Learning: 2025-11-24T16:03:45.295Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: Applies to packages/arkenv/**/*.ts : Keep environment variable schemas readable and TypeScript-like using ArkType syntax

Applied to files:

  • examples/with-bun-react/src/env.ts
  • apps/playgrounds/bun-react/bun-env.d.ts
  • examples/with-bun-react/bun-env.d.ts
📚 Learning: 2025-11-29T07:59:59.399Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T07:59:59.399Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Group related environment variables in logical schemas for better organization and maintainability

Applied to files:

  • examples/with-bun-react/src/env.ts
  • examples/with-bun-react/.env.development
  • examples/with-bun-react/tsconfig.json
  • examples/with-bun-react/bun-env.d.ts
📚 Learning: 2025-11-29T07:59:59.399Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T07:59:59.399Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Provide default values for optional environment variables using ArkType's default value syntax (e.g., `"boolean = false"`)

Applied to files:

  • examples/with-bun-react/src/env.ts
  • examples/with-bun-react/.env.development
  • examples/with-bun-react/tsconfig.json
  • examples/with-bun-react/bun-env.d.ts
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Use `ArkEnvError` for environment variable validation errors

Applied to files:

  • examples/with-bun-react/src/env.ts
  • examples/with-bun-react/bun-env.d.ts
📚 Learning: 2025-11-29T07:59:59.399Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T07:59:59.399Z
Learning: Applies to **/packages/arkenv/**/*.{ts,tsx} : Ensure environment validation errors display missing variables, expected types/formats, and helpful suggestions for fixing issues

Applied to files:

  • examples/with-bun-react/src/env.ts
📚 Learning: 2025-11-24T16:03:45.295Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: Applies to packages/arkenv/**/*.ts : Leverage ArkType's built-in types (e.g., `string.host`, `number.port`) where possible in environment schemas

Applied to files:

  • examples/with-bun-react/src/env.ts
  • examples/with-bun-react/bun-env.d.ts
📚 Learning: 2025-11-29T07:59:59.399Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T07:59:59.399Z
Learning: Applies to **/packages/arkenv/**/*.{test,integration.test}.{ts,tsx} : Save and restore original `process.env` in `beforeEach`/`afterEach` hooks to avoid test pollution

Applied to files:

  • examples/with-bun-react/src/env.ts
  • examples/with-bun-react/bun-env.d.ts
📚 Learning: 2025-11-24T16:03:45.295Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: Applies to packages/arkenv/**/*.ts : Use ArkType's `type()` function to define schemas in environment variable definitions

Applied to files:

  • examples/with-bun-react/src/env.ts
  • examples/with-bun-react/bun-env.d.ts
📚 Learning: 2025-11-24T16:03:45.295Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: Applies to packages/arkenv/**/*.ts : Convert ArkType validation errors to `ArkEnvError` for user-friendly error messages that include variable name and expected type

Applied to files:

  • examples/with-bun-react/src/env.ts
📚 Learning: 2025-11-24T16:03:45.295Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: Applies to packages/arkenv/**/*.ts : Use union types for enums in ArkType schemas (e.g., `"'dev' | 'prod'"`) instead of separate enum definitions

Applied to files:

  • examples/with-bun-react/src/env.ts
  • examples/with-bun-react/bun-env.d.ts
📚 Learning: 2025-11-24T16:03:45.295Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: Applies to packages/arkenv/**/*.ts : Leverage ArkType's type inference for TypeScript types instead of manual type definitions

Applied to files:

  • examples/with-bun-react/src/env.ts
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/package.json : Use `bun run <script>` instead of `npm run <script>`, `yarn run <script>`, or `pnpm run <script>` for running scripts

Applied to files:

  • examples/with-bun-react/package.json
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
📚 Learning: 2025-11-24T16:04:11.901Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/monorepo.mdc:0-0
Timestamp: 2025-11-24T16:04:11.901Z
Learning: Applies to packages/*/package.json : Packages in packages/ directory must be published to npm and require changesets for versioning, proper exports, and type definitions

Applied to files:

  • examples/with-bun-react/package.json
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript 5.1+ features when appropriate

Applied to files:

  • examples/with-bun-react/tsconfig.json
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Organize imports automatically (Biome handles this)

Applied to files:

  • examples/with-bun-react/tsconfig.json
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Avoid unnecessary template literals (`noUnusedTemplateLiteral` error)

Applied to files:

  • examples/with-bun-react/tsconfig.json
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Place default parameters last in function signatures (`useDefaultParameterLast` error)

Applied to files:

  • examples/with-bun-react/tsconfig.json
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Avoid explicit types when TypeScript can infer them (`noInferrableTypes` error)

Applied to files:

  • examples/with-bun-react/tsconfig.json
📚 Learning: 2025-11-24T16:05:09.182Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/www/.cursor/rules/posthog-integration.mdc:0-0
Timestamp: 2025-11-24T16:05:09.182Z
Learning: Applies to apps/www/**/*.{ts,tsx,js,jsx} : If using TypeScript, use an enum to store feature flag names. If using JavaScript, store feature flag names as strings to an object declared as a constant to simulate an enum. Use UPPERCASE_WITH_UNDERSCORE naming convention for enum/const object members.

Applied to files:

  • examples/with-bun-react/tsconfig.json
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx} : Use `Bun.serve()` with built-in WebSocket, HTTPS, and route support instead of `express`

Applied to files:

  • examples/with-bun-react/src/frontend.tsx
  • examples/with-bun-react/src/index.ts
  • examples/with-bun-react/bunfig.toml
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.{ts,tsx,js,jsx} : Use `Bun.serve()` with built-in WebSocket, HTTPS, and route support instead of `express`

Applied to files:

  • examples/with-bun-react/src/index.ts
  • examples/with-bun-react/bunfig.toml
  • examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.{ts,tsx,js,jsx} : Use `Bun.redis` for Redis operations instead of `ioredis`

Applied to files:

  • apps/playgrounds/bun-react/bun-env.d.ts
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx} : Use `Bun.$` template literal syntax for shell commands instead of `execa`

Applied to files:

  • apps/playgrounds/bun-react/bun-env.d.ts
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.{ts,tsx,js,jsx} : Use `Bun.$\`command\`` for shell execution instead of `execa`

Applied to files:

  • examples/with-bun-react/build.ts
📚 Learning: 2025-11-24T16:04:36.939Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/test-patterns.mdc:0-0
Timestamp: 2025-11-24T16:04:36.939Z
Learning: Applies to **/*.test.{ts,tsx} : Focus component tests on public API, user behavior, state transitions, and accessibility rather than styling or implementation details

Applied to files:

  • examples/with-bun-react/src/api-tester.tsx
📚 Learning: 2025-11-24T16:04:36.939Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/test-patterns.mdc:0-0
Timestamp: 2025-11-24T16:04:36.939Z
Learning: Applies to **/*.integration.test.{ts,tsx} : Test how multiple units (components, hooks, functions) work together without mocking their interactions in integration tests

Applied to files:

  • examples/with-bun-react/src/api-tester.tsx
📚 Learning: 2025-11-24T16:04:36.939Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/test-patterns.mdc:0-0
Timestamp: 2025-11-24T16:04:36.939Z
Learning: Applies to **/*.test.{ts,tsx} : Test individual functions, components, and hooks in isolation with mocked dependencies in unit tests

Applied to files:

  • examples/with-bun-react/src/api-tester.tsx
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Include examples in JSDoc comments when helpful for public APIs

Applied to files:

  • examples/with-bun-react/src/api-tester.tsx
📚 Learning: 2025-11-24T16:04:36.939Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/test-patterns.mdc:0-0
Timestamp: 2025-11-24T16:04:36.939Z
Learning: Applies to **/*.test.{ts,tsx} : Use Testing Library with `user-event` for real user simulation in component tests

Applied to files:

  • examples/with-bun-react/src/api-tester.tsx
🧬 Code graph analysis (8)
examples/with-bun-react/.env.production (1)
packages/bun-plugin/src/index.test.ts (7)
  • process (48-68)
  • process (39-46)
  • process (30-37)
  • originalEnv (4-69)
  • originalEnv (7-9)
  • arkenvPlugin (43-45)
  • process (19-28)
examples/with-bun-react/src/App.tsx (3)
apps/playgrounds/bun-react/src/App.tsx (1)
  • App (7-45)
examples/with-bun-react/src/api-tester.tsx (1)
  • APITester (3-50)
apps/playgrounds/bun-react/src/APITester.tsx (2)
  • APITester (3-50)
  • e (6-22)
examples/with-bun-react/src/env.ts (4)
packages/arkenv/src/type.ts (1)
  • type (3-3)
packages/bun-plugin/src/index.ts (2)
  • arkenv (126-137)
  • processEnvSchema (12-32)
packages/arkenv/src/custom-types.integration.test.ts (1)
  • env (191-197)
packages/arkenv/src/create-env.ts (1)
  • createEnv (34-52)
examples/with-bun-react/.env.development (2)
packages/bun-plugin/src/index.test.ts (6)
  • process (48-68)
  • process (39-46)
  • process (30-37)
  • arkenvPlugin (34-36)
  • arkenvPlugin (43-45)
  • process (19-28)
examples/with-vite-react/vite.config.ts (1)
  • env (11-20)
examples/with-bun-react/src/index.ts (3)
examples/with-bun-react/src/env.ts (1)
  • env (9-9)
apps/playgrounds/bun-react/src/index.tsx (3)
  • PUT (16-21)
  • req (24-29)
  • GET (10-15)
packages/bun-plugin/src/index.ts (2)
  • build (179-239)
  • setup (133-135)
examples/with-bun-react/bunfig.toml (1)
packages/bun-plugin/src/index.ts (3)
  • arkenv (126-137)
  • processEnvSchema (12-32)
  • build (179-239)
examples/with-bun-react/build.ts (1)
packages/bun-plugin/src/index.ts (4)
  • build (179-239)
  • args (38-88)
  • arkenv (126-137)
  • setup (133-135)
examples/with-bun-react/src/api-tester.tsx (1)
apps/playgrounds/bun-react/src/APITester.tsx (2)
  • APITester (3-50)
  • e (6-22)
🪛 dotenv-linter (4.0.0)
examples/with-bun-react/.env.production

[warning] 2-2: [UnorderedKey] The BUN_PUBLIC_BOOLEAN key should go before the BUN_PUBLIC_TEST key

(UnorderedKey)

examples/with-bun-react/.env.development

[warning] 2-2: [UnorderedKey] The BUN_PUBLIC_BOOLEAN key should go before the BUN_PUBLIC_TEST key

(UnorderedKey)

🪛 markdownlint-cli2 (0.18.1)
examples/README.md

15-15: Emphasis style
Expected: underscore; Actual: asterisk

(MD049, emphasis-style)


15-15: Emphasis style
Expected: underscore; Actual: asterisk

(MD049, emphasis-style)


16-16: Emphasis style
Expected: underscore; Actual: asterisk

(MD049, emphasis-style)


16-16: Emphasis style
Expected: underscore; Actual: asterisk

(MD049, emphasis-style)

…and build process, and refine HMR root creation in `frontend.tsx`.
@yamcodes yamcodes merged commit 601bf1a into main Nov 29, 2025
15 checks passed
@yamcodes yamcodes deleted the 455-update-bun-examples-for-bun-plugin branch November 29, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation example Issues or Pull Requests concerning at least one ArkEnv example. (Found in the `examples/` directory)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Bun example(s) for Bun plugin

1 participant