@plitzi/cli 0.37.7 → 0.37.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/cli",
3
- "version": "0.37.7",
3
+ "version": "0.37.9",
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.37.7",
24
+ "@plitzi/sdk-authoring": "0.37.9",
25
25
  "chalk": "^6.0.0",
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.37.7",
31
+ "@plitzi/sdk-shared": "0.37.9",
32
32
  "@types/node": "^26.6.2",
33
33
  "eslint": "^9.39.5",
34
34
  "eslint-plugin-import": "^2.32.0",
@@ -4,9 +4,10 @@ description: >-
4
4
  Use the Plitzi command line (@plitzi/cli, `plitzi …` or `npx @plitzi/cli …`) instead of hand-writing what it
5
5
  generates: scaffold a project that renders a space, add elements of your own (plugins) to it, create a plugin package,
6
6
  build a plugin into the module + manifest + zip the platform takes, sign in to upload and install it on a space, and
7
- edit a space's own server code (its functions) in the project. Use whenever the task is to start a Plitzi project,
8
- create or change a plugin/custom element, pack, upload or install one, pull/push/try a space's functions, or work out
9
- which space the CLI is connected to.
7
+ edit a space's own server code (its functions) in the project, and take a space on Plitzi out as a self-hosted project
8
+ of its own (`create --from`, kept in step with `pull`). Use whenever the task is to start a Plitzi project, create or
9
+ change a plugin/custom element, pack, upload or install one, pull/push/try a space's functions, move a space to a
10
+ server of its own, or work out which space the CLI is connected to.
10
11
  ---
11
12
 
12
13
  # The Plitzi CLI
@@ -17,6 +18,8 @@ a signed-in upload. **Reach for it before writing any of those yourself.**
17
18
 
18
19
  ```bash
19
20
  npx @plitzi/cli create my-site # a project that renders a space
21
+ npx @plitzi/cli create my-board --from pizarra # a space on Plitzi, as a project that serves it alone
22
+ npx @plitzi/cli pull # that project brought up to date with its space
20
23
  npx @plitzi/cli add plugin seat-picker legend # elements of your own, in the project you are in
21
24
  npx @plitzi/cli create seat-picker --plugin # a plugin package any space can load
22
25
  npx @plitzi/cli pack plugin # a plugin built, and zipped the way the builder takes it
@@ -64,6 +67,30 @@ What a project gives you, so you use it rather than rebuild it:
64
67
  The space itself is written with `@plitzi/sdk-authoring` — see the `plitzi-authoring` skill, which `create` copies into
65
68
  `.claude/skills/` beside this one.
66
69
 
70
+ ## A space on Plitzi, as a project (`create --from`, `pull`)
71
+
72
+ `create --from <space>` (its permanent URL or id) writes a server project holding everything the space is made of, and
73
+ serving it with nothing of Plitzi's — neither its servers nor its CDN:
74
+
75
+ - its pages as authoring code in `src/space/` (`--source cloud` writes none: they stay on Plitzi, read with a key);
76
+ - its actions in `src/actions/` — each a `defineAction` call where the document reads back exactly, JSON where it does
77
+ not (the report says why) — and its connectors as JSON;
78
+ - its functions in `functions/`, its runtime and plugins as the source they were built from, under `src/`;
79
+ - its files downloaded into `public/`, every CDN address rewritten to the project's own;
80
+ - `.env` with a signing key made for it, and the names of the variables and credentials it needs — never their values.
81
+
82
+ It takes a signed-in CLI and a space the person may change (owner, admin or writer). It takes out the draft unless
83
+ `--environment production` (that environment's latest snapshot) or `--environment production --revision 3` (that one,
84
+ pinned) says otherwise. Read the report it prints: a
85
+ plugin or runtime uploaded before Plitzi kept sources comes across built only (`vendor/`), and a space with visitor
86
+ roles needs sign-in of its own (the note in `src/main.ts`).
87
+
88
+ `pull` brings the project up to date: what changed on the space alone is written, what changed here alone is kept,
89
+ and when one file changed on both it writes **nothing** and names them — keep your changes aside and pull again, or
90
+ `--force` to take the space's copy. It never touches `.env`, and only adds to `package.json`. What the project was given
91
+ is recorded in `.plitzi/space.json`: commit it. It follows the version the project was made from; `pull --environment
92
+ … --revision …` moves it to another, `--revision latest` lets go of a pin.
93
+
67
94
  ## Elements of your own (`add plugin`)
68
95
 
69
96
  A plugin is a React component the space renders — a map, a chart, a seat picker: whatever is not text in a box. **Never
@@ -121,14 +148,16 @@ plitzi upload plugin # the zip pack left, onto the sp
121
148
  `pack` writes one ES module (React and the SDK kept out — the page provides them), `plugin-manifest.json` from the
122
149
  declarations with integrity hashes, and the zip the builder takes under Resources. `upload` checks the manifest,
123
150
  sends the zip to one of the space's CDNs (`--cdn`) and installs it — a plugin already there moves to the new version with
124
- its settings kept. `--plugin-version` sets the version the manifest carries.
151
+ its settings kept. `--plugin-version` sets the version the manifest carries. The plugin's source — every file it
152
+ imports, followed from its entry — is kept beside it on the space (`runtime push` does the same for a runtime), which
153
+ is what `create --from` brings back; `plitzi pack source` writes what would be kept to a file, to look at.
125
154
 
126
155
  A self-hosted page server does not need `pack`: it compiles a plugin from its source
127
156
  (`plugins: { seatPicker: { js: 'src/plugins/SeatPicker/index.ts', action: 'compile' } }` in `createServer`).
128
157
 
129
158
  ## A space's functions (`functions`)
130
159
 
131
- A space's own server code — TypeScript tasks its actions run as steps, and routes under `/api/` — lives in the space;
160
+ A space's own server code — TypeScript tasks its actions run as steps, and routes under `/fn/` — lives in the space;
132
161
  `functions/` in a project is a **working copy** of it. The contract (`defineFunctions`, `ctx`) and every rule are in
133
162
  `docs/en/functions.md` of the workspace; what matters for the CLI:
134
163
 
@@ -141,6 +170,8 @@ A space's own server code — TypeScript tasks its actions run as steps, and rou
141
170
  - **`try` runs the saved draft for real** (its fetches and writes happen). `dev` runs `functions/` on this machine with
142
171
  the project's own `@plitzi/sdk-server` — `npm install -D @plitzi/sdk-server isolated-vm core-js` first — and sends
143
172
  nothing to the space; `PLITZI_FUNCTIONS_CREDENTIALS='{"stripe":{"apiKey":"…"}}'` gives it credentials to name.
173
+ - **A run gets 100 ms of CPU and 10 s.** A task that needs more asks with `limits: { cpuMs, wallMs }` (or
174
+ `defineFunctions({ limits })` for all), up to the plan's ceiling; asking above it is a problem the push reports.
144
175
  - **The live site runs what the space was last published with.** A push changes the draft; publishing is the person's.
145
176
 
146
177
  ## When something does not work
@@ -152,3 +183,4 @@ A space's own server code — TypeScript tasks its actions run as steps, and rou
152
183
  | A flow on the plugin's event is refused, or never runs | the event is not in `declaration.ts`, or the plugin is missing from `src/plugins/declarations.ts` |
153
184
  | `upload` opens a browser | there is no session, or no space chosen — the person completes it there |
154
185
  | The upload went to the wrong space | `plitzi space` chooses another; check `whoami` first |
186
+ | `pull` wrote nothing and named files | they changed here and on the space — set your changes aside and pull again, or `--force` |