Merged
Conversation
- Updated the attribute parser to correctly handle TypeScript enums, including imported constants. - Enhanced the getLiteralValue function to prioritize type checking for imported constants. - Added support for enums in the test fixtures, validating the integration with playcanvas. - Introduced playcanvas as a dependency in package.json and package-lock.json. This update improves the parsing of enums and ensures compatibility with the latest playcanvas features.
- Replaced the fallback in `resolveIdentifier` to return `undefined` instead of a literal value. - Refactored enum definitions in test fixtures to utilize new tone mapping constants from playcanvas. - Updated tests to validate the new enum structure and ensure correct default values for tone mapping attributes. This change enhances the clarity and functionality of enum handling in the codebase.
Collaborator
|
Fantastic news, I'll update my script that could use this when this is out! |
Collaborator
- Introduced a new function `getPlaycanvasTypes` to load Playcanvas type definitions directly from `node_modules`. - Updated `parseAttributes` and `getAttributes` functions to utilize the loaded Playcanvas types instead of relying on a local fixture file. - Removed the `playcanvas.d.ts` fixture file as it is no longer needed. This change streamlines type handling and ensures that the latest Playcanvas definitions are used in the project.
Collaborator
Author
|
@mvaligursky This was using a a copy of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds support for referencing types from within playcanvas. This allows scripts to include direct references to playcanvas values. Fixes #16 and this issue
We can now use imported values for enum types. Tests included.
Note, this also removes the
playcanvas.d.tsfrom the tests and resolves instead to the playcanvas innode_modeules