@plitzi/sdk-dev-tools 0.38.4 → 0.38.6
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 +352 -0
- package/dist/DevToolsContainer.d.ts +6 -1
- package/dist/DevToolsContainer.mjs +47 -43
- package/package.json +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,357 @@
|
|
|
1
1
|
# @plitzi/sdk-dev-tools
|
|
2
2
|
|
|
3
|
+
## 0.38.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3bce653: ## Fixes
|
|
8
|
+
|
|
9
|
+
- **The dev tools draw their icons again.** The panel lives in a shadow root of its own, which the page's stylesheets
|
|
10
|
+
never reach, and Font Awesome moved to a sheet of its own in 0.38.5 (`plitzi-sdk-icons.css`): the badge and every tab
|
|
11
|
+
lost their icons. The panel now links that sheet inside its root, beside its own. Where it is served is the SDK's
|
|
12
|
+
new `sdkIconsStylePath` — the page server sends `/sdk-assets/plitzi-sdk-icons.css`, the same sheet the document
|
|
13
|
+
links — which the `iframe` and `shadow` render modes read too: they had `/plitzi-sdk-icons.css` hard-coded, a path a
|
|
14
|
+
page server does not serve.
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [3bce653]
|
|
17
|
+
- @plitzi/sdk-plugins@0.38.6
|
|
18
|
+
- @plitzi/sdk-schema@0.38.6
|
|
19
|
+
- @plitzi/sdk-shared@0.38.6
|
|
20
|
+
|
|
21
|
+
## 0.38.5
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 3bce653: ## Agents work through the MCP: the builder's AI chat is gone
|
|
26
|
+
|
|
27
|
+
An agent reaches a space through the MCP, from whatever harness the person already uses; Plitzi no longer runs one of
|
|
28
|
+
its own inside the builder. **Breaking** for whoever imported what that chat was built on:
|
|
29
|
+
|
|
30
|
+
- **The builder's Assistant panel is removed**, with its conversations, attachments, previews and provider settings.
|
|
31
|
+
- **`@plitzi/sdk-mcp` no longer exports the in-process AI engine**: `AIEngine`, `toolResponseOk`, `toolResponseErr`,
|
|
32
|
+
`zodToJsonSchema`, `getAllowedModes`, `bindTools`, `isToolActive`, `resolveToolHandler`, `isCallToolResult`,
|
|
33
|
+
`toolResponseFromResult` and `buildAgentGuide`. The MCP server, its tools and `@plitzi/sdk-mcp/server` are unchanged;
|
|
34
|
+
the tool functions are still exported to run in-process.
|
|
35
|
+
- **`@plitzi/sdk-shared` drops the chat's types** — `AITypes` (`AiContext`, `AiMode`, `AiMessageAttachment`,
|
|
36
|
+
`AiUsage`, …) and `McpTypes` (`McpTool`, `McpToolHandler`, `McpContent`, …), with their `./types/AITypes` and
|
|
37
|
+
`./types/McpTypes/index` subpaths — and no longer depends on `@modelcontextprotocol/sdk`.
|
|
38
|
+
- **A change's `origin` is never `coworker`**: `ChangeOrigin` is `builder`, `mcp`, `autofix`, `api` or `system`, and
|
|
39
|
+
the History panel's filter follows.
|
|
40
|
+
- **The builder's platform flags are gone**: `PlatformFlags` is no longer part of the builder's first query, nor
|
|
41
|
+
`platformFlags` of its store — `assistanceAI` was the only one.
|
|
42
|
+
- **Plitzi's own deployment no longer offers the `ai.complete` task** to flows.
|
|
43
|
+
- **Each MCP tool says whether it only reads** (`readOnlyHint`, from the tool's `access`), so a host can run a read
|
|
44
|
+
without asking and ask before a write. Until now `access` was read only by the builder's chat.
|
|
45
|
+
- **The MCP works over the JSON adapters.** `createJsonAdapters` offers `getSchema` and `getStyle`, and — for a space
|
|
46
|
+
read from a path — `saveSchema` and `saveStyle`, each writing its document back into the file. **Breaking**:
|
|
47
|
+
`saveOfflineData` is gone from `SSRAdapters`; nothing called it, and it was the JSON adapters' only write, so an MCP
|
|
48
|
+
over them could neither read nor save.
|
|
49
|
+
|
|
50
|
+
## Lighter pages: icons on their own
|
|
51
|
+
- **Font Awesome is a stylesheet of its own**, `plitzi-sdk-icons.css`, with its fonts as files beside it
|
|
52
|
+
(`webfonts/`) instead of base64 inside `plitzi-sdk.css` — which drops from 287 KB to 103 KB. A page fetches a face
|
|
53
|
+
only when it shows an icon of that style, and a new SDK version no longer downloads the fonts again. The page server
|
|
54
|
+
links it after `plitzi-sdk.css` (`SSRTemplateProps.iconsCssPath`), the SDK's iframe and shadow modes load it beside
|
|
55
|
+
the stylesheet, and the package exports it: **a project that imports `@plitzi/plitzi-sdk/plitzi-sdk.css` imports
|
|
56
|
+
`@plitzi/plitzi-sdk/plitzi-sdk-icons.css` too** — `plitzi upgrade` adds it to `src/main.ts`, and a new project has
|
|
57
|
+
it. The MCP's rendered widgets inline the sheet, fonts and all, only for a widget that draws an icon.
|
|
58
|
+
- **Material Icons is no longer loaded.** Nothing in Plitzi used it; every page paid a request to Google for it.
|
|
59
|
+
- **A page loads only the plugins it draws.** The page server sends the rest as their declaration
|
|
60
|
+
(`PluginEntry.deferred`, `pluginDeclarationOf` in `@plitzi/sdk-shared/plugins/declaration`); the SDK registers each
|
|
61
|
+
as a stand-in that knows its types from the start, and loads its code and stylesheet the first time one of its
|
|
62
|
+
elements is drawn — on a page reached by navigating too, with no server involved. What a page draws is
|
|
63
|
+
`pageElementTypes` (`@plitzi/sdk-shared/schema/pageElements`): the page, its layouts, the components and references
|
|
64
|
+
it holds. `render()` takes a plugin as `{ load, css, declaration }` beside `{ component }`.
|
|
65
|
+
- **The space travels beside the page, not inside it.** The page names it (`<link id="plitzi-space">`,
|
|
66
|
+
`SSRTemplateProps.spaceDocumentPath`), the browser fetches it while the scripts load, and the page server answers
|
|
67
|
+
`/_plitzi/space/<hash>.json` behind the same gates as its pages — `immutable`, since the name is its content's hash:
|
|
68
|
+
one download for every page and every visit until the space changes. The website's docs page went from 2.6 MB to
|
|
69
|
+
0.5 MB. Still the whole space, so every navigation after the first page stays in the browser. A draft preview and a
|
|
70
|
+
deployment's own `templateFn` keep it inline.
|
|
71
|
+
- **An arrival on screen plays as the page arrives.** A `motion: { on: 'view' }` element already in view was held
|
|
72
|
+
invisible until the SDK hydrated — the page's content, and a page rendered `ssrOnly` forever. The page server's
|
|
73
|
+
document now sees it as soon as it is parsed, and hands over to the SDK once the page is live.
|
|
74
|
+
|
|
75
|
+
## Server data: one request per question, the newest winning, and a way to stop
|
|
76
|
+
- **A link asks for its page's server data once.** The navigation's prefetch already brought it; the route change that
|
|
77
|
+
followed asked again — two renders per click. `useRscSync` now asks only for a location the store does not hold.
|
|
78
|
+
- **Answers land in the order they were asked.** `refreshRsc` joins a refresh already in flight for the same URL and
|
|
79
|
+
aborts one a newer refresh would overwrite (a whole payload asked again, an element asked again); a whole payload
|
|
80
|
+
keeps what an element asked for after it. A slow answer no longer paints a page the visitor has left.
|
|
81
|
+
- **Stopping.** `cancelRsc(store, ids)`, an `apiContainer`'s `cancelQuery` callback (`cancelApi(id)` in authoring) and
|
|
82
|
+
`queryCache.cancel(key)` for a browser provider: the request is dropped and what is shown stays. The server hears it:
|
|
83
|
+
`SSRRscContext.signal` aborts when the browser hangs up, and the default `getRscData` stops every element still
|
|
84
|
+
resolving — a shared render run only once nobody is waiting on it.
|
|
85
|
+
- **Pending.** A server provider's `isLoading` is true while it is asked again (`rsc.refreshing`). The `navigation`
|
|
86
|
+
source says `pending` and `pendingLocation` while a link waits for its destination's data; a second link clicked
|
|
87
|
+
before the first went supersedes it, and the first never goes.
|
|
88
|
+
- **A bound `input` asks again.** An `apiContainer`'s `input` is a prop now: bound to state, every change refetches a
|
|
89
|
+
server provider. What a refresh asks for (`req.ctx.rscParams`) wins over the `input` the element was saved with.
|
|
90
|
+
- **A section cut by its budget says how to give it more** (`rsc.elementTimeoutMs`).
|
|
91
|
+
|
|
92
|
+
## Flows
|
|
93
|
+
- **`whileRunning('latest')`**: a new firing stops the run in progress — no further step; its `runServerAction` is
|
|
94
|
+
cancelled (request and server run) and its `webHook` aborted — and runs. A search as you type. The step's context
|
|
95
|
+
carries the `signal`. Offered in the builder and the MCP.
|
|
96
|
+
- `onApiSuccess` / `onApiError` fire once per answer: a cancelled request or a loading flag that came and went no
|
|
97
|
+
longer runs the flow again.
|
|
98
|
+
- **A debounce is `whileRunning('latest')` and a `delay` first**: `delayTime` ends its wait the moment its run is
|
|
99
|
+
superseded, so only the last firing gets past it. Its `time` is a number.
|
|
100
|
+
|
|
101
|
+
## Server actions
|
|
102
|
+
- **The request budget is never silent.** A task that caught the refused fetch hid `maxRequests`; the step that ran
|
|
103
|
+
into it now logs it, and the server logs it once, naming `createServer({ action: { limits: { maxRequests } } })`.
|
|
104
|
+
- **`invalid_input` says what the value was and which type takes it** — `windows (text, got a list; declare the field
|
|
105
|
+
\`json\` to take it)`. The templates reference documents that a param that is only `|json_encode` is the value it
|
|
106
|
+
encodes.
|
|
107
|
+
- **`kv` survives a restart with no database.** `createFileKv({ file })` (`@plitzi/sdk-server/actions`) keeps the
|
|
108
|
+
in-process store in one JSON file, written whole as soon as anything changes — for one process.
|
|
109
|
+
`createSqliteKv({ file } | { db })` (`@plitzi/sdk-server/sqlite`, new entry) is a table in a SQLite file over
|
|
110
|
+
`node:sqlite`, every operation one statement, shared safely by every process on the file. Both pass the adapter
|
|
111
|
+
contract every store is held to. The `09-schedules` example uses it rather than its own copy, whose counters read
|
|
112
|
+
`22.0`.
|
|
113
|
+
|
|
114
|
+
## Authoring
|
|
115
|
+
- **What a space declares and never uses** is suggested now: `unused-class`, `unused-token`, `unused-component`, and
|
|
116
|
+
`literal-colour` — a class painted from the palette typing out a scheme token's light value. A suggestion about
|
|
117
|
+
declarations names them in `subjects`, so the MCP says one a batch left unused beside the ones the space had.
|
|
118
|
+
`unusedDeclarations(schema, style)` is the rule itself, for anything else that says "unused" (the builder does).
|
|
119
|
+
- **`pageFamily(shape, entries)`** writes pages of one shape from data: each page its id, slug, titles, folder and
|
|
120
|
+
layout, and its body built inside `scope(entry.id, …)` so two pages never give one id.
|
|
121
|
+
- **`action-output-path`** (warned): `.data` read on a provider fed by a server action, which publishes its output at
|
|
122
|
+
the root. **`actionSource(id, sample)`** types such a provider by a sample of its output.
|
|
123
|
+
- A value template (`returns: 'value'`, a computed, a step param) may name its parts with `{% set %}` before its one
|
|
124
|
+
expression, and is still that expression's value.
|
|
125
|
+
- `abs()`, `floor()`, `ceil()`, `clamp()` are refused with how they are written here (`x|abs`,
|
|
126
|
+
`x|round(0, 'floor')`, `min(max(x, low), high)`).
|
|
127
|
+
- An unknown attribute is reported against the element's props, not as "'id' does not exist in type ElementSpec[]".
|
|
128
|
+
- `explain` answers a builder's name (`reloadApi`, `cancelApi`) with its step, and knows `whileRunning`.
|
|
129
|
+
- A component's instance takes `quiet`, like any element — `component(id, { quiet: ['repeated-shape'] })`: instances
|
|
130
|
+
whose slots are filled alike on purpose stop being offered as a repeat, and an exported instance that carries one
|
|
131
|
+
typechecks.
|
|
132
|
+
- `container` and `text` take a `title`. A trigger's `preview` may hold numbers, flags, lists and `null`.
|
|
133
|
+
- **A Markdown element's headings are sections a link can name.** Each renders with the anchor its words read as
|
|
134
|
+
(`## Server data` → `#server-data`, numbered when repeated), and a link's `hash` may name one: `anchor-missing` counts
|
|
135
|
+
them, so a table of contents built from the Markdown is checked like any other link.
|
|
136
|
+
- `answerAction(page, actionId, output)` (testing): a test that would save something answers that server action in
|
|
137
|
+
the browser — the server's `kv`, and what the developer kept, are never written. A stream step gets its `done` frame.
|
|
138
|
+
|
|
139
|
+
## Plugins
|
|
140
|
+
- **A plugin's stylesheet sits below the space's.** The cascade order is now `… utilities, plitzi-sdk-plugin,
|
|
141
|
+
plitzi-sdk-runtime`, and whatever builds a plugin writes its CSS into `plitzi-sdk-plugin` (`inPluginLayer` from
|
|
142
|
+
`@plitzi/sdk-shared/style`): `plitzi pack plugin`, a server compiling one (`action: 'compile'`), and the stylesheet a
|
|
143
|
+
server copies or downloads for one. A space's classes and `customCss` now win over what the plugin's author shipped,
|
|
144
|
+
whatever the specificity — as they do over a built-in element. A plugin packed before this ships unlayered and still
|
|
145
|
+
wins until it is packed again.
|
|
146
|
+
- **Declared param types reach the callback.** A param declared `number` (new, a text box in the builder) or `boolean`
|
|
147
|
+
is handed over as one — written `5000`, or bound to text that says it; an empty number as nothing, so the component's
|
|
148
|
+
default applies.
|
|
149
|
+
- **`useElementVisible(id)`** (`@plitzi/plitzi-sdk`): whether another element is on the page — its own `visible`, every
|
|
150
|
+
container around it, the breakpoint — kept current while the plugin is mounted, at that plugin's cost alone.
|
|
151
|
+
- **A page open on a development server loads again when the server restarts** (`devReload`): `start:dev` restarting
|
|
152
|
+
on a change to the server's code reached the open page only when somebody reloaded it.
|
|
153
|
+
- **A saved plugin is swapped into the open page** (`devReload`, server mode): the page server rebuilds the plugin
|
|
154
|
+
whose source changed and the page renders the new component in place, keeping its state — no restart, no reload. A
|
|
155
|
+
change to its declaration (what the builder and the linter know of it) still reloads the page. `render()` takes
|
|
156
|
+
`{ hotPlugins: true }` and answers `{ unmount, replacePlugin }`; `PluginManager.rebuild(name)` and `onSources`. A new
|
|
157
|
+
folder in `src/plugins` is registered without a restart (`server.plugins.register`), from `create` and `create --from` alike.
|
|
158
|
+
- **A plugin brings its own server half.** `functions/index.ts` beside the component — the `defineFunctions` a
|
|
159
|
+
space's functions use — answers routes under `/fn/plugins/<type>/` and runs steps named `<type>.<action>` (origin
|
|
160
|
+
`'plugin'`, the builder's **Plugins** group). It runs with a narrower `ctx`: its own `kv` (prefixed
|
|
161
|
+
`plugin:<type>:`, its `rateLimit` and `sign` too), none of the space's credentials, no realtime publishing or grants;
|
|
162
|
+
its routes and tasks outside its namespace are refused, as are a space's routes under `/fn/plugins/`. The component
|
|
163
|
+
reaches its routes with `usePluginRoute(type)` (`@plitzi/plitzi-sdk`; `undefined` where no server runs code).
|
|
164
|
+
A page server takes them as `functions.plugins` (`{ [type]: FunctionsDefinition }`), swaps one with
|
|
165
|
+
`server.functions.setPlugin`, and asks a cloud adapter with `actionLookups.getPluginFunctions(spaceId, version)`.
|
|
166
|
+
`plitzi pack plugin` carries the source in the zip as `functions.source.json` (`PLUGIN_FUNCTIONS_SOURCE`, named by
|
|
167
|
+
the manifest's `functions`; `loadFunctionsSource` builds it) — kept privately by the platform, never published.
|
|
168
|
+
- **A plugin lays out the space's elements it holds.** `elementChildren(children)` (`@plitzi/plitzi-sdk`) hands
|
|
169
|
+
over each child element with the id it was authored under, for a dock, tabs or a masonry to place in boxes of its
|
|
170
|
+
own — instead of writing styles onto elements it does not render.
|
|
171
|
+
- **`useDisplayMode()`** (`@plitzi/plitzi-sdk`): `desktop`, `tablet` or `mobile`, at the widths the space's styles are
|
|
172
|
+
compiled at — not a breakpoint of the plugin's own.
|
|
173
|
+
- **A file a library needs whole travels inside the bundle**, imported as Vite imports it: `worker.js?raw` (its text — a
|
|
174
|
+
worker from a Blob), `engine.wasm?inline` (a base64 data URI). `plitzi pack` and a server compiling a plugin share
|
|
175
|
+
one build (`@plitzi/sdk-shared/plugins/bundle`), so a server now inlines `.avif`, `.ttf` and `.otf` as `pack` did.
|
|
176
|
+
|
|
177
|
+
## CLI and page checks
|
|
178
|
+
- **`plitzi lint`** reads a local space's source the way eslint reads code, for what the document cannot show:
|
|
179
|
+
`file-too-long`, `pages-in-one-file`, `inline-records` (rows of data written in code → `src/data/`), `repeated-css`,
|
|
180
|
+
`special-case-in-map`, `colour-not-token`, `positional-id`, `unused-file` — each at file:line with what to write
|
|
181
|
+
instead — and authoring's suggestions at the line that wrote them. `--json`, `--strict`, `--max-warnings <n>`;
|
|
182
|
+
`// plitzi-lint-disable-next-line <code> -- why` for a departure on purpose. Projects get `npm run lint:space`
|
|
183
|
+
(`upgrade` adds it to older ones). `doctor` stays the project's and never reads the space.
|
|
184
|
+
- **`--template blank`** starts with only the colours its page uses: a token declared and read by nothing is one
|
|
185
|
+
authoring now points out.
|
|
186
|
+
- **The welcome space is written as a folder**, not one 800-line file: `src/space/index.ts` (the page), `tokens.ts`,
|
|
187
|
+
`theme.ts`, `content.ts` — the shape a space keeps as it grows, and clean under `plitzi lint`. **Breaking** for
|
|
188
|
+
whoever called it: `blankSpaceSource()` is now `blankTemplateFiles({ name, dir, plugin })`, which returns the files by
|
|
189
|
+
path; `toPortableSource` keeps imports of the files beside it. A plugin package's preview space is
|
|
190
|
+
`preview/space/index.ts`.
|
|
191
|
+
- **`check`, `shot` and the generated visual tests settle instead of waiting for `networkidle`**, which never came on a
|
|
192
|
+
page with a realtime channel: `openPage` (`@plitzi/sdk-authoring`) waits for load, then quiet, counting no stream
|
|
193
|
+
that stays open.
|
|
194
|
+
- **The server is the project's in `src/config/serverOptions.ts`; `src/main.ts` stays the CLI's.** `create` writes
|
|
195
|
+
`src/config/serverOptions.ts` (handed to `createServer`, typed from `ServerConfig`, now exported by
|
|
196
|
+
`@plitzi/sdk-server`) and, with `--source local`, `src/actions/index.ts` (the space’s server actions), which `main.ts` wires
|
|
197
|
+
for calls, renders and schedules. What `main.ts` wires itself (the space's adapters, the plugins, `public/`,
|
|
198
|
+
`src/data/`, `src/functions/`, the actions' lookups) is left out of `serverOptions`' type and comes after it, so no option unwires it.
|
|
199
|
+
`upgrade` writes either file into a project that has none — only when the `main.ts` reading it is the CLI's — and
|
|
200
|
+
never replaces it; `create --from` projects read `serverOptions.ts` too.
|
|
201
|
+
- **`upgrade packages` brings up the scripts the CLI wrote and nobody changed** (`.plitzi/scaffold.json` now records
|
|
202
|
+
them); a script the project changed is left and said, as before.
|
|
203
|
+
- `start:dev` restarts on a change to the server's code — `src/main.ts`, `src/config/`, `src/actions/` and
|
|
204
|
+
`src/functions/` (there from the start, kept by a `.gitkeep`); a plugin is swapped in the open page instead, and its
|
|
205
|
+
`functions/` set again, without a restart. A function imports its siblings with `.ts`, as `src/`.
|
|
206
|
+
- `add plugin --server` writes the plugin's server half (`functions/index.ts`, a `GET`/`POST /state` example on its
|
|
207
|
+
`kv`); a package gets `@plitzi/sdk-server` as a devDependency for its types. Refused in a client-mode project.
|
|
208
|
+
- `add plugin`: `--prop rows:list` and `--prop meta:json` for data a binding fills; `--headless` writes
|
|
209
|
+
`drawsNothing: true`; the generated events hook never fires on the builder's canvas.
|
|
210
|
+
- A `channel` with no tag is boxless to a page check, like a provider; an empty list is said to have no rows, with what
|
|
211
|
+
to do, instead of "no size (0×0)".
|
|
212
|
+
- **A server-mode project keeps its `kv` in `state/kv.json`** (`createFileKv`; ignored by git): what the space's actions
|
|
213
|
+
save outlives a restart, `start:dev`'s included. `action.kv` in `src/config/serverOptions.ts` names another store.
|
|
214
|
+
- A server-mode project types what its plugins import besides code (`plitzi/assets.d.ts`): a stylesheet, an image,
|
|
215
|
+
`?raw`, `?inline` — a client-mode one has them from `vite/client`.
|
|
216
|
+
- **A project made from a space runs the server `create` writes.** It has the same `src/main.ts` as any project: it
|
|
217
|
+
now takes a free port and writes `tmp/dev-server.json` (which `check`, `shot` and the visual tests read), answers
|
|
218
|
+
`/health`, and re-authors its pages on save instead of waiting for a restart. Its actions are `src/actions/` and its
|
|
219
|
+
connectors `src/connectors/`, both there from the start, and `start:dev` restarts on them; `src/actions/index.ts`
|
|
220
|
+
exports `actions` and `connectors`, as a `create` project's does (`push` reads that). Before, `upgrade` showed its
|
|
221
|
+
`main.ts` as the project's own, and `--take all` would have put `create`'s server in place of the space's.
|
|
222
|
+
- **A `--source cloud` server project starts.** Its key is in `.env`, which nothing read: `npm start` stopped on "Set
|
|
223
|
+
PLITZI_HOST_KEY". Every server project's `src/main.ts` now reads `.env` itself (`process.loadEnvFile`), and every
|
|
224
|
+
one is given a signing key there (`PLITZI_SIGNING_SECRET`, made for it by `create`) — `ctx.sign` refused in a project
|
|
225
|
+
`create` wrote, a plugin's server half included. `PORT` is no longer written into `.env`, where it pinned 8080. A
|
|
226
|
+
cloud project keeps its `kv` in `state/kv.json` too.
|
|
227
|
+
- **`upgrade` keeps the package manager a project was written for** (`.plitzi/scaffold.json`) when it has no lockfile
|
|
228
|
+
of its own yet: a yarn or pnpm project not installed (`--no-install`), or sitting in a monorepo folder, was taken for
|
|
229
|
+
npm and its `AGENTS.md`, Playwright config and `.gitignore` replaced with npm's commands.
|
|
230
|
+
- `author`, `check`, `fix` and `push` know the element types of a project's built-only plugins
|
|
231
|
+
(`vendor/plugins/*/plugin-manifest.json`, every element each provides), as its server does.
|
|
232
|
+
- **`import` reaches Plitzi only when told to.** A site not served from this machine needs `--account` — ask the
|
|
233
|
+
person's Plitzi account whether one of their spaces verified its domain, signing in — and without it is refused,
|
|
234
|
+
saying so, before any request: an agent running `import` in a local project opened a sign-in nobody asked for. The
|
|
235
|
+
CLI skill and the generated `AGENTS.md` say to run `import` only when the user asks, and to ask before `--account`.
|
|
236
|
+
- **A server project's data is no longer on the internet.** It was `public/data/*.json`, served to anyone as a file;
|
|
237
|
+
it is `src/data/*.json`, which the server reads and never serves (`dataDir`, new in `createServer`): a provider with
|
|
238
|
+
`runtime: 'server'` and `query: '/data/<file>'` reads it, and the page arrives with it. `projectData`
|
|
239
|
+
(`@plitzi/sdk-authoring/node`) and `authorSpace`'s `serverData` hold bindings to those files, and a provider asking
|
|
240
|
+
for `/data/…` from the browser is refused (`server-data-in-browser`): nothing would answer it. What a provider reads
|
|
241
|
+
is still in the page it renders — data a page must not carry is a server action's to read. A client-mode project
|
|
242
|
+
keeps `public/data/`, which the browser has to fetch. The catalog template follows the mode
|
|
243
|
+
(`catalogTemplateFiles({ mode })`). `public/` holds only what is meant for everyone.
|
|
244
|
+
- **The project's own server code is `src/functions/`**, with the rest of its source — typechecked with it, left out of
|
|
245
|
+
`tsconfig.build.json` (the server builds it at boot). `functions pull`/`push`/`dev`, `push`, `pull` and `create
|
|
246
|
+
--from` follow. The `kv` folder is `state/` (it was `data/`, beside a data folder that was something else).
|
|
247
|
+
- **What is the CLI's is in `plitzi/`, apart from `src/`.** `plitzi/author.ts`, `plitzi/assets.d.ts` (server mode) or
|
|
248
|
+
`plitzi/preflight.css` (client mode), and `plitzi/README.md` — which says what each folder of `src/` is, instead of a
|
|
249
|
+
README in every one. `src/main.ts` stays where an entry point is looked for, the CLI's all the same.
|
|
250
|
+
`src/plugins/declarations.ts` is gone: a plugin is declared by its folder's `declaration.ts`, found by the server,
|
|
251
|
+
`author`, `check`, `fix`, `push` and the visual test alike (`pluginDeclarations` from `@plitzi/sdk-authoring/node`;
|
|
252
|
+
Vite's `import.meta.glob` in client mode).
|
|
253
|
+
- `functions.plugins` is in `SSRServerConfig`'s type and checked as the server starts: a project passing its plugins'
|
|
254
|
+
server halves did not typecheck.
|
|
255
|
+
- **A project's source is folders that grow.** The space is `src/space/` — its `index.ts` exports it as `space` and
|
|
256
|
+
assembles the rest (the catalog template's `src/site/` is `src/space/` now; `create --from` writes the space's own
|
|
257
|
+
`index.ts` there, exported as `space` too). The server actions are `src/actions/` — `index.ts` lists them, one action
|
|
258
|
+
a file, as `create --from` already had them — and what the server does besides serving the space is
|
|
259
|
+
`src/config/serverOptions.ts`. `start:dev` watches `src/config` and `src/actions` whole.
|
|
260
|
+
- **One server for every project, kept by `upgrade`.** `src/main.ts` runs what a project holds from where it lands — a
|
|
261
|
+
runtime in `src/runtime/` (or built only, `vendor/runtime.bundle`), plugins built only (`vendor/plugins/`), the
|
|
262
|
+
actions' connectors — so `create --from` writes no `main.ts` or `.prettierignore` of its own any more, and `upgrade`
|
|
263
|
+
keeps both current in projects made from a space too. `loadRuntimeModule` (`@plitzi/sdk-server/runtime`): a project's
|
|
264
|
+
runtime module, or nothing when it has none.
|
|
265
|
+
- **`plitzi add runtime`** writes `src/runtime/index.ts` — run by the project's server (`npm start` answers its
|
|
266
|
+
endpoints) and sent by `plitzi runtime push`, whose default entry it is now — and has `start:dev` restart on it. A
|
|
267
|
+
space taken out with a runtime gets `src/runtime/index.ts` handing over the module its source starts at.
|
|
268
|
+
- **`push` sends the space's files back as their CDN addresses.** `create --from` and `pull` write each CDN address as
|
|
269
|
+
the project's path (`/assets/a.png`, served from `public/assets/`); `push` sent those paths as they were, and the
|
|
270
|
+
space's pictures and data pointed at nothing on Plitzi. It also says, before sending, what Plitzi would not have: a
|
|
271
|
+
provider reading a file `src/data/` does not hold, and a file the space names that is not on its CDN.
|
|
272
|
+
- **`push` sends a project's data and its files.** Two new parts: `data` — `src/data/` whole, kept by Plitzi as the
|
|
273
|
+
space's own data (private, frozen with each publish, read by the page server of the version it renders; refused when
|
|
274
|
+
the space's copy changed since the project last had it, unless `--force`) — and `files` — each changed file of
|
|
275
|
+
`public/assets/`, put at the same path under the space's `assets/` on its CDN, so a pull brings it back where it was.
|
|
276
|
+
`create --from` and `pull` write the space's data into `src/data/`. `getData` joins the action lookups
|
|
277
|
+
(`ActionLookupsConfig`), and the page server resolves `/data/<file>` through it when there is no `dataDir`.
|
|
278
|
+
- **A space's data is edited in the builder and by agents.** The builder's Server view has a **Data** tab: the JSON
|
|
279
|
+
files the space's server providers read (`/data/<file>`), a file list and a JSON editor, saved whole against the
|
|
280
|
+
copy it read (⌘S; a newer copy is refused, a broken file named). The MCP reads it as `plitzi://data/{env}` and writes
|
|
281
|
+
it with `upsertDataFile` / `deleteDataFile` (`getData` / `saveData` among the adapters; a file that is not JSON is
|
|
282
|
+
refused as it is written), and the guide has a Data section. One write path for the builder, agents and `plitzi push`
|
|
283
|
+
(`SpaceData` / `SpaceSaveData` over GraphQL, under `spaceManage`), one history. `DataDraft` / `DataSaveResult` are
|
|
284
|
+
in `@plitzi/sdk-shared`. The builder's file list is shared by Functions and Data (`modules/FileTree`).
|
|
285
|
+
- **`plitzi doctor`**: whether the project the CLI set up is whole, checked against what it is now — a developer may
|
|
286
|
+
change any file. Packages (declared, installed at versions that agree, one copy of the SDK and of React), the CLI's
|
|
287
|
+
files and scripts (as `upgrade` sees them, one planner for both), the file each Node script starts and every folder
|
|
288
|
+
`start:dev` watches, the TypeScript configs, `.gitignore` and `.env` (never in git; the signing secret as long as the
|
|
289
|
+
project's server wants it), the code Node runs as written (relative imports with their extension, JSON with its
|
|
290
|
+
attribute, no JSX, every package declared — walked with esbuild), each plugin folder against its declaration, the data
|
|
291
|
+
files, `src/functions/` built by the project's own sdk-server, `.plitzi/` and the skills. Each finding has an area, a
|
|
292
|
+
code, the file and its fix; `--json`, `--strict`; exit 1 on an error. It never checks the space — `npm run author`
|
|
293
|
+
and `check` do — and every report says so. A layout an older CLI left (`src/space.ts`, `src/author.ts`,
|
|
294
|
+
`functions/` at the root…) is its own area, checked first and alone. `--fix` repairs what is simple and safe —
|
|
295
|
+
that layout moved with every import, URL and script following (and the scaffold record with it), dead files,
|
|
296
|
+
`.gitignore`, `"type": "module"`, a watched folder, a signing secret — then checks again; `--dry-run` says what.
|
|
297
|
+
Each report ends with what to run next. `upgrade` writes no file over an older layout, and says `doctor --fix`.
|
|
298
|
+
`buildFunctions` and `FunctionsBuildError` are exported from
|
|
299
|
+
`@plitzi/sdk-server/functions-runner`, `MIN_SIGNING_SECRET_LENGTH` from `@plitzi/sdk-server/actions`.
|
|
300
|
+
- **`--dry-run`** on every command that writes or sends — `create`, `add plugin`, `add runtime`, `pull`, `push`,
|
|
301
|
+
`pack plugin`, `source`, `import`, `upload plugin`, `functions pull`/`push`, `runtime push`/`start`/`stop`/`size`/
|
|
302
|
+
`vars`, `skills update`, `doctor --fix`: each file it would write (`+` new, `~` replaced, `-` removed), what it would install or run, what it would
|
|
303
|
+
send and where, and none of it done. It still reads what it needs to say so.
|
|
304
|
+
- **A new project is formatted from the start**, every template and mode: its first `format` changes nothing. The CLI's
|
|
305
|
+
own files are in its `.prettierignore`, so formatting never turns one into a file `upgrade` believes was changed.
|
|
306
|
+
|
|
307
|
+
## Builder
|
|
308
|
+
- **The pages panel keeps its folders as you left them** — open or closed, per space, across reloads — the way the
|
|
309
|
+
style inspector keeps its sections. A folder starts closed.
|
|
310
|
+
- **Usages**, a panel beside Layers: where each component, class, token, space variable and data source is used,
|
|
311
|
+
page by page — what reads it and which elements — and which nothing uses, by authoring's own rule. A click selects
|
|
312
|
+
the element, inside a component too.
|
|
313
|
+
- **Revealing an element inside a component opens the component** (the Usages panel, ⌘P, the issues and the history all
|
|
314
|
+
reveal through it); before, the selection was dropped. **Panels stay open** when a component opens or closes.
|
|
315
|
+
- **The canvas dims a page's layout around its body again when the layout or its slot draws no box**
|
|
316
|
+
(`display: contents`, which the efficiency guide recommends): the hole was measured as a rect of zeros and the whole
|
|
317
|
+
page was dimmed. A box-less element is measured by what it holds, and the mask by the box that positions it.
|
|
318
|
+
- **Elements is one category at a time.** A row of chips — each category with its count, and the space's components as
|
|
319
|
+
one more — picks what the panel shows, remembered between sessions, so the panel stays the same height however many
|
|
320
|
+
elements plugins add. A search looks through every category and the components at once. Each element is a tile: its
|
|
321
|
+
icon, its whole name, and what it is on hover. Container, Button, Form, Form Control, Dropdown Popup, List Item, Rich
|
|
322
|
+
Text, Dialog Container and Tab Container Item have icons of their own (`sdk-elements`), none shared with another
|
|
323
|
+
element or with the component and snippet icons.
|
|
324
|
+
- **Layers reads as a tree and is driven from the keyboard.** A guide per depth, a chevron that turns, the component's
|
|
325
|
+
name beside an element that is one, and the selected row kept in view. ↑/↓, Home/End, → to open or go in, ← to close
|
|
326
|
+
or go up. A row under a closed ancestor is no longer shown. (plitzi-ui's `Tree`.)
|
|
327
|
+
- **Motion and preview no longer share an icon.** Playing the page's motion is a wand, which pulses while it plays;
|
|
328
|
+
preview is an eye, and a pen to go back to editing.
|
|
329
|
+
- **A component's settings fit their modal, however many props it has.** The modal is wider; the name and folder
|
|
330
|
+
share a line, and each prop is one compact row — its name, its kind, required, remove — with what a binding writes to
|
|
331
|
+
read it (`{{ props.<name> }}`) or what is wrong with it, and what it is for, beneath. The fields scroll and the buttons
|
|
332
|
+
stay in view. Props and slots are titled sections, and a slot shows its id.
|
|
333
|
+
|
|
334
|
+
## Packages
|
|
335
|
+
- **`GET /auth/continue` takes `?fallback=`**: where to go when `redirect` is refused, vetted by the same check. A sign-in
|
|
336
|
+
screen's way back sends its site there, so leaving without signing in never lands on "you are signed in".
|
|
337
|
+
- **Markdown renders headings you can link to and code you can copy.** A heading carries its anchor and a `#` link to
|
|
338
|
+
itself; a fenced block a header with its language and a **Copy** button. The anchor is `@plitzi/sdk-shared`'s:
|
|
339
|
+
`anchorOf`, `uniqueAnchor` and `markdownHeadings` (`schema/anchor`, `schema/markdownHeadings`) — what the element
|
|
340
|
+
renders, what authoring checks a link against and what a table of contents is built from are one function. Needs
|
|
341
|
+
`@plitzi/plitzi-ui` 1.6.31 (its `Markdown` takes `headingAnchor`).
|
|
342
|
+
- **Every package declares what it imports, and nothing more.** `react` is a peer of `sdk-auth`, `sdk-event-bridge`,
|
|
343
|
+
`sdk-interactions`, `sdk-style` and `sdk-variables`; `sdk-schema` depends on `immer`, `sdk-elements` on
|
|
344
|
+
`@dr.pogodin/react-helmet`, `sdk-plugins` on `@plitzi/plitzi-ui`, `sdk-style` on `@plitzi/sdk-event-bridge` and
|
|
345
|
+
`sdk-dev-tools` on `@plitzi/sdk-plugins` — each worked only because `@plitzi/plitzi-sdk` brought them, and failed
|
|
346
|
+
installed alone or under a strict linker. `prop-types` and the `@plitzi/*` dependencies nothing imported are gone:
|
|
347
|
+
`sdk-mcp` no longer declares `@plitzi/sdk-elements`, which its code does not import — it still arrives through
|
|
348
|
+
`@plitzi/plitzi-sdk`.
|
|
349
|
+
|
|
350
|
+
- Updated dependencies [3bce653]
|
|
351
|
+
- @plitzi/sdk-plugins@0.38.5
|
|
352
|
+
- @plitzi/sdk-schema@0.38.5
|
|
353
|
+
- @plitzi/sdk-shared@0.38.5
|
|
354
|
+
|
|
3
355
|
## 0.38.4
|
|
4
356
|
|
|
5
357
|
### Patch Changes
|
|
@@ -8,6 +8,11 @@ export type DevToolsContainerProps = {
|
|
|
8
8
|
instanceId?: string;
|
|
9
9
|
devToolsStyle?: string;
|
|
10
10
|
devToolsStyleLink?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Font Awesome's sheet, linked inside the panel's shadow root beside its own: a page's stylesheets stop at the root,
|
|
13
|
+
* and the panel's icons are classes of that sheet (its fonts are the page's, declared by the same sheet there).
|
|
14
|
+
*/
|
|
15
|
+
devToolsIconsLink?: string;
|
|
11
16
|
renderMode?: 'default' | 'shadow';
|
|
12
17
|
/**
|
|
13
18
|
* What scrolls while the panel is folded away.
|
|
@@ -26,5 +31,5 @@ export type DevToolsContainerProps = {
|
|
|
26
31
|
*/
|
|
27
32
|
qa?: boolean;
|
|
28
33
|
};
|
|
29
|
-
declare const DevToolsContainer: ({ children, className, innerClassName, enabled, instanceId, renderMode, scroll, qa, devToolsStyle, devToolsStyleLink }: DevToolsContainerProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
|
|
34
|
+
declare const DevToolsContainer: ({ children, className, innerClassName, enabled, instanceId, renderMode, scroll, qa, devToolsStyle, devToolsStyleLink, devToolsIconsLink }: DevToolsContainerProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
|
|
30
35
|
export default DevToolsContainer;
|
|
@@ -13,62 +13,66 @@ import { DevStoreScopeContext as h } from "@plitzi/nexus/react";
|
|
|
13
13
|
import g from "@plitzi/sdk-shared/theme/useTheme";
|
|
14
14
|
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
15
15
|
//#region src/DevToolsContainer.tsx
|
|
16
|
-
var y = d(() => import("./components/DevToolsOverlay/index.mjs")), b = "horizontal", x = 0, S = ({ children: d, className: S, innerClassName: C, enabled: w = !1, instanceId: T, renderMode: E = "default", scroll: D = "container", qa: O = !1, devToolsStyle: k = "", devToolsStyleLink: A = "" }) => {
|
|
17
|
-
let { resolvedTheme:
|
|
18
|
-
|
|
19
|
-
let
|
|
20
|
-
o(w), a(
|
|
21
|
-
let
|
|
22
|
-
e &&
|
|
23
|
-
}, [
|
|
24
|
-
|
|
25
|
-
}, [
|
|
16
|
+
var y = d(() => import("./components/DevToolsOverlay/index.mjs")), b = "horizontal", x = 0, S = ({ children: d, className: S, innerClassName: C, enabled: w = !1, instanceId: T, renderMode: E = "default", scroll: D = "container", qa: O = !1, devToolsStyle: k = "", devToolsStyleLink: A = "", devToolsIconsLink: j = "" }) => {
|
|
17
|
+
let { resolvedTheme: M } = g(), [N, P] = c("plitzi-sdk.dev-tools.orientation", b), [F, I] = c("plitzi-sdk.dev-tools.collapsed", !0), [L, R] = c("plitzi-sdk.dev-tools.tab", "logs"), [z, B] = m(), V = p(void 0), H = p(null);
|
|
18
|
+
V.current ||= `sdk-instance-${++x}`;
|
|
19
|
+
let U = T || V.current, W = i(), G = W ? N : b, K = r(U, w);
|
|
20
|
+
o(w), a(K, U), e(K);
|
|
21
|
+
let q = f((e) => P(e), [P]), J = f((e) => {
|
|
22
|
+
e && R("logs"), B(e), I(!1);
|
|
23
|
+
}, [I, R]), Y = f(() => I(!0), [I]), X = f((e) => {
|
|
24
|
+
B(void 0), R(e);
|
|
25
|
+
}, [R]);
|
|
26
26
|
if (!w) return d;
|
|
27
|
-
let
|
|
27
|
+
let Z = D === "document" && (!W || F), Q = K && W && /* @__PURE__ */ _(n, { children: /* @__PURE__ */ _(t, { children: /* @__PURE__ */ v(u, {
|
|
28
28
|
fallback: null,
|
|
29
29
|
children: [E === "default" && /* @__PURE__ */ _(y, {
|
|
30
|
-
className: l({ dark:
|
|
31
|
-
collapsed:
|
|
32
|
-
orientation:
|
|
33
|
-
tabSelected:
|
|
34
|
-
logTypeFilter:
|
|
35
|
-
onOpen:
|
|
36
|
-
onCollapse:
|
|
37
|
-
onTabSelect:
|
|
38
|
-
onChangeOrientation:
|
|
39
|
-
pageRef:
|
|
30
|
+
className: l({ dark: M === "dark" }),
|
|
31
|
+
collapsed: F,
|
|
32
|
+
orientation: G,
|
|
33
|
+
tabSelected: L,
|
|
34
|
+
logTypeFilter: z,
|
|
35
|
+
onOpen: J,
|
|
36
|
+
onCollapse: Y,
|
|
37
|
+
onTabSelect: X,
|
|
38
|
+
onChangeOrientation: q,
|
|
39
|
+
pageRef: H,
|
|
40
40
|
qa: O
|
|
41
|
-
}), E === "shadow" && /* @__PURE__ */ v(s, { children: [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
}), E === "shadow" && /* @__PURE__ */ v(s, { children: [
|
|
42
|
+
j && /* @__PURE__ */ _(s.Link, { href: j }),
|
|
43
|
+
A && /* @__PURE__ */ _(s.Link, { href: A }),
|
|
44
|
+
/* @__PURE__ */ v(s.Content, { children: [/* @__PURE__ */ _("style", { dangerouslySetInnerHTML: { __html: k } }), /* @__PURE__ */ _(y, {
|
|
45
|
+
className: l({ dark: M === "dark" }),
|
|
46
|
+
collapsed: F,
|
|
47
|
+
orientation: G,
|
|
48
|
+
tabSelected: L,
|
|
49
|
+
logTypeFilter: z,
|
|
50
|
+
onOpen: J,
|
|
51
|
+
onCollapse: Y,
|
|
52
|
+
onTabSelect: X,
|
|
53
|
+
onChangeOrientation: q,
|
|
54
|
+
pageRef: H,
|
|
55
|
+
qa: O
|
|
56
|
+
})] })
|
|
57
|
+
] })]
|
|
54
58
|
}) }) });
|
|
55
59
|
return /* @__PURE__ */ v("div", {
|
|
56
60
|
className: l("relative flex min-w-0 grow", {
|
|
57
|
-
"overflow-auto": !
|
|
58
|
-
"flex-col":
|
|
59
|
-
"h-screen": !
|
|
61
|
+
"overflow-auto": !Z,
|
|
62
|
+
"flex-col": Z || G === "horizontal",
|
|
63
|
+
"h-screen": !Z && G === "vertical"
|
|
60
64
|
}, S),
|
|
61
65
|
children: [/* @__PURE__ */ _(h, {
|
|
62
|
-
value:
|
|
66
|
+
value: U,
|
|
63
67
|
children: /* @__PURE__ */ _("div", {
|
|
64
|
-
ref:
|
|
65
|
-
className: l("grow", { "basis-0 flex-col overflow-auto": !
|
|
68
|
+
ref: H,
|
|
69
|
+
className: l("grow", { "basis-0 flex-col overflow-auto": !Z }, C),
|
|
66
70
|
children: d
|
|
67
71
|
})
|
|
68
|
-
}),
|
|
72
|
+
}), Z ? /* @__PURE__ */ _("div", {
|
|
69
73
|
className: "sticky bottom-0 h-0",
|
|
70
|
-
children:
|
|
71
|
-
}) :
|
|
74
|
+
children: Q
|
|
75
|
+
}) : Q]
|
|
72
76
|
});
|
|
73
77
|
};
|
|
74
78
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-dev-tools",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.6",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -1210,11 +1210,10 @@
|
|
|
1210
1210
|
},
|
|
1211
1211
|
"dependencies": {
|
|
1212
1212
|
"@plitzi/nexus": "^1.4.0",
|
|
1213
|
-
"@plitzi/plitzi-ui": "^1.6.
|
|
1214
|
-
"@plitzi/sdk-
|
|
1215
|
-
"@plitzi/sdk-schema": "0.38.
|
|
1216
|
-
"@plitzi/sdk-shared": "0.38.
|
|
1217
|
-
"@plitzi/sdk-style": "0.38.4",
|
|
1213
|
+
"@plitzi/plitzi-ui": "^1.6.31",
|
|
1214
|
+
"@plitzi/sdk-plugins": "0.38.6",
|
|
1215
|
+
"@plitzi/sdk-schema": "0.38.6",
|
|
1216
|
+
"@plitzi/sdk-shared": "0.38.6",
|
|
1218
1217
|
"@uiw/react-json-view": "^2.0.0-alpha.43",
|
|
1219
1218
|
"clsx": "^2.1.1"
|
|
1220
1219
|
}
|