This repository was archived by the owner on Apr 30, 2025. It is now read-only.
This repository was archived by the owner on Apr 30, 2025. It is now read-only.
Add toposort to ensure outputs are printed in valid order #53
Open
Description
Currently, cuetsy prints its outputs in alphabetical order. TS is sensitive to ordering in its constant declarations, however, meaning that this:
interface Bar {
N: number;
}
const defaultBar: Bar = {
N: defaultFoo,
}
type Foo = number;
const defaultFoo: Foo = 4;
Is invalid because defaultFoo
is declared after it is referenced in defaultBar
. Consequently, we have to add a (stable) toposort to cuetsy such that its const outputs are in an acceptable order.
It'll also mean erroring on circular references, if any.