@v-office/site-checks 0.3.2 → 0.3.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/README.md +6 -6
- package/dist/bin.mjs +1 -1
- package/dist/{cli-Cj1FkuvI.mjs → cli-C2uCbjyQ.mjs} +8 -4
- package/dist/index.mjs +1 -1
- package/instructions/CHANGELOG.md +1 -0
- package/instructions/MIGRATION.md +1 -0
- package/instructions/versions/0.3.3/CHANGELOG.md +14 -0
- package/instructions/versions/0.3.3/MIGRATION.md +17 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,12 +93,12 @@ the command.
|
|
|
93
93
|
|
|
94
94
|
### `src`: before the build
|
|
95
95
|
|
|
96
|
-
| id | Severity | What it refuses or reports
|
|
97
|
-
| ---------------- | -------- |
|
|
98
|
-
| `html-comments` | error | An HTML comment (`<!-- … -->`) in `src/**/*.{astro,tsx,jsx,md,mdx,html}`: Astro passes it into the built page, readable with View Source.
|
|
99
|
-
| `image-formats` | error | A raster image under `public/` without an `.avif` sibling.
|
|
100
|
-
| `sync-once` | warning | An inline content loader in `src/content.config.ts` that fetches the PMS without the `CONTENT_SYNC_TOKEN` reuse idiom: `astro check` and `astro build` each run it, twice per deploy.
|
|
101
|
-
| `v9-hub-filters` | warning | v9 only (`CMS_BACKEND=v9` in the build's env or `.env` / `.env.production`, else AI Studio's `PMS_BACKEND=v9`): a Hub filter the site's search needs that the be-on! Hub does not serve, asked through the site's own `website-sdk hub-filters check`; a Hub that cannot be asked. A warning: the outcome is the Hub's data.
|
|
96
|
+
| id | Severity | What it refuses or reports | How to fix |
|
|
97
|
+
| ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
98
|
+
| `html-comments` | error | An HTML comment (`<!-- … -->`) in `src/**/*.{astro,tsx,jsx,md,mdx,html}`: Astro passes it into the built page, readable with View Source. | `{/* … */}` in `.astro` and JSX markup, `//` in frontmatter, remove it from Markdown. |
|
|
99
|
+
| `image-formats` | error | A raster image under `public/` without an `.avif` sibling. Left out by file name, in any folder: icons (`favicon*`, `apple-touch-icon*`, `icon-*`, `android-chrome-*`, `mstile-*`, `web-app-manifest-*`) and share pictures (`og-*`, `og_*`, `*-og.*`, `social-*`, `*-social.*`, `twitter-*`, `share-*`), which link previews show only as JPEG or PNG. | Encode the AVIF (or list the file in `imageIgnore`). |
|
|
100
|
+
| `sync-once` | warning | An inline content loader in `src/content.config.ts` that fetches the PMS without the `CONTENT_SYNC_TOKEN` reuse idiom: `astro check` and `astro build` each run it, twice per deploy. | Keep the token in the store's meta (`meta.get`) and reuse the entries (`store.keys()`) when it matches. |
|
|
101
|
+
| `v9-hub-filters` | warning | v9 only (`CMS_BACKEND=v9` in the build's env or `.env` / `.env.production`, else AI Studio's `PMS_BACKEND=v9`): a Hub filter the site's search needs that the be-on! Hub does not serve, asked through the site's own `website-sdk hub-filters check`; a Hub that cannot be asked. A warning: the outcome is the Hub's data. | Add the entry in the Hub (`website-sdk hub-filters request`), or drop it from the SDK options. Needs `install`. |
|
|
102
102
|
|
|
103
103
|
### `dist`: after the build
|
|
104
104
|
|
package/dist/bin.mjs
CHANGED
|
@@ -812,9 +812,12 @@ const RASTER = /* @__PURE__ */ new Set([
|
|
|
812
812
|
".png",
|
|
813
813
|
".webp"
|
|
814
814
|
]);
|
|
815
|
-
/**
|
|
816
|
-
*
|
|
817
|
-
|
|
815
|
+
/** Images that must stay JPEG or PNG, by file name anywhere under `public/` (the names the
|
|
816
|
+
* blueprints commit gate exempted): icons, since AVIF is no favicon or web manifest format, and
|
|
817
|
+
* share pictures, since link previews render JPEG and PNG only and show an AVIF og:image blank.
|
|
818
|
+
* An AVIF beside them serves nobody; a file named otherwise goes in `imageIgnore`. */
|
|
819
|
+
const ICON = /^(?:apple-touch-icon|favicon|icon-|android-chrome-|mstile-|web-app-manifest-)/;
|
|
820
|
+
const SHARE = /^(?:og[-_]|social-|twitter-|share-)|-(?:og|social)\./;
|
|
818
821
|
/** The URLs an element references for an image: `src`, `poster`, every `srcset` candidate. */
|
|
819
822
|
const imageUrls = (el) => {
|
|
820
823
|
const urls = [];
|
|
@@ -842,7 +845,8 @@ const imageFormats = {
|
|
|
842
845
|
const findings = [];
|
|
843
846
|
for (const file of filesUnder(ctx.publicDir, RASTER)) {
|
|
844
847
|
const rel = ctx.rel(file);
|
|
845
|
-
|
|
848
|
+
const name = path.basename(file);
|
|
849
|
+
if (ignored.has(rel) || ICON.test(name) || SHARE.test(name)) continue;
|
|
846
850
|
const stem = file.slice(0, -path.extname(file).length);
|
|
847
851
|
if (fs.existsSync(`${stem}.avif`)) continue;
|
|
848
852
|
findings.push({
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as loadOptions, a as runDistChecks, b as readAstroConfig, c as refusalMessage, d as MAX_FINDINGS_PER_CHECK, f as MAX_MESSAGE_CHARS, g as CONFIG_FILE, h as runSiteChecks, i as distChecks, l as summarizeBlocking, m as blockingResults, n as cli, o as SITE_CHECKS_FILE, p as MAX_PATH_CHARS, r as runStage, s as findingLine, t as USAGE, u as summaryLines, v as checks, y as checksOf } from "./cli-
|
|
1
|
+
import { _ as loadOptions, a as runDistChecks, b as readAstroConfig, c as refusalMessage, d as MAX_FINDINGS_PER_CHECK, f as MAX_MESSAGE_CHARS, g as CONFIG_FILE, h as runSiteChecks, i as distChecks, l as summarizeBlocking, m as blockingResults, n as cli, o as SITE_CHECKS_FILE, p as MAX_PATH_CHARS, r as runStage, s as findingLine, t as USAGE, u as summaryLines, v as checks, y as checksOf } from "./cli-C2uCbjyQ.mjs";
|
|
2
2
|
export { CONFIG_FILE, MAX_FINDINGS_PER_CHECK, MAX_MESSAGE_CHARS, MAX_PATH_CHARS, SITE_CHECKS_FILE, USAGE, blockingResults, checks, checksOf, cli, distChecks, findingLine, loadOptions, readAstroConfig, refusalMessage, runDistChecks, runSiteChecks, runStage, summarizeBlocking, summaryLines };
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Release notes of `@v-office/site-checks`, newest first. Each version has its own directory.
|
|
6
6
|
|
|
7
|
+
- `versions/0.3.3/CHANGELOG.md`: release notes for 0.3.3
|
|
7
8
|
- `versions/0.3.2/CHANGELOG.md`: release notes for 0.3.2
|
|
8
9
|
- `versions/0.3.1/CHANGELOG.md`: release notes for 0.3.1
|
|
9
10
|
- `versions/0.3.0/CHANGELOG.md`: release notes for 0.3.0
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Migration guides of `@v-office/site-checks`, newest first. Apply them in order when skipping versions.
|
|
6
6
|
|
|
7
|
+
- `versions/0.3.3/MIGRATION.md`: Migration: 0.3.2 to 0.3.3
|
|
7
8
|
- `versions/0.3.2/MIGRATION.md`: Migration: 0.3.1 to 0.3.2
|
|
8
9
|
- `versions/0.3.1/MIGRATION.md`: Migration: 0.3.0 to 0.3.1
|
|
9
10
|
- `versions/0.3.0/MIGRATION.md`: Migration: 0.2.x to 0.3.0
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog: 0.3.3
|
|
2
|
+
|
|
3
|
+
`image-formats` no longer asks for an AVIF beside share pictures and more icons. Link previews
|
|
4
|
+
(WhatsApp, Facebook, LinkedIn, Slack) show an `og:image` only as JPEG or PNG, so an AVIF beside it
|
|
5
|
+
would never be served; the check refused builds over them.
|
|
6
|
+
|
|
7
|
+
## Fixed
|
|
8
|
+
|
|
9
|
+
- `image-formats` leaves share pictures out by file name: `og-*`, `og_*`, `*-og.*`, `social-*`,
|
|
10
|
+
`*-social.*`, `twitter-*` and `share-*`.
|
|
11
|
+
- Icons are left out by file name in any folder under `public/` and in any raster format, and the
|
|
12
|
+
list now also covers `android-chrome-*` and `mstile-*`, next to `favicon*`,
|
|
13
|
+
`apple-touch-icon*`, `icon-*` and `web-app-manifest-*`. Before, only PNG icons at the root of
|
|
14
|
+
`public/` or in `public/favicon/` were left out.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Migration: 0.3.2 to 0.3.3
|
|
2
|
+
|
|
3
|
+
No changes required.
|
|
4
|
+
|
|
5
|
+
## 1. Upgrade
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add --save-exact --save-dev @v-office/site-checks@0.3.3
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## What changes for the site
|
|
12
|
+
|
|
13
|
+
- A share picture or icon named as above needs no AVIF sibling and no `imageIgnore` entry any
|
|
14
|
+
more. An entry the site added for one can stay; removing it changes nothing.
|
|
15
|
+
- A share picture named otherwise (`public/brand/preview.jpg`, say) still needs its path in
|
|
16
|
+
`imageIgnore` in `site-checks.config.json`. Every other raster image under `public/` still needs
|
|
17
|
+
its AVIF.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-office/site-checks",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "The checks over a v-office website in two stages, `site-checks src` before the build and `site-checks dist` after it, which AI Studio's build worker runs on every build from its own pinned copy; the report has the shape of the build worker's dist-check report. A check with severity error refuses the deploy",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|