Skip to content

Commit 24cc32a

Browse files
committed
Updated agents file
1 parent 2db8b38 commit 24cc32a

File tree

1 file changed

+7
-37
lines changed

1 file changed

+7
-37
lines changed

AGENTS.md

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**AI Agent Documentation for sveltekit-superforms**
44

5-
This document provides essential information for AI agents (like GitHub Copilot, Claude, ChatGPT, etc.) working with the sveltekit-superforms codebase. Last updated: October 17, 2025.
5+
This document provides essential information for AI agents (like GitHub Copilot, Claude, ChatGPT, etc.) working with the sveltekit-superforms codebase. Last updated: October 18, 2025.
66

77
---
88

@@ -29,7 +29,7 @@ The library uses a **validation adapter pattern** to support multiple validation
2929

3030
**Supported Libraries:**
3131

32-
- Zod (v3 via `zod.ts`, v4 via `zod4.ts`) ⚠️ Zod v4 has known open issues
32+
- Zod (v3 via `zod.ts`, v4 via `zod4.ts`)
3333
- Valibot, Yup, Joi, ArkType, Effect, TypeBox, Superstruct, VineJS
3434
- class-validator, schemasafe, simple-schema
3535
- JSON Schema (direct)
@@ -145,7 +145,7 @@ src/
145145
├── lib/
146146
│ ├── adapters/ # Validation library adapters
147147
│ │ ├── zod.ts # Zod v3 adapter
148-
│ │ ├── zod4.ts # Zod v4 adapter ⚠️
148+
│ │ ├── zod4.ts # Zod v4 adapter
149149
│ │ ├── valibot.ts, yup.ts, joi.ts, etc.
150150
│ │ └── adapters.ts # Core adapter types
151151
│ ├── client/ # Client-side code (browser)
@@ -190,21 +190,6 @@ src/
190190
191191
## Known Issues & Important Notes
192192
193-
### ⚠️ Zod v4 Open Issues (as of Oct 2025)
194-
195-
There are **5 open GitHub issues** specifically related to Zod v4 adapter:
196-
197-
1. **#629** - Date field validation fails with `dateProxy` ("expected date, received string")
198-
- Impact: datetime-local inputs don't work with zod4 + dateProxy
199-
2. **#639** - Error messages are always "Invalid Input" in dev mode
200-
- Impact: Generic errors instead of localized messages (works in production)
201-
3. **#594** - Schema shape creation fails for some zod/v4 schemas
202-
- Impact: "No shape could be created for schema" error with certain schema types
203-
4. **#618** - Invalid URL returns non-descriptive "Invalid input"
204-
- Impact: URL validation error messages are generic with zod4
205-
5. **#633** - Boolean defaults incorrectly when validating URL
206-
- Impact: Boolean schema with `default(true)` becomes `false` for URL validation
207-
208193
**Adapter-specific notes:**
209194
210195
- Zod v4 adapter has special JSON Schema handling for `date` (→ integer/unix-time) and `bigint` (→ string) in `src/lib/adapters/zod4.ts`
@@ -216,11 +201,9 @@ There are **5 open GitHub issues** specifically related to Zod v4 adapter:
216201
217202
2. **Circular Dependency Warning** (#350): Using `@sveltejs/adapter-node` produces circular dependency warnings during build (doesn't break functionality).
218203
219-
3. **SuperDebug Import**: Import from `'sveltekit-superforms'` (Svelte 5) or `'sveltekit-superforms/client/SuperDebug.svelte'` (Svelte 4).
220-
221-
4. **Multiple Forms**: When using multiple forms on same page with different schemas, no ID required. With same schema, set unique `id` in options.
204+
3. **Multiple Forms**: When using multiple forms on same page with different schemas, no ID required. With same schema, set unique `id` in options.
222205
223-
5. **Nested Data**: Requires `dataType: 'json'` option and `use:enhance`. Without JS, only flat structures work (HTML FormData limitation).
206+
4. **Nested Data**: Requires `dataType: 'json'` option and `use:enhance`. Without JS, only flat structures work (HTML FormData limitation).
224207
225208
---
226209
@@ -475,28 +458,15 @@ pnpm run check:adapters # Verify adapter types exist
475458
476459
See `CHANGELOG.md` for full history.
477460
478-
**Recent Zod v4 related changes:**
479-
480-
- Zod 4 adapter added with `zod4` and `zod4Client` exports
481-
- Fixed date JSON Schema format for Zod 4 (was incorrect)
482-
- Fixed bigint handling for Zod 4 and Valibot
483-
- Zod 4 adapter now handles top-level discriminated unions
484-
- Note: "Check migrations carefully and please report any bugs" (from changelog)
485-
486-
**Dependencies:**
487-
488-
- Peer dependency: `zod ^3.25.0 || ^4.0.0` (supports both)
489-
- Optional dev dependency: `zod ^4.1.11`
490-
491461
---
492462
493463
## Final Notes
494464
495-
This is a mature, widely-used library (v2.27.4) with comprehensive documentation. The codebase is well-structured but complex, especially `superForm.ts`. When making changes:
465+
This is a mature, widely-used library with comprehensive documentation. The codebase is well-structured but complex, especially `superForm.ts`. When making changes:
496466
497467
- **Always run tests** (`pnpm test`)
498468
- **Check for TypeScript errors** (`pnpm run check`)
499-
- **Consider backward compatibility** (many users depend on this)
469+
- **Consider backward compatibility** many users depend on this, but adapters should in general only support the latest version of its validation library.
500470
- **Document breaking changes** clearly
501471
- **Test across validation libraries** if modifying adapter system
502472

0 commit comments

Comments
 (0)