Skip to content

br(v28): Making zod plugin an optional peer dependency.#3313

Merged
RobinTail merged 32 commits intomake-v28from
opt-zod-plugin
Apr 11, 2026
Merged

br(v28): Making zod plugin an optional peer dependency.#3313
RobinTail merged 32 commits intomake-v28from
opt-zod-plugin

Conversation

@RobinTail
Copy link
Copy Markdown
Owner

@RobinTail RobinTail commented Apr 10, 2026

Making zod plugin an optional peer dependency.
Since branding moved to regular metadata, the framework could operate without the plugin, but the plugin could be an opt-in feature to enable the methods of convenience, such as .example().
This could simplify the framework, its bundling and make it free of side effects by default.

Breaking changes list:

  • getBrand() moved from Zod plugin to the framework;
  • Users SHOULD install @express-zod-api/zod-plugin and import it manually IF they want to continue using convenience methods such as ZodType::example()

@RobinTail RobinTail added this to the v28 milestone Apr 10, 2026
@RobinTail RobinTail added dependencies Pull requests that update a dependency file CI/CD breaking Backward incompatible changes labels Apr 10, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 10, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ec8ad19c-11c9-4b24-9e8e-112c588ff3a4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch opt-zod-plugin

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.

Comment thread express-zod-api/vitest.setup.ts Outdated
@coveralls-official
Copy link
Copy Markdown

coveralls-official Bot commented Apr 10, 2026

Coverage Status

Coverage is 100.0%opt-zod-plugin into make-v28. No base build found for make-v28.

Comment thread express-zod-api/src/documentation-helpers.ts Outdated
Comment thread express-zod-api/src/schema-walker.ts Outdated
@RobinTail RobinTail force-pushed the opt-zod-plugin branch 3 times, most recently from 775c430 to 24a20f9 Compare April 10, 2026 19:01
Comment thread zod-plugin/src/index.ts
RobinTail added a commit that referenced this pull request Apr 11, 2026
Found the lack of this feature while working on #3313 

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Schema metadata now supports a brand property (symbol, string, or
number) to record schema branding.

* **Tests**
* Expanded type-level tests to validate the new brand metadata along
with existing default and examples fields.

* **Documentation**
* Changelog updated with a v4.1.0 entry describing the brand metadata
support.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@RobinTail RobinTail marked this pull request as ready for review April 11, 2026 09:57
Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

Clean decoupling. The migration from .brand() to .meta({ [brandProperty]: ... }) is consistent across all schema files, the Array.isArray guards on examples are the correct defensive change given the plugin is no longer guaranteed, and the satisfies typeof brandProp cross-package type import is a nice compile-time sync check with zero runtime cost. Impact analysis found no stale references. Two minor items below.

Task list (7/7 completed)
  • Read the PR diff and identify major areas of change
  • Review core changes: package.json, index.ts, and schema files
  • Review zod-plugin package changes
  • Review test changes
  • Impact analysis: verify no stale references to removed/changed APIs
  • Self-critique and draft review
  • Submit review

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Claude Opus𝕏

Comment thread README.md Outdated
Comment thread zod-plugin/tests/index.spec.ts Outdated
RobinTail and others added 2 commits April 11, 2026 12:02
Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>
@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog Bot commented Apr 11, 2026

Both review threads are resolved. The README typo was already fixed, and the vacuous test assertion was replaced with Object.keys(entrypoint).toHaveLength(0) in 2cfd4c98. No code changes needed from this run.

Task list (4/4 completed)
  • Review comment threads and understand feedback
  • Acknowledge RobinTail's reply — the test fix is already committed (2cfd4c9), thread is OUTDATED
  • Reply to review comment and resolve thread
  • Report progress

Pullfrog  | View workflow run | Triggered by Pullfrog | Using Claude Opus𝕏

@RobinTail
Copy link
Copy Markdown
Owner Author

@pullfrog review again

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

No new issues. Reviewed the following changes:

  • Consolidated brand.ts into metadata.ts, renaming all imports across source and test files
  • Added getExamples() helper that normalizes globalRegistry examples to always return an array
  • Applied getExamples() in endpoint.ts and arrayResultHandler, simplifying the guard-and-extract pattern
  • Deleted brand.spec.ts and created metadata.spec.ts covering both getBrand() and getExamples()

Prior review feedback:

  • Typo "preferrably" → "preferably" — addressed in 93f06f3
  • Vacuous {} assertion in zod-plugin/tests/index.spec.ts — addressed in 2cfd4c9

Pullfrog  | View workflow run | Using Claude Opus𝕏

Comment thread express-zod-api/src/result-handler.ts Outdated
Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

Approving — the consolidation into metadata.ts and the new getExamples() helper are clean. The one inline comment is a minor consistency suggestion, not blocking.

Pullfrog  | View workflow run | Using Claude Opus𝕏

@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog Bot commented Apr 11, 2026

No code changes needed — the getExamples(output) fix was already applied. Confirmed and resolved the thread.

Task list (3/3 completed)
  • Check out PR branch and verify the fix is already applied
  • Reply to reviewer confirming the fix
  • Report progress

Pullfrog  | View workflow run | Triggered by Pullfrog | Using Claude Opus𝕏

Copy link
Copy Markdown
Owner Author

@RobinTail RobinTail left a comment

Choose a reason for hiding this comment

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

🏁

@RobinTail RobinTail merged commit 3f8b431 into make-v28 Apr 11, 2026
12 checks passed
@RobinTail RobinTail deleted the opt-zod-plugin branch April 11, 2026 17:25
RobinTail added a commit that referenced this pull request Apr 23, 2026
This one is no longer needed because custom schemas of `ez` namespace no
longer use those symbols for `ZodBranded`.
Using `.brand()` replaced to `.meta({ "x-brand": ... })` in #3313
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Backward incompatible changes CI/CD dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant