@ploaness/governance 1.0.0 → 1.2.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/dist/a11y-hit-target.d.ts +35 -0
- package/dist/a11y-hit-target.d.ts.map +1 -0
- package/dist/a11y-hit-target.js +82 -0
- package/dist/a11y-hit-target.js.map +1 -0
- package/dist/a11y-incomplete.d.ts +18 -0
- package/dist/a11y-incomplete.d.ts.map +1 -0
- package/dist/a11y-incomplete.js +65 -0
- package/dist/a11y-incomplete.js.map +1 -0
- package/dist/access-boundary.d.ts +62 -6
- package/dist/access-boundary.d.ts.map +1 -1
- package/dist/access-boundary.js +201 -6
- package/dist/access-boundary.js.map +1 -1
- package/dist/admin-view-coverage.d.ts +25 -0
- package/dist/admin-view-coverage.d.ts.map +1 -0
- package/dist/admin-view-coverage.js +74 -0
- package/dist/admin-view-coverage.js.map +1 -0
- package/dist/asset-policy.d.ts.map +1 -1
- package/dist/asset-policy.js +1 -23
- package/dist/asset-policy.js.map +1 -1
- package/dist/axe-coverage.d.ts +40 -0
- package/dist/axe-coverage.d.ts.map +1 -0
- package/dist/axe-coverage.js +62 -0
- package/dist/axe-coverage.js.map +1 -0
- package/dist/banned-typography.d.ts.map +1 -1
- package/dist/banned-typography.js +26 -0
- package/dist/banned-typography.js.map +1 -1
- package/dist/blocklist-entries.d.ts +36 -0
- package/dist/blocklist-entries.d.ts.map +1 -0
- package/dist/blocklist-entries.js +338 -0
- package/dist/blocklist-entries.js.map +1 -0
- package/dist/blocklist.d.ts +91 -0
- package/dist/blocklist.d.ts.map +1 -0
- package/dist/blocklist.js +187 -0
- package/dist/blocklist.js.map +1 -0
- package/dist/build-diagnosis.d.ts +10 -0
- package/dist/build-diagnosis.d.ts.map +1 -0
- package/dist/build-diagnosis.js +38 -0
- package/dist/build-diagnosis.js.map +1 -0
- package/dist/container-failure.d.ts.map +1 -1
- package/dist/container-failure.js +1 -18
- package/dist/container-failure.js.map +1 -1
- package/dist/container-files.d.ts +16 -0
- package/dist/container-files.d.ts.map +1 -1
- package/dist/container-files.js +23 -8
- package/dist/container-files.js.map +1 -1
- package/dist/container-images.d.ts +43 -0
- package/dist/container-images.d.ts.map +1 -0
- package/dist/container-images.js +157 -0
- package/dist/container-images.js.map +1 -0
- package/dist/dependency-freshness.d.ts +8 -0
- package/dist/dependency-freshness.d.ts.map +1 -1
- package/dist/dependency-freshness.js +2 -18
- package/dist/dependency-freshness.js.map +1 -1
- package/dist/doc-blocks.d.ts.map +1 -1
- package/dist/doc-blocks.js +1 -13
- package/dist/doc-blocks.js.map +1 -1
- package/dist/document-references.d.ts.map +1 -1
- package/dist/document-references.js +7 -1
- package/dist/document-references.js.map +1 -1
- package/dist/editorconfig-policy.d.ts +7 -0
- package/dist/editorconfig-policy.d.ts.map +1 -1
- package/dist/editorconfig-policy.js +19 -12
- package/dist/editorconfig-policy.js.map +1 -1
- package/dist/environment-coherence.d.ts +87 -0
- package/dist/environment-coherence.d.ts.map +1 -0
- package/dist/environment-coherence.js +128 -0
- package/dist/environment-coherence.js.map +1 -0
- package/dist/environment-files.d.ts.map +1 -1
- package/dist/environment-files.js +1 -19
- package/dist/environment-files.js.map +1 -1
- package/dist/file-roles.d.ts +7 -2
- package/dist/file-roles.d.ts.map +1 -1
- package/dist/file-roles.js +10 -9
- package/dist/file-roles.js.map +1 -1
- package/dist/freshness-repair.d.ts +82 -0
- package/dist/freshness-repair.d.ts.map +1 -0
- package/dist/freshness-repair.js +91 -0
- package/dist/freshness-repair.js.map +1 -0
- package/dist/generated-denial.d.ts.map +1 -1
- package/dist/generated-denial.js +1 -9
- package/dist/generated-denial.js.map +1 -1
- package/dist/generated-drift.d.ts +18 -0
- package/dist/generated-drift.d.ts.map +1 -0
- package/dist/generated-drift.js +24 -0
- package/dist/generated-drift.js.map +1 -0
- package/dist/harness-package.d.ts +13 -0
- package/dist/harness-package.d.ts.map +1 -0
- package/dist/harness-package.js +20 -0
- package/dist/harness-package.js.map +1 -0
- package/dist/history-policy.d.ts.map +1 -1
- package/dist/history-policy.js +1 -7
- package/dist/history-policy.js.map +1 -1
- package/dist/image-assets.d.ts.map +1 -1
- package/dist/image-assets.js +1 -10
- package/dist/image-assets.js.map +1 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -1
- package/dist/index.js.map +1 -1
- package/dist/install-policy.d.ts +21 -0
- package/dist/install-policy.d.ts.map +1 -1
- package/dist/install-policy.js +53 -1
- package/dist/install-policy.js.map +1 -1
- package/dist/jsx-accessibility-scope.d.ts +17 -0
- package/dist/jsx-accessibility-scope.d.ts.map +1 -0
- package/dist/jsx-accessibility-scope.js +36 -0
- package/dist/jsx-accessibility-scope.js.map +1 -0
- package/dist/jsx-accessibility.d.ts +13 -0
- package/dist/jsx-accessibility.d.ts.map +1 -0
- package/dist/jsx-accessibility.js +188 -0
- package/dist/jsx-accessibility.js.map +1 -0
- package/dist/network-policy.d.ts.map +1 -1
- package/dist/network-policy.js +1 -12
- package/dist/network-policy.js.map +1 -1
- package/dist/oxlint-policy.d.ts +16 -0
- package/dist/oxlint-policy.d.ts.map +1 -0
- package/dist/oxlint-policy.js +28 -0
- package/dist/oxlint-policy.js.map +1 -0
- package/dist/oxlint-report.d.ts +29 -0
- package/dist/oxlint-report.d.ts.map +1 -0
- package/dist/oxlint-report.js +84 -0
- package/dist/oxlint-report.js.map +1 -0
- package/dist/oxlint-scope.d.ts +13 -0
- package/dist/oxlint-scope.d.ts.map +1 -0
- package/dist/oxlint-scope.js +46 -0
- package/dist/oxlint-scope.js.map +1 -0
- package/dist/oxlint-suppressions.d.ts +17 -0
- package/dist/oxlint-suppressions.d.ts.map +1 -0
- package/dist/oxlint-suppressions.js +72 -0
- package/dist/oxlint-suppressions.js.map +1 -0
- package/dist/paired-assets.d.ts.map +1 -1
- package/dist/paired-assets.js.map +1 -1
- package/dist/payload-access.d.ts +6 -0
- package/dist/payload-access.d.ts.map +1 -1
- package/dist/payload-access.js +188 -57
- package/dist/payload-access.js.map +1 -1
- package/dist/payload-configs.d.ts +23 -0
- package/dist/payload-configs.d.ts.map +1 -0
- package/dist/payload-configs.js +96 -0
- package/dist/payload-configs.js.map +1 -0
- package/dist/payload-defaults.d.ts +128 -0
- package/dist/payload-defaults.d.ts.map +1 -0
- package/dist/payload-defaults.js +295 -0
- package/dist/payload-defaults.js.map +1 -0
- package/dist/payload-field-access.d.ts +4 -0
- package/dist/payload-field-access.d.ts.map +1 -0
- package/dist/payload-field-access.js +51 -0
- package/dist/payload-field-access.js.map +1 -0
- package/dist/payload-policy.d.ts +13 -0
- package/dist/payload-policy.d.ts.map +1 -1
- package/dist/payload-policy.js +171 -32
- package/dist/payload-policy.js.map +1 -1
- package/dist/payload-source.js +2 -2
- package/dist/payload-source.js.map +1 -1
- package/dist/relationship-cleanup.d.ts +18 -0
- package/dist/relationship-cleanup.d.ts.map +1 -0
- package/dist/relationship-cleanup.js +96 -0
- package/dist/relationship-cleanup.js.map +1 -0
- package/dist/release-age.d.ts.map +1 -1
- package/dist/release-age.js +1 -16
- package/dist/release-age.js.map +1 -1
- package/dist/request-limits.d.ts.map +1 -1
- package/dist/request-limits.js +1 -11
- package/dist/request-limits.js.map +1 -1
- package/dist/route-coverage.d.ts +27 -0
- package/dist/route-coverage.d.ts.map +1 -0
- package/dist/route-coverage.js +57 -0
- package/dist/route-coverage.js.map +1 -0
- package/dist/route-map.d.ts +65 -0
- package/dist/route-map.d.ts.map +1 -0
- package/dist/route-map.js +168 -0
- package/dist/route-map.js.map +1 -0
- package/dist/run-plan.d.ts.map +1 -1
- package/dist/run-plan.js +1 -19
- package/dist/run-plan.js.map +1 -1
- package/dist/secret-policy.d.ts.map +1 -1
- package/dist/secret-policy.js +5 -15
- package/dist/secret-policy.js.map +1 -1
- package/dist/settings-layering.d.ts +8 -30
- package/dist/settings-layering.d.ts.map +1 -1
- package/dist/settings-layering.js +19 -48
- package/dist/settings-layering.js.map +1 -1
- package/dist/settings.d.ts +19 -2
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +5 -1
- package/dist/settings.js.map +1 -1
- package/dist/source-security.d.ts +4 -0
- package/dist/source-security.d.ts.map +1 -0
- package/dist/source-security.js +56 -0
- package/dist/source-security.js.map +1 -0
- package/dist/source-text.d.ts +16 -0
- package/dist/source-text.d.ts.map +1 -1
- package/dist/source-text.js +46 -16
- package/dist/source-text.js.map +1 -1
- package/dist/toolchain-pins.d.ts.map +1 -1
- package/dist/toolchain-pins.js +2 -19
- package/dist/toolchain-pins.js.map +1 -1
- package/dist/version-policy.d.ts +7 -8
- package/dist/version-policy.d.ts.map +1 -1
- package/dist/version-policy.js +46 -26
- package/dist/version-policy.js.map +1 -1
- package/dist/vulnerability-policy.d.ts.map +1 -1
- package/dist/vulnerability-policy.js +1 -11
- package/dist/vulnerability-policy.js.map +1 -1
- package/dist/wiring-policy.d.ts.map +1 -1
- package/dist/wiring-policy.js +4 -1
- package/dist/wiring-policy.js.map +1 -1
- package/dist/wiring-violation.d.ts.map +1 -1
- package/dist/wiring-violation.js +1 -6
- package/dist/wiring-violation.js.map +1 -1
- package/dist/workspace-policy.d.ts.map +1 -1
- package/dist/workspace-policy.js +3 -9
- package/dist/workspace-policy.js.map +1 -1
- package/dist/yaml-blocks.d.ts +10 -0
- package/dist/yaml-blocks.d.ts.map +1 -1
- package/dist/yaml-blocks.js +20 -0
- package/dist/yaml-blocks.js.map +1 -1
- package/package.json +2 -2
- package/dist/url-safety.d.ts +0 -12
- package/dist/url-safety.d.ts.map +0 -1
- package/dist/url-safety.js +0 -58
- package/dist/url-safety.js.map +0 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Require static test evidence for authored admin views excluded from the anonymous crawl.
|
|
2
|
+
import { containsRoute, reachesAxe } from './axe-coverage.js';
|
|
3
|
+
import { balancedArguments, lineOf, stripComments } from './source-text.js';
|
|
4
|
+
// `components` then `views`, each read as the block it opens rather than as text found anywhere in the
|
|
5
|
+
// file. Nesting the two is what tells Payload's own vocabulary apart from a project's: a `views` key
|
|
6
|
+
// that is not inside a `components` block is not a custom admin view.
|
|
7
|
+
const BLOCK_PATTERNS = [
|
|
8
|
+
String.raw `\bcomponents\s*:\s*\{`,
|
|
9
|
+
String.raw `\bviews\s*:\s*\{`,
|
|
10
|
+
];
|
|
11
|
+
const VIEW_PATH = /\bpath\s*:\s*['"](\/[^'"]*)['"]/gu;
|
|
12
|
+
// The brace-delimited body opened at `at`, carrying the offset it starts at so that a match inside it
|
|
13
|
+
// can be reported at its line in the whole file rather than at its line in the fragment. The scan is
|
|
14
|
+
// `balancedArguments`, which skips string literals - a brace inside a quoted string would otherwise
|
|
15
|
+
// close the block early and hide every view declared after it.
|
|
16
|
+
const blockAt = (source, at) => {
|
|
17
|
+
const text = balancedArguments(source, at);
|
|
18
|
+
return text === undefined ? undefined : { text, start: at + 1 };
|
|
19
|
+
};
|
|
20
|
+
const blocksMatching = (blocks, pattern) => blocks.flatMap((block) => [...block.text.matchAll(new RegExp(pattern, 'gu'))].flatMap((match) => {
|
|
21
|
+
const opened = blockAt(block.text, match.index + match[0].length - 1);
|
|
22
|
+
return opened === undefined
|
|
23
|
+
? []
|
|
24
|
+
: [{ text: opened.text, start: block.start + opened.start }];
|
|
25
|
+
}));
|
|
26
|
+
/**
|
|
27
|
+
* The custom admin views a Payload configuration declares.
|
|
28
|
+
*
|
|
29
|
+
* Both `admin.components.views` and a collection's own are found, because both produce a route the
|
|
30
|
+
* pinned sweep will not reach and both are the project's markup.
|
|
31
|
+
* @param source the file's text.
|
|
32
|
+
* @returns one entry per declared view path, in the order the file declares them.
|
|
33
|
+
*/
|
|
34
|
+
export const findDeclaredAdminViews = (source) => {
|
|
35
|
+
const code = stripComments(source);
|
|
36
|
+
const views = BLOCK_PATTERNS.reduce((blocks, pattern) => blocksMatching(blocks, pattern), [{ text: code, start: 0 }]);
|
|
37
|
+
return views.flatMap((block) => [...block.text.matchAll(VIEW_PATH)].map((match) => ({
|
|
38
|
+
path: match[1] ?? '',
|
|
39
|
+
line: lineOf(code, block.start + match.index),
|
|
40
|
+
})));
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The declared views that no specification scans for accessibility.
|
|
44
|
+
* @param views the views a configuration declares.
|
|
45
|
+
* @param specs the project's test files, which is where a scan would be written.
|
|
46
|
+
* @param everyFile every file a spec may import a scan from, the specs included.
|
|
47
|
+
* @returns one violation per view nothing looks at.
|
|
48
|
+
*/
|
|
49
|
+
export const findUnscannedAdminViews = (views, specs, everyFile) => views.flatMap((view) => {
|
|
50
|
+
const driving = specs.filter((spec) => containsRoute(spec.source, view.path));
|
|
51
|
+
if (driving.length === 0) {
|
|
52
|
+
return [
|
|
53
|
+
{
|
|
54
|
+
line: view.line,
|
|
55
|
+
rule: 'admin-view-undriven',
|
|
56
|
+
reason: `no test drives the custom admin view at "${view.path}". It is this project's own ` +
|
|
57
|
+
'markup inside the panel the accessibility sweep skips, so nothing else will ever look ' +
|
|
58
|
+
'at it: give it an end-to-end spec that scans it with axe, scoped to the view container',
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
return driving.some((spec) => reachesAxe(spec, everyFile))
|
|
63
|
+
? []
|
|
64
|
+
: [
|
|
65
|
+
{
|
|
66
|
+
line: view.line,
|
|
67
|
+
rule: 'admin-view-unscanned',
|
|
68
|
+
reason: `the custom admin view at "${view.path}" is driven by a test but nothing scans it ` +
|
|
69
|
+
'with axe. The pinned sweep skips the admin panel, so this view has no accessibility ' +
|
|
70
|
+
'coverage at all: add a scan scoped to the view container, not to the whole panel',
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=admin-view-coverage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-view-coverage.js","sourceRoot":"","sources":["../src/admin-view-coverage.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,OAAO,EAAE,aAAa,EAAE,UAAU,EAAmB,M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3B,MAAM,EACJ,4CAA4C,IAAI,CAAC,IAAI,8BAA8B;oBACnF,wFAAwF;oBACxF,wFAAwF;aAC3F;SACF,CAAA;IACH,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,IAAgB,EAAW,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC7E,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC;YACE;gBACE,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,sBAAsB;gBAC5B,MAAM,EACJ,6BAA6B,IAAI,CAAC,IAAI,6CAA6C;oBACnF,sFAAsF;oBACtF,kFAAkF;aACrF;SACF,CAAA;AACP,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-policy.d.ts","sourceRoot":"","sources":["../src/asset-policy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"asset-policy.d.ts","sourceRoot":"","sources":["../src/asset-policy.ts"],"names":[],"mappings":"AAEA,+DAA+D;AAC/D,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,CAAA;AAEnF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAAA;AAEhF,sFAAsF;AACtF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAA;IACjC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAC3B;AAED,gEAAgE;AAChE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,qGAAqG;AACrG,MAAM,WAAW,UAAU;IACzB,gEAAgE;IAChE,QAAQ,CAA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AS,MAAM,EAAE,EAC5B,SAAS,CAAC,IAAI,EAAE,MAAM,KAAK,UAAU,KACpC,SAAS,cAAc,EASzB,CAAA;AAED,4DAA4D;AAC5D,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAA;AAE/D;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,YAAY,EAAE,WAAW,OAAO,KAAG,UAkBpE,CAAA;AAED,wEAAwE;AACxE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,SAAS,YAAY,EAAE,KAAG,SAAS,YAAY,EAGrF,CAAA;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GACvB,QAAQ,SAAS,YAAY,EAAE,EAC/B,MAAM,SAAS,KACd,SAAS,YAAY,EASpB,CAAA"}
|
package/dist/asset-policy.js
CHANGED
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
// from the working tree by tools ploaness does not run (git, editors, coding agents), so it cannot live
|
|
3
|
-
// inside the package and be resolved through node_modules the way an ESLint or Biome config can. Those
|
|
4
|
-
// files are materialised into the consumer tree by `ploaness sync` and policed here.
|
|
5
|
-
//
|
|
6
|
-
// Five dispositions:
|
|
7
|
-
// PINNED - ploaness owns the content; the file must exist and match byte for byte.
|
|
8
|
-
// SEED - ploaness writes it once when absent; the project owns it thereafter and may edit it.
|
|
9
|
-
// FORBIDDEN - the path must not exist, because ploaness supplies that configuration itself and a
|
|
10
|
-
// working-tree copy would silently shadow or contradict it.
|
|
11
|
-
// SECTION - ploaness owns a marked block at the top of the file; the project owns everything below
|
|
12
|
-
// it. Neither PINNED nor SEED fits a file both parties must write: pinning it would forbid
|
|
13
|
-
// the project its own agent instructions, and seeding it would let the contract statement
|
|
14
|
-
// drift the moment ploaness changed.
|
|
15
|
-
// REFERENCE - the path need not exist, but if it does it carries nothing but a pointer at AGENTS.md.
|
|
16
|
-
// This is for the entry-point file a coding agent other than Claude reads. PINNED cannot
|
|
17
|
-
// express it: pinning would force a project to carry an entry point for a tool it does
|
|
18
|
-
// not use, and FORBIDDEN would bar it from using that tool at all. What the rule refuses
|
|
19
|
-
// is a second set of instructions - the standard says the root instruction file holds the
|
|
20
|
-
// rules and a tool-specific one only points at it, so two agents cannot be told two
|
|
21
|
-
// different things. The form of the pointer is the tool's own: `@AGENTS.md` is Claude's
|
|
22
|
-
// import syntax and means nothing to Cursor, so the check reads for the NAME rather than
|
|
23
|
-
// demanding one spelling and forcing a file the tool cannot act on.
|
|
1
|
+
// Manage files that tools read from the working tree, where installed package configuration cannot reach them.
|
|
24
2
|
const DISPOSITIONS = new Set([
|
|
25
3
|
'PINNED',
|
|
26
4
|
'SEED',
|
package/dist/asset-policy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-policy.js","sourceRoot":"","sources":["../src/asset-policy.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"asset-policy.js","sourceRoot":"","sources":["../src/asset-policy.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAgD/G,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAS;IACxD,QAAQ;IACR,MAAM;IACN,WAAW;IACX,SAAS;IACT,WAAW;CACZ,CAAC,CAAA;AAEF,oGAAoG;AACpG,sGAAsG;AACtG,iFAAiF;AACjF,MAAM,aAAa,GAAG,CAAC,GAAW,EAAsB,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEhF,MAAM,MAAM,GAAwB,IAAI,GAAG,CAAS;IAClD,YAAY;IACZ,aAAa;IACb,SAAS;IACT,YAAY;CACb,CAAC,CAAA;AAEF,MAAM,OAAO,GAAG,CAAC,GAAW,EAAqB,EAAE,CAAC,MAAM,C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YAAY,GAAG,CAC1B,MAA+B,EAC/B,IAAe,EACU,EAAE,CAC3B,MAAM,CAAC,MAAM,CAAC,CAAC,KAAmB,EAAW,EAAE;IAC7C,IAAI,KAAK,CAAC,KAAK,KAAK,YAAY,EAAE,CAAC;QACjC,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAChD,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC,KAAK,KAAK,aAAa,CAAA;AACzD,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** A file the coverage question is answered from: its repository path and its text. */
|
|
2
|
+
export interface SpecSource {
|
|
3
|
+
readonly path: string;
|
|
4
|
+
readonly source: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Whether a specification names one route.
|
|
8
|
+
*
|
|
9
|
+
* A route is a prefix of every longer route beneath it, so a bare `includes` would let a spec for
|
|
10
|
+
* `/calendar-archive` answer for `/calendar`. The character after the match has to end the route.
|
|
11
|
+
* @param source the specification's text.
|
|
12
|
+
* @param route the route being looked for.
|
|
13
|
+
* @returns true when the text drives that route and not merely one whose name starts the same way.
|
|
14
|
+
*/
|
|
15
|
+
export declare const containsRoute: (source: string, route: string) => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether a specification BUILDS a URL beneath one route prefix.
|
|
18
|
+
*
|
|
19
|
+
* The evidence a dynamic route needs, and deliberately narrower than `containsRoute`. A spec cannot
|
|
20
|
+
* contain `/play/[id]`, because that is a file path rather than an address: what it contains is
|
|
21
|
+
* `/play/${gameId}`. Asking merely for the prefix would let a spec that visits `/play` answer for
|
|
22
|
+
* `/play/[id]`, which is the false pass this whole family of rules exists to avoid - so what is
|
|
23
|
+
* required is the prefix, a separator, and an interpolation, which together mean the spec computed an
|
|
24
|
+
* address rather than typed one.
|
|
25
|
+
* @param source the specification's text.
|
|
26
|
+
* @param prefix the static part of the route, before its first dynamic segment.
|
|
27
|
+
* @returns true when the text builds a URL below that prefix.
|
|
28
|
+
*/
|
|
29
|
+
export declare const containsBuiltRoute: (source: string, prefix: string) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether a specification scans with axe, directly or through a helper it imports.
|
|
32
|
+
*
|
|
33
|
+
* This is static source evidence through at most one helper import. It does not establish execution;
|
|
34
|
+
* the end-to-end suite must run the scan.
|
|
35
|
+
* @param spec the specification being judged.
|
|
36
|
+
* @param everyFile every file it may import a scan from, the specifications included.
|
|
37
|
+
* @returns true when the source names axe directly or through an imported helper.
|
|
38
|
+
*/
|
|
39
|
+
export declare const reachesAxe: (spec: SpecSource, everyFile: readonly SpecSource[]) => boolean;
|
|
40
|
+
//# sourceMappingURL=axe-coverage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axe-coverage.d.ts","sourceRoot":"","sources":["../src/axe-coverage.ts"],"names":[],"mappings":"AAGA,uFAAuF;AACvF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAoBD;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,OACmB,CAAA;AAEjF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,KAAG,OACD,CAAA;AAgCnE;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GAAI,MAAM,UAAU,EAAE,WAAW,SAAS,UAAU,EAAE,KAAG,OAI7E,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { maskLiterals, stripComments, withoutComments } from './source-text.js';
|
|
3
|
+
// Recognize axe identifiers in code, excluding comments, strings, and regex literals.
|
|
4
|
+
const AXE_MARKERS = ['AxeBuilder', 'axe.run'];
|
|
5
|
+
const REGEX_METACHARACTERS = /[$()*+.?[\\\]^{|}]/gu;
|
|
6
|
+
const escaped = (text) => text.replaceAll(REGEX_METACHARACTERS, String.raw `\$&`);
|
|
7
|
+
// An import specifier is a path too, and `@/lib/calendar/interval` contains `/calendar`. Read as a
|
|
8
|
+
// route, that made every unit spec of a `calendar` module look like a test driving the view - and a
|
|
9
|
+
// spec that also imported the shared axe helper would then have answered for a view nothing scans,
|
|
10
|
+
// which is a false PASS and the one failure a gate must never have. Specifiers and comments are
|
|
11
|
+
// removed before the search; `importedSources` reads the specifiers from the original text, where
|
|
12
|
+
// they still are.
|
|
13
|
+
const MODULE_SPECIFIER = /\b(?:from|import)\s*(?:\(\s*)?['"][^'"]*['"]/gu;
|
|
14
|
+
const routeText = (source) => withoutComments(source).replaceAll(MODULE_SPECIFIER, '');
|
|
15
|
+
/**
|
|
16
|
+
* Whether a specification names one route.
|
|
17
|
+
*
|
|
18
|
+
* A route is a prefix of every longer route beneath it, so a bare `includes` would let a spec for
|
|
19
|
+
* `/calendar-archive` answer for `/calendar`. The character after the match has to end the route.
|
|
20
|
+
* @param source the specification's text.
|
|
21
|
+
* @param route the route being looked for.
|
|
22
|
+
* @returns true when the text drives that route and not merely one whose name starts the same way.
|
|
23
|
+
*/
|
|
24
|
+
export const containsRoute = (source, route) => new RegExp(String.raw `${escaped(route)}(?![\w-])`, 'u').test(routeText(source));
|
|
25
|
+
/**
|
|
26
|
+
* Whether a specification BUILDS a URL beneath one route prefix.
|
|
27
|
+
*
|
|
28
|
+
* The evidence a dynamic route needs, and deliberately narrower than `containsRoute`. A spec cannot
|
|
29
|
+
* contain `/play/[id]`, because that is a file path rather than an address: what it contains is
|
|
30
|
+
* `/play/${gameId}`. Asking merely for the prefix would let a spec that visits `/play` answer for
|
|
31
|
+
* `/play/[id]`, which is the false pass this whole family of rules exists to avoid - so what is
|
|
32
|
+
* required is the prefix, a separator, and an interpolation, which together mean the spec computed an
|
|
33
|
+
* address rather than typed one.
|
|
34
|
+
* @param source the specification's text.
|
|
35
|
+
* @param prefix the static part of the route, before its first dynamic segment.
|
|
36
|
+
* @returns true when the text builds a URL below that prefix.
|
|
37
|
+
*/
|
|
38
|
+
export const containsBuiltRoute = (source, prefix) => routeText(source).includes(`${prefix === '/' ? '' : prefix}/\${`);
|
|
39
|
+
const carriesAxe = (source) => AXE_MARKERS.some((marker) => maskLiterals(source).includes(marker));
|
|
40
|
+
const RELATIVE_IMPORT = /\bfrom\s*['"](\.[^'"]*)['"]/gu;
|
|
41
|
+
// Resolve from the importing file, without accessing the filesystem. All candidates were already read.
|
|
42
|
+
const matchesFile = (specifier, importer, candidate) => {
|
|
43
|
+
const resolved = path.posix.normalize(path.posix.join(path.posix.dirname(importer), specifier));
|
|
44
|
+
const stem = resolved.replace(/\.[cm]?jsx?$/u, '');
|
|
45
|
+
return [
|
|
46
|
+
resolved,
|
|
47
|
+
...['.ts', '.tsx', '.mts', '.cts', '/index.ts', '/index.tsx'].map((suffix) => `${stem}${suffix}`),
|
|
48
|
+
].includes(candidate);
|
|
49
|
+
};
|
|
50
|
+
const importedSources = (spec, everyFile) => [...stripComments(spec.source).matchAll(RELATIVE_IMPORT)].flatMap((match) => everyFile.filter((candidate) => matchesFile(match[1] ?? '', spec.path, candidate.path)));
|
|
51
|
+
/**
|
|
52
|
+
* Whether a specification scans with axe, directly or through a helper it imports.
|
|
53
|
+
*
|
|
54
|
+
* This is static source evidence through at most one helper import. It does not establish execution;
|
|
55
|
+
* the end-to-end suite must run the scan.
|
|
56
|
+
* @param spec the specification being judged.
|
|
57
|
+
* @param everyFile every file it may import a scan from, the specifications included.
|
|
58
|
+
* @returns true when the source names axe directly or through an imported helper.
|
|
59
|
+
*/
|
|
60
|
+
export const reachesAxe = (spec, everyFile) => carriesAxe(spec.source) ||
|
|
61
|
+
importedSources(spec, everyFile).some((imported) => carriesAxe(imported.source));
|
|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AEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAgB,EAAE,SAAgC,EAAW,EAAE,CACxF,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;IACvB,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,QAAoB,EAAW,EAAE,CACtE,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAC5B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banned-typography.d.ts","sourceRoot":"","sources":["../src/banned-typography.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"banned-typography.d.ts","sourceRoot":"","sources":["../src/banned-typography.ts"],"names":[],"mappings":"AA6EA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAiCD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAI,MAAM,MAAM,KAAG,SAAS,mBAAmB,EAM/E,CAAA"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// referenced via its code point only, so neither this module nor its callers trip the check on
|
|
6
6
|
// themselves.
|
|
7
7
|
const STRAIGHT_DOUBLE_QUOTE = 'a straight double quote';
|
|
8
|
+
const STRAIGHT_SINGLE_QUOTE = 'a straight single quote "\'"';
|
|
8
9
|
const PLAIN_HYPHEN = 'a hyphen "-"';
|
|
9
10
|
// The code points are named rather than written at each use, because a bare number in the table below
|
|
10
11
|
// would be exactly the unexplained literal the standard bans - and this module cannot spell the
|
|
@@ -15,6 +16,16 @@ const ELLIPSIS = 0x20_26;
|
|
|
15
16
|
const LEFT_DOUBLE_QUOTE = 0x20_1c;
|
|
16
17
|
const RIGHT_DOUBLE_QUOTE = 0x20_1d;
|
|
17
18
|
const LOW_DOUBLE_QUOTE = 0x20_1e;
|
|
19
|
+
// The three single forms, absent for long enough to be worth naming rather than merely adding. The
|
|
20
|
+
// standard bans "typographic quotation marks" without qualifying which, and the shipped guide says
|
|
21
|
+
// "curly quotation mark"; both phrases cover these, and the scanner covered only their double
|
|
22
|
+
// counterparts. U+2019 is the expensive half of that gap: it is the apostrophe in "it's" and "don't",
|
|
23
|
+
// which makes it the banned character a model emits most often and the one a reader is least likely to
|
|
24
|
+
// notice. The other two are here because a set admitting U+201E while refusing U+201A is not a rule
|
|
25
|
+
// anybody can hold in their head.
|
|
26
|
+
const LEFT_SINGLE_QUOTE = 0x20_18;
|
|
27
|
+
const RIGHT_SINGLE_QUOTE = 0x20_19;
|
|
28
|
+
const LOW_SINGLE_QUOTE = 0x20_1a;
|
|
18
29
|
const BANNED_CHARACTERS = [
|
|
19
30
|
{ char: String.fromCodePoint(EM_DASH), label: 'em dash (U+2014)', replacement: PLAIN_HYPHEN },
|
|
20
31
|
{ char: String.fromCodePoint(EN_DASH), label: 'en dash (U+2013)', replacement: PLAIN_HYPHEN },
|
|
@@ -38,6 +49,21 @@ const BANNED_CHARACTERS = [
|
|
|
38
49
|
label: 'low double quote (U+201E)',
|
|
39
50
|
replacement: STRAIGHT_DOUBLE_QUOTE,
|
|
40
51
|
},
|
|
52
|
+
{
|
|
53
|
+
char: String.fromCodePoint(LEFT_SINGLE_QUOTE),
|
|
54
|
+
label: 'left single quote (U+2018)',
|
|
55
|
+
replacement: STRAIGHT_SINGLE_QUOTE,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
char: String.fromCodePoint(RIGHT_SINGLE_QUOTE),
|
|
59
|
+
label: 'right single quote (U+2019)',
|
|
60
|
+
replacement: STRAIGHT_SINGLE_QUOTE,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
char: String.fromCodePoint(LOW_SINGLE_QUOTE),
|
|
64
|
+
label: 'low single quote (U+201A)',
|
|
65
|
+
replacement: STRAIGHT_SINGLE_QUOTE,
|
|
66
|
+
},
|
|
41
67
|
];
|
|
42
68
|
const BY_CHARACTER = new Map(BANNED_CHARACTERS.map((banned) => [
|
|
43
69
|
banned.char,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banned-typography.js","sourceRoot":"","sources":["../src/banned-typography.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,oGAAoG;AACpG,wGAAwG;AACxG,iEAAiE;AACjE,+FAA+F;AAC/F,cAAc;AAQd,MAAM,qBAAqB,GAAW,yBAAyB,CAAA;AAC/D,MAAM,YAAY,GAAW,cAAc,CAAA;AAE3C,sGAAsG;AACtG,gGAAgG;AAChG,6EAA6E;AAC7E,MAAM,OAAO,GAAW,OAAO,CAAA;AAC/B,MAAM,OAAO,GAAW,OAAO,CAAA;AAC/B,MAAM,QAAQ,GAAW,OAAO,CAAA;AAChC,MAAM,iBAAiB,GAAW,OAAO,CAAA;AACzC,MAAM,kBAAkB,GAAW,OAAO,CAAA;AAC1C,MAAM,gBAAgB,GAAW,OAAO,CAAA;AAExC,MAAM,iBAAiB,GAA+B;IACpD,EAAE,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,YAAY,EAAE;IAC7F,EAAE,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,YAAY,EAAE;IAC7F;QACE,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC;QACpC,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,kBAAkB;KAChC;IACD;QACE,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC;QAC7C,KAAK,EAAE,4BAA4B;QACnC,WAAW,EAAE,qBAAqB;KACnC;IACD;QACE,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,kBAAkB,CA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AC,CAAC;YACE;gBACE,IAAI,EAAE,UAAU;gBAChB,MAAM,EAAE,KAAK,GAAG,CAAC;gBACjB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,WAAW,EAAE,MAAM,CAAC,WAAW;aAChC;SACF,CAAA;AACP,CAAC,CAAC,CAAA;AAEJ;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,IAAY,EAAkC,EAAE,CACvF,IAAI;KACD,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC;KACxB,KAAK,CAAC,IAAI,CAAC;KACX,OAAO,CAAC,CAAC,IAAY,EAAE,KAAa,EAAkC,EAAE,CACvE,gBAAgB,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAClC,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** One image repository ploaness refuses, and what a project pulls instead. */
|
|
2
|
+
export interface BlockedImage {
|
|
3
|
+
/**
|
|
4
|
+
* The repository in normalised form: no `docker.io/`, no `library/`, a registry host kept for any
|
|
5
|
+
* other registry. A trailing `*` matches every repository under that prefix.
|
|
6
|
+
*/
|
|
7
|
+
readonly repository: string;
|
|
8
|
+
/** The first tag the refusal applies to, when the repository was once permissively licensed. */
|
|
9
|
+
readonly from?: string;
|
|
10
|
+
/** A tag pattern that stays allowed, for a repository publishing an open-source variant beside the default. */
|
|
11
|
+
readonly allowedTag?: RegExp;
|
|
12
|
+
readonly reason: string;
|
|
13
|
+
readonly replacement: string;
|
|
14
|
+
}
|
|
15
|
+
/** One npm package ploaness refuses, and what a project depends on instead. */
|
|
16
|
+
export interface BlockedPackage {
|
|
17
|
+
/** The package name; a trailing `*` matches every name under that prefix, `@scope/*` a whole scope. */
|
|
18
|
+
readonly name: string;
|
|
19
|
+
/** The first version the refusal applies to, when the package was once permissively licensed. */
|
|
20
|
+
readonly from?: string;
|
|
21
|
+
readonly reason: string;
|
|
22
|
+
readonly replacement: string;
|
|
23
|
+
}
|
|
24
|
+
/** One system package ploaness refuses in a Dockerfile install line. */
|
|
25
|
+
export interface BlockedSystemPackage {
|
|
26
|
+
readonly name: string;
|
|
27
|
+
readonly reason: string;
|
|
28
|
+
readonly replacement: string;
|
|
29
|
+
}
|
|
30
|
+
/** The image repositories ploaness refuses, in the order the report lists them. */
|
|
31
|
+
export declare const BLOCKED_IMAGES: readonly BlockedImage[];
|
|
32
|
+
/** The npm packages ploaness refuses, in the order the report lists them. */
|
|
33
|
+
export declare const BLOCKED_PACKAGES: readonly BlockedPackage[];
|
|
34
|
+
/** The system packages a Dockerfile may not install. */
|
|
35
|
+
export declare const BLOCKED_SYSTEM_PACKAGES: readonly BlockedSystemPackage[];
|
|
36
|
+
//# sourceMappingURL=blocklist-entries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocklist-entries.d.ts","sourceRoot":"","sources":["../src/blocklist-entries.ts"],"names":[],"mappings":"AAeA,+EAA+E;AAC/E,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,gGAAgG;IAChG,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,+GAA+G;IAC/G,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,+EAA+E;AAC/E,MAAM,WAAW,cAAc;IAC7B,uGAAuG;IACvG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,iGAAiG;IACjG,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAkCD,mFAAmF;AACnF,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAwMjD,CAAA;AAED,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EAmGrD,CAAA;AAED,wDAAwD;AACxD,eAAO,MAAM,uBAAuB,EAAE,SAAS,oBAAoB,EAOlE,CAAA"}
|