chore(deps): Update zod to v4.4.3#332
Merged
Merged
Conversation
1 task
so0k
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Bumps
zodfrom3.25.76to4.4.3(latest) in both packages that declare it,@cdktn/hcl2cdkand@cdktn/cli-core.This is a major version bump (3.x → 4.x) and required migrating three removed/changed APIs across the schema definitions:
z.record(V)→z.record(z.string(), V). v4 requires an explicit key type; the single-argument form no longer typechecks. Updated every call site inschema.ts,terraform-json.ts,local-provider-constraints.ts,models/schema.tsanddependencies/package-manager.ts..nonstrict()→.loose(). The.nonstrict()alias for unknown-key passthrough was removed;.loose()is the v4 equivalent..deepPartial()→ per-level.partial()..deepPartial()was removed with no direct replacement, so each nesting level is now made partial explicitly. To keep parsing behaviour identical I reproduced v3's exact recursion rules:.deepPartial()recursed into plain nested objects and array elements (those get.partial()) but not intoz.record()values — so record value objects such asrequired_providersand npmdependencieskeep their fields required, as they were on v3.ZodError.errors→ZodError.issues. The.errorsaccessor was renamed. Updated the two error-logging sites inoutput.tsandhcl2cdk/index.ts.No string-format helpers (
z.string().email()etc.) are used, so those v4 relocations don't apply here.The migrated schemas were checked against both the installed v3 and v4 copies to confirm they parse identically — same output on valid input, same unknown-key passthrough, and the same rejection of a missing required field.
tsc --noEmitpasses cleanly on both packages.Checklist