@domain-first/project-structure 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,54 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @domain-first/project-structure
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Stop hand-rolling folders. Scaffold a clean, consistent **Domain-First** architecture — bounded contexts, aggregates, use cases, commands/queries, ports, REST endpoints, React modules — with one command, every time.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```bash
|
|
6
|
+
npx df-ps
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Why
|
|
10
|
+
|
|
11
|
+
- **Zero boilerplate** — aggregates, repositories, wiring and tests generated in seconds, correctly named and cross-linked
|
|
12
|
+
- **One consistent architecture** — every bounded context, layer and file lands in the same place, no matter who on the team runs it
|
|
13
|
+
- **Grows with your stack** — adapts output to whichever `@domain-first` packages (`types`, `errors`, `handlers`, `wire`, `handlers-rest`) you use, or stays framework-free if you don't
|
|
14
|
+
- **Interactive, not magic** — a guided CLI menu, not a rigid template you fight against
|
|
15
|
+
|
|
16
|
+
## Install
|
|
6
17
|
|
|
7
18
|
```bash
|
|
8
|
-
npm i @domain-first/project-structure
|
|
19
|
+
npm i -D @domain-first/project-structure
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick start
|
|
9
23
|
|
|
24
|
+
```bash
|
|
10
25
|
npx df-ps
|
|
11
26
|
```
|
|
27
|
+
|
|
28
|
+
First run walks you through a short setup (source folder, packages, testing library) and writes a config file. Every run after that opens a menu to scaffold whatever you need next — a new aggregate, use case, endpoint, widget — into your existing structure.
|
|
29
|
+
|
|
30
|
+
## What gets generated
|
|
31
|
+
|
|
32
|
+
Pick a piece, get the whole slice — class, tests, infra implementation and wiring, all linked together:
|
|
33
|
+
|
|
34
|
+
- **Domain** — aggregates, repositories, services, namespaced errors
|
|
35
|
+
- **Application** — use cases, commands & queries (execution or orchestration), ports
|
|
36
|
+
- **Infrastructure** — adapter implementations per port/repository (e.g. `prisma`, `in-memory`)
|
|
37
|
+
- **Presentation** — REST endpoints, React pages/widgets
|
|
38
|
+
|
|
39
|
+
Everything lands with consistent naming and imports. For example:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
bounded-contexts/
|
|
43
|
+
order/
|
|
44
|
+
domain/aggregates/order/
|
|
45
|
+
application/use-cases/
|
|
46
|
+
application/commands/
|
|
47
|
+
infrastructure/repositories/
|
|
48
|
+
presentation/rest/
|
|
49
|
+
wiring/
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
MIT
|