@plitzi/cli 0.38.11 → 0.38.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/CHANGELOG.md +115 -0
- package/README.md +12 -10
- package/dist/index.js +2464 -3221
- package/package.json +3 -3
- package/skills/plitzi-cli/reference/functions.md +4 -0
- package/skills/plitzi-cli/reference/plugins.md +5 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/cli",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.13",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"description": "Command line for Plitzi: scaffold a project that renders a space, a plugin package, or an element of your own.",
|
|
6
6
|
"files": [
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@plitzi/sdk-authoring": "0.38.
|
|
24
|
+
"@plitzi/sdk-authoring": "0.38.13",
|
|
25
25
|
"chalk": "^6.0.1",
|
|
26
26
|
"commander": "^15.0.0",
|
|
27
27
|
"esbuild": "^0.28.2",
|
|
28
28
|
"fflate": "^0.8.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@plitzi/sdk-shared": "0.38.
|
|
31
|
+
"@plitzi/sdk-shared": "0.38.13",
|
|
32
32
|
"@types/node": "^26.6.4",
|
|
33
33
|
"eslint": "^9.39.5",
|
|
34
34
|
"eslint-plugin-import": "^2.32.0",
|
|
@@ -16,6 +16,10 @@ A space's own server code — TypeScript tasks its actions run as steps, and rou
|
|
|
16
16
|
the project's own `@plitzi/sdk-server` — `npm install -D @plitzi/sdk-server isolated-vm core-js` first — and sends
|
|
17
17
|
nothing to the space. Credentials are `PLITZI_CREDENTIALS={"stripe":{"apiKey":"…"}}` in `.env` — what `dev` and the
|
|
18
18
|
project's own server hand `ctx.fetch({ credential })`; in the cloud, the space's Credentials.
|
|
19
|
+
- **An action that only runs one task** is `taskAction(tasks.make, { trigger: { type: 'call', access: 'public' } })`
|
|
20
|
+
(`@plitzi/sdk-authoring`): its input is the task's params, its id `<namespace>-<action>`. A param says what it
|
|
21
|
+
takes — `required`, `maxLength`, `min`/`max` — and a call outside it is refused with the reason before `run`;
|
|
22
|
+
`ctx.rateLimit('make', { most: 5, perSeconds: 600, refuse: 'Wait ten minutes' })` refuses over the limit alike.
|
|
19
23
|
- **A run gets 100 ms of CPU and 10 s.** A task that needs more asks with `limits: { cpuMs, wallMs }` (or
|
|
20
24
|
`defineFunctions({ limits })` for all), up to the plan's ceiling; asking above it is a problem the push reports.
|
|
21
25
|
- **What must happen in N seconds whether or not a page is open** — a turn that runs out, a bot's move — is
|
|
@@ -14,7 +14,7 @@ plitzi plugin add ticker --prop interval:number=5000 --prop paused:boolean --tri
|
|
|
14
14
|
|
|
15
15
|
**Say its shape and it is written in it**: `--prop name:type=default` (string, number, boolean; `list`/`json` for data
|
|
16
16
|
a binding fills) per attribute — typed, bindable, with a control in its panel; `--trigger onTick:count` per event and
|
|
17
|
-
what a flow reads, fired with
|
|
17
|
+
what a flow reads, fired with `usePluginTrigger(declaration)` — `fire('onTick', { count })`, typed; `--callback reset` per action a flow calls; `--headless`
|
|
18
18
|
for one with nothing to see. Without them it writes a counter showing the three ways an element talks to a space.
|
|
19
19
|
|
|
20
20
|
Each is a folder (`src/plugins/SeatPicker/` in a project `create` wrote):
|
|
@@ -22,13 +22,14 @@ Each is a folder (`src/plugins/SeatPicker/` in a project `create` wrote):
|
|
|
22
22
|
| File | What it holds |
|
|
23
23
|
| --- | --- |
|
|
24
24
|
| `SeatPicker.tsx` | the component. Its props ARE the element's attributes; render through `RootElement` |
|
|
25
|
-
| `declaration.ts` |
|
|
25
|
+
| `declaration.ts` | `definePlugin<…Attributes>()({ type, label, attributes, triggers, callbacks })` — the events it fires, the actions it answers, its defaults; the rest derived. Data only |
|
|
26
26
|
| `Settings.tsx` | its panel in the builder |
|
|
27
27
|
| `index.ts` | the three put together |
|
|
28
28
|
|
|
29
29
|
- **Registered by itself**: every folder of `src/plugins` is, under its name in camelCase (`SeatPicker` → `seatPicker`).
|
|
30
30
|
Elsewhere the command prints the line that registers it (for `render()`, `<PlitziSdk>` or a page server).
|
|
31
|
-
- **
|
|
31
|
+
- **Place it** from its declaration in `src/space/`: `const seatPicker = defineElement(declaration)`,
|
|
32
|
+
then `seatPicker({ id: 'seats', … })` — what `plugin add` and `explain` print. On Plitzi, the builder adds the same.
|
|
32
33
|
- **Checked like a built-in element**: its folder's `declaration.ts` is found by itself and handed to
|
|
33
34
|
`authorSpace(space, { plugins })`: flows on its events, steps to its actions and its attributes are
|
|
34
35
|
refused when wrong; `declaredTrigger(declaration, 'onPick')` and `declaredCallback(declaration, 'reset', { on: 'seats' })`
|
|
@@ -50,7 +51,7 @@ plitzi create packages/seat-picker --plugin --name @acme/plitzi-plugin-seat-pick
|
|
|
50
51
|
|
|
51
52
|
Its scripts: `start` (the elements inside a space, hot-replaced), `visual`, `typecheck`, `lint`. Add more elements with
|
|
52
53
|
`plugin add` from inside it — they are listed in `src/elements.ts` and `src/declarations.ts`, which the package
|
|
53
|
-
publishes from. A package's element is
|
|
54
|
+
publishes from. A package's element is placed the same way: `defineElement(declaration)`.
|
|
54
55
|
|
|
55
56
|
## Building and shipping (`plugin pack`, `plugin upload`)
|
|
56
57
|
|