Skip to content
Merged
Changes from 1 commit
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
24 changes: 1 addition & 23 deletions packages/sveltekit/src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ async function convertSvelteKitRequest(request) {
export class SvelteKitBuilder extends BaseBuilder {
constructor(config?: Partial<SvelteKitConfig>) {
const workingDir = config?.workingDir || process.cwd();
const dirs = getWorkflowDirs({ dirs: config?.dirs });

super({
...config,
dirs,
dirs: ['src/routes', 'src/lib'],
buildTarget: 'sveltekit' as const,
stepsBundlePath: '', // unused in base
workflowsBundlePath: '', // unused in base
Expand Down Expand Up @@ -232,24 +231,3 @@ export const OPTIONS = createSvelteKitHandler('OPTIONS');`
}
}
}

/**
* Gets the list of directories to scan for workflow files.
*/
export function getWorkflowDirs(options?: { dirs?: string[] }): string[] {
return unique([
// User-provided directories take precedence
...(options?.dirs ?? []),
// Scan routes directories (like Next.js does with app/pages directories)
// This allows workflows to be placed anywhere in the routes tree
'routes',
'src/routes',
// Also scan dedicated workflow directories for organization
'workflows',
'src/workflows',
]).sort();
}

function unique<T>(array: T[]): T[] {
return Array.from(new Set(array));
}