create-oke 0.6.0 → 0.7.0
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 +23 -8
- package/package.json +3 -3
- package/src/ai-setup/apply.ts +214 -0
- package/src/ai-setup/catalog.ts +263 -0
- package/src/ai-setup/detect-ollama.ts +180 -0
- package/src/ai-setup/from-pref.ts +99 -0
- package/src/ai-setup/prompts.ts +649 -0
- package/src/ai-setup/recommend.ts +203 -0
- package/src/cli.test.ts +385 -28
- package/src/cli.ts +332 -29
- package/src/create-defaults.test.ts +92 -0
- package/src/create-defaults.ts +246 -0
- package/src/customize-flow.test.ts +82 -0
- package/src/customize-flow.ts +432 -0
- package/src/drivers-catalog.ts +217 -0
- package/src/scaffold.ts +97 -10
- package/src/templates.ts +14 -9
- package/src/transform.test.ts +105 -0
- package/src/transform.ts +227 -0
- package/src/wizard-select.ts +50 -0
- package/{template → templates/advanced}/.env.example +40 -2
- package/templates/advanced/README.md +32 -0
- package/templates/advanced/oke.config.ts +74 -0
- package/templates/advanced/package.json +18 -0
- package/templates/advanced/src/app.ts +30 -0
- package/templates/advanced/src/channels.ts +13 -0
- package/templates/advanced/src/core.ts +8 -0
- package/{template → templates/advanced}/src/flows/main/index.ts +9 -6
- package/templates/advanced/src/flows/main/shapes.ts +1 -0
- package/templates/advanced/src/flows/main/signals.ts +1 -0
- package/templates/advanced/src/flows/notes/index.ts +224 -0
- package/templates/advanced/src/flows/notes/shapes.ts +52 -0
- package/templates/advanced/src/flows/notes/signals.ts +13 -0
- package/templates/advanced/src/gates.ts +12 -0
- package/templates/advanced/src/locales/ar.ts +18 -0
- package/templates/advanced/src/locales/en.ts +22 -0
- package/templates/advanced/src/schema.decl.ts +13 -0
- package/templates/advanced/src/vault.ts +7 -0
- package/templates/advanced/tests/advanced.test.ts +42 -0
- package/templates/standard/.env.example +94 -0
- package/templates/standard/README.md +46 -0
- package/templates/standard/drizzle.config.ts +25 -0
- package/{template → templates/standard}/oke.config.ts +9 -9
- package/{template → templates/standard}/package.json +1 -1
- package/templates/standard/src/app.ts +30 -0
- package/templates/standard/src/channels.ts +13 -0
- package/{template → templates/standard}/src/core.ts +1 -0
- package/templates/standard/src/flows/main/index.ts +34 -0
- package/templates/standard/src/flows/main/shapes.ts +1 -0
- package/templates/standard/src/flows/main/signals.ts +1 -0
- package/templates/standard/src/flows/notes/index.ts +143 -0
- package/templates/standard/src/flows/notes/shapes.ts +26 -0
- package/templates/standard/src/flows/notes/signals.ts +13 -0
- package/templates/standard/src/gates.ts +12 -0
- package/templates/standard/src/locales/ar.ts +18 -0
- package/templates/standard/src/locales/en.ts +22 -0
- package/templates/standard/src/schema.decl.ts +13 -0
- package/templates/standard/src/vault.ts +7 -0
- package/templates/standard/tests/standard.test.ts +51 -0
- package/template/README.md +0 -77
- package/template/bun.lock +0 -845
- package/template/src/app.ts +0 -18
- package/template/src/channels.ts +0 -4
- package/template/src/flows/main/shapes.ts +0 -2
- package/template/src/flows/main/signals.ts +0 -4
- package/template/src/gates.ts +0 -4
- package/template/src/locales/ar.ts +0 -20
- package/template/src/locales/en.ts +0 -26
- package/template/src/schema.decl.ts +0 -12
- package/template/src/vault.ts +0 -4
- package/template/tests/standard.test.ts +0 -18
- /package/{template → templates/advanced}/drizzle.config.ts +0 -0
package/template/README.md
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# standard
|
|
2
|
-
|
|
3
|
-
Full recommended file layout with **empty scaffolding** — structure without
|
|
4
|
-
business logic. Default `create-oke` template.
|
|
5
|
-
|
|
6
|
-
## Run
|
|
7
|
-
|
|
8
|
-
```bash
|
|
9
|
-
bun install
|
|
10
|
-
oke dev # app :6530 · Console :6533 · MCP :6535
|
|
11
|
-
# or: oke mode docker && oke dev # postgres · redis · Mailpit · RustFS · OpenBao
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
Local `oke dev` auto-runs `oke db push` when `schema.decl.ts` changes (opt out:
|
|
15
|
-
`--no-db-push`). Docker/prod never auto-apply DDL — use `oke db migrate`.
|
|
16
|
-
|
|
17
|
-
| Port | Try |
|
|
18
|
-
| ------- | ------------------------- |
|
|
19
|
-
| `:6530` | `GET /` · `GET /health` |
|
|
20
|
-
| `:6533` | Console |
|
|
21
|
-
| `:6535` | MCP |
|
|
22
|
-
|
|
23
|
-
## What’s in this template
|
|
24
|
-
|
|
25
|
-
```text
|
|
26
|
-
standard/
|
|
27
|
-
├── .env.example # copied to .env.local by create-oke
|
|
28
|
-
├── drizzle.config.ts # oke db push|generate|migrate
|
|
29
|
-
├── oke.config.ts # local: sqlite · docker/prod: postgres
|
|
30
|
-
├── src/
|
|
31
|
-
│ ├── app.ts # adopt({ main }); wires stores + side modules
|
|
32
|
-
│ ├── core.ts / schema.decl.ts # Store (replace the placeholder table)
|
|
33
|
-
│ ├── gates.ts # Gate stubs
|
|
34
|
-
│ ├── vault.ts # Vault stubs
|
|
35
|
-
│ ├── channels.ts # Channel stubs
|
|
36
|
-
│ ├── locales/en.ts · ar.ts # i18n stubs
|
|
37
|
-
│ └── flows/main/
|
|
38
|
-
│ ├── index.ts # GET / · GET /health
|
|
39
|
-
│ ├── shapes.ts # contracts live next to flows
|
|
40
|
-
│ └── signals.ts # Signal stubs
|
|
41
|
-
└── tests/standard.test.ts
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
- **Elements stubbed:** Flow · Store · Signal · Gate · Vault · Channel (+ locales)
|
|
45
|
-
- **Unit:** `main`
|
|
46
|
-
- **Flows to replace:** `root`, `health` — delete or rename once your domain exists
|
|
47
|
-
|
|
48
|
-
Fill `schema.decl.ts` (abstract tables → `oke db` emits `schema.generated.ts`
|
|
49
|
-
for the active dialect), then add real flows under
|
|
50
|
-
`src/flows/<unit>/`.
|
|
51
|
-
|
|
52
|
-
## Docker mode (`oke dev --docker`)
|
|
53
|
-
|
|
54
|
-
Closest to production protocols: Postgres, Redis, SMTP (Mailpit), S3 (RustFS),
|
|
55
|
-
and a real OpenBao vault (durable Raft storage, real init/unseal — not a
|
|
56
|
-
`-dev` server). Compose credentials land in `docker/.env.docker`.
|
|
57
|
-
|
|
58
|
-
On first `oke dev --docker` / `oke docker --prod` bring-up, `oke` initializes
|
|
59
|
-
OpenBao, unseals it, and mints a least-privilege token for the app. The root
|
|
60
|
-
token and the single unseal key stay on the host under `.oke/openbao/`
|
|
61
|
-
(`0600`, gitignored) — never in `docker/.env.docker`, never in YAML.
|
|
62
|
-
|
|
63
|
-
> **Single point of failure by design:** back up `.oke/openbao/unseal.key` to
|
|
64
|
-
> a separate safe location. Losing it means losing every secret permanently,
|
|
65
|
-
> with no recovery.
|
|
66
|
-
|
|
67
|
-
Host ports are unique per project so multiple apps can run at once. Use
|
|
68
|
-
`oke stack` or the `oke dev` Docker summary for the Mailpit UI and RustFS
|
|
69
|
-
console URLs — do not assume `:8025` / `:9001`.
|
|
70
|
-
|
|
71
|
-
`docker/.env.docker` uses protocol-native keys (`DATABASE_URL`, `REDIS_URL`,
|
|
72
|
-
`S3_*`, `SMTP_*`, `MAILPIT_UI_URL`) and includes commented optional controls.
|
|
73
|
-
Supported controls you uncomment are preserved when the generated stack refreshes.
|
|
74
|
-
|
|
75
|
-
## Agent contract
|
|
76
|
-
|
|
77
|
-
See [`AGENTS.md`](./AGENTS.md). Handbook: [oke.omqkhafi.dev/docs](https://oke.omqkhafi.dev/docs)
|