@mccaskie-labs/workbench-config 0.1.20 → 0.1.21
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,11 @@
|
|
|
1
1
|
# @mccaskie-labs/workbench-config
|
|
2
2
|
|
|
3
|
+
## 0.1.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- The `ui` component: `capabilities/ui.json` (rules and probes for `@mccaskie-labs/workbench-ui`) joins the manifests, and `ui` joins the component list.
|
|
8
|
+
|
|
3
9
|
## 0.1.20
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/capabilities/schema.json
CHANGED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./schema.json",
|
|
3
|
+
"format": 1,
|
|
4
|
+
"component": "ui",
|
|
5
|
+
"title": "One look for every page",
|
|
6
|
+
"summary": "workbench-ui gives every Workbench page the same dark look: the page shell, a top bar with the environment tag, cards that fold, jump pills, outcome pills, and one way to write times, money and durations. It returns HTML text in the app's own Worker, with no Gateway call and no cost.",
|
|
7
|
+
"status": "built",
|
|
8
|
+
"surfaces": {
|
|
9
|
+
"package": [
|
|
10
|
+
"shell",
|
|
11
|
+
"topBar",
|
|
12
|
+
"card",
|
|
13
|
+
"jumpNav",
|
|
14
|
+
"SECTIONS_SCRIPT",
|
|
15
|
+
"pill",
|
|
16
|
+
"chip",
|
|
17
|
+
"when",
|
|
18
|
+
"shortWhen",
|
|
19
|
+
"timeLeft",
|
|
20
|
+
"money",
|
|
21
|
+
"duration",
|
|
22
|
+
"escape",
|
|
23
|
+
"STYLE",
|
|
24
|
+
"CSS"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"rules": [
|
|
28
|
+
{
|
|
29
|
+
"id": "ui.one-look",
|
|
30
|
+
"kind": "must",
|
|
31
|
+
"text": "Build every page a person opens with shell (or STYLE for a page that writes its own document), so each page has the same top bar, cards and pills.",
|
|
32
|
+
"enforced_by": "review",
|
|
33
|
+
"probe": "ui.page"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "ui.environment-tag",
|
|
37
|
+
"kind": "must",
|
|
38
|
+
"text": "Pass the environment to topBar, so every page says whether it is staging or production.",
|
|
39
|
+
"enforced_by": "review",
|
|
40
|
+
"probe": "ui.page"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "ui.escape",
|
|
44
|
+
"kind": "must",
|
|
45
|
+
"text": "Escape any text that goes into an HTML argument (a card's inner, a top bar's extra) with escape. Arguments described as plain text are escaped for you.",
|
|
46
|
+
"enforced_by": "review",
|
|
47
|
+
"probe": "ui.page"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "ui.no-own-colours",
|
|
51
|
+
"kind": "must_not",
|
|
52
|
+
"text": "Give a page its own colours. A page's own rules go after the shared ones and use the colour tokens (--surface, --line, --pass and so on).",
|
|
53
|
+
"enforced_by": "review",
|
|
54
|
+
"probe": "ui.page"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "ui.one-format",
|
|
58
|
+
"kind": "must",
|
|
59
|
+
"text": "Write the times, amounts and durations a page shows with when, shortWhen, timeLeft, money and duration, not hand-built strings.",
|
|
60
|
+
"enforced_by": "review",
|
|
61
|
+
"probe": "ui.formats"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"examples": [
|
|
65
|
+
{
|
|
66
|
+
"id": "ui.example.page",
|
|
67
|
+
"title": "A page with one folding card",
|
|
68
|
+
"lang": "ts",
|
|
69
|
+
"probe": "ui.page",
|
|
70
|
+
"code": "import { workbenchEnv } from '@mccaskie-labs/workbench-config'\nimport { card, pill, shell, shortWhen, topBar } from '@mccaskie-labs/workbench-ui'\n\nconst html = shell({\n title: 'Orders',\n site: 'my-app',\n top: topBar({ name: 'my-app', href: '/', env: workbenchEnv(env), links: [['History', '/history']] }),\n body: card('Last order', `<div class=\"body\">${pill('pass', 'Sent')} ${shortWhen(order.sent_at)}</div>`, {\n id: 'last-order',\n about: 'The most recent order and when it went out.',\n collapsible: true,\n }),\n})"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"probes": [
|
|
74
|
+
{
|
|
75
|
+
"id": "ui.page",
|
|
76
|
+
"half": "runtime",
|
|
77
|
+
"expect": "pass",
|
|
78
|
+
"smoke": true,
|
|
79
|
+
"cost_hint_usd": 0,
|
|
80
|
+
"note": "In the Worker itself: builds one page with shell, topBar, jumpNav, a folding card and a pill, and checks the shared stylesheet is there with its colour tokens, the environment tag is shown, the pill carries its tone, the jump pill points at the card, and markup in a plain-text title and in text passed through escape both come out escaped"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"id": "ui.formats",
|
|
84
|
+
"half": "runtime",
|
|
85
|
+
"expect": "pass",
|
|
86
|
+
"smoke": true,
|
|
87
|
+
"cost_hint_usd": 0,
|
|
88
|
+
"note": "In the Worker itself: compares money (US$0.0042, US$12.50, and an en dash for nothing), duration (640 ms, 2.35 s, 3 min 5 s) and timeLeft against a fixed now (42 minutes left) with the expected text, and checks when and shortWhen write one fixed moment as its Manila day and hour with UTC beside it"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const MANIFEST_VERSION: "
|
|
1
|
+
export declare const MANIFEST_VERSION: "2216125e22d4";
|
|
2
2
|
export declare const capabilities: {
|
|
3
3
|
readonly ai: {
|
|
4
4
|
readonly $schema: "./schema.json";
|
|
@@ -1642,6 +1642,70 @@ export declare const capabilities: {
|
|
|
1642
1642
|
readonly note: "The app's own checkStrings run passes in its tests, and npx workbench-strings check passes in CI";
|
|
1643
1643
|
}];
|
|
1644
1644
|
};
|
|
1645
|
+
readonly ui: {
|
|
1646
|
+
readonly $schema: "./schema.json";
|
|
1647
|
+
readonly format: 1;
|
|
1648
|
+
readonly component: "ui";
|
|
1649
|
+
readonly title: "One look for every page";
|
|
1650
|
+
readonly summary: "workbench-ui gives every Workbench page the same dark look: the page shell, a top bar with the environment tag, cards that fold, jump pills, outcome pills, and one way to write times, money and durations. It returns HTML text in the app's own Worker, with no Gateway call and no cost.";
|
|
1651
|
+
readonly status: "built";
|
|
1652
|
+
readonly surfaces: {
|
|
1653
|
+
readonly package: readonly ["shell", "topBar", "card", "jumpNav", "SECTIONS_SCRIPT", "pill", "chip", "when", "shortWhen", "timeLeft", "money", "duration", "escape", "STYLE", "CSS"];
|
|
1654
|
+
};
|
|
1655
|
+
readonly rules: readonly [{
|
|
1656
|
+
readonly id: "ui.one-look";
|
|
1657
|
+
readonly kind: "must";
|
|
1658
|
+
readonly text: "Build every page a person opens with shell (or STYLE for a page that writes its own document), so each page has the same top bar, cards and pills.";
|
|
1659
|
+
readonly enforced_by: "review";
|
|
1660
|
+
readonly probe: "ui.page";
|
|
1661
|
+
}, {
|
|
1662
|
+
readonly id: "ui.environment-tag";
|
|
1663
|
+
readonly kind: "must";
|
|
1664
|
+
readonly text: "Pass the environment to topBar, so every page says whether it is staging or production.";
|
|
1665
|
+
readonly enforced_by: "review";
|
|
1666
|
+
readonly probe: "ui.page";
|
|
1667
|
+
}, {
|
|
1668
|
+
readonly id: "ui.escape";
|
|
1669
|
+
readonly kind: "must";
|
|
1670
|
+
readonly text: "Escape any text that goes into an HTML argument (a card's inner, a top bar's extra) with escape. Arguments described as plain text are escaped for you.";
|
|
1671
|
+
readonly enforced_by: "review";
|
|
1672
|
+
readonly probe: "ui.page";
|
|
1673
|
+
}, {
|
|
1674
|
+
readonly id: "ui.no-own-colours";
|
|
1675
|
+
readonly kind: "must_not";
|
|
1676
|
+
readonly text: "Give a page its own colours. A page's own rules go after the shared ones and use the colour tokens (--surface, --line, --pass and so on).";
|
|
1677
|
+
readonly enforced_by: "review";
|
|
1678
|
+
readonly probe: "ui.page";
|
|
1679
|
+
}, {
|
|
1680
|
+
readonly id: "ui.one-format";
|
|
1681
|
+
readonly kind: "must";
|
|
1682
|
+
readonly text: "Write the times, amounts and durations a page shows with when, shortWhen, timeLeft, money and duration, not hand-built strings.";
|
|
1683
|
+
readonly enforced_by: "review";
|
|
1684
|
+
readonly probe: "ui.formats";
|
|
1685
|
+
}];
|
|
1686
|
+
readonly examples: readonly [{
|
|
1687
|
+
readonly id: "ui.example.page";
|
|
1688
|
+
readonly title: "A page with one folding card";
|
|
1689
|
+
readonly lang: "ts";
|
|
1690
|
+
readonly code: "import { workbenchEnv } from '@mccaskie-labs/workbench-config'\nimport { card, pill, shell, shortWhen, topBar } from '@mccaskie-labs/workbench-ui'\n\nconst html = shell({\n title: 'Orders',\n site: 'my-app',\n top: topBar({ name: 'my-app', href: '/', env: workbenchEnv(env), links: [['History', '/history']] }),\n body: card('Last order', `<div class=\"body\">${pill('pass', 'Sent')} ${shortWhen(order.sent_at)}</div>`, {\n id: 'last-order',\n about: 'The most recent order and when it went out.',\n collapsible: true,\n }),\n})";
|
|
1691
|
+
readonly probe: "ui.page";
|
|
1692
|
+
}];
|
|
1693
|
+
readonly probes: readonly [{
|
|
1694
|
+
readonly id: "ui.page";
|
|
1695
|
+
readonly half: "runtime";
|
|
1696
|
+
readonly expect: "pass";
|
|
1697
|
+
readonly smoke: true;
|
|
1698
|
+
readonly cost_hint_usd: 0;
|
|
1699
|
+
readonly note: "In the Worker itself: builds one page with shell, topBar, jumpNav, a folding card and a pill, and checks the shared stylesheet is there with its colour tokens, the environment tag is shown, the pill carries its tone, the jump pill points at the card, and markup in a plain-text title and in text passed through escape both come out escaped";
|
|
1700
|
+
}, {
|
|
1701
|
+
readonly id: "ui.formats";
|
|
1702
|
+
readonly half: "runtime";
|
|
1703
|
+
readonly expect: "pass";
|
|
1704
|
+
readonly smoke: true;
|
|
1705
|
+
readonly cost_hint_usd: 0;
|
|
1706
|
+
readonly note: "In the Worker itself: compares money (US$0.0042, US$12.50, and an en dash for nothing), duration (640 ms, 2.35 s, 3 min 5 s) and timeLeft against a fixed now (42 minutes left) with the expected text, and checks when and shortWhen write one fixed moment as its Manila day and hour with UTC beside it";
|
|
1707
|
+
}];
|
|
1708
|
+
};
|
|
1645
1709
|
};
|
|
1646
1710
|
export type Alias = (typeof capabilities)["ai"]["allowed"]["aliases"][number]["alias"];
|
|
1647
1711
|
export type GatewayScope = (typeof capabilities)["gateway"]["allowed"]["scopes"][number];
|
package/dist/capabilities.gen.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by `npm run capabilities:build` from capabilities/*.json. Do not edit.
|
|
2
2
|
// check:capabilities fails in Checks when this file is stale.
|
|
3
|
-
export const MANIFEST_VERSION = "
|
|
3
|
+
export const MANIFEST_VERSION = "2216125e22d4";
|
|
4
4
|
export const capabilities = {
|
|
5
5
|
"ai": {
|
|
6
6
|
"$schema": "./schema.json",
|
|
@@ -2204,5 +2204,96 @@ export const capabilities = {
|
|
|
2204
2204
|
"note": "The app's own checkStrings run passes in its tests, and npx workbench-strings check passes in CI"
|
|
2205
2205
|
}
|
|
2206
2206
|
]
|
|
2207
|
+
},
|
|
2208
|
+
"ui": {
|
|
2209
|
+
"$schema": "./schema.json",
|
|
2210
|
+
"format": 1,
|
|
2211
|
+
"component": "ui",
|
|
2212
|
+
"title": "One look for every page",
|
|
2213
|
+
"summary": "workbench-ui gives every Workbench page the same dark look: the page shell, a top bar with the environment tag, cards that fold, jump pills, outcome pills, and one way to write times, money and durations. It returns HTML text in the app's own Worker, with no Gateway call and no cost.",
|
|
2214
|
+
"status": "built",
|
|
2215
|
+
"surfaces": {
|
|
2216
|
+
"package": [
|
|
2217
|
+
"shell",
|
|
2218
|
+
"topBar",
|
|
2219
|
+
"card",
|
|
2220
|
+
"jumpNav",
|
|
2221
|
+
"SECTIONS_SCRIPT",
|
|
2222
|
+
"pill",
|
|
2223
|
+
"chip",
|
|
2224
|
+
"when",
|
|
2225
|
+
"shortWhen",
|
|
2226
|
+
"timeLeft",
|
|
2227
|
+
"money",
|
|
2228
|
+
"duration",
|
|
2229
|
+
"escape",
|
|
2230
|
+
"STYLE",
|
|
2231
|
+
"CSS"
|
|
2232
|
+
]
|
|
2233
|
+
},
|
|
2234
|
+
"rules": [
|
|
2235
|
+
{
|
|
2236
|
+
"id": "ui.one-look",
|
|
2237
|
+
"kind": "must",
|
|
2238
|
+
"text": "Build every page a person opens with shell (or STYLE for a page that writes its own document), so each page has the same top bar, cards and pills.",
|
|
2239
|
+
"enforced_by": "review",
|
|
2240
|
+
"probe": "ui.page"
|
|
2241
|
+
},
|
|
2242
|
+
{
|
|
2243
|
+
"id": "ui.environment-tag",
|
|
2244
|
+
"kind": "must",
|
|
2245
|
+
"text": "Pass the environment to topBar, so every page says whether it is staging or production.",
|
|
2246
|
+
"enforced_by": "review",
|
|
2247
|
+
"probe": "ui.page"
|
|
2248
|
+
},
|
|
2249
|
+
{
|
|
2250
|
+
"id": "ui.escape",
|
|
2251
|
+
"kind": "must",
|
|
2252
|
+
"text": "Escape any text that goes into an HTML argument (a card's inner, a top bar's extra) with escape. Arguments described as plain text are escaped for you.",
|
|
2253
|
+
"enforced_by": "review",
|
|
2254
|
+
"probe": "ui.page"
|
|
2255
|
+
},
|
|
2256
|
+
{
|
|
2257
|
+
"id": "ui.no-own-colours",
|
|
2258
|
+
"kind": "must_not",
|
|
2259
|
+
"text": "Give a page its own colours. A page's own rules go after the shared ones and use the colour tokens (--surface, --line, --pass and so on).",
|
|
2260
|
+
"enforced_by": "review",
|
|
2261
|
+
"probe": "ui.page"
|
|
2262
|
+
},
|
|
2263
|
+
{
|
|
2264
|
+
"id": "ui.one-format",
|
|
2265
|
+
"kind": "must",
|
|
2266
|
+
"text": "Write the times, amounts and durations a page shows with when, shortWhen, timeLeft, money and duration, not hand-built strings.",
|
|
2267
|
+
"enforced_by": "review",
|
|
2268
|
+
"probe": "ui.formats"
|
|
2269
|
+
}
|
|
2270
|
+
],
|
|
2271
|
+
"examples": [
|
|
2272
|
+
{
|
|
2273
|
+
"id": "ui.example.page",
|
|
2274
|
+
"title": "A page with one folding card",
|
|
2275
|
+
"lang": "ts",
|
|
2276
|
+
"code": "import { workbenchEnv } from '@mccaskie-labs/workbench-config'\nimport { card, pill, shell, shortWhen, topBar } from '@mccaskie-labs/workbench-ui'\n\nconst html = shell({\n title: 'Orders',\n site: 'my-app',\n top: topBar({ name: 'my-app', href: '/', env: workbenchEnv(env), links: [['History', '/history']] }),\n body: card('Last order', `<div class=\"body\">${pill('pass', 'Sent')} ${shortWhen(order.sent_at)}</div>`, {\n id: 'last-order',\n about: 'The most recent order and when it went out.',\n collapsible: true,\n }),\n})",
|
|
2277
|
+
"probe": "ui.page"
|
|
2278
|
+
}
|
|
2279
|
+
],
|
|
2280
|
+
"probes": [
|
|
2281
|
+
{
|
|
2282
|
+
"id": "ui.page",
|
|
2283
|
+
"half": "runtime",
|
|
2284
|
+
"expect": "pass",
|
|
2285
|
+
"smoke": true,
|
|
2286
|
+
"cost_hint_usd": 0,
|
|
2287
|
+
"note": "In the Worker itself: builds one page with shell, topBar, jumpNav, a folding card and a pill, and checks the shared stylesheet is there with its colour tokens, the environment tag is shown, the pill carries its tone, the jump pill points at the card, and markup in a plain-text title and in text passed through escape both come out escaped"
|
|
2288
|
+
},
|
|
2289
|
+
{
|
|
2290
|
+
"id": "ui.formats",
|
|
2291
|
+
"half": "runtime",
|
|
2292
|
+
"expect": "pass",
|
|
2293
|
+
"smoke": true,
|
|
2294
|
+
"cost_hint_usd": 0,
|
|
2295
|
+
"note": "In the Worker itself: compares money (US$0.0042, US$12.50, and an en dash for nothing), duration (640 ms, 2.35 s, 3 min 5 s) and timeLeft against a fixed now (42 minutes left) with the expected text, and checks when and shortWhen write one fixed moment as its Manila day and hour with UTC beside it"
|
|
2296
|
+
}
|
|
2297
|
+
]
|
|
2207
2298
|
}
|
|
2208
2299
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const COMPONENTS: readonly ["gateway", "ai", "images", "image-search", "config", "email", "email-inbound", "email-sending", "database", "workers", "domains", "dns", "analytics", "country", "pdf", "access", "r2", "kv", "github", "strings"];
|
|
2
|
+
export declare const COMPONENTS: readonly ["gateway", "ai", "images", "image-search", "config", "email", "email-inbound", "email-sending", "database", "workers", "domains", "dns", "analytics", "country", "pdf", "access", "r2", "kv", "github", "strings", "ui"];
|
|
3
3
|
export type Component = (typeof COMPONENTS)[number];
|
|
4
4
|
export declare const allowedSchemas: {
|
|
5
5
|
gateway: z.ZodObject<{
|
|
@@ -111,6 +111,7 @@ export declare const capabilitySchema: z.ZodObject<{
|
|
|
111
111
|
pdf: "pdf";
|
|
112
112
|
r2: "r2";
|
|
113
113
|
strings: "strings";
|
|
114
|
+
ui: "ui";
|
|
114
115
|
workers: "workers";
|
|
115
116
|
}>;
|
|
116
117
|
title: z.ZodString;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mccaskie-labs/workbench-config",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"description": "Workbench app configuration: WORKBENCH_ENV, typed variables that fail by name, secrets that are never printed, and the capabilities manifest.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|