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.
- package/README.md +45 -11
- package/index.js +4 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,25 +1,59 @@
|
|
|
1
1
|
# create-substrat
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Scaffold a [Substrat](https://substrat.net) vertical.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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': '^
|
|
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': '^
|
|
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
|
-
|
|
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,
|