mirror of
https://github.com/xtr-dev/payload-billing.git
synced 2025-12-10 02:43:24 +00:00
- Replace all @/ path aliases with proper relative imports and .js extensions - Update @mollie/api-client peer dependency to support v4.x (^3.7.0 || ^4.0.0) - Bump version to 0.1.5 - Ensure ESM compatibility for plugin distribution Fixes module resolution error: "Cannot find package '@/collections'" when using the plugin in external PayloadCMS projects. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
16 lines
558 B
TypeScript
16 lines
558 B
TypeScript
import type { CollectionConfig, CollectionSlug, Field } from 'payload'
|
|
import type { Id } from './types/index.js'
|
|
|
|
export type FieldsOverride = (args: { defaultFields: Field[] }) => Field[]
|
|
|
|
export const extractSlug =
|
|
(arg: string | Partial<CollectionConfig>) => (typeof arg === 'string' ? arg : arg.slug!) as CollectionSlug
|
|
|
|
/**
|
|
* Safely cast ID types for PayloadCMS operations
|
|
* This utility provides a typed way to handle the mismatch between our Id type and PayloadCMS expectations
|
|
*/
|
|
export function toPayloadId(id: Id): any {
|
|
return id as any
|
|
}
|