diff --git a/README.md b/README.md index 21fe8a6..0005eb6 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,31 @@

- Nest Logo + Hodfords Logo

-# nestjs-command +

nestjs-command simplifies creating and managing CLI commands in NestJS applications. It offers an easy way to define and execute commands, streamlining CLI integration and boosting productivity with minimal configuration.

-## Description +## Installation πŸ€– -[Nest](https://github.com/nestjs/nest) Nest commands for common templates +Install the `nestjs-command` package with: -___ +``` +npm install @hodfords/nestjs-command --save +``` -- [Installation](#installation) -- [Usage](#usage) - - [Make new command](#make-new-command) - - [Make controller](#make-controller) - - [Make DTO](#make-dto) - - [Make e2e test](#make-e2e-test) - - [Make entity](#make-entity) - - [Make migration](#make-migration) - - [Make module](#make-module) - - [Make repository](#make-repository) - - [Make service](#make-service) +Set up in your codebase: -## Installation πŸ€– +- `src/config/command.config.ts` -``` -npm install @hodfords/nestjs-command --save-dev -``` -- `src/config/command.config.ts` ```javascript import { CommandModule } from '@hodfords/nestjs-command'; -export const commandConfig = CommandModule.register(); // CommandModule.register(false) if typeorm is disabled +export const commandConfig = CommandModule.register(); + +// export const = CommandModule.register(false) if typeorm is disabled ``` -- `src/app.module.ts` +- `src/app.module.ts` + ```javascript import { Module } from '@nestjs/common'; import { CommandModule } from '@hodfords/nestjs-command'; @@ -47,7 +38,7 @@ import { CommandModule } from '@hodfords/nestjs-command'; export class AppModule {} ``` -- `src/cli.ts` +- `src/cli.ts` ```javascript import { NestFactory } from '@nestjs/core'; @@ -64,88 +55,118 @@ async function bootstrap() { bootstrap(); ``` -- `package.json` +- `package.json` ```json "wz-command": "wz-command" ``` -## Usage ⚑️ +## Usage πŸš€ + +Here’s how you can use them. For each type of component, you can use one of the two available command formats: with `npm run` or directly with `wz-command` -### Make new command +### Make a command ```bash npm run wz-command make-command -- --module -OR +``` + +```bash wz-command make-command --module ``` -### Make controller +### Make a controller ```bash npm run wz-command make-controller -- --module -OR +``` + +```bash wz-command make-controller --module ``` -### Make dto +### Make a dto ```bash npm run wz-command make-dto -- --module -OR +``` + +```bash wz-command make-dto --module ``` -### Make e2e test +### Make an e2e test ```bash npm run wz-command make-e2e-test -- --module -OR +``` + +```bash wz-command make-e2e-test --module ``` -### Make entity +### Make an entity ```bash npm run wz-command make-entity -- --module -OR +``` + +```bash wz-command make-entity --module ``` -### Make migration -#### Create new table +### Make a migration + +#### Create table + ```bash npm run wz-command make-migration -- --module --create= -OR +``` + +```bash wz-command make-migration --module --create= ``` -#### Update a table + +#### Update table + ```bash npm run wz-command make-migration -- --module --update= -OR +``` + +```bash wz-command make-migration --module --update= ``` -### Make module +### Make a module ```bash npm run wz-command make-module -OR +``` + +```bash wz-command make-module ``` -### Make repository +### Make a repository ```bash npm run wz-command make-repository -- --module -OR +``` + +```bash wz-command make-repository --module ``` -### Make service +### Make a service ```bash npm run wz-command make-service -- --module -OR +``` + +```bash wz-command make-service --module ``` + +## License πŸ“ + +This project is licensed under the MIT License diff --git a/package-lock.json b/package-lock.json index 7d83c64..c8830fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@hodfords/nestjs-command", - "version": "10.1.0", + "version": "10.1.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@hodfords/nestjs-command", - "version": "10.1.0", + "version": "10.1.1", "license": "ISC", "dependencies": { "pluralize": "8.0.0" diff --git a/package.json b/package.json index f4d5755..78981ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hodfords/nestjs-command", - "version": "10.1.0", + "version": "10.1.1", "description": "A utility for running CLI commands in NestJS apps", "main": "index.js", "scripts": {