# ts-domainer

> domainer

Latest version **1.0.2** (published 2021-10-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install ts-domainer
pnpm add ts-domainer
yarn add ts-domainer
bun add ts-domainer
```

Provides the command `domainer`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-10-30 |
| First published | 2021-10-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 23 |
| Unpacked size | 175.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | serhii-halych |
| Maintainers | serhii-halych |

## Links

- npm: https://www.npmjs.com/package/ts-domainer
- npm.io page: https://npm.io/package/ts-domainer

## Dependencies (23)

- [ejs](https://npm.io/package/ejs.md) ^3.1.6
- [clui](https://npm.io/package/clui.md) ^0.3.6
- [glob](https://npm.io/package/glob.md) ^7.1.7
- [rxjs](https://npm.io/package/rxjs.md) ^7.3.0
- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [clear](https://npm.io/package/clear.md) ^0.1.0
- [urijs](https://npm.io/package/urijs.md) ^1.19.7
- [eslint](https://npm.io/package/eslint.md) ^7.32.0
- [figlet](https://npm.io/package/figlet.md) ^1.5.2
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [inquirer](https://npm.io/package/inquirer.md) ^8.1.2
- [minimist](https://npm.io/package/minimist.md) ^1.2.5
- [prettier](https://npm.io/package/prettier.md) ^2.4.1
- [typescript](https://npm.io/package/typescript.md) ^4.4.2
- [change-case](https://npm.io/package/change-case.md) ^4.1.2
- [inquirer-fuzzy-path](https://npm.io/package/inquirer-fuzzy-path.md) ^2.3.0
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.24.2
- [typescript-formatter](https://npm.io/package/typescript-formatter.md) ^7.2.2
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) ^4.31.2
- [inquirer-autocomplete-prompt](https://npm.io/package/inquirer-autocomplete-prompt.md) ^1.4.0
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) ^4.31.2
- [eslint-plugin-simple-import-sort](https://npm.io/package/eslint-plugin-simple-import-sort.md) ^7.0.0
- [inquirer-file-tree-selection-prompt](https://npm.io/package/inquirer-file-tree-selection-prompt.md) ^1.0.12

## Recent versions

- 1.0.2 (latest) — 2021-10-30
- 1.0.1 — 2021-10-30
- 1.0.0 — 2021-10-30

## README

domainer

---

core features:

- setup project structure from scratch. Create initial files:
  -- AbstractUseCase
  -- DbContext
  -- DITokens

Core concepts:

- Use case
- Repository
- Context
- DB Context
- Service/Client

диалоговое окно, спрашивающее что хотим создать
если выбираем Use case | Repository, спрашивается контекст, в котором нужно создать.
если выбираем Context, создаётся новая папка с дефолтной структурой:

- application
- infrastructure,
  и файлами \*Module.ts . Автоматом модуль иньёктится в глобальный модуль

части, которые создаются при инициализации:

- DITokens (UseCaseToken, ServiceToken, ClientToken, CoreToken)
- AppModule (Nest under the hood)
- AbstractUseCase
- IDbContext, AbstractDbContext
- domainer-config.json

--------- V1 ---------

\*\*\* I want to setup initial project from scratch. - DONE

1. When I run `domainer init` domainer creates the next folder structure and files

src/
----core/
--------application/
------------AbstractUseCase.ts
------------IDbContext.ts

--------tokens/
------------CoreToken.ts
------------UseCaseToken.ts
------------ServiceToken.ts
------------DbContextToken.ts

----AppModule.ts

domainer-config.json

2. domainer-config.json must have all necessary information about core files (name, path)

-
-
-
-
-
-
-
-
-
-
-
-

\*\*\* I want to create new context - DONE

1. When I run `domainer add` and choose `Context` domainer asks the name of new context

2. If context exists domainer must notify me and do nothing

3. If context does not exist domainer must create new Context with the next folder structure and files

src/
----<Context name>/
--------application/
------------dataStructures/
------------useCases/
--------infrastructure/
------------persistence/
------------api/
--------<Context name>Module.ts

4. <Context name>Module.ts module must be imported in AppModule.ts automatically

-
-
-
-
-
-
-
-
-
-
-
- \*\*\* I want to create new use case

1. When I run `domainer add` and choose `Use case` domainer asks the next questions:

- Use case context: string <required>
- Use case DB context: string <"global" is default> <required>
- Use case action: string <required>
- Use case has input data: y/n <"y" is default> <required>
- Use case has output data: y/n <"y" is default> <required>

2. If use case action already exists in same context domainer must notify me and do nothing

3. If use case action does not exist in same context domainer must create new Use case with the next folder structure and files

src/
----<Context name>/
--------application/
------------dataStructures/
------------useCases/
----------------<Use case action>/
--------------------<Use case action>UseCase.ts
--------------------I<Use case action>UseCase.ts
--------------------only if "Use case has input data: y" DS<Use case action>UseCaseInputData.ts
--------------------only if "Use case has output data: y" DS<Use case action>UseCaseOutputData.ts
--------infrastructure/
------------persistence/
------------api/
--------<Context name>Module.ts

4. UseCaseToken.ts must be upgrated with new Use case token automatically

5. <Context name>Module.ts module must be updated with new Use case automatically

-
-
-
-
-
-
-
-
-
-
-

\*\*\* I want to create new repository

1. When I run `domainer add` and choose `Repository` domainer asks the next questions:

- Repository context: string <required>
- Repository DB context: string <"global" is default> <required>
- Repository entity name: string <required>

2. If repository already exists in same context domainer must notify me and do nothing

3. If repository does not exist in same context domainer must create new Repository with the next folder structure and files

src/
----<Context name>/
--------application/
------------boundaries/
----------------I<Repository entity name>Repository.ts
------------dataStructures/
------------useCases/
--------infrastructure/
------------persistence/
----------------<Repository entity name>Repository.ts
----------------<Repository entity name>Mapper.ts
------------api/
--------<Context name>Module.ts

4. Choosen DB context must be upgrated with new Repository automatically (both interface and implementation)

\*\*\* Files validation
save all paths, filenames into config.

---
_Source: https://npm.io/package/ts-domainer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
