Mmarklundin

playcanvas-esm-scripts

No description available

playcanvasesmscriptsmigration
Public
2 executions

Run locally

npx codemod playcanvas-esm-scripts

Updates legacy PlayCanvas scripts to the newer ESM Scripts format

This codemod transforms legacy PlayCanvas Scripts into their newer modern equivalents. You can open this codemod and run it over your existing scripts in vscode using the link to the side.

The codemod fully supports all syntax transformations apart from 'json' type attributes..

To run this codemod use

sh

This will translate the following older Script

javascript

transforms it into the modern ESM Scripts format

javascript

It will map any attribute properties to their relevant jsdocs tags according to the spec, and export all classes in the correct format. It will also handle enums correctly.

Ready to contribute?

Build your own codemod and share it with the community.