Plugin Component Combiner (Plugin Dev Tool)

On my search for a tool that allows me to easily work with a plugin split into components I just came across a cool tool called JSCombiner, made by Ardee Aram:

It allows you to select a folder and have the js files within that folder merged into a new file. If you keep the program running in the background, it will also listen for changes to these files & update the main plugin.

Features:
  • Merge Plugins Components in Alphabetical order into Main Plugin
  • Listen for changed & update Main Plugin

Requirements:

To run JSCombiner you must have the following installed:
  • Java Runtime Environment >= 1.7.0 (jRuby has a bundled distribution)
  • jRuby http://jruby.org/ (best use version 9.2.19.0 - later versions sometimes have an error)
Download Original Tool:

Link:


Download Anyone Variant:

I've also made a special version that is less flexible, but faster for my workflow. The download is attached to this post.
This makes it vastly faster and less tedious to use.

Features (Anyone Variant):
  • Instant Component loading
  • No setup process
My version of the file is designed to be one-click and you're good to go. No reconfiguring, no selecting or folder browsing.

EDIT: I've uploaded a second alternative version. This one is more clear in the naming scheme.
Drop it into your "plugins" folder, rename it to the name of your plugin, make a subfolder named after your plugin, throw your plugin or plugins into the subfolder, it will automatically generate a JS file with the same name.
1652656590115.png


Anyone Variant Instructions (v1):

1. Make sure you have the required software installed (Java Runtime 1.7.0 or higher - and jRuby)
2. In the folder where you want your Main Plugin to be, create a new folder and name it after your plugin file's name. Add a "_" in front of the folder name, and add as suffix "sub components":
ANY_Core => _ANY_Core sub components
3. Put the sub component js files into this new folder - ensure they're sorted in Alphabetical priority.
1631130984487.png

4. Place the *.rb file into the main folder and rename it to the plugin filename.
1631130905106.png

5. Launch the *.rb file. It will merge the files of the subfolder automatically and listen for changes. You can either exit out, or leave it running if you want to keep modifying the main file automatically based on component changes.

Repeat the above steps for every single main plugin file. Every one of them should have their own *.rb file.

1631131184073.png


Final Words:

And that's it.

What a useful tool by Ardee Aram. I merely optimized the workflow for RPGM plugin development.

This is the solution I came up with to have a very easily manageable component system for my plugins, so it's less of a headache to scroll through thousands upon thousands of lines of code. The tool will automatically ensure the main file is up to date, so I can just work on the components and never bother with manually merging all the JS files.

I hope this makes your life easier. Cheers.
Merge Plugins Components in Alphabetical order into Main Plugin
This can be a problem for people who don't know what they are doing.

In some cases the compatibility between plugins depend on the order in which they are placed in the plugin manager.
Combining them into a single file can cause problems if the order in which they are combined is not the correct one.
And that order is rarely the alphabetical order of the filenames, not unless they were programmed and named that way.
This can be a problem for people who don't know what they are doing.

In some cases the compatibility between plugins depend on the order in which they are placed in the plugin manager.
Combining them into a single file can cause problems if the order in which they are combined is not the correct one.
And that order is rarely the alphabetical order of the filenames, not unless they were programmed and named that way.
I think you misunderstood what this tool does.
It isn't there to combine Plugins into a single big plugin file. (There's not really any reason for this, and as you point out, there'd be compatibility issues)

This is a tool meant for Plugin Developers that work on a single plugin, but wish to split that plugin into multiple parts during the coding process.

For instance: I'm finishing up on a massive Dialogue Bust & Flow Controller, that also includes an integrated Clothing System for Sprites, Battlers, Enemies, Characters, Facesets, etc.
The whole thing is currently at around 7000 lines of code.
Working on it is a horrible process of constantly scrolling around.

Splitting a single file into its components makes it vastly easier to keep track of everything. This tool exists to allow you to have the split up components either merged via a single double-click, or auto merges the sub components into its main plugin anytime one of the sub components is changed.

The final result is always a single plugin, just like any other RPGM plugin and is used exactly as that.

This simply ensures you don't have to recompile all components individually into a single plugin for testing purposes - or forces you to load dozens of fragments of a plugin individually into the Plugin Manager.
Check out rollup.js, I think it's much better and easier to use!


Rollup is also very smart about it, you can for example have a file with a lot of general functions that you can use in any plugin. Then when you compile a plugin into a single JS, it will only load the functions that you actually used, so any "extra" code left behind in the source will not be included in the final plugin.
Check out rollup.js, I think it's much better and easier to use!


Rollup is also very smart about it, you can for example have a file with a lot of general functions that you can use in any plugin. Then when you compile a plugin into a single JS, it will only load the functions that you actually used, so any "extra" code left behind in the source will not be included in the final plugin.
Rollup definitely seems more flexible and powerful, but actually also more complex & requires more setting up?

Stuff like smart functions aren't really part of my workflow, since any function I use is either in my Core plugin or in that new plugin. Otherwise I can't control which functions the game dev's plugins will have access to.

The advantage of the tool above is that it's braindead easy.
Throw the *.rb file into the folder, make the component sub folder, throw the component files in, done.
Settings up a new plugin project takes not even 10 seconds, and then I can just go wild creating the plugin components.

The only thing that's a bit tricky to get into is the naming scheme in order to control the sequence. When more than 9 sub files are in a folder, lead by a digit, a leading zero is needed to ensure 10, 11 etc. don't come before 2.

Original thread: https://forums.rpgmakerweb.com/threads/plugin-component-combiner-plugin-dev-tool.140272/