@kizenapps/cli 1.13.0-poc-bcd37de → 1.13.0-poc-f34f035
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 +7 -1
- package/dist/index.js +69 -69
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -205,6 +205,8 @@ Only the block JSON goes to stdout, so it can be piped or redirected (`appbuilde
|
|
|
205
205
|
|
|
206
206
|
The JSON carries only the sizes the block's `config.json` writes: `min_w`, `max_w`, `min_h`, `max_h`, `default_w` and `default_h`. Sizes it leaves out are left out of the JSON too, rather than filled with packager defaults. `default_w` and `default_h` are the starting size, in grid columns and rows, of a dashlet created from the block. Each size that is set must be a positive integer, each `min_*` must be no greater than its `max_*`, and each `default_*` must fall within whichever of its `min_*` and `max_*` are set (for example `min_w` ≤ `default_w` ≤ `max_w`). Otherwise the export fails as `invalid_block` naming the field.
|
|
207
207
|
|
|
208
|
+
If the plugin has components in `src/views/`, the JSON also carries a `views` array: each packaged view's `api_name`, `name`, `type`, `script`/`html`/`css` (each left out when empty) and `event_scripts` (as a `[{ name, script }]` array), so the block can open one with `this.showViewInModal('<api_name>')`. Components in `src/pages/` are not included. Without views, the output is unchanged.
|
|
209
|
+
|
|
208
210
|
### `appbuilder block push`
|
|
209
211
|
|
|
210
212
|
Packages the plugin in the current directory (same validation as `block export`) and writes one block into a Custom Block (AI Coded) dashlet on a Kizen dashboard, homepage or chart group: it updates an existing dashlet or creates a new one. Card chrome (background, border, radius, shadow) comes from the dashboard's style settings, like native dashlets.
|
|
@@ -240,6 +242,10 @@ It runs headless when stdin or stdout is not a TTY, or when `--json` is passed.
|
|
|
240
242
|
|
|
241
243
|
**Size.** A dashlet created by `push` starts `default_w` columns wide, or `min_w` when there's no `default_w`, or 6 when neither is set. Its height works the same way with `default_h`, then `min_h`, then 3 rows. That size is clamped into whichever of `min_*`/`max_*` the block's `config.json` sets, then into the grid (2 to 12 columns, 1 to 99 rows). The pushed content carries exactly the sizes `config.json` writes, the same as `block export`. Updating an existing dashlet never changes its layout or size.
|
|
242
244
|
|
|
245
|
+
The pushed content includes the plugin's `src/views/` components as `views`, in the same shape as `block export`. They count toward drift detection: a view changed in Kizen since the last push stops the push with `drift_detected`. Blocks in plugins without views push exactly as before, and existing `pushes.json` entries stay valid.
|
|
246
|
+
|
|
247
|
+
`block export` and `block push` fail with `invalid_block` if a view's `api_name`, `name`, `script`, `html`, `css` or event script contains a NUL character or `{__ref:`. The field is reported as `views.<api_name>.<field>`. A warning `appbuilder/views-unmatched` appears if some `src/views/` components couldn't be matched to packaged views.
|
|
248
|
+
|
|
243
249
|
**Matching.** With `--dashboard` and neither `--dashlet` nor `--create`, the push updates the dashlet recorded in `.kizenapp/pushes.json` for that dashboard, else the single custom code dashlet named `appbuilder:<plugin_api_name>/<block_api_name>` (the name given to every dashlet `push` creates). No match, or several, is `needs_choice`.
|
|
244
250
|
|
|
245
251
|
#### JSON output
|
|
@@ -303,7 +309,7 @@ An applied write:
|
|
|
303
309
|
|
|
304
310
|
`action` is `created` or `updated`. `remembered` is `false` (with a warning) when `.kizenapp/pushes.json` couldn't be written; the push itself still succeeded.
|
|
305
311
|
|
|
306
|
-
`refresh` is only on applied writes, and only when the dashboard id is a uuid; otherwise it's left out. `script` is exactly `await window.__kizenCustomBlocks?.refresh('<dashboardId>')`. Run it in a Kizen tab that already has `url` open to refetch that dashboard in place instead of reloading the page. The hook is registered on dashboards, homepages and chart groups. When it's available on the page, the script resolves to `{ refreshed: true, dashboardId }`. Otherwise it resolves to `undefined`:
|
|
312
|
+
`refresh` is only on applied writes, and only when the dashboard id is a uuid; otherwise it's left out. `script` is exactly `await window.__kizenCustomBlocks?.refresh('<dashboardId>')`. Run it in a Kizen tab that already has `url` open to refetch that dashboard in place instead of reloading the page. The hook is registered on dashboards, homepages and chart groups. When it's available on the page, the script resolves to `{ refreshed: true, dashboardId }`. Otherwise it resolves to `undefined`: the page is an older Kizen build without the hook. `refreshed: true` means the dashboard query was invalidated, not that the target was on screen, which is why the agent matches the tab by `url` and screenshots afterwards. Human output prints the same script on a `Refresh an open tab:` line after the URL.
|
|
307
313
|
|
|
308
314
|
A failure exits 1:
|
|
309
315
|
|