fix: Slug component import path to use absolute package reference#426
fix: Slug component import path to use absolute package reference#426ainsleyclark merged 1 commit intomainfrom
Conversation
Fixes the slug field component path from a relative `/fields/Slug/Component` to the fully-qualified `@ainsleydev/payload-helper/fields/Slug/Component`, preventing PayloadCMS from resolving it as a relative path in the consumer's importMap. Also adds the corresponding package.json export. https://claude.ai/code/session_01WVA6tqvspfT8wQrJG8Zivn
Review summary
A small, well-scoped fix for a real PayloadCMS import resolution bug. The root cause is clear, the changeset is present, and the approach (absolute package reference + matching export entry) is correct. Two minor consistency issues worth noting. Critical issues 🔴None. Warnings 🟡1. Inconsistent export conditions The new export adds a "./fields/Slug/Component": {
"types": "./dist/fields/Slug/Component.d.ts",
"import": "./dist/fields/Slug/Component.js",
"default": "./dist/fields/Slug/Component.js" // ← inconsistent
}Since the package declares 2. No test coverage for the path fix There is no test (unit or integration) verifying that the slug field component path resolves correctly to the absolute package reference. If this regresses — for example, if someone changes the Suggestions 🟢Commit message scope The commit uses |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #426 +/- ##
==========================================
+ Coverage 64.59% 70.26% +5.67%
==========================================
Files 154 187 +33
Lines 6064 7439 +1375
==========================================
+ Hits 3917 5227 +1310
+ Misses 2064 2012 -52
- Partials 83 200 +117 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Fixed the slug field component import path to use an absolute package reference instead of a relative path, ensuring proper resolution in consumer applications.
Key Changes
/fields/Slug/Component#Component) to an absolute package reference (@ainsleydev/payload-helper/fields/Slug/Component#Component)package.jsonfor the slug component to support the new import path with proper type definitions and entry pointsImplementation Details
The issue was that the relative path would resolve incorrectly in the consumer's import map. By using the absolute package reference and adding the corresponding export configuration, the component can now be properly resolved regardless of where it's imported from. This ensures consistent behavior across different consumer applications and build configurations.
https://claude.ai/code/session_01WVA6tqvspfT8wQrJG8Zivn