Damon Oehlman commented here:
https://github.com/volojs/volo/issues/25#issuecomment-8413344
asking about splitting out the volofile/project automation stuff from
the dependency resolution stuff. This has come up before, and so this
is a thread to talk through what that might look like. This is a bit
rambling, just trying to list out the different things affecting the
decision.
I liked having an easy way to do synchronous-style scripting in node
that had some helpers for some common tasks. I liked using promises
too, since it gave a linear flow to the code. I also wanted to include
these helpers once, in a globally installed package, so that it was
easy to use in a volofile-type of file, and not require each use to
need to npm install a bunch of files in a local node_modules to get
that capability, since coming from my web background, that seemed
silly and bloated to do so.
However, I think that runs a bit counter to how packages in node/npm
are used. Not saying what they do now is good (people pushing a
package's test files to npm is just lunacy), but there is a culture
there. And one of the reasons for trying volo's approach, to something
like grunt[1] was to try to go more with the grain of node/npm instead
of having to do a bunch of adapter modules to use the node stuff
directly.
For reusable volo commands, like volo-ghdeploy[2] it was nice to be
able to reuse the globally installed helpers too. I am wondering
though if it is better to just encourage folks to create node packages
with a 'bin', see uglifyjs as an example, and then get the reusability
that way. I think it is still useful to have a way to call a locally
installed node_modules/.bin over the global script though, so I like
the 'n.' support in volofiles[3] for that.
The 'v.' support for just doing strings for a sequential list of
async-completed strings is also nice. Maybe it just means encouraging
shelljs for folks instead. Getting windows support without needing
cygwin is a big driver for this automation functionality.
The other reason for including the automation piece with a globally
installed package, and inside volo in particular, it is nice to have
the onAdd: and onCreate: hooks as part of `volo add` and `volo create`
to allow the newly fetched dependency/project template to do some work
after getting fetched. Maybe this can be accomplished by a
volo.scripts area in the package.json that just runs plain node
scripts though.
That is it for now on the brain dump. Feedback welcome.
James
[1]
https://github.com/volojs/volo/wiki/volo-and-grunt
[2]
https://github.com/volojs/volo-ghdeploy
[3]
https://github.com/volojs/volo/wiki/Creating-a-volofile
[4]
https://github.com/arturadib/shelljs