Skip to content

Fix editor autocomplete for arkenv / createEnv function#531

Merged
yamcodes merged 10 commits into
mainfrom
522-schema-autocompletion-no-longer-works-without-type-helper-075-077
Dec 12, 2025
Merged

Fix editor autocomplete for arkenv / createEnv function#531
yamcodes merged 10 commits into
mainfrom
522-schema-autocompletion-no-longer-works-without-type-helper-075-077

Conversation

@yamcodes

@yamcodes yamcodes commented Dec 12, 2025

Copy link
Copy Markdown
Owner

Closes #522

Summary by CodeRabbit

  • Bug Fixes

    • Fixed editor autocomplete support for the environment creation function.
  • New Features

    • Exported a new type alias for improved convenience and reusability across packages.
  • Build

    • Removed explicit sourcemap generation settings from build configurations in example projects.

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

@changeset-bot

changeset-bot Bot commented Dec 12, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7df6f3a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@repo/scope Patch
arkenv Patch
@repo/types Patch
@arkenv/bun-plugin Patch
@arkenv/vite-plugin Patch

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

@vercel

vercel Bot commented Dec 12, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
arkenv Ready Ready Preview Comment Dec 12, 2025 9:23am

@coderabbitai

coderabbitai Bot commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This PR introduces a convenience type alias $ representing the ArkType inference token, updates createEnv and related type signatures to use the shorter $ instead of (typeof $)["t"], and removes explicit sourcemap options from build configurations. These changes restore editor autocompletion for schema definitions without requiring a manual type helper.

Changes

Cohort / File(s) Summary
Changelog entries
.changeset/brown-dolls-poke.md, .changeset/dirty-ants-buy.md
Documents new patch release: exports $ type alias for convenience and fixes editor autocomplete for createEnv function
Build configuration
apps/playgrounds/bun-react/bin/build.ts, examples/with-bun-react/bin/build.ts
Removes explicit sourcemap: true option from Bun.build calls, relying on default behavior
Type inference token export
packages/internal/scope/src/index.ts
Exports new public type alias $ as (typeof $)["t"] for convenience across packages
Schema type definitions
packages/internal/types/src/schema.ts
Updates EnvSchemaWithType to use $ instead of (typeof $)["t"] for ArkType's Type second parameter
Public API signatures
packages/arkenv/src/create-env.ts
Updates EnvSchema and createEnv overloads to use $ token for type inference; adjusts env parameter to default to process.env

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Specific areas requiring attention:
    • Type inference token consistency: verify all usages of (typeof $)["t"] have been replaced with $ across the public API surface
    • packages/arkenv/src/create-env.ts overload signatures: confirm the three overloads correctly reflect the new $ token and maintain backward compatibility
    • Generic constraint changes in packages/internal/types/src/schema.ts: ensure the EnvSchemaWithType signature change does not break existing type inference
    • Build configuration removals: confirm that removing sourcemap: true does not affect intended debugging/development workflows

Possibly related PRs

  • PR #139: Both PRs export and re-expose the $ symbol from internal scope as a public type utility, establishing the foundation for the inference token.
  • PR #419: Related type-system changes to packages/arkenv/src/create-env.ts and shared type utilities that work in tandem with this refactor.
  • PR #382: Earlier modifications to the same createEnv signatures and ArkType-related generics that this PR refines further.

Poem

🐰 Behold! The $ token hops forth with grace,
No more (typeof $)["t"] cluttering the place,
Autocompletion blooms in editors bright,
Type inference simplified, schemas typed just right!
~ The Type-Aware Rabbit 🌟

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning All changes are directly related to fixing the autocompletion regression: exporting the $ type alias, updating type parameters across relevant packages, and removing unrelated sourcemap options from build files. Remove sourcemap configuration changes from apps/playgrounds/bun-react/bin/build.ts and examples/with-bun-react/bin/build.ts as these are unrelated to the autocompletion fix objective.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 accurately describes the main change: fixing editor autocomplete for the createEnv function, which aligns with the primary objective of resolving the regression documented in issue #522.
Linked Issues check ✅ Passed The PR successfully restores editor autocompletion by exporting the $ type alias and updating type parameters from (typeof $)["t"] to $, directly addressing the regression in issue #522.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 522-schema-autocompletion-no-longer-works-without-type-helper-075-077

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7fce47f and 7df6f3a.

⛔ Files ignored due to path filters (1)
  • examples/basic/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • .changeset/brown-dolls-poke.md (1 hunks)
  • .changeset/dirty-ants-buy.md (1 hunks)
  • apps/playgrounds/bun-react/bin/build.ts (0 hunks)
  • examples/with-bun-react/bin/build.ts (0 hunks)
  • packages/arkenv/src/create-env.ts (2 hunks)
  • packages/internal/scope/src/index.ts (1 hunks)
  • packages/internal/types/src/schema.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • apps/playgrounds/bun-react/bin/build.ts
  • examples/with-bun-react/bin/build.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

