Low Level Commands
esy provides a set of low level commands which enable more configurable workflows.
Such commands are grouped into two concerns:
- Managing installations
- Managing build environments
Managing installations
The following commands helps managing installations of dependencies.
The end product of an installation procedure is a solution lock (esy.lock
directory) which describes the package graph which corresponds to the
constraints defined in package.json manifest.
User typically don't need to run those commands but rather use esy install
invocation or esy invocation which performs installation procedure as needed.
esy solve
esy solve command performs dependency resolution and produces the solution lock
(esy.lock directory). It doesn't fetch package sources.
esy fetch
esy fetch command fetches package sources as defined in esy.lock making
package sources available for the next commands in the pipeline.
Managing build environment
The following commands operate on a project which has the esy.lock produced
and sources fetched.
esy build-dependencies
esy build-dependencies command builds dependencies in a given build
environment for a given package:
esy build-dependencies [OPTION]... [PACKAGE]
Note that by default only regular packages are built, to build linked packages
one need to pass --all command line flag.
Arguments:
PACKAGE(optional, default:root) Package to build dependencies for.
Options:
-
--allBuild all dependencies (including linked packages) -
--releaseForce to use "esy.build" commands (by default "esy.buildDev" commands are used)By default linked packages are built using
"esy.buildDev"commands defined in their correspondingpackage.jsonmanifests, passing--releasemakes build process use"esy.build"commands instead.
esy command-exec
esy-exec-command command executes a command in a given environment:
esy exec-command [OPTION]... PACKAGE COMMAND...
Arguments:
-
COMMAND(required) Command to execute within the environment. -
PACKAGE(required) Package in which environment execute the command.
Options:
-
--build-contextInitialize package's build context before executing the command.This provides the identical context as when running package build commands.
-
--envspec=DEPSPECDefine DEPSPEC expression which is used to construct the environment for the command invocation. -
--include-build-envInclude build environment. -
--include-current-envInclude current environment. -
--include-npm-binInclude npm bin in$PATH.
esy print-env
esy-print-env command prints a configured environment on stdout:
esy print-env [OPTION]... PACKAGE
Arguments:
PACKAGE(required) Package in which environment execute the command.
Options:
-
--envspec=DEPSPECDefine DEPSPEC expression which is used to construct the environment for the command invocation. -
--include-build-envInclude build environment. This includes some special$cur__*envirironment variables, as well as environment variables configured in theesy.buildEnvsection of the package config. -
--include-current-envInclude current environment. -
--include-npm-binInclude npm bin in$PATH. -
--jsonFormat output as JSON
DEPSPEC
Some commands allow to define how an environment is constructed for each package
based on other packages in a dependency graph (see --envspec command option
described above). This is done via DEPSPEC expressions.
There are the following constructs available in DEPSPEC:
-
selfrefers to the current package, for which the environment is being constructed. -
rootrefers to the root package in an esy project. -
dependencies(PKG)refers to a set of"dependencies"ofPKGpackage. -
devDependencies(PKG)refers to a set of"devDependencies"ofPKGpackage. -
EXPR1 + EXPR2refers to a set of packages found inEXPR1orEXPR2(union).
Examples:
-
Dependencies of the current package:
dependencies(self)This constructs the environment which is analogous to the environment used to build packages.
-
Dev dependencies of the root package:
devDependencies(root) -
Dependencies of the current package and the package itself:
dependencies(self) + selfThis constructs the environment which is analogous to the environment used in
esy x CMDinvocations.