Skip to content

Migrate basic examples to be JS based#457

Merged
yamcodes merged 9 commits intomainfrom
456-can-we-use-this-without-typescript
Nov 29, 2025
Merged

Migrate basic examples to be JS based#457
yamcodes merged 9 commits intomainfrom
456-can-we-use-this-without-typescript

Conversation

@yamcodes
Copy link
Owner

@yamcodes yamcodes commented Nov 29, 2025

Closes #456

Summary by CodeRabbit

  • New Features

    • Added a basic JavaScript example demonstrating environment-variable setup and runtime validation
    • Added a Node.js playground module that exposes a validated, typed environment configuration and logs the resolved config
    • Included example scaffolding (env example, .gitignore, package config, TS config)
  • Documentation

    • Added a step-by-step README for the basic JS example with quickstart and walkthrough
    • Renamed and clarified example naming to remove TypeScript-specific wording

✏️ 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: 3e02aea

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 7:55am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 29, 2025

Warning

Rate limit exceeded

@yamcodes has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 43 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 53578c7 and 3e02aea.

📒 Files selected for processing (1)
  • .cursor/rules/pnpm.mdc (1 hunks)

Walkthrough

Adds a new basic JavaScript example, updates workspace entries and example metadata to remove TypeScript labeling, and introduces a Node.js playground module that defines, validates, logs, and exports environment variables using arkenv.

Changes

Cohort / File(s) Summary
New basic-js example
examples/basic-js/.env.example, examples/basic-js/.gitignore, examples/basic-js/package.json, examples/basic-js/tsconfig.json
New example project files: environment template, gitignore, npm ESM package config (scripts, arkenv/arktype deps), and a TS config included for tooling.
basic-js documentation
examples/basic-js/README.md
New README with quickstart, walkthrough for adding a required env var, using .env, and printing env values.
with-vite-react example updates
examples/with-vite-react/package.json, examples/with-vite-react/README.md
Renamed package (removed -ts) and updated README title to drop TypeScript mention.
Workspace and examples README
arkenv.code-workspace, examples/README.md
Added examples/basic-js workspace entry, renamed existing Vite React workspace entry, and updated examples README to note TypeScript is optional and link the new JS example.
Node playground configuration
apps/playgrounds/node/index.js
New Node module that declares an arkenv schema (HOST, PORT, NODE_ENV with union/default, ALLOWED_ORIGINS array/default, DEBUG), builds from process.env, validates/parses, logs the parsed config, and exports it as the default export.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to: apps/playgrounds/node/index.js schema types/defaults and exported values.
  • Verify examples/basic-js/package.json scripts and engine fields for Node 24 compatibility and workspace consistency.

Possibly related PRs

Poem

