badday 0.1.0 → 0.1.1
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/dist/cli.js +15 -13
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2637,7 +2637,7 @@ function controlsOf(name) {
|
|
|
2637
2637
|
}
|
|
2638
2638
|
|
|
2639
2639
|
// src/engine/runner.ts
|
|
2640
|
-
var VERSION = "0.1.
|
|
2640
|
+
var VERSION = "0.1.1";
|
|
2641
2641
|
var BODY_LIMIT2 = 2e3;
|
|
2642
2642
|
var PROBE_TIMEOUT_MS = 4e3;
|
|
2643
2643
|
var STALL_LIMIT_MS = 9e4;
|
|
@@ -3089,7 +3089,7 @@ code, pre { font-family: var(--mono); font-size: 12.5px; }
|
|
|
3089
3089
|
.top { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
|
|
3090
3090
|
.brand { font: 700 17px var(--mono); letter-spacing: -0.02em; }
|
|
3091
3091
|
.brand i { font-style: normal; color: var(--fail); }
|
|
3092
|
-
.meta { color: var(--muted); font-size: 13px; flex: 1; min-width: 220px; }
|
|
3092
|
+
.meta { color: var(--muted); font-size: 13px; flex: 1; min-width: 220px; display: flex; flex-wrap: wrap; gap: 2px 16px; }
|
|
3093
3093
|
.meta code { color: var(--ink); }
|
|
3094
3094
|
.theme { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; font-size: 13px; color: var(--muted); }
|
|
3095
3095
|
.theme:hover { color: var(--ink); border-color: var(--muted); }
|
|
@@ -3280,13 +3280,14 @@ function count(checks) {
|
|
|
3280
3280
|
function drawTop() {
|
|
3281
3281
|
const when = new Date(R.startedAt)
|
|
3282
3282
|
const meta = document.getElementById('meta')
|
|
3283
|
+
// Each fact is its own span. The gap between them is CSS, so no separator character is needed.
|
|
3283
3284
|
meta.append(
|
|
3284
|
-
h('code', {}, R.target),
|
|
3285
|
-
when.toLocaleString(undefined, { dateStyle: 'medium', timeStyle: 'short' }),
|
|
3286
|
-
(R.durationMs / 1000).toFixed(1) + ' s
|
|
3287
|
-
'created ' + R.records.created + ' records, deleted ' + R.records.deleted
|
|
3288
|
-
|
|
3289
|
-
|
|
3285
|
+
h('span', {}, h('code', {}, R.target)),
|
|
3286
|
+
h('span', {}, when.toLocaleString(undefined, { dateStyle: 'medium', timeStyle: 'short' })),
|
|
3287
|
+
h('span', {}, (R.durationMs / 1000).toFixed(1) + ' s'),
|
|
3288
|
+
h('span', {}, 'created ' + R.records.created + ' records, deleted ' + R.records.deleted
|
|
3289
|
+
+ (R.records.left ? ', left ' + R.records.left + ' behind' : '')
|
|
3290
|
+
+ (R.records.unidentified ? ', and ' + R.records.unidentified + ' more creates succeeded without naming a record' : '')),
|
|
3290
3291
|
)
|
|
3291
3292
|
document.title = 'badday report, ' + R.target
|
|
3292
3293
|
document.getElementById('sample').hidden = !R.sample
|
|
@@ -3399,13 +3400,13 @@ function chips(c) {
|
|
|
3399
3400
|
|
|
3400
3401
|
function checkCard(c, compact) {
|
|
3401
3402
|
const v = VERDICTS[c.verdict]
|
|
3402
|
-
const chev = h('span', { class: 'chev', 'aria-hidden': 'true' }, '
|
|
3403
|
+
const chev = h('span', { class: 'chev', 'aria-hidden': 'true' }, '>')
|
|
3403
3404
|
const summary = compact
|
|
3404
3405
|
? h('summary', {}, h('span', { class: 'badge' }, v.label), h('span', { class: 'title' }, c.title),
|
|
3405
3406
|
h('code', { class: 'name' }, c.name), chev)
|
|
3406
3407
|
: h('summary', {}, h('span', { class: 'badge' }, v.label), h('span', { class: 'title' }, c.title), chev,
|
|
3407
3408
|
h('span', { class: 'sum' }, c.summary),
|
|
3408
|
-
h('span', { class: 'tags' }, h('code', {}, c.id || c.name), '
|
|
3409
|
+
h('span', { class: 'tags' }, h('code', {}, c.id || c.name), ', ' + packTitle[c.pack]))
|
|
3409
3410
|
return h('details', { class: 'check ' + c.verdict + (compact ? ' compact' : ''), id: 'check-' + (c.id || c.name) },
|
|
3410
3411
|
summary,
|
|
3411
3412
|
h('div', { class: 'body' }, compact && h('p', { class: 'sum' }, c.summary), facts(c), timeline(c), fix(c), chips(c)))
|
|
@@ -3872,14 +3873,14 @@ function learn(seen, baseUrl) {
|
|
|
3872
3873
|
if (!idField) idField = ["_id", "uuid", "slug", "key"].find((field) => samples.some((row) => field in row));
|
|
3873
3874
|
if (idField && idField !== "id") {
|
|
3874
3875
|
resource.idField = idField;
|
|
3875
|
-
about.push(`a record
|
|
3876
|
+
about.push(`the app finds a record by its "${idField}"`);
|
|
3876
3877
|
}
|
|
3877
3878
|
if (!idField) open.push(`badday could not tell which field of ${name} holds the id. Open one record in the app while badday records, or name the field in idField.`);
|
|
3878
3879
|
if (sentRecord2) {
|
|
3879
3880
|
const answerNamesRecord = !!gotRecord && !!idField && idField in gotRecord;
|
|
3880
3881
|
if (idField && !answerNamesRecord && typeof sentRecord2[idField] === "string") {
|
|
3881
3882
|
resource.markerField = idField;
|
|
3882
|
-
about.push(`the create answer names no record, and the client picks the "${idField}"`);
|
|
3883
|
+
about.push(`the create answer names no record, and the client picks the "${idField}" itself`);
|
|
3883
3884
|
} else {
|
|
3884
3885
|
const typed = Object.entries(sentRecord2).filter(([, value]) => typeof value === "string" && /\s/.test(value) && !/@|^\d{4}-\d\d-\d\d|^https?:/.test(value)).sort((a, b) => b[1].length - a[1].length)[0]?.[0];
|
|
3885
3886
|
const marker = MARKER_NAMES.find((field) => typeof sentRecord2[field] === "string") ?? typed;
|
|
@@ -3903,7 +3904,8 @@ function learn(seen, baseUrl) {
|
|
|
3903
3904
|
about.push(`the app reads the ${open_.join(" and the ")} route with no login, so badday treats it as public`);
|
|
3904
3905
|
}
|
|
3905
3906
|
const routes = [resource.create && "create", resource.list && "list", resource.get && "read", resource.update && "update", resource.remove && "delete"].filter(Boolean);
|
|
3906
|
-
notes.push(`${name}: ${routes.join(", ")} at ${g.path}
|
|
3907
|
+
notes.push(`${name}: ${routes.join(", ")} at ${g.path}.`);
|
|
3908
|
+
for (const fact of about) notes.push(`${name}: ${fact}.`);
|
|
3907
3909
|
for (const [route3, what] of [["get", "opened one"], ["update", "changed one"], ["remove", "deleted one"], ["list", "listed them"]]) {
|
|
3908
3910
|
if (!resource[route3]) open.push(`Nobody ${what} of the ${name} during the recording, so badday knows no ${route3 === "remove" ? "delete" : route3} route for them.`);
|
|
3909
3911
|
}
|