**/*.{ts,tsx}: Prefer type over interface for type definitions in TypeScript
Use TypeScript 5.1+ features when appropriate
Leverage const type parameters for better inference in TypeScript
Use JSDoc comments for public APIs
Use tabs for indentation (configured in Biome)
Use double quotes for strings (configured in Biome)
Organize imports automatically (Biome handles this)
Avoid explicit types when TypeScript can infer them (noInferrableTypes error)
Use as const where appropriate for immutable values (useAsConstAssertion error)
Don't reassign function parameters (noParameterAssign error)
Place default parameters last in function signatures (useDefaultParameterLast error)
Always initialize enum values (useEnumInitializers error)
Declare one variable per statement (useSingleVarDeclarator error)
Avoid unnecessary template literals (noUnusedTemplateLiteral error)
Prefer Number.parseInt over global parseInt (useNumberNamespace error)
Use kebab-case for TypeScript filenames (e.g., create-env.ts)
Use camelCase for function names (e.g., createEnv)
Use PascalCase for type names (e.g., ArkEnvError)
Use UPPER_SNAKE_CASE for environment variables and constants
Include examples in JSDoc comments when helpful for public APIs
Document complex type logic with JSDoc comments
Use ArkEnvError for environment variable validation errors
Provide clear, actionable error messages that include the variable name and expected type

**/*.{ts,tsx}: Use createEnv(schema) as the main function for validated environment objects, available as the default export
Use built-in validators (host, port, url, email) from src/types.ts when available instead of custom validation
Use ArkEnvError for environment variable errors, not generic errors
Environment schema definitions should use built-in validators, ArkType string literals, and support default values in the schema pattern
Use logical grouping for related environment variables in schemas
Use descriptive env...

Files:

  • packages/internal/types/src/schema.ts
  • packages/internal/scope/src/index.ts
  • packages/arkenv/src/create-env.ts
**/*.{ts,tsx,json,md}

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

Use Biome for linting and formatting instead of ESLint and Prettier

Files:

  • packages/internal/types/src/schema.ts
  • packages/internal/scope/src/index.ts
  • packages/arkenv/src/create-env.ts
**/index.ts

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

Use barrel exports (index.ts) for package entry points

Files:

  • packages/internal/scope/src/index.ts
packages/arkenv/**/*.ts

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

packages/arkenv/**/*.ts: Use ArkType's type() function to define schemas in environment variable definitions
Leverage ArkType's type inference for TypeScript types instead of manual type definitions
Use the scoped $ type system for custom types defined in scope.ts
Keep environment variable schemas readable and TypeScript-like using ArkType syntax
Use union types for enums in ArkType schemas (e.g., "'dev' | 'prod'") instead of separate enum definitions
Leverage ArkType's built-in types (e.g., string.host, number.port) where possible in environment schemas
Convert ArkType validation errors to ArkEnvError for user-friendly error messages that include variable name and expected type

Files:

  • packages/arkenv/src/create-env.ts
packages/arkenv/src/**/*.ts

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

Main library implementation should be in src/create-env.ts, built-in validators in src/types.ts, error handling in src/errors.ts, and utilities in src/utils.ts

Files:

  • packages/arkenv/src/create-env.ts
🧠 Learnings (16)
📓 Common learnings
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/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: Applies to packages/arkenv/**/*.ts : Use the scoped `$` type system for custom types defined in `scope.ts`
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
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/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/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
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 : Convert ArkType validation errors to `ArkEnvError` for user-friendly error messages that include variable name and expected type
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/scope.ts : Define custom types in `scope.ts` using ArkType's scoped type system for reusability across 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 PascalCase for type names (e.g., `ArkEnvError`)
📚 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:

  • packages/internal/types/src/schema.ts
  • .changeset/brown-dolls-poke.md
  • .changeset/dirty-ants-buy.md
  • packages/arkenv/src/create-env.ts
📚 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:

  • packages/internal/types/src/schema.ts
  • .changeset/brown-dolls-poke.md
  • .changeset/dirty-ants-buy.md
  • packages/arkenv/src/create-env.ts
📚 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:

  • packages/internal/types/src/schema.ts
  • .changeset/dirty-ants-buy.md
  • packages/arkenv/src/create-env.ts
📚 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:

  • packages/internal/types/src/schema.ts
  • packages/arkenv/src/create-env.ts
📚 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:

  • packages/internal/types/src/schema.ts
  • packages/arkenv/src/create-env.ts
📚 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/scope.ts : Define custom types in `scope.ts` using ArkType's scoped type system for reusability across schemas

Applied to files:

  • packages/internal/types/src/schema.ts
  • .changeset/brown-dolls-poke.md
  • packages/internal/scope/src/index.ts
📚 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:

  • packages/internal/types/src/schema.ts
  • packages/arkenv/src/create-env.ts
