In this gist there's a plugin.js boilerplate for creating a new anvil plugin.
Also, there's a sublime snippet for the SB Text users out there.
| <snippet> | |
| <content><![CDATA[ | |
| var pluginFactory = function( _, anvil ) { | |
| return anvil.plugin( { | |
| // Name your plugin | |
| name: "anvil.${1:PluginName}", | |
| // Activity list: "identify", "pull", "combine", "pre-process","compile", "post-process", "push", "test" | |
| activity: "post-process", | |
| // Command all the things [ "-s, --somecommand", "Run this plugin for awesomesauce" ] | |
| commander: [], | |
| // Configure all the things... | |
| configure: function( config, command, done ) { | |
| done(); | |
| }, | |
| // Run all the things... | |
| run: function( done ) { | |
| done(); | |
| } | |
| } ); | |
| }; | |
| module.exports = pluginFactory; | |
| ]]></content> | |
| <!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
| <tabTrigger>anvilp</tabTrigger> | |
| <!-- Optional: Set a scope to limit where the snippet will trigger --> | |
| <scope>source.js</scope> | |
| </snippet> |
| var pluginFactory = function( _, anvil ) { | |
| return anvil.plugin( { | |
| // Name your plugin | |
| name: "anvil.somePlugin", | |
| // Activity list: "identify", "pull", "combine", "pre-process","compile", "post-process", "push", "test" | |
| activity: "post-process", | |
| // Command all the things [ "-s, --somecommand", "Run this plugin for awesomesauce" ] | |
| commander: [], | |
| // Configure all the things... | |
| configure: function( config, command, done ) { | |
| done(); | |
| }, | |
| // Run all the things... | |
| run: function( done ) { | |
| done(); | |
| } | |
| } ); | |
| }; | |
| module.exports = pluginFactory; |