@mdvp/cli 1.8.1 → 1.8.3

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.
Files changed (2) hide show
  1. package/cli.mjs +26 -11
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -12,7 +12,8 @@ function pickModule(url) {
12
12
  const API = "https://designsense.tixo-digital.workers.dev"
13
13
  const CONFIG_DIR = `${homedir()}/.mdvp`
14
14
  const CONFIG_FILE = `${CONFIG_DIR}/config.json`
15
- const VERSION = "1.2.0"
15
+ const PKG = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8"))
16
+ const VERSION = PKG.version
16
17
 
17
18
  const CATS = {
18
19
  spacing: "Spacing", typography: "Typography", color: "Color",
@@ -131,16 +132,30 @@ async function cmdAudit(domain, { json, raw, apiKey }) {
131
132
  best: sorted.slice(-3).reverse().map((b) => ({ key: b.c, category: CATS[b.c] ?? b.c, score: b.s })),
132
133
  },
133
134
  metrics: site.metrics ?? null,
134
- media: {
135
- screenshot_desktop: `https://designsense.tixo-digital.workers.dev/dataset/${site.id}/file/desktop-1440.jpg`,
136
- screenshot_mobile: `https://designsense.tixo-digital.workers.dev/dataset/${site.id}/file/iphone-390.jpg`,
137
- screenshot_tablet: `https://designsense.tixo-digital.workers.dev/dataset/${site.id}/file/ipad-1024.jpg`,
138
- video_scroll: `https://designsense.tixo-digital.workers.dev/dataset/${site.id}/file/scroll.webm`,
139
- html: `https://designsense.tixo-digital.workers.dev/dataset/${site.id}/file/page.html`,
140
- a11y: `https://designsense.tixo-digital.workers.dev/dataset/${site.id}/file/a11y.json`,
141
- css_coverage: `https://designsense.tixo-digital.workers.dev/dataset/${site.id}/file/css-coverage.json`,
142
- network: `https://designsense.tixo-digital.workers.dev/dataset/${site.id}/file/network.json`,
143
- },
135
+ assets: (() => {
136
+ const base = `https://designsense.tixo-digital.workers.dev/dataset/${site.id}/file`
137
+ return {
138
+ screenshots: {
139
+ desktop: `${base}/desktop-1440.jpg`,
140
+ mobile: `${base}/iphone-390.jpg`,
141
+ tablet: `${base}/ipad-1024.jpg`,
142
+ },
143
+ video: `${base}/scroll.webm`,
144
+ dom: {
145
+ html: `${base}/page.html`,
146
+ metrics: `${base}/metrics.json`,
147
+ scores: `${base}/scores.json`,
148
+ features: `${base}/features.json`,
149
+ },
150
+ diagnostics: {
151
+ console: `${base}/console.json`,
152
+ network: `${base}/network.json`,
153
+ a11y: `${base}/a11y.json`,
154
+ css_coverage: `${base}/css-coverage.json`,
155
+ },
156
+ files_index: `https://designsense.tixo-digital.workers.dev/dataset/${site.id}/files`,
157
+ }
158
+ })(),
144
159
  mdvp: { version: "1", api: "https://designsense.tixo-digital.workers.dev", dataset_url: `https://designsense.tixo-digital.workers.dev/dataset/${site.id}` },
145
160
  }
146
161
  console.log(JSON.stringify(output, null, 2))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdvp/cli",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "description": "Machine Design Vision Protocol — gives agents eyes to understand design quality",
5
5
  "bin": {
6
6
  "mdvp": "./cli.mjs"