Skip to content

One CLI to rule them all! A bunch of daily commands to help the development of our projects.

Notifications You must be signed in to change notification settings

the-glima/dale-cli

Repository files navigation

Dale CLI

It's pronounced /dah-Leh/ (the Spanish way of saying it)

One CLI to rule them all! A bunch of daily commands to help the development of our projects.

Installation

Soon...

Usage

To see commands list 
$ dale

To use a specific command
$ dale COMMAND

Commands

dale build

Build all containers:

$ dale b

ALIASES
  $ dale b

dale clean

Remove all containers:

$ dale c

OPTIONS
  -i, --image Specify a image name to be removed.

ALIASES
  $ dale c

dale format

Format code using Prettier:

$ dale format

ALIASES
  $ dale f

dale generate

Generate api files:

$ dale generate

ALIASES
  $ dale g

dale help [COMMAND]

See command's help and options

$ dale -h COMMAND
$ dale --help COMMAND

dale integration

Run integration tests using Newman:

$ dale integration

ALIASES
  $ dale i

dale lint

Lint code using TSLint:

$ dale lint

ALIASES
  $ dale l

dale reset

Stop, remove and start all containers:

USAGE
  $ dale reset
  
OPTIONS
  -e, --env To use the docker-compose-env.yaml, it will start containers using an environment scenario.
  -i, --image Specify a image name to be removed.

ALIASES
  $ dale r

dale restart

Stop and start all containers:

USAGE
  $ dale restart

OPTIONS
  -e, --env To use the docker-compose-env.yaml, it will start containers using an environment scenario.

ALIASES
  $ dale rs

dale start

Create a network and starts all containers:

USAGE
  $ dale start

OPTIONS
  -e, --env To use the docker-compose-env.yaml, it will start containers using an environment scenario.

ALIASES
  $ dale s

dale stop

Stops all containers:

USAGE
  $ dale stop

OPTIONS
  -e, --env To use the docker-compose-env.yaml, it will stop containers running in an environment scenario.

ALIASES
  $ dale st

dale testcafe

Run E2E tests using Testacafe:

USAGE
  $ dale testcafe
  $ dale testcafe -f 'CRM'
  $ dale testcafe -u=dev

ARGUMENTS
  -f <fixture-name> to run a specific fixture
  -t <test-name> to run a single specific test

OPTIONS
  -u, --url  To run TestCafe tests in different environments. Options: 'dev', 'acc' and 'prod'

ALIASES
  $ dale t

dale unit

Run unit tests:

  $ dale unit

ALIASES
  $ dale u

You can pass any Jest CLI arguments

Configuration

You can override commands and settings adding a .dalerc.json file in the root of your project:

Logo

To toggle the Dale logo:

Value Type: Boolean

{
  "logo": true, // default
  ...
}

Log Color

Color for the commands logs, it should be a one of these available colors: 'black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'gray', 'grey', 'blackBright', 'redBright', 'greenBright', 'yellowBright', 'blueBright', 'magentaBright', 'cyanBright', 'whiteBright':

Value Type: String

Default:

{
  "logColor": cyan, // default
  ...
}

Image

The project's image(s) to clean or reset:

Value Type: Array<string>

{
  "images": ["foo", "bar"],
  ...
}

Be specific with the image name or you can add just the first part, this value works with a "*" at the end i.e.: "images": ["payon"] it will remove payon-mock, payon-api, etc...

Commands

Commands object list. These are the available commands: 'build', 'clean', 'format', 'integration', 'lint', 'reset', 'reset-mock', 'restart', 'start', 'stop', 'testcafe', 'unit'.

Value Type: Object { [key: string]: Array<string> }

{ 
  "commands": { 
    "build": ["this is my custom build command"],
    ...
  }
}

Development

Running locally

To run the CLI in this project you need to run its binary (from the root path):

$ bin/run
$ bin/run COMMAND

Or, with you can Npm link it (from the root path):

$ npm link
$ dale

After linking you can use dale across other projects

After you test it you should unlink it (from the root path):

$ npm unlink

Test

$ npm run test // run all tests
$ npm run test:integration // run commands/* tests
$ npm run test:unit // run config/* and utils/* tests

Build

$ npm run build

Format

$ npm run format

Lint

$ npm run lint

Check

$ npm run format && npm run lint

Git Hooks

We are using Husky to run some commands before or after some Git commands. Check husky options in package.json.

Pre Commit

Please read our documentation about Git Commit: Writing a Commit Message and Applying Conventional Commits.

We use Commitlinnt (a tool to check if your commit messages meet the conventional commit format) integrated with Husky, so before committing the message will be linted. If it doesn't follow the Conventional Commits the commit it will be prevented.

Pre-commit

Before committing it will run npm run format and npm run lint for formatting and linting the code if an error occurs the commit will fail.

Pre-push

Before pushing it will run npm run test to run all tests if an error occurs the push will be prevented.

Oclif

This project was built using Oclif CLI framework. Have a look at its documentation, there you will find everything that you need to create commands, hooks, plugins, etc...

About

One CLI to rule them all! A bunch of daily commands to help the development of our projects.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published