@tokenoftrust/cli 3.3.0 → 3.4.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenoftrust/cli",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "Token of Trust developer CLI — clone a tenant store, run it locally with save→reload, and submit it for preview. Installs the `tot` command.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Token of Trust",
@@ -176,7 +176,7 @@ export function evidenceFromDir({ pagesDir, stylePath = null, lint = null, confi
176
176
  ...buildReadinessChecks({
177
177
  aggregate: { ...summary, totals: { ...summary.totals, issues: summary.totals?.issues ?? { lowRiskOpen: 0 } } },
178
178
  styleJson: styleJson ?? (summary.style?.gates ? { gates: summary.style.gates } : null),
179
- args: { manifest: summary.manifest ?? "(none supplied to the style-concept audit)" },
179
+ args: { manifest: summary.manifest ?? "(none supplied to the style-concept audit)", plan: summary.plan ?? null },
180
180
  config,
181
181
  }),
182
182
  ];
@@ -45,7 +45,13 @@ export function gateProblem(label, counts) {
45
45
  return `All ${counts.total} page checks passed.`;
46
46
  }
47
47
 
48
- export function styleGuideCheck(styleJson, manifestPath) {
48
+ /**
49
+ * @param {any} styleJson the style-concept audit output
50
+ * @param {string} manifestPath where the manifest was looked for
51
+ * @param {{ declared: boolean, routes: string[], approvalReceiptId: string|null }|null} [plan]
52
+ * the store plan's style-guide declaration (null when the store has no plan)
53
+ */
54
+ export function styleGuideCheck(styleJson, manifestPath, plan = null) {
49
55
  const gate = styleJson?.gates?.styleGuide;
50
56
  const manifest = styleJson?.manifest;
51
57
  const manifestPresent = manifest?.present === true;
@@ -58,6 +64,20 @@ export function styleGuideCheck(styleJson, manifestPath) {
58
64
  fix: "Run the style-concept audit with the store manifest so the guide index and per-theme guide records can be checked.",
59
65
  };
60
66
  }
67
+ if (!manifestPresent && plan) {
68
+ const approved = plan.declared && plan.approvalReceiptId;
69
+ return {
70
+ area: "Style guide",
71
+ status: approved ? "PASS" : "FAIL",
72
+ why: "The style guide is the approved visual contract for brand, accessibility states, responsive behavior, and reusable page patterns.",
73
+ problem: approved
74
+ ? `The store plan declares a style guide at ${plan.routes.length} route(s), approved by receipt ${plan.approvalReceiptId}.`
75
+ : `The store plan declares no ${plan.declared ? "style-guide approval receipt" : "style guide"}, and no migration manifest was found at ${manifestPath}.`,
76
+ fix: approved
77
+ ? "Keep the plan's style-guide routes and approval receipt current when the guide changes."
78
+ : "Declare styleGuide and styleGuideApprovalReceiptId in the store plan, or record the style guide in the migration manifest.",
79
+ };
80
+ }
61
81
  if (!manifestPresent) {
62
82
  return {
63
83
  area: "Style guide",
@@ -204,7 +224,7 @@ export function complianceNoticesCheck(results, config) {
204
224
  }
205
225
 
206
226
  /**
207
- * @param {{ aggregate: any, styleJson: any, args: { manifest: string }, config?: Record<string, any> | null }} input
227
+ * @param {{ aggregate: any, styleJson: any, args: { manifest: string, plan?: object|null }, config?: Record<string, any> | null }} input
208
228
  * `config` is the store's `.tot/config.json`, which decides the compliance notices row.
209
229
  */
210
230
  export function buildReadinessChecks({ aggregate, styleJson, args, config = null }) {
@@ -222,7 +242,7 @@ export function buildReadinessChecks({ aggregate, styleJson, args, config = null
222
242
 
223
243
  return [
224
244
  ...(compliance ? [compliance] : []),
225
- styleGuideCheck(styleJson, args.manifest),
245
+ styleGuideCheck(styleJson, args.manifest, args.plan ?? null),
226
246
  ecommerceStyleGuideCheck(styleJson),
227
247
  styleQualityCheck(styleJson),
228
248
  {