@plitzi/cli 0.38.9 → 0.38.11
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 +261 -0
- package/README.md +22 -7
- package/dist/index.js +1344 -816
- package/package.json +3 -3
- package/skills/plitzi-cli/reference/functions.md +7 -2
- package/skills/plitzi-cli/reference/projects.md +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/cli",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.11",
|
|
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.11",
|
|
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.11",
|
|
32
32
|
"@types/node": "^26.6.4",
|
|
33
33
|
"eslint": "^9.39.5",
|
|
34
34
|
"eslint-plugin-import": "^2.32.0",
|
|
@@ -9,13 +9,18 @@ A space's own server code — TypeScript tasks its actions run as steps, and rou
|
|
|
9
9
|
changes aside, `functions pull`, apply them again, `functions push`. Never `--force` over somebody else's work to get past it.
|
|
10
10
|
- **A push is checked, not just stored.** A problem comes back as `src/functions/<file>:<line> <message>` and nothing is
|
|
11
11
|
saved — fix it and push again. `index.ts` must default-export `defineFunctions({ … })`; files import each other by
|
|
12
|
-
relative path and `@plitzi/sdk-server/functions`, nothing else
|
|
12
|
+
relative path and `@plitzi/sdk-server/functions`, nothing else — a package (installed in the project) is bundled in with
|
|
13
|
+
`functions add <package>`, as `./vendor/<package>.js`; one that needs Node is refused. `src/data/` is read with `ctx.data('x.json')`, never
|
|
13
14
|
imported (`dev` reads the project's).
|
|
14
15
|
- **`try` runs the saved draft for real** (its fetches and writes happen). `dev` runs `src/functions/` on this machine with
|
|
15
16
|
the project's own `@plitzi/sdk-server` — `npm install -D @plitzi/sdk-server isolated-vm core-js` first — and sends
|
|
16
|
-
nothing to the space
|
|
17
|
+
nothing to the space. Credentials are `PLITZI_CREDENTIALS={"stripe":{"apiKey":"…"}}` in `.env` — what `dev` and the
|
|
18
|
+
project's own server hand `ctx.fetch({ credential })`; in the cloud, the space's Credentials.
|
|
17
19
|
- **A run gets 100 ms of CPU and 10 s.** A task that needs more asks with `limits: { cpuMs, wallMs }` (or
|
|
18
20
|
`defineFunctions({ limits })` for all), up to the plan's ceiling; asking above it is a problem the push reports.
|
|
21
|
+
- **What must happen in N seconds whether or not a page is open** — a turn that runs out, a bot's move — is
|
|
22
|
+
`ctx.later({ action, in, input, key })` on an action with a `later` trigger (`flow.later` from a flow): never a page's
|
|
23
|
+
timer asking the server back. The same `key` replaces what still waits; `ctx.cancelLater(key)` drops it.
|
|
19
24
|
- **The live site runs what the space was last published with.** A push changes the draft; publishing is the person's.
|
|
20
25
|
|
|
21
26
|
## A space's runtime (`runtime`)
|
|
@@ -19,7 +19,7 @@ What a project gives you, so you use it rather than rebuild it:
|
|
|
19
19
|
| `npx plitzi element where <id\|class\|words>` | where the code writes an element: file:line and the call — edit it there, not the files around it. `npx plitzi element edit <id> --set content="…"` writes an attribute in it, `remove <id>` takes it out, `move <id> --before <id>` reorders it — each checked |
|
|
20
20
|
| `check -- /path --width 1440,390` | whether a page is whole, in text: elements on screen, overflow, console, refused requests, failed flows, a binding its data lacks; `--state`, `--element <id>`: what it holds; `--ssr`: SSR misses; `--as <user>`; `--json` |
|
|
21
21
|
| `npx plitzi page import <url>` | a page the user owns, as a start: tokens, its blocks' layout, lists as `data/*.json` — never the words. **Only when the user asks**; a site not on this machine needs `--account`: ask first |
|
|
22
|
-
| `shot -- /path --width 390 --scheme dark` | a picture of one page — `--clip <element>` one element, `--frames 4` what moves, `--compare <url>` what differs from another site |
|
|
22
|
+
| `shot -- /path --width 390 --scheme dark` | a picture of one page — `--clip <element>` one element, `--frames 4` what moves (`--from load`: as the page arrives), `--steps "click a; wait 300; frames 6 150; shot"` a whole interaction, `--compare <url>` what differs from another site, `--as <user>` signed in (said, when the page sent it elsewhere) |
|
|
23
23
|
| `visual` | a browser asserts every element the space names is visible |
|
|
24
24
|
| `typecheck`, `lint`, `format` | before calling a change done |
|
|
25
25
|
|