Skip to content

A starter template to develop RPG Maker plugins utilizing ES6 and modules.

Notifications You must be signed in to change notification settings

xuyanwen2012/rmmz-plugins-starter

Repository files navigation

rmmz-plugins-starter

RPG Maker MV/MZ plugin development starter in TypeScript

TypeScript Code Style: Google License: MIT

This repository is a monorepo that allows easy development of for RPG Maker MV/MZ plugins. It serves as a starting point for plugin developer who loves to write RM plugins in TypeScripts. The monorepo is especially useful for developers who produce many plugins. Rather than having many repositories each filled with redundant toolchains and dependencies, we can manage them as a whole in this template.

  • ✅ The template uses TypeScript. Code with confidence and build safer RPG Maker Plugin!
  • ✅ The template uses Rollup.js as the module bundler, which compiles small pieces of code into a single JavaScript that ready to use.
  • ✅ The template uses pnpm to manage all plugins in a single repository.
  • ✅ The template follows the Google TypeScript Style. To enforce the style guide and provide automated fixes, we uses gts from Google.

Simply clone this repository to start building your plugins.

Template Structure

Under the plugins directory, lies each plugin

rmmz_plugins-starter
│
└───dist
│   │   Plugin1.js      // The generated ready-to-use plugins,
│   │   Plugin2.js      // simply copy them to your RPG Maker Plugin folder
│   │   ...  
│
└───plugins
│   │
│   └───Plugin1
│   │   │   _header.txt        // Plugin parameters goes here etc.
│   │   │   package.json       // Should specify the plugin's name here, used by the pnpm.
│   │   │   rollup.config.js   
│   │   │   tsconfig.json      
│   │   │
│   │   └───src
│   │       │   index.js       // The entry point of your plugin
│   │       │   others.js
│   │       │   ...
│   │
│   └───plugin2
│   │   │    ...
│   │
│   │   ...

When making a new plugin, just copy paste the example Plugin1 directory (excluding node_modules). Give the plugin a proper name in the package.json. Run pnpm install again to install some dependency. Then you are ready to go.

Installation and Usage

We recommend using pnpm since this is a monorepo. Alternately you can still use npm, which then involves extra manual work. Once pnpm is installed, just use pnpm in place of npm/Yarn. E.g., install dependencies via:

pnpm install

To compile a plugin you wrote. For example plugin1, where plugin1 is the package name specified in plugins/Plugin1/package.json.

pnpm build                          // build all plugins
pnpm build --filter plugin1         // build only plugin 'plugin1' 

Note, npm package name does not allow upper case characters, thus all package name should be named in lower case.

Then the compiled RM plugin will be at /dist/Plugin1.js

You can also do a style check or fix on your plugin code via:

pnpm run check --filter plugin1     // check all plugins 
pnpm run fix                        // automatically fix all source code

License

Released under the MIT License.

About

A starter template to develop RPG Maker plugins utilizing ES6 and modules.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published