Skip to content

Bump arktype to v2.1.28#498

Merged
yamcodes merged 4 commits into
mainfrom
fix-type-instantiation-is-deep
Dec 5, 2025
Merged

Bump arktype to v2.1.28#498
yamcodes merged 4 commits into
mainfrom
fix-type-instantiation-is-deep

Conversation

@yamcodes

@yamcodes yamcodes commented Dec 5, 2025

Copy link
Copy Markdown
Owner

Fix "type instantiation is excessively deep" issue with ArkType 2.1.28 and close #497

Summary by CodeRabbit

  • New Features

    • Added a new environment variable (ZED_ENV) to support development configuration.
  • Chores

    • Added schema validation tooling to support the new env configuration.
    • Updated an internal dependency to a newer patch version.

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

renovate Bot and others added 2 commits December 5, 2025 18:59
@changeset-bot

changeset-bot Bot commented Dec 5, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8decc65

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

@vercel

vercel Bot commented Dec 5, 2025

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
arkenv Skipped Skipped Dec 5, 2025 8:36pm

@github-actions github-actions Bot added the @arkenv/vite-plugin Issues or Pull Requests involving the Vite plugin for ArkEnv label Dec 5, 2025
@coderabbitai

coderabbitai Bot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Updates arktype to 2.1.28, adds zod and a new ZED_ENV sample variable to the node playground, refactors the playground env to an inline arkenv/zod schema, and applies a TypeScript cast in the Vite plugin to bypass a deep-instantiation typing issue.

Changes

Cohort / File(s) Summary
Workspace & deps
pnpm-workspace.yaml, apps/playgrounds/node/package.json
Bumped arktype catalog entry to 2.1.28; added dependency zod@^4.1.13 to the playground package.
Playground env
apps/playgrounds/node/.env.example, apps/playgrounds/node/index.ts
Added ZED_ENV=development to .env example; replaced separate Env type with an inline arkenv config using zod, exposed env.ZED_ENV, and logged it at runtime.
Vite plugin typing
packages/vite-plugin/src/index.ts
Adjusted call to createEnv by casting plugin options (now options as never) to avoid deep TypeScript instantiation errors introduced by arktype 2.1.28; no runtime behavior change.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review packages/vite-plugin/src/index.ts cast to ensure it’s a safe interim workaround and add a TODO if needed.
  • Verify apps/playgrounds/node/index.ts refactor preserves prior validation/behavior and that zod usage matches project conventions.
  • Confirm dependency bump in pnpm-workspace.yaml has no unintended ripple effects.

Possibly related PRs

Suggested labels

arkenv, example

Poem

🐰 A little hop, a tiny tweak,
ZED_ENV peeks from the playground creek.
Types nudged gently, cast to never,
I nibble carrots, code runs clever.
Hooray — small changes, big bunny cheer!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes additional changes to apps/playgrounds/node files (adding ZED_ENV variable and zod dependency) that appear unrelated to the arktype bump or the type instantiation issue #497. Remove or isolate changes to .env.example, index.ts, and package.json in apps/playgrounds/node as they are out of scope for the arktype bump fix; consider separating into a distinct PR.
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 reflects the primary change in the PR—bumping arktype to v2.1.28—which is the core modification across the package files.
Linked Issues check ✅ Passed The PR addresses issue #497 by implementing a type assertion workaround (casting to 'never') in vite-plugin/src/index.ts to resolve the 'type instantiation is excessively deep' failure while completing the arktype version bump.
✨ 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 fix-type-instantiation-is-deep

📜 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 3a80c0d and 8decc65.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • packages/vite-plugin/src/index.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/vite-plugin/src/index.ts
⏰ 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)

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.

@pkg-pr-new

pkg-pr-new Bot commented Dec 5, 2025

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 8decc65

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/vite-plugin/src/index.ts (1)

64-64: Acknowledge the temporary type-safety workaround.

The as any cast resolves the "type instantiation is excessively deep" error introduced by ArkType 2.1.28, as documented in PR objectives. While this is an acceptable interim solution, it sacrifices type safety.

