@korajs/cli 1.0.0-beta.12 → 1.0.0-beta.14

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 (91) hide show
  1. package/README.md +25 -107
  2. package/dist/bin.cjs +808 -340
  3. package/dist/bin.cjs.map +1 -1
  4. package/dist/bin.js +588 -174
  5. package/dist/bin.js.map +1 -1
  6. package/dist/{chunk-G2PBYMMA.js → chunk-7Y4J2GXP.js} +168 -153
  7. package/dist/chunk-7Y4J2GXP.js.map +1 -0
  8. package/dist/{chunk-Z7GCXMGW.js → chunk-BURFQVMV.js} +44 -9
  9. package/dist/chunk-BURFQVMV.js.map +1 -0
  10. package/dist/{chunk-4IKCHRJ6.js → chunk-TVIRMDER.js} +122 -112
  11. package/dist/chunk-TVIRMDER.js.map +1 -0
  12. package/dist/create.cjs +63 -28
  13. package/dist/create.cjs.map +1 -1
  14. package/dist/create.js +2 -2
  15. package/dist/index.cjs +41 -14
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +21 -1
  18. package/dist/index.d.ts +21 -1
  19. package/dist/index.js +8 -2
  20. package/dist/{studio-server-NIFKZI4F.js → studio-server-XLGZNGG5.js} +11 -2
  21. package/dist/studio-server-XLGZNGG5.js.map +1 -0
  22. package/dist/vite.cjs +351 -0
  23. package/dist/vite.cjs.map +1 -0
  24. package/dist/vite.d.cts +161 -0
  25. package/dist/vite.d.ts +161 -0
  26. package/dist/vite.js +321 -0
  27. package/dist/vite.js.map +1 -0
  28. package/package.json +18 -8
  29. package/templates/react-basic/AGENTS.md +5 -5
  30. package/templates/react-basic/vite.config.ts +4 -1
  31. package/templates/react-sync/.env.example +1 -1
  32. package/templates/react-sync/AGENTS.md +5 -5
  33. package/templates/react-sync/server.ts +8 -0
  34. package/templates/react-sync/src/vite-env.d.ts +1 -0
  35. package/templates/react-sync/vite.config.ts +4 -1
  36. package/templates/react-tailwind/AGENTS.md +5 -5
  37. package/templates/react-tailwind/vite.config.ts +10 -1
  38. package/templates/react-tailwind-sync/.env.example +1 -1
  39. package/templates/react-tailwind-sync/AGENTS.md +9 -7
  40. package/templates/react-tailwind-sync/server.ts +8 -0
  41. package/templates/react-tailwind-sync/src/App.tsx +1 -1
  42. package/templates/react-tailwind-sync/src/kora.ts +32 -0
  43. package/templates/react-tailwind-sync/src/main.tsx +1 -23
  44. package/templates/react-tailwind-sync/src/modules/todos/todo.mutations.ts +4 -8
  45. package/templates/react-tailwind-sync/src/modules/todos/todo.queries.ts +2 -2
  46. package/templates/react-tailwind-sync/src/modules/todos/useTodos.ts +1 -1
  47. package/templates/react-tailwind-sync/src/vite-env.d.ts +1 -0
  48. package/templates/react-tailwind-sync/vite.config.ts +10 -1
  49. package/templates/svelte-basic/AGENTS.md +4 -4
  50. package/templates/svelte-basic/package.json.hbs +6 -0
  51. package/templates/svelte-basic/src/App.svelte +2 -1
  52. package/templates/svelte-basic/vite.config.ts +4 -1
  53. package/templates/svelte-sync/.env.example +1 -1
  54. package/templates/svelte-sync/AGENTS.md +4 -4
  55. package/templates/svelte-sync/server.ts +8 -0
  56. package/templates/svelte-sync/src/App.svelte +2 -1
  57. package/templates/svelte-sync/vite.config.ts +4 -1
  58. package/templates/svelte-tailwind/AGENTS.md +4 -4
  59. package/templates/svelte-tailwind/package.json.hbs +7 -1
  60. package/templates/svelte-tailwind/src/App.svelte +2 -1
  61. package/templates/svelte-tailwind/vite.config.ts +10 -1
  62. package/templates/svelte-tailwind-sync/.env.example +1 -1
  63. package/templates/svelte-tailwind-sync/AGENTS.md +4 -4
  64. package/templates/svelte-tailwind-sync/package.json.hbs +1 -1
  65. package/templates/svelte-tailwind-sync/server.ts +8 -0
  66. package/templates/svelte-tailwind-sync/src/App.svelte +2 -1
  67. package/templates/svelte-tailwind-sync/vite.config.ts +10 -1
  68. package/templates/tauri-react/.env.example +1 -1
  69. package/templates/tauri-react/AGENTS.md +5 -5
  70. package/templates/tauri-react/README.md.hbs +2 -2
  71. package/templates/tauri-react/package.json.hbs +1 -1
  72. package/templates/tauri-react/server.ts +10 -2
  73. package/templates/tauri-react/src/vite-env.d.ts +1 -0
  74. package/templates/vue-basic/AGENTS.md +4 -4
  75. package/templates/vue-basic/package.json.hbs +6 -0
  76. package/templates/vue-basic/vite.config.ts +4 -1
  77. package/templates/vue-sync/.env.example +1 -1
  78. package/templates/vue-sync/AGENTS.md +4 -4
  79. package/templates/vue-sync/server.ts +8 -0
  80. package/templates/vue-sync/vite.config.ts +4 -1
  81. package/templates/vue-tailwind/AGENTS.md +4 -4
  82. package/templates/vue-tailwind/package.json.hbs +6 -0
  83. package/templates/vue-tailwind/vite.config.ts +4 -1
  84. package/templates/vue-tailwind-sync/.env.example +1 -1
  85. package/templates/vue-tailwind-sync/AGENTS.md +4 -4
  86. package/templates/vue-tailwind-sync/server.ts +8 -0
  87. package/templates/vue-tailwind-sync/vite.config.ts +4 -1
  88. package/dist/chunk-4IKCHRJ6.js.map +0 -1
  89. package/dist/chunk-G2PBYMMA.js.map +0 -1
  90. package/dist/chunk-Z7GCXMGW.js.map +0 -1
  91. package/dist/studio-server-NIFKZI4F.js.map +0 -1
