
With all the the stuff that's going on around API scripts at the moment, I thought it might be an opportune moment to raise this: has anyone given thought to how API scripts can nicely be packaged up and unit tested using standard tools (NPM, node, gulp etc)? One of the things that makes this uncomfortable at the moment is that API script files do not specify their own dependencies - the closest thing we have is a package.json, which unhelpfully nameclashes with the node package spec file, and doesn't interact with any standard tools (e.g. node itself) Really, I'd like to be able to run my Roll20 scripts inside a mocha suite under gulp; and I'd like to be able to require() my dependencies explicitly from with a script (which would be limited to underscore, roll20's own library (for which we could make a test proxy) and any other API scripts upon which we depended). At the moment the best way of achieving this seems to be to simulate the behaviour of the API server and cludge together a big JS file out of a bunch of fragments. I guess this is OK, but it's fragile and deeply non-standard. I guess it's probably a little late given that the one-click stuff is already rolling out, but is there any chance that the way this is handled could be aligned more closely with industry standards? It seems unfortunate, to say the least, the there's a totally custom solution that doesn't interact with any of the available tools when there are well-understood, widely-supported frameworks that do most of this stuff already. What was so wrong with require, module.exports and npm dependencies that necessitated a completely homegrown alternative? Cheers, Lucian