Skip to content

Script name casing #49

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

Merged
merged 2 commits into from
Jul 28, 2025
Merged

Script name casing #49

merged 2 commits into from
Jul 28, 2025

Conversation

marklundin
Copy link
Member

This PR fixes playcanvas/editor#1345.

If a scriptName static field is provided it uses that verbatim, otherwise it will used a the name of the class converted to lower camel case.

  • Use the scriptName property verbatim if it exists.
  • Convert class names to lower camel case when scriptName is not present.
  • Update attribute extraction to use the original name instead of the lower camel case version.

- Use the scriptName property verbatim if it exists.
- Convert class names to lower camel case when scriptName is not present.
- Update attribute extraction to use the original name instead of the lower camel case version.
@marklundin marklundin requested a review from Copilot July 28, 2025 10:00
@marklundin marklundin self-assigned this Jul 28, 2025
@marklundin marklundin added the bug Something isn't working label Jul 28, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes script name casing by allowing custom script names via a scriptName static field while ensuring consistent camel case formatting for class-derived names. The change addresses issue #1345 by implementing a fallback mechanism for script naming.

  • Use scriptName property verbatim when present, otherwise convert class names to lower camel case
  • Update attribute extraction to use the processed script name instead of re-applying case conversion
  • Maintain consistent naming throughout the script processing pipeline

Co-authored-by: Copilot <[email protected]>
@marklundin marklundin requested a review from mvaligursky July 28, 2025 10:02
@marklundin marklundin merged commit e86071c into main Jul 28, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ESM can't handle scriptName starting with a uppercase letter
2 participants