create-oke 0.1.4 → 0.2.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 (117) hide show
  1. package/README.md +55 -0
  2. package/{templates → examples}/linkly/package.json +1 -1
  3. package/{templates → examples}/notes/package.json +1 -1
  4. package/{templates → examples}/provisions/package.json +1 -1
  5. package/{templates → examples}/skyport/package.json +1 -1
  6. package/package.json +7 -3
  7. package/src/cli.test.ts +246 -18
  8. package/src/cli.ts +358 -32
  9. package/src/index.ts +9 -1
  10. package/src/scaffold.ts +50 -32
  11. package/src/sync-templates.ts +28 -7
  12. package/src/templates.ts +85 -12
  13. package/src/transform.ts +3 -2
  14. package/templates/full/oke.config.ts +23 -0
  15. package/templates/full/package.json +15 -0
  16. package/templates/full/src/ai.ts +11 -0
  17. package/templates/full/src/app.ts +34 -0
  18. package/templates/full/src/channels.ts +9 -0
  19. package/templates/full/src/core.ts +4 -0
  20. package/templates/full/src/flows/main/index.ts +27 -0
  21. package/templates/full/src/flows/main/shapes.ts +3 -0
  22. package/templates/full/src/flows/main/signals.ts +8 -0
  23. package/templates/full/src/gates.ts +4 -0
  24. package/templates/full/src/locales/ar.ts +3 -0
  25. package/templates/full/src/locales/en.ts +3 -0
  26. package/templates/full/src/schema.ts +8 -0
  27. package/templates/full/src/vault.ts +9 -0
  28. package/templates/full/tests/full.test.ts +11 -0
  29. package/templates/hello/README.md +13 -0
  30. package/templates/hello/oke.config.ts +3 -0
  31. package/templates/hello/package.json +14 -0
  32. package/templates/hello/src/app.ts +10 -0
  33. package/templates/hello/src/flows/hello/index.ts +10 -0
  34. package/templates/hello/tests/hello.test.ts +10 -0
  35. package/templates/minimal/oke.config.ts +7 -0
  36. package/templates/minimal/package.json +15 -0
  37. package/templates/minimal/src/app.ts +13 -0
  38. package/templates/minimal/src/core.ts +4 -0
  39. package/templates/minimal/src/flows/main/index.ts +32 -0
  40. package/templates/minimal/src/schema.ts +8 -0
  41. package/templates/minimal/tests/minimal.test.ts +13 -0
  42. package/templates/standard/oke.config.ts +19 -0
  43. package/templates/standard/package.json +15 -0
  44. package/templates/standard/src/app.ts +18 -0
  45. package/templates/standard/src/channels.ts +4 -0
  46. package/templates/standard/src/core.ts +4 -0
  47. package/templates/standard/src/flows/main/index.ts +14 -0
  48. package/templates/standard/src/flows/main/shapes.ts +2 -0
  49. package/templates/standard/src/flows/main/signals.ts +4 -0
  50. package/templates/standard/src/gates.ts +4 -0
  51. package/templates/standard/src/locales/ar.ts +2 -0
  52. package/templates/standard/src/locales/en.ts +2 -0
  53. package/templates/standard/src/schema.ts +9 -0
  54. package/templates/standard/src/vault.ts +4 -0
  55. package/templates/standard/tests/standard.test.ts +10 -0
  56. /package/{templates → examples}/linkly/oke.config.ts +0 -0
  57. /package/{templates → examples}/linkly/src/app.ts +0 -0
  58. /package/{templates → examples}/linkly/src/core.ts +0 -0
  59. /package/{templates → examples}/linkly/src/flows/analytics/index.ts +0 -0
  60. /package/{templates → examples}/linkly/src/flows/links/index.ts +0 -0
  61. /package/{templates → examples}/linkly/src/flows/links/shapes.ts +0 -0
  62. /package/{templates → examples}/linkly/src/flows/links/signals.ts +0 -0
  63. /package/{templates → examples}/linkly/src/gates.ts +0 -0
  64. /package/{templates → examples}/linkly/src/schema.ts +0 -0
  65. /package/{templates → examples}/linkly/tests/linkly.test.ts +0 -0
  66. /package/{templates → examples}/notes/oke.config.ts +0 -0
  67. /package/{templates → examples}/notes/src/app.ts +0 -0
  68. /package/{templates → examples}/notes/src/core.ts +0 -0
  69. /package/{templates → examples}/notes/src/flows/notes/index.ts +0 -0
  70. /package/{templates → examples}/notes/src/schema.ts +0 -0
  71. /package/{templates → examples}/notes/tests/notes.test.ts +0 -0
  72. /package/{templates → examples}/provisions/oke.config.ts +0 -0
  73. /package/{templates → examples}/provisions/src/app.ts +0 -0
  74. /package/{templates → examples}/provisions/src/channels.ts +0 -0
  75. /package/{templates → examples}/provisions/src/core.ts +0 -0
  76. /package/{templates → examples}/provisions/src/flows/notifications/index.ts +0 -0
  77. /package/{templates → examples}/provisions/src/flows/orders/index.ts +0 -0
  78. /package/{templates → examples}/provisions/src/flows/orders/shapes.ts +0 -0
  79. /package/{templates → examples}/provisions/src/flows/orders/signals.ts +0 -0
  80. /package/{templates → examples}/provisions/src/flows/payments/index.ts +0 -0
  81. /package/{templates → examples}/provisions/src/flows/payments/shapes.ts +0 -0
  82. /package/{templates → examples}/provisions/src/flows/payments/stripe.ts +0 -0
  83. /package/{templates → examples}/provisions/src/gates.ts +0 -0
  84. /package/{templates → examples}/provisions/src/locales/ar.ts +0 -0
  85. /package/{templates → examples}/provisions/src/locales/en.ts +0 -0
  86. /package/{templates → examples}/provisions/src/plugins/audit-schema.ts +0 -0
  87. /package/{templates → examples}/provisions/src/plugins/audit.ts +0 -0
  88. /package/{templates → examples}/provisions/src/schema.ts +0 -0
  89. /package/{templates → examples}/provisions/src/vault.ts +0 -0
  90. /package/{templates → examples}/provisions/tests/orders.test.ts +0 -0
  91. /package/{templates → examples}/skyport/evals/triage.jsonl +0 -0
  92. /package/{templates → examples}/skyport/oke.config.ts +0 -0
  93. /package/{templates → examples}/skyport/oke.images.lock +0 -0
  94. /package/{templates → examples}/skyport/src/ai.ts +0 -0
  95. /package/{templates → examples}/skyport/src/app.ts +0 -0
  96. /package/{templates → examples}/skyport/src/channels.ts +0 -0
  97. /package/{templates → examples}/skyport/src/core.ts +0 -0
  98. /package/{templates → examples}/skyport/src/flows/bookings/index.ts +0 -0
  99. /package/{templates → examples}/skyport/src/flows/bookings/shapes.ts +0 -0
  100. /package/{templates → examples}/skyport/src/flows/bookings/signals.ts +0 -0
  101. /package/{templates → examples}/skyport/src/flows/notifications/index.ts +0 -0
  102. /package/{templates → examples}/skyport/src/flows/payments/index.ts +0 -0
  103. /package/{templates → examples}/skyport/src/flows/payments/shapes.ts +0 -0
  104. /package/{templates → examples}/skyport/src/flows/support/index.ts +0 -0
  105. /package/{templates → examples}/skyport/src/flows/users/elements.ts +0 -0
  106. /package/{templates → examples}/skyport/src/flows/users/index.ts +0 -0
  107. /package/{templates → examples}/skyport/src/flows/users/shapes.ts +0 -0
  108. /package/{templates → examples}/skyport/src/gates.ts +0 -0
  109. /package/{templates → examples}/skyport/src/journeys.ts +0 -0
  110. /package/{templates → examples}/skyport/src/locales/ar.ts +0 -0
  111. /package/{templates → examples}/skyport/src/locales/en.ts +0 -0
  112. /package/{templates → examples}/skyport/src/plugins/audit-schema.ts +0 -0
  113. /package/{templates → examples}/skyport/src/plugins/audit.ts +0 -0
  114. /package/{templates → examples}/skyport/src/plugins/panel.tsx +0 -0
  115. /package/{templates → examples}/skyport/src/schema.ts +0 -0
  116. /package/{templates → examples}/skyport/src/vault.ts +0 -0
  117. /package/{templates → examples}/skyport/tests/support.test.ts +0 -0
@@ -0,0 +1,4 @@
1
+ import { store } from "okengine";
2
+ import * as schema from "./schema";
3
+
4
+ export const db = store.sql("app", { schema });
@@ -0,0 +1,14 @@
1
+ import { on, flow, http } from "okengine";
2
+ import { z } from "zod";
3
+
4
+ import "./shapes";
5
+ import "./signals";
6
+
7
+ /** Replace with your unit's flows. */
8
+ export const health = on(
9
+ http.get("/health"),
10
+ flow({
11
+ out: z.object({ ok: z.literal(true) }),
12
+ do: () => ({ ok: true as const }),
13
+ }),
14
+ );
@@ -0,0 +1,2 @@
1
+ // add unit shapes here
2
+ export {};
@@ -0,0 +1,4 @@
1
+ import { signal } from "okengine";
2
+
3
+ // add unit signals here
4
+ void signal;
@@ -0,0 +1,4 @@
1
+ import { gate } from "okengine";
2
+
3
+ // add shared gates here
4
+ void gate;
@@ -0,0 +1,2 @@
1
+ /** Locale strings — add keys as channel templates need them. */
2
+ export default {};
@@ -0,0 +1,2 @@
1
+ /** Locale strings — add keys as channel templates need them. */
2
+ export default {};
@@ -0,0 +1,9 @@
1
+ import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
2
+ import { id, now } from "okengine/store";
3
+
4
+ /** Replace with your tables — keep defaults on the schema. */
5
+ export const entries = sqliteTable("entries", {
6
+ id: text("id").primaryKey().$defaultFn(id),
7
+ body: text("body").notNull(),
8
+ createdAt: integer("created_at").notNull().$defaultFn(now),
9
+ });
@@ -0,0 +1,4 @@
1
+ import { vault } from "okengine";
2
+
3
+ // add shared secrets here
4
+ void vault;
@@ -0,0 +1,10 @@
1
+ import { test, expect } from "bun:test";
2
+ import { createTestApp } from "okengine/test";
3
+ import { app } from "../src/app";
4
+
5
+ test("boots — health flow", async () => {
6
+ const t = await createTestApp(app);
7
+ const { data, error } = await t.api.main.health({});
8
+ expect(error).toBeNull();
9
+ expect(data).toEqual({ ok: true });
10
+ });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes