Skip to content
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
@sdboyer

Description

@sdboyer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions