Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types for Defold Extensions #8

Open
thejustinwalsh opened this issue Dec 17, 2020 · 4 comments
Open

Types for Defold Extensions #8

thejustinwalsh opened this issue Dec 17, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@thejustinwalsh
Copy link
Member

Support type definitions for extensions.

  • Ideally these types would be opt-in in your .tsconfig file, and not automatically included.
  • Library names should match the pattern of the library include so that there are not additional steps in getting type definitions to function.
@thejustinwalsh thejustinwalsh added the enhancement New feature or request label Dec 17, 2020
@thejustinwalsh
Copy link
Member Author

Approach

  • Use the ts-defold key in the package.json to point to the main *.project file for the Defold app.
    • default to app/game.project if not present
  • Scan the *.project file for [dependencies] and generate the types from the included documentation in the extension package.
  • If no types are available scan the ts-defold/extension-types repo (naming TBD) to check for types.
    • If these types are available a message about how to include them in your .tsconfig and package.json should be emitted instead.
    • We may also want to simply not generate types if these types are explicitly defined. There may be user-contributed types that work better than any auto-generated types.

@thejustinwalsh
Copy link
Member Author

First implementation is available in 3e04227.

@thejustinwalsh thejustinwalsh self-assigned this Aug 11, 2021
@thinknathan
Copy link
Member

Alternative implementation available here: xtgen

@thejustinwalsh
Copy link
Member Author

I consider @thinknathan's xtgen the best solution.
I have yet to make plans to pick this work back up in the near or distant future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants