@dforge-core/dforge-cli 0.1.0-rc.5 → 0.1.0-rc.6

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.
Files changed (2) hide show
  1. package/README.md +36 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -91,6 +91,42 @@ dforge-cli module install --path . --code <tenant> # full validation + install
91
91
 
92
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
93
 
94
+ ### Programmatic use (subpath export)
95
+
96
+ The pure-TS builders behind `init module` are also exposed as a library entry, so downstream packages can compose module file maps without shelling to the CLI. Used by [`@dforge-core/dforge-mcp`](https://www.npmjs.com/package/@dforge-core/dforge-mcp) to drive AI-authored modules.
97
+
98
+ ```ts
99
+ import {
100
+ buildManifest,
101
+ buildEntity,
102
+ buildDataViews,
103
+ buildFolders,
104
+ buildMenus,
105
+ buildRoles,
106
+ } from "@dforge-core/dforge-cli/templates";
107
+ import type { ScaffoldOpts, EntitySpec } from "@dforge-core/dforge-cli/templates";
108
+ import { randomUUID } from "node:crypto";
109
+
110
+ const opts: ScaffoldOpts = {
111
+ path: "",
112
+ code: "smoke",
113
+ displayName: "Smoke",
114
+ description: "",
115
+ author: "",
116
+ license: "MIT",
117
+ version: "0.1.0",
118
+ dbSchemaVersion: "0.0.1",
119
+ dependencies: ["admin", "metadata"],
120
+ preset: "minimal",
121
+ entities: [{ name: "thing", label: "Thing", traits: "identity+audit" }],
122
+ };
123
+
124
+ const manifest = buildManifest(opts, randomUUID());
125
+ // → plain JS object, ready for JSON.stringify
126
+ ```
127
+
128
+ All builders are pure functions returning plain JS objects (no I/O). The subpath ships dual CJS + ESM + `.d.ts` types.
129
+
94
130
  ## Auth
95
131
 
96
132
  The remote `module install --url` and `marketplace publish` flows need a JWT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dforge-core/dforge-cli",
3
- "version": "0.1.0-rc.5",
3
+ "version": "0.1.0-rc.6",
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",