@nielspeter/eess 0.2.1 → 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.
- package/README.md +3 -3
- package/dist/assertion-advice.d.ts +26 -0
- package/dist/assertion-advice.d.ts.map +1 -0
- package/dist/assertion-advice.js +29 -0
- package/dist/assertion-advice.js.map +1 -0
- package/dist/baseline.d.ts +69 -4
- package/dist/baseline.d.ts.map +1 -1
- package/dist/baseline.js +119 -13
- package/dist/baseline.js.map +1 -1
- package/dist/cache-registry.d.ts +14 -0
- package/dist/cache-registry.d.ts.map +1 -0
- package/dist/cache-registry.js +37 -0
- package/dist/cache-registry.js.map +1 -0
- package/dist/cardinality.d.ts +35 -0
- package/dist/cardinality.d.ts.map +1 -0
- package/dist/cardinality.js +65 -0
- package/dist/cardinality.js.map +1 -0
- package/dist/check-options.d.ts +14 -0
- package/dist/check-options.d.ts.map +1 -1
- package/dist/comment-suppression.d.ts +60 -0
- package/dist/comment-suppression.d.ts.map +1 -0
- package/dist/comment-suppression.js +89 -0
- package/dist/comment-suppression.js.map +1 -0
- package/dist/condition.d.ts +6 -0
- package/dist/condition.d.ts.map +1 -1
- package/dist/correspondence-core.d.ts +35 -0
- package/dist/correspondence-core.d.ts.map +1 -0
- package/dist/correspondence-core.js +38 -0
- package/dist/correspondence-core.js.map +1 -0
- package/dist/correspondence.d.ts +27 -5
- package/dist/correspondence.d.ts.map +1 -1
- package/dist/correspondence.js +39 -5
- package/dist/correspondence.js.map +1 -1
- package/dist/dedupe-config-findings.d.ts +56 -0
- package/dist/dedupe-config-findings.d.ts.map +1 -0
- package/dist/dedupe-config-findings.js +74 -0
- package/dist/dedupe-config-findings.js.map +1 -0
- package/dist/define.d.ts +44 -2
- package/dist/define.d.ts.map +1 -1
- package/dist/define.js +45 -4
- package/dist/define.js.map +1 -1
- package/dist/diff-aware.d.ts +8 -0
- package/dist/diff-aware.d.ts.map +1 -1
- package/dist/diff-aware.js +11 -2
- package/dist/diff-aware.js.map +1 -1
- package/dist/diff-disclosure.d.ts +72 -0
- package/dist/diff-disclosure.d.ts.map +1 -0
- package/dist/diff-disclosure.js +110 -0
- package/dist/diff-disclosure.js.map +1 -0
- package/dist/disk-set.d.ts +27 -0
- package/dist/disk-set.d.ts.map +1 -0
- package/dist/disk-set.js +12 -0
- package/dist/disk-set.js.map +1 -0
- package/dist/edge-coverage.d.ts +96 -0
- package/dist/edge-coverage.d.ts.map +1 -0
- package/dist/edge-coverage.js +108 -0
- package/dist/edge-coverage.js.map +1 -0
- package/dist/errors.d.ts +25 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +32 -0
- package/dist/errors.js.map +1 -1
- package/dist/execute-rule.d.ts +11 -5
- package/dist/execute-rule.d.ts.map +1 -1
- package/dist/execute-rule.js +87 -19
- package/dist/execute-rule.js.map +1 -1
- package/dist/format-github.d.ts.map +1 -1
- package/dist/format-github.js +37 -5
- package/dist/format-github.js.map +1 -1
- package/dist/format-json.d.ts +83 -1
- package/dist/format-json.d.ts.map +1 -1
- package/dist/format-json.js +70 -9
- package/dist/format-json.js.map +1 -1
- package/dist/format.d.ts +4 -2
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +40 -8
- package/dist/format.js.map +1 -1
- package/dist/glob-site.d.ts +232 -0
- package/dist/glob-site.d.ts.map +1 -0
- package/dist/glob-site.js +156 -0
- package/dist/glob-site.js.map +1 -0
- package/dist/identity-root.d.ts +55 -0
- package/dist/identity-root.d.ts.map +1 -0
- package/dist/identity-root.js +170 -0
- package/dist/identity-root.js.map +1 -0
- package/dist/index.d.ts +41 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -3
- package/dist/index.js.map +1 -1
- package/dist/owns-empty-discovery.d.ts +5 -0
- package/dist/owns-empty-discovery.d.ts.map +1 -0
- package/dist/owns-empty-discovery.js +77 -0
- package/dist/owns-empty-discovery.js.map +1 -0
- package/dist/path-universe.d.ts +44 -0
- package/dist/path-universe.d.ts.map +1 -0
- package/dist/path-universe.js +21 -0
- package/dist/path-universe.js.map +1 -0
- package/dist/predicate.d.ts +33 -0
- package/dist/predicate.d.ts.map +1 -1
- package/dist/preset-dispatch.d.ts +19 -0
- package/dist/preset-dispatch.d.ts.map +1 -1
- package/dist/preset-dispatch.js +43 -3
- package/dist/preset-dispatch.js.map +1 -1
- package/dist/project-relative.d.ts +25 -0
- package/dist/project-relative.d.ts.map +1 -0
- package/dist/project-relative.js +54 -0
- package/dist/project-relative.js.map +1 -0
- package/dist/report.d.ts +11 -5
- package/dist/report.d.ts.map +1 -1
- package/dist/report.js +17 -0
- package/dist/report.js.map +1 -1
- package/dist/rule-builder-like.d.ts +11 -0
- package/dist/rule-builder-like.d.ts.map +1 -0
- package/dist/rule-builder-like.js +2 -0
- package/dist/rule-builder-like.js.map +1 -0
- package/dist/rule-builder.d.ts +109 -84
- package/dist/rule-builder.d.ts.map +1 -1
- package/dist/rule-builder.js +202 -158
- package/dist/rule-builder.js.map +1 -1
- package/dist/rule-description.d.ts +33 -1
- package/dist/rule-description.d.ts.map +1 -1
- package/dist/rule-description.js +17 -1
- package/dist/rule-description.js.map +1 -1
- package/dist/rule-metadata.d.ts +20 -3
- package/dist/rule-metadata.d.ts.map +1 -1
- package/dist/selection-memo.d.ts +47 -0
- package/dist/selection-memo.d.ts.map +1 -0
- package/dist/selection-memo.js +68 -0
- package/dist/selection-memo.js.map +1 -0
- package/dist/shallow-clone.d.ts +20 -0
- package/dist/shallow-clone.d.ts.map +1 -0
- package/dist/shallow-clone.js +27 -0
- package/dist/shallow-clone.js.map +1 -0
- package/dist/stderr.d.ts +16 -0
- package/dist/stderr.d.ts.map +1 -0
- package/dist/stderr.js +73 -0
- package/dist/stderr.js.map +1 -0
- package/dist/terminal-builder.d.ts +209 -9
- package/dist/terminal-builder.d.ts.map +1 -1
- package/dist/terminal-builder.js +264 -20
- package/dist/terminal-builder.js.map +1 -1
- package/dist/type-guards.d.ts +38 -0
- package/dist/type-guards.d.ts.map +1 -0
- package/dist/type-guards.js +42 -0
- package/dist/type-guards.js.map +1 -0
- package/dist/unsuppressable.d.ts +54 -0
- package/dist/unsuppressable.d.ts.map +1 -0
- package/dist/unsuppressable.js +76 -0
- package/dist/unsuppressable.js.map +1 -0
- package/dist/vacuity-findings.d.ts +55 -0
- package/dist/vacuity-findings.d.ts.map +1 -0
- package/dist/vacuity-findings.js +124 -0
- package/dist/vacuity-findings.js.map +1 -0
- package/dist/violation.d.ts +152 -4
- package/dist/violation.d.ts.map +1 -1
- package/dist/violation.js +262 -1
- package/dist/violation.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* Where the repository or workspace root is, and how to make a path portable
|
|
5
|
+
* relative to it.
|
|
6
|
+
*
|
|
7
|
+
* Lives in `core/` rather than `helpers/` because two things in `core/` need
|
|
8
|
+
* it — violation identity and the disk set behind `outside-project` — and the
|
|
9
|
+
* `core must not import from helpers` dogfood rule is right: core is the
|
|
10
|
+
* foundation. This module depends on nothing but `node:fs` and `node:path`, so
|
|
11
|
+
* it always belonged here; it was in `helpers/` only because `baseline.ts`
|
|
12
|
+
* happened to need it first. That rule caught the misplacement the same day it
|
|
13
|
+
* was introduced.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Placeholder substituted for the identity root when hashing a violation.
|
|
17
|
+
* Chosen to be something no real path contains.
|
|
18
|
+
*/
|
|
19
|
+
const ROOT_TOKEN = '<root>';
|
|
20
|
+
/**
|
|
21
|
+
* Find the identity root for a baseline: the repository or workspace root
|
|
22
|
+
* containing `startDir`.
|
|
23
|
+
*
|
|
24
|
+
* Resolution order, all **nearest-first**:
|
|
25
|
+
*
|
|
26
|
+
* 1. `.git` — the definitive repository root. Tested with `existsSync`, not
|
|
27
|
+
* `isDirectory`: in a worktree or submodule it is a *file* holding a gitdir
|
|
28
|
+
* pointer, and a worktree is precisely the "same code, different absolute
|
|
29
|
+
* path" case this module exists to survive.
|
|
30
|
+
* 2. a `package.json` declaring `workspaces` — a monorepo root without git.
|
|
31
|
+
* 3. any `package.json` — a single-package project.
|
|
32
|
+
* 4. `startDir` itself, when nothing is found. That degrades to the previous
|
|
33
|
+
* behaviour for that one path rather than guessing.
|
|
34
|
+
*
|
|
35
|
+
* Nearest, **not** outermost. Outermost is tempting for monorepos, but it is
|
|
36
|
+
* wrong the moment any ancestor is also a repository — a home directory under
|
|
37
|
+
* dotfiles version control is the common case — because the root would then sit
|
|
38
|
+
* above the checkout and the "relative" path would still carry
|
|
39
|
+
* `Documents/Projects/…`, which differs per machine. It reproduces the bug it
|
|
40
|
+
* is meant to fix. The nearest `.git` is the repository root by definition, and
|
|
41
|
+
* in a monorepo that is already the workspace root, so nearest costs nothing.
|
|
42
|
+
*/
|
|
43
|
+
export function discoverIdentityRoot(startDir) {
|
|
44
|
+
const resolved = path.resolve(startDir);
|
|
45
|
+
let nearestPackage;
|
|
46
|
+
let current = resolved;
|
|
47
|
+
for (;;) {
|
|
48
|
+
if (fs.existsSync(path.join(current, '.git')))
|
|
49
|
+
return current;
|
|
50
|
+
if (WORKSPACE_MARKERS.some((marker) => fs.existsSync(path.join(current, marker))))
|
|
51
|
+
return current;
|
|
52
|
+
const manifest = path.join(current, 'package.json');
|
|
53
|
+
if (fs.existsSync(manifest)) {
|
|
54
|
+
if (nearestPackage === undefined)
|
|
55
|
+
nearestPackage = current;
|
|
56
|
+
if (declaresWorkspaces(manifest))
|
|
57
|
+
return current;
|
|
58
|
+
}
|
|
59
|
+
const parent = path.dirname(current);
|
|
60
|
+
if (parent === current)
|
|
61
|
+
break;
|
|
62
|
+
current = parent;
|
|
63
|
+
}
|
|
64
|
+
return nearestPackage ?? resolved;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Files that mark a monorepo root for a tool other than npm/yarn/bun.
|
|
68
|
+
*
|
|
69
|
+
* Without these, a pnpm or Nx repo whose `.git` is absent — a Docker build
|
|
70
|
+
* (`.dockerignore` excludes `.git` in essentially every Node guide), a source
|
|
71
|
+
* tarball, `git archive`, a CI provider that ships a source artifact — falls
|
|
72
|
+
* through to the *nearest* `package.json`, i.e. the individual package. The
|
|
73
|
+
* developer machine has `.git` and resolves the workspace root, CI does not
|
|
74
|
+
* and resolves `packages/api`, the two roots disagree, and every hash differs.
|
|
75
|
+
*
|
|
76
|
+
* That is bug 0010's own symptom, reintroduced by the heuristic meant to fix
|
|
77
|
+
* it — and invisible, because both files carry the current hashVersion. Only
|
|
78
|
+
* npm/yarn/bun put workspaces in `package.json`; everyone else uses a file.
|
|
79
|
+
*
|
|
80
|
+
* Deliberately **root-only** files. `turbo.json` and `deno.json` are excluded
|
|
81
|
+
* even though they mark monorepos, because both are legal *inside* a package
|
|
82
|
+
* (Turborepo Package Configurations, per-package Deno config) and would anchor
|
|
83
|
+
* below the workspace root — the exact divergence this list exists to prevent.
|
|
84
|
+
* Turborepo is covered anyway: it runs on top of npm/pnpm/yarn workspaces, so
|
|
85
|
+
* one of the other markers is always present at the real root.
|
|
86
|
+
*/
|
|
87
|
+
const WORKSPACE_MARKERS = [
|
|
88
|
+
'pnpm-workspace.yaml',
|
|
89
|
+
'pnpm-workspace.yml',
|
|
90
|
+
'lerna.json',
|
|
91
|
+
'rush.json',
|
|
92
|
+
'nx.json',
|
|
93
|
+
];
|
|
94
|
+
/**
|
|
95
|
+
* Whether a package.json declares npm/yarn/bun workspaces, marking it as the
|
|
96
|
+
* root of a monorepo. An unreadable or malformed manifest is simply not a
|
|
97
|
+
* workspace root — it must not abort baseline loading.
|
|
98
|
+
*/
|
|
99
|
+
function declaresWorkspaces(manifestPath) {
|
|
100
|
+
try {
|
|
101
|
+
const parsed = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
|
|
102
|
+
return parsed !== null && typeof parsed === 'object' && 'workspaces' in parsed;
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
// A malformed or unreadable package.json is simply not a workspace root —
|
|
106
|
+
// it must not abort identity-root discovery (or baseline loading behind
|
|
107
|
+
// it) over a manifest this function doesn't even need to parse correctly.
|
|
108
|
+
// Deliberately unexamined: every failure mode (bad JSON, permissions, a
|
|
109
|
+
// symlink race) reduces to the same "not a workspace root" answer.
|
|
110
|
+
void error;
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Convert a filesystem path to its portable form: relative to the identity
|
|
116
|
+
* root, with forward slashes.
|
|
117
|
+
*
|
|
118
|
+
* A path outside the root is returned unchanged — relativising it would encode
|
|
119
|
+
* the root's *depth* (`../../..`), which varies by machine and would reproduce
|
|
120
|
+
* the very bug this fixes.
|
|
121
|
+
*/
|
|
122
|
+
export function toPortablePath(filePath, root) {
|
|
123
|
+
const normalizedRoot = normalizeSeparators(root);
|
|
124
|
+
const normalizedPath = normalizeSeparators(filePath);
|
|
125
|
+
const prefix = normalizedRoot.endsWith('/') ? normalizedRoot : normalizedRoot + '/';
|
|
126
|
+
if (!normalizedPath.startsWith(prefix))
|
|
127
|
+
return normalizedPath;
|
|
128
|
+
return normalizedPath.slice(prefix.length);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Replace every occurrence of the identity root inside free text with a stable
|
|
132
|
+
* token.
|
|
133
|
+
*
|
|
134
|
+
* Rule descriptions, element names and messages are prose: producers
|
|
135
|
+
* interpolate `getFilePath()` into them (`src/smells/duplicate-bodies.ts`,
|
|
136
|
+
* `src/presets/boundaries.ts`, and any user-written `defineCondition`). Since
|
|
137
|
+
* the text is unstructured, this substitutes the known root prefix rather than
|
|
138
|
+
* trying to parse paths out of it — a regex would also rewrite the `/src`
|
|
139
|
+
* inside a doubled-star glob, which is not a path at all, and relativising it
|
|
140
|
+
* would encode the root's depth.
|
|
141
|
+
*
|
|
142
|
+
* Substring replacement is sufficient because the only machine-dependent part
|
|
143
|
+
* of an interpolated path IS the root prefix; everything after it is a property
|
|
144
|
+
* of the repository.
|
|
145
|
+
*
|
|
146
|
+
* Only the *root* is separator-normalized, never the surrounding text: rule
|
|
147
|
+
* descriptions embed regex sources (`/\bparse/`), and rewriting their
|
|
148
|
+
* backslashes would let two distinct rules collide on one identity.
|
|
149
|
+
*/
|
|
150
|
+
export function normalizeIdentityText(text, root) {
|
|
151
|
+
const posixRoot = normalizeSeparators(root);
|
|
152
|
+
if (posixRoot === '')
|
|
153
|
+
return text;
|
|
154
|
+
const win32Root = posixRoot.replaceAll('/', '\\');
|
|
155
|
+
const withToken = text.replaceAll(posixRoot, ROOT_TOKEN).replaceAll(win32Root, ROOT_TOKEN);
|
|
156
|
+
// Collapse `<root>/x` and `<root>x` so a root with and without a trailing
|
|
157
|
+
// separator produce identical identity.
|
|
158
|
+
return withToken
|
|
159
|
+
.replaceAll(ROOT_TOKEN + '/', ROOT_TOKEN)
|
|
160
|
+
.replaceAll(ROOT_TOKEN + '\\', ROOT_TOKEN);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Normalize Windows separators so a baseline generated on one OS matches on
|
|
164
|
+
* another. ts-morph already returns forward slashes; interpolated `path.*`
|
|
165
|
+
* output and the stored `file` field do not.
|
|
166
|
+
*/
|
|
167
|
+
function normalizeSeparators(value) {
|
|
168
|
+
return value.replaceAll('\\', '/');
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=identity-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-root.js","sourceRoot":"","sources":["../src/identity-root.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B;;;;;;;;;;;GAWG;AAEH;;;GAGG;AACH,MAAM,UAAU,GAAG,QAAQ,CAAA;AAE3B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,MAAM,QAAQ,GAAG,IAAI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UAAU,GAAG,IAAI,EAAE,UAAU,CAAC,CAAA;AAC9C,CAAC;AAED;;;;GAIG;AACH,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;AACpC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,16 @@ export type { Condition, ConditionContext } from './condition.js';
|
|
|
3
3
|
export { not, and, or } from './combinators.js';
|
|
4
4
|
export type { Matcher } from './combinators.js';
|
|
5
5
|
export type { ArchViolation, ArchFix } from './violation.js';
|
|
6
|
+
export { byCodepoint, severityFor, remedyRepeatsMessage } from './violation.js';
|
|
6
7
|
export { applyFixes } from './apply-fixes.js';
|
|
7
8
|
export type { ApplyResult } from './apply-fixes.js';
|
|
9
|
+
export { UNSUPPRESSABLE } from './unsuppressable.js';
|
|
8
10
|
export { RuleBuilder } from './rule-builder.js';
|
|
9
11
|
export { TerminalBuilder } from './terminal-builder.js';
|
|
12
|
+
export type { CollectResult } from './terminal-builder.js';
|
|
13
|
+
export { marksAssertsCardinality, assertsCardinality } from './cardinality.js';
|
|
14
|
+
export { registerCacheReset, clearRegisteredCaches } from './cache-registry.js';
|
|
15
|
+
export { selectionMemo } from './selection-memo.js';
|
|
10
16
|
export { ArchRuleError } from './errors.js';
|
|
11
17
|
export type { RuleMetadata } from './rule-metadata.js';
|
|
12
18
|
export type { RuleDescription } from './rule-description.js';
|
|
@@ -19,8 +25,8 @@ export { formatViolationsGitHub } from './format-github.js';
|
|
|
19
25
|
export type { CheckOptions, OutputFormat, BaselineFilter, DiffFilterLike } from './check-options.js';
|
|
20
26
|
export { detectFormat, isCI } from './environment.js';
|
|
21
27
|
export { definePredicate, defineCondition } from './define.js';
|
|
22
|
-
export { dispatchRule, validateOverrides, throwIfViolations } from './preset-dispatch.js';
|
|
23
|
-
export { reportViolations, finishPreset } from './report.js';
|
|
28
|
+
export { dispatchRule, validateOverrides, throwIfViolations, presetConstructsNothingViolation, } from './preset-dispatch.js';
|
|
29
|
+
export { reportViolations, finishPreset, violationsEmittedCount } from './report.js';
|
|
24
30
|
export type { ReportMode, ReportOptions, PresetReportOptions } from './report.js';
|
|
25
31
|
export type { RuleSeverity, PresetBaseOptions } from './preset-dispatch.js';
|
|
26
32
|
export { matchSelections } from './matching.js';
|
|
@@ -30,13 +36,45 @@ export type { Selection, ElementInfo, Direction, RelationSpec, CorrespondenceOpt
|
|
|
30
36
|
export { applyFilters } from './execute-rule.js';
|
|
31
37
|
export { escapeGitHub } from './format-github.js';
|
|
32
38
|
export { hashViolation } from './baseline.js';
|
|
39
|
+
export { discoverIdentityRoot, normalizeIdentityText } from './identity-root.js';
|
|
40
|
+
export { writeStderr } from './stderr.js';
|
|
33
41
|
export { bold, red, dim, yellow, cyan, gray } from './ansi.js';
|
|
34
42
|
export { parseExclusionComments, isExcludedByComment } from './exclusion-comments.js';
|
|
35
43
|
export type { ExclusionComment, ExclusionWarning, ParseResult } from './exclusion-comments.js';
|
|
36
|
-
export { silent } from './silent-exclusion.js';
|
|
44
|
+
export { silent, isSilent } from './silent-exclusion.js';
|
|
37
45
|
export type { SilentExclusion } from './silent-exclusion.js';
|
|
38
46
|
export { withBaseline, generateBaseline, Baseline } from './baseline.js';
|
|
39
47
|
export type { BaselineEntry, BaselineFile } from './baseline.js';
|
|
40
48
|
export { collectViolations } from './baseline-generator.js';
|
|
41
49
|
export { diffAware, DiffFilter } from './diff-aware.js';
|
|
50
|
+
export { recordEdgeCoverage, untestedRules, edgeCoverageNotice, resetEdgeCoverage, } from './edge-coverage.js';
|
|
51
|
+
export type { UntestedReason, EdgeCoverage } from './edge-coverage.js';
|
|
52
|
+
export type { GlobKind, GlobPosition, GlobBase, DeclaredGlob, GlobSite, OpaqueGlob, GlobLeaf, GlobTree, DeclaredGlobs, GlobNode, } from './glob-site.js';
|
|
53
|
+
export { isFaultPosition, countDeclaredGlobs, isGlobNode, isOpaqueGlob, globAnyOf, globNode, stampGlobs, negateGlobs, combineGlobs, } from './glob-site.js';
|
|
54
|
+
export type { PathUniverse } from './path-universe.js';
|
|
55
|
+
export { viewsFor } from './path-universe.js';
|
|
56
|
+
export type { OnDisk, DiskSet } from './disk-set.js';
|
|
57
|
+
export { isAnchored, isProjectRelative } from './project-relative.js';
|
|
58
|
+
export { isRecord, isNullaryCallable } from './type-guards.js';
|
|
59
|
+
export { shallowClone } from './shallow-clone.js';
|
|
60
|
+
export { suppressionNotice, activeNotice, resetDiffDisclosureForTests } from './diff-disclosure.js';
|
|
61
|
+
export { resetCommentSuppression, recordCommentSuppression, commentSuppressions, commentSuppressionNotice, } from './comment-suppression.js';
|
|
62
|
+
export { dedupeConfigFindings } from './dedupe-config-findings.js';
|
|
63
|
+
export { assertionLessViolation } from './terminal-builder.js';
|
|
64
|
+
export { toPortablePath } from './identity-root.js';
|
|
65
|
+
export type { Describable } from './rule-description.js';
|
|
66
|
+
export { isDescribable } from './rule-description.js';
|
|
67
|
+
export { resetStderrGuardForTests } from './stderr.js';
|
|
68
|
+
export { DECLARE_INSTEAD } from './unsuppressable.js';
|
|
69
|
+
export { UNSUPPRESSABLE_MECHANISMS } from './unsuppressable.js';
|
|
70
|
+
export { subjectOf } from './violation.js';
|
|
71
|
+
export { identityCollisions } from './violation.js';
|
|
72
|
+
export { resetIdentityCollisions } from './violation.js';
|
|
73
|
+
export { disambiguateIdentities } from './violation.js';
|
|
74
|
+
export { isArchRuleError } from './errors.js';
|
|
75
|
+
export type { ArchJsonViolation, ArchJsonSuppression, ArchJsonUntestedAllowlist, ArchJsonReport, } from './format-json.js';
|
|
76
|
+
export type { CorrespondenceResult } from './correspondence-core.js';
|
|
77
|
+
export { setCorrespondence } from './correspondence-core.js';
|
|
78
|
+
export { marksOwnEmptyDiscovery, ownsEmptyDiscovery } from './owns-empty-discovery.js';
|
|
79
|
+
export type { RuleBuilderLike } from './rule-builder-like.js';
|
|
42
80
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAC/C,YAAY,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAG/C,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAC/C,YAAY,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAG/C,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,YAAY,EAAE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AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,GACf,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AACtF,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -5,10 +5,15 @@
|
|
|
5
5
|
// defineCondition extension points. Nothing here depends on ts-morph or any
|
|
6
6
|
// dialect-specific parser.
|
|
7
7
|
export { not, and, or } from './combinators.js';
|
|
8
|
+
export { byCodepoint, severityFor, remedyRepeatsMessage } from './violation.js';
|
|
8
9
|
export { applyFixes } from './apply-fixes.js';
|
|
10
|
+
export { UNSUPPRESSABLE } from './unsuppressable.js';
|
|
9
11
|
// Rule builder, terminal builder, error
|
|
10
12
|
export { RuleBuilder } from './rule-builder.js';
|
|
11
13
|
export { TerminalBuilder } from './terminal-builder.js';
|
|
14
|
+
export { marksAssertsCardinality, assertsCardinality } from './cardinality.js';
|
|
15
|
+
export { registerCacheReset, clearRegisteredCaches } from './cache-registry.js';
|
|
16
|
+
export { selectionMemo } from './selection-memo.js';
|
|
12
17
|
export { ArchRuleError } from './errors.js';
|
|
13
18
|
// Code frame & formatting
|
|
14
19
|
export { generateCodeFrame } from './code-frame.js';
|
|
@@ -19,8 +24,8 @@ export { detectFormat, isCI } from './environment.js';
|
|
|
19
24
|
// Custom predicate/condition factories
|
|
20
25
|
export { definePredicate, defineCondition } from './define.js';
|
|
21
26
|
// Preset dispatch — generic per-rule severity/override infrastructure for presets
|
|
22
|
-
export { dispatchRule, validateOverrides, throwIfViolations } from './preset-dispatch.js';
|
|
23
|
-
export { reportViolations, finishPreset } from './report.js';
|
|
27
|
+
export { dispatchRule, validateOverrides, throwIfViolations, presetConstructsNothingViolation, } from './preset-dispatch.js';
|
|
28
|
+
export { reportViolations, finishPreset, violationsEmittedCount } from './report.js';
|
|
24
29
|
// Matching engine — shared by correspondence() and eess-ts's crossLayer
|
|
25
30
|
export { matchSelections } from './matching.js';
|
|
26
31
|
// Cross-validation — bind two element Selections and assert they correspond
|
|
@@ -29,12 +34,37 @@ export { correspondence, CorrespondenceBuilder } from './correspondence.js';
|
|
|
29
34
|
export { applyFilters } from './execute-rule.js';
|
|
30
35
|
export { escapeGitHub } from './format-github.js';
|
|
31
36
|
export { hashViolation } from './baseline.js';
|
|
37
|
+
export { discoverIdentityRoot, normalizeIdentityText } from './identity-root.js';
|
|
38
|
+
export { writeStderr } from './stderr.js';
|
|
32
39
|
export { bold, red, dim, yellow, cyan, gray } from './ansi.js';
|
|
33
40
|
// Exclusions
|
|
34
41
|
export { parseExclusionComments, isExcludedByComment } from './exclusion-comments.js';
|
|
35
|
-
export { silent } from './silent-exclusion.js';
|
|
42
|
+
export { silent, isSilent } from './silent-exclusion.js';
|
|
36
43
|
// Baseline & diff-aware
|
|
37
44
|
export { withBaseline, generateBaseline, Baseline } from './baseline.js';
|
|
38
45
|
export { collectViolations } from './baseline-generator.js';
|
|
39
46
|
export { diffAware, DiffFilter } from './diff-aware.js';
|
|
47
|
+
// Edge coverage — allowlist conditions disclose when they tested nothing
|
|
48
|
+
export { recordEdgeCoverage, untestedRules, edgeCoverageNotice, resetEdgeCoverage, } from './edge-coverage.js';
|
|
49
|
+
export { isFaultPosition, countDeclaredGlobs, isGlobNode, isOpaqueGlob, globAnyOf, globNode, stampGlobs, negateGlobs, combineGlobs, } from './glob-site.js';
|
|
50
|
+
export { viewsFor } from './path-universe.js';
|
|
51
|
+
export { isAnchored, isProjectRelative } from './project-relative.js';
|
|
52
|
+
export { isRecord, isNullaryCallable } from './type-guards.js';
|
|
53
|
+
export { shallowClone } from './shallow-clone.js';
|
|
54
|
+
export { suppressionNotice, activeNotice, resetDiffDisclosureForTests } from './diff-disclosure.js';
|
|
55
|
+
export { resetCommentSuppression, recordCommentSuppression, commentSuppressions, commentSuppressionNotice, } from './comment-suppression.js';
|
|
56
|
+
export { dedupeConfigFindings } from './dedupe-config-findings.js';
|
|
57
|
+
export { assertionLessViolation } from './terminal-builder.js';
|
|
58
|
+
export { toPortablePath } from './identity-root.js';
|
|
59
|
+
export { isDescribable } from './rule-description.js';
|
|
60
|
+
export { resetStderrGuardForTests } from './stderr.js';
|
|
61
|
+
export { DECLARE_INSTEAD } from './unsuppressable.js';
|
|
62
|
+
export { UNSUPPRESSABLE_MECHANISMS } from './unsuppressable.js';
|
|
63
|
+
export { subjectOf } from './violation.js';
|
|
64
|
+
export { identityCollisions } from './violation.js';
|
|
65
|
+
export { resetIdentityCollisions } from './violation.js';
|
|
66
|
+
export { disambiguateIdentities } from './violation.js';
|
|
67
|
+
export { isArchRuleError } from './errors.js';
|
|
68
|
+
export { setCorrespondence } from './correspondence-core.js';
|
|
69
|
+
export { marksOwnEmptyDiscovery, ownsEmptyDiscovery } from './owns-empty-discovery.js';
|
|
40
70
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E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AA0B,CAAA;AAC5D,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Declare that this condition reports an empty discovery population itself. */
|
|
2
|
+
export declare function marksOwnEmptyDiscovery<T extends object>(condition: T): T;
|
|
3
|
+
/** Does this condition report an empty discovery population itself? */
|
|
4
|
+
export declare function ownsEmptyDiscovery(condition: object): boolean;
|
|
5
|
+
//# sourceMappingURL=owns-empty-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owns-empty-discovery.d.ts","sourceRoot":"","sources":["../src/owns-empty-discovery.ts"],"names":[],"mappings":"AA4DA,gFAAgF;AAChF,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAGxE;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE7D"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A condition that diagnoses its own empty discovery population.
|
|
3
|
+
*
|
|
4
|
+
* [ts-archunit Plan 0081](https://github.com/nielspeter/ts-archunit/blob/main/plans/completed/0081-a-condition-declares-discovery-ownership.md). The
|
|
5
|
+
* dead-glob gate can see that a `.layer()` or `.inFolder()` glob matched nothing,
|
|
6
|
+
* but it short-circuits **before** the condition runs, so where a condition
|
|
7
|
+
* produces a better finding — one that names the dead layer, with a remedy
|
|
8
|
+
* pointing at the call the reader must edit — the gate would replace it with a
|
|
9
|
+
* generic message. This symbol is how a condition says "leave it to me".
|
|
10
|
+
*
|
|
11
|
+
* ## Why per condition, and not per builder
|
|
12
|
+
*
|
|
13
|
+
* It was per builder, and the granularity was load-bearing rather than cosmetic.
|
|
14
|
+
* At v0.45.0 `PairFinalBuilder` returned `true` unconditionally while its own
|
|
15
|
+
* docstring claimed *"All three now produce a finding naming the layer"* — and
|
|
16
|
+
* that claim was false: `haveMatchingCounterpart` checked for empty layers inside
|
|
17
|
+
* its pair loop, so a dead **final** layer produced no configuration finding at
|
|
18
|
+
* all. The coarse declaration suppressed the gate for exactly the case its
|
|
19
|
+
* declared owner did not handle, and the result was silence where the truth was
|
|
20
|
+
* one dead glob
|
|
21
|
+
* ([ts-archunit bug 0040](https://github.com/nielspeter/ts-archunit/blob/main/bugs/fixed/0040-a-crosslayer-rule-reports-nothing-when-its-layer-resolves-nothing.md)).
|
|
22
|
+
*
|
|
23
|
+
* v0.45.1 fixed the condition, so the blanket claim became true again. It would
|
|
24
|
+
* have gone false again the moment a fourth condition reached that builder,
|
|
25
|
+
* because nothing forced the new condition to say anything. Now the claim is not
|
|
26
|
+
* a claim: the builder reads the tag off the condition it was given.
|
|
27
|
+
*
|
|
28
|
+
* **An untagged condition does not own it, so the gate covers it.** That default
|
|
29
|
+
* is the load-bearing half — under it, v0.45.0's hole would have degraded to a
|
|
30
|
+
* generic message rather than silence, and a generic message is recoverable. An
|
|
31
|
+
* agent reading "this glob matched nothing" fixes the glob; silence sends it to
|
|
32
|
+
* write files into a layer that will never match.
|
|
33
|
+
*
|
|
34
|
+
* ## Unreachable by construction — a registry, not a property
|
|
35
|
+
*
|
|
36
|
+
* The first version was a `unique symbol` keyed onto the condition object, copying
|
|
37
|
+
* `ASSERTS_CARDINALITY`. Review broke it in two lines:
|
|
38
|
+
*
|
|
39
|
+
* ```ts
|
|
40
|
+
* const stolen = Object.getOwnPropertySymbols(haveMatchingCounterpart())[0]
|
|
41
|
+
* const mine: PairCondition = { description: 'x', evaluate: () => [], [stolen]: true }
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* Measured: **0 configuration findings** on a dead layer. `PairCondition` is a
|
|
45
|
+
* public type and all three condition factories are public exports, so the symbol
|
|
46
|
+
* was readable off any shipped condition — the one-line silent opt-out this file
|
|
47
|
+
* claimed could not exist, reachable through documented API.
|
|
48
|
+
*
|
|
49
|
+
* The `ASSERTS_CARDINALITY` precedent is stronger than the copy was, and that is
|
|
50
|
+
* why copying it was not enough: `defineCondition` is its *sanctioned constructor*,
|
|
51
|
+
* and a test asserts that constructor emits no own symbols. `PairCondition` has no
|
|
52
|
+
* sanctioned constructor, so there is nothing to make the analogous guarantee.
|
|
53
|
+
*
|
|
54
|
+
* A module-level `WeakSet` has no such hole. Membership is not a property of the
|
|
55
|
+
* object, so it cannot be read off one, copied, or forged — a caller would need
|
|
56
|
+
* this module's binding, and it is not exported. `WeakSet` rather than `Set` so a
|
|
57
|
+
* condition is not retained after its rule is discarded.
|
|
58
|
+
*/
|
|
59
|
+
const OWNERS = new WeakSet();
|
|
60
|
+
/** Declare that this condition reports an empty discovery population itself. */
|
|
61
|
+
export function marksOwnEmptyDiscovery(condition) {
|
|
62
|
+
OWNERS.add(condition);
|
|
63
|
+
return condition;
|
|
64
|
+
}
|
|
65
|
+
/** Does this condition report an empty discovery population itself? */
|
|
66
|
+
export function ownsEmptyDiscovery(condition) {
|
|
67
|
+
return OWNERS.has(condition);
|
|
68
|
+
}
|
|
69
|
+
/*
|
|
70
|
+
* Not every builder needs this. `SliceRuleBuilder` declares ownership at the
|
|
71
|
+
* BUILDER level and correctly so: its reason — `assignedFrom` fanning out one glob
|
|
72
|
+
* tree per entry, where a single dead entry among populated siblings is a
|
|
73
|
+
* legitimate project shape — is identical for every condition reachable through
|
|
74
|
+
* it. Registry membership is for the case where ownership varies by condition,
|
|
75
|
+
* which is what made a blanket declaration wrong for cross-layer.
|
|
76
|
+
*/
|
|
77
|
+
//# sourceMappingURL=owns-empty-discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owns-empty-discovery.js","sourceRoot":"","sources":["../src/owns-empty-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,MAAM,MAAM,GAAG,IAAI,OAAO,EAAU,CAAA;AAEpC,gFAAgF;AAChF,MAAM,UAAU,sBAAsB,CAAmB,SAAY;IACnE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACrB,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAClD,OAAO,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AAC9B,CAAC;AAED;;;;;;;GAOG"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every path a glob could legitimately match in a project — the shape of the
|
|
3
|
+
* data, not how to build it.
|
|
4
|
+
*
|
|
5
|
+
* `PathUniverse` and `viewsFor` are pure: given the materialized string
|
|
6
|
+
* arrays, they need no `ArchProject`/ts-morph and stay in the kernel. Only
|
|
7
|
+
* the MATERIALIZER — walking a real project's source files into this shape —
|
|
8
|
+
* needs the dialect's own project type, and lives in that dialect (e.g.
|
|
9
|
+
* `packages/ts/src/core/path-universe.ts`'s `pathUniverse()`).
|
|
10
|
+
*/
|
|
11
|
+
export interface PathUniverse {
|
|
12
|
+
/** Absolute paths of every file in the project. */
|
|
13
|
+
readonly filePaths: readonly string[];
|
|
14
|
+
/**
|
|
15
|
+
* Immediate parent directories only.
|
|
16
|
+
*
|
|
17
|
+
* Not all ancestors. A directory-matching predicate typically tests
|
|
18
|
+
* `filePath.substring(0, filePath.lastIndexOf('/'))` — the immediate
|
|
19
|
+
* parent and nothing else — so an all-ancestors set is not a harmless
|
|
20
|
+
* over-approximation, it is a false green: many ancestors are no file's
|
|
21
|
+
* direct parent, so a glob naming one of those can never select anything
|
|
22
|
+
* while an all-ancestors universe would call it satisfiable.
|
|
23
|
+
*/
|
|
24
|
+
readonly parentDirs: readonly string[];
|
|
25
|
+
/** `filePaths` relative to the tsconfig directory, for message wording. */
|
|
26
|
+
readonly tsconfigRelativeFilePaths: readonly string[];
|
|
27
|
+
/** `parentDirs` relative to the tsconfig directory, for message wording. */
|
|
28
|
+
readonly tsconfigRelativeParentDirs: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The views a glob of this kind is matched against.
|
|
32
|
+
*
|
|
33
|
+
* Satisfiability is taken against the **union** — a glob is unsatisfiable
|
|
34
|
+
* only when nothing in any view matches it. That is deliberately generous,
|
|
35
|
+
* so that a wrong `base` cannot make a glob look unmatched by accident. It
|
|
36
|
+
* does NOT make `base` message-only: the anchor check in `syntacticFault`
|
|
37
|
+
* consults it directly, and an unanchored `base: 'absolute'` glob is dead
|
|
38
|
+
* regardless of what any view holds — see `GlobBase`.
|
|
39
|
+
*
|
|
40
|
+
* `import-target`, `specifier` and `literal` are not path kinds and have no
|
|
41
|
+
* views, so they can never be found unsatisfiable here.
|
|
42
|
+
*/
|
|
43
|
+
export declare function viewsFor(universe: PathUniverse, kind: 'file-path' | 'parent-dir' | 'import-target' | 'specifier' | 'literal'): readonly (readonly string[])[];
|
|
44
|
+
//# sourceMappingURL=path-universe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-universe.d.ts","sourceRoot":"","sources":["../src/path-universe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,2EAA2E;IAC3E,QAAQ,CAAC,yBAAyB,EAAE,SAAS,MAAM,EAAE,CAAA;IACrD,4EAA4E;IAC5E,QAAQ,CAAC,0BAA0B,EAAE,SAAS,MAAM,EAAE,CAAA;CACvD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,WAAW,GAAG,YAAY,GAAG,eAAe,GAAG,WAAW,GAAG,SAAS,GAC3E,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAIhC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The views a glob of this kind is matched against.
|
|
3
|
+
*
|
|
4
|
+
* Satisfiability is taken against the **union** — a glob is unsatisfiable
|
|
5
|
+
* only when nothing in any view matches it. That is deliberately generous,
|
|
6
|
+
* so that a wrong `base` cannot make a glob look unmatched by accident. It
|
|
7
|
+
* does NOT make `base` message-only: the anchor check in `syntacticFault`
|
|
8
|
+
* consults it directly, and an unanchored `base: 'absolute'` glob is dead
|
|
9
|
+
* regardless of what any view holds — see `GlobBase`.
|
|
10
|
+
*
|
|
11
|
+
* `import-target`, `specifier` and `literal` are not path kinds and have no
|
|
12
|
+
* views, so they can never be found unsatisfiable here.
|
|
13
|
+
*/
|
|
14
|
+
export function viewsFor(universe, kind) {
|
|
15
|
+
if (kind === 'file-path')
|
|
16
|
+
return [universe.filePaths, universe.tsconfigRelativeFilePaths];
|
|
17
|
+
if (kind === 'parent-dir')
|
|
18
|
+
return [universe.parentDirs, universe.tsconfigRelativeParentDirs];
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=path-universe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-universe.js","sourceRoot":"","sources":["../src/path-universe.ts"],"names":[],"mappings":"AA8BA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,QAAQ,CACtB,QAAsB,EACtB,IAA4E;IAE5E,IAAI,IAAI,KAAK,WAAW;QAAE,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,yBAAyB,CAAC,CAAA;IACzF,IAAI,IAAI,KAAK,YAAY;QAAE,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,0BAA0B,CAAC,CAAA;IAC5F,OAAO,EAAE,CAAA;AACX,CAAC"}
|
package/dist/predicate.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DeclaredGlobs } from './glob-site.js';
|
|
1
2
|
/**
|
|
2
3
|
* A predicate that tests whether an architectural element matches a condition.
|
|
3
4
|
* Used in `.that()` clauses to filter elements before rule evaluation.
|
|
@@ -7,5 +8,37 @@ export interface Predicate<T> {
|
|
|
7
8
|
readonly description: string;
|
|
8
9
|
/** Returns true if the element matches this predicate. */
|
|
9
10
|
test(element: T): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The path globs this predicate matches against, if any.
|
|
13
|
+
*
|
|
14
|
+
* Declaring them lets the builder answer "can this rule ever have subjects?"
|
|
15
|
+
* without running it (plan 0069). Optional: a predicate that matches on
|
|
16
|
+
* something other than a path — a name, a decorator, a type — declares
|
|
17
|
+
* nothing and is treated as opaque, which is never a fault.
|
|
18
|
+
*
|
|
19
|
+
* Leaves are `DeclaredGlob`, so a predicate cannot claim a `position`; the
|
|
20
|
+
* builder stamps that on according to where the predicate was registered.
|
|
21
|
+
*/
|
|
22
|
+
readonly globs?: DeclaredGlobs;
|
|
23
|
+
/**
|
|
24
|
+
* What to call this predicate's globs in a **configuration finding**, when
|
|
25
|
+
* the call the user made is not the call the predicate makes.
|
|
26
|
+
*
|
|
27
|
+
* Plan 0074, the second consequence of 0069's appendix item 4: presets must
|
|
28
|
+
* thread the option name into the site's origin (`shared: "…"`, not
|
|
29
|
+
* `resideInFolder("…")`), or the message names a call the user never made.
|
|
30
|
+
*
|
|
31
|
+
* A preset option is one name that expands to several predicates —
|
|
32
|
+
* `shared: ['…']` becomes `atPath()`, which is `or(resideInFile,
|
|
33
|
+
* resideInFolder)`. Measured before this existed, the finding read "This
|
|
34
|
+
* rule's selector reside in file matching … or reside in folder matching …
|
|
35
|
+
* can never match anything", naming two calls the author never wrote and
|
|
36
|
+
* omitting the option they did.
|
|
37
|
+
*
|
|
38
|
+
* Deliberately **not** `description`, which is overloaded: that renders the
|
|
39
|
+
* human-readable rule text, and rewriting it would change every violation
|
|
40
|
+
* message the preset produces, not just the configuration finding.
|
|
41
|
+
*/
|
|
42
|
+
readonly originLabel?: string;
|
|
10
43
|
}
|
|
11
44
|
//# sourceMappingURL=predicate.d.ts.map
|
package/dist/predicate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predicate.d.ts","sourceRoot":"","sources":["../src/predicate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,4FAA4F;IAC5F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,0DAA0D;IAC1D,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"predicate.d.ts","sourceRoot":"","sources":["../src/predicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD;;;GAGG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,4FAA4F;IAC5F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,0DAA0D;IAC1D,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAA;IACzB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAA;IAE9B;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B"}
|
|
@@ -36,6 +36,25 @@ export declare function dispatchRule(builder: Dispatchable, rule: string | (Rule
|
|
|
36
36
|
* (likely typos).
|
|
37
37
|
*/
|
|
38
38
|
export declare function validateOverrides(overrides: Record<string, RuleSeverity> | undefined, knownIds: string[]): void;
|
|
39
|
+
/**
|
|
40
|
+
* A configuration finding for a preset call that constructed **zero** rules —
|
|
41
|
+
* every optional capability was left off, or a required discovery pattern
|
|
42
|
+
* (a folder glob, a repositories glob) matched nothing, so the call checked
|
|
43
|
+
* nothing and would otherwise pass silently. The vacuity matrix
|
|
44
|
+
* (`scripts/vacuity-matrix.mjs`) is what proves a preset needs this: it
|
|
45
|
+
* probes every published preset at its minimal type-correct call, and a
|
|
46
|
+
* preset reaching `fail-open` there is exactly this shape.
|
|
47
|
+
*
|
|
48
|
+
* Unsuppressable (ADR-010) for the same reason a zero-examined rule is: the
|
|
49
|
+
* caller's mistake is in how the preset was configured, not in the code the
|
|
50
|
+
* preset would have checked, and `.excluding()`/a baseline/`--changed` all
|
|
51
|
+
* aim at the latter.
|
|
52
|
+
*
|
|
53
|
+
* @param presetName - The preset's own name, e.g. `'agentGuardrails'`.
|
|
54
|
+
* @param optionsHint - The option names that would enable a rule, for the
|
|
55
|
+
* remedy — e.g. `'noGenericErrors, noStubs, noEmptyBodies'`.
|
|
56
|
+
*/
|
|
57
|
+
export declare function presetConstructsNothingViolation(presetName: string, optionsHint: string): ArchViolation;
|
|
39
58
|
/**
|
|
40
59
|
* Emit (stderr text) and throw a single `ArchRuleError` with all aggregated
|
|
41
60
|
* violations, if any. Kept for backward compatibility; it is now `finishPreset`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset-dispatch.d.ts","sourceRoot":"","sources":["../src/preset-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"preset-dispatch.d.ts","sourceRoot":"","sources":["../src/preset-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAIpE,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAA;AAEnD;;;;GAIG;AACH,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,SAAS,CAAC,EAAE,MAAM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