🐇
I hopped through folders, nose a-gleam,
Found a tiny basic-js stream.
Schemas snug and envs set right,
No TS banner in my sight.
A carrot, a log — config delight. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the PR, which is to migrate basic examples to JavaScript-based implementations.
Linked Issues check ✅ Passed The PR successfully addresses issue #456 by adding a JavaScript-only example (examples/basic-js) and updating documentation to clarify JS usage is supported without TypeScript.
Out of Scope Changes check ✅ Passed All changes are within scope: new basic-js example, workspace update to include it, README updates documenting JS support, and renaming of the vite-react example to remove TS suffix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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) www Improvements or additions to arkenv.js.org tests This issue or PR is about adding, removing or changing tests labels Nov 29, 2025
@yamcodes yamcodes changed the title feat: Add a new with-typescript example and convert the basic exa… Migrate basic examples to be JS based Nov 29, 2025
…ith-bun` to `with-bun-ts` and `basic` to `with-typescript`.
@github-actions github-actions bot removed www Improvements or additions to arkenv.js.org tests This issue or PR is about adding, removing or changing tests labels Nov 29, 2025
…ypeScript from Vite React example title, and update file extensions.
@yamcodes yamcodes marked this pull request as ready for review November 29, 2025 07:42
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: 3

🧹 Nitpick comments (4)
examples/basic-js/package.json (1)

16-18: Use a version range for Node.js engine constraint.

The exact version constraint "node": "24" is overly restrictive and may cause compatibility issues. Use a range that allows for patch and minor updates within the supported major version.

Apply this diff:

 	"engines": {
-		"node": "24"
+		"node": ">=24 <25"
 	},

Or consider aligning with the with-vite-react example which uses ">=22 <26" for broader compatibility:

 	"engines": {
-		"node": "24"
+		"node": ">=22 <26"
 	},
examples/README.md (1)

13-15: Consider clarifying the distinction between basic and basic-js examples.

With both basic and basic-js examples now available, users might be confused about which to choose. Consider adding a brief note explaining the difference (e.g., basic uses TypeScript while basic-js demonstrates pure JavaScript usage).

Based on learnings: The basic example is documented as the Node.js example. Consider whether having both basic (TypeScript) and basic-js (JavaScript) serves users well, or if a clearer naming convention would help (e.g., basic-ts and basic-js).

apps/playgrounds/node/index.js (1)

7-7: Consider using the = [] syntax for array defaults.

Per coding guidelines, default values should use the = value syntax. This can be simplified to:

-	ALLOWED_ORIGINS: type("string[]").default(() => []),
+	ALLOWED_ORIGINS: "string[] = []",

This is more concise and follows the same pattern as the other defaults in the schema.

Based on coding guidelines, which specify using the = value syntax for default values.

examples/basic-js/README.md (1)

36-43: Consider aligning documentation example with actual implementation pattern.

The documentation shows using arkenv({...}) directly with an inline schema, but the actual index.js implementation uses type({...}) followed by arkenv(Env, process.env). While both patterns are valid, this inconsistency might confuse users.

Consider either:

  1. Updating the documentation to match the implementation pattern, or
  2. Adding a note explaining that both patterns work

This would help users better understand the relationship between the tutorial and the actual code.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9fb1f71 and 846882f.

⛔ Files ignored due to path filters (4)
  • examples/basic/package-lock.json is excluded by !**/package-lock.json
  • examples/with-vite-react-ts/package-lock.json is excluded by !**/package-lock.json
  • examples/with-vite-react/public/vite.svg is excluded by !**/*.svg
  • examples/with-vite-react/src/assets/react.svg is excluded by !**/*.svg
📒 Files selected for processing (10)
  • apps/playgrounds/node/index.js (1 hunks)
  • arkenv.code-workspace (1 hunks)
  • examples/README.md (1 hunks)
  • examples/basic-js/.env.example (1 hunks)
  • examples/basic-js/.gitignore (1 hunks)
  • examples/basic-js/README.md (1 hunks)
  • examples/basic-js/package.json (1 hunks)
  • examples/basic-js/tsconfig.json (1 hunks)
  • examples/with-vite-react/README.md (1 hunks)
  • examples/with-vite-react/package.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,js,jsx}

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

**/*.{ts,tsx,js,jsx}: Use createEnv(schema) function (available as default export, typically imported as arkenv) to create validated environment objects with ArkType schema definitions
Use built-in validators (host, port, url, email) from ArkEnv when available in environment schemas instead of writing custom validators
Provide default values for optional environment variables in schemas using the = value syntax
Use descriptive environment variable names that indicate purpose and format in schema definitions

Files:

  • apps/playgrounds/node/index.js
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/basic-js/package.json
  • examples/with-vite-react/package.json
**/package.json

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

Use workspace:* protocol for workspace dependencies between packages

When referencing workspace packages, use the workspace:* protocol in dependencies

Files:

  • examples/basic-js/package.json
  • examples/with-vite-react/package.json
{**/package.json,pnpm-lock.yaml,pnpm-workspace.yaml}

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

{**/package.json,pnpm-lock.yaml,pnpm-workspace.yaml}: Always use pnpm for all package management operations
Never use npm or yarn commands

Files:

  • examples/basic-js/package.json
  • examples/with-vite-react/package.json
{pnpm-workspace.yaml,**/package.json}

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

Certain native dependencies are configured with onlyBuiltDependencies in pnpm configuration: @biomejs/biome, @sentry/cli, @swc/core, @tailwindcss/oxide, @vercel/speed-insights, esbuild, sharp

Files:

  • examples/basic-js/package.json
  • examples/with-vite-react/package.json
🧠 Learnings (42)
📓 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: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:03:35.759Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `createEnv(schema)` function (available as default export, typically imported as `arkenv`) to create validated environment objects with ArkType schema definitions
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
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:03:35.759Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use built-in validators (host, port, url, email) from ArkEnv when available in environment schemas instead of writing custom validators
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
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
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: ArkType validates environment variables at runtime and TypeScript types are inferred from the schema definition
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
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/test-patterns.mdc:0-0
Timestamp: 2025-11-24T16:04:36.939Z
Learning: Achieve coverage goals: environment variable parsing and validation, type checking and error handling, default value handling, custom type validation, plugin integration with Vite, and real project build testing using examples as fixtures
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
📚 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/basic-js/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/basic-js/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} : Include examples in JSDoc comments when helpful for public APIs

Applied to files:

  • examples/basic-js/tsconfig.json
  • examples/README.md
📚 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 JSDoc comments for public APIs

Applied to files:

  • examples/basic-js/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/basic-js/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} : Leverage `const` type parameters for better inference in TypeScript

Applied to files:

  • examples/basic-js/tsconfig.json
📚 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} : Use `*.integration.test.ts` suffix to distinguish integration tests from unit tests

Applied to files:

  • examples/basic-js/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} : Use kebab-case for TypeScript filenames (e.g., `create-env.ts`)

Applied to files:

  • examples/basic-js/tsconfig.json
📚 Learning: 2025-11-24T16:03:35.759Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:03:35.759Z
Learning: Applies to **/*.integration.test.{ts,tsx} : Name integration tests with `.integration.test.ts` or `.integration.test.tsx` suffix to distinguish them from unit tests

Applied to files:

  • examples/basic-js/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/basic-js/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: Prefer tree-shakeable exports for better bundling

Applied to files:

  • examples/basic-js/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,html,css} : Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild` for bundling

