diff --git a/docs/src/guide/getting-started.md b/docs/src/guide/getting-started.md index b423879..47887d8 100644 --- a/docs/src/guide/getting-started.md +++ b/docs/src/guide/getting-started.md @@ -54,7 +54,7 @@ async function run() { // "serializedContext": "{\"value\":42,\"_outputs.start\":42,\"_inputs.double\":42,\"_outputs.double\":84}", // "status": "completed" // } - +} run() ``` @@ -77,12 +77,12 @@ export async function simpleWorkflow(value: number) { } /** @step */ -async function startNode(value: number) { +export async function startNode(value: number) { return value } /** @step */ -async function doubleNode(input: number) { +export async function doubleNode(input: number) { return input * 2 } ``` diff --git a/packages/compiler/src/compiler.ts b/packages/compiler/src/compiler.ts index 2f58c15..08ef018 100644 --- a/packages/compiler/src/compiler.ts +++ b/packages/compiler/src/compiler.ts @@ -101,7 +101,7 @@ export class Compiler { const manifestDir = path.dirname(path.resolve('./dist/flowcraft.manifest.ts')) for (const [uses, { importPath, exportName }] of Object.entries(registry)) { const relativePath = path.relative(manifestDir, importPath).replace(/\.ts$/, '') - imports.push(`import { ${exportName} } from '${relativePath}'`) + imports.push(`import { ${exportName} } from '${relativePath.split(path.sep).join(path.posix.sep)}'`) registryEntries.push(` '${uses}': ${exportName}`) }