@blackbelt-technology/frontend-mockup-loop 0.7.0 → 0.9.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.
@@ -176,8 +176,9 @@ the change's notes.
176
176
  - `serve_mockup{dir, port?, stop?}` — Node static server on 0.0.0.0; returns
177
177
  local + LAN URLs. Zero external deps.
178
178
  - `score_mockup{url, widths?, outDir?, system?}` — Playwright breakpoint screenshots +
179
- scoring rubric. Falls back to install guidance if Playwright is absent
180
- (`npm i -D playwright && npx playwright install chromium`).
179
+ scoring rubric. Chromium is declared in this package's `pi.tools` (optional
180
+ `pw-browser` probe); absent → install guidance via the registry's Install
181
+ dropdown or `pi-dashboard-ensure` (`npx playwright@1.62.1 install chromium`).
181
182
  - `init_ui_contract{path?, force?, system?, refresh?}` — scaffold the
182
183
  token-referencing contract. With `system`, write that preset's DTCG contract
183
184
  (offline snapshot; `refresh` re-fetches upstream first). No `system` →
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blackbelt-technology/frontend-mockup-loop",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Pi extension + skill for a ground→contract→mockup→test→fix→learn frontend design loop. Ships a live mockup server tool, a Playwright breakpoint-screenshot tool, and a design-contract scaffolder. Works in any React/Tailwind/shadcn project.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -30,6 +30,13 @@
30
30
  ],
31
31
  "skills": [
32
32
  ".pi/skills/frontend-mockup-loop"
33
+ ],
34
+ "tools": [
35
+ {
36
+ "id": "chromium",
37
+ "probe": "pw-browser",
38
+ "optional": true
39
+ }
33
40
  ]
34
41
  },
35
42
  "files": [
@@ -38,15 +45,17 @@
38
45
  "presets-data/",
39
46
  ".pi/skills/",
40
47
  "references/",
41
- "README.md"
48
+ "README.md",
49
+ "!**/AGENTS.md",
50
+ "!**/*.AGENTS.md"
42
51
  ],
43
52
  "dependencies": {
44
53
  "@axe-core/playwright": "^4.10.0",
45
54
  "eslint-plugin-tailwindcss": "^3.17.0"
46
55
  },
47
56
  "peerDependencies": {
48
- "@earendil-works/pi-coding-agent": "*",
49
- "typebox": "*"
57
+ "@earendil-works/pi-coding-agent": ">=1.0.0",
58
+ "typebox": ">=1.3.6"
50
59
  },
51
60
  "peerDependenciesMeta": {
52
61
  "@earendil-works/pi-coding-agent": {
@@ -54,7 +63,7 @@
54
63
  }
55
64
  },
56
65
  "devDependencies": {
57
- "@earendil-works/pi-coding-agent": "*",
58
- "typebox": "*"
66
+ "@earendil-works/pi-coding-agent": "^1.0.0",
67
+ "typebox": ">=1.3.6"
59
68
  }
60
69
  }
package/src/AGENTS.md DELETED
@@ -1,7 +0,0 @@
1
- # DOX — packages/mockup-loop/src
2
-
3
- Files in this directory. One row per source file.
4
-
5
- | File | Purpose |
6
- |------|---------|
7
- | `extension.ts` | Pi extension entry `frontendMockupLoop(pi)`. Registers 3 tools: `serve_mockup{dir,port?,stop?}` (node:http static server on 0.0.0.0, returns local+LAN URL, `servers` Map keyed by port), `score_mockup{url,widths?,outDir?}` (dynamic-import playwright chromium, full-page screenshots at widths default [375,768,1440], returns paths + scoring rubric, falls back to install guidance if absent), `init_ui_contract{path?,force?}` (writes `CONTRACT_TEMPLATE` to `ui-contract.md`). Registers `/mockup-loop` command. `session_shutdown` closes all servers. Path-traversal guard in static handler. See change: add-frontend-mockup-loop. Now registers 5 tools: adds `list_design_systems{}` (enumerates registry) + `validate_mockup{system,url?,dir?}` (L1+L2 gates, L3+L4 advisory, returns {gates,advisory,pass}). `init_ui_contract` gains `system?`+`refresh?` (writes DTCG contract from preset snapshot; no system → blank template). `score_mockup` gains `system?` (swaps generic rubric for preset boolean rubric). Imports from src/presets/*. See change: add-selectable-design-systems. |
@@ -1,9 +0,0 @@
1
- # DOX — packages/mockup-loop/src/presets
2
-
3
- Files in this directory. One row per source file.
4
-
5
- | File | Purpose |
6
- |------|---------|
7
- | `contract.ts` | DTCG contract loader. `loadContract(id)` reads bundled presets-data/<id>/contract.tokens.json, asserts DTCG via `isDtcg`. `refreshContract(id)` re-fetches upstream (token systems only; rule-pack throws). `rubricPath`/`contractPath`/`PRESETS_DATA_DIR` resolvers. UPSTREAM_SOURCES map. See change: add-selectable-design-systems. |
8
- | `registry.ts` | Design-system preset registry. `DesignSystemPreset` type (id,label,platform,substrate,contractSource,minTouchTarget,spacingScale,validators[]). 5 v1 presets: shadcn,mui,material-3,fluent-2,apple-hig. `listPresets`/`getPreset`/`resolvePreset` (rejects unknown id without throw). See change: add-selectable-design-systems. |
9
- | `validators.ts` | Layered validators. `runL1` token-lint (built-in raw-hex scan, gate for bundled systems), `runL2` a11y floor (inline WCAG contrast scan + axe-if-present, hard gate), `runL3` named-system auditor (shell-out-if-present via `isToolAvailable`, advisory), `runL4` boolean rubric (score=pass/N in code, advisory), `validateMockup` orchestrator returns {gates,advisory,pass}; pass gate-only. Inline WCAG `contrastRatio`/`parseHex`. See change: add-selectable-design-systems. |