@eightmedia/flightcheck 1.0.0 → 1.1.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/analyze/structuredReport.d.ts +9 -0
  3. package/dist/analyze/structuredReport.d.ts.map +1 -1
  4. package/dist/analyze/structuredReport.js +38 -15
  5. package/dist/analyze.js +6 -0
  6. package/dist/checks/agent-ready.d.ts.map +1 -1
  7. package/dist/checks/agent-ready.js +8 -8
  8. package/dist/checks/analyze.d.ts +4 -0
  9. package/dist/checks/analyze.d.ts.map +1 -1
  10. package/dist/checks/analyze.js +2 -0
  11. package/dist/checks/crawl.d.ts.map +1 -1
  12. package/dist/checks/crawl.js +11 -0
  13. package/dist/checks/dns.d.ts.map +1 -1
  14. package/dist/checks/dns.js +2 -2
  15. package/dist/checks/issues.d.ts +3 -1
  16. package/dist/checks/issues.d.ts.map +1 -1
  17. package/dist/checks/issues.js +2 -2
  18. package/dist/checks/redirect.d.ts.map +1 -1
  19. package/dist/checks/redirect.js +12 -12
  20. package/dist/checks/robots-txt.d.ts.map +1 -1
  21. package/dist/checks/robots-txt.js +6 -6
  22. package/dist/checks/security-headers.d.ts.map +1 -1
  23. package/dist/checks/security-headers.js +6 -6
  24. package/dist/checks/sitemap.d.ts.map +1 -1
  25. package/dist/checks/sitemap.js +6 -6
  26. package/dist/cli.js +7 -1
  27. package/dist/crawler/defaults.d.ts +2 -1
  28. package/dist/crawler/defaults.d.ts.map +1 -1
  29. package/dist/crawler/defaults.js +2 -1
  30. package/dist/crawler/runCrawler.d.ts.map +1 -1
  31. package/dist/crawler/runCrawler.js +12 -3
  32. package/dist/crawler/smartPageSelection.d.ts +77 -0
  33. package/dist/crawler/smartPageSelection.d.ts.map +1 -0
  34. package/dist/crawler/smartPageSelection.js +308 -0
  35. package/dist/version.d.ts +9 -0
  36. package/dist/version.d.ts.map +1 -0
  37. package/dist/version.js +24 -0
  38. package/docs/agent-fixes.md +5 -7
  39. package/docs/agent-ready.md +2 -2
  40. package/docs/analyze.md +19 -7
  41. package/docs/crawler.md +15 -2
  42. package/docs/index.md +2 -4
  43. package/docs/qc-checks-plan.md +5 -4
  44. package/docs/stack.md +11 -18
  45. package/package.json +1 -1
package/docs/analyze.md CHANGED
@@ -36,6 +36,8 @@ Without `--output`, paths are derived from the input: `-raw.json` becomes
36
36
  ```json
37
37
  {
38
38
  "version": 1,
39
+ "flightcheckVersion": "1.0.1",
40
+ "flags": ["https://example.com", "--quiet"],
39
41
  "generatedAt": "2026-10-27T12:00:00.000Z",
40
42
  "source": "./flightcheck/example-raw.json",
41
43
  "redirectOnly": false,
@@ -67,7 +69,8 @@ Without `--output`, paths are derived from the input: `-raw.json` becomes
67
69
  "category": "infra",
68
70
  "scope": "origin",
69
71
  "title": "Missing Hsts",
70
- "message": "Strict-Transport-Security header is missing on HTTPS."
72
+ "message": "Strict-Transport-Security header is missing on HTTPS.",
73
+ "fix": "Send `Strict-Transport-Security: max-age=31536000; includeSubDomains` on HTTPS responses (hosting or app headers)."
71
74
  }
72
75
  ]
73
76
  }
@@ -82,22 +85,31 @@ includes metadata so consumers can filter or regroup.
82
85
  | `category` | `infra` \| `seo` \| `a11y` \| `best-practices` \| `security` \| `performance` |
83
86
  | `scope` | `site-wide` \| `template` \| `page` \| `origin` |
84
87
  | `title` | Short human title |
85
- | `message` | What to do / what was found |
88
+ | `message` | What was found |
89
+ | `fix` | Concrete remediation suggestion when available |
86
90
  | `template` | Present when `scope` is `template` |
87
91
  | `urls` / `count` | Affected pages when relevant |
88
92
 
93
+ Header fields:
94
+
95
+ | Field | Meaning |
96
+ | --- | --- |
97
+ | `version` | Report JSON schema version |
98
+ | `flightcheckVersion` | npm package version that produced the report |
99
+ | `flags` | CLI arguments used for this run (empty when not invoked via CLI) |
100
+
89
101
  ### `*-report.md`
90
102
 
91
103
  Generated from the JSON. Structure:
92
104
 
93
- 1. **At a glance** — page counts and finding totals
94
- 2. **Stack / DNS / redirect** — factual context when available
95
- 3. **Findings** — grouped by severity for reading order, with plain-language titles
105
+ 1. Header — generated time, Flightcheck version, flags, source path
106
+ 2. **At a glance** — page counts and finding totals
107
+ 3. **Stack / DNS / redirect** — factual context when available
108
+ 4. **Findings** — grouped by severity for reading order, with plain-language titles and a **Fix** line when available
96
109
 
97
110
  ## Notes
98
111
 
99
112
  - The script validates crawl input against the expected flightcheck report schema.
100
113
  - On schema errors, the script stops with a clear error message.
101
114
  - Fix-manifest and agent-jobs output are no longer generated. Prefer `*-report.json`
102
- for machine consumers. See the design note in
103
- [superpowers/specs/2026-10-27-structured-report-design.md](./superpowers/specs/2026-10-27-structured-report-design.md).
115
+ for machine consumers.
package/docs/crawler.md CHANGED
@@ -34,7 +34,7 @@ Key flags:
34
34
  - `--errors-only` include only critical/error findings in the Markdown report
35
35
  - `--checks <ids>` comma-separated checks; default: all implemented checks (`crawl`, `security-headers`, `dns`, `robots-txt`, `sitemap`, `analyze`)
36
36
  - `--parallel` run independent checks in the same wave concurrently
37
- - `--max-pages <n>`
37
+ - `--max-pages <n>` (default **100**) — hard crawl budget with smart URL selection (see below)
38
38
  - `--delay-ms <n>`
39
39
  - `--timeout-ms <n>`
40
40
  - `--concurrency <n>`
@@ -149,7 +149,20 @@ Additionally:
149
149
 
150
150
  - Only internal links are crawled. Links are discovered via `extractInternalLinks` and added to the queue; Crawlee's `enqueueLinks` is intentionally not used.
151
151
  - Sitemap URLs are added to the crawl queue by default so pages from `sitemap.xml` are visited even when they are not reachable via internal links.
152
- - `--max-pages` is the hard stop (`maxRequestsPerCrawl`). The crawl stops once this count is processed, even if unvisited links remain. Increase `--max-pages` to crawl the entire site.
152
+ - `--max-pages` (default **100**) is the hard stop (`maxRequestsPerCrawl`). The crawl stops once this count is processed, even if unvisited links remain. Raise `--max-pages` (for example `1000` or higher) when you need broader coverage of a large site.
153
+
154
+ ### Smart page selection
155
+
156
+ Large sitemaps often list thousands of archive detail URLs. Selection is based on **URL-tree shape**, not slug names (so `/stories`, `/nieuws`, or `/whatever` all work the same):
157
+
158
+ 1. Build a path tree from known URLs (sitemap seeds and later discoveries)
159
+ 2. Treat a path as a **list parent** when it has many direct children that are mostly **leaves** (no further subpages) — typical archive indexes
160
+ 3. Prefer **home**, other **structural** shallow pages, and those **list** indexes
161
+ 4. Under each list parent, take only a **round-robin sample** of leaf URLs until `--max-pages` is filled
162
+
163
+ Seed order follows that ranking (FIFO). Structural links discovered from HTML are pushed to the front of the queue (`forefront`); leaf URLs under list parents are capped so one archive cannot flood the budget.
164
+
165
+ Selection lives in `src/crawler/smartPageSelection.ts`.
153
166
  - Query parameters and hashes do not count toward URL identity.
154
167
  - Non-HTML responses are reported with `note`.
155
168
  - Links to files with a known non-HTML extension (such as `.pdf`, `.zip`, images, video, fonts) are not added to the queue, so Crawlee does not generate unnecessary retries and errors.
package/docs/index.md CHANGED
@@ -11,14 +11,12 @@
11
11
  - [QC checks plan](./qc-checks-plan.md)
12
12
  - [Agent fixes (deprecated)](./agent-fixes.md)
13
13
 
14
- ## Specs
15
-
16
- - [Structured report](./superpowers/specs/2026-10-27-structured-report-design.md)
17
-
18
14
  ## Changelog
19
15
 
20
16
  - Package releases: [CHANGELOG.md](../CHANGELOG.md)
21
17
  - Branch notes: [changelog/](./changelog/)
18
+ - [2026-10-28 — smart-max-pages](./changelog/2026-10-28--smart-max-pages.md)
19
+ - [2026-10-28 — report-version-flags](./changelog/2026-10-28--report-version-flags.md)
22
20
  - [2026-10-27 — npm-public-package](./changelog/2026-10-27--npm-public-package.md)
23
21
  - [2026-10-27 — structured-report-json](./changelog/2026-10-27--structured-report-json.md)
24
22
  - [2026-09-28 — agent-ready-check](./changelog/2026-09-28--agent-ready-check.md)
@@ -6,7 +6,7 @@ image alt text, broken links, accessibility, security headers, DNS, and optional
6
6
  performance auditing.
7
7
 
8
8
  **Status:** in progress — Phase 1 shipped, Phase 2 mostly shipped
9
- **Last updated:** 2026-09-28
9
+ **Last updated:** 2026-10-27
10
10
 
11
11
  ---
12
12
 
@@ -18,8 +18,9 @@ Add the checks below as modular, exportable functions (see `docs/check-api.md`)
18
18
  - Run independently via API endpoints in a consuming project
19
19
  - Execute in parallel where dependencies allow
20
20
 
21
- Each check produces structured JSON output and feeds into the Markdown TODO report via
22
- `analyze`.
21
+ Each check produces structured JSON output and feeds into analyze, which writes
22
+ `*-report.json` (`analysis` + `findings[]`) and a plain-language `*-report.md` from that
23
+ model.
23
24
 
24
25
  ---
25
26
 
@@ -126,7 +127,7 @@ Wave 3 (optional, after crawl):
126
127
  performance (Lighthouse or PageSpeed API on same URL sample)
127
128
 
128
129
  Wave 4:
129
- analyze (merges all check outputs into TODO report)
130
+ analyze (merges check outputs into *-report.json + *-report.md)
130
131
  ```
131
132
 
132
133
  Wave 2 and 3 share a URL sampler (`src/checks/sampleUrls.ts`):
package/docs/stack.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Stack detection
2
2
 
3
- Flightcheck fingerprints the technology stack of a crawled site for handover docs and agent
4
- routing. Results appear in `analysis.stack` in `*-report.json` and under **Stack** in the Markdown report.
3
+ Flightcheck fingerprints the technology stack of a crawled site for handover docs and tooling.
4
+ Results appear in `analysis.stack` in `*-report.json` and under **Stack** in the Markdown report.
5
5
 
6
6
  Detection uses **curated flightcheck rules** in `src/crawler/stackDetect.ts` — not the full
7
7
  Wappalyzer / webappanalyzer database. Rules only fire on strong signals (script URLs, distinctive
@@ -49,26 +49,19 @@ during analyze.
49
49
 
50
50
  ## Analyze output
51
51
 
52
- ```markdown
53
- ## Stack
54
-
55
- ### Platform
56
- - **Node.js** (medium, site-wide)
57
- - implied by Next.js
58
-
59
- ### Framework
60
- - **Next.js** (high, site-wide)
61
- - html: `data-next-head`
52
+ In `*-report.json`, stack detections live under `analysis.stack` (name, categories,
53
+ confidence, evidence, pageCount). The Markdown report renders them as:
62
54
 
63
- ### Hosting
64
- - **Vercel** (high, origin)
65
- - header: x-vercel-id
55
+ ```markdown
56
+ ### Stack
66
57
 
67
- ### Tracking (flightcheck crawl)
68
- - Tag managers:
69
- - Google Tag Manager: `GTM-XXXX`
58
+ - **Next.js** (JavaScript frameworks, high) — Next.js runtime markers in HTML
59
+ - **Vercel** (Hosting, high) — header: x-vercel-id
70
60
  ```
71
61
 
62
+ Tracking IDs from the crawl are still aggregated in the stack profile for tooling; the
63
+ human Markdown report focuses on stack detections in the **At a glance** section.
64
+
72
65
  Run with infra checks for the fullest picture:
73
66
 
74
67
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eightmedia/flightcheck",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Pre-launch website audit: crawl SEO/a11y/security checks and emit structured JSON + Markdown reports.",
5
5
  "license": "GPL-3.0",
6
6
  "type": "module",