Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/kind-suns-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@workflow/world-postgres": patch
"@workflow/sveltekit": patch
"@workflow/builders": patch
---

- export stepEntrypoint and workflowEntrypoint from build
- add abstract queue driver to world postgres
- add execution strategy to world postgres
8 changes: 5 additions & 3 deletions packages/builders/src/base-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,13 @@ export abstract class BaseBuilder {

const entryContent = `
// Built in steps
import { stepEntrypoint } from 'workflow/runtime';
import '${builtInSteps}';
// User steps
${imports}
// API entrypoint
export { stepEntrypoint as POST } from 'workflow/runtime';`;
export const __wkf_entrypoint = stepEntrypoint;
export const POST = stepEntrypoint;`;

// Bundle with esbuild and our custom SWC plugin
const esbuildCtx = await esbuild.context({
Expand Down Expand Up @@ -549,8 +551,8 @@ export abstract class BaseBuilder {
import { workflowEntrypoint } from 'workflow/runtime';

const workflowCode = \`${workflowBundleCode.replace(/[\\`$]/g, '\\$&')}\`;

export const POST = workflowEntrypoint(workflowCode);`;
export const __wkf_entrypoint = workflowEntrypoint(workflowCode);
export const POST = __wkf_entrypoint`;

// we skip the final bundling step for Next.js so it can bundle itself
if (!bundleFinalOutput) {
Expand Down
6 changes: 3 additions & 3 deletions packages/sveltekit/src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class SvelteKitBuilder extends BaseBuilder {

// Replace the default export with SvelteKit-compatible handler
stepsRouteContent = stepsRouteContent.replace(
/export\s*\{\s*stepEntrypoint\s+as\s+POST\s*\}\s*;?$/m,
/export\s*const\s*POST\s*=\s*stepEntrypoint\s*;$/m,
`${SVELTEKIT_REQUEST_CONVERTER}
export const POST = async ({request}) => {
const normalRequest = await convertSvelteKitRequest(request);
Expand Down Expand Up @@ -133,11 +133,11 @@ export const POST = async ({request}) => {

// Replace the default export with SvelteKit-compatible handler
workflowsRouteContent = workflowsRouteContent.replace(
/export const POST = workflowEntrypoint\(workflowCode\);?$/m,
/export\s*const\s*POST\s*=\s*__wkf_entrypoint\s*;?$/m,
`${SVELTEKIT_REQUEST_CONVERTER}
export const POST = async ({request}) => {
const normalRequest = await convertSvelteKitRequest(request);
return workflowEntrypoint(workflowCode)(normalRequest);
return __wkf_entrypoint(normalRequest);
}`
);
await writeFile(workflowsRouteFile, workflowsRouteContent);
Expand Down
7 changes: 0 additions & 7 deletions packages/world-postgres/DEV_NOTES.md

This file was deleted.

50 changes: 0 additions & 50 deletions packages/world-postgres/HOW_IT_WORKS.md

This file was deleted.

Loading
Loading