create-holon 0.1.0 → 0.1.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/LICENSE.md +1 -1
- package/index.mjs +16 -16
- package/package.json +4 -4
- package/template/README.md +11 -11
- package/template/nomos.package.mjs +3 -6
- package/template/package.json +3 -3
package/LICENSE.md
CHANGED
|
@@ -12,7 +12,7 @@ with it; we keep the rest for now.
|
|
|
12
12
|
authorizes;
|
|
13
13
|
- build, run, and ship applications on top of them — including commercial ones;
|
|
14
14
|
- keep everything that's yours: code you write, and everything these tools
|
|
15
|
-
generate FOR you (scaffolds from `create-
|
|
15
|
+
generate FOR you (scaffolds from `create-githolon` / `githolon generate`, generated
|
|
16
16
|
clients, compiled domain packages) carries NO restriction from us — it is
|
|
17
17
|
yours outright.
|
|
18
18
|
|
package/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// `npm create
|
|
2
|
+
// `npm create githolon <dir>` — scaffold a Nomos domain package (the starter
|
|
3
3
|
// guestbook domain + compile config + live e2e) into <dir> and init it as a
|
|
4
|
-
// git repo. The holon itself is MINTED LOCALLY after compile (`
|
|
4
|
+
// git repo. The holon itself is MINTED LOCALLY after compile (`githolon ledger
|
|
5
5
|
// init holon` — genesis + your law under YOUR identity, verified by the same
|
|
6
6
|
// wasm gate the cloud runs), so it is yours from the first byte. Plain node,
|
|
7
7
|
// zero dependencies; the heavy lifting (compile, codegen, the engine) lives in
|
|
8
|
-
// @githolon/dsl and
|
|
8
|
+
// @githolon/dsl and githolon and arrives with the scaffold's `npm install`.
|
|
9
9
|
//
|
|
10
10
|
// Everything scaffolded here belongs to the user — see LICENSE.md ("You may /
|
|
11
11
|
// keep everything that's yours").
|
|
@@ -19,11 +19,11 @@ const TEMPLATE = path.join(path.dirname(fileURLToPath(import.meta.url)), "templa
|
|
|
19
19
|
const args = process.argv.slice(2);
|
|
20
20
|
if (args.includes("-h") || args.includes("--help")) {
|
|
21
21
|
process.stdout.write(
|
|
22
|
-
"create-
|
|
23
|
-
"Usage:\n npm create
|
|
22
|
+
"create-githolon — scaffold a Nomos domain package\n\n" +
|
|
23
|
+
"Usage:\n npm create githolon <dir> (or: npx create-githolon <dir>)\n\n" +
|
|
24
24
|
"Scaffolds the starter domain + compile config + live e2e into <dir>\n" +
|
|
25
|
-
"(default: my-holon-app) and inits a git repo. After `
|
|
26
|
-
"`
|
|
25
|
+
"(default: my-holon-app) and inits a git repo. After `githolon compile`,\n" +
|
|
26
|
+
"`githolon ledger init holon` mints YOUR holon locally — verified by the\n" +
|
|
27
27
|
"same wasm gate the cloud runs, ready to birth by git push.\n\n" +
|
|
28
28
|
"Flags:\n --no-git skip git init\n",
|
|
29
29
|
);
|
|
@@ -39,12 +39,12 @@ const appName = path
|
|
|
39
39
|
.replace(/[^a-z0-9-_.]+/g, "-")
|
|
40
40
|
.replace(/^[-_.]+|[-_.]+$/g, "");
|
|
41
41
|
if (!appName) {
|
|
42
|
-
console.error(`create-
|
|
42
|
+
console.error(`create-githolon: '${path.basename(targetDir)}' does not reduce to a valid package name`);
|
|
43
43
|
process.exit(1);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
if (existsSync(targetDir) && readdirSync(targetDir).length > 0) {
|
|
47
|
-
console.error(`create-
|
|
47
|
+
console.error(`create-githolon: refusing to scaffold into non-empty directory: ${targetDir}`);
|
|
48
48
|
process.exit(1);
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -69,8 +69,8 @@ if (!noGit) {
|
|
|
69
69
|
if (gitInited) {
|
|
70
70
|
git(["add", "-A"]);
|
|
71
71
|
// Identity fallback keeps the initial commit working on unconfigured machines.
|
|
72
|
-
git(["commit", "-m", "scaffold: create-
|
|
73
|
-
git(["-c", "user.name=create-
|
|
72
|
+
git(["commit", "-m", "scaffold: create-githolon starter"]) ||
|
|
73
|
+
git(["-c", "user.name=create-githolon", "-c", "user.email=create-githolon@nomos", "commit", "-m", "scaffold: create-githolon starter"]);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -80,10 +80,10 @@ process.stdout.write(
|
|
|
80
80
|
`\nNext:\n` +
|
|
81
81
|
` cd ${rel}\n` +
|
|
82
82
|
` npm install\n` +
|
|
83
|
-
` npx
|
|
84
|
-
` npx
|
|
83
|
+
` npx githolon compile # → build/: deployable package + manifests + typed client\n` +
|
|
84
|
+
` npx githolon login --agent # a verified identity, no browser\n\n` +
|
|
85
85
|
`Then pick a path (README.md walks both):\n` +
|
|
86
|
-
` A) npx
|
|
87
|
-
` B) npx
|
|
88
|
-
` cd holon && npx
|
|
86
|
+
` A) npx githolon ws create <ws> && npx githolon deploy <ws>\n` +
|
|
87
|
+
` B) npx githolon ledger init holon # YOUR holon, minted + verified LOCALLY\n` +
|
|
88
|
+
` cd holon && npx githolon git remote <ws> && git push nomos main\n`,
|
|
89
89
|
);
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-holon",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Scaffold a Nomos domain package: the starter domain + compile config + live e2e. `npm create
|
|
5
|
+
"description": "Scaffold a Nomos domain package: the starter domain + compile config + live e2e. `npm create githolon my-app`.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/Captain-App/nomos2.git",
|
|
10
|
-
"directory": "create-
|
|
10
|
+
"directory": "create-githolon"
|
|
11
11
|
},
|
|
12
12
|
"bin": {
|
|
13
|
-
"create-
|
|
13
|
+
"create-githolon": "./index.mjs"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"index.mjs",
|
package/template/README.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
# __APP_NAME__ — a Nomos domain package
|
|
2
2
|
|
|
3
|
-
Scaffolded by `npm create
|
|
3
|
+
Scaffolded by `npm create githolon`. One domain file, one config, one command —
|
|
4
4
|
then an offline-first typed client against Nomos Cloud. Two ways to get a live
|
|
5
5
|
workspace; both end in the same place.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install
|
|
9
|
-
npx
|
|
10
|
-
npx
|
|
9
|
+
npx githolon compile # → build/: deployable package + manifests + typed client
|
|
10
|
+
npx githolon login --agent # self-onboard a verified identity (no browser; linkable to a full account later)
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Path A — deploy your law
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npx
|
|
17
|
-
npx
|
|
16
|
+
npx githolon ws create <ws> # births a fresh workspace on your identity; SAVES its one-time secret to ~/.holon
|
|
17
|
+
npx githolon deploy <ws> # POSTs build/guestbook.deploy.json with the stored secret
|
|
18
18
|
npm run e2e # the full loop, live: offline write → sync → admission → cloud query
|
|
19
19
|
```
|
|
20
20
|
|
|
@@ -30,24 +30,24 @@ from genesis and re-derive your exact verdict (same head, same plans re-run)
|
|
|
30
30
|
before serving anything. Authority lives in the git; no holon outranks another.
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
npx
|
|
34
|
-
npx
|
|
33
|
+
npx githolon ledger init holon # mint + assert locally: chain VALID, head <h>, under YOUR uid
|
|
34
|
+
npx githolon ledger verify holon # re-assert any time
|
|
35
35
|
cd holon
|
|
36
|
-
npx
|
|
36
|
+
npx githolon git remote <ws> # wires the remote + credential helper; mints + stores the owner secret
|
|
37
37
|
git push nomos main # the upload birth — the cloud re-derives the verdict, byte-identical adoption
|
|
38
|
-
npx
|
|
38
|
+
npx githolon deploy <ws> # idempotent (alreadyInstalled) + stages the read manifests so queries route
|
|
39
39
|
cd ..
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
After birth, `holon/` tracks YOUR workspace: new writes admitted on main arrive
|
|
43
|
-
with `git pull`. (`
|
|
43
|
+
with `git pull`. (`githolon git setup` installed a git credential helper, so plain
|
|
44
44
|
git just works against the cloud.)
|
|
45
45
|
|
|
46
46
|
## What's here
|
|
47
47
|
|
|
48
48
|
- `domains/guestbook.ts` — the starter domain (the law): one aggregate, two
|
|
49
49
|
directives, a declared query, a derived field, a count. Rename it, reshape
|
|
50
|
-
it, or add domains with `npx
|
|
50
|
+
it, or add domains with `npx githolon generate domain <name>`.
|
|
51
51
|
- `nomos.package.mjs` — the compile config (module list per domain key; reads
|
|
52
52
|
are auto-discovered from exports).
|
|
53
53
|
- `build/guestbook.client.ts` — GENERATED typed TS client (payload types from
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
// The
|
|
1
|
+
// The holon-compile config: one package, one domain, one module file.
|
|
2
2
|
// Read-side declarations (queries/counts/...) are auto-discovered from the
|
|
3
3
|
// module's exports by shape — nothing to wire here.
|
|
4
|
+
// Building a Flutter app too? Add `dart: true` for the typed Dart frontend
|
|
5
|
+
// (build/dart/) alongside the TS client.
|
|
4
6
|
export default {
|
|
5
7
|
name: "guestbook",
|
|
6
8
|
domains: [{ key: "guestbook", modules: ["./domains/guestbook.ts"] }],
|
|
7
|
-
// Typed Dart frontend (the Flutter sibling of build/guestbook.client.ts):
|
|
8
|
-
// build/dart/guestbook.dart + the vendored nomos_dsl support files. A Flutter
|
|
9
|
-
// app vendors the build/dart/ directory as-is. `dart: { out: "some/dir" }`
|
|
10
|
-
// overrides the destination.
|
|
11
|
-
dart: true,
|
|
12
9
|
};
|
package/template/package.json
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"version": "0.0.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"description": "A Nomos domain package — authored in @githolon/dsl, compiled with `
|
|
6
|
+
"description": "A Nomos domain package — authored in @githolon/dsl, compiled with `githolon compile`, deployed to Nomos Cloud with one POST.",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"compile": "
|
|
8
|
+
"compile": "githolon compile",
|
|
9
9
|
"e2e": "tsx test/e2e.mts",
|
|
10
10
|
"typecheck": "tsc --noEmit"
|
|
11
11
|
},
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"zod": "^4.4.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"
|
|
18
|
+
"githolon": "^0.1.2",
|
|
19
19
|
"@types/node": "^25.9.2",
|
|
20
20
|
"tsx": "^4.19.2",
|
|
21
21
|
"typescript": "^5.6.3"
|