Skip to content

feat(zod-plugin): Add x-brand to the GlobalMeta augmentation#3315

Merged
RobinTail merged 2 commits intomasterfrom
plugin-aug-xbrand
Apr 11, 2026
Merged

feat(zod-plugin): Add x-brand to the GlobalMeta augmentation#3315
RobinTail merged 2 commits intomasterfrom
plugin-aug-xbrand

Conversation

@RobinTail
Copy link
Copy Markdown
Owner

@RobinTail RobinTail commented Apr 11, 2026

Found the lack of this feature while working on #3313

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.

@RobinTail RobinTail added the enhancement New feature or request label Apr 11, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c97f5c36-32bc-451c-8a47-e8c91609f985

📥 Commits

Reviewing files that changed from the base of the PR and between 7a10df2 and 9b77a59.

📒 Files selected for processing (1)
  • zod-plugin/CHANGELOG.md
✅ Files skipped from review due to trivial changes (1)
  • zod-plugin/CHANGELOG.md

📝 Walkthrough

Walkthrough

Extends Zod's GlobalMeta via module augmentation to include an x-brand key (from brandProperty) typed as symbol | string | number; updates tests to import globalRegistry and assert the new meta type; and adds a v4.1.0 changelog entry documenting the change.

Changes

Cohort / File(s) Summary
Type Augmentation
zod-plugin/src/augmentation.ts
Added `[brandProperty]?: symbol
Tests & Verification
zod-plugin/tests/index.spec.ts
Updated tests to import globalRegistry and extend compile-time assertions to check globalRegistry.get(...) return includes default, examples, and x-brand with correct types.
Documentation
zod-plugin/CHANGELOG.md
Added v4.1.0 changelog entry documenting the GlobalMeta x-brand extension for storing schema brands.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • RobinTail/express-zod-api#3162: Related changes updating GlobalMeta brand handling and use of Zod's global registry.
  • RobinTail/express-zod-api#2878: Introduces the brandProperty constant and brand helpers that populate the GlobalMeta metadata added here.

Suggested labels

coverage

Poem

🐰 A tiny brand in GlobalMeta's lair,
Symbols, strings, or numbers to wear,
Tests hop in to give a cheer,
Changelog notes the change this year,
Rabbit stamps each schema with care.

🚥 Pre-merge checks | ✅ 3
✅ 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 describes the main change: adding an x-brand property to the GlobalMeta augmentation in the zod-plugin, which aligns with the modifications across CHANGELOG, augmentation.ts, and tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch plugin-aug-xbrand

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.

@RobinTail RobinTail marked this pull request as ready for review April 11, 2026 06:14
@coveralls-official
Copy link
Copy Markdown

coveralls-official Bot commented Apr 11, 2026

Coverage Status

coverage: 100.0%. remained the same — plugin-aug-xbrand into master

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@zod-plugin/CHANGELOG.md`:
- Line 7: Fix the typo in the changelog entry: change "inteface" to "interface"
in the sentence describing the augmentation of Zod's GlobalMeta (the line
mentioning "Added `x-brand` type to the augmentation of Zod's `GlobalMeta`
inteface:"); ensure the word "interface" is spelled correctly while preserving
the surrounding text and backtick formatting for `x-brand` and `GlobalMeta`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c5365e00-23b0-485a-b1aa-9bb094ad0004

📥 Commits

Reviewing files that changed from the base of the PR and between 6426c6f and 7a10df2.

📒 Files selected for processing (3)
  • zod-plugin/CHANGELOG.md
  • zod-plugin/src/augmentation.ts
  • zod-plugin/tests/index.spec.ts

Comment thread zod-plugin/CHANGELOG.md 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.

Important

Typo in the CHANGELOG entry.

Task list (4/4 completed)
  • Read the PR diff and understand the changes
  • Review each changed file for correctness and issues
  • Self-critique drafted comments
  • Submit review

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

Comment thread zod-plugin/CHANGELOG.md Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@RobinTail RobinTail merged commit c79c673 into master Apr 11, 2026
14 checks passed
@RobinTail RobinTail deleted the plugin-aug-xbrand branch April 11, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant