@dforge-core/dforge-cli 0.1.0-rc.3 → 0.1.0-rc.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/README.md +53 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -17,9 +17,7 @@ macOS arm64/x64, Linux x64/arm64, Windows x64/arm64.
|
|
|
17
17
|
## Commands
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
# Scaffold a new module interactively (
|
|
21
|
-
# preset/initial entity). Generates manifest with a real UUID, writes the
|
|
22
|
-
# minimum file set so the module installs cleanly.
|
|
20
|
+
# Scaffold a new module interactively (see `Scaffolding a new module` below).
|
|
23
21
|
dforge-cli init module ./my-module
|
|
24
22
|
|
|
25
23
|
# Package a module directory into a .dforge archive
|
|
@@ -41,6 +39,58 @@ DFORGE_URL=https://app.example.com DFORGE_TOKEN=<jwt> \
|
|
|
41
39
|
dforge-cli dbml-import --from-dbml ./schema.dbml
|
|
42
40
|
```
|
|
43
41
|
|
|
42
|
+
## Scaffolding a new module
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
dforge-cli init module ./my-module
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Walks you through an interactive setup and writes a fresh module that's
|
|
49
|
+
ready to `pack` and `install`.
|
|
50
|
+
|
|
51
|
+
### What it asks
|
|
52
|
+
|
|
53
|
+
| Prompt | Default | Notes |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| Module code | (none) | `^[a-z][a-z0-9_-]*$` — becomes the DB schema name and `module_cd` |
|
|
56
|
+
| Display name | titlecased `code` | shown in the UI |
|
|
57
|
+
| Description | (empty) | optional |
|
|
58
|
+
| Author name | `git config user.name` | optional |
|
|
59
|
+
| License | `MIT` | |
|
|
60
|
+
| Version | `0.1.0` | semver |
|
|
61
|
+
| DB schema version | `0.0.1` | bumped when you alter physical columns |
|
|
62
|
+
| Dependencies | `admin`, `metadata` | toggle which system modules you depend on |
|
|
63
|
+
| Preset | Minimal | see below |
|
|
64
|
+
| First entity name | (none) | `^[a-z][a-z0-9_]*$` — table/entity code |
|
|
65
|
+
| First entity label | titlecased name | display label |
|
|
66
|
+
| Traits | `identity + audit` | see below |
|
|
67
|
+
|
|
68
|
+
`moduleId` (the immutable UUID) is auto-generated with `crypto.randomUUID()` — no prompt.
|
|
69
|
+
|
|
70
|
+
### Presets
|
|
71
|
+
|
|
72
|
+
- **Minimal** — manifest + one entity + minimum UI (`data_views`, `folders`, `menus`, `actions`) + one admin role. ~8 files. Installs as-is; you add fields/views/roles from there.
|
|
73
|
+
- **Minimal + add more entities interactively** — same as Minimal, then loops to add additional entities (name + label + traits per entity) so you don't have to re-run.
|
|
74
|
+
- **Full template** — Minimal plus `settings.json`, `translations/en-US.json`, a `seed-data/01-<entity>.json` per entity, and a `logic/actions/` stub directory. Use this when you want the typical optional files scaffolded for you to fill in (or delete).
|
|
75
|
+
|
|
76
|
+
### Entity traits
|
|
77
|
+
|
|
78
|
+
The "traits" choice controls which built-in columns the entity gets for free — both rendered by the platform, no need to declare in `fields`:
|
|
79
|
+
|
|
80
|
+
- **identity only** — primary key only. Use for lookup tables that don't need audit columns.
|
|
81
|
+
- **identity + audit** (recommended) — primary key + `created_date` + `last_updated` + `created_by` + `last_updated_by`. Standard for any business entity.
|
|
82
|
+
|
|
83
|
+
You can change traits later by editing the entity JSON.
|
|
84
|
+
|
|
85
|
+
### After scaffold
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
cd ./my-module
|
|
89
|
+
dforge-cli module install --path . --code <tenant> # full validation + install
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The first install runs the full server-side validator (manifest, FK targets, package-filter SQL, migration safety) — fix anything it flags, then re-run.
|
|
93
|
+
|
|
44
94
|
## Auth
|
|
45
95
|
|
|
46
96
|
The remote `module install --url` and `marketplace publish` flows need a JWT
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dforge-core/dforge-cli",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
4
|
-
"description": "dForge CLI
|
|
3
|
+
"version": "0.1.0-rc.4",
|
|
4
|
+
"description": "dForge CLI - validate, pack, publish, and install dForge modules. Distributes a single-file native binary per platform via optionalDependencies (esbuild-style).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/iash44/dForge-core",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/dforge-core/dforge-cli.git"
|
|
9
|
+
"url": "git+https://github.com/dforge-core/dforge-cli.git"
|
|
10
10
|
},
|
|
11
11
|
"bin": {
|
|
12
12
|
"dforge-cli": "dist/cli.js"
|