Skip to content

ArkEnv in vite.config.ts#380

Merged
yamcodes merged 24 commits intomainfrom
365-arkenv-in-viteconfigts
Nov 20, 2025
Merged

ArkEnv in vite.config.ts#380
yamcodes merged 24 commits intomainfrom
365-arkenv-in-viteconfigts

Conversation

@yamcodes
Copy link
Owner

@yamcodes yamcodes commented Nov 18, 2025

A natural continuation of #381

Summary by CodeRabbit

  • New Features

    • Validate environment variables in vite.config and reuse a single schema across config and the Vite plugin
    • Server config now reads port from validated env
  • Documentation

    • Reorganized docs under /docs/arkenv with new Vite plugin guide and examples
    • Updated navigation and doc links to the new hierarchy
  • Chores

    • Updated examples, tests, and site redirects to use the arkenv-specific paths

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

…ing and improved plugin usage

- Updated Vite configuration to utilize `loadEnv` for environment variable management.
- Refactored plugin imports and initialization for better clarity and structure.
- Ensured server port is dynamically set based on environment variables.
@yamcodes yamcodes linked an issue Nov 18, 2025 that may be closed by this pull request
@changeset-bot
Copy link

changeset-bot bot commented Nov 18, 2025

⚠️ No Changeset found

Latest commit: 39cd975

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 changesets to release 2 packages
Name Type
@arkenv/vite-plugin Patch
arkenv Patch

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 18, 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 20, 2025 8:25pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 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 4 minutes and 48 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 e1e0d70 and 39cd975.

📒 Files selected for processing (7)
  • tooling/playwright-www/tests/a11y.test.ts (2 hunks)
  • tooling/playwright-www/tests/docs-navigation.test.ts (8 hunks)
  • tooling/playwright-www/tests/examples.test.ts (7 hunks)
  • tooling/playwright-www/tests/homepage.test.ts (1 hunks)
  • tooling/playwright-www/tests/integrations.test.ts (10 hunks)
  • tooling/playwright-www/tests/morphs.test.ts (12 hunks)
  • tooling/playwright-www/tests/quickstart.test.ts (10 hunks)

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Reorganizes documentation under /docs/arkenv, adds a Vite plugin/docs section and examples for using ArkEnv inside vite.config.ts with shared type() schemas, renames schema identifiers from envSchema → Env across examples/tests, adds middleware and redirects for docs paths, and updates tests and dependencies accordingly.

Changes

