@v-office/site-checks 0.3.1 → 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 CHANGED
@@ -5,17 +5,18 @@ the build, `site-checks dist` reads the built `dist/` after it. Each stage print
5
5
  writes a report in the shape of the build worker's dist-check report, and exits non-zero when a
6
6
  check with severity `error` found something.
7
7
 
8
- AI Studio's build worker runs the `src` stage itself for every Astro site, from its own pinned
9
- copy of this package and with the site's `site-checks.config.json`, before `astro check`: a site
10
- installs nothing for it. After the build it runs the site's own `site-checks dist` when the site
11
- installed this package, and otherwise the platform's dist checks alone. A refused stage never goes
12
- live and the previous build stays up; the report lands in the studio and on the admin page.
13
- Locally the two commands are how a developer looks before pushing.
8
+ AI Studio's build worker runs the checks itself on every build, from its own pinned copy of this
9
+ package and with the site's `site-checks.config.json`: for an Astro site the `src` stage before
10
+ `astro check` and the whole `dist` stage after the build, for any other website (the guest and
11
+ owner apps) the platform's dist checks alone. What a build checks does not depend on whether the
12
+ site installed this package. A refused stage never goes live and the previous build stays up; the
13
+ report lands in the studio and on the admin page. Locally the two commands are how a developer
14
+ looks before pushing.
14
15
 
15
16
  ## Use
16
17
 
17
- Installing the package adds the `dist` stage's site checks to the site's builds, at the version
18
- the site pins, and the two commands to its scripts:
18
+ Installing the package gives the site the two commands, for a look before pushing or a pre-push
19
+ hook. Pin the version the build worker uses, so the commands and the build agree:
19
20
 
20
21
  ```sh
21
22
  pnpm add --save-exact --save-dev @v-office/site-checks
@@ -30,8 +31,8 @@ pnpm add --save-exact --save-dev @v-office/site-checks
30
31
  }
31
32
  ```
32
33
 
33
- The scripts are a convenience for developers; the build worker runs the `src` stage itself and
34
- calls the bin for the `dist` stage. Nothing goes into `astro.config`.
34
+ The scripts are for developers; the build worker never runs the site's installed copy, it runs
35
+ both stages from its own. Nothing goes into `astro.config`.
35
36
 
36
37
  ```
37
38
  site-checks <src | dist> [--root <dir>] [--dist <dir>] [--site <url>] [--report <file>]
@@ -92,12 +93,12 @@ the command.
92
93
 
93
94
  ### `src`: before the build
94
95
 
95
- | id | Severity | What it refuses or reports | How to fix |
96
- | ---------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
97
- | `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. |
98
- | `image-formats` | error | A raster image under `public/` without an `.avif` sibling. Favicons, the apple-touch icon and `icon-<n>` PNGs at the root of `public/` are left out. | Encode the AVIF (or list the file in `imageIgnore`). |
99
- | `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. |
100
- | `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`. |
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`. |
101
102
 
102
103
  ### `dist`: after the build
103
104
 
package/dist/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as cli } from "./cli-Cj1FkuvI.mjs";
2
+ import { n as cli } from "./cli-C2uCbjyQ.mjs";
3
3
  //#region src/bin.ts
4
4
  process.exitCode = await cli(process.argv.slice(2), {
5
5
  out: (line) => console.log(line),
@@ -812,9 +812,12 @@ const RASTER = /* @__PURE__ */ new Set([
812
812
  ".png",
813
813
  ".webp"
814
814
  ]);
815
- /** Icons browsers and web manifests load as PNG by name, at the root of `public/` or in its
816
- * `favicon/` folder (the site starter's layout): an AVIF beside them serves nobody. */
817
- const ICON = /^public\/(?:favicon\/)?(?:apple-touch-icon|favicon|icon-\d+|web-app-manifest-\d+x\d+)[^/]*\.png$/;
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
- if (ignored.has(rel) || ICON.test(rel)) continue;
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-Cj1FkuvI.mjs";
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,8 @@
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
8
+ - `versions/0.3.2/CHANGELOG.md`: release notes for 0.3.2
7
9
  - `versions/0.3.1/CHANGELOG.md`: release notes for 0.3.1
8
10
  - `versions/0.3.0/CHANGELOG.md`: release notes for 0.3.0
9
11
  - `versions/0.2.4/CHANGELOG.md`: release notes for 0.2.4
@@ -4,6 +4,8 @@
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
8
+ - `versions/0.3.2/MIGRATION.md`: Migration: 0.3.1 to 0.3.2
7
9
  - `versions/0.3.1/MIGRATION.md`: Migration: 0.3.0 to 0.3.1
8
10
  - `versions/0.3.0/MIGRATION.md`: Migration: 0.2.x to 0.3.0
9
11
  - `versions/0.2.4/MIGRATION.md`: Migration: 0.2.3 to 0.2.4
@@ -0,0 +1,16 @@
1
+ # Changelog: 0.3.2
2
+
3
+ The notes only: the code is the same as 0.3.0 and 0.3.1. AI Studio's build worker now runs both
4
+ stages from its own pinned copy for every website, so what a build checks no longer depends on
5
+ whether a site installed this package. Installing it is for running the same checks locally.
6
+
7
+ ## Changed
8
+
9
+ - The README, the package description and the migration notes describe the build worker's
10
+ checks: for an Astro site the `src` stage before `astro check` and every check of the `dist`
11
+ stage after the build, the site checks and the platform's dist checks; for any other website
12
+ (the guest and owner apps) the platform's dist checks alone. All from the worker's copy, with the
13
+ site's `site-checks.config.json` as their data. The worker no longer runs a site's own
14
+ `site-checks dist`.
15
+ - Installing the package gives a site the two commands, for a look before pushing or a pre-push
16
+ hook. Pin the version the build worker uses, so the commands and the build agree.
@@ -0,0 +1,20 @@
1
+ # Migration: 0.3.1 to 0.3.2
2
+
3
+ No changes required: 0.3.2 changes the notes only.
4
+
5
+ ## 1. Upgrade
6
+
7
+ ```sh
8
+ pnpm add --save-exact --save-dev @v-office/site-checks@0.3.2
9
+ ```
10
+
11
+ ## What changes for the site
12
+
13
+ - Nothing in the build. AI Studio's build worker runs every check from its own pinned copy,
14
+ whether or not the site installs this package: an Astro site gets the `src` stage before
15
+ `astro check` and the whole `dist` stage after the build. A finding with severity `error`
16
+ refuses the deploy, and the previous build stays live.
17
+ - With the package installed, `pnpm check:src` and `pnpm check:dist` (after `pnpm build`) run the
18
+ same checks locally, on their own or in a pre-push hook. Keep the pinned version equal to the
19
+ build worker's, so the commands and the build agree; AI Studio's rollouts move the pin.
20
+ - `site-checks.config.json` stays at the project root: the build's checks read it.
@@ -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,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-office/site-checks",
3
- "version": "0.3.1",
4
- "description": "The checks over a v-office website in two stages: `site-checks src` before the build (AI Studio's build worker runs it for every Astro site) and `site-checks dist` after it, with the report in the shape of the build worker's dist-check report. A check with severity error refuses the deploy",
3
+ "version": "0.3.3",
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": {
7
7
  "type": "git",