This tool exists in order to enforce proposed conventions and provide better DX for projects utilizing technologies like
docker
(especiallydocker-compose
anddocker-machine
),node
,webpack
,nextjs
and so on.
The following instructions are outlined for the repositories (projects) utilizing this tool.
- Make sure you have both
"name"
and"organization"
keys set in the target projectpackage.json
file. - ake sure to run
dxtools
from eithernpm
oryarn
scripts because commands heavily rely on target projectspackage.json
keys which end up in the environment.
- Run
yarn add --dev https://github.com/nikolakanacki/dxtools.git
- Add
"tools": "dxtools"
under"scripts"
key in yourpackage.json
file. - Prosper.
Global environment is set with DXTOOLS_ENV
variable and defaults to development
if not set before running the command (you can also use options arguments to set it, see below). You can prevent the environment loading completely by setting DXTOOLS_ENV_LOADED
to 'true'
or by using --no-env
options argument. Passing any of the environment options arguments will reset DXTOOLS_ENV_LOADED
to false
.
The following files / file patterns will be loaded into environment in the order specified below:
.env.default
: Commitable default values applied for all environments..env.<DXTOOLS_ENV>
: Commitable<DXTOOLS_ENV>
values..env.<DXTOOLS_ENV>.local
: Non commitable<DXTOOLS_ENV>
specific values..env
: Non commitable values applied last for all environments.
# In your project (if you did set up package.json):
yarn tools [...options] <command> [...args]
-e|--env <env>
: SetDXTOOLS_ENV
value to<env>
.--no-env
: Prevent environment loading.-ed|-ep|-es
: SetDXTOOLS_ENV
todevelopment
,production
orstaging
, accordingly.-d|--cd <path>
: Change directory to<path>
before running any commands. This is done after the environment has already been loaded. You can also set withDXTOOLS_CWD
env variable.