@korajs/cli 1.0.0-beta.12 → 1.0.0-beta.13
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 +25 -107
- package/dist/bin.cjs +808 -340
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +588 -174
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-G2PBYMMA.js → chunk-7Y4J2GXP.js} +168 -153
- package/dist/chunk-7Y4J2GXP.js.map +1 -0
- package/dist/{chunk-Z7GCXMGW.js → chunk-TIKGLNER.js} +44 -9
- package/dist/chunk-TIKGLNER.js.map +1 -0
- package/dist/{chunk-4IKCHRJ6.js → chunk-TVIRMDER.js} +122 -112
- package/dist/chunk-TVIRMDER.js.map +1 -0
- package/dist/create.cjs +63 -28
- package/dist/create.cjs.map +1 -1
- package/dist/create.js +2 -2
- package/dist/index.cjs +41 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +8 -2
- package/dist/{studio-server-NIFKZI4F.js → studio-server-XLGZNGG5.js} +11 -2
- package/dist/studio-server-XLGZNGG5.js.map +1 -0
- package/dist/vite.cjs +351 -0
- package/dist/vite.cjs.map +1 -0
- package/dist/vite.d.cts +161 -0
- package/dist/vite.d.ts +161 -0
- package/dist/vite.js +321 -0
- package/dist/vite.js.map +1 -0
- package/package.json +18 -8
- package/templates/react-basic/AGENTS.md +5 -5
- package/templates/react-basic/vite.config.ts +4 -1
- package/templates/react-sync/AGENTS.md +5 -5
- package/templates/react-sync/server.ts +8 -0
- package/templates/react-sync/src/vite-env.d.ts +1 -0
- package/templates/react-sync/vite.config.ts +4 -1
- package/templates/react-tailwind/AGENTS.md +5 -5
- package/templates/react-tailwind/vite.config.ts +10 -1
- package/templates/react-tailwind-sync/AGENTS.md +9 -7
- package/templates/react-tailwind-sync/server.ts +8 -0
- package/templates/react-tailwind-sync/src/App.tsx +1 -1
- package/templates/react-tailwind-sync/src/kora.ts +32 -0
- package/templates/react-tailwind-sync/src/main.tsx +1 -23
- package/templates/react-tailwind-sync/src/modules/todos/todo.mutations.ts +4 -8
- package/templates/react-tailwind-sync/src/modules/todos/todo.queries.ts +2 -2
- package/templates/react-tailwind-sync/src/modules/todos/useTodos.ts +1 -1
- package/templates/react-tailwind-sync/src/vite-env.d.ts +1 -0
- package/templates/react-tailwind-sync/vite.config.ts +10 -1
- package/templates/svelte-basic/AGENTS.md +4 -4
- package/templates/svelte-basic/package.json.hbs +6 -0
- package/templates/svelte-basic/src/App.svelte +2 -1
- package/templates/svelte-basic/vite.config.ts +4 -1
- package/templates/svelte-sync/AGENTS.md +4 -4
- package/templates/svelte-sync/server.ts +8 -0
- package/templates/svelte-sync/src/App.svelte +2 -1
- package/templates/svelte-sync/vite.config.ts +4 -1
- package/templates/svelte-tailwind/AGENTS.md +4 -4
- package/templates/svelte-tailwind/package.json.hbs +7 -1
- package/templates/svelte-tailwind/src/App.svelte +2 -1
- package/templates/svelte-tailwind/vite.config.ts +10 -1
- package/templates/svelte-tailwind-sync/AGENTS.md +4 -4
- package/templates/svelte-tailwind-sync/package.json.hbs +1 -1
- package/templates/svelte-tailwind-sync/server.ts +8 -0
- package/templates/svelte-tailwind-sync/src/App.svelte +2 -1
- package/templates/svelte-tailwind-sync/vite.config.ts +10 -1
- package/templates/tauri-react/AGENTS.md +5 -5
- package/templates/tauri-react/package.json.hbs +1 -1
- package/templates/tauri-react/server.ts +8 -0
- package/templates/tauri-react/src/vite-env.d.ts +1 -0
- package/templates/vue-basic/AGENTS.md +4 -4
- package/templates/vue-basic/package.json.hbs +6 -0
- package/templates/vue-basic/vite.config.ts +4 -1
- package/templates/vue-sync/AGENTS.md +4 -4
- package/templates/vue-sync/server.ts +8 -0
- package/templates/vue-sync/vite.config.ts +4 -1
- package/templates/vue-tailwind/AGENTS.md +4 -4
- package/templates/vue-tailwind/package.json.hbs +6 -0
- package/templates/vue-tailwind/vite.config.ts +4 -1
- package/templates/vue-tailwind-sync/AGENTS.md +4 -4
- package/templates/vue-tailwind-sync/server.ts +8 -0
- package/templates/vue-tailwind-sync/vite.config.ts +4 -1
- package/dist/chunk-4IKCHRJ6.js.map +0 -1
- package/dist/chunk-G2PBYMMA.js.map +0 -1
- package/dist/chunk-Z7GCXMGW.js.map +0 -1
- package/dist/studio-server-NIFKZI4F.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,126 +1,44 @@
|
|
|
1
1
|
# @korajs/cli
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
8
|
-
|
|
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
|
-
|
|
12
|
+
pnpm add -D @korajs/cli@beta
|
|
60
13
|
```
|
|
61
14
|
|
|
62
|
-
|
|
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
|
|
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
|
-
|
|
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.
|