Skip to content

sortEntriesByDeps

sortEntriesByDeps(entries, fileProvider): Promise<SortResult>

Defined in: workspace/sort.ts:50

Sort workspace entries by their dependencies

Performs topological sort using Kahn’s algorithm. Entries without dependencies come first.

object[]

Array of entry configurations

FileProvider

File provider for reading configs

Promise<SortResult>

Sorted entries with dependencies first, plus any errors

const sorted = await sortEntriesByDeps([
{ entry: '/spec/core/index.html' }, // depends on overview
{ entry: '/spec/overview/index.html' }, // no deps
], fileProvider);
// Result: overview comes first, then core