fenix-tools | FeniX Engine Developer Tools

License: MIT pipeline status JavaScript Style Guide

Buy Me a Coffee at ko-fi.com

FeniXTools is a modular library built for use with RPG Maker MV plugin development.

Fenix Tools is designed with modern ES6 Javascript and is was created to help with common tasks which occur often when developing plugins for RPG Maker MV.

Tree-shakeable!

When using a bundler like Webpack or Rollup for bundling plugins, you can ensure you get only what you use in your plugin and not the whole library with it. This makes your plugins self reliant and it won't depend on the entire fenix-tools library to be used.

Installation

Prerequisites

Skip if you already have NodeJS & npm.

Windows

Ubuntu

sudo apt-get install nodejs
sudo apt-get install npm

Install fenix-tools

npm install fenix-tools --save-dev 

or

Have a look at our tags page for current releases

Getting Started

❗ If you would rather an easy to use command line tool, then check out FeniXCLI, a CLI tool that generates and builds projects for you

❗ If you would rather learn by example then have a look at fenix-tools-example for an easy start.

Basics

Before you can use FeniXTools you must have your enviroment setup to use ES6 modules. To start we will need a bundler library, the bundler library is responsible for bundling the code into one file and correctly interpreting import and export for you.

In this guide you will be shown 3 steps for setting up your project and building your plugins using FeniXTools as your helper library.

  1. Install & Setup RollupJS
  2. Setup directory structure
  3. Import FeniXTools methods
  4. Build your files

Install & Setup RollupJS

Install rollup and it's plugin for resolving node dependencies

npm install rollup rollup-plugin-node-resolve --save-dev

Create a rollup.config.js file

import resolve from 'rollup-plugin-node-resolve'

export default {
  input: `./src/example-plugin/main.js`,
  external: [
    'fs-extra',
    'http',
    'path'
  ],
  output: [{
    file: `./game/js/plugins/example-plugin.js`,
    format: 'iife',
    indent: false
  }
  ],
  plugins: [
    resolve({
      jsnext: true,
      module: true
    }
    )
  ]
}

Setup directory structure

This structure is for developing more than one plugin per project and every plugin contains it's own folder within the src directory.

├── game 
├── src  
│  ├── new-plugin
│  │   ├── Core.js
│  │   ├── main.js
│  │   ├── Parameters.js
│  ├── plugin-two
│  ├── plugin-three
├── test
├── LICENSE
├── README.md
└── package.json

Every plugin will require a main.js entry point file, which is used by RollupJS to bundle all the code and create the single plugin file.

Import FeniXTools library

🗒️ All FeniXEngine projects contain a Core.js and a Parameters.js file. You are not required to name your files this unless you are creating plugins for FeniXEngine plugin suite or you are using FeniXCLI.

Include the entire FeniXTools library

// Core.js
import * as FeniXTools from 'fenix-tools'

OR simply import the method you would like to use in your code.

import {loadLocalFile} from 'fenix-tools'

Build your plugin(s)

In your main.js file you will need to let RollupJS know what to include in the final bundle. Most plugins you will be simply exporting every single file in your plugin's folder.

/* eslint-disable */
export * from './Parameters'
export * from './Core'

Now run RollupJS which will create your plugin to the output directory in your rollup.config.js which is currently set to ./game/js/plugins/

npx rollup -c

If you installed Rollup globally you can run rollup directly

rollup -c

Documentation

A good place to get started is the documentation page for a list of available methods.

Documentation

Want To Contribute ?

It's really easy to get started with Fenix Tools development

Forking And Cloning

  • Fork the repo to your own account.

  • Clone the repository to a directory on your machine, where UserName is your gitlab username

    git clone git@gitlab.com:UserName/plugins.git

For a basic how-to on cloning read this Basic git commands


Install Required Packages

Once cloned, change to the root directory of the project and open the command line/terminal and install the packages required for FeniX plugin development

npm install

Once installation is complete, we use RollupJS to bundle all files.

npm run build

The resulting output after bundling is placed in ./lib/ folder.

Credits

While this is open source and credit is not required, it would be appreciated it you linked to FeniX Engine's website or GitLab repository to show support.

https://fenixenginemv.gitlab.io/

All plugins and tools developed for FeniX engine must retain its license information in the header of all plugins and files and must not be removed.

Contributing

Please read over the Contribution Guide

License

License: MIT The MIT License