package/README.md CHANGED
@@ -1,126 +1,44 @@
1
1
  # @korajs/cli
2
2
 
3
- CLI tooling for Kora.js. Scaffold new apps, run the development server, manage schema migrations, and generate TypeScript types.
3
+ The `kora` command for Kora.js: scaffold apps, run the dev environment, generate migrations and
4
+ types, check a project, operate and deploy a sync server, and inspect data with Kora Studio.
4
5
 
5
6
  ## Install
6
7
 
7
- ```bash
8
- pnpm add -g @korajs/cli
9
- ```
10
-
11
- Or use directly with `npx`:
12
-
13
- ```bash
14
- npx create-kora-app my-app
15
- ```
16
-
17
- ## Commands
18
-
19
- ### create-kora-app
20
-
21
- Scaffold a new Kora.js project:
22
-
23
- ```bash
24
- npx create-kora-app my-app
25
-
26
- # Interactive prompts:
27
- # Select a template: React (basic) | React (with sync)
28
- # Package manager: pnpm | npm | yarn | bun
29
- ```
30
-
31
- ### kora dev
32
-
33
- Start the development environment:
34
-
35
- ```bash
36
- kora dev
37
- ```
38
-
39
- This runs:
40
- - Vite dev server for your application
41
- - Kora sync server (if configured)
42
- - Schema file watcher with auto type generation
43
- - Embedded DevTools (toggle with `Ctrl+Shift+K`)
44
-
45
- ### kora migrate
46
-
47
- Detect schema changes and generate migrations:
48
-
49
- ```bash
50
- kora migrate
51
- # Detects changes, generates migration file, prompts to apply
52
- ```
53
-
54
- ### kora deploy
55
-
56
- Deploy your Kora app to a cloud platform with a single command:
8
+ Projects created with `create-kora-app` already have it as a dev dependency (`pnpm dev` runs
9
+ `kora dev`). Elsewhere:
57
10
 
58
11
  ```bash
59
- kora deploy
12
+ pnpm add -D @korajs/cli@beta
60
13
  ```