Cohort / File(s) Summary
Docs metadata & structure
apps/www/content/docs/meta.json, apps/www/content/docs/arkenv/meta.json, apps/www/content/docs/vite-plugin/meta.json
Replace top-level pages list with ["arkenv","vite-plugin"]; add arkenv docs meta with sections and add vite-plugin meta.
New Vite plugin docs & examples
apps/www/content/docs/vite-plugin/index.mdx, apps/www/content/docs/vite-plugin/arkenv-in-viteconfig.mdx, openspec/specs/vite-config-usage/spec.md, openspec/changes/archive/.../*
Add docs/specs/design/tasks describing using ArkEnv in vite.config.ts, showing loadEnv + shared Env schema and validation patterns.
Schema rename (envSchema → Env)
.changeset/clever-ties-search.md, apps/playgrounds/node/index.ts, apps/www/content/docs/arkenv/how-to/reuse-schemas.mdx, packages/vite-plugin/src/__fixtures__/basic/config.ts, packages/vite-plugin/src/index.test.ts, ...
Rename local/exported schema identifiers from envSchema to Env and update all usage sites and tests accordingly.
Vite config pattern & example changes
apps/playgrounds/vite/vite.config.ts
Convert config to function form, load runtime .env via loadEnv, validate with arkenv(Env, ...), initialize vite plugin with schema, and use validated env (e.g., server.port ← env.PORT).
Docs routing & redirects
apps/www/middleware.ts, apps/www/next.config.ts, apps/www/app/(home)/layout.tsx, apps/www/components/page/sail-button.tsx, apps/www/components/page/sail-button.test.tsx
Add middleware to redirect/match old /docs/* slugs to /docs/arkenv/*, add permanent redirect /docs/docs/arkenv, and update UI link targets and tests to new paths.
Tests updated for arkenv-prefixed paths & schemas
tooling/playwright-www/tests/quickstart.test.ts, tooling/playwright-www/tests/docs-navigation.test.ts, packages/arkenv/src/create-env.test.ts, packages/vite-plugin/src/index.test.ts
Update Playwright and unit tests to expect /docs/arkenv/* paths; add tests for type()-based schemas in createEnv and adjust fixtures to use Env.
Package & dependency updates
apps/www/package.json, packages/vite-plugin/package.json, packages/vite-plugin/README.md, packages/arkenv/README.md
Add @arkenv/vite-plugin and vite to www dependencies; widen vite devDependency version in vite-plugin; update README installation/links.
Examples & READMEs link fixes
examples/basic/README.md, examples/with-bun/README.md
Update documentation hyperlinks to use /docs/arkenv/... targets.
Design/spec archives
openspec/changes/archive/2025-11-20-add-arkenv-vite-config/*
Add design, proposal, tasks, and spec documents describing implementation choices and migration notes for Vite config usage.

Sequence Diagram(s)

sequenceDiagram
    participant Vite as Vite
    participant Config as vite.config.ts
    participant LoadEnv as loadEnv()
    participant ArkEnv as arkenv(Env,...)
    participant Plugin as `@arkenv/vite-plugin`

    Vite->>Config: invoke with {mode}
    Config->>LoadEnv: loadEnv(mode, cwd, "")
    LoadEnv-->>Config: raw env map
    Config->>ArkEnv: arkenv(Env, raw env)
    ArkEnv-->>Config: validated/typed env
    Config->>Vite: return config (server.port ← env.PORT) + plugins
    Vite->>Plugin: plugin initialized with Env (validates VITE_* for client)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas to focus during review:
    • apps/www/middleware.ts — redirect/matching logic and edge cases for existing doc slugs.
    • apps/playgrounds/vite/vite.config.ts — runtime loadEnv + arkenv usage and plugin wiring.
    • Tests added/updated in packages/arkenv/src/create-env.test.ts and packages/vite-plugin/src/index.test.ts — ensure assertions reflect intended type-inference/validation behavior.
    • Documentation metadata (apps/www/content/docs/meta.json) — verify all site links remain resolvable.

Possibly related issues

  • ArkEnv in vite.config.ts #365 — Implements ArkEnv-in-vite.config feature requested by this issue (shared schemas, loadEnv integration, vite-plugin support).

Possibly related PRs

Poem

🐰 I hopped through docs and changed the trail,
Env schemas unified without fail.
Vite now listens, loadEnv in hand,
Validated vars spread across the land.
Cheers from a rabbit — clean paths, smooth sail!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title "ArkEnv in vite.config.ts" clearly and specifically describes the main change: adding support for using ArkEnv within Vite configuration files.
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.

- Updated various dependencies in `package.json` to their latest versions, including `@sentry/nextjs`, `vite`, and `@vitejs/plugin-react`.
- Enhanced test setup by refining console error and warning suppression methods for better clarity and maintainability.
- Adjusted configurations to support new features and improvements in the updated dependencies.
@github-actions github-actions bot added the docs Improvements or additions to documentation label Nov 18, 2025
- Introduced a new requirement ensuring that the environment object returned from `loadEnv` or any wrapper is type-safe.
- Specified that unsafe patterns bypassing validation or type checking are forbidden.
- Documented scenarios to prevent unsafe usage and emphasized the need for proper typing or wrapping of the environment object.
- Updated existing documentation to explicitly forbid unsafe usage patterns in Vite config examples.
- Defined the environment variable schema using ArkType's `type()` function outside of `defineConfig` for reuse in both `loadEnv` and plugin contexts.
- Updated `createEnv` to accept both raw schema objects and type definitions, improving type inference and validation.
- Modified Vite plugin to utilize the new schema structure, ensuring type safety and reducing code duplication.
- Enhanced documentation to reflect the new schema usage and type safety requirements for Vite configuration.
@github-actions github-actions bot added arkenv Changes to the `arkenv` npm package. @arkenv/vite-plugin Issues or Pull Requests involving the Vite plugin for ArkEnv labels Nov 18, 2025
@arkenv-bot
Copy link
Contributor

arkenv-bot bot commented Nov 18, 2025

📦 Bundle Size Report

Package Size Limit Diff Status
@arkenv/vite-plugin 828 B 2 kB 0.0%
arkenv 729 B 2 kB 0.0%

All size limits passed!

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 18, 2025

Open in StackBlitz

npm i https://pkg.pr.new/arkenv@380
npm i https://pkg.pr.new/@arkenv/vite-plugin@380

commit: 39cd975

@github-actions github-actions bot removed arkenv Changes to the `arkenv` npm package. @arkenv/vite-plugin Issues or Pull Requests involving the Vite plugin for ArkEnv labels Nov 19, 2025
… handling

- Updated dependencies in pnpm-lock.yaml, including rolldown-vite to version 7.2.7 and added @arkenv/vite-plugin.
- Refactored Vite configuration to use consistent naming for plugins and improved environment variable handling.
- Introduced middleware in the Next.js application to manage documentation routing and added redirects for better user experience.
- Enhanced documentation with new guides for ArkEnv integration and usage examples.

This commit enhances type safety and usability across the project, ensuring a smoother development experience.
@github-actions github-actions bot added www Improvements or additions to arkenv.js.org tests This issue or PR is about adding, removing or changing tests labels Nov 20, 2025
@github-actions github-actions bot added the @arkenv/vite-plugin Issues or Pull Requests involving the Vite plugin for ArkEnv label Nov 20, 2025
…mentation updates

- Added tests for `createEnv` to validate type definitions, type inference, schema reuse, and error handling.
- Updated `packages/arkenv/README.md` to include a link to the Vite plugin documentation for better guidance on usage.
- Created a new documentation page `arkenv-in-viteconfig.mdx` detailing the integration of ArkEnv in Vite configurations, including examples and distinctions between server-only and client-exposed environment variables.

This commit improves the robustness of the ArkEnv integration with Vite and enhances the clarity of documentation for users.
@github-actions github-actions bot added the arkenv Changes to the `arkenv` npm package. label Nov 20, 2025
…nv and Vite integration

- Deleted the design document outlining the context, goals, decisions, and implementation details for integrating ArkEnv with Vite.
- Removed the proposal document detailing the rationale, architectural challenges, and potential solutions for using ArkEnv with unprefixed environment variables in Vite.
- Cleared out the tasks document that tracked the evaluation, implementation, documentation, and testing of the integration.
- Eliminated the specs document that defined requirements and scenarios for using ArkEnv in Vite config files.

This commit cleans up obsolete documentation related to the ArkEnv and Vite integration, streamlining the project structure.
- Marked validation tasks as complete, confirming successful spec validation and example functionality.
- Added details on the successful Vite playground build and type checking for `arkenv` and `vite-plugin` packages.
- Created a new documentation page explaining Vite's environment loading behavior and providing clear examples of config vs client variables.

This commit enhances the documentation clarity and ensures all validation steps are thoroughly addressed.
- Added an important note in the Vite configuration documentation emphasizing the necessity of installing the core `arkenv` package.
- Updated links to the ArkEnv documentation across multiple README files to direct users to the correct page for better navigation.

This commit enhances user guidance and ensures clarity in the integration process.
@github-actions github-actions bot added the example Issues or Pull Requests concerning at least one ArkEnv example. (Found in the `examples/` directory) label Nov 20, 2025
- Added an important note highlighting the requirement to install the core `arkenv` package for proper functionality.
- Removed redundant note to streamline the documentation.

This commit improves clarity and ensures users are aware of necessary dependencies for using ArkEnv in Vite configurations.
@yamcodes yamcodes changed the title 365 arkenv in viteconfigts ArkEnv in vite.config.ts Nov 20, 2025
- Modified test cases in `quickstart.test.ts` to update integration links for VSCode, JetBrains, and environment variables guide to point to the new ArkEnv paths.
- Ensured that the expected URLs in the tests align with the updated documentation structure.

This commit enhances the accuracy of the Quickstart tests, ensuring they reflect the latest documentation changes for ArkEnv.
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: 2

🧹 Nitpick comments (5)
packages/arkenv/README.md (2)

63-63: Update Features section to acknowledge Vite support.

The Features section states "Works in Node.js and Bun," but the header badges include Vite and the Plugins section (line 120) emphasizes the Vite plugin. Given the PR's focus on Vite config integration, update this to mention Vite support or link to the Vite example.

Based on learnings, runtime support documentation should link to specific examples: Node.js (examples/basic), Bun (examples/with-bun), and Vite (examples/with-vite-react-ts). Please verify the Vite example path exists and update accordingly.


116-116: Add Vite example link to Requirements section.

The Requirements section links to Node.js and Bun examples but omits the Vite example. Given the PR's emphasis on Vite integration and the retrieved learning that documentation should link to specific examples, this should include a link to the Vite example as well.

Consider updating this line to:

- Tested on [Node.js **LTS** and **Current**](https://github.com/yamcodes/arkenv/tree/main/examples/basic), [Bun **1.2**](https://github.com/yamcodes/arkenv/tree/main/examples/with-bun), and [Vite](https://github.com/yamcodes/arkenv/tree/main/examples/with-vite-react-ts). Older versions may work but are not officially supported.

Please verify the Vite example path and confirm this update aligns with the documentation strategy.

packages/vite-plugin/README.md (1)

20-52: Installation section looks good, but consider enhancing examples reference per project learnings.

The installation instructions are comprehensive and cover all major package managers. However, based on learnings from a related PR, runtime support documentation should link to specific examples. Consider adding a reference to the Vite example (e.g., examples/with-vite-react-ts) alongside the playground link.

You could enhance the documentation by adding an examples section like:

## Quick Start

See [examples/with-vite-react-ts](https://github.com/yamcodes/arkenv/tree/main/examples/with-vite-react-ts) for a complete working example.
tooling/playwright-www/tests/quickstart.test.ts (1)

145-145: Path updates and improved navigation handling.

The updated path correctly reflects the new documentation structure. The explicit waitForURL with wildcard pattern and timeout (lines 151-156) is a good defensive practice for handling navigation timing.

Consider applying consistent navigation pattern:

For consistency and reliability, consider applying the same explicit waitForURL pattern to the integration links tests (lines 98-99, 111-112):

 await vscodeLink.click();
+await page.waitForURL(
+    "**/docs/arkenv/integrations/vscode",
+    { timeout: 10000 }
+);
 await expect(page).toHaveURL("/docs/arkenv/integrations/vscode");

This would make all navigation tests handle timing consistently, though the current approach may already be sufficient if those navigations are faster.

Also applies to: 151-159

openspec/specs/vite-config-usage/spec.md (1)

3-4: Update the Purpose section.

The Purpose section contains placeholder text indicating it was created during archiving and needs updating.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f8bfd5f and e1de716.

📒 Files selected for processing (12)
  • apps/www/content/docs/vite-plugin/arkenv-in-viteconfig.mdx (1 hunks)
  • examples/basic/README.md (1 hunks)
  • examples/with-bun/README.md (1 hunks)
  • openspec/changes/archive/2025-11-20-add-arkenv-vite-config/design.md (1 hunks)
  • openspec/changes/archive/2025-11-20-add-arkenv-vite-config/proposal.md (1 hunks)
  • openspec/changes/archive/2025-11-20-add-arkenv-vite-config/specs/vite-config-usage/spec.md (1 hunks)
  • openspec/changes/archive/2025-11-20-add-arkenv-vite-config/tasks.md (1 hunks)
  • openspec/specs/vite-config-usage/spec.md (1 hunks)
  • packages/arkenv/README.md (1 hunks)
  • packages/arkenv/src/create-env.test.ts (1 hunks)
  • packages/vite-plugin/README.md (1 hunks)
  • tooling/playwright-www/tests/quickstart.test.ts (2 hunks)
✅ Files skipped from review due to trivial changes (3)
  • openspec/changes/archive/2025-11-20-add-arkenv-vite-config/design.md
  • openspec/changes/archive/2025-11-20-add-arkenv-vite-config/proposal.md
  • examples/with-bun/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/www/content/docs/vite-plugin/arkenv-in-viteconfig.mdx
🧰 Additional context used
🧠 Learnings (3)
📓 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).
📚 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/README.md
  • openspec/changes/archive/2025-11-20-add-arkenv-vite-config/tasks.md
  • packages/vite-plugin/README.md
  • packages/arkenv/README.md
  • tooling/playwright-www/tests/quickstart.test.ts
  • openspec/specs/vite-config-usage/spec.md
  • openspec/changes/archive/2025-11-20-add-arkenv-vite-config/specs/vite-config-usage/spec.md
📚 Learning: 2025-09-10T19:35:18.179Z
Learnt from: yamcodes
Repo: yamcodes/arkenv PR: 136
File: .changeset/vast-bananas-win.md:2-3
Timestamp: 2025-09-10T19:35:18.179Z
Learning: The arkenv package is currently in v0.x.x (pre-1.0) development phase, where breaking changes are acceptable in minor version bumps according to semantic versioning conventions.

Applied to files:

  • examples/basic/README.md
🧬 Code graph analysis (3)
openspec/changes/archive/2025-11-20-add-arkenv-vite-config/tasks.md (5)
packages/vite-plugin/src/index.test.ts (6)
  • config (39-75)
  • mockTransformedEnv (135-182)
  • mockCreateEnv (102-133)
  • mockTransformedEnv (261-304)
  • pluginInstance (95-100)
  • mockCreateEnv (232-259)
packages/arkenv/src/index.test.ts (1)
  • vi (65-81)
packages/arkenv/src/error.integration.test.ts (1)
  • it (15-183)
packages/vite-plugin/src/index.ts (1)
  • arkenv (15-36)
packages/arkenv/src/custom-types.integration.test.ts (1)
  • it (190-224)
packages/arkenv/src/create-env.test.ts (4)
packages/arkenv/src/type.ts (1)
  • type (3-3)
packages/arkenv/src/create-env.ts (1)
  • createEnv (47-65)
packages/arkenv/src/types.ts (1)
  • port (6-14)
packages/arkenv/src/custom-types.integration.test.ts (2)
  • it (128-188)
  • it (190-224)
openspec/changes/archive/2025-11-20-add-arkenv-vite-config/specs/vite-config-usage/spec.md (4)
packages/arkenv/src/type.test.ts (5)
  • envType (86-108)
  • envType (29-47)
  • envType (202-217)
  • envType (171-190)
  • envType (5-9)
packages/arkenv/src/create-env.ts (1)
  • createEnv (47-65)
packages/vite-plugin/src/index.test.ts (1)
  • config (39-75)
packages/vite-plugin/src/index.ts (1)
  • arkenv (15-36)
🪛 LanguageTool
openspec/specs/vite-config-usage/spec.md

[style] ~36-~36: This phrase is redundant. Consider using “outside”.
Context: ...nction (not as a raw object) and placed outside of defineConfig to enable reuse in both ...

(OUTSIDE_OF)

openspec/changes/archive/2025-11-20-add-arkenv-vite-config/specs/vite-config-usage/spec.md

[style] ~33-~33: This phrase is redundant. Consider using “outside”.
Context: ...nction (not as a raw object) and placed outside of defineConfig to enable reuse in both ...

(OUTSIDE_OF)

🪛 markdownlint-cli2 (0.18.1)
packages/vite-plugin/README.md

9-9: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

🔇 Additional comments (6)
tooling/playwright-www/tests/quickstart.test.ts (1)

94-94: Path updates look correct.

The updated paths correctly reflect the new documentation structure under /docs/arkenv/integrations/. The test logic remains sound.

Also applies to: 99-99, 107-107, 112-112

openspec/changes/archive/2025-11-20-add-arkenv-vite-config/specs/vite-config-usage/spec.md (1)

1-90: Comprehensive and well-structured specification.

The specification clearly defines requirements for using ArkEnv in Vite config files, including:

  • Type-safe validation with type() definitions
  • Schema reuse between loadEnv and the Vite plugin
  • Clear forbidden patterns to prevent type-safety bypasses
  • Proper error handling expectations

The distinction between server-only config variables and client-exposed VITE_* variables is well-documented.

Note: The static analysis hint about "outside of" being redundant is a false positive—"placed outside of defineConfig" is clear and idiomatic in this context.

packages/arkenv/src/create-env.test.ts (1)

113-189: Comprehensive test coverage for type definitions—consider naming consistency.

The new test suite thoroughly validates:

  • Type definition acceptance via type()
  • Correct type inference and value coercion
  • Schema reuse across multiple createEnv invocations
  • Error handling for invalid type definitions
  • Custom environment integration

However, the tests use envSchema as the variable name (lines 118, 133, 151, 166, 174), while the PR summary indicates a broader effort to rename schema variables from envSchema to Env across the codebase. While these are local test variables, consider using Env for consistency with the naming convention established elsewhere in this PR.

Would you like to align the test variable naming with the Env convention used in other parts of this PR?

openspec/specs/vite-config-usage/spec.md (1)

6-93: Well-structured specification—approved.

This specification document provides clear, comprehensive requirements for ArkEnv integration with Vite config files. The requirements properly cover:

  • Type-safe environment validation patterns
  • Schema reuse strategies
  • Error handling expectations
  • Forbidden unsafe patterns

The scenarios effectively illustrate the expected behavior and constraints.

Note: The static analysis hint flagging "outside of" is a false positive.

openspec/changes/archive/2025-11-20-add-arkenv-vite-config/tasks.md (1)

1-73: Thorough task completion documentation.

This checklist provides excellent tracking of the implementation work, including:

  • Solution evaluation with clear choice documentation
  • Implementation details for createEnv and Vite plugin updates
  • Test coverage verification
  • Documentation and example updates
  • Validation steps

The notes clarify that no separate loadEnv wrapper was needed since createEnv accepts type definitions directly, which simplifies the API surface.

examples/basic/README.md (1)

76-76: Link update aligns with docs reorganization.

The change at line 76 correctly updates the "Next steps" link to point to the reorganized /docs/arkenv structure, consistent with the PR's documentation reorganization objective.

…iles

- Corrected links in the `README.md` files for the basic and with-bun examples to point to the updated ArkEnv documentation.
- Adjusted the heading level in the Vite plugin documentation for consistency.

This commit ensures that users have accurate navigation paths for environment variable setup and improves the overall documentation structure.
- Modified the test case in `docs-navigation.test.ts` to update the navigation links from the homepage to the quickstart documentation, ensuring they point to the correct ArkEnv paths.
- Adjusted expected URL checks to align with the updated documentation structure.

This commit enhances the accuracy of the documentation navigation tests, ensuring they reflect the latest changes in the ArkEnv documentation.
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 (3)
tooling/playwright-www/tests/docs-navigation.test.ts (1)

