diff --git a/README.md b/README.md index b85a0c4..8713303 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,88 @@ -# DEMS - CLI +# Development Environment Management System (DEMS) + +[![๐Ÿงช Tests](https://github.com/angelmadames/dems-cli/actions/workflows/tests.yml/badge.svg)](https://github.com/angelmadames/dems-cli/actions/workflows/tests.yml) ## Contents -- [Overview](#overview) -- [Setup](#setup) +- [๐Ÿ—’๏ธ Overview](#๏ธ-overview) +- [๐Ÿ”ง Setup](#-setup) +- [๐Ÿ–๏ธ Style](#๏ธ-style) +- [๐Ÿ—๏ธ Structure](#๏ธ-structure) + - [๐ŸŸข Commands](#-commands) + - [๐Ÿ”ต Config](#-config) + - [๐ŸŸ  Utils](#-utils) + +## ๐Ÿ—’๏ธ Overview -## Overview +DEMS is a generic CLI tool meant to assist teams to quickly get from onboarding +to coding by automating the initialization process of an application (git clone, +deps install, provisioning of required services like databases or mail servers) +using Docker. -This project was created using `bun init` in bun v1.0.23. -[Bun](https://bun.sh) is a fast all-in-one JavaScript runtime. +DEMS is made with [Bun], [TypeScript] and [Commander.js]. -## Setup +## ๐Ÿ”ง Setup To install dependencies: -```bash +```shell bun install ``` To run: -```bash -bun run cli.ts +```shell +./cli.ts --help ``` + +## ๐Ÿ–๏ธ Style + +Our chosen format and lint tool is [Biome]. For more information about our +preset and custom rules configuration, see the [biome.json](./biome.json) +file. + +## ๐Ÿ—๏ธ Structure + +The current version of DEMS in this repository is a modern adaptation of an internal +tool with the same name that I made for [gbh.tech]. The original version was made +purely with Bash scripts, which is the main motivation for this newer version, to +extend its capabilities with a rich ecosystem and make it more accesible to developers. + +The structure of DEMS is simple: it has **commands** ([/src/commands](./src//commands/)), +and those commands depend on **utilities** ([/src/utils](./src/utils/)) and **config +files** ([/src/config](./src/config/)). + +### ๐ŸŸข Commands + +As you'd expect, `commands` are the protagonists of DEMS. They assist the software engineer +in the various tasks needed to setup a local project and start working on it. + +Commands are instances of the Command class provided by [Commander.js], which are then +added to the main `cli` Command object in the [./cli.ts](./cli.ts) file with `addCommand()`. + +> ๐Ÿ’ก Execute `dems --help` to check all available commands. + +### ๐Ÿ”ต Config + +The DEMS Config is split into three (3) different contexts found in two different files: [./src/config/cli.ts](./src/config//cli.ts) and [./src/config/dems.ts](./src/config//dems.ts). + +- **CLI**: modifies the behavior of the CLI tool, without affecting any specific project. +- **DEMS**: defines the configuration directives of DEMS for every project, in the form of a `config.json` file. +- **Environment**: defines the blogal environment variables of DEMS that can affect all other configurations (all env vars start with a prefix `DEMS_` to avoid conflicts). + +### ๐ŸŸ  Utils + +The Utils are simply re-usable functions that assist commands, they can go from simple things +like normalizing a string, to more complex tags like generating a .env file from the config.json +of the project or generating parameter for Docker Compose. + +For more information, check the [./src/utils](./src//utils/) directory. + + +[Bun]: https://bun.sh +[TypeScript]: https://www.typescriptlang.org +[Commander.js]: https://github.com/tj/commander.js +[Biome]: https://biomejs.dev +[gbh.tech]: https://gbh.tech diff --git a/biome.json b/biome.json index c3bbf79..c9f23ca 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/1.4.1/schema.json", + "$schema": "https://biomejs.dev/schemas/1.6.3/schema.json", "organizeImports": { "enabled": true }, diff --git a/package.json b/package.json index 1120ca4..0b57900 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "dems-cli", + "version": "0.0.1", "description": "DEMS (Development Environment Management System) CLI", "author": "Angel Adames ", "main": "dist/cli.js",