Buildable
Link your local repositories and dependencies quickly, without any additional knowledge.
Installation
Buildable is made to work with each of installation type such as local, global and npx.
It is using pnpm to install and manage dependencies.
Use .npmrc
file to configure this package manager.
Local scope
npm install --save-dev @webeferen/buildable
Global scope
npm install --global @webeferen/buildable
It can be also used via npx
npx @webeferen/buildable [command]
Getting Started
Buildable itself is a CLI tool that doesn't require any additional configuration to run successfully. To get the smoothest experience the recommended way is by doing following steps:
- Call
buildable init
method to create metadata files;- Modify
.buildable
to the state that fits the usecase; - Modify
pnpm-workspaces.yaml
if needed - default ispackages/*
;
- Modify
- Run
buildable install
to make sure that every dependency is installed and linked; - Run desired commands by typing
buildable run XYZ
;
Commands
buildable [command] (...options)
Help
This command prints out useful information such as available commands and options.
buildable help
Prints out currently used version of the package
buildable --version
Init
This command generates configuration files which allows modifications to be applied. It will also generate pnpm-workspaces.yaml
file if workspace
flag is set to true.
buildable init (...options)
Install
This command installs and links packages. Under the hood it is using either pnpm-workspaces
if workspaces
is set or pnpm install
in each project.
buildable install (...options)
Run Script
This command runs specified command for each project inside directory.
buildable run (r) "script name" (...options)
Dependency Graph
This command generates dependency graph with every dependency inside workspace (linking them with correct versions). Graph only shows relations between local dependencies.
buildable dependency-graph (dg) (...options)
Execution Order
This command generates execution order in which projects should be run to avoid build order issues. It only takes into consideration local dependencies.
buildable execution-order (eo) (...options)
Available options
-
--listeners (-l)
List of comma separated texts when achieve next process can be run (regex check) -
--only (-o)
List of comma separated projects that will only be run (with their dependencies) -
--exclude (-e)
List of comma separated packages which should be excluded -
--path (-p)
Relative path to the directory containing workspace (if any) -
--config (-c)
Relative path to the configuration file -
--reload (-r)
List of comma separated packages which can be manually reloaded -
--workspace (-w)
Sets buildable in workspace mode (default: true) -
--no-safe
Disables safe mode for running without dependencies
Example configuration
Example configuration can be found here.
Possible issues
There were some cases where buildable was not able to kill child process by itself. If that happens, this command might help to clean the ports up:
kill -9 $(lsof -ti:[port])
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.