Consider opening a tracking issue to improve the EnvSchema typing (e.g., using Standard Schema directly) as the preferred long-term solution mentioned in the PR objectives. Would you like me to help create this issue?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 030bb0a and 3a80c0d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • apps/playgrounds/node/.env.example (1 hunks)
  • apps/playgrounds/node/index.ts (1 hunks)
  • apps/playgrounds/node/package.json (1 hunks)
  • packages/vite-plugin/src/index.ts (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/package.json

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

Use workspace:* protocol for workspace dependencies between packages

Files:

  • apps/playgrounds/node/package.json
{packages,apps,tooling}/**/package.json

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

When referencing workspace packages in dependencies, use the workspace:* protocol instead of version numbers

Files:

  • apps/playgrounds/node/package.json
**/*.{ts,tsx,json,md}

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

Use Biome for linting and formatting instead of ESLint and Prettier

Files:

  • apps/playgrounds/node/package.json
  • packages/vite-plugin/src/index.ts
  • apps/playgrounds/node/index.ts
{package.json,pnpm-lock.yaml,pnpm-workspace.yaml}

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

Always use pnpm for all package management operations in this monorepo (never use npm or yarn commands), except for standalone example projects in the examples/ folder

Files:

  • pnpm-workspace.yaml
pnpm-workspace.yaml

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

Use pnpm for package management with workspace support

Files:

  • pnpm-workspace.yaml
**/*.{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/vite-plugin/src/index.ts
  • apps/playgrounds/node/index.ts
**/index.ts

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

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

Files:

  • packages/vite-plugin/src/index.ts
  • apps/playgrounds/node/index.ts
🧠 Learnings (23)
📓 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 : 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/**/*.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 : 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/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Use `ArkEnvError` for environment variable validation errors
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.920Z
Learning: Applies to **/*.{ts,tsx} : Use `ArkEnvError` for environment variable errors, not generic errors
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.920Z
Learning: Applies to **/*.{ts,tsx} : Environment schema definitions should use built-in validators, ArkType string literals, and support default values in the schema pattern
📚 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:

  • apps/playgrounds/node/package.json
  • packages/vite-plugin/src/index.ts
  • apps/playgrounds/node/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 : Use ArkType's `type()` function to define schemas in environment variable definitions

Applied to files:

  • apps/playgrounds/node/package.json
  • apps/playgrounds/node/index.ts
📚 Learning: 2025-11-24T16:04:11.901Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/monorepo.mdc:0-0
Timestamp: 2025-11-24T16:04:11.901Z
Learning: packages/arkenv should not depend on other workspace packages; packages/vite-plugin depends on arkenv; apps/www may depend on workspace packages

Applied to files:

  • apps/playgrounds/node/package.json
  • pnpm-workspace.yaml
📚 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:

  • apps/playgrounds/node/package.json
  • packages/vite-plugin/src/index.ts
  • apps/playgrounds/node/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:

  • apps/playgrounds/node/package.json
  • pnpm-workspace.yaml
  • apps/playgrounds/node/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: ArkType validates environment variables at runtime and TypeScript types are inferred from the schema definition

Applied to files:

  • apps/playgrounds/node/package.json
  • packages/vite-plugin/src/index.ts
  • apps/playgrounds/node/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 : Use union types for enums in ArkType schemas (e.g., `"'dev' | 'prod'"`) instead of separate enum definitions

Applied to files:

  • apps/playgrounds/node/package.json
  • apps/playgrounds/node/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 : Use the scoped `$` type system for custom types defined in `scope.ts`

Applied to files:

  • apps/playgrounds/node/package.json
📚 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:

  • apps/playgrounds/node/package.json
📚 Learning: 2025-11-29T22:11:39.920Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.920Z
Learning: Applies to pnpm-workspace.yaml : Use pnpm for package management with workspace support

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-11-29T08:00:08.031Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/pnpm.mdc:0-0
Timestamp: 2025-11-29T08:00:08.031Z
Learning: Applies to package.json : The project uses `pnpm10.20.0` as specified in the `packageManager` field

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-11-29T22:11:39.920Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.920Z
Learning: Always run `pnpm changeset` for version bumps in published packages - never skip changesets

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-11-24T16:04:36.939Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/test-patterns.mdc:0-0
Timestamp: 2025-11-24T16:04:36.939Z
Learning: Applies to packages/vite-plugin/src/**/*.test.ts : Test Vite plugin using the `with-vite-react-ts` example as a fixture and validate plugin works with real Vite projects

Applied to files:

  • pnpm-workspace.yaml
  • packages/vite-plugin/src/index.ts
📚 Learning: 2025-11-29T22:11:39.920Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.920Z
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/vite-plugin/src/index.ts
  • apps/playgrounds/node/index.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 camelCase for function names (e.g., `createEnv`)

Applied to files:

  • packages/vite-plugin/src/index.ts
📚 Learning: 2025-11-24T16:04:36.939Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/test-patterns.mdc:0-0
Timestamp: 2025-11-24T16:04:36.939Z
Learning: Achieve coverage goals: environment variable parsing and validation, type checking and error handling, default value handling, custom type validation, plugin integration with Vite, and real project build testing using examples as fixtures

Applied to files:

  • packages/vite-plugin/src/index.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 TypeScript 5.1+ features when appropriate

Applied to files:

  • packages/vite-plugin/src/index.ts
📚 Learning: 2025-11-29T22:11:39.920Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.920Z
Learning: Never modify `.env` files in examples or apps - these may contain sensitive configuration

Applied to files:

  • apps/playgrounds/node/.env.example
📚 Learning: 2025-11-29T22:11:39.920Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.920Z
Learning: Applies to **/*.{ts,tsx} : Use `ArkEnvError` for environment variable errors, not generic errors

Applied to files:

  • apps/playgrounds/node/index.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:

  • apps/playgrounds/node/index.ts
📚 Learning: 2025-11-29T22:11:39.920Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.920Z
Learning: Applies to **/*.{ts,tsx} : Use logical grouping for related environment variables in schemas

Applied to files:

  • apps/playgrounds/node/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 : Convert ArkType validation errors to `ArkEnvError` for user-friendly error messages that include variable name and expected type

Applied to files:

  • apps/playgrounds/node/index.ts
🧬 Code graph analysis (1)
apps/playgrounds/node/index.ts (8)
examples/with-bun-react/src/env.ts (1)
  • env (9-9)
packages/vite-plugin/src/index.ts (1)
  • arkenv (50-86)
packages/arkenv/src/type.ts (1)
  • type (3-3)
packages/arkenv/src/types.ts (2)
  • host (19-19)
  • port (6-14)
packages/arkenv/src/index.test.ts (2)
  • arkenv (50-53)
  • vi (65-81)
packages/arkenv/src/create-env.ts (1)
  • createEnv (34-52)
packages/bun-plugin/src/index.ts (1)
  • arkenv (126-137)
packages/arkenv/src/type.test.ts (2)
  • envType (86-108)
  • envType (5-9)
⏰ 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). (5)
  • GitHub Check: test-e2e (e2e)
  • GitHub Check: test-e2e (a11y)
  • GitHub Check: test-build (latest)
  • GitHub Check: test-build (lts/*)
  • GitHub Check: test-typesafety
🔇 Additional comments (4)
pnpm-workspace.yaml (1)

21-21: LGTM!

The ArkType version bump to 2.1.28 is the trigger for the type instantiation issue, which is addressed by the workaround in the vite-plugin.

apps/playgrounds/node/.env.example (1)

5-5: LGTM!

The new ZED_ENV environment variable is properly documented in the example file.

apps/playgrounds/node/index.ts (1)

4-11: Consider the rationale for mixing validation libraries.

If Standard Schema support is planned, this would be a valid test case. However, without corresponding arkenv implementation changes, this appears to be an error. Please clarify the intention behind mixing Zod and ArkType validation.

apps/playgrounds/node/package.json (1)

14-14: Zod version 4.1.13 is a valid release (published November 24, 2025) and is appropriate for this dependency.

Comment thread apps/playgrounds/node/index.ts
@yamcodes yamcodes changed the title Fix "type instantiation is excessively deep" issue with ArkType 2.1.28 Bump arktype to v2.1.28 Dec 5, 2025
@yamcodes yamcodes mentioned this pull request Dec 5, 2025
@yamcodes
yamcodes merged commit 7fb64a1 into main Dec 5, 2025
18 of 19 checks passed
@yamcodes
yamcodes deleted the fix-type-instantiation-is-deep branch December 5, 2025 20:39
yamcodes added a commit that referenced this pull request Dec 8, 2025
ArkEnv has supported Standard Schema validators (Zod, Valibot, etc.)
since v2.1.28, but this capability was not documented. Users can now mix
validators from different libraries in a single schema.

## Changes

**READMEs**
- Added "Compatible with any Standard Schema validator" to features list

**Documentation (`/docs/standard-schema`)**
- What Standard Schema is and why it matters (interoperability, zero
runtime overhead)
- Usage examples with Zod and Valibot
- Practical use cases: complex transformations, incremental migration,
team preferences
- Error handling and TypeScript inference

**Example (`examples/with-standard-schema/`)**
- Working project demonstrating ArkType + Zod integration
- Shows mixing validators based on complexity needs

**Navigation**
- Added page to docs menu under API section
- Referenced from quickstart guide

## Example Usage

```ts
import arkenv from 'arkenv';
import { z } from 'zod';

const env = arkenv({
  // ArkType for concise syntax
  HOST: "string.host",
  NODE_ENV: "'development' | 'production' | 'test'",
  
  // Zod for complex transformations
  DATABASE_URL: z.string().url(),
  ALLOWED_ORIGINS: z.string()
    .transform(str => str.split(','))
    .pipe(z.array(z.string().url())),
});
```

> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### 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)
> - Triggering command: `/usr/local/bin/node node
./node_modules/.bin/../next/dist/bin/next build git conf�� get --local
node_modules/.pnpm/@esbuild&#43;linux-x64@0.27.1/node_modules/@esbuild/linux-x64/bin/esbuild
user.email` (dns block)
> - Triggering command: `/usr/local/bin/node node
./node_modules/.bin/../next/dist/bin/next build bash --no�� --noprofile`
(dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/yamcodes/arkenv/settings/copilot/coding_agent)
(admins only)
>
> </details>

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Document support for any Standard Schema
validator</issue_title>
> <issue_description>Since #498 (`arkenv@>=2.1.28`)
supports the usage of _any_ Standard Schema validator, we should
properly document that as an ArkEnv feature in the advertised features
list, ideally along with examples/use cases/a dedicated section, and
anything else that comes to mind for proper documentation
here.</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes #500

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: yamcodes <2014360+yamcodes@users.noreply.github.com>
Co-authored-by: Yam C Borodetsky <yam@yam.codes>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Type instantiation is excessively deep" with ArkType 2.1.28

1 participant