eaa-kit 0.9.0 → 0.11.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/README.md +174 -149
- package/dist/astro/index.d.ts +1 -3
- package/dist/astro/index.js +2 -3
- package/dist/audit/runners/worker.js +2 -3
- package/dist/{audit-J2jeLo-y.js → audit-DbqNIrt6.js} +61 -35
- package/dist/audit-rUhqnm3o.js +1 -0
- package/dist/{baseline-DrFh7joZ.js → baseline-CKElWbx4.js} +4 -5
- package/dist/baseline-DU0EPiTq.js +1 -0
- package/dist/baseline-DYOejLFO.js +1 -0
- package/dist/{baseline-wyJsSIFQ.js → baseline-DvdsFTQy.js} +5 -6
- package/dist/{cache-D4dOIuOi.js → cache-DIV4G0TI.js} +24 -5
- package/dist/{checklist-Gx2g3LFC.js → checklist-CA0Ri71Z.js} +7 -8
- package/dist/cli/index.js +52 -35
- package/dist/{collect-BJYk7_pJ.js → collect-CjucwTEF.js} +16 -8
- package/dist/{command-BGGMf4vn.js → command-C8ZFvcc1.js} +6 -9
- package/dist/completeness-Cg-XIKWN.js +1 -0
- package/dist/completeness-Dzyvgr4Z.js +72 -0
- package/dist/component-CgbeRgJa.js +1 -0
- package/dist/{component-ChisoFyY.js → component-ZLd8DA_a.js} +3 -4
- package/dist/{countries-Dg0BdytB.js → countries-B_PE6r5R.js} +42 -18
- package/dist/{countries-DRTBubeE.js → countries-CCqog6dy.js} +10 -7
- package/dist/coverage-B9_6yv_8.js +2 -0
- package/dist/{coverage-zdzgSKjz.js → coverage-C1Z6t9Ct.js} +5 -7
- package/dist/{crawl-DwdqiljK.js → crawl-CkHJJV4w.js} +131 -23
- package/dist/{criteria-CnPJKGeb.js → criteria-CacF0HP1.js} +1 -2
- package/dist/{define-Ctf2uOEh.js → define-BdTPIfqE.js} +5 -5
- package/dist/detect-DnFHXpWh.js +49 -0
- package/dist/detect-oLDadgee.js +160 -0
- package/dist/doctor-q8IebwAb.js +248 -0
- package/dist/eleventy/index.d.ts +1 -3
- package/dist/eleventy/index.js +2 -3
- package/dist/{entry-CjqjrUBY.js → entry-kf94P140.js} +1 -2
- package/dist/{fingerprint-BjYV_0F7.js → fingerprint-CcoQ1WxQ.js} +1 -2
- package/dist/{frameworks-B4ClIJgE.js → frameworks-BboC8eNk.js} +234 -28
- package/dist/frameworks-Y-n3NUuG.js +1 -0
- package/dist/{fs-BmPtmFke.js → fs-tPD5r0wY.js} +1 -2
- package/dist/hosts-B48qR6Vt.js +19 -0
- package/dist/{html-whingnfj.js → html-Bjq3Iw3g.js} +54 -14
- package/dist/{impact-luGCnN8F.js → impact-BGlJ6j0Y.js} +1 -2
- package/dist/{impact-EEB9ZXmC.d.ts → impact-CZjUloYC.d.ts} +0 -2
- package/dist/index.d.ts +10 -23
- package/dist/index.js +3 -3
- package/dist/{init-CPbFVMuk.js → init-3Ti3ao5Z.js} +65 -126
- package/dist/issues-WLlepU95.js +120 -0
- package/dist/{jsdom-CsW_xVcA.js → jsdom-C4pLIMyP.js} +2 -3
- package/dist/jsdom-Zle--VQ1.js +2 -0
- package/dist/{json-SGCgxSPT.js → json-B_k4CDmR.js} +5 -6
- package/dist/json-IL1JxlTL.js +1 -0
- package/dist/{load-CH-ltdlq.js → load-C3eFEdoH.js} +3 -4
- package/dist/load-oQQJPNlV.js +1 -0
- package/dist/markdown-D-QpPYsz.js +138 -0
- package/dist/next-8zDgH0nP.js +119 -0
- package/dist/nuxt/index.d.ts +1 -3
- package/dist/nuxt/index.js +2 -3
- package/dist/{pages-DxY5Z0gl.js → pages-CCP1WfYe.js} +80 -17
- package/dist/{playwright-ukCr_5o3.js → playwright-ky4b_HME.js} +98 -16
- package/dist/{pool-B4tEUa2S.js → pool-B3XKdk57.js} +4 -5
- package/dist/project-B21NT_aX.js +502 -0
- package/dist/project-Dht13sb1.js +1 -0
- package/dist/{remediation-Bbs4KcX1.js → remediation-BkE7q7dT.js} +2 -193
- package/dist/{render-C6zYfaba.js → render-ky8cm4QF.js} +22 -20
- package/dist/result-DhoT4g0P.js +1 -0
- package/dist/{result-B7_zVxAX.js → result-g8dGsrcv.js} +1 -2
- package/dist/{review-Bz0fO9_I.js → review-BGjTBFvd.js} +2 -3
- package/dist/review-iheEjp7_.js +1 -0
- package/dist/{routes-CSctpS1P.js → routes-BpQeBDmM.js} +4 -5
- package/dist/{run-DzVEOkiF.js → run-D7tc7IU2.js} +2 -3
- package/dist/{run-BK2blxMI.d.ts → run-VXnP4uLp.d.ts} +2 -6
- package/dist/{sarif-9BAgNiOa.js → sarif-v66-PjdE.js} +7 -8
- package/dist/{schema-DJSF4K05.js → schema-DfC-Ww1w.js} +1 -2
- package/dist/setup-BYlqHlo0.js +2 -0
- package/dist/setup-Cf82ONw0.js +353 -0
- package/dist/shell-BdQYTaBQ.js +89 -0
- package/dist/{site-BHMtf3q2.js → site-CxVyh8IO.js} +1 -2
- package/dist/{start-DzOM0p6I.js → start-bdanSxZr.js} +9 -10
- package/dist/statement/templates/cz.cs.md +2 -1
- package/dist/statement/templates/cz.en.md +2 -1
- package/dist/statement/templates/dk.da.md +3 -2
- package/dist/statement/templates/dk.en.md +4 -3
- package/dist/statement/templates/pt.en.md +3 -2
- package/dist/statement/templates/pt.pt.md +3 -3
- package/dist/statement/templates/se.en.md +9 -0
- package/dist/statement/templates/se.sv.md +8 -0
- package/dist/{text-BF1LHMiV.js → text-CISDPU49.js} +11 -3
- package/dist/{version-B3v4rNoG.js → version-C8aJm8YJ.js} +1 -2
- package/dist/vite/index.d.ts +1 -3
- package/dist/vite/index.js +2 -3
- package/dist/{watch-B2RoUbo0.js → watch-CefxwMsZ.js} +3 -4
- package/dist/webpack/index.d.ts +1 -3
- package/dist/webpack/index.js +2 -3
- package/dist/{worksheet-B_kQ1pxq.js → worksheet-CcBo9G7s.js} +4 -5
- package/dist/workspaces-BBFXOyeV.js +85 -0
- package/package.json +15 -13
- package/dist/audit-CJDCQaFY.js +0 -2
- package/dist/baseline-477B1CZ_.js +0 -2
- package/dist/baseline-D9ihb-wk.js +0 -2
- package/dist/component-DcCn3BJS.js +0 -2
- package/dist/coverage-GvaMpV64.js +0 -3
- package/dist/frameworks-etFg_O8K.js +0 -2
- package/dist/jsdom-BUYuVJJm.js +0 -3
- package/dist/json-CyLmvF5P.js +0 -2
- package/dist/load-D7lBeOsq.js +0 -2
- package/dist/project-BLFdCbOq.js +0 -2
- package/dist/project-v2PoRw70.js +0 -291
- package/dist/result-CRmjjoAA.js +0 -2
- package/dist/review-a-2ghjQ5.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as exists } from "./fs-
|
|
1
|
+
import { t as exists } from "./fs-tPD5r0wY.js";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
|
|
4
|
+
// src/audit/frameworks.ts
|
|
5
5
|
/**
|
|
6
6
|
* Most specific first. Several of these depend on Vite, so Vite is last: a
|
|
7
7
|
* SvelteKit project is a SvelteKit project, not a Vite one.
|
|
@@ -69,6 +69,38 @@ const FRAMEWORKS = [
|
|
|
69
69
|
outputs: ["build/client"],
|
|
70
70
|
serves: true
|
|
71
71
|
},
|
|
72
|
+
{
|
|
73
|
+
id: "qwik",
|
|
74
|
+
name: "Qwik",
|
|
75
|
+
packages: ["@builder.io/qwik-city", "@qwik.dev/router"],
|
|
76
|
+
outputs: ["dist"],
|
|
77
|
+
staticOutput: {
|
|
78
|
+
needs: "the static adapter",
|
|
79
|
+
how: "run npm run qwik add static, then build"
|
|
80
|
+
},
|
|
81
|
+
serves: true
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "solidstart",
|
|
85
|
+
name: "SolidStart",
|
|
86
|
+
packages: ["@solidjs/start"],
|
|
87
|
+
outputs: [".output/public", "dist"],
|
|
88
|
+
serves: true
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "tanstack-start",
|
|
92
|
+
name: "TanStack Start",
|
|
93
|
+
packages: ["@tanstack/react-start", "@tanstack/solid-start"],
|
|
94
|
+
outputs: [".output/public", "dist/client"],
|
|
95
|
+
serves: true
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: "analog",
|
|
99
|
+
name: "Analog",
|
|
100
|
+
packages: ["@analogjs/platform"],
|
|
101
|
+
outputs: ["dist/analog/public"],
|
|
102
|
+
serves: true
|
|
103
|
+
},
|
|
72
104
|
{
|
|
73
105
|
id: "astro",
|
|
74
106
|
name: "Astro",
|
|
@@ -136,6 +168,93 @@ const FRAMEWORKS = [
|
|
|
136
168
|
outputs: ["build"],
|
|
137
169
|
serves: false
|
|
138
170
|
},
|
|
171
|
+
{
|
|
172
|
+
id: "hexo",
|
|
173
|
+
name: "Hexo",
|
|
174
|
+
packages: ["hexo"],
|
|
175
|
+
outputs: ["public"],
|
|
176
|
+
configs: ["_config.yml"],
|
|
177
|
+
outputPattern: /^public_dir:\s*['"]?([^'"\s#]+)/m,
|
|
178
|
+
serves: false
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: "mkdocs",
|
|
182
|
+
name: "MkDocs",
|
|
183
|
+
packages: [],
|
|
184
|
+
files: ["mkdocs.yml", "mkdocs.yaml"],
|
|
185
|
+
outputs: ["site"],
|
|
186
|
+
configs: ["mkdocs.yml", "mkdocs.yaml"],
|
|
187
|
+
outputPattern: /^site_dir:\s*['"]?([^'"\s#]+)/m,
|
|
188
|
+
buildCommand: "mkdocs build",
|
|
189
|
+
serves: false
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: "sphinx",
|
|
193
|
+
name: "Sphinx",
|
|
194
|
+
packages: [],
|
|
195
|
+
files: [
|
|
196
|
+
"conf.py",
|
|
197
|
+
"docs/conf.py",
|
|
198
|
+
"doc/conf.py",
|
|
199
|
+
"source/conf.py",
|
|
200
|
+
"docs/source/conf.py"
|
|
201
|
+
],
|
|
202
|
+
outputs: [
|
|
203
|
+
"_build/html",
|
|
204
|
+
"docs/_build/html",
|
|
205
|
+
"build/html",
|
|
206
|
+
"docs/build/html",
|
|
207
|
+
"doc/_build/html"
|
|
208
|
+
],
|
|
209
|
+
buildCommand: "sphinx-build -M html docs docs/_build",
|
|
210
|
+
serves: false
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: "mdbook",
|
|
214
|
+
name: "mdBook",
|
|
215
|
+
packages: [],
|
|
216
|
+
files: ["book.toml"],
|
|
217
|
+
outputs: ["book"],
|
|
218
|
+
configs: ["book.toml"],
|
|
219
|
+
outputPattern: /build-dir\s*=\s*['"]([^'"]+)['"]/,
|
|
220
|
+
buildCommand: "mdbook build",
|
|
221
|
+
serves: false
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
id: "quarto",
|
|
225
|
+
name: "Quarto",
|
|
226
|
+
packages: [],
|
|
227
|
+
files: ["_quarto.yml", "_quarto.yaml"],
|
|
228
|
+
outputs: ["_site"],
|
|
229
|
+
configs: ["_quarto.yml", "_quarto.yaml"],
|
|
230
|
+
outputPattern: /output-dir:\s*['"]?([^'"\s#]+)/,
|
|
231
|
+
buildCommand: "quarto render",
|
|
232
|
+
serves: false
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
id: "pelican",
|
|
236
|
+
name: "Pelican",
|
|
237
|
+
packages: [],
|
|
238
|
+
files: ["pelicanconf.py"],
|
|
239
|
+
outputs: ["output"],
|
|
240
|
+
configs: ["pelicanconf.py", "publishconf.py"],
|
|
241
|
+
outputPattern: /OUTPUT_PATH\s*=\s*['"]([^'"]+)['"]/,
|
|
242
|
+
buildCommand: "pelican content",
|
|
243
|
+
serves: false
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
id: "zola",
|
|
247
|
+
name: "Zola",
|
|
248
|
+
packages: [],
|
|
249
|
+
files: ["zola.toml"],
|
|
250
|
+
contents: {
|
|
251
|
+
file: "config.toml",
|
|
252
|
+
pattern: /^\s*base_url\s*=/m
|
|
253
|
+
},
|
|
254
|
+
outputs: ["public"],
|
|
255
|
+
buildCommand: "zola build",
|
|
256
|
+
serves: false
|
|
257
|
+
},
|
|
139
258
|
{
|
|
140
259
|
id: "hugo",
|
|
141
260
|
name: "Hugo",
|
|
@@ -143,9 +262,12 @@ const FRAMEWORKS = [
|
|
|
143
262
|
files: [
|
|
144
263
|
"hugo.toml",
|
|
145
264
|
"hugo.yaml",
|
|
146
|
-
"
|
|
265
|
+
"hugo.json",
|
|
266
|
+
"config.toml",
|
|
267
|
+
"config/_default"
|
|
147
268
|
],
|
|
148
269
|
outputs: ["public"],
|
|
270
|
+
buildCommand: "hugo",
|
|
149
271
|
serves: false
|
|
150
272
|
},
|
|
151
273
|
{
|
|
@@ -154,6 +276,7 @@ const FRAMEWORKS = [
|
|
|
154
276
|
packages: [],
|
|
155
277
|
files: ["_config.yml"],
|
|
156
278
|
outputs: ["_site"],
|
|
279
|
+
buildCommand: "bundle exec jekyll build",
|
|
157
280
|
serves: false
|
|
158
281
|
},
|
|
159
282
|
{
|
|
@@ -191,6 +314,28 @@ const FRAMEWORKS = [
|
|
|
191
314
|
serves: true,
|
|
192
315
|
serveCommand: "ddev start, or php craft serve"
|
|
193
316
|
},
|
|
317
|
+
{
|
|
318
|
+
id: "drupal",
|
|
319
|
+
name: "Drupal",
|
|
320
|
+
packages: [],
|
|
321
|
+
files: [
|
|
322
|
+
"core/lib/Drupal.php",
|
|
323
|
+
"web/core/lib/Drupal.php",
|
|
324
|
+
"docroot/core/lib/Drupal.php"
|
|
325
|
+
],
|
|
326
|
+
outputs: [],
|
|
327
|
+
serves: true,
|
|
328
|
+
serveCommand: "ddev start, or drush runserver"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
id: "statamic",
|
|
332
|
+
name: "Statamic",
|
|
333
|
+
packages: [],
|
|
334
|
+
files: ["please"],
|
|
335
|
+
outputs: [],
|
|
336
|
+
serves: true,
|
|
337
|
+
serveCommand: "php artisan serve"
|
|
338
|
+
},
|
|
194
339
|
{
|
|
195
340
|
id: "laravel",
|
|
196
341
|
name: "Laravel",
|
|
@@ -227,6 +372,65 @@ const FRAMEWORKS = [
|
|
|
227
372
|
serves: true,
|
|
228
373
|
serveCommand: "python manage.py runserver"
|
|
229
374
|
},
|
|
375
|
+
{
|
|
376
|
+
id: "ghost",
|
|
377
|
+
name: "Ghost theme",
|
|
378
|
+
packages: [],
|
|
379
|
+
files: ["default.hbs"],
|
|
380
|
+
outputs: [],
|
|
381
|
+
serves: true,
|
|
382
|
+
serveCommand: "ghost start, in the Ghost install this theme belongs to"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
id: "shopify",
|
|
386
|
+
name: "Shopify theme",
|
|
387
|
+
packages: [],
|
|
388
|
+
files: ["layout/theme.liquid"],
|
|
389
|
+
outputs: [],
|
|
390
|
+
serves: true,
|
|
391
|
+
serveCommand: "shopify theme dev"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
id: "vue-cli",
|
|
395
|
+
name: "Vue CLI",
|
|
396
|
+
packages: ["@vue/cli-service"],
|
|
397
|
+
outputs: ["dist"],
|
|
398
|
+
configs: [
|
|
399
|
+
"vue.config.js",
|
|
400
|
+
"vue.config.mjs",
|
|
401
|
+
"vue.config.ts"
|
|
402
|
+
],
|
|
403
|
+
outputPattern: /outputDir\s*:\s*['"`]([^'"`]+)['"`]/,
|
|
404
|
+
serves: false
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
id: "ember",
|
|
408
|
+
name: "Ember",
|
|
409
|
+
packages: ["ember-cli"],
|
|
410
|
+
outputs: ["dist"],
|
|
411
|
+
serves: false
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
id: "parcel",
|
|
415
|
+
name: "Parcel",
|
|
416
|
+
packages: ["parcel"],
|
|
417
|
+
outputs: ["dist"],
|
|
418
|
+
serves: false
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
id: "rsbuild",
|
|
422
|
+
name: "Rsbuild",
|
|
423
|
+
packages: ["@rsbuild/core"],
|
|
424
|
+
outputs: ["dist"],
|
|
425
|
+
serves: false
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
id: "rspack",
|
|
429
|
+
name: "Rspack",
|
|
430
|
+
packages: ["@rspack/cli", "@rspack/core"],
|
|
431
|
+
outputs: ["dist"],
|
|
432
|
+
serves: false
|
|
433
|
+
},
|
|
230
434
|
{
|
|
231
435
|
id: "vite",
|
|
232
436
|
name: "Vite",
|
|
@@ -264,33 +468,33 @@ async function detectFramework(cwd, pkg) {
|
|
|
264
468
|
...pkg?.devDependencies
|
|
265
469
|
};
|
|
266
470
|
for (const framework of FRAMEWORKS) {
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
byFile = true;
|
|
272
|
-
break;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
if (!byPackage && !byFile) continue;
|
|
276
|
-
const configured = await outputFromConfig(cwd, framework);
|
|
277
|
-
const outputs = configured === void 0 ? [...framework.outputs] : [configured, ...framework.outputs];
|
|
471
|
+
const evidence = await identify(cwd, framework, deps);
|
|
472
|
+
if (evidence === void 0) continue;
|
|
473
|
+
const configured = await configuredOutput(cwd, framework);
|
|
474
|
+
const outputs = configured === void 0 ? [...framework.outputs] : [configured.output, ...framework.outputs];
|
|
278
475
|
return {
|
|
279
476
|
framework,
|
|
280
|
-
outputs: [...new Set(outputs)]
|
|
477
|
+
outputs: [...new Set(outputs)],
|
|
478
|
+
evidence: [evidence, ...configured === void 0 ? [] : [`${configured.file} sets the output to ${configured.output}/`]]
|
|
281
479
|
};
|
|
282
480
|
}
|
|
283
481
|
}
|
|
284
|
-
/**
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
482
|
+
/** What identifies this framework here, in words, or undefined if nothing does. */
|
|
483
|
+
async function identify(cwd, framework, deps) {
|
|
484
|
+
const dependency = framework.packages.find((name) => deps[name] !== void 0);
|
|
485
|
+
if (dependency !== void 0) return `package.json depends on ${dependency}`;
|
|
486
|
+
for (const file of framework.files ?? []) if (await exists(file, cwd)) return `found ${file}`;
|
|
487
|
+
if (framework.contents !== void 0) {
|
|
488
|
+
const { file, pattern } = framework.contents;
|
|
489
|
+
try {
|
|
490
|
+
if (pattern.test(await readFile(path.resolve(cwd, file), "utf8"))) return `${file} is ${article(framework.name)} ${framework.name} config`;
|
|
491
|
+
} catch {}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
function article(name) {
|
|
495
|
+
return /^[AEFHILMNORSX]/.test(name) ? "an" : "a";
|
|
496
|
+
}
|
|
497
|
+
async function configuredOutput(cwd, framework) {
|
|
294
498
|
if (framework.configs === void 0 || framework.outputPattern === void 0) return void 0;
|
|
295
499
|
for (const name of framework.configs) {
|
|
296
500
|
let source;
|
|
@@ -302,7 +506,10 @@ async function outputFromConfig(cwd, framework) {
|
|
|
302
506
|
const value = framework.outputPattern.exec(source)?.[1];
|
|
303
507
|
if (value === void 0 || value === "") continue;
|
|
304
508
|
if (path.isAbsolute(value)) continue;
|
|
305
|
-
return
|
|
509
|
+
return {
|
|
510
|
+
file: name,
|
|
511
|
+
output: value.replace(/^\.\//, "").replace(/\/$/, "")
|
|
512
|
+
};
|
|
306
513
|
}
|
|
307
514
|
}
|
|
308
515
|
/** Every output directory worth trying, framework-aware, most likely first. */
|
|
@@ -310,5 +517,4 @@ async function candidateOutputs(cwd, pkg) {
|
|
|
310
517
|
const detected = await detectFramework(cwd, pkg);
|
|
311
518
|
return [.../* @__PURE__ */ new Set([...detected?.outputs ?? [], ...FALLBACK_OUTPUTS])];
|
|
312
519
|
}
|
|
313
|
-
|
|
314
|
-
export { outputFromConfig as a, detectFramework as i, FRAMEWORKS as n, candidateOutputs as r, FALLBACK_OUTPUTS as t };
|
|
520
|
+
export { detectFramework as i, FRAMEWORKS as n, candidateOutputs as r, FALLBACK_OUTPUTS as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as FALLBACK_OUTPUTS, r as candidateOutputs, i as detectFramework } from "./frameworks-BboC8eNk.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { stat } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
|
|
3
|
+
// src/fs.ts
|
|
4
4
|
/**
|
|
5
5
|
* Asking the filesystem a yes-or-no question.
|
|
6
6
|
*
|
|
@@ -36,5 +36,4 @@ async function isDirectory(target) {
|
|
|
36
36
|
function toPosix(filePath) {
|
|
37
37
|
return filePath.split(path.sep).join("/");
|
|
38
38
|
}
|
|
39
|
-
//#endregion
|
|
40
39
|
export { toPosix as i, isDirectory as n, isFile as r, exists as t };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/cli/hosts.ts
|
|
2
|
+
/**
|
|
3
|
+
* The CI systems `init` writes a pipeline for.
|
|
4
|
+
*
|
|
5
|
+
* On their own so the command line can list them in `--help` without loading
|
|
6
|
+
* the project detection that writing a pipeline needs.
|
|
7
|
+
*/
|
|
8
|
+
const CI_HOSTS = [
|
|
9
|
+
"github",
|
|
10
|
+
"gitlab",
|
|
11
|
+
"bitbucket"
|
|
12
|
+
];
|
|
13
|
+
/** How each host's pipeline is named to a person. */
|
|
14
|
+
const CI_HOST_NAMES = {
|
|
15
|
+
github: "GitHub Actions workflow",
|
|
16
|
+
gitlab: "GitLab CI job",
|
|
17
|
+
bitbucket: "Bitbucket Pipelines step"
|
|
18
|
+
};
|
|
19
|
+
export { CI_HOST_NAMES as n, CI_HOSTS as t };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
7
|
-
import { r as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { c as standardsReference, i as escapeText, n as count, r as escapeAttribute, t as collapse } from "./text-CISDPU49.js";
|
|
2
|
+
import { t as TOOL_VERSION } from "./version-C8aJm8YJ.js";
|
|
3
|
+
import { a as reusedPart, n as missedParts, r as redirectPart, t as discoveryLabel } from "./completeness-Dzyvgr4Z.js";
|
|
4
|
+
import { r as componentPath } from "./component-ZLd8DA_a.js";
|
|
5
|
+
import { a as manualCheckFor, o as understandingUrl, r as reviewSummary, t as buildCoverage } from "./coverage-C1Z6t9Ct.js";
|
|
6
|
+
import { a as impactLabel, r as byImpactThenRule } from "./impact-BGlJ6j0Y.js";
|
|
7
|
+
import { a as issueTotals, i as isShared, n as coverageParts, r as groupIssues, t as blindRules } from "./issues-WLlepU95.js";
|
|
8
|
+
import { t as remediationFor } from "./remediation-BkE7q7dT.js";
|
|
9
|
+
import { u as runEngine } from "./result-g8dGsrcv.js";
|
|
10
|
+
import { l as reviewSentence } from "./review-BGjTBFvd.js";
|
|
11
|
+
import { n as buildSummary } from "./json-B_k4CDmR.js";
|
|
10
12
|
import axe from "axe-core";
|
|
11
|
-
|
|
13
|
+
// src/audit/report/html.ts
|
|
12
14
|
/**
|
|
13
15
|
* A standalone HTML audit report.
|
|
14
16
|
*
|
|
@@ -57,6 +59,7 @@ ${STYLES}
|
|
|
57
59
|
<main>
|
|
58
60
|
<h1>Accessibility audit</h1>
|
|
59
61
|
${verdict(totals, options)}
|
|
62
|
+
${sinceBaseline(totals, options)}
|
|
60
63
|
${scoreboard(audits)}
|
|
61
64
|
${issues(audits, options)}
|
|
62
65
|
${runDetails(audits, engine, generatedAt, options)}
|
|
@@ -89,6 +92,26 @@ function verdict(totals, options) {
|
|
|
89
92
|
if (completeness && !completeness.complete) return banner("partial", "No violations found, but the whole site was not measured", `${escapeText(missedParts(completeness).join(", "))}. This report describes ${count(completeness.audited, "page")}, not the site.`);
|
|
90
93
|
return banner("pass", "No violations found", "Automated testing found nothing to report.");
|
|
91
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* What changed since the baseline was recorded, for the reader who wants to
|
|
97
|
+
* know whether things are getting better: what is new, what the project still
|
|
98
|
+
* lives with, and what has been fixed since.
|
|
99
|
+
*
|
|
100
|
+
* Only with a baseline. Without one there is no "last time" this report can
|
|
101
|
+
* speak for, and inventing one from an earlier run nobody pointed at would be
|
|
102
|
+
* a comparison the reader never asked for.
|
|
103
|
+
*/
|
|
104
|
+
function sinceBaseline(totals, options) {
|
|
105
|
+
const baseline = options.baseline;
|
|
106
|
+
if (baseline === void 0) return "";
|
|
107
|
+
const items = [
|
|
108
|
+
`<li><strong>${totals.failing}</strong> new ${totals.failing === 1 ? "violation" : "violations"} at or above ${escapeText(options.failOn)}, which the baseline does not list</li>`,
|
|
109
|
+
`<li><strong>${totals.accepted}</strong> ${totals.accepted === 1 ? "element" : "elements"} the baseline still accepts</li>`,
|
|
110
|
+
`<li><strong>${baseline.stale}</strong> baseline ${baseline.stale === 1 ? "entry" : "entries"} no longer found: fixed, or the element is gone</li>`
|
|
111
|
+
];
|
|
112
|
+
if (baseline.expired > 0) items.push(`<li><strong>${baseline.expired}</strong> baseline ${baseline.expired === 1 ? "entry has" : "entries have"} expired and no longer ${baseline.expired === 1 ? "suppresses" : "suppress"} anything</li>`);
|
|
113
|
+
return `<h2>Since the baseline</h2>\n<ul class="counts since">\n ${items.join("\n ")}\n</ul>`;
|
|
114
|
+
}
|
|
92
115
|
function banner(kind, heading, detail) {
|
|
93
116
|
return `<p class="verdict ${escapeAttribute(kind)}"><strong>${escapeText(heading)}</strong> ${detail}</p>`;
|
|
94
117
|
}
|
|
@@ -420,7 +443,8 @@ p.reach, p.sources, p.selector, p.more, p.written-in { margin: 0.35rem 0; font-s
|
|
|
420
443
|
.element details { font-size: 0.9rem; color: #4a4a4a; }
|
|
421
444
|
.element summary { cursor: pointer; }
|
|
422
445
|
ul.page-list { margin: 0.35rem 0 0; padding-left: 1.25rem; }
|
|
423
|
-
|
|
446
|
+
/* Screen only: a reader whose system is dark still prints on white paper. */
|
|
447
|
+
@media screen and (prefers-color-scheme: dark) {
|
|
424
448
|
body { background: #121212; color: #ededed; }
|
|
425
449
|
a { color: #9ec1ff; }
|
|
426
450
|
h2, hr { border-color: #3a3a3a; }
|
|
@@ -456,9 +480,26 @@ ul.page-list { margin: 0.35rem 0 0; padding-left: 1.25rem; }
|
|
|
456
480
|
.badge.unclassified { background: #1f1f1f; border-color: #b6b6b6; color: #d8d8d8; }
|
|
457
481
|
}
|
|
458
482
|
@media print {
|
|
459
|
-
|
|
460
|
-
|
|
483
|
+
@page { margin: 16mm 14mm; }
|
|
484
|
+
:root { color-scheme: light; }
|
|
485
|
+
body { background: #ffffff; color: #000000; font-size: 10.5pt; line-height: 1.45; }
|
|
486
|
+
main { max-width: none; padding: 0; }
|
|
461
487
|
a { color: #000000; }
|
|
488
|
+
/* Paper has no links, so the address goes beside the text it was behind. */
|
|
489
|
+
a[href^="http"]::after { content: " <" attr(href) ">"; font-size: 0.8em; color: #333333;
|
|
490
|
+
overflow-wrap: anywhere; }
|
|
491
|
+
h1, h2, h3, p.rule, p.review-heading, p.accepted-heading { break-after: avoid; }
|
|
492
|
+
h2 { margin-top: 1.5rem; padding-top: 0.75rem; }
|
|
493
|
+
li.finding, li.issue, .element, .tile, .verdict, dl.run, tr, ul.counts { break-inside: avoid; }
|
|
494
|
+
pre, pre code { white-space: pre-wrap; overflow-wrap: anywhere; overflow: visible; }
|
|
495
|
+
.scroll { overflow: visible; }
|
|
496
|
+
/* Collapsed detail is still detail: a printed report is read without a mouse. */
|
|
497
|
+
details::details-content { content-visibility: visible; display: block; }
|
|
498
|
+
summary { list-style: none; font-weight: 600; }
|
|
499
|
+
.badge, .tile, .verdict, pre.suggested { print-color-adjust: exact;
|
|
500
|
+
-webkit-print-color-adjust: exact; }
|
|
501
|
+
.scoreboard { gap: 0.4rem; }
|
|
502
|
+
.tile { padding: 0.4rem 0.6rem; }
|
|
462
503
|
}`;
|
|
463
504
|
/**
|
|
464
505
|
* The counts, worst first, with what was never checked beside them.
|
|
@@ -565,5 +606,4 @@ function manualBlock(ruleId, finding) {
|
|
|
565
606
|
links.length === 0 ? "" : ` <p class="criteria">${links.join(" · ")}</p>`
|
|
566
607
|
].filter((line) => line !== "").join("\n");
|
|
567
608
|
}
|
|
568
|
-
//#endregion
|
|
569
609
|
export { buildHtmlReport };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/audit/impact.ts
|
|
2
2
|
/** axe-core's impact scale, least to most severe. */
|
|
3
3
|
const IMPACT_LEVELS = [
|
|
4
4
|
"minor",
|
|
@@ -52,5 +52,4 @@ function countAtOrAbove(audits, threshold) {
|
|
|
52
52
|
for (const audit of audits) for (const finding of audit.violations) if (meetsThreshold(finding.impact, threshold)) total += 1;
|
|
53
53
|
return total;
|
|
54
54
|
}
|
|
55
|
-
//#endregion
|
|
56
55
|
export { impactLabel as a, meetsThreshold as c, countAtOrAbove as i, IMPACT_LEVELS as n, impactRank as o, byImpactThenRule as r, isImpactLevel as s, DEFAULT_FAIL_ON as t };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import "axe-core";
|
|
2
|
-
//#region src/audit/impact.d.ts
|
|
3
2
|
/** axe-core's impact scale, least to most severe. */
|
|
4
3
|
declare const IMPACT_LEVELS: readonly ['minor', 'moderate', 'serious', 'critical'];
|
|
5
4
|
type ImpactLevel = (typeof IMPACT_LEVELS)[number];
|
|
6
|
-
//#endregion
|
|
7
5
|
export { ImpactLevel as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as ImpactLevel } from "./impact-
|
|
2
|
-
//#region src/next.d.ts
|
|
1
|
+
import { t as ImpactLevel } from "./impact-CZjUloYC.js";
|
|
3
2
|
/**
|
|
4
3
|
* The command that gets somebody past an error.
|
|
5
4
|
*
|
|
@@ -19,8 +18,6 @@ interface NextStep {
|
|
|
19
18
|
/** What it does, in a few words. */
|
|
20
19
|
why: string;
|
|
21
20
|
}
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/schema.d.ts
|
|
24
21
|
/**
|
|
25
22
|
* The small amount of schema validation this package actually needs.
|
|
26
23
|
*
|
|
@@ -78,8 +75,6 @@ declare const DEFAULTED: unique symbol;
|
|
|
78
75
|
type DefaultedSchema<T> = Schema<T> & {
|
|
79
76
|
readonly [DEFAULTED]: true;
|
|
80
77
|
};
|
|
81
|
-
//#endregion
|
|
82
|
-
//#region src/config/define.d.ts
|
|
83
78
|
/**
|
|
84
79
|
* Countries with their own supervisory body and statute text. What is known
|
|
85
80
|
* about each one is in `countries.ts`.
|
|
@@ -146,7 +141,7 @@ declare const auditSchema: Schema<ObjectOf<{
|
|
|
146
141
|
maxDepth: OptionalSchema<number>;
|
|
147
142
|
/** Lowest impact that exits 1. */
|
|
148
143
|
failOn: OptionalSchema<"critical" | "minor" | "moderate" | "serious">;
|
|
149
|
-
format: OptionalSchema<"console" | "html" | "json" | "sarif">;
|
|
144
|
+
format: OptionalSchema<"console" | "html" | "json" | "markdown" | "sarif">;
|
|
150
145
|
/** Write the report here instead of stdout. */
|
|
151
146
|
output: OptionalSchema<string>;
|
|
152
147
|
/** Audit in real Chromium. Needs the playwright peer. */
|
|
@@ -253,7 +248,7 @@ declare const configSchema: Schema<ObjectOf<{
|
|
|
253
248
|
maxDepth: OptionalSchema<number>;
|
|
254
249
|
/** Lowest impact that exits 1. */
|
|
255
250
|
failOn: OptionalSchema<"critical" | "minor" | "moderate" | "serious">;
|
|
256
|
-
format: OptionalSchema<"console" | "html" | "json" | "sarif">;
|
|
251
|
+
format: OptionalSchema<"console" | "html" | "json" | "markdown" | "sarif">;
|
|
257
252
|
/** Write the report here instead of stdout. */
|
|
258
253
|
output: OptionalSchema<string>;
|
|
259
254
|
/** Audit in real Chromium. Needs the playwright peer. */
|
|
@@ -357,8 +352,6 @@ declare class ConfigError extends Error {
|
|
|
357
352
|
}
|
|
358
353
|
/** Validate an already-loaded config object. */
|
|
359
354
|
declare function parseConfig(value: unknown, source?: string): EaaConfig;
|
|
360
|
-
//#endregion
|
|
361
|
-
//#region src/config/load.d.ts
|
|
362
355
|
/** Checked in this order, first match wins. */
|
|
363
356
|
declare const CONFIG_FILENAMES: readonly ['eaa.config.ts', 'eaa.config.mts', 'eaa.config.js', 'eaa.config.mjs', 'eaa.config.json'];
|
|
364
357
|
interface LoadedConfig {
|
|
@@ -384,8 +377,6 @@ interface LoadConfigOptions {
|
|
|
384
377
|
declare function loadConfig(options?: LoadConfigOptions): Promise<LoadedConfig>;
|
|
385
378
|
/** Walks up from `cwd`, so the CLI works from a subdirectory of the project. */
|
|
386
379
|
declare function findConfigFile(cwd: string): Promise<string | undefined>;
|
|
387
|
-
//#endregion
|
|
388
|
-
//#region src/statement/error.d.ts
|
|
389
380
|
/**
|
|
390
381
|
* Lives in its own module so that both the renderer and the audit-report reader
|
|
391
382
|
* can throw it without importing each other.
|
|
@@ -403,8 +394,6 @@ declare class StatementError extends Error {
|
|
|
403
394
|
/** The command that fixes it, printed under the message. */
|
|
404
395
|
next?: NextStep | undefined);
|
|
405
396
|
}
|
|
406
|
-
//#endregion
|
|
407
|
-
//#region src/audit/review.d.ts
|
|
408
397
|
declare const reviewSchema: Schema<ObjectOf<{
|
|
409
398
|
schemaVersion: Schema<number>;
|
|
410
399
|
/** Who carried out the review, for the record as a whole. */
|
|
@@ -421,8 +410,6 @@ declare const reviewSchema: Schema<ObjectOf<{
|
|
|
421
410
|
}>>>;
|
|
422
411
|
}>>;
|
|
423
412
|
type ReviewRecord = Infer<typeof reviewSchema>;
|
|
424
|
-
//#endregion
|
|
425
|
-
//#region src/statement/findings.d.ts
|
|
426
413
|
/** One rule that failed, folded across every page it failed on. */
|
|
427
414
|
interface AuditFinding {
|
|
428
415
|
ruleId: string;
|
|
@@ -466,8 +453,6 @@ interface AuditSummary {
|
|
|
466
453
|
declare function summariseAuditReport(value: unknown, source?: string): AuditSummary;
|
|
467
454
|
/** Read and summarise a report written by `eaa-kit audit --format json`. */
|
|
468
455
|
declare function readAuditReport(file: string, cwd?: string): Promise<AuditSummary>;
|
|
469
|
-
//#endregion
|
|
470
|
-
//#region src/statement/evidence.d.ts
|
|
471
456
|
/**
|
|
472
457
|
* Whether the statement's claim survives contact with the evidence beside it.
|
|
473
458
|
*
|
|
@@ -507,8 +492,6 @@ interface EvidenceInput {
|
|
|
507
492
|
declare function checkStatementEvidence(input: EvidenceInput): EvidenceProblem[];
|
|
508
493
|
/** Whether any problem is bad enough to stop the document being written. */
|
|
509
494
|
declare function refuses(problems: readonly EvidenceProblem[]): boolean;
|
|
510
|
-
//#endregion
|
|
511
|
-
//#region src/statement/html.d.ts
|
|
512
495
|
/**
|
|
513
496
|
* Markdown-to-HTML for exactly the subset the statement templates emit, and
|
|
514
497
|
* nothing else.
|
|
@@ -549,8 +532,6 @@ interface HtmlDocumentOptions {
|
|
|
549
532
|
declare function toHtmlDocument(markdown: string, options: HtmlDocumentOptions): string;
|
|
550
533
|
/** The document body: the block elements alone, for embedding in a page. */
|
|
551
534
|
declare function toHtmlBody(markdown: string): string;
|
|
552
|
-
//#endregion
|
|
553
|
-
//#region src/statement/render.d.ts
|
|
554
535
|
interface RenderStatementOptions {
|
|
555
536
|
/** Language to render in. Defaults to the site's own language when it is German. */
|
|
556
537
|
locale?: StatementLocale;
|
|
@@ -570,6 +551,13 @@ interface RenderStatementOptions {
|
|
|
570
551
|
* statement is the barrier list, which a person writes.
|
|
571
552
|
*/
|
|
572
553
|
review?: ReviewRecord;
|
|
554
|
+
/**
|
|
555
|
+
* The day the statement is generated, as an ISO date. Decides which
|
|
556
|
+
* supervisor a country names where the law has scheduled a change, such as
|
|
557
|
+
* Sweden's on 1 January 2027. Defaults to today in the local calendar; tests
|
|
558
|
+
* and previews set it.
|
|
559
|
+
*/
|
|
560
|
+
today?: string;
|
|
573
561
|
}
|
|
574
562
|
interface RenderedStatement {
|
|
575
563
|
markdown: string;
|
|
@@ -588,5 +576,4 @@ interface RenderedStatement {
|
|
|
588
576
|
* template branches on, so that no German sentence is assembled in TypeScript.
|
|
589
577
|
*/
|
|
590
578
|
declare function renderStatement(config: EaaConfig, options?: RenderStatementOptions): Promise<RenderedStatement>;
|
|
591
|
-
//#endregion
|
|
592
579
|
export { ASSESSMENT_METHODS, type AssessmentMethod, type AuditFinding, type AuditSummary, COMPLIANCE_STATUSES, CONFIG_FILENAMES, COUNTRIES, type ComplianceStatus, ConfigError, type Country, type EaaConfig, type EaaConfigInput, type EvidenceInput, type EvidenceProblem, type EvidenceSeverity, type HtmlDocumentOptions, ISSUE_REASONS, type IssueReason, type KnownIssue, type LoadConfigOptions, type LoadedConfig, type RenderStatementOptions, type RenderedStatement, STATEMENT_LOCALES, StatementError, type StatementLocale, checkStatementEvidence, configSchema, defineConfig, findConfigFile, loadConfig, parseConfig, readAuditReport, refuses, renderStatement, summariseAuditReport, toHtmlBody, toHtmlDocument };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ISSUE_REASONS, c as configSchema, d as parseConfig, i as ConfigError, l as defineConfig, n as COMPLIANCE_STATUSES, r as COUNTRIES, s as STATEMENT_LOCALES, t as ASSESSMENT_METHODS } from "./define-
|
|
2
|
-
import { i as loadConfig, n as findConfigFile, t as CONFIG_FILENAMES } from "./load-
|
|
3
|
-
import { a as summariseAuditReport, c as StatementError, i as readAuditReport, n as toHtmlBody, o as checkStatementEvidence, r as toHtmlDocument, s as refuses, t as renderStatement } from "./render-
|
|
1
|
+
import { a as ISSUE_REASONS, c as configSchema, d as parseConfig, i as ConfigError, l as defineConfig, n as COMPLIANCE_STATUSES, r as COUNTRIES, s as STATEMENT_LOCALES, t as ASSESSMENT_METHODS } from "./define-BdTPIfqE.js";
|
|
2
|
+
import { i as loadConfig, n as findConfigFile, t as CONFIG_FILENAMES } from "./load-C3eFEdoH.js";
|
|
3
|
+
import { a as summariseAuditReport, c as StatementError, i as readAuditReport, n as toHtmlBody, o as checkStatementEvidence, r as toHtmlDocument, s as refuses, t as renderStatement } from "./render-ky8cm4QF.js";
|
|
4
4
|
export { ASSESSMENT_METHODS, COMPLIANCE_STATUSES, CONFIG_FILENAMES, COUNTRIES, ConfigError, ISSUE_REASONS, STATEMENT_LOCALES, StatementError, checkStatementEvidence, configSchema, defineConfig, findConfigFile, loadConfig, parseConfig, readAuditReport, refuses, renderStatement, summariseAuditReport, toHtmlBody, toHtmlDocument };
|