@sculptor/cli 0.2.1 → 0.2.2
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 +37 -4
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -10,6 +10,12 @@ It handles:
|
|
|
10
10
|
- Dev and production startup paths
|
|
11
11
|
- Help and version output
|
|
12
12
|
|
|
13
|
+
## Version Policy
|
|
14
|
+
|
|
15
|
+
- Deprecated range: `0.2.0` through `0.2.1`
|
|
16
|
+
- Current stable: `0.2.2`
|
|
17
|
+
- Reason: the earlier release predates the current template-registry layout, the `sc config` command set, and the route/handler generation contract used by the current CLI.
|
|
18
|
+
|
|
13
19
|
## Quick Command Sheet
|
|
14
20
|
|
|
15
21
|
| Command | What it does |
|
|
@@ -20,8 +26,12 @@ It handles:
|
|
|
20
26
|
| `sc build` | Builds the app |
|
|
21
27
|
| `sc lint` | Lints the app |
|
|
22
28
|
| `sc test` | Runs the test suite |
|
|
29
|
+
| `sc config get <path>` | Reads a config value |
|
|
30
|
+
| `sc config set <path=value>` | Writes a config value |
|
|
31
|
+
| `sc config list` | Lists the merged config |
|
|
23
32
|
| `sc generate` / `sc g` | Generates framework resources |
|
|
24
33
|
| `sc g c user` | Generates a controller resource |
|
|
34
|
+
| `sc g r user` | Generates a functional route and handler pair |
|
|
25
35
|
| `sc g c user in src/app/users` | Generates into a custom path |
|
|
26
36
|
| `sc g c in src/app/users` | Infers the name from the path and generates there |
|
|
27
37
|
| `sc g t user -e` | Generates an enum type file |
|
|
@@ -187,6 +197,24 @@ Behavior:
|
|
|
187
197
|
What it solves:
|
|
188
198
|
- You can keep a generated test registry while still having a standard test command
|
|
189
199
|
|
|
200
|
+
### `sc config`
|
|
201
|
+
|
|
202
|
+
What it does:
|
|
203
|
+
- Reads, writes, and lists app config
|
|
204
|
+
|
|
205
|
+
How it is used:
|
|
206
|
+
```bash
|
|
207
|
+
sc config get logging
|
|
208
|
+
sc config set logging.dogMode=false
|
|
209
|
+
sc config list
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Behavior:
|
|
213
|
+
- `get` reads a dot-path from the merged config
|
|
214
|
+
- `set` writes a dot-path assignment while preserving JSON formatting when possible
|
|
215
|
+
- `list` prints the flattened merged config
|
|
216
|
+
- `sculptor` supports the same command set as `sc`
|
|
217
|
+
|
|
190
218
|
### `sc generate` and `sc g`
|
|
191
219
|
|
|
192
220
|
What it does:
|
|
@@ -211,7 +239,8 @@ Supported kinds:
|
|
|
211
239
|
|
|
212
240
|
Behavior:
|
|
213
241
|
- Refuses to run outside a Sculptor app root
|
|
214
|
-
-
|
|
242
|
+
- Controller generation is controller-first by default and can opt into paired functional route files with `--functional`
|
|
243
|
+
- Route generation always writes the paired functional route and handler files
|
|
215
244
|
- Rewrites the test registry when test generation is enabled
|
|
216
245
|
|
|
217
246
|
What it solves:
|
|
@@ -291,6 +320,7 @@ sc --version
|
|
|
291
320
|
| Flag | Meaning |
|
|
292
321
|
| --- | --- |
|
|
293
322
|
| `--functional` | Use functional routing mode |
|
|
323
|
+
| `--with-routes` | Alias for paired functional route generation |
|
|
294
324
|
| `--decorator` | Use decorator routing mode |
|
|
295
325
|
| `--hybrid` | Use hybrid routing mode |
|
|
296
326
|
| `--style` | Explicitly set routing mode |
|
|
@@ -307,9 +337,9 @@ sc --version
|
|
|
307
337
|
### Controller generation
|
|
308
338
|
|
|
309
339
|
What it does:
|
|
310
|
-
-
|
|
311
|
-
-
|
|
312
|
-
- In
|
|
340
|
+
- Writes `*.controller.ts` by default
|
|
341
|
+
- Pass `--functional` or `--with-routes` to also write paired `*.route.ts` and `*.route.handler.ts` files
|
|
342
|
+
- In functional-first app flows, the paired functional route files are the standard route shape
|
|
313
343
|
|
|
314
344
|
Examples:
|
|
315
345
|
```bash
|
|
@@ -317,6 +347,7 @@ sc generate controller user
|
|
|
317
347
|
sc g c user
|
|
318
348
|
sc g c user in src/app/users
|
|
319
349
|
sc g c in src/app/users
|
|
350
|
+
sc g c user --functional
|
|
320
351
|
```
|
|
321
352
|
|
|
322
353
|
If you use `in <path>`:
|
|
@@ -489,6 +520,8 @@ If you are inside a Sculptor app root, use:
|
|
|
489
520
|
```bash
|
|
490
521
|
sc dev
|
|
491
522
|
sc generate controller user
|
|
523
|
+
sc generate route user
|
|
524
|
+
sc config list
|
|
492
525
|
sc test
|
|
493
526
|
```
|
|
494
527
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sculptor/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sc": "./bin/sc.js",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
},
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@sculptor/config": "^0.2.
|
|
40
|
-
"@sculptor/core": "^0.2.
|
|
41
|
-
"@sculptor/template-registry": "^0.1.
|
|
39
|
+
"@sculptor/config": "^0.2.1",
|
|
40
|
+
"@sculptor/core": "^0.2.3",
|
|
41
|
+
"@sculptor/template-registry": "^0.1.5",
|
|
42
42
|
"tsx": "^4.19.4"
|
|
43
43
|
}
|
|
44
44
|
}
|