@plitzi/cli 0.38.13 → 0.38.14
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 +148 -0
- package/README.md +36 -5
- package/dist/index.js +731 -368
- package/package.json +3 -3
- package/skills/plitzi-cli/SKILL.md +2 -1
- package/skills/plitzi-cli/reference/projects.md +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,153 @@
|
|
|
1
1
|
# @plitzi/cli
|
|
2
2
|
|
|
3
|
+
## 0.38.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 493955a: ## SDK
|
|
8
|
+
|
|
9
|
+
- **An embedded space leaves the page's theme alone** (`@plitzi/plitzi-sdk`, `@plitzi/plitzi-builder`): plitzi-ui's
|
|
10
|
+
`Provider` stamps `dark` on `<html>` by default — and, being `light`, takes it off — so every space mounted with
|
|
11
|
+
`themeScope: 'container'` turned the page around it light, and nothing put it back. The SDK and the builder now leave
|
|
12
|
+
the class to their own theme provider (`applyColorModeClass={false}`).
|
|
13
|
+
- **A space inside a space** (`@plitzi/plitzi-sdk`, `@plitzi/sdk-shared`): one drawn inside another — the `plitziSdk`
|
|
14
|
+
element, a plugin rendering one, the builder's canvas — knows it (`render.enclosed`). It is `container` unless it
|
|
15
|
+
says otherwise, wears its theme on its own root and starts from the page's when its own is `system`, keeps its
|
|
16
|
+
stylesheet to its own root (`@scope` — its `:root` palette and `.dark` rules repainted the outer page, its
|
|
17
|
+
`.plitzi-sdk` rule restyled the outer root), writes no `<title>` (`ownsHead`) and no `theme` cookie.
|
|
18
|
+
- **The `plitziSdk` element draws** (`@plitzi/plitzi-sdk`): it rendered in `widget` mode with no page to show, so it
|
|
19
|
+
drew nothing. A widget with no `currentPageId` now shows the page its home address would. And it takes a space's
|
|
20
|
+
documents as well as a key: `offlineData`, bound whole (an `apiContainer`'s answer, a runtime's route, what
|
|
21
|
+
`plitzi_render` returns) or as `offlineData.schema` and `offlineData.style` from two elements — waiting, without an
|
|
22
|
+
error, for the half that has not answered; one that cannot be drawn is said why, in the console and on the canvas.
|
|
23
|
+
- **`<PlitziSdk>` inside a plugin draws** (`@plitzi/plitzi-sdk`): it mounted a router of its own inside the page's, and
|
|
24
|
+
React Router refused it — `routing: 'memory'` or not. A space inside another is a widget: `raw` becomes `widget`
|
|
25
|
+
there, one page and no router (a frame of its own, `iframe` or `shadow`, is left as asked).
|
|
26
|
+
- **A space inside another is as tall as what it holds** (`@plitzi/plitzi-sdk`): its root was `min-h-screen`, as a
|
|
27
|
+
space that IS the page is, so a card of three lines drawn in a panel took the window's height.
|
|
28
|
+
- **`<PlitziSdk.Plugin component>` takes a component with its own props** (`@plitzi/plitzi-sdk`), as `render()`'s
|
|
29
|
+
plugins do: typed `ComponentPluginFC`, it refused any component that read its attributes.
|
|
30
|
+
- **An edited page keeps its address in step** (`@plitzi/plitzi-sdk`): the routes are built from the pages' own
|
|
31
|
+
elements, and those were read again only when the list of pages changed — an edit to one page (its slug, its flag)
|
|
32
|
+
leaves that list the same, and the routes kept its old address until something else rebuilt them.
|
|
33
|
+
- **Packages declare only what they use** (`@plitzi/sdk-dev-tools`, `@plitzi/sdk-shared`): `@plitzi/sdk-plugins`, which
|
|
34
|
+
the dev tools no longer import, and `terser`, which no build here runs, are no longer dependencies.
|
|
35
|
+
- **An edited page keeps its route up to date** (`@plitzi/plitzi-sdk`): the routes are built from the pages' own
|
|
36
|
+
elements, which were read again only when the list of pages changed — an edit to one page (its slug, its flag) left
|
|
37
|
+
the list the same and the route at the old address. They follow every edit to a page now, and stay the same object
|
|
38
|
+
while no page changes.
|
|
39
|
+
- **`@plitzi/sdk-dev-tools` no longer depends on `@plitzi/sdk-plugins`**, which nothing in it imports.
|
|
40
|
+
- **A dropdown's menu opens inside a card that lifts or clips** (`@plitzi/sdk-elements`, `@plitzi/sdk-shared`): drawn
|
|
41
|
+
inside the dropdown, an ancestor with a `transform` — a card lifting on hover — made itself the containing block of
|
|
42
|
+
the menu's `position: fixed`, and one with `overflow: hidden` cut it off: the menu opened and nobody saw it. The open
|
|
43
|
+
menu and its backdrop are drawn at the space's root (`spaceRootOf`, `@plitzi/sdk-shared/helpers/spaceRoot`); a
|
|
44
|
+
style written for the popup by an ancestor's selector no longer reaches it — its own classes do.
|
|
45
|
+
- **A copy button says when it could not copy** (`@plitzi/sdk-elements`, `@plitzi/sdk-shared`,
|
|
46
|
+
`@plitzi/sdk-interactions`, `@plitzi/sdk-variables`, `@plitzi/sdk-dev-tools`): a page not served over https has no
|
|
47
|
+
clipboard — a phone opening a development server by its address — and a code block's "Copy" threw there. It reads
|
|
48
|
+
"Not copied", and says why. `clipboardWriter` and `copyText` (`@plitzi/sdk-shared/helpers/clipboard`) are the one
|
|
49
|
+
check, the `copyToClipboard` step's too.
|
|
50
|
+
|
|
51
|
+
## Authoring
|
|
52
|
+
- **`plitziSdk` is authored like any element** (`@plitzi/sdk-authoring`, `@plitzi/sdk-elements`): its declaration moved
|
|
53
|
+
to `@plitzi/sdk-elements` beside the others, so it has a factory — `plitziSdk({ id, bind: { offlineData: 'view.data'
|
|
54
|
+
} })` —, its attributes typed, and `plitzi explain` knows it.
|
|
55
|
+
- **A binding may write part of an attribute** (`@plitzi/sdk-authoring`): `offlineData.schema` writes into
|
|
56
|
+
`offlineData`, as the runtime always did; authoring refused it as an attribute nothing reads.
|
|
57
|
+
- **`choosesChildren`** (`@plitzi/sdk-shared`, `@plitzi/sdk-authoring`): a plugin that shows only some of the elements
|
|
58
|
+
put inside it — a dashboard's panels, a wizard's step — says so in its declaration, and the page checks owe none of
|
|
59
|
+
them on screen; what it draws is still read by the checks of the whole page (images, sideways scroll, legibility).
|
|
60
|
+
`verify` was red on every such page.
|
|
61
|
+
|
|
62
|
+
- **A page says how the document scrolls** (`@plitzi/sdk-elements`, `@plitzi/sdk-authoring`, `@plitzi/sdk-mcp`):
|
|
63
|
+
`documentScroll: 'locked'` holds the document still while the page is open — a dashboard or a board used with a
|
|
64
|
+
finger, where the whole page was dragged and bounced back though nothing in it scrolls — and `'noBounce'` keeps the
|
|
65
|
+
scroll without the rubber band or pull-to-refresh. The page draws the rule itself, so it is in the server's HTML and
|
|
66
|
+
leaves with the page; never inside a widget, a space drawn in another, or the builder's canvas. A Settings select,
|
|
67
|
+
`PageSpec.documentScroll`, `upsertPage`'s `documentScroll` (`null` undoes it) and the page read; an unknown value is
|
|
68
|
+
refused (`attribute-value`). `upsertPage` is now held to the lint of the page it writes, as element writes are.
|
|
69
|
+
|
|
70
|
+
## MCP
|
|
71
|
+
- **`@plitzi/sdk-mcp/render`** (`@plitzi/sdk-mcp`): `plitzi_render`'s widget render on its own — no MCP server, no SSR,
|
|
72
|
+
no OAuth — for a project whose own agent draws in its own pages: `render`, `renderWidgetShape` to declare it as a
|
|
73
|
+
tool, `renderGuideText` for the agent. `base`, the style of the project's space, brings its tokens, classes and fonts
|
|
74
|
+
to the widget.
|
|
75
|
+
|
|
76
|
+
## Server
|
|
77
|
+
- **`publicUrl` says where people reach the server** (`@plitzi/sdk-server`): it was `http://127.0.0.1:<port>` whatever
|
|
78
|
+
the server was. It is `https` once `serverOptions.tls` gives it a certificate, and this machine's network address
|
|
79
|
+
with `HOST` open to the network (what a tablet opens, what an OAuth provider sends it back to); `PUBLIC_URL` still
|
|
80
|
+
wins. The network addresses it prints say `https` too.
|
|
81
|
+
- **A server serving TLS reaches itself** (`@plitzi/sdk-server`): with a local certificate (mkcert) Node trusts nothing
|
|
82
|
+
the browsers were told to, so a runtime calling its own MCP failed. Its requests to its own address now connect to its
|
|
83
|
+
listener and are taken when it presents exactly its certificate (`reachOwnServer`, exported from `/runtime`).
|
|
84
|
+
- **A runtime reads compressed answers again** (`@plitzi/sdk-server`): the dispatcher `reachOwnServer` (and the
|
|
85
|
+
platform's `reachSpaceInside`) installs reached every other host with an undici connector that offers HTTP/2, and an
|
|
86
|
+
answer that came back over h2 reached Node's `fetch` without its `content-encoding` — every API that compresses read
|
|
87
|
+
as Brotli bytes. Other hosts are reached over HTTP/1.1 now, as Node's own `fetch` reaches them.
|
|
88
|
+
- **A project's server serves HTTPS from `.env`** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`): `TLS_CERT` and
|
|
89
|
+
`TLS_KEY`, the certificate's and the key's paths — what `plitzi cert` writes — with no code of the project's;
|
|
90
|
+
`serverOptions.tls` still wins. A network address the certificate does not name is said at boot, the machine's
|
|
91
|
+
`.local` name is printed among the addresses when it is named, and a server on loopback alone says how to open it to
|
|
92
|
+
the network.
|
|
93
|
+
- **A session survives a phone on the Wi-Fi** (`@plitzi/sdk-server`): a private network address (`192.168.…`, `10.…`,
|
|
94
|
+
Tailscale's `100.64/10`, IPv6 unique- and link-local) and a machine's mDNS name (`studio.local`) get the local
|
|
95
|
+
cookie profile — `SameSite=Lax`, no `Secure`, no `Domain`. They got `SameSite=None; Secure`, which a browser drops
|
|
96
|
+
over http: nobody could sign in from a tablet. A deployment's own `.local` sub-domains (`app.example.local`) keep the
|
|
97
|
+
strict profile.
|
|
98
|
+
- **Hiding the dev tools on a server over HTTPS hydrates** (`@plitzi/sdk-server`): a server with a certificate speaks
|
|
99
|
+
HTTP/2, which sends no `Host` — only `:authority` — and the cookies named for the origin's port (the dev tools'
|
|
100
|
+
`plitzi_debug_<port>`, forced flags, painted state) were looked for without it. Shift+F12 hid the dev tools in the
|
|
101
|
+
browser, the server rendered them back, and the page failed to hydrate. Every one is read off `requestAuthority`.
|
|
102
|
+
- **A rebuild of plugins says it finished** (`@plitzi/sdk-server`): bundles removed under a running server (`tmp/`
|
|
103
|
+
deleted) were each a warning, "rebuilding…", and their "ready" at a level a project's terminal does not show. It is
|
|
104
|
+
one episode now: said when noticed, and again when the last is built — how many, how long, which failed.
|
|
105
|
+
- **`tmp/dev-server.json` records the scheme** (`@plitzi/sdk-server`): `url` is `https` with a certificate, and the
|
|
106
|
+
file adds the network addresses and the `publicUrl`.
|
|
107
|
+
- **`public/` is asked about every time** (`@plitzi/sdk-server`): it was cached for an hour — a `.js` or `.css` in it
|
|
108
|
+
for a year, `immutable` — so a file a project rewrites while it runs arrived stale. It is `no-cache` now, answered
|
|
109
|
+
`304` by its `ETag` while unchanged; `immutable` stays for what is versioned (the SDK, the plugins).
|
|
110
|
+
|
|
111
|
+
## CLI
|
|
112
|
+
- **`check`, `shot`, `verify` and `visual` find a server on HTTPS** (`@plitzi/cli`): they rebuilt
|
|
113
|
+
`http://127.0.0.1:<port>`, so a project serving a certificate had no page checked. They read the URL `npm start`
|
|
114
|
+
recorded, and take a local certificate on this machine only. A project's `playwright.config.ts` comes from
|
|
115
|
+
`plitzi upgrade`.
|
|
116
|
+
- **`verify` runs the project's tests** (`@plitzi/cli`): a step `test`, after the lint, when `package.json` has a
|
|
117
|
+
`test` script.
|
|
118
|
+
- **`tsconfig.json` is the project's** (`@plitzi/cli`): the compiler options moved to `plitzi/tsconfig.base.json`, which
|
|
119
|
+
the CLI keeps up and `tsconfig.json` extends — so a folder of the project's own (`scripts/`, `tools/`) goes in its
|
|
120
|
+
`include` without changing a file of the CLI's. `plitzi doctor --fix` makes an older `tsconfig.json` extend it,
|
|
121
|
+
keeping only the options the project changed.
|
|
122
|
+
- **`doctor --fix` and `upgrade` write as the project's Prettier does** (`@plitzi/cli`): a repaired `tsconfig.json` or
|
|
123
|
+
`package.json` left `verify`'s format step red.
|
|
124
|
+
- **`upgrade` renames `usePlitziServiceContext`** (`@plitzi/cli`): with `PlitziServiceProvider` and
|
|
125
|
+
`PlitziServiceContextValue`, renamed in 0.38.12 with no alias — import, use and the module path that named it.
|
|
126
|
+
- **`skills update` compares every file** (`@plitzi/cli`): only `SKILL.md` was, so a change in a reference alone was
|
|
127
|
+
"up to date".
|
|
128
|
+
- **`NOTES.md`, the project's notes for agents** (`@plitzi/cli`): `AGENTS.md` and `CLAUDE.md` are the CLI's and
|
|
129
|
+
`upgrade` replaces them, so what a project's own sessions had to know had nowhere to live. `CLAUDE.md` imports
|
|
130
|
+
`NOTES.md`, `AGENTS.md` sends every agent to it, and nothing the CLI does touches it; `doctor --fix` writes one for
|
|
131
|
+
a project that has none.
|
|
132
|
+
|
|
133
|
+
- **`start:dev-inspect`** (`@plitzi/cli`): a server project's `start:dev` with Node's inspector open on
|
|
134
|
+
127.0.0.1:9229, so a debugger (VS Code, `chrome://inspect`) attaches to the server, and again after each restart.
|
|
135
|
+
`plitzi upgrade` adds it; `plitzi runtime add` has it restart on the runtime too.
|
|
136
|
+
- **`plitzi cert`** (`@plitzi/cli`): HTTPS while developing, for a phone or a tablet on the Wi-Fi — over http its
|
|
137
|
+
browser gives a page no microphone, camera or clipboard. A certificate from mkcert's local authority for this machine,
|
|
138
|
+
its network addresses and its `.local` name, in `tmp/tls/`, named in `.env`; what to install on the phone, said.
|
|
139
|
+
- **A browser project opens to the network** (`@plitzi/cli`): its `vite.config.ts` reads `HOST`, `TLS_CERT` and
|
|
140
|
+
`TLS_KEY` from `.env`, as a server project does, and writes `tmp/dev-server.json` — the port Vite took and the scheme
|
|
141
|
+
— so `page check`, `page shot` and `visual` find it on another port or over HTTPS. `plitzi upgrade` brings it.
|
|
142
|
+
|
|
143
|
+
## Docs
|
|
144
|
+
- **Two plugins share through `state`** (`@plitzi/sdk-authoring` skill): each plugin is a bundle of its own, so a module
|
|
145
|
+
both import is two copies, and what one keeps there the other never sees.
|
|
146
|
+
- **`verify --help`** names the project's tests among its steps.
|
|
147
|
+
|
|
148
|
+
- Updated dependencies [493955a]
|
|
149
|
+
- @plitzi/sdk-authoring@0.38.14
|
|
150
|
+
|
|
3
151
|
## 0.38.13
|
|
4
152
|
|
|
5
153
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -125,7 +125,9 @@ when an install fails the CLI says which setting names it.
|
|
|
125
125
|
- **The authoring skill**, in `.claude/skills/`, so an agent working in the project knows how a space is put
|
|
126
126
|
together before it touches one: a cheatsheet to start from, references by subject and recipes by intent — each a
|
|
127
127
|
file that authors with no warning. `.claude` is left out of the project's lint and formatting.
|
|
128
|
-
- **`AGENTS.md`**: the commands, the port, where data goes, how to look at a page, and what not to read.
|
|
128
|
+
- **`AGENTS.md`**: the commands, the port, where data goes, how to look at a page, and what not to read. The CLI's,
|
|
129
|
+
like `CLAUDE.md`, which imports it: `upgrade` replaces both. What the project's own sessions have to know goes in
|
|
130
|
+
**`NOTES.md`**, which both point at and nothing the CLI does touches.
|
|
129
131
|
- **Quiet output.** `author` prints one line when the space is fine (every problem with its code when it is not), the
|
|
130
132
|
server only what goes wrong (`npm start -- --verbose` for every request), `typecheck` one line per error. Under the
|
|
131
133
|
warnings, `author` prints the space's **suggestions**
|
|
@@ -147,8 +149,9 @@ when an install fails the CLI says which setting names it.
|
|
|
147
149
|
| `.plitzi/` | What the CLI records about the project: the space it came from (`space.json`), the functions' working copy, the files `create` wrote — what `space pull`, `space push` and `upgrade` stand on | yes |
|
|
148
150
|
|
|
149
151
|
**`plitzi/` is the CLI's; `src/` is yours — but `src/main.ts`.** `plitzi/` holds `author.ts`, the types plugins import
|
|
150
|
-
(`assets.d.ts`, server mode) or the page's base styles (`preflight.css`, client mode),
|
|
151
|
-
|
|
152
|
+
(`assets.d.ts`, server mode) or the page's base styles (`preflight.css`, client mode), the compiler options
|
|
153
|
+
(`tsconfig.base.json`, which the project's own `tsconfig.json` extends — a folder of yours, `scripts/` or `tools/`, goes
|
|
154
|
+
in its `include`), and a `README.md` saying what each folder of `src/` is. `src/main.ts`, the entry point, is the CLI's too, kept in `src/` where an entry point is
|
|
152
155
|
looked for; `upgrade` keeps all of them current, and the build compiles `src/` into `dist/main.js`. In server mode it is a few lines: it authors the space
|
|
153
156
|
(`authorProjectSpace` from `@plitzi/sdk-authoring/node`, which reads `src/space/` as `author` reads it) and hands
|
|
154
157
|
it, the actions and the options to `serveProject` from `@plitzi/sdk-server/project`, which wires the rest from where the
|
|
@@ -312,7 +315,7 @@ and that running it once more will not change the answer (kept in `tmp/refusals.
|
|
|
312
315
|
```bash
|
|
313
316
|
plitzi element remove ent-trust # the element's call taken out, with the styles and imports only it used
|
|
314
317
|
plitzi element move ent-faq --before ent-pricing # put before (or --after) a sibling of the same list of children
|
|
315
|
-
plitzi verify # author, lint:space, typecheck, lint, format and every page: what fails
|
|
318
|
+
plitzi verify # author, lint:space, typecheck, lint, test, format and every page: what fails
|
|
316
319
|
plitzi verify --no-pages # the pages left out, said as such
|
|
317
320
|
```
|
|
318
321
|
|
|
@@ -496,6 +499,32 @@ It loads the plugins' declarations and the project's own `@plitzi/sdk-server` to
|
|
|
496
499
|
never starts the server or the runtime. A check that cannot finish is said as an error
|
|
497
500
|
of its area, never a crash.
|
|
498
501
|
|
|
502
|
+
## `cert`
|
|
503
|
+
|
|
504
|
+
```bash
|
|
505
|
+
plitzi cert # HTTPS for a phone or a tablet on your Wi-Fi
|
|
506
|
+
plitzi cert --name studio.tailnet.ts.net # a name of the machine's own too
|
|
507
|
+
plitzi cert --json # one object: { cert, key, names, authority, open, urls }
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
A project opens to its network with `HOST=0.0.0.0` in `.env` — the server, or Vite, prints every address to open. Over
|
|
511
|
+
plain http, though, a phone's browser gives the page no microphone, camera, clipboard, geolocation or service worker:
|
|
512
|
+
it is not a secure context. `cert` makes a certificate for this machine — loopback, every network address it has, its
|
|
513
|
+
mDNS name (`studio.local`) and the names `--name` adds — in `tmp/tls/`, and sets `TLS_CERT` and `TLS_KEY` in `.env`,
|
|
514
|
+
which the server and Vite serve HTTPS from with no code of the project's.
|
|
515
|
+
|
|
516
|
+
It is signed by [mkcert](https://github.com/FiloSottile/mkcert)'s local authority, which `cert` asks you to install when
|
|
517
|
+
it is missing (`brew install mkcert`, `apt install mkcert`, `choco install mkcert`). At a terminal it runs
|
|
518
|
+
`mkcert -install` — it may ask for your password — so this machine's browsers trust it; with nobody there (an agent,
|
|
519
|
+
`--json`) it leaves that step to you. The phone trusts it once you install the authority there: `rootCA.pem`, in
|
|
520
|
+
`mkcert -CAROOT` — that file only, never `rootCA-key.pem` beside it — sent by AirDrop or mail and trusted fully in
|
|
521
|
+
Settings › General › About › Certificate Trust Settings on an iPhone; installed as a CA certificate under Settings ›
|
|
522
|
+
Security on Android.
|
|
523
|
+
|
|
524
|
+
A certificate names the addresses it was made for: when the router hands the machine a new one, the server says so at
|
|
525
|
+
boot, and `cert` makes one again — or open the `.local` name, which stays. A space read from Plitzi by a browser project
|
|
526
|
+
answers the address the phone opens once it is among the space's allowed domains.
|
|
527
|
+
|
|
499
528
|
## `feedback`
|
|
500
529
|
|
|
501
530
|
```bash
|
|
@@ -793,6 +822,7 @@ Every project has a `.env`, never committed, and a `.env.example`, committed: th
|
|
|
793
822
|
for a clone to copy and fill in. A server project's `.env` is read as each script starts —
|
|
794
823
|
`node --env-file-if-exists=.env` in `start`, `start:prod` and `author`, and in `start:dev`, which Node watches,
|
|
795
824
|
`node --import @plitzi/sdk-server/env` (Node's flag there has its watcher restart on every write in the project) —
|
|
825
|
+
`start:dev-inspect` is the same with Node's inspector open on 127.0.0.1:9229, for a debugger to attach —
|
|
796
826
|
before any of its modules is evaluated, so `src/config/serverOptions.ts` and the actions find their settings in
|
|
797
827
|
`process.env` as they load. A change to it is read on the next start, and a deployment that sets its environment needs
|
|
798
828
|
no file. `start:prod` also sets `NODE_ENV=production` itself — without it a deployed server is a development one, its
|
|
@@ -801,4 +831,5 @@ deployment started some other way says `devMode: false` in `src/config/serverOpt
|
|
|
801
831
|
project's is Vite's: only `VITE_*` reaches the page, and ships in it.
|
|
802
832
|
`create` gives each one a signing key there, made for it: `PLITZI_SIGNING_SECRET`, what `ctx.sign` and `ctx.verify`
|
|
803
833
|
sign with — at least 32 characters (`doctor --fix` writes one where it is missing). `PORT` is left commented out: 8080,
|
|
804
|
-
or the next free port while developing
|
|
834
|
+
or the next free port while developing; so are `HOST`, loopback until it opens the project to the network, and
|
|
835
|
+
`TLS_CERT` and `TLS_KEY`, which `cert` sets.
|