61
14
 
62
- Supported platforms: **Fly.io**, **Railway** (Render, Docker, Kora Cloud coming soon).
63
-
64
- #### Options
65
-
66
- | Flag | Description |
67
- |------|-------------|
68
- | `--platform` | Target platform: `fly`, `railway`, `render`, `docker`, `kora-cloud` |
69
- | `--app` | Application name on the platform |
70
- | `--region` | Deployment region (e.g., `iad`, `lhr`, `syd`) |
71
- | `--prod` | Deploy to production environment (default: preview) |
72
- | `--confirm` | Non-interactive mode — fail fast if required data is missing |
73
- | `--reset` | Delete `.kora/deploy/` state and generated artifacts |
74
-
75
- #### Subcommands
15
+ ## Quick start
76
16
 
77
17
  ```bash
78
- kora deploy status # Show deployment health, URLs, and metadata
79
- kora deploy logs # View recent deployment logs
80
- kora deploy rollback # Revert to the previous deployment
81
- ```
82
-
83
- #### Non-interactive (CI/CD)
84
-
85
- ```bash
86
- kora deploy --platform=fly --app=my-app --region=iad --confirm
87
- ```
88
-
89
- #### What it does
90
-
91
- 1. Generates a `Dockerfile` and `.dockerignore` in `.kora/deploy/`
92
- 2. Bundles your server entry (`server.ts`) with esbuild into a single file
93
- 3. Builds your client with Vite
94
- 4. Generates platform config (`fly.toml` or `railway.json`)
95
- 5. Provisions the app on the platform (creates it if new)
96
- 6. Deploys and returns your live URL and sync WebSocket endpoint
97
-
98
- #### Prerequisites
99
-
100
- - **Fly.io**: Install [flyctl](https://fly.io/docs/hands-on/install-flyctl/) and run `fly auth login`
101
- - **Railway**: Install [@railway/cli](https://docs.railway.com/guides/cli) and run `railway login`
102
-
103
- ### kora generate types
104
-
105
- Generate TypeScript types from your schema:
106
-
107
- ```bash
108
- kora generate types
109
- # Output: kora/generated/types.ts
110
- ```
111
-
112
- ## Quick Start
113
-
114
- ```bash
115
- npx create-kora-app my-app
18
+ npx create-kora-app@beta my-app # or: kora create my-app
116
19
  cd my-app
117
20
  pnpm dev
118
21
  ```
119
22
 
120
- You'll have a working offline-first app in under 2 minutes.
23
+ ## Commands
24
+
25
+ | Command | What it does |
26
+ |---------|--------------|
27
+ | `kora create [name]` | Scaffold from a bundled template (React, Vue, Svelte, with or without Tailwind and sync, or Tauri desktop). Works offline. |
28
+ | `kora dev` | Vite, the sync server (`server.ts` or a managed one from `kora.config.ts`) and the schema watcher. |
29
+ | `kora migrate` | Diff the schema against its snapshot and write up/down SQL, an operation-transform stub and a manifest; `--apply` runs them on the configured server databases. |
30
+ | `kora generate types` / `kora generate hooks` | Optional generated types and React hook stubs (types are already inferred from `defineSchema`). |
31
+ | `kora doctor` | Check the project setup and the sync server. |
32
+ | `kora status`, `kora logs` | A running server's status and live events. |
33
+ | `kora backup create \| restore \| info` | Server backups. |
34
+ | `kora compact` | Compact a local SQLite operation log after server acknowledgement. |
35
+ | `kora deploy` | Build and deploy to Fly.io, Railway, AWS ECS or AWS Lightsail (`status`, `logs`, `rollback`). |
36
+ | `kora studio` | Inspect a database, run a multi-device sync lab, or watch a live server. |
37
+ | `kora agents-md` | Write an `AGENTS.md` with Kora's rules for AI coding agents. |
38
+
39
+ Run `kora <command> --help` for options. The [CLI reference](https://korajs.dev/api/cli) documents
40
+ every flag.
121
41
 
122
42
  ## License
123
43
 
124
44
  MIT
125
-
126
- See the [full documentation](https://github.com/ehoneahobed/kora) for guides, API reference, and examples.