Applied to files:

  • examples/basic-js/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 : Use `bun --hot` to run TypeScript entry files with hot module reloading enabled

Applied to files:

  • examples/basic-js/tsconfig.json
  • examples/with-vite-react/package.json
📚 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/basic-js/.gitignore
  • examples/basic-js/.env.example
📚 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/basic-js/.gitignore
  • examples/with-vite-react/package.json
  • examples/basic-js/.env.example
📚 Learning: 2025-11-24T16:03:35.759Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:03:35.759Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `createEnv(schema)` function (available as default export, typically imported as `arkenv`) to create validated environment objects with ArkType schema definitions

Applied to files:

  • apps/playgrounds/node/index.js
  • examples/basic-js/README.md
  • examples/basic-js/package.json
  • examples/with-vite-react/package.json
  • examples/README.md
  • examples/with-vite-react/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:

  • apps/playgrounds/node/index.js
  • examples/basic-js/README.md
  • examples/basic-js/package.json
  • examples/with-vite-react/package.json
  • examples/README.md
  • examples/with-vite-react/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 : Leverage ArkType's built-in types (e.g., `string.host`, `number.port`) where possible in environment schemas

Applied to files:

  • apps/playgrounds/node/index.js
  • examples/basic-js/README.md
  • examples/basic-js/package.json
  • examples/README.md
  • examples/with-vite-react/README.md
📚 Learning: 2025-11-24T16:03:35.759Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:03:35.759Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use built-in validators (host, port, url, email) from ArkEnv when available in environment schemas instead of writing custom validators

Applied to files:

  • apps/playgrounds/node/index.js
  • examples/basic-js/README.md
📚 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:

  • apps/playgrounds/node/index.js
  • examples/basic-js/README.md
  • examples/basic-js/package.json
  • examples/README.md
  • examples/with-vite-react/README.md
📚 Learning: 2025-11-24T16:03:35.759Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:03:35.759Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use descriptive environment variable names that indicate purpose and format in schema definitions

Applied to files:

  • apps/playgrounds/node/index.js
  • examples/basic-js/README.md
  • examples/basic-js/.env.example
📚 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: ArkType validates environment variables at runtime and TypeScript types are inferred from the schema definition

Applied to files:

  • apps/playgrounds/node/index.js
  • examples/basic-js/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 : Use ArkType's `type()` function to define schemas in environment variable definitions

Applied to files:

  • apps/playgrounds/node/index.js
  • examples/basic-js/README.md
  • examples/basic-js/package.json
📚 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:

  • apps/playgrounds/node/index.js
  • examples/basic-js/README.md
📚 Learning: 2025-11-24T16:03:35.759Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:03:35.759Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Provide default values for optional environment variables in schemas using the `= value` syntax

Applied to files:

  • apps/playgrounds/node/index.js
  • examples/basic-js/.env.example
📚 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:

  • apps/playgrounds/node/index.js
  • examples/basic-js/README.md
  • examples/basic-js/package.json
  • examples/with-vite-react/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 : Use union types for enums in ArkType schemas (e.g., `"'dev' | 'prod'"`) instead of separate enum definitions

