@blotout/qinto-cli 0.1.6 → 0.1.8

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 CHANGED
@@ -193,10 +193,15 @@ ships the platform bundles and prints the version it is running.
193
193
  ```sh
194
194
  qinto app dev # from inside the app directory
195
195
  qinto app dev ./apps/my-app
196
+ qinto app dev ./apps # a folder of app directories — pick which to mount
196
197
  ```
197
198
 
199
+ A directory holding a `qinto.app.jsonc` runs that one app. A directory that does not is scanned **one level down**, and every
200
+ subfolder holding a manifest is offered; everything is ticked, so pressing Enter mounts them all. `--apps my-app,crm` skips the
201
+ question, and `--no-input` mounts everything found.
202
+
198
203
  ```
199
- My App (my-app) — local Qinto on platform 0.1.0
204
+ 2 apps — local Qinto on platform 0.1.0
200
205
 
201
206
  Console http://127.0.0.1:4300
202
207
  Demo site http://127.0.0.1:4301
@@ -204,13 +209,25 @@ qinto app dev ./apps/my-app
204
209
  Dev state ~/.qinto/dev/8f3c1a2b4d5e6f70
205
210
  Site token qwat_dev_…
206
211
 
207
- The app is not installed yet.
212
+ My App (my-app) — installed and active on the seeded site
213
+ panel http://127.0.0.1:4302/dev-my-app/0.0.0-dev/
214
+ CRM (crm) — installed, but no install is active until you set API_KEY in the console
208
215
  ```
209
216
 
217
+ **Apps mounted together share one site**, which is what makes everything that crosses apps testable: one event fans out to every
218
+ app's hooks, `ctx.context.shared` is readable across them, a site-wide `ctx.push` reaches them all, and `ctx.apps.call` really
219
+ goes caller → the site worker's broker → callee, each app in its own worker. Calls to a `public` function work as soon as both
220
+ apps are mounted; a `private` one is refused with `403 forbidden` until you approve it under **App-to-app approvals** on the
221
+ callee's page, exactly as a site manager does on a deployed site.
222
+
223
+ An app folder added or removed while `dev` is running is not picked up — it says so and asks for a restart. A save inside a
224
+ mounted app rebuilds that app alone.
225
+
210
226
  Three surfaces, one per side of the product:
211
227
 
212
- - **The console** is the platform's side. A team and the site `dev.localhost` are seeded for you; install the app there, turn it
213
- on and off, manage its installs, and fill in the variables the manifest declares. It renders the same form the Qinto platform
228
+ - **The console** is the platform's side. A team and the site `dev.localhost` are seeded for you; every mounted app is listed
229
+ under **Site → Apps**, where you install it, turn it on and off, manage its installs, and fill in the variables the manifest
230
+ declares. It renders the same form the Qinto platform
214
231
  does — text, toggle, and write-only secrets — and an install stays `inactive`, receiving nothing, until every `required`
215
232
  variable is filled in. Adding an install is offered only for an app whose manifest sets `install.multiple`, and the last
216
233
  install is never removable — uninstall the app instead.
@@ -229,30 +246,40 @@ backfill handlers, and workflows match the manifest — so a mismatch fails here
229
246
  `migrations` use the same statement ledger and backfill checkpoints as a deployed app: rerunning `dev` applies only what is new,
230
247
  and an entry changed after it was applied is refused by id and checksum.
231
248
 
232
- Everything the session persists — the install, its variables and secrets, and every Durable Object, D1, KV and R2 the two workers
233
- wrote — lives in `~/.qinto/dev/<project>/`, outside your app directory, so a restart resumes where you left off and the plaintext
234
- secrets file can never be committed. `--reset` discards all of it.
249
+ Everything the session persists — each app's installs, its variables and secrets, and every Durable Object, D1, KV and R2 the
250
+ workers wrote — lives in `~/.qinto/dev/<directory>/`, keyed on the directory you pointed `dev` at and outside your app
251
+ directories, so a restart resumes where you left off and the plaintext secrets file can never be committed. Each app's resources
252
+ are namespaced by its slug, so two apps declaring a `d1` called `ledger` get a database each. `--reset` discards all of it.
235
253
 
236
254
  | Flag | What it does |
237
255
  | --- | --- |
256
+ | `--apps <slugs>` | Comma-separated slugs to mount, instead of choosing them. |
238
257
  | `--console-port <port>` | Port the console is served from (default `4300`). |
239
258
  | `--demo-port <port>` | Port the demo site is served from (default `4301`). |
240
259
  | `--worker-port <port>` | Port the local site worker listens on (default `4310`). |
241
- | `--reset` | Discard this project's local install, variables, secrets and stored data first. |
260
+ | `--ui-port <port>` | Port the app panels are served from (default `4302`). |
261
+ | `--reset` | Discard this directory's local installs, variables, secrets and stored data first. |
262
+ | `--no-input` | Disable all interactive prompts, mounting every app found. |
242
263
 
243
- All three listeners bind `127.0.0.1` only.
264
+ All four listeners bind `127.0.0.1` only.
244
265
 
245
- One thing behaves differently from a deployed site, and `dev` says so rather than letting you discover it:
266
+ Two things behave differently from a deployed site, and `dev` says so rather than letting you discover them:
246
267
 
247
268
  - **`ai`, `vectorize`, and a `hyperdrive` with no local database URL are not bound.** Each needs a Cloudflare account or a
248
269
  database only you can name, so the app boots without those bindings and the start-up banner lists them. Give a hyperdrive its
249
270
  local URL in the console to bind it — the origin in your manifest is the *deployed* database and is never used here.
271
+ - **Two mounted apps cannot bind the same hyperdrive name to different databases.** workerd names a hyperdrive connection after
272
+ the binding — your app's own `env.DATABASE` — and keeps the first of a name, so the second app's binding is reported inert
273
+ instead of silently reaching the first app's database. Rename the binding, or point both at one database.
250
274
 
251
275
  **The UI panel.** When your manifest declares a `ui` block, `dev` runs its build with the same base path a published panel is
252
- served under — `/<appId>/<version>/` — and serves the result on its own port (`--ui-port`, default 4302). **Apps → Panel** in
253
- the console frames it there. That port is deliberately not the console's: the panel is cross-origin, exactly as it is in
254
- production, so the `postMessage` origin and `event.source` checks on both sides are the real ones. The console mints a real
255
- app-UI token, so the panel's calls to `${ctx.siteOrigin}/apps/<slug>/ui/*` go through the site worker's own claim checks.
276
+ served under — `/<appId>/<version>/` — and serves the result on its own port (`--ui-port`, default 4302); every mounted app's
277
+ panel is served from that one port, each under its own base path, and gets its own entry in the console's **Apps** menu. That
278
+ port is deliberately not the console's: the panel is cross-origin, exactly as it is in production, so the `postMessage` origin
279
+ and `event.source` checks on both sides are the real ones. The console mints a real app-UI token, so the panel's calls to
280
+ `${ctx.siteOrigin}/apps/<slug>/ui/*` go through the site worker's own claim checks. One difference from a deployed site: there
281
+ every panel gets its own `https://<slug>.appui.<zone>` origin, and here they share one, so panels are not origin-isolated from
282
+ each other.
256
283
 
257
284
  ### Publish — `qinto app publish [dir]`
258
285