create-oke 0.11.2 → 0.13.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.
Files changed (59) hide show
  1. package/package.json +1 -1
  2. package/src/agents-md.ts +4 -1
  3. package/src/ai-setup/apply.ts +3 -5
  4. package/src/ai-setup/from-pref.ts +4 -4
  5. package/src/ai-setup/prompts.ts +1 -1
  6. package/src/cli.test.ts +86 -14
  7. package/src/cli.ts +145 -29
  8. package/src/create-defaults.test.ts +9 -0
  9. package/src/create-defaults.ts +27 -0
  10. package/src/customize-flow.ts +2 -1
  11. package/src/drivers-catalog.ts +18 -9
  12. package/src/local-okengine.test.ts +2 -0
  13. package/src/local-okengine.ts +3 -0
  14. package/src/scaffold.ts +17 -5
  15. package/src/transform.test.ts +6 -3
  16. package/src/transform.ts +24 -1
  17. package/templates/advanced/.env.example +13 -5
  18. package/templates/advanced/README.md +3 -0
  19. package/templates/advanced/oke.config.ts +6 -5
  20. package/templates/advanced/package.json +14 -3
  21. package/templates/advanced/src/app.ts +2 -1
  22. package/templates/advanced/src/core.ts +12 -0
  23. package/templates/advanced/src/db/seed/index.ts +2 -0
  24. package/templates/advanced/src/flows/main/index.ts +4 -4
  25. package/templates/advanced/src/flows/notes/index.ts +14 -14
  26. package/templates/advanced/src/flows/notes/shapes.ts +2 -3
  27. package/templates/advanced/web/index.html +12 -0
  28. package/templates/advanced/web/src/App.css +78 -0
  29. package/templates/advanced/web/src/App.tsx +100 -0
  30. package/templates/advanced/web/src/client.ts +38 -0
  31. package/templates/advanced/web/src/index.css +18 -0
  32. package/templates/advanced/web/src/main.tsx +13 -0
  33. package/templates/advanced/web/src/vite-env.d.ts +17 -0
  34. package/templates/advanced/web/tsconfig.app.json +24 -0
  35. package/templates/advanced/web/tsconfig.json +4 -0
  36. package/templates/advanced/web/tsconfig.node.json +20 -0
  37. package/templates/advanced/web/vite.config.ts +32 -0
  38. package/templates/standard/.env.example +13 -5
  39. package/templates/standard/README.md +3 -0
  40. package/templates/standard/oke.config.ts +4 -3
  41. package/templates/standard/package.json +14 -3
  42. package/templates/standard/src/app.ts +2 -1
  43. package/templates/standard/src/core.ts +12 -0
  44. package/templates/standard/src/db/seed/index.ts +2 -0
  45. package/templates/standard/src/flows/main/index.ts +4 -4
  46. package/templates/standard/src/flows/notes/index.ts +12 -12
  47. package/templates/standard/src/flows/notes/shapes.ts +2 -3
  48. package/templates/standard/tests/standard.test.ts +3 -2
  49. package/templates/standard/web/index.html +12 -0
  50. package/templates/standard/web/src/App.css +78 -0
  51. package/templates/standard/web/src/App.tsx +100 -0
  52. package/templates/standard/web/src/client.ts +38 -0
  53. package/templates/standard/web/src/index.css +18 -0
  54. package/templates/standard/web/src/main.tsx +13 -0
  55. package/templates/standard/web/src/vite-env.d.ts +17 -0
  56. package/templates/standard/web/tsconfig.app.json +24 -0
  57. package/templates/standard/web/tsconfig.json +4 -0
  58. package/templates/standard/web/tsconfig.node.json +20 -0
  59. package/templates/standard/web/vite.config.ts +32 -0
@@ -0,0 +1,24 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
+ "target": "es2023",
5
+ "lib": ["ES2023", "DOM"],
6
+ "module": "esnext",
7
+ "types": ["vite/client"],
8
+ "allowArbitraryExtensions": true,
9
+ "skipLibCheck": true,
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+ "verbatimModuleSyntax": true,
13
+ "moduleDetection": "force",
14
+ "noEmit": true,
15
+ "jsx": "react-jsx",
16
+ "strict": true,
17
+ "noUnusedLocals": true,
18
+ "noUnusedParameters": true,
19
+ "erasableSyntaxOnly": true,
20
+ "noFallthroughCasesInSwitch": true,
21
+ "noUncheckedIndexedAccess": true
22
+ },
23
+ "include": ["src"]
24
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "files": [],
3
+ "references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }]
4
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "es2023",
5
+ "lib": ["ES2023"],
6
+ "types": ["bun"],
7
+ "skipLibCheck": true,
8
+ "module": "nodenext",
9
+ "allowImportingTsExtensions": true,
10
+ "verbatimModuleSyntax": true,
11
+ "moduleDetection": "force",
12
+ "noEmit": true,
13
+ "strict": true,
14
+ "noUnusedLocals": true,
15
+ "noUnusedParameters": true,
16
+ "erasableSyntaxOnly": true,
17
+ "noFallthroughCasesInSwitch": true
18
+ },
19
+ "include": ["vite.config.ts"]
20
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Vite 8 SPA for the Notes starter.
3
+ *
4
+ * `index.html` is the documented entry (not backend-integration HTML).
5
+ * The oke app stays on :6530. `server.proxy` keeps `createClient("")`
6
+ * same-origin — leave CORS at Vite's localhost default. `preview.proxy` inherits
7
+ * this map. Do not proxy `/` — `main.root` is `GET /` and would steal the SPA.
8
+ */
9
+
10
+ import react from "@vitejs/plugin-react";
11
+ import { dirname, resolve } from "node:path";
12
+ import { fileURLToPath } from "node:url";
13
+ import { defineConfig, type ProxyOptions } from "vite";
14
+
15
+ const root = dirname(fileURLToPath(import.meta.url));
16
+
17
+ /** Local oke app (`oke dev`). */
18
+ const APP_ORIGIN = "http://127.0.0.1:6530";
19
+
20
+ const proxy: Record<string, ProxyOptions> = {
21
+ "/health": { target: APP_ORIGIN, changeOrigin: true },
22
+ "/notes": { target: APP_ORIGIN, changeOrigin: true },
23
+ "/_oke": { target: APP_ORIGIN, changeOrigin: true },
24
+ };
25
+
26
+ export default defineConfig({
27
+ root,
28
+ plugins: [react()],
29
+ // Load `VITE_*` from the app root (same place as `.env.example`).
30
+ envDir: resolve(root, ".."),
31
+ server: { proxy },
32
+ });