Migrate to v2.0
#
Configuration#
Beemo configuration has movedPreviously, configuration was either defined in a root configs/beemo.js
file, or a beemo
block
within package.json
. Configuration must now be defined in .config/beemo.ts
(or .js
, .json
,
.yaml
, etc). Package level config has been removed entirely.
package.json
#
Driver overrides have been removed from The ability to configure drivers in a beemo.<driver>
block within package.json
has been removed.
Instead, configure the driver at .config/beemo/<driver>.ts
(or .js
).
#
Drivers configuration structure has changedWhen configuring drivers with the drivers
setting, either supply a list of names.
Or a tuple with a name and an options object.
Or if you need more control, an object of names that map to booleans (enable or disable the driver), or an options object.
The old format of mixing strings and objects within a list is no longer supported. For more information on these formats, check out the official Boost documentation on plugins.
#
Strategy settings have been renamedThe strategy
setting has been renamed to configStrategy
to align with the new outputStrategy
.
#
Beemo#
File and type have movedThe Beemo
class instance is no longer default exported from @beemo/core
. It can now be accessed
from the named Tool
class export, or the BeemoTool
type alias export.
#
Logging has been removedAll logging methods have been removed. Use the native console
instead.
#
Workspace methods have movedMethods relating to project workspaces have moved to the project
class property. The APIs of these
methods may have also changed, so please refer to their TypeScript types.
#
Driver and script management has changedDrivers and scripts have moved to a registry based pattern, resulting in changes to the Tool
API.
#
Driver and script modules must export a factory function and have a name propertyIf you're using custom driver and script modules, they must now default export a function that
returns a class instance, instead of exporting a class declaration. Furthermore, all driver and
script instances must have a name
property (which is the name of the NPM module).
--stdio
command line option has been removed#
The The --stdio
option has been removed in favor of the new driver configuration option
outputStrategy
, which allows the output to be configured on a driver-by-driver basis, and
configured outside the context of the CLI.
By default Beemo will buffer the output and display it after the process has finished executing.
#
ContextsWith the migration from yargs
to @boost/args, the args object
structure has changed, as well as any terminology.
#
Options are now located in multiple locationsOptions are either known or unknown, depending on the CLI command being ran. Known options are now
accessed from args.options
, while unknown options from args.unknown
. Since unknown options are
well, unknown, we have no information on what type of value they should be, so all unknown option
values are always strings.
To avoid having to check both of these locations, a new Context#getRiskyOption()
method has been
provided. It will return the known option if it exists, otherwise unknown, and null
if neither
exists.
However, this method is risky, as denoted by its name. For unknown options, empty string values are
converted to true
, as they are treated as flags (--clean
). If you want to avoid the conversion,
pass true
as a 2nd argument.
#
Positional args are now referred to as paramsThe title is self-explanatory. Args are now called params, and the argv list is now accessed from
args.params
instead of args._
.
#
Drivers#
Jest: Peer dependency on Babel has been removedThe @beemo/driver-babel
peer dependency has been removed from the Jest driver's package.json
,
but the Babel config will still be automatically generated when running Jest if the Babel driver has
been enabled.
If you're using Babel to transform files within your Jest tests, be sure to install both driver dependencies manually.
--reference-workspaces
option has been removed#
TypeScript: The In previous versions, the --reference-workspaces
CLI option would automatically generate project
references in the root tsconfig.json
, and a tsconfig.json
in each package folder. Going forward,
root project references will now be linked automatically if a project is workspaces enabled (Yarn
workspaces, etc) instead of requiring a CLI option.
#
TypeScript: Package project reference linking has moved to a new commandAs mentioned above, project references were automatically linked when running the TypeScript driver
with --reference-workspaces
. However, this process was rather heavy and only needed to be ran when
adding or removing packages, or changing dependencies. Because of this, package-level project
reference linking has moved to a new command, beemo typescript:sync-project-refs
.
This new command will only update the tsconfig.json
within each package, as the root
tsconfig.json
is still updated when running beemo typescript
.
#
Scripts@boost/args
#
Script arguments are now based on To support the new functionality provided by @boost/args,
the args()
method has been renamed to parse()
, and the return type/structure has changed to
ParserOptions
. Furthermore, the 2nd argument to execute()
has updated to the type/structure of
Arguments
.
#
Script tasks have been removedThe executeTasks()
and task()
methods have been removed. If you would like similar
functionality, we suggest using the @boost/pipeline package
directly.
#
TypeScriptOnly including important type changes.
- Migrated
Arguments
to@boost/args
structure. - Removed the generic from
Tool
(formerlyBeemo
). - Removed:
BeemoPluginRegistry
ExecuteType
ExecuteQueue
StdioType