Skip to content

[BUG] Typescript bindings: dependencies model namespaces #3218

Open
@rsodre

Description

@rsodre

Describe the bug

When generating Typescript bindings of a project that includes models imported from dependencies, the SchemaType includes the original model namespace, instead of adding them to the default namespace, where they are actually created.

To Reproduce

Import and configure Arcade achievements:

achievement = { git = "https://github.com/cartridge-gg/arcade", tag = "v1.5.0" }

Generate typescript bindings, the imported models are in the original namespace inside SchemaType:

export interface SchemaType extends ISchemaType {
	pistols: {
		Challenge: Challenge,
		ChallengeMessage: ChallengeMessage,
		ChallengeMessageValue: ChallengeMessageValue,
		ChallengeValue: ChallengeValue,
		// ...
		MockedValue: MockedValue,
		MockedValueValue: MockedValueValue,
	},
	// this will not work, as `achievement` is not a namespace in the game
	// this will also break `SchemaType`
	achievement: {
		TrophyCreation: TrophyCreation,
		TrophyCreationValue: TrophyCreationValue,
		TrophyProgression: TrophyProgression,
		TrophyProgressionValue: TrophyProgressionValue,
	},
}

Expected behavior
Imported models should be on the default namespace.

Screenshots

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions