create-substrat 0.3.0 → 0.4.1

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 (3) hide show
  1. package/README.md +45 -11
  2. package/index.js +4 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,25 +1,59 @@
1
1
  # create-substrat
2
2
 
3
- Reserves `npm create substrat` for the Substrat initializer.
3
+ Scaffold a [Substrat](https://substrat.net) vertical.
4
4
 
5
- **The initializer is not released yet.** This package prints a pointer to the docs and
6
- exits. It does not scaffold anything, because a stub that pretended to would be worse than
7
- nothing.
5
+ ```sh
6
+ npm create substrat <dir>
7
+ npm create substrat . # scaffold into the current directory
8
+ ```
9
+
10
+ **Full documentation: https://substrat.net/reference/create-substrat**
11
+
12
+ ## What you get
13
+
14
+ A project that installs and runs, plus an **instruction layer** so your AI editor already
15
+ knows the rules and the build flow:
16
+
17
+ - `src/` — `manifest.ts`, `migrations.ts`, `module.ts`, `provision.ts`, `seed.ts`, a Node
18
+ `server.ts` for local work, and a `worker.ts` that mounts the platform surface via
19
+ [`@substrat-run/vertical-host`](https://npmjs.com/package/@substrat-run/vertical-host).
20
+ - `test/scenario.test.ts` — the scenario test the build flow grows.
21
+ - `AGENTS.md` + `.substrat/playbook.md` — the rules and the build flow, read by Claude Code,
22
+ Cursor, and opencode alike; each gets its own command stub.
23
+ - Generated `package.json`, `tsconfig.json`, `vitest.config.ts`, `.gitignore`, `README.md`,
24
+ including the `substrat` block that `substrat push` reads — so you never author wrangler
25
+ config.
8
26
 
9
- To start a vertical today, follow the [getting started guide](https://substrat.net/guide/getting-started).
10
- The packages are published and usable:
27
+ The scaffolder writes the skeleton; **the agent writes the vertical**, guided by the playbook.
11
28
 
12
29
  ```sh
13
- pnpm add @substrat-run/kernel @substrat-run/contracts @substrat-run/adapter-sqlite zod
30
+ cd <dir> && pnpm install
31
+ # then, in your AI editor:
32
+ # Claude Code: /substrat
33
+ # Cursor / opencode: the new-vertical command
14
34
  ```
15
35
 
36
+ ## Don't add `zod`
37
+
38
+ Substrat is on Zod 4, and Zod schemas do not compose across copies or majors — mixing two
39
+ makes `z.object({ facility: entityRef })` fail at runtime with `expected a Zod schema`,
40
+ pointing nowhere near the cause. Import `z` from contracts instead, and never install zod:
41
+
42
+ ```ts
43
+ import { z, entityRef, money } from '@substrat-run/contracts';
44
+ ```
45
+
46
+ ## Dependency-free by design
47
+
48
+ Node built-ins only, no build step. It can never break at install time and damage the name it
49
+ exists to protect.
50
+
16
51
  ## Note on the name
17
52
 
18
53
  `substrat` on npm is an **unrelated** package — an HTML5 build system published in 2013.
19
- Substrat's own packages are all under the [`@substrat-run`](https://www.npmjs.com/org/substrat-run)
20
- scope. Never `npm install substrat`.
54
+ Substrat's own packages are all under the
55
+ [`@substrat-run`](https://www.npmjs.com/org/substrat-run) scope. Never `npm install substrat`.
21
56
 
22
57
  ---
23
58
 
24
- [Docs](https://substrat.net) · [Repo](https://github.com/substrat-run/substrat) ·
25
- Apache-2.0
59
+ [Docs](https://substrat.net) · [Repo](https://github.com/substrat-run/substrat) · Apache-2.0
package/index.js CHANGED
@@ -99,12 +99,12 @@ function packageJson(name) {
99
99
  '@substrat-run/engine-invoicing': ENGINES,
100
100
  hono: '^4.6.0',
101
101
  '@hono/node-server': '^1.13.0',
102
- 'better-sqlite3': '^12.0.0',
102
+ 'better-sqlite3': '^13.0.3',
103
103
  },
104
104
  devDependencies: {
105
105
  '@substrat-run/boundary-lint': BOUNDARY_LINT,
106
106
  '@cloudflare/workers-types': '^4.20250109.0',
107
- '@types/better-sqlite3': '^7.6.0',
107
+ '@types/better-sqlite3': '^9.6.0',
108
108
  '@types/node': '^22.0.0',
109
109
  concurrently: '^9.0.0',
110
110
  tsx: '^4.19.0',
@@ -112,7 +112,8 @@ function packageJson(name) {
112
112
  vitest: '^3.0.0',
113
113
  },
114
114
  // Do NOT add `zod` here — import `z` from `@substrat-run/contracts` (AGENTS.md, rule 10).
115
- pnpm: { onlyBuiltDependencies: ['better-sqlite3'] },
115
+ // better-sqlite3 >=13 ships prebuilt binaries for every supported platform and
116
+ // declares no install script, so it needs no build allowlist entry.
116
117
  },
117
118
  null,
118
119
  2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-substrat",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Scaffold a Substrat vertical — `npm create substrat <dir>`.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {