@plitzi/sdk-dev-tools 0.39.11 → 0.39.13
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 +20 -0
- package/dist/components/DevToolsPanel/DevToolsBody.mjs +39 -37
- package/dist/components/DevToolsPanel/DevToolsHeader.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/ExperimentsViewer/ExperimentsListItem.d.ts +13 -0
- package/dist/components/DevToolsPanel/tabs/ExperimentsViewer/ExperimentsListItem.mjs +70 -0
- package/dist/components/DevToolsPanel/tabs/ExperimentsViewer/ExperimentsViewer.d.ts +11 -0
- package/dist/components/DevToolsPanel/tabs/ExperimentsViewer/ExperimentsViewer.mjs +49 -0
- package/dist/components/DevToolsPanel/tabs/ExperimentsViewer/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/ExperimentsViewer/index.mjs +4 -0
- package/dist/components/DevToolsPanel/tabs/FlagsViewer/FlagSource.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/FlagsViewer/FlagSource.mjs +2 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @plitzi/sdk-dev-tools
|
|
2
2
|
|
|
3
|
+
## 0.39.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 919736b: Released with every `@plitzi` package at this version. What changed in each, and what to do when you upgrade, is in
|
|
8
|
+
`@plitzi/cli`'s `CHANGELOG.md`: one copy of the notes, not one per package.
|
|
9
|
+
- Updated dependencies [919736b]
|
|
10
|
+
- @plitzi/sdk-schema@0.39.13
|
|
11
|
+
- @plitzi/sdk-shared@0.39.13
|
|
12
|
+
|
|
13
|
+
## 0.39.12
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 2f5b44d: Released with every `@plitzi` package at this version. What changed in each, and what to do when you upgrade, is in
|
|
18
|
+
`@plitzi/cli`'s `CHANGELOG.md`: one copy of the notes, not one per package.
|
|
19
|
+
- Updated dependencies [2f5b44d]
|
|
20
|
+
- @plitzi/sdk-schema@0.39.12
|
|
21
|
+
- @plitzi/sdk-shared@0.39.12
|
|
22
|
+
|
|
3
23
|
## 0.39.11
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -1,49 +1,51 @@
|
|
|
1
1
|
import e from "./tabs/ActionsViewer/index.mjs";
|
|
2
2
|
import t from "./tabs/CacheViewer/index.mjs";
|
|
3
3
|
import n from "./tabs/ElementsViewer/index.mjs";
|
|
4
|
-
import r from "./tabs/
|
|
5
|
-
import i from "./tabs/
|
|
6
|
-
import a from "./tabs/
|
|
7
|
-
import o from "./tabs/
|
|
8
|
-
import s from "./tabs/
|
|
9
|
-
import c from "./tabs/
|
|
10
|
-
import l from "./tabs/
|
|
11
|
-
import u from "./tabs/
|
|
12
|
-
import d from "./tabs/
|
|
13
|
-
import f from "
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
4
|
+
import r from "./tabs/ExperimentsViewer/index.mjs";
|
|
5
|
+
import i from "./tabs/FlagsViewer/index.mjs";
|
|
6
|
+
import a from "./tabs/HistoryViewer/index.mjs";
|
|
7
|
+
import o from "./tabs/Logs/index.mjs";
|
|
8
|
+
import s from "./tabs/PluginsViewer/PluginsViewer.mjs";
|
|
9
|
+
import c from "./tabs/QaViewer/index.mjs";
|
|
10
|
+
import l from "./tabs/RunViewer/index.mjs";
|
|
11
|
+
import u from "./tabs/StoreViewer/index.mjs";
|
|
12
|
+
import d from "./tabs/TracingViewer/TracingViewer.mjs";
|
|
13
|
+
import f from "./tabs/VariablesViewer/index.mjs";
|
|
14
|
+
import p from "clsx";
|
|
15
|
+
import { use as m } from "react";
|
|
16
|
+
import { DevToolsContext as h } from "@plitzi/sdk-shared/devTools/react";
|
|
17
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
17
18
|
// src/components/DevToolsPanel/DevToolsBody.tsx
|
|
18
|
-
var
|
|
19
|
-
let { logs:
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
className:
|
|
22
|
-
children: /* @__PURE__ */
|
|
19
|
+
var v = ({ className: v, tabSelected: y, orientation: b, logTypeFilter: x, elementSelected: S, onSelectElement: C, qa: w = !1, run: T }) => {
|
|
20
|
+
let { logs: E, clearLogs: D } = m(h);
|
|
21
|
+
return /* @__PURE__ */ g("div", {
|
|
22
|
+
className: p("bg-ui-panel flex min-h-0 w-full flex-1 overflow-auto", v),
|
|
23
|
+
children: /* @__PURE__ */ _("div", {
|
|
23
24
|
className: "flex min-h-0 w-full flex-col",
|
|
24
25
|
children: [
|
|
25
|
-
|
|
26
|
-
items:
|
|
27
|
-
orientation:
|
|
28
|
-
logTypeFilter:
|
|
29
|
-
onClear:
|
|
26
|
+
y === "logs" && /* @__PURE__ */ g(o, {
|
|
27
|
+
items: E,
|
|
28
|
+
orientation: b,
|
|
29
|
+
logTypeFilter: x,
|
|
30
|
+
onClear: D
|
|
30
31
|
}),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
y === "store" && /* @__PURE__ */ g(u, { elementSelected: S }),
|
|
33
|
+
y === "cache" && /* @__PURE__ */ g(t, {}),
|
|
34
|
+
y === "history" && /* @__PURE__ */ g(a, {}),
|
|
35
|
+
y === "variables" && /* @__PURE__ */ g(f, {}),
|
|
36
|
+
y === "flags" && /* @__PURE__ */ g(i, {}),
|
|
37
|
+
y === "experiments" && /* @__PURE__ */ g(r, {}),
|
|
38
|
+
y === "elements" && /* @__PURE__ */ g(n, {
|
|
39
|
+
elementSelected: S,
|
|
40
|
+
onSelectElement: C
|
|
39
41
|
}),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
y === "plugins" && /* @__PURE__ */ g(s, {}),
|
|
43
|
+
y === "tracing" && /* @__PURE__ */ g(d, {}),
|
|
44
|
+
y === "actions" && /* @__PURE__ */ g(e, {}),
|
|
45
|
+
w && y === "qa" && /* @__PURE__ */ g(c, {}),
|
|
46
|
+
y === "run" && /* @__PURE__ */ g(l, { snapshot: T })
|
|
45
47
|
]
|
|
46
48
|
})
|
|
47
49
|
});
|
|
48
50
|
};
|
|
49
|
-
export {
|
|
51
|
+
export { v as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExperimentVariant } from '@plitzi/sdk-shared/experiments';
|
|
2
|
+
export type ExperimentsListItemProps = {
|
|
3
|
+
name: string;
|
|
4
|
+
/** Each variant's weight, A first. */
|
|
5
|
+
weights: number[];
|
|
6
|
+
/** The variant this page shows. */
|
|
7
|
+
shown?: ExperimentVariant;
|
|
8
|
+
/** What a tester forced, if anything. */
|
|
9
|
+
forced?: ExperimentVariant;
|
|
10
|
+
onForce: (name: string, variant: ExperimentVariant | undefined) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const ExperimentsListItem: ({ name, weights, shown, forced, onForce }: ExperimentsListItemProps) => import('react').JSX.Element;
|
|
13
|
+
export default ExperimentsListItem;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import e from "clsx";
|
|
2
|
+
import { useCallback as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { variantAt as i } from "@plitzi/sdk-shared/experiments";
|
|
5
|
+
// src/components/DevToolsPanel/tabs/ExperimentsViewer/ExperimentsListItem.tsx
|
|
6
|
+
var a = ({ name: r, variant: i, weight: a, forced: o, onForce: s }) => {
|
|
7
|
+
let c = t(() => s(r, i), [
|
|
8
|
+
r,
|
|
9
|
+
i,
|
|
10
|
+
s
|
|
11
|
+
]);
|
|
12
|
+
return /* @__PURE__ */ n("button", {
|
|
13
|
+
type: "button",
|
|
14
|
+
className: e("rounded px-1.5 py-0.5 font-mono text-[10px] font-medium", {
|
|
15
|
+
"bg-violet-600 text-white": o,
|
|
16
|
+
"text-ui-fg-subtle hover:bg-ui-hover": !o
|
|
17
|
+
}),
|
|
18
|
+
title: `Force variant ${i.toUpperCase()} (weight ${String(a)}) for this browser`,
|
|
19
|
+
onClick: c,
|
|
20
|
+
children: i.toUpperCase()
|
|
21
|
+
});
|
|
22
|
+
}, o = ({ name: e, weights: o, shown: s, forced: c, onForce: l }) => {
|
|
23
|
+
let u = o.reduce((e, t) => e + t, 0), d = o.map((e, t) => {
|
|
24
|
+
let n = i(t);
|
|
25
|
+
return n ? `${n.toUpperCase()} ${String(u > 0 ? Math.round(e / u * 100) : 0)}%` : "";
|
|
26
|
+
}).join(" · "), f = t(() => l(e, void 0), [e, l]);
|
|
27
|
+
return /* @__PURE__ */ r("div", {
|
|
28
|
+
className: "border-ui-line hover:bg-ui-hover grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2 border-b px-3 py-1.5 transition-colors",
|
|
29
|
+
children: [/* @__PURE__ */ r("div", {
|
|
30
|
+
className: "flex min-w-0 flex-col gap-0.5",
|
|
31
|
+
children: [/* @__PURE__ */ r("div", {
|
|
32
|
+
className: "flex min-w-0 items-center gap-2",
|
|
33
|
+
children: [/* @__PURE__ */ n("span", {
|
|
34
|
+
className: "text-ui-fg truncate font-mono font-medium",
|
|
35
|
+
title: e,
|
|
36
|
+
children: e
|
|
37
|
+
}), s && /* @__PURE__ */ r("span", {
|
|
38
|
+
className: "text-ui-fg-muted bg-ui-raised rounded px-1 font-mono text-[10px]",
|
|
39
|
+
children: [
|
|
40
|
+
"shows ",
|
|
41
|
+
s.toUpperCase(),
|
|
42
|
+
c ? " · forced" : ""
|
|
43
|
+
]
|
|
44
|
+
})]
|
|
45
|
+
}), /* @__PURE__ */ n("span", {
|
|
46
|
+
className: "text-ui-fg-subtle truncate text-[11px]",
|
|
47
|
+
children: d
|
|
48
|
+
})]
|
|
49
|
+
}), /* @__PURE__ */ r("div", {
|
|
50
|
+
className: "flex items-center gap-1",
|
|
51
|
+
children: [o.map((t, r) => {
|
|
52
|
+
let o = i(r);
|
|
53
|
+
return o && /* @__PURE__ */ n(a, {
|
|
54
|
+
name: e,
|
|
55
|
+
variant: o,
|
|
56
|
+
weight: t,
|
|
57
|
+
forced: c === o,
|
|
58
|
+
onForce: l
|
|
59
|
+
}, o);
|
|
60
|
+
}), c !== void 0 && /* @__PURE__ */ n("button", {
|
|
61
|
+
type: "button",
|
|
62
|
+
className: "text-ui-fg-subtle hover:bg-ui-hover rounded px-1.5 py-0.5 text-[10px]",
|
|
63
|
+
title: "Stop forcing it: the visitor's own variant shows again",
|
|
64
|
+
onClick: f,
|
|
65
|
+
children: /* @__PURE__ */ n("i", { className: "fa-solid fa-rotate-left" })
|
|
66
|
+
})]
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
export { o as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The space's A/B tests as this page drew them — each experiment's variant for this visitor — with a way to force any
|
|
3
|
+
* variant for this browser.
|
|
4
|
+
*
|
|
5
|
+
* Forcing is a tester's: it shows the variant on the page that is open and keeps it in a session cookie of its own, so
|
|
6
|
+
* the next page is drawn with it on the server too — and never touches the variant the visitor keeps, so a tester's
|
|
7
|
+
* visit is not measured as one it was not drawn. Offered only here, and the dev tools only where debugging is
|
|
8
|
+
* authorized: the same rule the server applies before honouring the cookie.
|
|
9
|
+
*/
|
|
10
|
+
declare const ExperimentsViewer: () => import('react').JSX.Element;
|
|
11
|
+
export default ExperimentsViewer;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import e from "./ExperimentsListItem.mjs";
|
|
2
|
+
import { useCallback as t, useMemo as n } from "react";
|
|
3
|
+
import { useCommonStore as r } from "@plitzi/sdk-shared/store";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { declaredExperiments as o, withForcedExperiment as s, writeForcedExperiments as c } from "@plitzi/sdk-shared/experiments";
|
|
6
|
+
// src/components/DevToolsPanel/tabs/ExperimentsViewer/ExperimentsViewer.tsx
|
|
7
|
+
var l = {}, u = () => {
|
|
8
|
+
let [[u, d, f = l]] = r([
|
|
9
|
+
"schema.flat",
|
|
10
|
+
"schema.components",
|
|
11
|
+
"experiments.assigned"
|
|
12
|
+
]), [p = l, m] = r("experiments.qa"), h = n(() => o({
|
|
13
|
+
flat: u,
|
|
14
|
+
components: d
|
|
15
|
+
}), [u, d]), g = Object.keys(h), _ = t((e, t) => {
|
|
16
|
+
let n = s(p, e, t);
|
|
17
|
+
m(n), c(n);
|
|
18
|
+
}, [p, m]), v = t(() => {
|
|
19
|
+
m({}), c({});
|
|
20
|
+
}, [m]);
|
|
21
|
+
return g.length === 0 ? /* @__PURE__ */ i("div", {
|
|
22
|
+
className: "text-ui-fg-subtle py-4 text-center text-xs italic",
|
|
23
|
+
children: "This space runs no A/B tests"
|
|
24
|
+
}) : /* @__PURE__ */ a("div", {
|
|
25
|
+
className: "flex w-full flex-col gap-1.5 overflow-y-auto p-3",
|
|
26
|
+
children: [/* @__PURE__ */ a("div", {
|
|
27
|
+
className: "text-ui-fg-subtle flex items-center justify-between gap-2 text-[10px] font-semibold tracking-wider uppercase",
|
|
28
|
+
children: [/* @__PURE__ */ a("span", {
|
|
29
|
+
className: "flex items-center gap-2",
|
|
30
|
+
children: [/* @__PURE__ */ i("i", { className: "fa-solid fa-flask" }), "A/B tests"]
|
|
31
|
+
}), Object.keys(p).length > 0 && /* @__PURE__ */ i("button", {
|
|
32
|
+
type: "button",
|
|
33
|
+
className: "hover:bg-ui-hover rounded px-1.5 py-0.5 font-medium normal-case",
|
|
34
|
+
onClick: v,
|
|
35
|
+
children: "Stop forcing all"
|
|
36
|
+
})]
|
|
37
|
+
}), /* @__PURE__ */ i("div", {
|
|
38
|
+
className: "border-ui-line w-full overflow-hidden rounded border",
|
|
39
|
+
children: g.map((t) => /* @__PURE__ */ i(e, {
|
|
40
|
+
name: t,
|
|
41
|
+
weights: h[t].weights,
|
|
42
|
+
shown: f[t],
|
|
43
|
+
forced: p[t],
|
|
44
|
+
onForce: _
|
|
45
|
+
}, t))
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
export { u as default };
|
|
@@ -2,6 +2,6 @@ import { FlagResolution } from '@plitzi/sdk-shared/flags';
|
|
|
2
2
|
export type FlagSourceProps = {
|
|
3
3
|
resolution?: FlagResolution;
|
|
4
4
|
};
|
|
5
|
-
/** Which layer decided the flag — and, when the space did with a rule, which
|
|
5
|
+
/** Which layer decided the flag — and, when the space did with a rule or its gradual rollout, which. */
|
|
6
6
|
declare const FlagSource: ({ resolution }: FlagSourceProps) => import('react').JSX.Element | null;
|
|
7
7
|
export default FlagSource;
|
|
@@ -8,7 +8,7 @@ var n = {
|
|
|
8
8
|
qa: "forced"
|
|
9
9
|
}, r = ({ resolution: r }) => {
|
|
10
10
|
if (!r) return null;
|
|
11
|
-
let { layer: i, rule: a } = r, o = i === "space" && a !== void 0 ? `rule ${a + 1}` :
|
|
11
|
+
let { layer: i, rule: a, rollout: o } = r, s = i === "space" && o ? "rollout" : n[i], c = i === "space" && a !== void 0 ? `rule ${a + 1}` : s;
|
|
12
12
|
return /* @__PURE__ */ t("span", {
|
|
13
13
|
className: e("rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wider uppercase", {
|
|
14
14
|
"bg-ui-raised text-ui-fg-subtle": i === "space",
|
|
@@ -16,7 +16,7 @@ var n = {
|
|
|
16
16
|
"bg-amber-100 text-amber-700 dark:bg-amber-950 dark:text-amber-300": i === "qa"
|
|
17
17
|
}),
|
|
18
18
|
title: "Which layer decided this flag",
|
|
19
|
-
children:
|
|
19
|
+
children: c
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
export { r as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-dev-tools",
|
|
3
|
-
"version": "0.39.
|
|
3
|
+
"version": "0.39.13",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@plitzi/nexus": "^1.5.1",
|
|
49
|
-
"@plitzi/plitzi-ui": "^1.6.
|
|
50
|
-
"@plitzi/sdk-schema": "0.39.
|
|
51
|
-
"@plitzi/sdk-shared": "0.39.
|
|
49
|
+
"@plitzi/plitzi-ui": "^1.6.41",
|
|
50
|
+
"@plitzi/sdk-schema": "0.39.13",
|
|
51
|
+
"@plitzi/sdk-shared": "0.39.13",
|
|
52
52
|
"@uiw/react-json-view": "^2.0.0-alpha.44",
|
|
53
53
|
"clsx": "^2.1.1"
|
|
54
54
|
}
|