@blotout/qinto-cli 0.1.5 → 0.1.7

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
@@ -166,13 +166,19 @@ declares only its build tooling.
166
166
 
167
167
  `qinto app add ui [dir]` adds the same UI panel to an app that was scaffolded without one, and installs it.
168
168
 
169
- ### Register — `qinto app register`
169
+ ### Register — `qinto app register [dir]`
170
170
 
171
171
  Registers the slug under an organization. `create --register` calls it for you; run it directly to register an app you scaffolded
172
172
  earlier or wrote by hand. The slug is immutable and unique inside the organization.
173
173
 
174
+ The slug, name, and description come from `qinto.app.jsonc` — the one in `dir`, or the one in the current directory when you pass
175
+ no `dir`. Pass `--slug`, `--name`, and `--description` only for an app that has no manifest yet; alongside a manifest they are
176
+ refused, because a slug that differs from the manifest is one `qinto app publish` then rejects.
177
+
174
178
  ```sh
175
- qinto app register --slug my-app --name "My App" --org Acme --description "What it does."
179
+ qinto app register ./my-app # slug, name, and description from its manifest
180
+ qinto app register --org Acme # the manifest in the current directory
181
+ qinto app register --slug my-app --name "My App" --description "What it does." # no manifest
176
182
  qinto app list # every app across your organizations
177
183
  qinto app list --json
178
184
  ```
@@ -187,10 +193,15 @@ ships the platform bundles and prints the version it is running.
187
193
  ```sh
188
194
  qinto app dev # from inside the app directory
189
195
  qinto app dev ./apps/my-app
196
+ qinto app dev ./apps # a folder of app directories — pick which to mount
190
197
  ```
191
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
+
192
203
  ```
193
- My App (my-app) — local Qinto on platform 0.1.0
204
+ 2 apps — local Qinto on platform 0.1.0
194
205
 
195
206
  Console http://127.0.0.1:4300
196
207
  Demo site http://127.0.0.1:4301
@@ -198,13 +209,25 @@ qinto app dev ./apps/my-app
198
209
  Dev state ~/.qinto/dev/8f3c1a2b4d5e6f70
199
210
  Site token qwat_dev_…
200
211
 
201
- 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
202
215
  ```
203
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
+
204
226
  Three surfaces, one per side of the product:
205
227
 
206
- - **The console** is the platform's side. A team and the site `dev.localhost` are seeded for you; install the app there, turn it
207
- 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
208
231
  does — text, toggle, and write-only secrets — and an install stays `inactive`, receiving nothing, until every `required`
209
232
  variable is filled in. Adding an install is offered only for an app whose manifest sets `install.multiple`, and the last
210
233
  install is never removable — uninstall the app instead.
@@ -223,30 +246,40 @@ backfill handlers, and workflows match the manifest — so a mismatch fails here
223
246
  `migrations` use the same statement ledger and backfill checkpoints as a deployed app: rerunning `dev` applies only what is new,
224
247
  and an entry changed after it was applied is refused by id and checksum.
225
248
 
226
- Everything the session persists — the install, its variables and secrets, and every Durable Object, D1, KV and R2 the two workers
227
- wrote — lives in `~/.qinto/dev/<project>/`, outside your app directory, so a restart resumes where you left off and the plaintext
228
- 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.
229
253
 
230
254
  | Flag | What it does |
231
255
  | --- | --- |
256
+ | `--apps <slugs>` | Comma-separated slugs to mount, instead of choosing them. |
232
257
  | `--console-port <port>` | Port the console is served from (default `4300`). |
233
258
  | `--demo-port <port>` | Port the demo site is served from (default `4301`). |
234
259
  | `--worker-port <port>` | Port the local site worker listens on (default `4310`). |
235
- | `--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. |
236
263
 
237
- All three listeners bind `127.0.0.1` only.
264
+ All four listeners bind `127.0.0.1` only.
238
265
 
239
- 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:
240
267
 
241
268
  - **`ai`, `vectorize`, and a `hyperdrive` with no local database URL are not bound.** Each needs a Cloudflare account or a
242
269
  database only you can name, so the app boots without those bindings and the start-up banner lists them. Give a hyperdrive its
243
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.
244
274
 
245
275
  **The UI panel.** When your manifest declares a `ui` block, `dev` runs its build with the same base path a published panel is
246
- served under — `/<appId>/<version>/` — and serves the result on its own port (`--ui-port`, default 4302). **Apps → Panel** in
247
- the console frames it there. That port is deliberately not the console's: the panel is cross-origin, exactly as it is in
248
- production, so the `postMessage` origin and `event.source` checks on both sides are the real ones. The console mints a real
249
- 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.
250
283
 
251
284
  ### Publish — `qinto app publish [dir]`
252
285