@mccaskie-labs/workbench-config 0.1.35 → 0.1.36
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 +6 -0
- package/capabilities/forms.json +3 -0
- package/capabilities/schema.json +13 -0
- package/dist/capabilities.gen.d.ts +4 -1
- package/dist/capabilities.gen.js +4 -1
- package/dist/capability-schema.d.ts +3 -0
- package/dist/capability-schema.js +6 -0
- package/dist/skills.js +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @mccaskie-labs/workbench-config
|
|
2
2
|
|
|
3
|
+
## 0.1.36
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- A manifest may say `styles: { prefix }` for a component that draws on a project's pages. Its generated skill then has a "Restyling" section: every class and variable is listed in `public/styles/workbench.css`, and the project restyles them in `public/styles/project.css`. The forms manifest has `styles: { prefix: "wb-form-" }`.
|
|
8
|
+
|
|
3
9
|
## 0.1.35
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/capabilities/forms.json
CHANGED
package/capabilities/schema.json
CHANGED
|
@@ -685,6 +685,19 @@
|
|
|
685
685
|
"no_offer": {
|
|
686
686
|
"type": "string",
|
|
687
687
|
"minLength": 1
|
|
688
|
+
},
|
|
689
|
+
"styles": {
|
|
690
|
+
"type": "object",
|
|
691
|
+
"properties": {
|
|
692
|
+
"prefix": {
|
|
693
|
+
"type": "string",
|
|
694
|
+
"pattern": "^wb-[a-z]+-$"
|
|
695
|
+
}
|
|
696
|
+
},
|
|
697
|
+
"required": [
|
|
698
|
+
"prefix"
|
|
699
|
+
],
|
|
700
|
+
"additionalProperties": false
|
|
688
701
|
}
|
|
689
702
|
},
|
|
690
703
|
"required": [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const MANIFEST_VERSION: "
|
|
1
|
+
export declare const MANIFEST_VERSION: "399d06007bb4";
|
|
2
2
|
export declare const capabilities: {
|
|
3
3
|
readonly ai: {
|
|
4
4
|
readonly $schema: "./schema.json";
|
|
@@ -1316,6 +1316,9 @@ export declare const capabilities: {
|
|
|
1316
1316
|
readonly why: "The client's own words for an answered limit, otherwise \"Workbench default, not yet confirmed\".";
|
|
1317
1317
|
}];
|
|
1318
1318
|
};
|
|
1319
|
+
readonly styles: {
|
|
1320
|
+
readonly prefix: "wb-form-";
|
|
1321
|
+
};
|
|
1319
1322
|
};
|
|
1320
1323
|
readonly gateway: {
|
|
1321
1324
|
readonly $schema: "./schema.json";
|
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 = "399d06007bb4";
|
|
4
4
|
export const capabilities = {
|
|
5
5
|
"ai": {
|
|
6
6
|
"$schema": "./schema.json",
|
|
@@ -1806,6 +1806,9 @@ export const capabilities = {
|
|
|
1806
1806
|
"why": "The client's own words for an answered limit, otherwise \"Workbench default, not yet confirmed\"."
|
|
1807
1807
|
}
|
|
1808
1808
|
]
|
|
1809
|
+
},
|
|
1810
|
+
"styles": {
|
|
1811
|
+
"prefix": "wb-form-"
|
|
1809
1812
|
}
|
|
1810
1813
|
},
|
|
1811
1814
|
"gateway": {
|
|
@@ -356,6 +356,9 @@ export declare const capabilitySchema: z.ZodObject<{
|
|
|
356
356
|
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
357
357
|
}, z.core.$strict>>;
|
|
358
358
|
no_offer: z.ZodOptional<z.ZodString>;
|
|
359
|
+
styles: z.ZodOptional<z.ZodObject<{
|
|
360
|
+
prefix: z.ZodString;
|
|
361
|
+
}, z.core.$strict>>;
|
|
359
362
|
}, z.core.$strict>;
|
|
360
363
|
export type Capability = z.infer<typeof capabilitySchema>;
|
|
361
364
|
export type Offer = z.infer<typeof offer>;
|
|
@@ -217,6 +217,12 @@ const baseShape = {
|
|
|
217
217
|
offer: offer.optional(),
|
|
218
218
|
/** Why a client has nothing to answer for this component (plumbing). A manifest has `offer` or `no_offer`. */
|
|
219
219
|
no_offer: z.string().min(1).optional(),
|
|
220
|
+
/**
|
|
221
|
+
* For a component that draws on a project's pages: the prefix of its classes
|
|
222
|
+
* and variables (docs/capabilities-manifest.md §10). Its skill then says how to
|
|
223
|
+
* restyle them through public/styles/project.css.
|
|
224
|
+
*/
|
|
225
|
+
styles: z.strictObject({ prefix: z.string().regex(/^wb-[a-z]+-$/) }).optional(),
|
|
220
226
|
};
|
|
221
227
|
/** One file in `capabilities/`. Parsing checks shape only; cross-references are checked by `checkManifests`. */
|
|
222
228
|
export const capabilitySchema = z.strictObject(baseShape).superRefine((m, ctx) => {
|
package/dist/skills.js
CHANGED
|
@@ -117,8 +117,14 @@ export function renderSkill(m) {
|
|
|
117
117
|
if (o.not_asked?.length) {
|
|
118
118
|
out.push("", "## Not asked", "", ...o.not_asked.map((n) => `- \`${n.sets}\`: ${n.why}`));
|
|
119
119
|
}
|
|
120
|
+
if (m.styles)
|
|
121
|
+
out.push("", "## Restyling", "", restyleLine(m.styles.prefix));
|
|
120
122
|
return `${out.join("\n")}\n`;
|
|
121
123
|
}
|
|
124
|
+
/** How a project restyles what a component draws (docs/capabilities-manifest.md §10). */
|
|
125
|
+
function restyleLine(prefix) {
|
|
126
|
+
return `Everything this tool draws on a page has a \`${prefix}\` class with a default Workbench style, and its colours and sizes are \`--${prefix}*\` variables. All of them are listed, each with what it is, in \`public/styles/workbench.css\`, which \`npx workbench-ui styles\` generates: never edit it. To match the project's own look, write rules for those classes, or set the variables to the project's own colours, in \`public/styles/project.css\`. It loads after workbench.css and always wins. When the client asks for a different look, change project.css, never the tool's markup.`;
|
|
127
|
+
}
|
|
122
128
|
/** Every skill the manifests produce, keyed by its path in a project. */
|
|
123
129
|
export function renderSkills(manifests) {
|
|
124
130
|
const files = {};
|
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.36",
|
|
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",
|