Commit 0ff51df
Upgrade to Zod 4 (#14956)
* feat: upgrade to Zod v4
Consolidate Zod v3 to v4 upgrade with comprehensive changes:
- Remove dual Zod version support, standardize on v4
- Simplify type systems and remove experimental.zod4 flag
- Update dependencies: js-yaml, magic-string, magicast to latest versions
- Replace kleur with piccolore for CLI colors
- Refactor content layer, actions, and config to use unified Zod handling
- Simplify JSON schema generation and type generation
- Remove z3/z4 branching logic throughout codebase
- Update error handling to work with unified Zod implementation
BREAKING CHANGE: Zod v3 support removed, project now requires Zod v4+
* Remove Zod v3 support, keep only v4
- Remove all z3 imports and replace with z4/zod
- Remove z3-specific functions (formDataToZ3Object, handleZ3FormDataGetAll/Get, unwrapBaseZ3ObjectSchema, createZ3Image)
- Remove dual-version type unions, simplify to z4-only types
- Remove z3ErrorMap function, keep only z4ErrorMap
- Remove checkZodSchemaCompatibility calls (no longer needed)
- Simplify vite-plugin-experimental-zod4/utils.ts to no-op
- Update package.json to require zod ^4.0.0
- Update test files and exports to reference z4 versions
* Finish upgrade
* skip these tests for now
* skip this one too
* correct mark the received item
* fix config-validate tests
* merge: resolve conflicts between zod4-m and next
* fix remaining build error
* remove references to zod4 thing
* fixes
* prevent the crash
* switch to the native zod to json schema
* oops
* fix content layer tests
* fix error map tests
* fix actions test
* fix intellisense tsts
* fix schema test
* fix: types
* Update Svelte to exactly 5.43.8 in package and fixtures
* fix svelte tests
* fix more e2e
* fix cloudflare tests
* fix defineMiddleware issue
* remove unused reference
* fix examples types
* pr comment stuff
* changeset
* remove experiemental flag
* add some debugging here
* remove debugging stuff
* Update packages/astro/src/actions/vite-plugin-actions.ts
Co-authored-by: Florian Lefebvre <[email protected]>
* fix
* fix: import
* use zod/v4 imports in core
* remove createDefineAction
* remove unnecessary type alias
* remove unused z4reference
* rename stuff
* unskip tests
* rename back to createImage
* nit
* revert markdown change
* put errorMap name back
* address feedback on rss
* fix: exports
* Update packages/astro-rss/src/index.ts
Co-authored-by: Florian Lefebvre <[email protected]>
* Update packages/astro-rss/src/schema.ts
Co-authored-by: Florian Lefebvre <[email protected]>
* Update packages/astro-rss/src/util.ts
Co-authored-by: Florian Lefebvre <[email protected]>
* Update packages/astro/src/assets/fonts/config.ts
Co-authored-by: Florian Lefebvre <[email protected]>
* Update packages/astro/src/assets/fonts/types.ts
Co-authored-by: Florian Lefebvre <[email protected]>
* Update packages/astro/src/content/loaders/types.ts
Co-authored-by: Florian Lefebvre <[email protected]>
* Update packages/astro/src/content/config.ts
Co-authored-by: Florian Lefebvre <[email protected]>
* Update packages/astro/src/core/config/schemas/relative.ts
Co-authored-by: Florian Lefebvre <[email protected]>
* Update packages/astro/test/units/config/config-validate.test.js
Co-authored-by: Florian Lefebvre <[email protected]>
* Update packages/astro/test/units/actions/form-data-to-object.test.js
Co-authored-by: Florian Lefebvre <[email protected]>
* Update packages/astro/src/core/config/schemas/refined.ts
Co-authored-by: Florian Lefebvre <[email protected]>
* Update packages/astro/src/content/content-layer.ts
Co-authored-by: Florian Lefebvre <[email protected]>
* Update packages/astro/src/content/types-generator.ts
Co-authored-by: Florian Lefebvre <[email protected]>
* Update packages/astro/src/content/utils.ts
Co-authored-by: Florian Lefebvre <[email protected]>
* Use $ZodError
* Update packages/astro/src/core/csp/config.ts
Co-authored-by: Florian Lefebvre <[email protected]>
* fix the build
* fix e2e test
* replace z4 with z
* increase vercel test timeout
* pr comments
* export ImageFunction
* use prefault
* Validate experimental features special
* bring back old locales
* fix test
* db needs to be a patch too
* fix chainability of image
* update zod imports
* Discard changes to packages/integrations/svelte/package.json
* Discard changes to packages/integrations/svelte/test/fixtures/async-rendering/package.json
* refresh lockfile
* chore: changeset
* fix: reference()
* skip broken svelte test
* Update .changeset/dance-ornate-keen.md
Co-authored-by: Sarah Rainsberger <[email protected]>
* fix config vlaidate test
---------
Co-authored-by: Florian Lefebvre <[email protected]>
Co-authored-by: Sarah Rainsberger <[email protected]>1 parent 941d8f2 commit 0ff51df
70 files changed
Lines changed: 614 additions & 511 deletions
File tree
- .changeset
- examples
- blog/src
- starlog/src
- packages
- astro-rss
- src
- astro
- components
- e2e
- fixtures
- cloudflare/src
- custom-client-directives
- src
- actions
- runtime
- assets/fonts
- content
- loaders
- core
- app
- config
- schemas
- csp
- errors
- env
- events
- types/public
- virtual-modules
- templates/content
- test
- fixtures
- content-collections-number-id
- content-layer/src
- pages/spacecraft
- units
- actions
- config
- db
- src/core
- db-client
- integration
- test/fixtures/ticketing-example/src/pages/[event]
- integrations
- cloudflare/src
- sitemap/src
- svelte/test
- vercel
- language-tools/language-server/test/content-intellisense
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments