Monorepo for RPG Maker MZ plugins maintained by JE. Chef Adventure (../ca) is the primary playtest game; built ships are copied there via the copy step in hotfix.
Use Bun (not npm/yarn). The default workflow after changing plugin source:
bun run hotfixThat runs lint → clean:out → build:all → copy:to-all (into project/js/plugins/ and ../ca/chef-adventure/js/plugins/j).
Every plugin ship is a Vite bundle:
- Source under
src/plugins/<family>/…uses ESM (import/export default) between colocated.jsfiles. entry.jsat the ship root imports_metadata/initialization.jsfirst, then the rest of the ship graph.vite.config.*.jsbeside the ship mergesvite.config.shared.js(Rolldown, no minify, MZ header plugin)._metadata/meta.jsexportsPLUGIN_NAME,PLUGIN_VERSION,PLUGIN_DESC_TAG(build-time only; not bundled)._metadata/initialization.jsconstructsJ.*.Metadatawith__PLUGIN_NAME__/__PLUGIN_VERSION__injected at compile time.- Output lands in
out/as a single.jsfile (plus.map) — what RMMZ loads at runtime. Noimport/exportin the shipped file.
bun run build:all runs every build:* script in package.json in parallel (src/build-tools/build-all.js). Individual targets (e.g. bun run build:jabs) exist for focused work; prefer full hotfix before commit so out/ and copies stay in sync.
bun run plugin:init <path-under-plugins> # e.g. abs/ext/myextCopies src/plugin-template/ into src/plugins/<path>/ (includes entry.js, vite.config.js, _metadata/meta.js). Follow SCAFFOLD.md in the new folder, then add a build:* script in package.json and register the ship in the test game’s plugins.js.
| Script | Role |
|---|---|
build-all.js |
Parallel build:* from package.json |
copy.js + mirror.js |
Mirror out/ to destination trees |
obliterator.js |
Delete out/ (clean:out) |
init.js |
plugin:init scaffold |
logger.js |
Shared CLI logging |
vite-plugin_rmmz-header-prepender.js |
Prepends MZ /*: header; defines __PLUGIN_NAME__ / __PLUGIN_VERSION__ |
generate-rmmz-engine-defs.js + rmmz-defs-infer.js |
bun run defs:generate — ambient typings from project/js/rmmz_*.js |
Register with PluginManager.registerCommand(J.*.Metadata.name, …) — the key must match Utils.extractFileName($plugins[n].name) (e.g. "J-ABS"). PluginMetadata exposes name (lowercase). J-Base also sets legacy Metadata.Name for older call sites; new code should use .name.
bun run test # build:all + vitest
bun run defs:generate # refresh src/defs/generated/rmmz/See .junie/guidelines.md for style, harness layout, and namespace rules.