@domandigital/create-site 0.9.1 → 0.10.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @domandigital/create-site
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3902169: `measure.mjs` counts phone screens to the footer for every page and prints it, and `site.programme.json` `measure.screens` sets a budget per page or page pattern (`{ "/": 6.5, "/services/*": 6 }`): a page over its budget fails the build (DOM-1052, part of DOM-772; the Bellerose home page ran 12.7 screens against a target of 6.5). New sites install `@domandigital/craft` ^0.22.0, which carries the count. `measure.screens` needs that craft or newer, and the gate says so when it is older.
|
|
8
|
+
|
|
3
9
|
## 0.9.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -80,7 +80,9 @@ a target under 44px and a form field set under 16px; on a short phone (375 x
|
|
|
80
80
|
667), on a main action below the first screen (`measure.mainAction`), fixed
|
|
81
81
|
layers over a quarter of the screen, images far larger than they are shown or
|
|
82
82
|
stretched, a phone, email or number field with the wrong keyboard or no
|
|
83
|
-
autocomplete,
|
|
83
|
+
autocomplete, a phone number that is not a `tel:` link, and a page longer than
|
|
84
|
+
its `measure.screens` budget (phone screens to the footer, page height over 667;
|
|
85
|
+
printed for every page even with no budget); in landscape, on
|
|
84
86
|
fixed layers over half the height; at 1440 and 1920, on body lines over 80
|
|
85
87
|
characters. `measure.baseline` lists known failures so they stay visible.
|
|
86
88
|
`pnpm deploy:preview` is the only deploy: it sets `PUBLIC_PREVIEW` itself,
|
package/dist/cli.js
CHANGED
|
@@ -788,7 +788,7 @@ var HOUSE_DEPENDENCIES = {
|
|
|
788
788
|
"@domandigital/seo": "^0.3.0"
|
|
789
789
|
};
|
|
790
790
|
var HOUSE_DEV_DEPENDENCIES = {
|
|
791
|
-
"@domandigital/craft": "^0.
|
|
791
|
+
"@domandigital/craft": "^0.22.0",
|
|
792
792
|
"@types/node": "^22.0.0",
|
|
793
793
|
vitest: "^4.1.11",
|
|
794
794
|
// scripts/gates/measure.mjs renders the pages at every viewport, phone first,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domandigital/create-site",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The first thing that runs on a new Doman Digital client site: installs the house packages and writes the per-site files they read (the facts file, route policy, backlink register, redirects, JSON-LD, the designer credit, house docs and the SEO checks), so every build starts on the same foundation and stays upgradeable by bumping packages.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"tsup": "^8.3.5",
|
|
42
42
|
"typescript": "^5.6.3",
|
|
43
43
|
"vitest": "^4.0.0",
|
|
44
|
-
"@domandigital/craft": "^0.
|
|
44
|
+
"@domandigital/craft": "^0.22.0",
|
|
45
45
|
"@domandigital/graph": "^0.7.0",
|
|
46
46
|
"@domandigital/seo": "^0.3.1"
|
|
47
47
|
},
|
|
@@ -73,7 +73,7 @@ Run around a running build:
|
|
|
73
73
|
|
|
74
74
|
| Gate | Stage | Fails when |
|
|
75
75
|
| --- | --- | --- |
|
|
76
|
-
| `measure.mjs` | 06 | measured with craft's measure (`@domandigital/craft/phone`) at every viewport, phone first: the ladder 320, 375, 390, 430, landscape 844 x 390, 768, 1024, 1280, 1440, 1920, and a width sweep from 320 to 1920 in 16 to 32px steps. A page in `measure.pages` does not answer; at any width it scrolls sideways, has visible text over other text, has a cut-off page title or text under `measure.minFontPx`; on a phone, a link, button, field or summary is under 44 x 44 CSS px (a link inside a sentence is exempt) or a text field is set under 16px; on a short phone (375 x 667), the main action in `measure.mainAction` is below the first screen and not pinned, fixed and sticky layers cover more than a quarter of the screen, an image is more than about 2.5 times wider than it is shown or is stretched past its file, a phone, email or number field has the wrong keyboard, a name, email or address field has no autocomplete, or a UK phone number in the text is not a `tel:` link; on a landscape phone, header and fixed layers cover more than half the height; at 1440 and 1920, body lines run past 80 characters or an image is stretched; a label in `measure.labels` leaves its container or covers a label or copy; with `--preview`, a page has no noindex. A failure names the widths it happens at |
|
|
76
|
+
| `measure.mjs` | 06 | measured with craft's measure (`@domandigital/craft/phone`) at every viewport, phone first: the ladder 320, 375, 390, 430, landscape 844 x 390, 768, 1024, 1280, 1440, 1920, and a width sweep from 320 to 1920 in 16 to 32px steps. A page in `measure.pages` does not answer; at any width it scrolls sideways, has visible text over other text, has a cut-off page title or text under `measure.minFontPx`; on a phone, a link, button, field or summary is under 44 x 44 CSS px (a link inside a sentence is exempt) or a text field is set under 16px; on a short phone (375 x 667), the main action in `measure.mainAction` is below the first screen and not pinned, fixed and sticky layers cover more than a quarter of the screen, an image is more than about 2.5 times wider than it is shown or is stretched past its file, a phone, email or number field has the wrong keyboard, a name, email or address field has no autocomplete, or a UK phone number in the text is not a `tel:` link; a page is over its `measure.screens` budget of phone screens to the footer; on a landscape phone, header and fixed layers cover more than half the height; at 1440 and 1920, body lines run past 80 characters or an image is stretched; a label in `measure.labels` leaves its container or covers a label or copy; with `--preview`, a page has no noindex. A failure names the widths it happens at |
|
|
77
77
|
| `deploy-preview.mjs` | 06 to 08 | the build, the measurement or the host's config refuses it (a route, a custom domain or `--prod`). Sets `PUBLIC_PREVIEW=1` and `NEXT_PUBLIC_PREVIEW=1` itself |
|
|
78
78
|
|
|
79
79
|
The site reads `PUBLIC_PREVIEW` (Astro, `import.meta.env.PUBLIC_PREVIEW`) or
|
|
@@ -100,7 +100,7 @@ pricing modules and writes the facts the redesign renders.
|
|
|
100
100
|
| `issue` | The programme issue in Linear (`DOM-123`) |
|
|
101
101
|
| `registeredDirection` | The direction's registered copy in the craft estate, usually `~/dd-ops/<site>/art-direction.json`; null until registered |
|
|
102
102
|
| `paths` | Where the token stylesheet, the deck, the rendered deck and the null-check report live, and the source folders `facts.mjs` reads |
|
|
103
|
-
| `measure` | `pages`, `minFontPx` (12), `labels` (`{ "selector": ".label", "within": ".screen" }` or null), `port`, `mainAction` (a CSS selector for the page's main action, or `{ "/": ".hero a", "*": "a.book" }` per page; not checked when absent), `thresholds` (override a house default: `maxLayerShare` 0.25, `landscapeMaxLayerShare` 0.5, `oversizeRatio` 2.5, `upscaleRatio` 1, `maxLineCh` 80, `overlapShare` 0.4, `minImagePx` 32), `sweep` (`{ "step": 16, "wideStep": 32 }`, or `false` to measure the ladder only), `baseline` (a file of known failures, craft's phone-first baseline format; `node scripts/gates/measure.mjs --serve --update-baseline` writes it, and it only shrinks) |
|
|
103
|
+
| `measure` | `pages`, `minFontPx` (12), `labels` (`{ "selector": ".label", "within": ".screen" }` or null), `port`, `mainAction` (a CSS selector for the page's main action, or `{ "/": ".hero a", "*": "a.book" }` per page; not checked when absent), `thresholds` (override a house default: `maxLayerShare` 0.25, `landscapeMaxLayerShare` 0.5, `oversizeRatio` 2.5, `upscaleRatio` 1, `maxLineCh` 80, `overlapShare` 0.4, `minImagePx` 32), `sweep` (`{ "step": 16, "wideStep": 32 }`, or `false` to measure the ladder only), `screens` (a length budget per page in phone screens to the footer, page height at 375 x 667 over 667: `{ "/": 6.5, "/services/*": 6 }`, a page or a `/prefix/*`, the most specific wins; a page over its budget fails, and with none set the count is only printed), `baseline` (a file of known failures, craft's phone-first baseline format; `node scripts/gates/measure.mjs --serve --update-baseline` writes it, and it only shrinks) |
|
|
104
104
|
| `nullCheck` | `harvest` (a path, `~/` allowed) and `justified` (phrase to reason) |
|
|
105
105
|
| `facts` | `importer`: the site's importer script, or null |
|
|
106
106
|
| `mobileFirst` | `exceptions`: the files allowed a `max-width` query or `max-*:` variant, each `{ "file": "src/styles/print.css", "reason": "..." }` |
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
// far larger than they are shown nor stretched; phone, email and number
|
|
25
25
|
// fields use the keyboard that fits and carry autocomplete; phone numbers
|
|
26
26
|
// in the text are tel: links;
|
|
27
|
+
// - the page's length: phone screens to the footer (page height at 375 x 667
|
|
28
|
+
// over 667), always printed per page; with measure.screens (a budget per
|
|
29
|
+
// page or page pattern, `{ "/": 6.5, "/services/*": 6 }`) a page over its
|
|
30
|
+
// budget fails;
|
|
27
31
|
// - on a landscape phone, header and fixed layers leave half the height;
|
|
28
32
|
// - at 1440 and 1920: body text lines stay under 80 characters and no image
|
|
29
33
|
// is stretched past its file.
|
|
@@ -78,6 +82,7 @@ try {
|
|
|
78
82
|
} catch {
|
|
79
83
|
stop(GATE, "06", "@domandigital/craft is not installed, or is older than the every-viewport measure (0.20). Install the site's dependencies.");
|
|
80
84
|
}
|
|
85
|
+
if (measure.screens && !craft.checkScreenBudgets) stop(GATE, "06", "measure.screens needs @domandigital/craft 0.22 or newer, which counts phone screens to the footer. Update it.");
|
|
81
86
|
const { measureSite, judgeMeasured, writeBaseline, EMPTY_BASELINE, LADDER, PHONE_FLOORS, DEFAULT_THRESHOLDS } = craft;
|
|
82
87
|
|
|
83
88
|
const close = values.serve ? await serveBuild() : () => {};
|
|
@@ -135,6 +140,7 @@ try {
|
|
|
135
140
|
floors: { textPx: minFontPx },
|
|
136
141
|
...(measure.mainAction ? { mainAction: measure.mainAction } : {}),
|
|
137
142
|
...(measure.thresholds ? { thresholds: measure.thresholds } : {}),
|
|
143
|
+
...(measure.screens ? { screens: craft.checkScreenBudgets(measure.screens, "site.programme.json measure.screens") } : {}),
|
|
138
144
|
...(measure.sweep !== undefined ? { sweep: measure.sweep } : {}),
|
|
139
145
|
onViewport: atViewport,
|
|
140
146
|
});
|
|
@@ -179,15 +185,18 @@ const res = {
|
|
|
179
185
|
minFieldFontPx: PHONE_FLOORS.fieldFontPx,
|
|
180
186
|
thresholds: { ...DEFAULT_THRESHOLDS, ...(measure.thresholds ?? {}) },
|
|
181
187
|
mainAction: measure.mainAction ?? null,
|
|
188
|
+
screens: measure.screens ?? null,
|
|
182
189
|
baseline: measure.baseline ?? null,
|
|
183
190
|
knownBreaches: judged.known,
|
|
184
|
-
pages: Object.fromEntries(site.routes.map((r) => [r.route, { viewports: r.viewports, findings: r.findings, noindex: extras[r.route].noindex, labels: extras[r.route].labels }])),
|
|
191
|
+
pages: Object.fromEntries(site.routes.map((r) => [r.route, { viewports: r.viewports, screens: r.screens ?? null, findings: r.findings, noindex: extras[r.route].noindex, labels: extras[r.route].labels }])),
|
|
185
192
|
errors: site.errors,
|
|
186
193
|
failures,
|
|
187
194
|
};
|
|
188
195
|
writeFileSync(join(root, "measure", "measure.json"), `${JSON.stringify(res, null, 1)}\n`);
|
|
189
196
|
const ladder = LADDER.map((v) => v.name).join(", ");
|
|
190
197
|
console.log(`${GATE}: ${pages.length} page(s) at ${ladder} and the width sweep, phone first, against ${base}${judged.known ? `; ${judged.known} known breach${judged.known === 1 ? "" : "es"} in ${measure.baseline}` : ""}; captures in measure/out, report in measure/measure.json`);
|
|
198
|
+
const lengths = craft.formatScreens?.(site.routes, measure.screens);
|
|
199
|
+
if (lengths) console.log(`${GATE}: phone screens to the footer${measure.screens ? " (of budget)" : ""}: ${lengths}`);
|
|
191
200
|
if (!updating && failures.length) stop(GATE, "06", `${failures.length} failure(s):\n${failures.map((f) => ` ${f}`).join("\n")}`);
|
|
192
201
|
|
|
193
202
|
/** Serves the last build on measure.port and returns how to stop it. */
|