tshex-cli 1.0.21 → 1.0.22
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 +50 -32
- package/package.json +1 -1
- package/templates/ctx-react/languages/en.json +1 -0
- package/templates/ctx-react/languages/es.json +1 -0
- /package/templates/ctx-react/{adapters/api → api}/.gitkeep +0 -0
- /package/templates/ctx-react/{adapters/hooks → assets}/.gitkeep +0 -0
- /package/templates/ctx-react/{adapters/schemas → components}/.gitkeep +0 -0
- /package/templates/ctx-react/{application → core}/.gitkeep +0 -0
- /package/templates/ctx-react/{domain → hooks}/.gitkeep +0 -0
- /package/templates/ctx-react/{languages → schemas}/.gitkeep +0 -0
package/README.md
CHANGED
|
@@ -70,29 +70,29 @@ The command creates this structure:
|
|
|
70
70
|
|
|
71
71
|
```text
|
|
72
72
|
core/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
73
|
+
|-- index.d.ts
|
|
74
|
+
|-- main.ts
|
|
75
|
+
|-- shared/
|
|
76
|
+
| |-- application/
|
|
77
|
+
| | |-- data/
|
|
78
|
+
| | | |-- drivers.ts
|
|
79
|
+
| | | |-- managers.ts
|
|
80
|
+
| | | `-- repositories.ts
|
|
81
|
+
| | |-- events.ts
|
|
82
|
+
| | |-- http.ts
|
|
83
|
+
| | |-- loggers.ts
|
|
84
|
+
| | |-- services.ts
|
|
85
|
+
| | `-- validations.ts
|
|
86
|
+
| `-- domain/
|
|
87
|
+
| |-- aggregates.ts
|
|
88
|
+
| |-- entities.ts
|
|
89
|
+
| |-- errors.ts
|
|
90
|
+
| `-- value-objects.ts
|
|
91
|
+
`-- users/
|
|
92
|
+
|-- adapters/
|
|
93
|
+
|-- application/
|
|
94
|
+
|-- domain/
|
|
95
|
+
`-- example-ports.ts
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
### Choose the destination directory
|
|
@@ -115,7 +115,11 @@ The context is created at `core/billing`.
|
|
|
115
115
|
|
|
116
116
|
### Create a context for React
|
|
117
117
|
|
|
118
|
-
The `--react` option creates a context
|
|
118
|
+
The `--react` option creates a context intended for a React application.
|
|
119
|
+
|
|
120
|
+
A React context is a consumer by nature. It does not provide a hexagonal capability to other systems. Instead, it consumes existing capabilities and organizes that consumption as a collection of adapters for the UI layer.
|
|
121
|
+
|
|
122
|
+
Use this mode when the generated context will call APIs, validate interface data, expose hooks, compose components, and localize messages.
|
|
119
123
|
|
|
120
124
|
```bash
|
|
121
125
|
npx tshex --ctx users --react
|
|
@@ -127,19 +131,33 @@ You can also use its short form:
|
|
|
127
131
|
npx tshex --ctx users -R
|
|
128
132
|
```
|
|
129
133
|
|
|
130
|
-
The
|
|
134
|
+
The command creates this structure:
|
|
131
135
|
|
|
132
136
|
```text
|
|
133
137
|
users/
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
|-- api/
|
|
139
|
+
|-- assets/
|
|
140
|
+
|-- components/
|
|
141
|
+
|-- core/
|
|
142
|
+
|-- hooks/
|
|
143
|
+
|-- languages/
|
|
144
|
+
`-- schemas/
|
|
141
145
|
```
|
|
142
146
|
|
|
147
|
+
Each directory represents a consumption adapter or a resource used by those adapters:
|
|
148
|
+
|
|
149
|
+
| Directory | Responsibility |
|
|
150
|
+
| --- | --- |
|
|
151
|
+
| `api/` | Adapters that call external services or backend contexts. |
|
|
152
|
+
| `assets/` | Static resources used by the React context. |
|
|
153
|
+
| `components/` | Visual react adapters that render the consumed capability. |
|
|
154
|
+
| `core/` | Local support code and project modules adapters shared by the adapters in this context. |
|
|
155
|
+
| `hooks/` | React hook adapters that expose behavior to components. |
|
|
156
|
+
| `languages/` | Translation resources for the interface. Can be json, ts files, etc. |
|
|
157
|
+
| `schemas/` | Validation and parsing adapters for UI input and output. |
|
|
158
|
+
|
|
159
|
+
This layout is intentionally different from the default context template. The standard context separates `domain`, `application`, and `adapters` because it models and provides a capability. The React context generated with `--react` assumes the opposite role: it always consumes capabilities and groups the code around the adapters required by that consumption.
|
|
160
|
+
|
|
143
161
|
## Documentation index
|
|
144
162
|
|
|
145
163
|
From this point on, the guide is split into dedicated documents under `docs/`.
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|