Skip to content

Undefined1234/MA3_POS_ENGINE

 
 

Repository files navigation

MA3 TypeScript Plugin Starter Template

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.

Dependencies

Configuration

maconfig.json

This file contains configuration which are relevant to the MA3 installation of the plugin, and some run-time.

buildconfig.json

This file contains configuration which is for the build itself, and are unrelated shipped plugin.

Dev Workflow

NOTE: You need to run once npm install before 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 MALightingTechnology plugins folder.

Reloading the plugin in MA3

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 as ReloadAllPlugins, but also resets the UI. (This is useful if you have some weird leftover UI dialogs stuff, and you want to clean it up)

Production Build

  • npm run build: For production
    • Generates a tsconfig.json
    • Builds the plugin into a dist folder.
    • Creates a Zip file ready for shipping.

tsconfig.json

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

Built-In images

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].ts file for each image, which exports the fileName and imageBase64 string
  • An index.ts file which exports:
    • ImageKey type: a string literal type with all possible image names
    • images object: a map of image-key to image-data

You need to initially run npm run build at least once, so the example code would compile in VS code.

About

A Basic typescript grandMA3 plugin template, with a build script.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 99.1%
  • JavaScript 0.9%