create-oke 0.3.6 → 0.5.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/package.json
CHANGED
package/template/oke.config.ts
CHANGED
|
@@ -55,6 +55,10 @@ export default defineConfig({
|
|
|
55
55
|
"store.files": "rustfs/rustfs:1.0.0-beta.11",
|
|
56
56
|
"channel.email": "axllent/mailpit:v1.22.3",
|
|
57
57
|
vault: "openbao/openbao:2.6.1",
|
|
58
|
+
// Opt in to full-text search (meilisearch store.index driver):
|
|
59
|
+
// drivers.store.index: { local: "meilisearch", docker: "meilisearch", test: "memory", prod: "meilisearch" }
|
|
60
|
+
// and pin its image. Local mode then needs the `meilisearch` binary on PATH.
|
|
61
|
+
// "store.index": "getmeili/meilisearch:v1.37",
|
|
58
62
|
},
|
|
59
63
|
i18n: { locales: ["en", "ar"], default: "en", dir: { ar: "rtl" } },
|
|
60
64
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { on, flow, http } from "okengine";
|
|
1
|
+
import { on, flow, http, gate } from "okengine";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
import "./shapes";
|
|
@@ -6,7 +6,7 @@ import "./signals";
|
|
|
6
6
|
|
|
7
7
|
/** First-run welcome — visit :6530/ after `oke dev`. */
|
|
8
8
|
export const root = on(
|
|
9
|
-
http.get("/"),
|
|
9
|
+
http.get("/").gate(gate.public),
|
|
10
10
|
flow({
|
|
11
11
|
out: z.object({
|
|
12
12
|
ok: z.literal(true),
|
|
@@ -23,7 +23,7 @@ export const root = on(
|
|
|
23
23
|
|
|
24
24
|
/** Replace with your unit's flows. */
|
|
25
25
|
export const health = on(
|
|
26
|
-
http.get("/health"),
|
|
26
|
+
http.get("/health").gate(gate.public),
|
|
27
27
|
flow({
|
|
28
28
|
out: z.object({ ok: z.literal(true) }),
|
|
29
29
|
do: () => ({ ok: true as const }),
|
|
@@ -8,3 +8,11 @@ test("boots — health flow", async () => {
|
|
|
8
8
|
expect(error).toBeNull();
|
|
9
9
|
expect(data).toEqual({ ok: true });
|
|
10
10
|
});
|
|
11
|
+
|
|
12
|
+
/** Flag-free `app.fetch` must auto-boot (gate posture + element pipeline). */
|
|
13
|
+
test("bare fetch auto-boots the public health route", async () => {
|
|
14
|
+
const res = await app.fetch(new Request("http://localhost/health"));
|
|
15
|
+
expect(res.status).toBe(200);
|
|
16
|
+
expect(app.booted).toBe(true);
|
|
17
|
+
expect(await res.json()).toEqual({ data: { ok: true }, error: null });
|
|
18
|
+
});
|