Fix ES module bundling issues by isolating pure types

- Create dedicated types-only module (src/types/index.ts) with pure type definitions
- Update main index.ts to export only pure types without runtime imports
- Removes need for serverExternalPackages in Next.js configuration
- Plugin now works "out of the box" without bundling workarounds

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-08-31 20:35:09 +02:00
parent 06571a4aae
commit 265d5affc6
2 changed files with 72 additions and 4 deletions

View File

@@ -1,10 +1,16 @@
// Main export contains only types and client-safe utilities
// Server-side functions are exported via '@xtr-dev/payload-automation/server'
// Types only - safe for client bundling
export type { CustomTriggerOptions, TriggerResult } from './core/trigger-custom-workflow.js'
export type { ExecutionContext, Workflow, WorkflowStep, WorkflowTrigger } from './core/workflow-executor.js'
export type { WorkflowsPluginConfig } from './plugin/config-types.js'
// Pure types only - completely safe for client bundling
export type {
CustomTriggerOptions,
TriggerResult,
ExecutionContext,
Workflow,
WorkflowStep,
WorkflowTrigger,
WorkflowsPluginConfig
} from './types/index.js'
// Server-side functions are NOT re-exported here to avoid bundling issues
// Import server-side functions from the /server export instead