@xeno-js/cli 0.1.2 → 0.1.4
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/LICENSE +18 -12
- package/README.md +461 -236
- package/dist/index.js +1018 -688
- package/dist/index.js.map +1 -1
- package/package.json +91 -66
- package/.github/.copilot-instruction.md +0 -73
- package/.github/agents/git-operator.agent.md +0 -86
- package/.github/agents/unit-tester.agent.md +0 -68
- package/.husky/commit-msg +0 -1
- package/.husky/pre-commit +0 -1
- package/.husky/pre-push +0 -1
- package/.prettierignore +0 -7
- package/.prettierrc.json +0 -37
- package/commitlint.config.cjs +0 -39
- package/eslint.config.mjs +0 -306
- package/lint-staged.config.mjs +0 -5
- package/logo/logo.png +0 -0
- package/src/domain/contracts/icommand-cli.contracts.ts +0 -13
- package/src/domain/contracts/icommand-runner.contracts.ts +0 -3
- package/src/domain/contracts/idispatch.contracts.ts +0 -3
- package/src/domain/contracts/ifile-service.contracts.ts +0 -3
- package/src/domain/contracts/igenerator.contracts.ts +0 -5
- package/src/domain/contracts/index.ts +0 -6
- package/src/domain/contracts/iscaffold-strategy.contracts.ts +0 -7
- package/src/domain/index.ts +0 -1
- package/src/index.ts +0 -30
- package/src/infrastructure/bootstrap/bootstrapper.ts +0 -30
- package/src/infrastructure/bootstrap/index.ts +0 -1
- package/src/infrastructure/builder/builder.test.ts +0 -36
- package/src/infrastructure/builder/builder.ts +0 -15
- package/src/infrastructure/builder/index.ts +0 -1
- package/src/infrastructure/command_launcher/command.utils.ts +0 -31
- package/src/infrastructure/command_launcher/index.ts +0 -0
- package/src/infrastructure/commands/command-runner.service.ts +0 -36
- package/src/infrastructure/commands/generate.command.ts +0 -55
- package/src/infrastructure/commands/help.command.ts +0 -63
- package/src/infrastructure/commands/index.ts +0 -4
- package/src/infrastructure/commands/new-project.command.ts +0 -47
- package/src/infrastructure/dispatcher/dispatcher.ts +0 -45
- package/src/infrastructure/dispatcher/index.ts +0 -1
- package/src/infrastructure/file/file.service.ts +0 -14
- package/src/infrastructure/file/index.ts +0 -1
- package/src/infrastructure/generators/core/bootstrap.generator.ts +0 -118
- package/src/infrastructure/generators/core/command/cqrs.generator.ts +0 -63
- package/src/infrastructure/generators/core/command/generate-command.generator.ts +0 -191
- package/src/infrastructure/generators/core/command/generate-query.generator.ts +0 -150
- package/src/infrastructure/generators/core/drizzle-sql-lite.generator.ts +0 -76
- package/src/infrastructure/generators/core/drizzle.generator.ts +0 -86
- package/src/infrastructure/generators/core/env.generator.ts +0 -69
- package/src/infrastructure/generators/core/index.ts +0 -9
- package/src/infrastructure/generators/core/main.generator.ts +0 -41
- package/src/infrastructure/generators/core/packagejson.generator.ts +0 -70
- package/src/infrastructure/generators/core/readme.generator.ts +0 -427
- package/src/infrastructure/generators/core/registry.generator.ts +0 -40
- package/src/infrastructure/generators/core/tsconfig.generator.ts +0 -39
- package/src/infrastructure/generators/gitignore.generator.ts +0 -60
- package/src/infrastructure/generators/vue/app-vue.generator.ts +0 -21
- package/src/infrastructure/generators/vue/bootstrap-ts.generator.ts +0 -60
- package/src/infrastructure/generators/vue/command_query/cqrs.generator.ts +0 -36
- package/src/infrastructure/generators/vue/command_query/generate-command-vue.generator.ts +0 -153
- package/src/infrastructure/generators/vue/command_query/generate-query-vue.generator.ts +0 -161
- package/src/infrastructure/generators/vue/env.generator.ts +0 -39
- package/src/infrastructure/generators/vue/index-html.generator.ts +0 -24
- package/src/infrastructure/generators/vue/index.ts +0 -12
- package/src/infrastructure/generators/vue/main.generator.ts +0 -41
- package/src/infrastructure/generators/vue/packagejson.generator.ts +0 -50
- package/src/infrastructure/generators/vue/readme.generator.ts +0 -389
- package/src/infrastructure/generators/vue/registry-ts.generator.ts +0 -26
- package/src/infrastructure/generators/vue/router.generator.ts +0 -35
- package/src/infrastructure/generators/vue/tailwind.generator.ts +0 -17
- package/src/infrastructure/generators/vue/tsconfig.generator.ts +0 -38
- package/src/infrastructure/generators/vue/use-app.generator.ts +0 -38
- package/src/infrastructure/generators/vue/vite-config.generator.ts +0 -35
- package/src/infrastructure/index.ts +0 -5
- package/src/infrastructure/strategies/core-scaffold.strategy.ts +0 -100
- package/src/infrastructure/strategies/index.ts +0 -2
- package/src/infrastructure/strategies/vue-scaffold.strategy.ts +0 -79
- package/src/shared/constants/command.constants.ts +0 -18
- package/src/shared/constants/core.constants.ts +0 -7
- package/src/shared/constants/index.ts +0 -2
- package/src/shared/index.ts +0 -3
- package/src/shared/types/common.types.ts +0 -68
- package/src/shared/types/index.ts +0 -1
- package/src/shared/utils/guards.utils.ts +0 -334
- package/src/shared/utils/index.ts +0 -2
- package/src/shared/utils/string.utils.ts +0 -60
- package/tsconfig.json +0 -15
- package/tsup.config.ts +0 -13
package/README.md
CHANGED
|
@@ -1,236 +1,461 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<img src="logo/logo.png" alt="Xeno CLI Logo" width="140" />
|
|
3
|
-
|
|
4
|
-
<h1>Xeno CLI</h1>
|
|
5
|
-
|
|
6
|
-
<p><
|
|
7
|
-
|
|
8
|
-
<p>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<a href="https://www.npmjs.com/package/@xeno-js/cli">
|
|
16
|
-
<img src="https://img.shields.io/npm/v/@xeno-js/cli?style=flat-square" alt="
|
|
17
|
-
</a>
|
|
18
|
-
<a href="https://
|
|
19
|
-
<img src="https://img.shields.io/
|
|
20
|
-
</a>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="logo/logo.png" alt="Xeno CLI Logo" width="140" />
|
|
3
|
+
|
|
4
|
+
<h1>Xeno CLI</h1>
|
|
5
|
+
|
|
6
|
+
<p><strong>Start with the architecture. Not the scaffolding.</strong></p>
|
|
7
|
+
|
|
8
|
+
<p>
|
|
9
|
+
Scaffold and generate TypeScript applications around explicit
|
|
10
|
+
application boundaries, CQRS, dependency injection, and Xeno's
|
|
11
|
+
application architecture.
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p>
|
|
15
|
+
<a href="https://www.npmjs.com/package/@xeno-js/cli">
|
|
16
|
+
<img src="https://img.shields.io/npm/v/@xeno-js/cli?style=flat-square" alt="npm version" />
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://github.com/xeno-js/xeno-cli">
|
|
19
|
+
<img src="https://img.shields.io/github/stars/xeno-js/xeno-cli?style=flat-square" alt="GitHub stars" />
|
|
20
|
+
</a>
|
|
21
|
+
<a href="https://github.com/xeno-js/xeno-cli/blob/develop/LICENSE">
|
|
22
|
+
<img src="https://img.shields.io/npm/l/@xeno-js/cli?style=flat-square" alt="License: MIT" />
|
|
23
|
+
</a>
|
|
24
|
+
<a href="https://buymeacoffee.com/xenojs">
|
|
25
|
+
<img src="https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Support-FFdd00?style=flat-square&logo=buy-me-a-coffee&logoColor=black" alt="Buy Me A Coffee" />
|
|
26
|
+
</a>
|
|
27
|
+
</p>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## What is Xeno CLI?
|
|
33
|
+
|
|
34
|
+
**Xeno CLI** (`@xeno-js/cli`) is the command-line entry point for creating and
|
|
35
|
+
generating Xeno projects.
|
|
36
|
+
|
|
37
|
+
It helps you start with an explicit application structure instead of rebuilding
|
|
38
|
+
the same architecture by hand.
|
|
39
|
+
|
|
40
|
+
Use it to:
|
|
41
|
+
|
|
42
|
+
- create a new Xeno backend project;
|
|
43
|
+
- create a Xeno Vue project;
|
|
44
|
+
- generate commands and queries;
|
|
45
|
+
- choose the infrastructure modules your project needs;
|
|
46
|
+
- generate the initial configuration and composition files.
|
|
47
|
+
|
|
48
|
+
The goal is simple:
|
|
49
|
+
|
|
50
|
+
> **Start coding the application, not the scaffolding.**
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
# Start in seconds
|
|
55
|
+
|
|
56
|
+
Create a Xeno backend project:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npx @xeno-js/cli new my-app --core
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Create a Vue project:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npx @xeno-js/cli new my-app --vue
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The CLI guides you through the project options and generates the initial
|
|
69
|
+
structure for you.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
# Generate a use case
|
|
74
|
+
|
|
75
|
+
Once your project exists, generate application components without manually
|
|
76
|
+
rebuilding the same structure.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npx @xeno-js/cli g command CreateUser --core
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
or:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npx @xeno-js/cli g query FindUser --core
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
For Vue:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npx @xeno-js/cli g command CreateUser --vue
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The `g` alias is available for faster iteration:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
xeno-js g command CreateUser --core
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
# What the CLI creates
|
|
103
|
+
|
|
104
|
+
Xeno CLI is built around the architecture used by the Xeno ecosystem.
|
|
105
|
+
|
|
106
|
+
A new project starts from explicit building blocks such as:
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
Application
|
|
110
|
+
├── composition root
|
|
111
|
+
├── configuration
|
|
112
|
+
├── registry
|
|
113
|
+
├── CQRS
|
|
114
|
+
├── domain contracts
|
|
115
|
+
└── infrastructure boundaries
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The exact generated files depend on the project type and the modules you select.
|
|
119
|
+
|
|
120
|
+
The important part is the boundary:
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
Transport
|
|
124
|
+
↓
|
|
125
|
+
Application
|
|
126
|
+
↓
|
|
127
|
+
Domain
|
|
128
|
+
↓
|
|
129
|
+
Infrastructure
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The CLI gives you the starting structure.
|
|
133
|
+
|
|
134
|
+
Your application defines the business behavior.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
# Backend projects
|
|
139
|
+
|
|
140
|
+
The Core scaffold can configure modules for areas such as:
|
|
141
|
+
|
|
142
|
+
- database access;
|
|
143
|
+
- Redis;
|
|
144
|
+
- authentication;
|
|
145
|
+
- HTTP clients;
|
|
146
|
+
- resilience;
|
|
147
|
+
- logging;
|
|
148
|
+
- validation;
|
|
149
|
+
- application pipelines.
|
|
150
|
+
|
|
151
|
+
The generated project uses `@xeno-js/core` as its application runtime.
|
|
152
|
+
|
|
153
|
+
Example:
|
|
154
|
+
|
|
155
|
+
```text
|
|
156
|
+
my-app/
|
|
157
|
+
├── src/
|
|
158
|
+
│ ├── bootstrap.ts
|
|
159
|
+
│ ├── main.ts
|
|
160
|
+
│ └── registry.ts
|
|
161
|
+
├── package.json
|
|
162
|
+
├── tsconfig.json
|
|
163
|
+
└── .env
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
The purpose is not to hide the architecture.
|
|
167
|
+
|
|
168
|
+
The purpose is to give you a clear place to continue building it.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
# Vue projects
|
|
173
|
+
|
|
174
|
+
Xeno CLI can also scaffold Vue applications around `@xeno-js/vue`.
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
npx @xeno-js/cli new my-app --vue
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The generated project can include the pieces you choose for your application,
|
|
181
|
+
such as:
|
|
182
|
+
|
|
183
|
+
- Xeno frontend bootstrap;
|
|
184
|
+
- Vue configuration;
|
|
185
|
+
- application registry;
|
|
186
|
+
- routing;
|
|
187
|
+
- Pinia;
|
|
188
|
+
- authentication;
|
|
189
|
+
- HTTP data sources;
|
|
190
|
+
- validation;
|
|
191
|
+
- logging;
|
|
192
|
+
- styling.
|
|
193
|
+
|
|
194
|
+
The UI remains the presentation layer.
|
|
195
|
+
|
|
196
|
+
Application behavior remains outside the component whenever the architecture
|
|
197
|
+
requires it.
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
# Why use the CLI?
|
|
202
|
+
|
|
203
|
+
Starting an application usually creates the same decisions again:
|
|
204
|
+
|
|
205
|
+
Where should the application bootstrap live?
|
|
206
|
+
|
|
207
|
+
Where should dependencies be registered?
|
|
208
|
+
|
|
209
|
+
Where do commands and queries belong?
|
|
210
|
+
|
|
211
|
+
How should infrastructure connect to the application?
|
|
212
|
+
|
|
213
|
+
How should the project evolve without putting everything into controllers,
|
|
214
|
+
routes, or components?
|
|
215
|
+
|
|
216
|
+
Xeno CLI turns those decisions into a repeatable starting structure.
|
|
217
|
+
|
|
218
|
+
> **You still design the application. You do not have to rebuild its
|
|
219
|
+
> foundation** **every time.**
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
# CLI and Xeno
|
|
224
|
+
|
|
225
|
+
The CLI is one part of the Xeno ecosystem.
|
|
226
|
+
|
|
227
|
+
```text
|
|
228
|
+
@xeno-js/shared
|
|
229
|
+
defines domain primitives
|
|
230
|
+
and application contracts
|
|
231
|
+
|
|
232
|
+
↓
|
|
233
|
+
|
|
234
|
+
@xeno-js/core
|
|
235
|
+
executes the application architecture
|
|
236
|
+
|
|
237
|
+
↓
|
|
238
|
+
|
|
239
|
+
@xeno-js/vue
|
|
240
|
+
brings the model to the browser
|
|
241
|
+
|
|
242
|
+
↓
|
|
243
|
+
|
|
244
|
+
@xeno-js/cli
|
|
245
|
+
creates the starting structure
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
A useful mental model is:
|
|
249
|
+
|
|
250
|
+
> **Shared defines the language.** **Core executes the architecture.** **Vue
|
|
251
|
+
> hosts the architecture in the browser.** **CLI gets you started.**
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
# Use it on new projects
|
|
256
|
+
|
|
257
|
+
The CLI is designed to make the first project setup explicit and repeatable.
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
npx @xeno-js/cli new my-app --core
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Then:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
cd my-app
|
|
267
|
+
npm install
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
The generated application can then be extended with the components and
|
|
271
|
+
infrastructure your project actually needs.
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
# Generate inside an existing project
|
|
276
|
+
|
|
277
|
+
The generator can also be used after the project already exists.
|
|
278
|
+
|
|
279
|
+
For example:
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
npx @xeno-js/cli g command CreateOrder --core
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
This is useful when a project already has its application structure and you want
|
|
286
|
+
to add another command or query without rebuilding the surrounding files
|
|
287
|
+
manually.
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
# Commands
|
|
292
|
+
|
|
293
|
+
## Create a project
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
xeno-js new <name> [--core | --vue]
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Options
|
|
300
|
+
|
|
301
|
+
- `--core` — create a backend project using `@xeno-js/core`
|
|
302
|
+
- `--vue` — create a frontend project using `@xeno-js/vue`
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## Generate a command or query
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
xeno-js generate <command | query> <Name> [--core | --vue]
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
Alias:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
xeno-js g <command | query> <Name> [--core | --vue]
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Optional output path:
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
xeno-js g command CreateUser --core --output src/features/users
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## Help
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
xeno-js --help
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Aliases:
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
xeno-js -h
|
|
336
|
+
xeno-js --h
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
# Installation
|
|
342
|
+
|
|
343
|
+
You can run the CLI on demand:
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
npx @xeno-js/cli --help
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
Or install it globally:
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
npm install -g @xeno-js/cli
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
Then:
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
xeno-js --help
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
# Node.js
|
|
364
|
+
|
|
365
|
+
Xeno CLI currently targets:
|
|
366
|
+
|
|
367
|
+
```text
|
|
368
|
+
Node.js 20+
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
# Relationship with the Xeno architecture
|
|
374
|
+
|
|
375
|
+
Xeno CLI does not replace your transport framework.
|
|
376
|
+
|
|
377
|
+
It does not try to own HTTP routing.
|
|
378
|
+
|
|
379
|
+
It does not define your business rules.
|
|
380
|
+
|
|
381
|
+
It gives you a consistent starting point for the application layer that sits
|
|
382
|
+
between transport and infrastructure.
|
|
383
|
+
|
|
384
|
+
```text
|
|
385
|
+
HTTP / CLI / Worker
|
|
386
|
+
↓
|
|
387
|
+
Application
|
|
388
|
+
↓
|
|
389
|
+
Domain
|
|
390
|
+
↓
|
|
391
|
+
Infrastructure
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
That boundary is what the rest of Xeno is designed to execute.
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
# Read the architecture
|
|
399
|
+
|
|
400
|
+
The CLI is easier to understand when you see the architecture it generates.
|
|
401
|
+
|
|
402
|
+
Start with:
|
|
403
|
+
|
|
404
|
+
- Xeno Core
|
|
405
|
+
- Xeno Shared
|
|
406
|
+
- Xeno Vue
|
|
407
|
+
- Xeno architecture documentation
|
|
408
|
+
|
|
409
|
+
Documentation:
|
|
410
|
+
|
|
411
|
+
https://www.xeno-js.it/docs/introduction
|
|
412
|
+
|
|
413
|
+
Core:
|
|
414
|
+
|
|
415
|
+
https://github.com/xeno-js/xeno-js
|
|
416
|
+
|
|
417
|
+
Shared:
|
|
418
|
+
|
|
419
|
+
https://github.com/xeno-js/xeno-shared
|
|
420
|
+
|
|
421
|
+
Vue:
|
|
422
|
+
|
|
423
|
+
https://github.com/xeno-js/xeno-fe
|
|
424
|
+
|
|
425
|
+
---
|
|
426
|
+
|
|
427
|
+
# Contributing
|
|
428
|
+
|
|
429
|
+
Contributions are welcome.
|
|
430
|
+
|
|
431
|
+
Development happens from feature branches targeting `develop`.
|
|
432
|
+
|
|
433
|
+
```bash
|
|
434
|
+
git checkout develop
|
|
435
|
+
git pull origin develop
|
|
436
|
+
git checkout -b feat/your-feature
|
|
437
|
+
|
|
438
|
+
npm install
|
|
439
|
+
npm run check
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
Before opening a pull request:
|
|
443
|
+
|
|
444
|
+
```bash
|
|
445
|
+
npm run check
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
We use Conventional Commits:
|
|
449
|
+
|
|
450
|
+
```text
|
|
451
|
+
feat(cli): add generator
|
|
452
|
+
fix(generator): correct scaffold output
|
|
453
|
+
refactor(dispatcher): simplify command dispatch
|
|
454
|
+
docs(readme): improve getting started
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
---
|
|
458
|
+
|
|
459
|
+
# License
|
|
460
|
+
|
|
461
|
+
MIT License. See `LICENSE`.
|