eaa-kit 0.3.0 → 0.4.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 (50) hide show
  1. package/README.md +51 -5
  2. package/dist/astro/index.js +1 -1
  3. package/dist/audit/runners/worker.js +1 -1
  4. package/dist/{audit-DcL73mOC.js → audit-CPoZMXGM.js} +180 -36
  5. package/dist/audit-CpXH2Mk8.js +2 -0
  6. package/dist/{baseline-CuKFq4IF.js → baseline-22Y1NWxM.js} +1 -1
  7. package/dist/{baseline-s9F3fXTN.js → baseline-DB9CZGnV.js} +2 -2
  8. package/dist/cli/index.js +267 -10
  9. package/dist/{collect-BkAQ0viT.js → collect-CFM8gEVv.js} +21 -10
  10. package/dist/{command-Dxpa00Ha.js → command-D8l_oYbV.js} +2 -2
  11. package/dist/{component-7kEBjv_y.js → component-C3GL1Mnu.js} +41 -6
  12. package/dist/component-DKd3EHOg.js +2 -0
  13. package/dist/coverage-B4IBKMO8.js +521 -0
  14. package/dist/{crawl-Oxt2Gaqo.js → crawl-BiI1Lau_.js} +2 -2
  15. package/dist/eleventy/index.d.ts +28 -0
  16. package/dist/eleventy/index.js +19 -0
  17. package/dist/{frameworks-BYa3tULg.js → frameworks-B4ClIJgE.js} +71 -0
  18. package/dist/{frameworks-DaDqrJOw.js → frameworks-etFg_O8K.js} +1 -1
  19. package/dist/{html-DKiI_3gs.js → html-BGTO3ypW.js} +130 -5
  20. package/dist/{impact-YdoOtFqm.js → impact-DZt2oBCP.js} +1 -1
  21. package/dist/index.js +2 -2
  22. package/dist/{init-DiLiYvN1.js → init-DIWDE35F.js} +2 -2
  23. package/dist/jsdom-4IMzv0eE.js +3 -0
  24. package/dist/jsdom-DCpGSLfW.js +81 -0
  25. package/dist/{json-Cnv9nd6U.js → json-DjEvy1nX.js} +8 -3
  26. package/dist/{json-B0Y7rNjt.js → json-QQuFIw1W.js} +1 -1
  27. package/dist/{load-UYXLqGV9.js → load-5wRGLvub.js} +1 -1
  28. package/dist/nuxt/index.d.ts +35 -0
  29. package/dist/nuxt/index.js +23 -0
  30. package/dist/{playwright-DYFsGUNd.js → playwright-BWniOain.js} +1 -1
  31. package/dist/{pool-BWkWZiJW.js → pool-BMevaLWD.js} +2 -2
  32. package/dist/{project-DW08TseF.js → project-CzOnkLH6.js} +8 -2
  33. package/dist/project-MFrXcw1M.js +2 -0
  34. package/dist/remediation-Dtowi2EC.js +321 -0
  35. package/dist/{render-DI_aCnAZ.js → render-DrvXRCEn.js} +3 -3
  36. package/dist/{result-DLxd2Eip.js → result-DoamKFsp.js} +78 -1
  37. package/dist/routes-CmdRUuOs.js +265 -0
  38. package/dist/{run-BW6CVuND.js → run-DB34BSOZ.js} +19 -2
  39. package/dist/{sarif-DB3WG7T9.js → sarif-SR3_lLYd.js} +14 -6
  40. package/dist/{schema-CMZ8ItGk.js → schema-is6CGX2D.js} +4 -1
  41. package/dist/{text-BFmNtMsV.js → text-CKKpzkYM.js} +1 -1
  42. package/dist/vite/index.js +1 -1
  43. package/dist/webpack/index.d.ts +33 -0
  44. package/dist/webpack/index.js +20 -0
  45. package/package.json +30 -8
  46. package/dist/audit-CuG2hYyo.js +0 -2
  47. package/dist/jsdom-BjpF-2V-.js +0 -158
  48. package/dist/jsdom-X4KYfTp8.js +0 -3
  49. package/dist/manual-Vz-oX1I_.js +0 -239
  50. package/dist/routes-C2Cgf6Ko.js +0 -119