Applied to files:

  • apps/playgrounds/node/index.js
📚 Learning: 2025-11-24T16:03:35.759Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:03:35.759Z
Learning: Group related environment variables in logical schemas and document environment requirements in README files

Applied to files:

  • examples/basic-js/README.md
📚 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:

  • examples/basic-js/README.md
  • arkenv.code-workspace
  • examples/basic-js/package.json
  • examples/with-vite-react/package.json
  • examples/README.md
  • examples/with-vite-react/README.md
📚 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-vite-react/package.json
  • examples/README.md
  • examples/with-vite-react/README.md
📚 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: packages/arkenv should not depend on other workspace packages; packages/vite-plugin depends on arkenv; apps/www may depend on workspace packages

Applied to files:

  • arkenv.code-workspace
  • examples/basic-js/package.json
  • examples/with-vite-react/package.json
📚 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 : Use fixture-based testing pattern with `__fixtures__` directory for Vite plugin tests

Applied to files:

  • arkenv.code-workspace
  • examples/with-vite-react/package.json
  • examples/with-vite-react/README.md
📚 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 examples/*/package.json : Examples in examples/ directory are not published, may have their own lock files, and are used as test fixtures

Applied to files:

  • arkenv.code-workspace
  • examples/basic-js/package.json
  • examples/README.md
  • examples/basic-js/.env.example
📚 Learning: 2025-11-24T16:04:19.413Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:19.413Z
Learning: Applies to package.json : The project uses `pnpm10.20.0` (specified in `packageManager` field)

Applied to files:

  • examples/basic-js/package.json
📚 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/basic-js/package.json
📚 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/basic-js/package.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/**/*.test.{ts,tsx,js,jsx} : Use `bun test` instead of `jest` or `vitest` for running tests

Applied to files:

  • examples/with-vite-react/package.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/**/*.html : Use HTML imports with `Bun.serve()` and don't use Vite for frontend bundling and development

Applied to files:

  • examples/with-vite-react/package.json
  • examples/with-vite-react/README.md
📚 Learning: 2025-11-24T16:03:35.759Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:03:35.759Z
Learning: Add examples demonstrating new functionality in the `examples/` directory when adding new features or validators

Applied to files:

  • examples/README.md
📚 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: Achieve coverage goals: environment variable parsing and validation, type checking and error handling, default value handling, custom type validation, plugin integration with Vite, and real project build testing using examples as fixtures

Applied to files:

  • examples/README.md
  • examples/with-vite-react/README.md
📚 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 UPPER_SNAKE_CASE for environment variables and constants

Applied to files:

  • examples/basic-js/.env.example
🧬 Code graph analysis (4)
apps/playgrounds/node/index.js (3)
packages/arkenv/src/type.ts (1)
  • type (3-3)
packages/vite-plugin/src/index.ts (1)
  • arkenv (50-86)
packages/arkenv/src/create-env.ts (1)
  • createEnv (34-52)
arkenv.code-workspace (3)
examples/with-vite-react-ts/src/vite-env.d.ts (2)
  • ImportMetaEnv (18-18)
  • ViteTypeOptions (8-14)
examples/with-vite-react-ts/src/App.tsx (1)
  • App (6-34)
apps/playgrounds/vite/src/App.tsx (1)
  • App (6-46)
examples/README.md (2)
examples/with-vite-react-ts/src/App.tsx (3)
  • App (6-34)
  • count (21-21)
  • setCount (21-21)
examples/with-vite-react-ts/src/vite-env.d.ts (2)
  • ViteTypeOptions (8-14)
  • ImportMetaEnv (18-18)
examples/basic-js/.env.example (4)
packages/arkenv/src/array-defaults.integration.test.ts (1)
  • env (14-30)
packages/arkenv/src/custom-types.integration.test.ts (7)
  • vi (21-29)
  • createEnv (34-37)
  • vi (215-223)
  • vi (129-143)
  • env (199-205)
  • vi (145-159)
  • vi (161-173)
packages/bun-plugin/src/index.test.ts (1)
  • originalEnv (4-69)
examples/with-vite-react-ts/vite.config.ts (1)
  • env (11-20)
🪛 dotenv-linter (4.0.0)
examples/basic-js/.env.example

[warning] 3-3: [UnorderedKey] The NODE_ENV key should go before the PORT key

