dansanderson / picotool

Tools and Python libraries for manipulating Pico-8 game files. http://www.lexaloffle.com/pico-8.php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plugin support for tools

dansanderson opened this issue · comments

The Python libraries are useful for building new tools, but there's currently no good way to extend the behavior of an existing tool without copy-pasting code. There might be opportunities for plugin-like extensions. For example, luafmt/luamin could be given the path to a LuaWriter class that is run in place of the usual writer or in addition as a post-processor.

Feedback welcome on what kinds of plugin APIs would be useful.

Hi Dan,

I would be very interested in this.

I've just tried your luamin tool as my PICO-8 game/engine has blown the compressed count, even though I'm only just over half the token limit! 😕

However, as I plan for my "engine" code to be included in others' carts, I need to "EXCLUDE" (read:most) function names and global variables from minifying. Anything private to functions is all good.

So, unless that sounds like a feature ("minifying scope level") that you plan to implement - I guess a plug-in architecture should allow me to write some kind of custom exclusions list, so that I could re-run luamin from the original source and for the final output to maintain "public" compatibility (just with MUCH less footprint)?

Thx

That's a good idea. Many minifiers have an "externs" list for this purpose. This would be easy to implement in the core tool.