dev
dev
requires shell integration.
dev
is a tool for utilizing developer environments. It is built on top of pkgx
and the pkgx pkging primitives and automatically determines the packages you need based on your project’s keyfiles.
Getting Started
dev
requires pkgx
to be integrated with your shell.
Activating dev
Environments
dev
EnvironmentsBecause there’s a package.json
we know you want node
.
If there’s a .node-version
file we read that:
We understand almost all keyfile conventions. If we don’t understand one you use let us know and we’ll add it.
The environment is only active while your terminal is inside that directory.
This is persisted across terminal sessions.
If you want to disable this behavior, deactivate it inside the project directory:
We even add version control systems like git
, svn
and hg
.
Because we read the keyfiles of different project types, use of dev
is entirely optional for your users and coworkers. They can either use dev
, manually construct the environment with pkgx
or source their deps themselves.
Customizing the Environment
Projects require specific versions. To facilitate this we allow you to supplement the project files that indicate tooling. For example in a package.json
file:
In files that support comments we use YAML front matter:
Our preference is comments, JSON doesn’t support comments so we have to stick a pkgx
node in there.
We read all the files in your project, but only at the root level. If you move up a level and it has its own environment you will need to activate that separately.
Overriding Defaults
Multiple projects can read package.json
. If you want to use bun
rather than node
just specify that in your package.json
(or pkgx.yaml
):
pkgx.yaml
pkgx.yaml
We supplement the existing files to be less intrusive, but if you prefer you can instead add a pkgx.yaml
(or .pkgx.yaml
) file to your repo.
The format is the same as that of YAML front matter, thus for example:
Controlling Shell Environment Variables
It can be convenient to control shell environment variables for work projects.
You can either prefix the YAML with a root pkgx
node as above or drop that considering our metadata is universal this seems acceptable, but using a pkgx
root is safer. If you use a pkgx
and you only have deps you can specify just the deps. We support specification as strings, arrays or dictionaries so pick the one that feels right to you.
Adding New Dependencies to an Activated Developer Environment
Edit the relevant files and cd .
to trigger the environment to reload.
Using Activated Environments in Editors
Generally programmer editors should see tools if the environments are activated. If no, let us know and we’ll fix it.
Deactivating dev
dev
Last updated