-
Notifications
You must be signed in to change notification settings - Fork 237
Expand file tree
/
Copy pathworkflow-config.ts
More file actions
39 lines (36 loc) · 1.13 KB
/
workflow-config.ts
File metadata and controls
39 lines (36 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import type { BuildTarget, WorkflowConfig } from './types.js';
import { resolve } from 'node:path';
function resolveObservabilityCwd(): string {
const raw = process.env.WORKFLOW_OBSERVABILITY_CWD;
if (!raw) {
return process.cwd();
}
// Allow relative paths; resolve relative to the current process.cwd()
// (i.e. where the CLI was invoked).
return resolve(process.cwd(), raw);
}
export const getWorkflowConfig = (
{
buildTarget,
workflowManifest,
}: {
buildTarget?: BuildTarget;
workflowManifest?: string;
} = {
buildTarget: 'standalone',
}
) => {
const config: WorkflowConfig = {
dirs: ['./workflows'],
dirsAreEntrypoints: false,
workingDir: resolveObservabilityCwd(),
buildTarget: buildTarget as BuildTarget,
stepsBundlePath: './.well-known/workflow/v1/step.js',
workflowsBundlePath: './.well-known/workflow/v1/flow.js',
webhookBundlePath: './.well-known/workflow/v1/webhook.js',
workflowManifestPath: workflowManifest,
// WIP: generate a client library to easily execute workflows/steps
// clientBundlePath: './lib/generated/workflows.js',
};
return config;
};