Dependencies
Dependency management in oneRepo is optional, but builds upon your package manager in order to better manage choosing versions, overlap deduplication, and multi-workspace conveniences.
Configuration
Section titled ConfigurationCompatible package managers
Section titled Compatible package managersNo configuration necessary! oneRepo automatically detects which package manager is used for your repository.
one dependencies
Section titled one dependenciesAliases: one dependency
, one deps
, one dep
Safely manage Workspace dependencies across your repository.
one dependencies add
Section titled one dependencies addAdd dependencies to Workspaces.
If a version is not provided with the command-line input, this command will look for currently installed versions of the requested dependencies throughout all Workspaces within the Workspace Graph. If only one version is found, it will be used, regardless of the --mode
provided.
If multiple versions of the requested dependencies are found in the Workspace Graph, a prompt will be presented to choose the appropriate version.
Otherwise, the latest version will be requested from the registry.
Option | Type | Description |
---|---|---|
--all, -a | boolean | Run across all Workspaces |
--dedupe | boolean , default: true | Deduplicate dependencies across the repository after install is complete. |
--dev, -d | array | Add dependencies for development purposes only. |
--mode | "strict" , "loose" , "off" , default: "loose" | Version selection mode. Use strict to use strict version numbers, loose to use caret (^ ) ranges, and off for nothing specific. |
--prod, -p | array | Add dependencies for production purposes. |
--workspaces, -w | array | One or more Workspaces to add dependencies into |
Install the latest version of normalizr
from the registry, using a strict version number.
Install the latest version of normalizr
from the registry, using a caret (^
) version number range, enabling newer minor and patch releases to satisfy the dependency in the future.
Install react
as a production dependency and babel-core
as a development dependency in both workspace-a
and workspace-b
.
one dependencies remove
Section titled one dependencies removeRemove dependencies from Workspaces.
Option | Type | Description | Required |
---|---|---|---|
--all, -a | boolean | Run across all Workspaces | |
--dedupe | boolean , default: true | Deduplicate dependencies across the repository after install is complete. | |
--dependencies, -d | array | Dependency names that should be removed. | ✅ |
--workspaces, -w | array | List of Workspace names to run against |
one dependencies verify
Section titled one dependencies verifyVerify dependencies across Workspaces.
Dependencies across Workspaces can be validated using one of the various modes:
off
: No validation will occur. Everything goes.loose
: Reused third-party dependencies will be required to have semantic version overlap across unique branches of the Graph.strict
: Versions of all dependencies across each discrete Workspace dependency tree must be strictly equal.
Option | Type | Description |
---|---|---|
--all, -a | boolean | Run across all Workspaces |
--mode | "strict" , "loose" , "off" , default: "loose" | Version selection mode. Use strict to use exact version matches, loose to accept within defined ranges (^ or ~ range), and off for no verification. |
--workspaces, -w | array | List of Workspace names to run against |