@lunatechs/lunatea-napkin
v2.1.0
Published
A wrapper around prettier's parser for transformation required by LunaTea
Downloads
6
Readme
This is the prettier parser used to transform and clean the JavaScript output from LunaTea plugins. LunaTea plugins are written using the Haxe programming language, the compiled JavaScript can have minor style issues that need to be fixed with LunaTea Napkin.
What modifications does it make to the code?
Removes empty classes generated by Haxe or LunaTea
Changes bracket notation prototype access to dot notation, in both variable expressions and member expressions
Removes LunaTea modifications like the empty LTGlobals object access
Finally, it uses prettier's parser to clean the output following its opinionated code style.
Installation
npm install --save-dev @lunatechs/lunatea-napkin
How to Use
By default LunaTea Napkin will convert all .js files in the dist
folder in the root of your project when you run it.
npx napkin
Custom target directory
If you want to choose a custom directory, use the path argument
npx napkin --path=./game/js/plugins/
Disable Prettier Styling
Sometimes you may only want to perform the transformation required after compiling a plugin with LunaTea.
npx napkin --no-pretty