To begin, create and clone a new repository on GitHub (or another VCS). This repository will be
known as your "configuration module" going forward. I suggest naming it
build-tools, etc, as it's straight forward, easy to understand, and defines intent.
Once cloned, initialize a new NPM package, and provide the package name with a username scope, like
@beemo/dev. Why a scope? Because we don't want to clutter NPM with common named packages. It also
avoids collisions and easily announces ownership.
0.0.0 for the version, and whatever you want for the remaining questions.
Now that we have a repository, we can install and setup Beemo.
This will only install the core functionality. To support different developer tools like Babel, ESLint, and Jest, we need to install packages known as "drivers" (view all available drivers).
Drivers and their peer dependencies must be installed as production dependencies.
For each driver you install, there should be an associated configuration file within a
folder, named after the camel-cased package name (excluding "driver-"). Using the example above,
we'd have the following:
The benefit of Beemo is that we can avoid different tooling conventions and standardize on a single implementation. No more
configs/<driver>.ts(and .js too).
Each configuration file should return an object. Easy enough.
You can access the command line args, the pipeline context, and the current
tool instance on
process.beemo (which allows for runtime conditional logic). For
--react was passed, we can enable the React preset.
Command line arguments are parsed into an object using @boost/args.
Configuration files are looked for and resolved in the following order:
Beemo supports executing custom scripts found within your configuration module. To utilize a script,
create a file (in PascalCase) within the
scripts/ folder, extend the
Script class provided by
Beemo, and define the
parse() method is optional but can be used to define parsing rules for CLI options (powered by
@boost/args). If no rules are provided, default parsing rules will
execute() method is required and is triggered when the
beemo run-script command is ran. This
method receives the current pipeline context as the 1st argument and options (parsed with
as the 2nd argument. The Beemo Tool instance is available under
Returning a promise in
Script files are looked for and resolved in the following order:
Now that Beemo and its drivers are installed, let's move forward by publishing your configuration module to NPM with public access. This is mandatory if using a scope.
You can also set the access in