1.2.0 • Published 10 months ago

clean-nestjs-cli v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Description

A command-line interface tool designed to streamline the creation and management of Nest projects following Clean Architecture principles.

Installation

npm install -g clean-nestjs-cli

Or

yarn global add clean-nestjs-cli

Or

pnpm add -g clean-nestjs-cli

Global Options

-v, --version: Outputs the current version of the CLI.

Example:

clean-nest -v

-h, --help: Displays help with all available commands and their options.

Example:

clean-nest -h

Usage

After installation, you can access the CLI using the clean-nest or cnest command.

cnest <command> [options]

Available Commands

new <project-name> [options]

Creates a new project with a clean and structured setup.

Alias: n

cnest new my-new-project

Options:

  • --no-linters: Disables linters (enabled by default).

    Example:

    cnest new my-new-project --no-linters

generate <schematics> <module> [resource] [options]

Generates a new element in your project, such as modules or resources.

Alias: g

cnest generate module user

Available schematics: module|mo, repository|rp, use-case|uc

Options:

  • --path <path>: Specifies the destination directory inside the /src/modules folder. The default path is the module root (/).

    Example:

    cnest generate module user --path auth
  • --no-spec: Do not generate a spec files

    Example:

    cnest generate use-case user find-all --no-spec

Folder Structure

When using the new command, a Nest project with the following clean structure will be created:

my-new-project/
├──src/
│  ├── modules/
│  │   ├── module-example/
│  │   │   ├── models/
│  │   │   │   ├── dtos/
│  │   │   │   ├── entities/
│  │   │   │   ├── interfaces/
│  │   │   │   ├── enums/
│  │   │   ├── repositories/
│  │   │   ├── use-cases/
│  │   │   │   ├── use-case-example-1/
│  │   │   │   └── use-case-example-2/
│  ├── app.module.ts
│  ├── main.ts
│  ├── shared/
│  │   ├── databases/
└── ...

Contribution

Contributions are welcome! Feel free to open issues and pull requests on the official repository.

Author

Jheison Novak

License

Copyright © 2024, Jheison Novak. Released under the MIT License.

1.2.0

10 months ago

1.1.0

10 months ago

1.0.2

10 months ago

1.0.3

10 months ago

1.0.1

10 months ago

1.0.0

11 months ago