Hi,
I'm going over our various modules, looking for those that are stable enough to
slap "1.0" on. Before I do so I want to have a final round on naming. As the
number of modules have grown I suspect our current naming scheme is causing some
confusion, and I want input on how we can improve.
The Buster.JS modules can be roughly categorized in three main categories:
* Generally useful utilities
* Buster-specific modules relating to the test framework
* Buster-specific modules relating to automating browsers
Several modules fit in more than one of these categories, in which case,
"generally useful utilities" is usually the preferred category.
I think it would be easier for people to find their way around the codebase if
we used naming conventions to make the distinction between the different kinds
of modules. The following is a very rough suggestion, but I'm really only
throwing the idea out there - is it worthwile persuing? Gimme all you got.
Generally useful modules
-------------------------------------
My suggestion is that all non-Buster.JS specific modules earn their own names
without the "buster-" prefix. I already did this with "fs-watch-tree" and
"preferences" (which is a bit too generic a name I guess). There's a concern
here for modules that are used in browsers, see below.
buster-args - Command-line arguments parser
buster-assertions - Assertion functions
buster-bayeux-emitter - Wrap a bayeux client in an EventEmitter interface
buster-evented-logger - A logger object that emits events
buster-format - Pretty object formatting
buster-glob - Glob multiple patterns in one operation. This module will die.
Isaac said he'd welcome a patch that puts this ability into
node-glob, so I guess that's the right approach.
buster-stdio-logger - Builds on evented logger and allows you to redirect
messages in specific levels to one of two streams.
buster-terminal - ANSI escape sequences and string utilities
buster-user-agent-parser - Used to display human friendly browser names in the server.
fs-watch-tree - Watch file trees for changes recursively
preferences - Read preferences from a ~/.<project> file, environment variables and more.
Test-framework modules
-----------------------------------
I suggest the test framework modules keep the buster- names.
buster
buster-analyzer
buster-autotest
buster-core
buster-sinon
buster-static
buster-test
buster-util (not really intended for outside use)
Extensions
buster-amd
buster-html-doc
buster-jstestdriver
buster-lint
buster-syntax
Browser automation modules
------------------------------------------
The browser automation modules will become easily reusable starting with the
next beta, and even more so in 0.7/RC1. It feels like this part is a separate
sub-project, i.e. that maybe the automation modules should have a different
common prefix, like optimus-prime-capture-server etc. Obviously I'm not
suggesting they be called "optimus prime", but you get the point.
buster-capture-server
buster-cli
buster-configuration
buster-resources
buster-server-cli
buster-test-cli
A concern
One concern is that some of these modules are used in the browser. An explicit
goal for the Buster.JS test runner is to not pollute the global environment
where the tests run, so I really don't want too many global variables -
preferably only `buster`.
If e.g. buster-assertions moves to a non-buster prefixed name, it doesn't make
sense for it to use the `buster` global, does it? AMD is also not suitable,
because I don't want Buster to define a global `require` function. Suggestions
for how work around this? One, albeit slightly hacky, suggestion is to inject
things into `global.buster` if available, otherwise expose other globals. :|
Organization
I still think these modules should all be hosted under
http://github.com/busterjs/ - they are still part of the project. But I think
rethinking the naming strategy to make it clearer what kind of modules the
different modules are will help people getting around the code base.
What do you guys think?
Chris