feat: Add PublishedAt and URLField helper utilities#415
Merged
ainsleyclark merged 6 commits intomainfrom Feb 17, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #415 +/- ##
==========================================
+ Coverage 64.59% 69.94% +5.35%
==========================================
Files 154 185 +31
Lines 6064 7394 +1330
==========================================
+ Hits 3917 5172 +1255
+ Misses 2064 2025 -39
- Partials 83 197 +114 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
When generate() returned undefined and draft mode was active, the hook would produce the string "undefined?draft=true". Now returns undefined early when generate yields no value. https://claude.ai/code/session_01NwyDXYNHC8fkcbWpmRpBfg
This comment has been minimized.
This comment has been minimized.
…date exports (#416) - PublishedAt: replace spread overrides with deepMerge for proper nested merging - URLField: use URL API to correctly append draft param when URL has existing query string - common/index.ts: re-export PublishedAt and URLField from common entry point - Changeset: reword description to match actual PR scope https://claude.ai/code/session_019KQTSWuJGhcoeP1WmXkaLZ Co-authored-by: Claude <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
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.
Summary
This PR adds two new reusable field helper utilities to the payload-helper package:
PublishedAtandURLField. These helpers provide pre-configured Payload CMS fields with sensible defaults and common functionality.Key Changes
PublishedAt: A new date field helper that automatically:
URLField: A new virtual text field helper that:
?draft=truequery parameter when in draft modeExports: Updated
common/index.tsand mainindex.tsto export both new utilities and their TypeScript typesImplementation Details
overridesparameter for field customizationPublishedAtuses abeforeChangehook to set the date when status changes to publishedURLFielduses anafterReadhook to dynamically generate the URL based on document datadeepMergeutility for proper field override handling inURLFieldhttps://claude.ai/code/session_01NwyDXYNHC8fkcbWpmRpBfg