58-71: Updated quickstart navigation path looks correct

Using a[href='/docs/arkenv/quickstart'] and asserting navigation to /docs/arkenv/quickstart aligns this test with the new docs routing; the sequencing (visibility → click → waitForURLtoHaveURL) is solid and should be reliable across browsers.

As a small polish, you could DRY the quickstart path into a constant and reuse it for the locator and both URL expectations in this file to avoid future drift if the path changes again, but this is optional.

packages/vite-plugin/README.md (2)

5-7: Consider using blank lines for spacing instead of <br/> tags.

While <br/> tags render correctly in HTML, standard markdown practice favors blank lines for paragraph spacing (consistent rendering across platforms and toolchains). This is a minor stylistic choice, but aligns better with markdown conventions.

-<br/>
-<br/>
-<br/>
+

Also applies to: 11-12


9-9: Documentation link is present; consider also linking the specific Vite example application.

The docs link (line 9) and playground link (line 62) are good, but per your documentation standards, explicitly linking examples/with-vite-react-ts alongside the playground would help users find runnable reference code more directly.

For example, you could update the Playground section:

 ## Playground

+* [Vite + React + TypeScript Example](https://github.com/yamcodes/arkenv/tree/main/examples/with-vite-react-ts)
 * [vite-playground](https://github.com/yamcodes/arkenv/tree/main/apps/playgrounds/vite)

Based on learnings from PR #132.

Also applies to: 62-62

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e1de716 and e1e0d70.

📒 Files selected for processing (4)
  • examples/basic/README.md (2 hunks)
  • examples/with-bun/README.md (2 hunks)
  • packages/vite-plugin/README.md (1 hunks)
  • tooling/playwright-www/tests/docs-navigation.test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • examples/basic/README.md
  • examples/with-bun/README.md
🧰 Additional context used
🧠 Learnings (2)
📓 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).
📚 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:

  • packages/vite-plugin/README.md
🧬 Code graph analysis (1)
tooling/playwright-www/tests/docs-navigation.test.ts (1)
tooling/playwright-www/tests/quickstart.test.ts (5)
  • page (36-42)
  • page (88-114)
  • page (18-34)
  • page (158-165)
  • page (53-66)
⏰ 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 (a11y)
  • GitHub Check: test-e2e (e2e)
🔇 Additional comments (2)
packages/vite-plugin/README.md (2)

9-9: Heading structure is now correct.

The heading hierarchy (h1 → h2 for all top-level sections) follows markdown standards and resolves the previous increment issue. Good fix.

Also applies to: 14-14, 20-20, 54-54, 60-60, 64-64


20-52: Installation section restructuring is well-organized.

The multi-package-manager approach with collapsible details and npm open by default is a solid UX improvement. All commands follow correct syntax for their respective tools (npm install, pnpm add, yarn add, bun add).

- Modified various test files to update URLs from the old `/docs` structure to the new `/docs/arkenv` paths, ensuring all tests point to the correct documentation.
- Adjusted expected titles and navigation checks to align with the updated documentation structure.

This commit enhances the accuracy of the tests, ensuring they reflect the latest changes in the ArkEnv documentation.
@yamcodes yamcodes merged commit 4df6a54 into main Nov 20, 2025
19 checks passed
@yamcodes yamcodes deleted the 365-arkenv-in-viteconfigts branch November 20, 2025 20:31
@coderabbitai coderabbitai bot mentioned this pull request Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@arkenv/vite-plugin Issues or Pull Requests involving the Vite plugin for ArkEnv arkenv Changes to the `arkenv` npm package. docs Improvements or additions to documentation example Issues or Pull Requests concerning at least one ArkEnv example. (Found in the `examples/` directory) tests This issue or PR is about adding, removing or changing tests www Improvements or additions to arkenv.js.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ArkEnv in vite.config.ts

1 participant