iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
989 stars 552 forks source link

Which Directory for Reusable Code? #1185

Open hayeswise opened 7 years ago

hayeswise commented 7 years ago

I'm developing plugins using the IITC framework. My plugins are are using @@INLCUDERAW: ...@@ to include files containing code that are common between my plugins and/or that I want to maintain outside the plugin. My two cases;

I believe these files should go into the plugins directory since they are not externals and are likely not candidates for externals (although, some of the Leaflet ones could be candidates).

Will this approach align with the IITC directory approach?

FesterCluck commented 7 years ago

INCLUDERAW is used to build libraries into plugins because they are intended to be independently installable. With IITC used so often via extensions like TamperMonkey, most of us feel its a bad practice, and that will change in the next version of IITC.

That being said, I cannot find a single instance where INCLUDERAW points to anywhere but externals. If you plan on using the build process to create single file plugins, it would be best to stick with that pattern.

The other option would be to submit these libraries to this project's core.

FesterCluck commented 7 years ago

@hayeswise you might want to just look into https://tampermonkey.net/documentation.php#_require IITC's build system is setup to deploy extensions which are self contained, and include all necessary scripts inline. It's not what you are looking for. Tampermonkey's documentation will get you where you need.

johnd0e commented 5 years ago

INCLUDERAW make sense when using some independent piece of code, because of easier support.

Imho Leaflet plugins should go to the externals directory, your own helper classes - to plugins directory. @require would be great, but it is definitely not supported by IITCm yet.