fix: resolve module import issues for Next.js/Turbopack compatibility

- Remove .js extensions from all TypeScript imports throughout codebase
- Update dev config to use testProvider instead of mollieProvider for testing
- Fix module resolution issues preventing development server startup
- Enable proper testing of billing plugin functionality with test provider

This resolves the "Module not found: Can't resolve" errors that were
preventing the development server from starting with Next.js/Turbopack.
All TypeScript imports now use extension-less imports as required.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-19 12:12:39 +02:00
parent 64c58552cb
commit d5a47a05b1
19 changed files with 145 additions and 64 deletions

View File

@@ -1,6 +1,6 @@
import { CollectionConfig } from 'payload'
import { FieldsOverride } from './utils.js'
import { PaymentProvider } from './types/index.js'
import { FieldsOverride } from './utils'
import { PaymentProvider } from './types/index'
export const defaults = {
paymentsCollection: 'payments',
@@ -20,7 +20,7 @@ export interface TestProviderConfig {
}
// Re-export the actual test provider config instead of duplicating
export type { TestProviderConfig as AdvancedTestProviderConfig } from '../providers/test.js'
export type { TestProviderConfig as AdvancedTestProviderConfig } from '../providers/test'
// Customer info extractor callback type
export interface CustomerInfoExtractor {

View File

@@ -1,8 +1,8 @@
import { createInvoicesCollection, createPaymentsCollection, createRefundsCollection } from '../collections/index.js'
import type { BillingPluginConfig } from './config.js'
import { createInvoicesCollection, createPaymentsCollection, createRefundsCollection } from '../collections/index'
import type { BillingPluginConfig } from './config'
import type { Config, Payload } from 'payload'
import { createSingleton } from './singleton.js'
import type { PaymentProvider } from '../providers/index.js'
import { createSingleton } from './singleton'
import type { PaymentProvider } from '../providers/index'
const singleton = createSingleton(Symbol('billingPlugin'))

View File

@@ -1,5 +1,5 @@
import { Payment } from './payments.js'
import { Id } from './id.js'
import { Payment } from './payments'
import { Id } from './id'
export interface Invoice<TCustomer = unknown> {
id: Id;

View File

@@ -1,6 +1,6 @@
import { Refund } from './refunds.js'
import { Invoice } from './invoices.js'
import { Id } from './id.js'
import { Refund } from './refunds'
import { Invoice } from './invoices'
import { Id } from './id'
export interface Payment {
id: Id;

View File

@@ -1,4 +1,4 @@
import { Payment } from './payments.js'
import { Payment } from './payments'
export interface Refund {
id: number;

View File

@@ -1,5 +1,5 @@
import type { CollectionConfig, CollectionSlug, Field } from 'payload'
import type { Id } from './types/index.js'
import type { Id } from './types/index'
export type FieldsOverride = (args: { defaultFields: Field[] }) => Field[]