Conversation
- Changed the default export to a variable `arkenv` for better readability. - Maintained the export of `createEnv` and `type` for continued access to the API. - Improved structure of exports to enhance code organization.
- Fixed default export alias in docs - Added code example for clarity - Ensured backward compatibility
🦋 Changeset detectedLatest commit: 827bd66 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe default export of the arkenv module changes to an alias named arkenv, while keeping createEnv as a named export. The index export surface is narrowed to explicit exports. A changeset entry documents the patch. package.json adds a new root-level version field. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Pre-merge checks (3 passed)✅ Passed checks (3 passed)
Poem
✨ Finishing touches
🧪 Generate unit tests
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
package.json (1)
38-39: Avoid adding a root-level version in a Changesets monorepo.Root "version" is unused by Changesets and can cause confusion or unintended bumps. Recommend removing it.
Apply:
- }, - "version": "0.0.1" + }.changeset/clever-dryers-drum.md (1)
1-26: Note potential export-surface change or clarify that only an alias changed.If
export *removals narrow the public API, this is breaking and may warrant a minor (per your pre-1.0 policy). Otherwise, explicitly state that no exports (besides the default alias) changed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.changeset/clever-dryers-drum.md(1 hunks)package.json(1 hunks)packages/arkenv/src/index.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Use built-in validators (host, port, url, email, etc.) when available in environment schemas
Provide default values for optional environment variables in schemas
Files:
packages/arkenv/src/index.ts
🧠 Learnings (1)
📓 Common learnings
Learnt from: yamcodes
PR: yamcodes/arkenv#136
File: .changeset/vast-bananas-win.md:2-3
Timestamp: 2025-09-10T19:35:18.144Z
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.
🧬 Code graph analysis (2)
.changeset/clever-dryers-drum.md (2)
packages/arkenv/src/index.test.ts (6)
arkenv(66-69)process(41-51)expect(27-30)beforeEach(15-98)process(81-97)process(53-63)packages/arkenv/src/create-env.ts (1)
createEnv(24-34)
packages/arkenv/src/index.ts (3)
packages/arkenv/src/create-env.ts (1)
createEnv(24-34)packages/arkenv/src/index.test.ts (8)
beforeEach(15-98)process(41-51)process(81-97)process(53-63)expect(27-30)expectTypeOf(32-39)arkenv(66-69)createEnv(74-77)packages/vite-plugin/src/index.test.ts (1)
__esModule(8-12)
🔇 Additional comments (3)
package.json (1)
1-40: Verify root version & release pipeline.
- Root package.json has "version": "0.0.1" (package.json:39) and a "release" script: "pnpm run build:packages && changeset publish".
- Workspace packages are independently versioned (packages/arkenv@0.6.0, packages/vite-plugin@0.0.9).
- Confirm Changesets config and CI publish only workspace packages and do not rely on the root version; if the root version is accidental, remove or set to a neutral placeholder.
packages/arkenv/src/index.ts (2)
3-8: LGTM on default export alias; keeps named export for BC.The aliasing pattern is clear and DX-friendly, while preserving createEnv as a named export.
1-9: Narrowed re-exports are safe for this repo — no internal consumers found.
Scanned packages/arkenv/src/index.ts and the repository for imports/uses of 'arkenv'; no code references symbols other than createEnv, type, or EnvSchema, and package.json exports point to ./dist/*.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## arkenv@0.7.0 ### Minor Changes - #### `EnvSchema` type now always uses ArkEnv scope _[`#149`](#149) [`02698db`](02698db) [@yamcodes](https://github.com/yamcodes)_ The `EnvSchema` type has been simplified and fixed to include the ArkEnv scope. Before: export type EnvSchema<def, $ = {}> = type.validate<def, $>; After: export type EnvSchema<def> = type.validate<def, (typeof $)["t"]>; // (Whereas $ is the ArkEnv scope) BREAKING CHANGE: We no longer allow specifying a custom scope in the `EnvSchema` type. - #### `createEnv` signature simplified _[`#149`](#149) [`02698db`](02698db) [@yamcodes](https://github.com/yamcodes)_ The `createEnv` function now has a simpler signature: - No longer uses multiple overloads. Return type now always uses the ArkEnv scope BREAKING CHANGE: You can no longer rely on `EnvSchema` to type `createEnv` with a custom scope. Only the ArkEnv scope is supported. ### Patch Changes - #### Fix default export autocomplete for better developer experience _[`#147`](#147) [`2ec4daa`](2ec4daa) [@yamcodes](https://github.com/yamcodes)_ The default export now properly aliases as `arkenv` instead of `createEnv`, providing better autocomplete when importing. For example, in VS Code (and other IDEs that support autocomplete), when writing the following code: ```ts // top of file const env = arke; ``` Your IDE will now show completion for `arkenv`, resulting in: ```ts // top of file import arkenv from "arkenv"; const env = arkenv(); ``` This change maintains full backward compatibility - all existing imports continue to work unchanged (like `import { createEnv } from "arkenv";`). - #### Replace Chalk dependency with Node.js built-in `util.styleText` _[`e6eca4f`](e6eca4f) [@yamcodes](https://github.com/yamcodes)_ Remove the external `chalk` dependency and replace it with Node.js built-in `util.styleText`, available [from Node.js v20.12.0](https://nodejs.org/api/util.html#utilstyletextformat-text-options). This makes ArkEnv zero-dependency. ## @arkenv/vite-plugin@0.0.10 ### Patch Changes - #### Fix types _[`#149`](#149) [`02698db`](02698db) [@yamcodes](https://github.com/yamcodes)_ Fix types in the vite plugin to correctly include all ArkType keywords as well as custom ArkEnv keywords like `string.host` and `number.port`. - #### Fix default export autocomplete for better developer experience _[`#149`](#149) [`02698db`](02698db) [@yamcodes](https://github.com/yamcodes)_ The default export now properly aliases as `arkenv` instead of being anonymous, providing better autocomplete when importing. For example, in VS Code (and other IDEs that support autocomplete), when writing the following code: ```ts import { defineConfig } from "vite"; // https://vite.dev/config/ export default defineConfig({ plugins: [ arke, // Your cursor is here ], }); ``` Your IDE will now show completion for `arkenv`, resulting in: ```ts import arkenv from "@arkenv/vite-plugin"; import { defineConfig } from "vite"; // https://vite.dev/config/ export default defineConfig({ plugins: [ arkenv(), // Your cursor is here ], }); ``` This change maintains full backward compatibility - all existing imports continue to work unchanged. <details><summary>Updated 1 dependency</summary> <small> [`2ec4daa`](2ec4daa) [`02698db`](02698db) [`02698db`](02698db) [`e6eca4f`](e6eca4f) </small> - `arkenv@0.7.0` </details> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
Documentation
Chores