@@ -1,119 +0,0 @@
1
- import { i as toPosix, n as isDirectory } from "./fs-BmPtmFke.js";
2
- import path from "node:path";
3
- import { glob } from "tinyglobby";
4
- //#region src/audit/routes.ts
5
- /** Route file conventions, most specific first. */
6
- const CONVENTIONS = [
7
- {
8
- framework: "next-app",
9
- dir: "app",
10
- pattern: "**/page.{tsx,ts,jsx,js,mdx}"
11
- },
12
- {
13
- framework: "next-app",
14
- dir: "src/app",
15
- pattern: "**/page.{tsx,ts,jsx,js,mdx}"
16
- },
17
- {
18
- framework: "next-pages",
19
- dir: "pages",
20
- pattern: "**/*.{tsx,ts,jsx,js,mdx}"
21
- },
22
- {
23
- framework: "next-pages",
24
- dir: "src/pages",
25
- pattern: "**/*.{tsx,ts,jsx,js,mdx}"
26
- },
27
- {
28
- framework: "astro",
29
- dir: "src/pages",
30
- pattern: "**/*.{astro,md,mdx}"
31
- },
32
- {
33
- framework: "nuxt",
34
- dir: "pages",
35
- pattern: "**/*.vue"
36
- },
37
- {
38
- framework: "sveltekit",
39
- dir: "src/routes",
40
- pattern: "**/+page.{svelte,ts,js}"
41
- }
42
- ];
43
- /**
44
- * The URL path a route file serves.
45
- *
46
- * Returns undefined for anything that is not a page: a Next.js route group
47
- * `(marketing)` contributes no segment, a private folder `_lib` contributes no
48
- * route at all, and a dynamic segment `[slug]` cannot be resolved to one path
49
- * without knowing the data behind it.
50
- */
51
- function routePathFor(relativeFile, framework) {
52
- let route = toPosix(relativeFile);
53
- if (framework === "next-app" || framework === "sveltekit") route = route.includes("/") ? route.replace(/\/[^/]+$/, "") : "";
54
- else {
55
- route = route.replace(/\.[^./]+$/, "");
56
- route = route.replace(/\/index$/, "");
57
- if (route === "index") route = "";
58
- }
59
- const segments = route.split("/").filter((segment) => segment !== "");
60
- const kept = [];
61
- for (const segment of segments) {
62
- if (/^[[(]|^_|^@/.test(segment)) {
63
- if (/^\(.*\)$/.test(segment)) continue;
64
- return;
65
- }
66
- kept.push(segment);
67
- }
68
- return kept.join("/");
69
- }
70
- /** Every page path a build could have emitted for one route. */
71
- function emittedPathsFor(route) {
72
- if (route === "") return [
73
- "/",
74
- "index.html",
75
- "index.htm"
76
- ];
77
- return [
78
- route,
79
- `${route}/`,
80
- `${route}.html`,
81
- `${route}/index.html`
82
- ];
83
- }
84
- /**
85
- * Build a page-to-source map by reading the project's route files.
86
- *
87
- * Returns undefined when the project uses no convention this understands, which
88
- * is not a failure — most builds are not framework projects.
89
- */
90
- async function buildRouteMap(cwd) {
91
- for (const convention of CONVENTIONS) {
92
- const directory = path.join(cwd, convention.dir);
93
- if (!await isDirectory(directory)) continue;
94
- const files = await glob([convention.pattern], {
95
- cwd: directory,
96
- ignore: ["**/node_modules/**"],
97
- onlyFiles: true
98
- });
99
- if (files.length === 0) continue;
100
- const sources = /* @__PURE__ */ new Map();
101
- for (const file of files) {
102
- const route = routePathFor(file, convention.framework);
103
- if (route === void 0) continue;
104
- const source = `${convention.dir}/${toPosix(file)}`;
105
- for (const emitted of emittedPathsFor(route)) if (!sources.has(emitted)) sources.set(emitted, source);
106
- }
107
- if (sources.size > 0) return {
108
- framework: convention.framework,
109
- sources
110
- };
111
- }
112
- }
113
- /** The source file for an audited page, if the map knows one. */
114
- function sourceFor(map, pagePath) {
115
- if (map === void 0) return void 0;
116
- return map.sources.get(pagePath) ?? map.sources.get(pagePath.replace(/^\//, ""));
117
- }
118
- //#endregion
119
- export { buildRouteMap, sourceFor };