(UnorderedKey)

⏰ 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). (1)
  • GitHub Check: test-e2e (a11y)
🔇 Additional comments (12)
examples/with-vite-react/package.json (1)

2-2: LGTM! Rename aligns with PR objectives.

The package name change removes the TypeScript-specific suffix while the example continues to use TypeScript internally, correctly indicating that ArkEnv supports both TypeScript and JavaScript projects.

arkenv.code-workspace (2)

87-90: LGTM! New workspace folder added correctly.

The workspace configuration correctly adds the new basic-js example folder.


96-97: LGTM! Folder path updated consistently.

The workspace configuration correctly reflects the rename from with-vite-react-ts to with-vite-react.

examples/basic-js/package.json (1)

6-8: Verify Node.js version compatibility with --env-file flag.

The scripts use Node.js's --env-file flag, which was introduced in Node.js 20.6.0. Ensure the engine constraint (currently set to Node 24) is compatible with this feature and that the minimum supported version is documented.

The use of --env-file is excellent for a JavaScript example as it eliminates the need for third-party dotenv packages. However, verify that this approach is documented in the example's README so users understand the Node.js version requirement.

examples/basic-js/.gitignore (1)

1-1: LGTM! Correctly excludes environment files.

The .gitignore properly excludes .env files from version control, which is essential for protecting sensitive environment variables.

examples/basic-js/.env.example (1)

1-3: LGTM! Sensible default environment variables.

The environment variable template provides reasonable defaults for a basic Node.js application. The static analysis warning about key ordering is pedantic and can be safely ignored—environment variable order does not affect functionality.

examples/with-vite-react/README.md (1)

1-1: LGTM! Title correctly reflects optional TypeScript usage.

Removing "TypeScript" from the title aligns with the PR's goal of demonstrating that ArkEnv works with or without TypeScript, while the content still appropriately documents TypeScript integration features for those who choose to use it.

examples/README.md (2)

5-8: Excellent addition clarifying JavaScript support.

This note effectively addresses the PR's objective by explicitly stating that TypeScript is not required and providing a link to the JavaScript example. This will help JavaScript-only developers quickly find relevant resources.


15-15: LGTM! Reference updated consistently.

The example reference correctly updates from with-vite-react-ts to with-vite-react.

examples/basic-js/tsconfig.json (1)

1-12: Based on my verification, I've found critical issues with the examples/basic-js example that go beyond the original review comment. Let me now generate the rewritten review comment:


The examples/basic-js example is incomplete and contains contradictory/unnecessary files.

The basic-js example has multiple issues:

  1. index.js is empty (0 bytes): The example's entry point contains no code, making it non-functional. The README describes what to do but provides nothing to run. This should contain the same ArkEnv setup shown in examples/basic/index.ts, adapted for JavaScript.

  2. tsconfig.json is unnecessary: For a pure JavaScript example with no TypeScript files, this configuration serves no purpose. It's identical to examples/basic/tsconfig.json and isn't referenced in any npm scripts or documentation.

  3. Example not listed in examples/README.md: The main examples README mentions basic-js in a NOTE section but doesn't include it in the examples table, making it discoverable only through that note.