📚 Learning: 2025-11-29T22:11:39.931Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.931Z
Learning: Applies to **/*.{ts,tsx} : Environment schema definitions should use built-in validators, ArkType string literals, and support default values in the schema pattern

Applied to files:

  • packages/internal/types/src/schema.ts
  • packages/arkenv/src/create-env.ts
📚 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 the scoped `$` type system for custom types defined in `scope.ts`

Applied to files:

  • packages/internal/types/src/schema.ts
  • .changeset/brown-dolls-poke.md
  • packages/internal/scope/src/index.ts
  • packages/arkenv/src/create-env.ts
📚 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:

  • packages/internal/types/src/schema.ts
  • .changeset/dirty-ants-buy.md
  • packages/arkenv/src/create-env.ts
📚 Learning: 2025-11-29T22:11:39.931Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.931Z
Learning: Applies to **/*.{ts,tsx} : Use `createEnv(schema)` as the main function for validated environment objects, available as the default export

Applied to files:

  • packages/internal/types/src/schema.ts
  • packages/arkenv/src/create-env.ts
📚 Learning: 2025-11-29T22:11:39.931Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.931Z
Learning: Applies to **/*.{ts,tsx} : Use logical grouping for related environment variables in schemas

Applied to files:

  • packages/internal/types/src/schema.ts
📚 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:

  • .changeset/dirty-ants-buy.md
📚 Learning: 2025-11-29T22:11:39.931Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.931Z
Learning: Applies to **/*.{ts,tsx} : Use `ArkEnvError` for environment variable errors, not generic errors

Applied to files:

  • .changeset/dirty-ants-buy.md
  • packages/arkenv/src/create-env.ts
📚 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:

  • .changeset/dirty-ants-buy.md
  • packages/arkenv/src/create-env.ts
🧬 Code graph analysis (3)
packages/internal/types/src/schema.ts (1)
packages/internal/scope/src/index.ts (2)
  • $ (9-19)
  • $ (21-21)
.changeset/dirty-ants-buy.md (2)
packages/vite-plugin/src/index.ts (1)
  • arkenv (50-87)
packages/arkenv/src/index.test.ts (1)
  • vi (65-81)
packages/internal/scope/src/index.ts (1)
packages/arkenv/src/scope.test.ts (1)
  • stringType (46-50)
⏰ 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 (6)
.changeset/dirty-ants-buy.md (1)

1-7: LGTM!

The changeset correctly documents the fix as a patch release, which is appropriate for a bug fix that restores previous autocomplete behavior.

packages/internal/scope/src/index.ts (1)

20-21: Clean type/value dual export pattern.

Exporting both const $ (value) and type $ (type alias) from the same module is idiomatic TypeScript that leverages separate namespaces. This simplifies imports for consumers who can now use $ in both value and type positions. As per coding guidelines, this aligns with using the scoped $ type system for custom types.

.changeset/brown-dolls-poke.md (1)

1-7: LGTM!

The changeset accurately documents the new type export with appropriate versioning.

packages/internal/types/src/schema.ts (1)

6-7: LGTM!

The simplified type parameter using the new $ alias improves readability while maintaining identical type semantics. The type-only import on line 1 is correct.

packages/arkenv/src/create-env.ts (2)

7-7: Core fix for autocomplete regression.

Using at.validate<def, $> with the explicit type alias instead of (typeof $)["t"] allows TypeScript's inference to work more directly, restoring editor autocomplete for schema definitions. This aligns with leveraging ArkType's type inference as per coding guidelines.


23-38: Consistent type signature updates across overloads.

All overload signatures and the implementation correctly use the $ type alias for ArkType inference. The structure maintains proper overload resolution order:

  1. Raw schema object → distill.Out<at.infer<T, $>>
  2. Pre-built type definition → InferType<T>
  3. Union overload for internal dispatch

The default parameter env: RuntimeEnvironment = process.env on line 37 appropriately provides the default environment source.


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 the example Issues or Pull Requests concerning at least one ArkEnv example. (Found in the `examples/` directory) label Dec 12, 2025
@arkenv-bot

arkenv-bot Bot commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Package Size Limit Diff Status
arkenv 728 B 2 kB 0.0%

All size limits passed!

@pkg-pr-new

pkg-pr-new Bot commented Dec 12, 2025

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 7df6f3a

@github-actions github-actions Bot added docs Adds or changes documentation, or acts as documentation in and of itself arkenv Changes to the `arkenv` npm package. labels Dec 12, 2025
@yamcodes
yamcodes marked this pull request as ready for review December 12, 2025 09:20
@yamcodes
yamcodes merged commit e91a804 into main Dec 12, 2025
20 checks passed
@yamcodes
yamcodes deleted the 522-schema-autocompletion-no-longer-works-without-type-helper-075-077 branch December 12, 2025 09:32
@arkenv-bot arkenv-bot Bot mentioned this pull request Dec 12, 2025
yamcodes pushed a commit that referenced this pull request Dec 12, 2025
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>
yamcodes added a commit that referenced this pull request Feb 10, 2026
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arkenv Changes to the `arkenv` npm package. docs Adds or changes documentation, or acts as documentation in and of itself 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.

Schema autocompletion no longer works without type helper (0.7.6 → 0.7.7)

1 participant