Plugin Component Combiner (Plugin Dev Tool)

Anyone

Veteran
Veteran
Joined
Aug 24, 2019
Messages
256
Reaction score
351
First Language
German
Primarily Uses
RMMV
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/
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.

Anyone Variant Instructions:

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.
 

Attachments

  • JSCombinerAnyone.rar
    2.6 KB · Views: 1

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,695
Reaction score
8,496
First Language
German
Primarily Uses
RMMV
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.
 

Anyone

Veteran
Veteran
Joined
Aug 24, 2019
Messages
256
Reaction score
351
First Language
German
Primarily Uses
RMMV
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.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,604
Reaction score
3,856
First Language
Java's Crypt
Primarily Uses
RMMZ
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.
 

Anyone

Veteran
Veteran
Joined
Aug 24, 2019
Messages
256
Reaction score
351
First Language
German
Primarily Uses
RMMV
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.
 

Latest Threads

Latest Posts

Latest Profile Posts

Hot chocolate and music make studying and note-taking much easier :kaoluv:
Until my hand cramps up from writing too much!
Doing RPG Maker News for 21st September 2021


Malak is still waiting for Dark Deception Chapter 4... This was him yesterday after another sugar crash.
Again, he's fine. He's just bored at this point, considering he's exhausted his entire vacation bucket list.
Am I the only one who files custom resources under specific folders to remember who to credit? :kaoswt2:
1632263519730.png
I always smile to myself when I see someone do the "immediate halt and spin around" from forgetting something. I find it sort of endearing how we all do it without ever being taught to.

Forum statistics

Threads
115,265
Messages
1,088,456
Members
149,869
Latest member
ekqul
Top