Skip to content

docs(bun-plugin): document process.env type augmentation#464

Merged
yamcodes merged 4 commits intomainfrom
copilot/document-process-env-type-augmentation
Nov 29, 2025
Merged

docs(bun-plugin): document process.env type augmentation#464
yamcodes merged 4 commits intomainfrom
copilot/document-process-env-type-augmentation

Conversation

Copy link
Contributor

Copilot AI commented Nov 29, 2025

The bun plugin exports ProcessEnvAugmented for typesafe process.env access, but this wasn't documented.

Changes

  • Added typing-process-env.mdx to bun-plugin docs
  • Updated meta.json to include new page in navigation

Usage

// bun-env.d.ts
/// <reference types="bun-types" />

type ProcessEnvAugmented = import("@arkenv/bun-plugin").ProcessEnvAugmented<
	typeof import("./src/env").default
>;

declare namespace NodeJS {
	interface ProcessEnv extends ProcessEnvAugmented {}
}

Follows same pattern as existing vite-plugin typing-import-meta-env.mdx docs.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /usr/local/bin/node node ./node_modules/.bin/../next/dist/bin/next build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Bun docs: document process.env type augmentation</issue_title>
<issue_description>The bun plugin allows type augmentation, properly document it in our docs</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Summary by CodeRabbit

  • Documentation
    • Added guide for making process.env typesafe in Bun plugins, including step-by-step setup instructions, usage examples for BUN_PUBLIC_* variables, and detailed explanations of the type augmentation system.

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

@changeset-bot
Copy link

changeset-bot bot commented Nov 29, 2025

⚠️ No Changeset found

Latest commit: 63dd96e

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 29, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

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

This PR adds documentation for Bun plugin's process.env type augmentation feature. A new guide page is created detailing setup, usage examples with BUN_PUBLIC_* variables, and explanation of the ProcessEnvAugmented type. The navigation metadata is updated to include the new page.

Changes

Cohort / File(s) Change Summary
Documentation Navigation
apps/www/content/docs/bun-plugin/meta.json
Added "typing-process-env" to the pages array to register the new guide in documentation navigation.
Typing Guide
apps/www/content/docs/bun-plugin/typing-process-env.mdx
New documentation page explaining process.env type augmentation setup using ArkEnv's Bun plugin, including step-by-step configuration examples, BUN_PUBLIC_* variable usage, and ProcessEnvAugmented type behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Validate documentation accuracy and clarity of setup instructions
  • Verify examples are correct and follow Bun plugin conventions
  • Check meta.json entry aligns with existing navigation structure

Possibly related PRs

  • Add Bun plugin #439: Implements the ProcessEnvAugmented type and Bun plugin functionality that this new documentation describes and explains for users.

Suggested labels

@arkenv/bun-plugin

Poem

🐰 A new guide hops into the docs today,
Making process.env type-safe in every way!
With setup steps and examples so clear,
The Bun plugin's magic is finally near! ✨

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 and concisely describes the main change: documentation of process.env type augmentation for the bun-plugin.
Linked Issues check ✅ Passed The PR fully addresses issue #463 by documenting ProcessEnvAugmented type augmentation for process.env, providing setup examples, and mirroring the vite-plugin documentation pattern.
Out of Scope Changes check ✅ Passed All changes are directly scoped to documenting process.env type augmentation: new documentation page and meta.json navigation update are both aligned with issue objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

@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:45pm

Co-authored-by: yamcodes <2014360+yamcodes@users.noreply.github.com>
Copilot AI changed the title [WIP] Document process.env type augmentation for bun plugin docs(bun-plugin): document process.env type augmentation Nov 29, 2025
Copilot AI requested a review from yamcodes November 29, 2025 20:26
@github-actions github-actions bot added docs Improvements or additions to documentation www Improvements or additions to arkenv.js.org labels Nov 29, 2025
@yamcodes yamcodes marked this pull request as ready for review November 29, 2025 20:37
Copilot AI review requested due to automatic review settings November 29, 2025 20:37
@yamcodes
Copy link
Owner

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 29, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds documentation for the ProcessEnvAugmented type export from @arkenv/bun-plugin, enabling developers to achieve typesafe process.env access in Bun projects. The documentation follows the established pattern from the vite-plugin's typing-import-meta-env.mdx documentation, ensuring consistency across the plugin ecosystem.

Key Changes

  • Created comprehensive documentation page explaining how to set up type augmentation for process.env in Bun projects
  • Added navigation entry in meta.json to make the new documentation discoverable
  • Included complete examples showing the setup, usage, and organization patterns for growing projects

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/www/content/docs/bun-plugin/typing-process-env.mdx New documentation page covering ProcessEnvAugmented type setup, usage examples, how it works, project organization patterns, and a warning about import statements breaking type augmentation
apps/www/content/docs/bun-plugin/meta.json Added typing-process-env to the navigation pages array to make the new documentation accessible from the sidebar

@yamcodes yamcodes merged commit 5518bb4 into main Nov 29, 2025
15 checks passed
@yamcodes yamcodes deleted the copilot/document-process-env-type-augmentation branch November 29, 2025 20:49
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 www Improvements or additions to arkenv.js.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bun docs: document process.env type augmentation

3 participants