Recommended fixes:

  • Populate index.js with the JavaScript equivalent of the code in examples/basic/index.ts
  • Remove tsconfig.json from examples/basic-js/ (or document why it's present if intended for IDE support)
  • Add basic-js to the examples table in examples/README.md for consistency
⛔ Skipped due to 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: .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
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
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: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Prefer tree-shakeable exports for better 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/**/*.{ts,tsx,js,jsx,html,css} : Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild` for bundling
apps/playgrounds/node/index.js (1)

15-28: LGTM!

The destructuring, logging, and export demonstrate proper ArkEnv usage in JavaScript. The implementation clearly shows how validated environment variables can be accessed and used.

examples/basic-js/README.md (1)

44-77: LGTM!

The walkthrough is clear, practical, and effectively demonstrates:

  • How ArkEnv validation errors appear
  • How to resolve missing required variables using .env files
  • Step-by-step commands that users can execute
  • Helpful next steps with documentation links

The tutorial provides a solid learning experience for users new to ArkEnv in JavaScript contexts.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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: 0

🧹 Nitpick comments (1)
examples/basic-js/README.md (1)

36-43: Clarify the initial schema to improve example completeness.

The example shows adding MY_ENV_VAR with a comment indicating "// other definitions..." already exist. For a "basic" example, it would be helpful to explicitly show what the initial schema contains (e.g., HOST, PORT, NODE_ENV as referenced in the .env.example context), so readers understand the full environment structure before and after adding a new variable.

Consider revising the code snippet to show the complete initial schema or adding a note explaining what variables are already defined:

     // index.js
     const env = arkenv({
-        // other definitions...
+        HOST: "string.host | string",
+        PORT: "number.port | string",
+        NODE_ENV: "'development' | 'production'",
         MY_ENV_VAR: "string"
     });

Alternatively, add an explanatory sentence: "The schema already defines HOST, PORT, and NODE_ENV (shown in .env.example). Now let's add a new required variable:"

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3dd8f5 and 53578c7.

📒 Files selected for processing (1)
  • examples/basic-js/README.md (1 hunks)
🧰 Additional context used
🧠 Learnings (15)
📓 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: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:03:35.759Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `createEnv(schema)` function (available as default export, typically imported as `arkenv`) to create validated environment objects with ArkType schema definitions
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
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/test-patterns.mdc:0-0
Timestamp: 2025-11-24T16:04:36.939Z
Learning: Achieve coverage goals: environment variable parsing and validation, type checking and error handling, default value handling, custom type validation, plugin integration with Vite, and real project build testing using examples as fixtures
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/.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
📚 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:

  • examples/basic-js/README.md
📚 Learning: 2025-11-24T16:03:35.759Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:03:35.759Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `createEnv(schema)` function (available as default export, typically imported as `arkenv`) to create validated environment objects with ArkType schema definitions

Applied to files:

  • examples/basic-js/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/basic-js/README.md
📚 Learning: 2025-11-24T16:03:35.759Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:03:35.759Z
Learning: Group related environment variables in logical schemas and document environment requirements in README files

Applied to files:

  • examples/basic-js/README.md
📚 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/basic-js/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 : Convert ArkType validation errors to `ArkEnvError` for user-friendly error messages that include variable name and expected type

Applied to files:

  • examples/basic-js/README.md
📚 Learning: 2025-11-24T16:03:35.759Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:03:35.759Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use descriptive environment variable names that indicate purpose and format in schema definitions

Applied to files:

  • examples/basic-js/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 : Use ArkType's `type()` function to define schemas in environment variable definitions

Applied to files:

  • examples/basic-js/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 : Leverage ArkType's built-in types (e.g., `string.host`, `number.port`) where possible in environment schemas

Applied to files:

  • examples/basic-js/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 : Use union types for enums in ArkType schemas (e.g., `"'dev' | 'prod'"`) instead of separate enum definitions

Applied to files:

  • examples/basic-js/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: ArkType validates environment variables at runtime and TypeScript types are inferred from the schema definition

Applied to files:

  • examples/basic-js/README.md
📚 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 PascalCase for type names (e.g., `ArkEnvError`)

Applied to files:

  • examples/basic-js/README.md
📚 Learning: 2025-11-24T16:03:35.759Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:03:35.759Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use built-in validators (host, port, url, email) from ArkEnv when available in environment schemas instead of writing custom validators

Applied to files:

  • examples/basic-js/README.md
📚 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: Achieve coverage goals: environment variable parsing and validation, type checking and error handling, default value handling, custom type validation, plugin integration with Vite, and real project build testing using examples as fixtures

Applied to files:

  • examples/basic-js/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)
🔇 Additional comments (2)
examples/basic-js/README.md (2)

8-11: Good integration of feedback on runtime-vs.-compile-time validation terminology.

The update from "Typesafe environment configuration" to "Runtime-validated environment configuration" (line 11) accurately reflects what ArkEnv provides in a pure JavaScript context, addressing prior review feedback.


50-50: Documentation URL is valid and verified.

The link at line 50 to arkenv.js.org/docs/arkenv/how-to/load-environment-variables#using-env-files is correct. This page exists in the documentation structure and is actively tested by the Playwright test suite. The same URL is also used consistently across other example READMEs (examples/basic/README.md, examples/with-bun/README.md) and is referenced in the site's meta configuration, confirming its validity.

@yamcodes yamcodes merged commit 11b1c00 into main Nov 29, 2025
15 checks passed
@yamcodes yamcodes deleted the 456-can-we-use-this-without-typescript branch November 29, 2025 07:59
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.

Can we use this without TypeScript?

1 participant