create-substrat 0.4.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/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
|