mirror of
https://github.com/xtr-dev/payload-automation.git
synced 2025-12-12 01:33:23 +00:00
- Create dedicated /server export for server-side functions and plugin
- Main export now contains only types (client-safe)
- Remove problematic /steps export that exposed server functions
- Update README with correct import structure
- Fix tests to use /server export
This prevents server-side code from being bundled in client JavaScript,
eliminating the "require is not defined in ES module scope" runtime error.
Breaking change: workflowsPlugin must now be imported from '/server':
import { workflowsPlugin } from '@xtr-dev/payload-automation/server'
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
14 lines
489 B
TypeScript
14 lines
489 B
TypeScript
import { describe, it, expect } from 'vitest'
|
|
|
|
describe('PayloadCMS Automation Plugin', () => {
|
|
it('should export the plugin function from server export', async () => {
|
|
const { workflowsPlugin } = await import('../exports/server.js')
|
|
expect(workflowsPlugin).toBeDefined()
|
|
expect(typeof workflowsPlugin).toBe('function')
|
|
})
|
|
|
|
it('should have the correct package name', async () => {
|
|
// Basic test to ensure the plugin can be imported
|
|
expect(true).toBe(true)
|
|
})
|
|
}) |