@plitzi/sdk-dev-tools 0.38.7 → 0.38.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/CHANGELOG.md CHANGED
@@ -1,5 +1,80 @@
1
1
  # @plitzi/sdk-dev-tools
2
2
 
3
+ ## 0.38.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 64f4cd6: - **`unusedPort()`** (`@plitzi/sdk-server`): a port the system has just handed out, for a test to listen on. The
8
+ package's own tests and `@plitzi/sdk-mcp`'s listened on fixed ports in the ephemeral range (393xx), which any
9
+ outgoing connection of a test running beside them could take: CI failed with `EADDRINUSE` on runs with nothing
10
+ wrong. Every one now listens on a port the system gives it.
11
+ - **Brotli at quality 5** (`@plitzi/sdk-server`): `compression.brotliQuality`, for a page rendered for one request, is
12
+ 5 (was 2). At 2 a 220 KB page came out larger than gzip — 36 KB against 31 — and at 5 it is 29 KB, for the CPU gzip
13
+ spends; on half a core ~0.1 ms a page.
14
+ - **`verify` checks the pages for signed-in visitors** (`@plitzi/cli`): a page that sends the browser to sign in is
15
+ checked again signed in as the account `.env` names — `PLITZI_CHECK_USER`, `PLITZI_CHECK_PASSWORD` (the environment
16
+ wins over `.env`). With none named, `verify` says how. `page check --as` reads the password from `.env` too, and
17
+ `page check` takes several pages, in one browser.
18
+ - **An address that shows nothing answers 404** (`@plitzi/sdk-shared`, `@plitzi/plitzi-sdk`, `@plitzi/sdk-server`):
19
+ one no page answers was sent to the home page with a 302 — every typo read as the home page. A page whose slug is
20
+ `'*'` is now the space's page for it, sent with status 404 (a folder may have its own; the deepest wins), and a page
21
+ gated off by a flag shows it too. Never kept in the page cache: an address asked for at random filled it. Only a slug
22
+ that IS `'*'`: a page answering a subtree by its own (`spaces/:spaceId/update/*`) stays a page like any other.
23
+ - **`authorSpace` gives a space with no `'*'` page a plain one** (`@plitzi/sdk-authoring`), in the home page's layout,
24
+ and says so: suggestion `not-found-page`. The project templates carry their own.
25
+ - **`notFound` on a server provider** (`@plitzi/sdk-elements`, `@plitzi/sdk-server`): an expression against its answer
26
+ (`{{ source.found == false }}`); when it is true the page is sent with status 404, rendered as written. Refused on a
27
+ browser provider (`not-found-in-browser`) and when it is not one expression (`not-found-not-a-template`).
28
+ - **`page check` and `verify` know a page sent with 404** (`@plitzi/cli`): it is said, not failed; the space's `'*'`
29
+ page is checked at an address no page has, and fails if it is not sent with 404.
30
+ - **A form field draws no background of its own** (`@plitzi/sdk-elements`): the `<input>` inside a form control's box
31
+ (`field`) took `background-color: inherit`, and painted a translucent box colour a second time — a darker box inside
32
+ the padding (Tremor's search). It is `transparent`: the box shows through it.
33
+ - **`space lint` offers `quiet` only where there is an element to put it on** (`@plitzi/cli`): a suggestion about what
34
+ the space lacks — `not-found-page` — is answered by writing it.
35
+ - **`feedback --previous`** (`@plitzi/cli`): the brief says what to do when an earlier report's link no longer opens —
36
+ say so, and ask the person for the highest id it had.
37
+ - **`start:prod` runs in production by itself** (`@plitzi/cli`): `NODE_ENV=production node …`. Without the variable a
38
+ deployed project was a development server — dev tools on, and every public action answering its `steps` and `trace`
39
+ (each step's result, what the `output` was meant to leave out). `doctor` says a `start:prod` that does not
40
+ (`start-prod-not-production`); `plitzi upgrade --write` rewrites the script.
41
+ - **A project's `ActionRefusal` reaches the flow** (`@plitzi/sdk-server`): a functions bundle carries its own copy of the
42
+ class, so `instanceof` never knew it and the run lost its reason (`{{ x.error }}` empty). Told apart by name now.
43
+ - **Plugins are not remounted after hydration** (`@plitzi/sdk-elements`): the registry wrapped each plugin again when
44
+ the host handed it over again, a new component type every time — the server's HTML thrown away, entrances replayed,
45
+ effects run twice. Each plugin component is wrapped once.
46
+ - **`start:dev` survives a space that does not author** (`@plitzi/sdk-server`): a restart while the space had an error
47
+ died, and fixing the space woke nothing. It comes up answering every page with what is wrong (503), and loads the
48
+ space the first time a save authors.
49
+ - **`page check` sees what is cut off at the screen's edge** (`@plitzi/sdk-authoring`, `@plitzi/cli`): a link or words an
50
+ ancestor hides past the viewport, which no sideways scroll shows (`cut-off`).
51
+ - **`page shot --click <element...> --sheet`** (`@plitzi/cli`): elements clicked in order — a name or a CSS selector,
52
+ inside a plugin too — pictured after each (`--frames`/`--every`), with how much changed, and every picture on one
53
+ contact sheet. The dev tools' badge is no longer in a picture: its shadow root is marked (`@plitzi/sdk-dev-tools`).
54
+ - **`formControl` is optional unless it says `required: true`** (`@plitzi/sdk-elements`), as an HTML field is. A field
55
+ left without `required` in an older space was required, and is not now.
56
+ - **`text({ decorative })`, `list({ label })`** (`@plitzi/sdk-elements`); **`writing-mode`, `text-orientation`** in the
57
+ CSS vocabulary (`@plitzi/sdk-shared`).
58
+ - **`unused-token` reads the plugins' stylesheets** (`@plitzi/sdk-authoring`): `authorSpace`'s `stylesheets`, which
59
+ `projectAuthoring` fills with every `.css` under `src/plugins/` — a token only a plugin used was said to be unused.
60
+ - **`id-taken` on a provider placed on two pages points at the layout they share** (`@plitzi/sdk-authoring`), not at
61
+ `scope()`, which renamed its source and every template reading it.
62
+ - **The welcome template's tokens keep their names** (`@plitzi/sdk-authoring`): `satisfies`, not an annotation, so
63
+ `tokens(variables).card` typechecks as the cheatsheet teaches.
64
+ - Updated dependencies [64f4cd6]
65
+ - @plitzi/sdk-shared@0.38.9
66
+ - @plitzi/sdk-plugins@0.38.9
67
+ - @plitzi/sdk-schema@0.38.9
68
+
69
+ ## 0.38.8
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies [1b45aae]
74
+ - @plitzi/sdk-schema@0.38.8
75
+ - @plitzi/sdk-shared@0.38.8
76
+ - @plitzi/sdk-plugins@0.38.8
77
+
3
78
  ## 0.38.7
4
79
 
5
80
  ### Patch Changes
@@ -10,70 +10,75 @@ import c from "@plitzi/plitzi-ui/hooks/useStorage";
10
10
  import l from "clsx";
11
11
  import { Suspense as u, lazy as d, useCallback as f, useRef as p, useState as m } from "react";
12
12
  import { DevStoreScopeContext as h } from "@plitzi/nexus/react";
13
- import g from "@plitzi/sdk-shared/theme/useTheme";
14
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
13
+ import { DEV_TOOLS_ATTRIBUTE as g } from "@plitzi/sdk-shared/devTools/chrome";
14
+ import _ from "@plitzi/sdk-shared/theme/useTheme";
15
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
15
16
  //#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 = "", 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
- if (!w) return d;
27
- let Z = D === "document" && (!W || F), Q = K && W && /* @__PURE__ */ _(n, { children: /* @__PURE__ */ _(t, { children: /* @__PURE__ */ v(u, {
17
+ var b = d(() => import("./components/DevToolsOverlay/index.mjs")), x = "horizontal", S = 0, C = ({ children: d, className: C, innerClassName: w, enabled: T = !1, instanceId: E, renderMode: D = "default", scroll: O = "container", qa: k = !1, devToolsStyle: A = "", devToolsStyleLink: j = "", devToolsIconsLink: M = "" }) => {
18
+ let { resolvedTheme: N } = _(), [P, F] = c("plitzi-sdk.dev-tools.orientation", x), [I, L] = c("plitzi-sdk.dev-tools.collapsed", !0), [R, z] = c("plitzi-sdk.dev-tools.tab", "logs"), [B, V] = m(), H = p(void 0), U = p(null);
19
+ H.current ||= `sdk-instance-${++S}`;
20
+ let W = E || H.current, G = i(), K = G ? P : x, q = r(W, T);
21
+ o(T), a(q, W), e(q);
22
+ let J = f((e) => F(e), [F]), Y = f((e) => {
23
+ e && z("logs"), V(e), L(!1);
24
+ }, [L, z]), X = f(() => L(!0), [L]), Z = f((e) => {
25
+ V(void 0), z(e);
26
+ }, [z]);
27
+ if (!T) return d;
28
+ let Q = O === "document" && (!G || I), $ = q && G && /* @__PURE__ */ v(n, { children: /* @__PURE__ */ v(t, { children: /* @__PURE__ */ y(u, {
28
29
  fallback: null,
29
- children: [E === "default" && /* @__PURE__ */ _(y, {
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
- qa: O
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
- ] })]
30
+ children: [D === "default" && /* @__PURE__ */ v(b, {
31
+ className: l({ dark: N === "dark" }),
32
+ collapsed: I,
33
+ orientation: K,
34
+ tabSelected: R,
35
+ logTypeFilter: B,
36
+ onOpen: Y,
37
+ onCollapse: X,
38
+ onTabSelect: Z,
39
+ onChangeOrientation: J,
40
+ pageRef: U,
41
+ qa: k
42
+ }), D === "shadow" && /* @__PURE__ */ v("div", {
43
+ style: { display: "contents" },
44
+ [g]: "",
45
+ children: /* @__PURE__ */ y(s, { children: [
46
+ M && /* @__PURE__ */ v(s.Link, { href: M }),
47
+ j && /* @__PURE__ */ v(s.Link, { href: j }),
48
+ /* @__PURE__ */ y(s.Content, { children: [/* @__PURE__ */ v("style", { dangerouslySetInnerHTML: { __html: A } }), /* @__PURE__ */ v(b, {
49
+ className: l({ dark: N === "dark" }),
50
+ collapsed: I,
51
+ orientation: K,
52
+ tabSelected: R,
53
+ logTypeFilter: B,
54
+ onOpen: Y,
55
+ onCollapse: X,
56
+ onTabSelect: Z,
57
+ onChangeOrientation: J,
58
+ pageRef: U,
59
+ qa: k
60
+ })] })
61
+ ] })
62
+ })]
58
63
  }) }) });
59
- return /* @__PURE__ */ v("div", {
64
+ return /* @__PURE__ */ y("div", {
60
65
  className: l("relative flex min-w-0 grow", {
61
- "overflow-auto": !Z,
62
- "flex-col": Z || G === "horizontal",
63
- "h-screen": !Z && G === "vertical"
64
- }, S),
65
- children: [/* @__PURE__ */ _(h, {
66
- value: U,
67
- children: /* @__PURE__ */ _("div", {
68
- ref: H,
69
- className: l("grow", { "basis-0 flex-col overflow-auto": !Z }, C),
66
+ "overflow-auto": !Q,
67
+ "flex-col": Q || K === "horizontal",
68
+ "h-screen": !Q && K === "vertical"
69
+ }, C),
70
+ children: [/* @__PURE__ */ v(h, {
71
+ value: W,
72
+ children: /* @__PURE__ */ v("div", {
73
+ ref: U,
74
+ className: l("grow", { "basis-0 flex-col overflow-auto": !Q }, w),
70
75
  children: d
71
76
  })
72
- }), Z ? /* @__PURE__ */ _("div", {
77
+ }), Q ? /* @__PURE__ */ v("div", {
73
78
  className: "sticky bottom-0 h-0",
74
- children: Q
75
- }) : Q]
79
+ children: $
80
+ }) : $]
76
81
  });
77
82
  };
78
83
  //#endregion
79
- export { S as default };
84
+ export { C as default };
@@ -1,4 +1,4 @@
1
- /** An element as it is asked about — by the panel, by `window.__plitzi.element()` and through it `plitzi check`. */
1
+ /** An element as it is asked about — by the panel, by `window.__plitzi.element()` and through it `plitzi page check`. */
2
2
  export type ElementReport = {
3
3
  id: string;
4
4
  type?: string;
@@ -1,11 +1,11 @@
1
1
  import e from "clsx";
2
2
  import { use as t, useCallback as n, useMemo as r } from "react";
3
- import i from "@plitzi/sdk-shared/devTools/DevToolsContext";
4
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
- import { DEV_TOOLS_ATTRIBUTE as s } from "@plitzi/sdk-shared/devTools/chrome";
3
+ import { DEV_TOOLS_ATTRIBUTE as i } from "@plitzi/sdk-shared/devTools/chrome";
4
+ import a from "@plitzi/sdk-shared/devTools/DevToolsContext";
5
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
6
  //#region src/components/DevToolsIndicator/DevToolsIndicator.tsx
7
7
  var c = ({ className: c, onOpen: l }) => {
8
- let { logs: u } = t(i), { errors: d, warnings: f } = r(() => u.reduce((e, { logType: t }) => ({
8
+ let { logs: u } = t(a), { errors: d, warnings: f } = r(() => u.reduce((e, { logType: t }) => ({
9
9
  errors: t === "danger" ? e.errors + 1 : e.errors,
10
10
  warnings: t === "warning" ? e.warnings + 1 : e.warnings
11
11
  }), {
@@ -26,24 +26,24 @@ var c = ({ className: c, onOpen: l }) => {
26
26
  f,
27
27
  l
28
28
  ]);
29
- return /* @__PURE__ */ a("div", {
29
+ return /* @__PURE__ */ o("div", {
30
30
  className: e("absolute bottom-3 left-3 z-[1000000]", c),
31
- [s]: "",
32
- children: /* @__PURE__ */ o("button", {
31
+ [i]: "",
32
+ children: /* @__PURE__ */ s("button", {
33
33
  className: e("flex cursor-pointer items-center gap-2 rounded border border-zinc-200 bg-white px-2 py-1.5 text-[12px]/[16px]", "font-bold text-zinc-600 shadow-md transition-colors select-none hover:bg-zinc-50", "dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-800"),
34
34
  title: "Plitzi dev tools",
35
35
  onClick: p,
36
36
  children: [
37
37
  "Plitzi",
38
- d > 0 && /* @__PURE__ */ o("span", {
38
+ d > 0 && /* @__PURE__ */ s("span", {
39
39
  className: "flex items-center gap-1 text-red-600 dark:text-red-400",
40
- children: [/* @__PURE__ */ a("i", { className: "fa-regular fa-circle-xmark text-[11px]" }), d]
40
+ children: [/* @__PURE__ */ o("i", { className: "fa-regular fa-circle-xmark text-[11px]" }), d]
41
41
  }),
42
- f > 0 && /* @__PURE__ */ o("span", {
42
+ f > 0 && /* @__PURE__ */ s("span", {
43
43
  className: "flex items-center gap-1 text-amber-600 dark:text-amber-400",
44
- children: [/* @__PURE__ */ a("i", { className: "fa-solid fa-triangle-exclamation text-[11px]" }), f]
44
+ children: [/* @__PURE__ */ o("i", { className: "fa-solid fa-triangle-exclamation text-[11px]" }), f]
45
45
  }),
46
- d === 0 && f === 0 && /* @__PURE__ */ a("i", { className: "fa-solid fa-terminal text-[11px] text-zinc-400" })
46
+ d === 0 && f === 0 && /* @__PURE__ */ o("i", { className: "fa-solid fa-terminal text-[11px] text-zinc-400" })
47
47
  ]
48
48
  })
49
49
  });
@@ -4,20 +4,20 @@ import n from "./DevToolsSubHeader.mjs";
4
4
  import r from "@plitzi/plitzi-ui/hooks/useStorage";
5
5
  import i from "clsx";
6
6
  import { useCallback as a, useMemo as o, useRef as s, useState as c } from "react";
7
- import { useCommonStore as l } from "@plitzi/sdk-shared/store";
8
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
- import { DEV_TOOLS_ATTRIBUTE as f } from "@plitzi/sdk-shared/devTools/chrome";
7
+ import { DEV_TOOLS_ATTRIBUTE as l } from "@plitzi/sdk-shared/devTools/chrome";
8
+ import { useCommonStore as u } from "@plitzi/sdk-shared/store";
9
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
10
10
  import p from "@plitzi/plitzi-ui/ContainerResizable";
11
11
  //#region src/components/DevToolsPanel/DevToolsPanel.tsx
12
12
  var m = "vertical", h = "horizontal", g = ({ className: m, orientation: h = "vertical", tabSelected: g, logTypeFilter: _, onCollapse: v, onTabSelect: y, onChangeOrientation: b, qa: x = !1 }) => {
13
13
  let [S, C] = r("plitzi-sdk.dev-tools.size", {
14
14
  width: 500,
15
15
  height: 200
16
- }), [w] = l("navigation.currentPageId"), [T, E] = c(), D = o(() => h === "vertical" ? ["w"] : ["n"], [h]), O = s(typeof document < "u" ? document.querySelector(".plitzi-sdk") : null), k = a((e) => E(e), [E]), A = a((e, t) => C((n) => ({
16
+ }), [w] = u("navigation.currentPageId"), [T, E] = c(), D = o(() => h === "vertical" ? ["w"] : ["n"], [h]), O = s(typeof document < "u" ? document.querySelector(".plitzi-sdk") : null), k = a((e) => E(e), [E]), A = a((e, t) => C((n) => ({
17
17
  width: Number.isFinite(e) ? e : n.width,
18
18
  height: Number.isFinite(t) ? t : n.height
19
19
  })), [C]);
20
- return /* @__PURE__ */ u(p, {
20
+ return /* @__PURE__ */ d(p, {
21
21
  className: i("component__container-resizable-sidebar relative z-[1000000] text-xs", m, { "h-full": h === "vertical" }),
22
22
  minConstraintsX: h === "vertical" ? 500 : Infinity,
23
23
  maxConstraintsX: h === "vertical" ? 1e3 : Infinity,
@@ -29,11 +29,11 @@ var m = "vertical", h = "horizontal", g = ({ className: m, orientation: h = "ver
29
29
  parentRef: O,
30
30
  autoGrow: !1,
31
31
  onChange: A,
32
- children: /* @__PURE__ */ d("div", {
32
+ children: /* @__PURE__ */ f("div", {
33
33
  className: "flex h-full w-full flex-col bg-white text-zinc-800 dark:bg-zinc-900 dark:text-zinc-200",
34
- [f]: "",
34
+ [l]: "",
35
35
  children: [
36
- /* @__PURE__ */ u(t, {
36
+ /* @__PURE__ */ d(t, {
37
37
  orientation: h,
38
38
  onChangeOrientation: b,
39
39
  onCollapse: v,
@@ -41,12 +41,12 @@ var m = "vertical", h = "horizontal", g = ({ className: m, orientation: h = "ver
41
41
  tabSelected: g,
42
42
  qa: x
43
43
  }),
44
- ["store", "elements"].includes(g) && /* @__PURE__ */ u(n, {
44
+ ["store", "elements"].includes(g) && /* @__PURE__ */ d(n, {
45
45
  elementSelected: T,
46
46
  onSelectElement: k,
47
47
  currentPageId: w
48
48
  }),
49
- /* @__PURE__ */ u(e, {
49
+ /* @__PURE__ */ d(e, {
50
50
  orientation: h,
51
51
  tabSelected: g,
52
52
  logTypeFilter: _,
@@ -2,7 +2,7 @@ export type DetailsRuntimeProps = {
2
2
  id: string;
3
3
  };
4
4
  /**
5
- * The element as the page has it now — the same report `window.__plitzi.element()` and `plitzi check --element` give:
5
+ * The element as the page has it now — the same report `window.__plitzi.element()` and `plitzi page check --element` give:
6
6
  * its own state, what it binds to, how many copies are on the page and where. Read again every second.
7
7
  */
8
8
  declare const DetailsRuntime: ({ id }: DetailsRuntimeProps) => import('react').JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-dev-tools",
3
- "version": "0.38.7",
3
+ "version": "0.38.9",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist"
@@ -1211,9 +1211,9 @@
1211
1211
  "dependencies": {
1212
1212
  "@plitzi/nexus": "^1.4.0",
1213
1213
  "@plitzi/plitzi-ui": "^1.6.32",
1214
- "@plitzi/sdk-plugins": "0.38.7",
1215
- "@plitzi/sdk-schema": "0.38.7",
1216
- "@plitzi/sdk-shared": "0.38.7",
1214
+ "@plitzi/sdk-plugins": "0.38.9",
1215
+ "@plitzi/sdk-schema": "0.38.9",
1216
+ "@plitzi/sdk-shared": "0.38.9",
1217
1217
  "@uiw/react-json-view": "^2.0.0-alpha.43",
1218
1218
  "clsx": "^2.1.1"
1219
1219
  }