This package is an example of how to use the ma3-ts-plugin-builder for building a TypeScript grandMA3 plugin.
It can be used as a starter template.
-
Uses node
>=16.20.0 -
ma3-pro-plugins/ma3-ts-plugin-builder: An opinionated build script, written in TypeScript.
-
ma3-pro-plugins/grandma3-ts-type: TypeScript types for grandMA3 Object-API and Object-Free-API
-
@ma3-pro-plugins/ma3-pro-plugins-lib: A library of utils. Some are generic and some are MA3 specific.
This file contains configuration which are relevant to the MA3 installation of the plugin, and some run-time.
This file contains configuration which is for the build itself, and are unrelated shipped plugin.
NOTE: You need to run once
npm installbefore running any of these scripts
npm run dev: For development- Generates a
tsconfig_dev.json - Builds the plugin in watch mode.
- Installs the transpile LUA code to your local
MALightingTechnologyplugins folder.
- Generates a
After you run npm run dev or after changing any file, you need to reload the plugins in MA3. You can do that with one of these commands:
ReloadAllPlugins- Reloads all plugins. Resets LUA global scope.ReloadUI- Does the same asReloadAllPlugins, but also resets the UI. (This is useful if you have some weird leftover UI dialogs stuff, and you want to clean it up)
npm run build: For production- Generates a
tsconfig.json - Builds the plugin into a
distfolder. - Creates a Zip file ready for shipping.
- Generates a
A tsconfig.json and tsconfig_dev.json are generated every time your run npm run build or npm run dev respectively.
They both extend the tsconfig_base.json
The plugin builder looks for a folder called images under the src folder.
If it find one, it generates a __imagesB64 folder which includes:
- A
__[image_name].tsfile for each image, which exports thefileNameandimageBase64string - An
index.tsfile which exports:ImageKeytype: a string literal type with all possible image namesimagesobject: a map of image-key to image-data
You need to initially run
npm run buildat least once, so the example code would compile in VS code.