@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.
- package/cli.mjs +26 -11
- 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
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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))
|