Fix editor autocomplete for arkenv / createEnv function#531
Conversation
🦋 Changeset detectedLatest commit: 7df6f3a The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 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.
|
WalkthroughThis PR introduces a convenience type alias Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
💤 Files with no reviewable changes (2)
🧰 Additional context used📓 Path-based instructions (5)**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)
Files:
**/*.{ts,tsx,json,md}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/index.ts📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)
Files:
packages/arkenv/**/*.ts📄 CodeRabbit inference engine (.cursor/rules/arktype.mdc)
Files:
packages/arkenv/src/**/*.ts📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🧠 Learnings (16)📓 Common learnings📚 Learning: 2025-11-24T16:03:45.295ZApplied to files:
📚 Learning: 2025-11-24T16:03:45.295ZApplied to files:
📚 Learning: 2025-11-24T16:03:45.295ZApplied to files:
📚 Learning: 2025-11-24T16:03:45.295ZApplied to files:
📚 Learning: 2025-11-24T16:03:45.295ZApplied to files:
📚 Learning: 2025-11-24T16:03:45.295ZApplied to files:
📚 Learning: 2025-11-24T16:03:45.295ZApplied to files:
📚 Learning: 2025-11-29T22:11:39.931ZApplied to files:
📚 Learning: 2025-11-24T16:03:45.295ZApplied to files:
📚 Learning: 2025-11-24T16:03:45.295ZApplied to files:
📚 Learning: 2025-11-29T22:11:39.931ZApplied to files:
📚 Learning: 2025-11-29T22:11:39.931ZApplied to files:
📚 Learning: 2025-09-10T19:35:18.179ZApplied to files:
📚 Learning: 2025-11-29T22:11:39.931ZApplied to files:
📚 Learning: 2025-11-24T16:04:00.957ZApplied to files:
🧬 Code graph analysis (3)packages/internal/types/src/schema.ts (1)
.changeset/dirty-ants-buy.md (2)
packages/internal/scope/src/index.ts (1)
⏰ 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)
🔇 Additional comments (6)
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 |
📦 Bundle Size Report
✅ All size limits passed! |
…thout-type-helper-075-077
…thout-type-helper-075-077
… build configuration.
commit: |
…thout-type-helper-075-077
…e for `Record<string, unknown>`.
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.8 ### Patch Changes - #### Fix editor autocomplete for `createEnv` (`arkenv`) function _[`#531`](#531) [`e91a804`](e91a804) [@yamcodes](https://github.com/yamcodes)_ Fix a signature issue where editor autocomplete was not working for the `createEnv` function. ## @arkenv/bun-plugin@0.0.3 ### Patch Changes <details><summary>Updated 1 dependency</summary> <small> [`e91a804`](e91a804) </small> - `arkenv@0.7.8` </details> ## @arkenv/vite-plugin@0.0.20 ### Patch Changes <details><summary>Updated 1 dependency</summary> <small> [`e91a804`](e91a804) </small> - `arkenv@0.7.8` </details> ## @repo/scope@0.0.1 ### Patch Changes - #### Export $ type _[`#531`](#531) [`e91a804`](e91a804) [@yamcodes](https://github.com/yamcodes)_ Export `type $ = (typeof $)["t"]` for convenience. This type is reused a lot in the other packages. ## @repo/types@0.0.2 ### Patch Changes <details><summary>Updated 1 dependency</summary> <small> [`e91a804`](e91a804) </small> - `@repo/scope@0.0.1` </details> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Summary
- Reorder `createEnv` overloads so the inline `EnvSchema<T>` overload is
evaluated first, restoring ArkType DSL string autocomplete
- Narrow the `config` parameter on ArkType-specific overloads to `{
validator?: "arktype" }` so they don't greedily match `{ validator:
"standard" }` calls — preserving correct return type inference for
standard mode (#758)
Closes #790
## Context
This is the same autocomplete regression originally reported in #522 and
fixed in #531 (v0.7.8). It regressed when #758 moved the
`StandardSchemaV1` overload to first position to fix standard mode
return types. The root cause was that overload ordering was the *only*
mechanism disambiguating the two modes — this fix makes the overloads
mutually exclusive via their config types, so ordering is no longer a
correctness concern.
## Test plan
- [x] All 227 arkenv tests pass (including standard mode type inference
tests with `expectTypeOf`)
- [x] Full monorepo test suite passes (6/6 projects)
- [x] Manually verified inline schema autocomplete works in editor
- [x] Manually verified standard mode return type inference works in
editor
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **Bug Fixes**
* Fixed inline schema autocompletion functionality for ArkType DSL
strings when using arkenv() with inline schema objects.
* **Refactor**
* Improved createEnv function by narrowing overloads based on validator
configuration type. Overloads are now mutually exclusive and
order-independent.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Closes #522
Summary by CodeRabbit
Bug Fixes
New Features
Build
✏️ Tip: You can customize this high-level summary in your review settings.