Skip to content

Race condition when generate multiple type into same file #479

@B-2U

Description

@B-2U

Hi, I'm using ts-rs to generate multiple enum into same ts file, and i use git diff after cargo test to make sure all bindings are up-to-date.
But I notice my CI failed sometime due to the order of the types changed in the generated file.

For example both Foo and Bar has #[ts(export, export_to = "Output.ts")]. And in Output.ts, its

export enum Foo { }

export enum Bar { }

Sometimes it became Bar first

export enum Bar { }

export enum Foo { }

I wonder is this expected and unavoidable? Maybe I should just generate them in seperate file instead?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions