@se-studio/site-check 2.19.1 → 2.22.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.
Files changed (95) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +11 -0
  3. package/develop-published-gate.mjs +701 -0
  4. package/dist/check-pages-exist.d.ts.map +1 -1
  5. package/dist/check-pages-exist.js +2 -1
  6. package/dist/check-pages-exist.js.map +1 -1
  7. package/dist/check-rewrites.d.ts.map +1 -1
  8. package/dist/check-rewrites.js +2 -1
  9. package/dist/check-rewrites.js.map +1 -1
  10. package/dist/cli.js +8 -1
  11. package/dist/cli.js.map +1 -1
  12. package/dist/collect-markdown-urls.d.ts.map +1 -1
  13. package/dist/collect-markdown-urls.js +2 -1
  14. package/dist/collect-markdown-urls.js.map +1 -1
  15. package/dist/download.d.ts.map +1 -1
  16. package/dist/download.js +2 -1
  17. package/dist/download.js.map +1 -1
  18. package/dist/fetch-timeout.d.ts +9 -0
  19. package/dist/fetch-timeout.d.ts.map +1 -0
  20. package/dist/fetch-timeout.js +17 -0
  21. package/dist/fetch-timeout.js.map +1 -0
  22. package/dist/smoke-test/cms-page-checks.d.ts.map +1 -1
  23. package/dist/smoke-test/cms-page-checks.js +1 -0
  24. package/dist/smoke-test/cms-page-checks.js.map +1 -1
  25. package/dist/smoke-test/config.d.ts.map +1 -1
  26. package/dist/smoke-test/config.js +106 -0
  27. package/dist/smoke-test/config.js.map +1 -1
  28. package/dist/smoke-test/content-assert.d.ts +14 -1
  29. package/dist/smoke-test/content-assert.d.ts.map +1 -1
  30. package/dist/smoke-test/content-assert.js +29 -5
  31. package/dist/smoke-test/content-assert.js.map +1 -1
  32. package/dist/smoke-test/dead-links.d.ts +58 -0
  33. package/dist/smoke-test/dead-links.d.ts.map +1 -0
  34. package/dist/smoke-test/dead-links.js +180 -0
  35. package/dist/smoke-test/dead-links.js.map +1 -0
  36. package/dist/smoke-test/environment.d.ts +19 -0
  37. package/dist/smoke-test/environment.d.ts.map +1 -0
  38. package/dist/smoke-test/environment.js +55 -0
  39. package/dist/smoke-test/environment.js.map +1 -0
  40. package/dist/smoke-test/index.d.ts +7 -2
  41. package/dist/smoke-test/index.d.ts.map +1 -1
  42. package/dist/smoke-test/index.js +4 -1
  43. package/dist/smoke-test/index.js.map +1 -1
  44. package/dist/smoke-test/runner.d.ts.map +1 -1
  45. package/dist/smoke-test/runner.js +90 -18
  46. package/dist/smoke-test/runner.js.map +1 -1
  47. package/dist/smoke-test/smoke-coverage/classify.d.ts +10 -0
  48. package/dist/smoke-test/smoke-coverage/classify.d.ts.map +1 -0
  49. package/dist/smoke-test/smoke-coverage/classify.js +90 -0
  50. package/dist/smoke-test/smoke-coverage/classify.js.map +1 -0
  51. package/dist/smoke-test/smoke-coverage/evaluate.d.ts +29 -0
  52. package/dist/smoke-test/smoke-coverage/evaluate.d.ts.map +1 -0
  53. package/dist/smoke-test/smoke-coverage/evaluate.js +270 -0
  54. package/dist/smoke-test/smoke-coverage/evaluate.js.map +1 -0
  55. package/dist/smoke-test/smoke-coverage/index.d.ts +8 -0
  56. package/dist/smoke-test/smoke-coverage/index.d.ts.map +1 -0
  57. package/dist/smoke-test/smoke-coverage/index.js +7 -0
  58. package/dist/smoke-test/smoke-coverage/index.js.map +1 -0
  59. package/dist/smoke-test/smoke-coverage/model.d.ts +20 -0
  60. package/dist/smoke-test/smoke-coverage/model.d.ts.map +1 -0
  61. package/dist/smoke-test/smoke-coverage/model.js +114 -0
  62. package/dist/smoke-test/smoke-coverage/model.js.map +1 -0
  63. package/dist/smoke-test/smoke-coverage/run.d.ts +19 -0
  64. package/dist/smoke-test/smoke-coverage/run.d.ts.map +1 -0
  65. package/dist/smoke-test/smoke-coverage/run.js +123 -0
  66. package/dist/smoke-test/smoke-coverage/run.js.map +1 -0
  67. package/dist/smoke-test/smoke-coverage/sitemap.d.ts +34 -0
  68. package/dist/smoke-test/smoke-coverage/sitemap.d.ts.map +1 -0
  69. package/dist/smoke-test/smoke-coverage/sitemap.js +148 -0
  70. package/dist/smoke-test/smoke-coverage/sitemap.js.map +1 -0
  71. package/dist/smoke-test/smoke-coverage/types.d.ts +74 -0
  72. package/dist/smoke-test/smoke-coverage/types.d.ts.map +1 -0
  73. package/dist/smoke-test/smoke-coverage/types.js +13 -0
  74. package/dist/smoke-test/smoke-coverage/types.js.map +1 -0
  75. package/dist/smoke-test/static.d.ts.map +1 -1
  76. package/dist/smoke-test/static.js +69 -6
  77. package/dist/smoke-test/static.js.map +1 -1
  78. package/dist/smoke-test/types.d.ts +23 -6
  79. package/dist/smoke-test/types.d.ts.map +1 -1
  80. package/dist/smoke-test/types.js.map +1 -1
  81. package/dist/validate.d.ts.map +1 -1
  82. package/dist/validate.js +5 -3
  83. package/dist/validate.js.map +1 -1
  84. package/dist/xml-entities.d.ts +3 -0
  85. package/dist/xml-entities.d.ts.map +1 -0
  86. package/dist/xml-entities.js +10 -0
  87. package/dist/xml-entities.js.map +1 -0
  88. package/docs/develop-published.md +36 -0
  89. package/docs/llms.md +1 -0
  90. package/docs/smoke-assertions.md +72 -0
  91. package/docs/smoke-coverage.md +92 -0
  92. package/package.json +6 -2
  93. package/smoke-coverage-dry-run.mjs +61 -0
  94. package/templates/develop-published/develop-published-gate.yml +129 -0
  95. package/templates/develop-published/update-develop-published.yml +58 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.22.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 3a5291b: develop-published-gate and site-check: every compare/sitemap fetch has a 30s timeout (`SITE_CHECK_FETCH_TIMEOUT_MS` overrides it in site-check; a timeout is a transient, retried failure, 3 tries), the spawned compare is killed after 25 minutes and not retried, and the gate workflow template gets a `concurrency` group keyed on the commit so the two READY deployments of one develop-published SHA no longer run the gate twice (a cancelled run posts no status). The gate job also gets `timeout-minutes: 35`, and an early step skips the run (success, no new status) when the newest `develop-published gate` status on the SHA is already `success`; failed, pending or missing statuses still run it. The deployment smoke workflow example in the skills package gets a job `timeout-minutes` too.
8
+
9
+ ## 2.22.0
10
+
11
+ ### Minor Changes
12
+
13
+ - c9aa97d: `develop-published-gate`: new `--sitemap-roots <paths>` option (comma-separated or repeated; paths or absolute production URLs) for the sitemap roots the app owns. The prod compare then walks only those roots (an index is followed one level) instead of the full production sitemap index, so URLs another app serves (for example `/earn/*` on point.me) are no longer compared. Without the option nothing changes: the full production sitemap index is compared as before. An unreadable, nested-index or empty root fails the compare.
14
+
15
+ ## 2.21.2
16
+
17
+ ### Patch Changes
18
+
19
+ - 396c0a4: `develop-published-gate`: the prod compare "sitemap pages exist" now only requires production sitemap URLs that return 200 on production. A URL missing on the build that also 404s/410s on production is reported as a warning ("prod sitemap lists dead URL"), not a gate failure; an indeterminate production answer (5xx, error) still fails. Transient fetch errors ("fetch failed", ECONNRESET, timeouts) are retried up to 3 times with backoff, both for the gate's own requests and for the spawned compare.
20
+
21
+ ## 2.21.1
22
+
23
+ ### Patch Changes
24
+
25
+ - 0692edf: develop-published docs and gate workflow template: the gate workflow checks out the promoted commit (not the build commit), and the docs describe how `ignoreCommand` skips builds and why the exact-commit stage accepts an ancestor build.
26
+
27
+ ## 2.21.0
28
+
29
+ ### Minor Changes
30
+
31
+ - bd04e26: Add `develop-published-gate`, the promote gate for a persistent published-content build of develop (exact commit, noindex, draft canary, full smoke, content smoke, prod compare), plus workflow templates in `templates/develop-published/` and `docs/develop-published.md`. Fix compare mode (`--check-against`) and the markdown URL collector failing on sitemap URLs that contain XML entities (for example `&apos;` in a slug): `<loc>` values are now decoded. In compare mode, `--vercel-bypass` now applies to the `--check-against` (development) requests only; production is public and no longer receives the bypass secret (`-H` headers still apply to both).
32
+
33
+ ## 2.20.0
34
+
35
+ ### Minor Changes
36
+
37
+ - 11227f7: Add an opt-in `coverage` block to `smoke.cases.json`. It reads the Contentful content model (read-only) and the site's `sitemap.xml`, reports the type name when a routable type has no smoke case (default mode `warn`, staged adoption `warn` then `enforce`), and can sample one deterministic route per type. Adds `privacy` and `person-index` smoke categories and a read-only `smoke-coverage-dry-run` script. Behaviour change for existing `deadLinks` users: a block without `mode` now defaults to `warn` (set `mode: "error"` to keep failing on dead links), and a `production` environment with a `*.vercel.app` base URL adds a warning. Files without a `coverage` block behave as before.
38
+ - 473cca5: Smoke runner follow-ups, all opt-in and backward compatible: `contentAssert` accepts an array of blocks, `environments` scopes a block to `local`/`preview`/`production` (`SMOKE_TEST_ENVIRONMENT`, inferred otherwise, never `production` from a preview URL), and `allowNon2xx` runs assertions on an expected 404. A top-level `deadLinks` block checks same-origin links on each smoke page (capped, concurrency-limited, reports each dead link with its source page). `runStaticSmokeTest` takes `protectionBypass: true` to send `x-vercel-protection-bypass`. See `docs/smoke-assertions.md`.
39
+
3
40
  ## 2.19.1
4
41
 
5
42
  ### Patch Changes
package/README.md CHANGED
@@ -84,6 +84,7 @@ Headers from `-H` override the Vercel bypass header if the same name is used.
84
84
  | `SITEMAP_PROD_URL` | Public production site base URL (sitemap-validate scripts, smoke case curation). Trailing slash is stripped. |
85
85
  | `PRODUCTION_SITE_URL` | Production site base URL for audits and tooling that need a canonical prod origin. Trailing slash is stripped. |
86
86
  | `VERCEL_PROTECTION_BYPASS_TOKEN` | Vercel Deployment Protection bypass secret (Vercel → Settings → Deployment Protection). Sent as `x-vercel-protection-bypass`. Aliases: `VERCEL_AUTOMATION_BYPASS_SECRET`, `VERCEL_BYPASS_TOKEN`. |
87
+ | `SMOKE_TEST_ENVIRONMENT` | `local`, `preview` or `production`. Scopes `contentAssert.environments` blocks; see [docs/smoke-assertions.md](./docs/smoke-assertions.md). Inferred when unset (never `production` from a preview URL). |
87
88
  | `SMOKE_TEST_REQUIRE_BYPASS` | `smoke-test-live` only. Set to `false` for a site with Deployment Protection switched off: the live smoke then runs without a bypass token (a token, if present, is still sent). Default: a token is required, so a protected deployment fails loudly. |
88
89
 
89
90
  ## Production HTML audit (`@se-studio/site-check/production-audit`)
@@ -181,6 +182,10 @@ Map `routing` from the app’s `constants.ts` / URL rules. Use `runStaticSmokeTe
181
182
 
182
183
  Import from `@se-studio/site-check/cms-integrity` for standalone checks: `runArticleLinkIntegrityFromSmokeConfig`, `evaluateArticleLinkIntegrity`, `getArticleLinkIntegrityExitCode`.
183
184
 
185
+ ### Coverage check (`coverage` in `smoke.cases.json`)
186
+
187
+ Optional, opt-in. Compares the cases with the site's Contentful model and sitemap, fails (or samples) when a routable type has no case, and adds the `privacy` and `person-index` categories. Files without a `coverage` block run unchanged. See [docs/smoke-coverage.md](./docs/smoke-coverage.md) for the config, items, dry run (`smoke-coverage-dry-run`) and the customer migration note.
188
+
184
189
  ### Vercel build cache (`VERCEL_FORCE_NO_BUILD_CACHE`)
185
190
 
186
191
  Not a smoke variable — set on the **Vercel project** when `next build` fails intermittently with webpack `WasmHash` errors (often with stale remote build cache; local `pnpm build` may still pass).
@@ -250,6 +255,12 @@ Optional per-case HTML checks for release verification (key blocks must render,
250
255
  }
251
256
  ```
252
257
 
258
+ `contentAssert` also accepts an array of blocks, `environments` (run a block only in `local`/`preview`/`production`) and `allowNon2xx` (assert on an expected 404). A top-level `deadLinks` block adds an opt-in dead internal link check per page, and `runStaticSmokeTest` takes `protectionBypass: true` for protected previews. See [docs/smoke-assertions.md](./docs/smoke-assertions.md).
259
+
260
+ ### develop-published gate (`develop-published-gate`)
261
+
262
+ Promote gate against a persistent published-content build of develop: exact commit, noindex, draft canary, full smoke, content smoke and a prod compare, in one command. Workflow templates are in `templates/develop-published/`. See [docs/develop-published.md](./docs/develop-published.md).
263
+
253
264
  ### Publish-state check (CDA vs CPA)
254
265
 
255
266
  Before promoting when Contentful entries changed, compare Delivery vs Preview: