@descent-vtt/spec-guard 0.5.1 → 0.6.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/CHANGELOG.md +377 -283
- package/README.md +1009 -868
- package/dist/cli.d.ts +2 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +10 -0
- package/dist/cli.js.map +1 -1
- package/dist/graph.d.ts +124 -0
- package/dist/graph.d.ts.map +1 -0
- package/dist/graph.js +241 -0
- package/dist/graph.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/layers.d.ts +72 -0
- package/dist/layers.d.ts.map +1 -0
- package/dist/layers.js +102 -0
- package/dist/layers.js.map +1 -0
- package/dist/parser.d.ts +25 -1
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +178 -1
- package/dist/parser.js.map +1 -1
- package/dist/reporter.d.ts.map +1 -1
- package/dist/reporter.js +62 -5
- package/dist/reporter.js.map +1 -1
- package/dist/runner.d.ts +8 -0
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +238 -40
- package/dist/runner.js.map +1 -1
- package/dist/types.d.ts +60 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +73 -73
package/dist/cli.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export interface CliOptions {
|
|
|
30
30
|
engine: EnginePreference;
|
|
31
31
|
allowMissingTargets: boolean;
|
|
32
32
|
defaultSkips: boolean;
|
|
33
|
+
ignoreStatus: boolean;
|
|
33
34
|
strictTargets: boolean;
|
|
34
35
|
allowEmptyScope: boolean;
|
|
35
36
|
printBaseline: boolean;
|
|
@@ -44,7 +45,7 @@ export interface CliOptions {
|
|
|
44
45
|
export declare class UsageError extends Error {
|
|
45
46
|
}
|
|
46
47
|
export declare function version(): string;
|
|
47
|
-
export declare const HELP = "spec-guard - Executable architecture assertions for Markdown specs & ADRs\n\nUsage\n spec-guard [patterns...] [options]\n\nPatterns\n Globs or paths to the Markdown specs to execute. A directory expands to the\n Markdown files inside it. Defaults to \"docs/**/*.md\" when omitted.\n\nOptions\n -r, --root <path> Codebase root that assertions are resolved against (default: cwd)\n -v, --verbose Print passing assertions too\n --fail-fast Stop at the first failing assertion\n --json Emit a machine-readable JSON report (same as --format json)\n --format <name> human | json | sarif (sarif uploads to GitHub code scanning)\n --engine <name> auto | rg | js (default: auto - scanner for small trees, ripgrep for big ones)\n --strict Treat analysis that could not be completed as a failure\n --allow-missing-targets\n Tolerate target paths that do not exist (they fail by default)\n --allow-empty-scope Tolerate assertions whose scope holds no files (they fail by default)\n --print-baseline Print the baseline=\"...\" that would exempt today's violations, and exit\n --no-default-skips Search .git, .hg, .svn and node_modules too\n --include-specs Also count matches inside the spec files themselves\n --max-snippets <n> Failure snippets per assertion (default: 5)\n --concurrency <n> Assertions executed in parallel (default: 8)\n --allow-empty Exit 0 when no spec files matched (about the run, not an assertion)\n --color/--no-color Force colour on or off (NO_COLOR is honoured)\n -h, --help Show this help\n --version Print the version\n\nDirectives\n <!-- @assert-absence target=\"src/\" symbol=\"LegacyGateway\" exclude=\"src/legacy/**\" -->\n <!-- @assert-count target=\"src/\" symbol=\"SessionManager\" expected=\"1\" -->\n <!-- @assert-present file=\"SECURITY.md\" -->\n\n Matches inside comments do not count; add comments=\"include\" to count them.\n An assertion whose scope holds no files fails; add allow-empty=\"true\" to allow it.\n\nExit codes\n 0 all assertions passed 1 an assertion failed 2 spec-guard could not run";
|
|
48
|
+
export declare const HELP = "spec-guard - Executable architecture assertions for Markdown specs & ADRs\n\nUsage\n spec-guard [patterns...] [options]\n\nPatterns\n Globs or paths to the Markdown specs to execute. A directory expands to the\n Markdown files inside it. Defaults to \"docs/**/*.md\" when omitted.\n\nOptions\n -r, --root <path> Codebase root that assertions are resolved against (default: cwd)\n -v, --verbose Print passing assertions too\n --fail-fast Stop at the first failing assertion\n --json Emit a machine-readable JSON report (same as --format json)\n --format <name> human | json | sarif (sarif uploads to GitHub code scanning)\n --engine <name> auto | rg | js (default: auto - scanner for small trees, ripgrep for big ones)\n --strict Treat analysis that could not be completed as a failure\n --allow-missing-targets\n Tolerate target paths that do not exist (they fail by default)\n --allow-empty-scope Tolerate assertions whose scope holds no files (they fail by default)\n --print-baseline Print the baseline=\"...\" that would exempt today's violations, and exit\n --no-default-skips Search .git, .hg, .svn and node_modules too\n --ignore-status Execute directives in draft, proposed and superseded documents too\n --include-specs Also count matches inside the spec files themselves\n --max-snippets <n> Failure snippets per assertion (default: 5)\n --concurrency <n> Assertions executed in parallel (default: 8)\n --allow-empty Exit 0 when no spec files matched (about the run, not an assertion)\n --color/--no-color Force colour on or off (NO_COLOR is honoured)\n -h, --help Show this help\n --version Print the version\n\nDirectives\n <!-- @assert-absence target=\"src/\" symbol=\"LegacyGateway\" exclude=\"src/legacy/**\" -->\n <!-- @assert-count target=\"src/\" symbol=\"SessionManager\" expected=\"1\" -->\n <!-- @assert-present file=\"SECURITY.md\" -->\n <!-- @assert-import-cycle target=\"src/\" types=\"ignore\" -->\n <!-- @assert-layers target=\"src/\" order=\"domain, application, infrastructure\" -->\n\n Matches inside comments do not count; add comments=\"include\" to count them.\n An assertion whose scope holds no files fails; add allow-empty=\"true\" to allow it.\n A document whose status is draft, proposed, rejected, deprecated or superseded\n is reported and not executed; --ignore-status runs it anyway.\n\nExit codes\n 0 all assertions passed 1 an assertion failed 2 spec-guard could not run";
|
|
48
49
|
/** Minimal, dependency-free argv parser. Supports `--flag value` and `--flag=value`. */
|
|
49
50
|
export declare function parseArgs(argv: readonly string[], cwd: string): CliOptions;
|
|
50
51
|
/** Runs the CLI and resolves to the process exit code. */
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAA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UAAW,SAAQ,KAAK;CAAG;AAExC,wBAAgB,OAAO,IAAI,MAAM,CAShC;AAED,eAAO,MAAM,IAAI,wlFA4C8D,CAAC;AAgChF,wFAAwF;AACxF,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAkI1E;AAYD,0DAA0D;AAC1D,wBAAsB,IAAI,CAAC,IAAI,GAAE,SAAS,MAAM,EAA0B,EAAE,EAAE,GAAE,KAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4EpH"}
|
package/dist/cli.js
CHANGED
|
@@ -48,6 +48,7 @@ Options
|
|
|
48
48
|
--allow-empty-scope Tolerate assertions whose scope holds no files (they fail by default)
|
|
49
49
|
--print-baseline Print the baseline="..." that would exempt today's violations, and exit
|
|
50
50
|
--no-default-skips Search .git, .hg, .svn and node_modules too
|
|
51
|
+
--ignore-status Execute directives in draft, proposed and superseded documents too
|
|
51
52
|
--include-specs Also count matches inside the spec files themselves
|
|
52
53
|
--max-snippets <n> Failure snippets per assertion (default: ${DEFAULT_MAX_SNIPPETS})
|
|
53
54
|
--concurrency <n> Assertions executed in parallel (default: ${DEFAULT_CONCURRENCY})
|
|
@@ -60,9 +61,13 @@ Directives
|
|
|
60
61
|
<!-- @assert-absence target="src/" symbol="LegacyGateway" exclude="src/legacy/**" -->
|
|
61
62
|
<!-- @assert-count target="src/" symbol="SessionManager" expected="1" -->
|
|
62
63
|
<!-- @assert-present file="SECURITY.md" -->
|
|
64
|
+
<!-- @assert-import-cycle target="src/" types="ignore" -->
|
|
65
|
+
<!-- @assert-layers target="src/" order="domain, application, infrastructure" -->
|
|
63
66
|
|
|
64
67
|
Matches inside comments do not count; add comments="include" to count them.
|
|
65
68
|
An assertion whose scope holds no files fails; add allow-empty="true" to allow it.
|
|
69
|
+
A document whose status is draft, proposed, rejected, deprecated or superseded
|
|
70
|
+
is reported and not executed; --ignore-status runs it anyway.
|
|
66
71
|
|
|
67
72
|
Exit codes
|
|
68
73
|
0 all assertions passed 1 an assertion failed 2 spec-guard could not run`;
|
|
@@ -106,6 +111,7 @@ export function parseArgs(argv, cwd) {
|
|
|
106
111
|
engine: 'auto',
|
|
107
112
|
allowMissingTargets: false,
|
|
108
113
|
defaultSkips: true,
|
|
114
|
+
ignoreStatus: false,
|
|
109
115
|
strictTargets: false,
|
|
110
116
|
allowEmptyScope: false,
|
|
111
117
|
printBaseline: false,
|
|
@@ -179,6 +185,9 @@ export function parseArgs(argv, cwd) {
|
|
|
179
185
|
case '--no-default-skips':
|
|
180
186
|
options.defaultSkips = false;
|
|
181
187
|
break;
|
|
188
|
+
case '--ignore-status':
|
|
189
|
+
options.ignoreStatus = true;
|
|
190
|
+
break;
|
|
182
191
|
case '--include-specs':
|
|
183
192
|
options.includeSpecs = true;
|
|
184
193
|
break;
|
|
@@ -257,6 +266,7 @@ export async function main(argv = process.argv.slice(2), io = defaultIO()) {
|
|
|
257
266
|
allowMissingTargets: options.allowMissingTargets,
|
|
258
267
|
allowEmptyScope: options.allowEmptyScope,
|
|
259
268
|
defaultSkips: options.defaultSkips,
|
|
269
|
+
ignoreStatus: options.ignoreStatus,
|
|
260
270
|
strictTargets: options.strictTargets,
|
|
261
271
|
includeSpecs: options.includeSpecs,
|
|
262
272
|
concurrency: options.concurrency,
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvH,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGtF,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AAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;IACnD,CAAC;IAED,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;QAC1B,0EAA0E;QAC1E,8CAA8C;QAC9C,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC;IAC3C,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAC/B,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;SAAM,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QACrC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAChC,CAAC;SAAM,CAAC;QACN,EAAE,CAAC,MAAM,CACP,YAAY,CACV,MAAM,EACN;YACE,KAAK,EAAE,cAAc,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC;YACjE,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,KAAK,EAAE,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC;SAC9B,EACD,OAAO,CAAC,WAAW,CACpB,CACF,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC;AAC3C,CAAC"}
|
package/dist/graph.d.ts
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The import graph behind `@assert-import-cycle`.
|
|
3
|
+
*
|
|
4
|
+
* Pure: no filesystem, no reading. The runner walks and tokenizes; everything
|
|
5
|
+
* here is a function of the references it was handed and the list of files the
|
|
6
|
+
* walk produced. That is the one thing ADR-0011 changed about resolution. A
|
|
7
|
+
* specifier is still turned into a path by arithmetic alone, as ADR-0005
|
|
8
|
+
* requires - but the path may now be compared with a set the run already holds,
|
|
9
|
+
* and that membership test is what gives a reference a file to point at.
|
|
10
|
+
*
|
|
11
|
+
* Layering lives elsewhere, in `layers.ts`, and on purpose. A layering rule
|
|
12
|
+
* matches names and never needs to know which file a reference is; a cycle
|
|
13
|
+
* cannot be seen without knowing exactly that. The two rest on different
|
|
14
|
+
* foundations, and keeping them in different modules keeps either from
|
|
15
|
+
* borrowing the other's.
|
|
16
|
+
*/
|
|
17
|
+
import { type ModuleReference } from './imports.js';
|
|
18
|
+
/**
|
|
19
|
+
* Every file a relative specifier might mean, most likely first.
|
|
20
|
+
*
|
|
21
|
+
* The whole resolver, and deliberately short enough to read in one go: the
|
|
22
|
+
* TypeScript source of an emitted extension, the path as written, the path
|
|
23
|
+
* with an extension, the directory's index. No `tsconfig` paths, no `exports`
|
|
24
|
+
* maps, no guessing at a build - ADR-0011 has the table and the reasons.
|
|
25
|
+
*/
|
|
26
|
+
export declare function candidates(resolved: string): string[];
|
|
27
|
+
/**
|
|
28
|
+
* Where a reference leads, as far as the graph is concerned.
|
|
29
|
+
*
|
|
30
|
+
* `edge` has a file. The other four do not, and they are distinguished because
|
|
31
|
+
* only one of them is a hole in the answer: `outside`, `not-code` and
|
|
32
|
+
* `external` are references the graph was never meant to follow, while
|
|
33
|
+
* `unresolved` is one it should have followed and could not.
|
|
34
|
+
*/
|
|
35
|
+
export type Resolution = {
|
|
36
|
+
kind: 'edge';
|
|
37
|
+
file: string;
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'outside';
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'not-code';
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'external';
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'unresolved';
|
|
46
|
+
};
|
|
47
|
+
export interface GraphScope {
|
|
48
|
+
/** The graph's nodes: JS and TS files in scope, root-relative, POSIX. */
|
|
49
|
+
nodes: ReadonlySet<string>;
|
|
50
|
+
/** Every file the walk produced, whatever its language. */
|
|
51
|
+
walked: ReadonlySet<string>;
|
|
52
|
+
/** Whether a root-relative path lies under one of the assertion's targets. */
|
|
53
|
+
covers: (relativePath: string) => boolean;
|
|
54
|
+
/** Whether a root-relative path is left out by the assertion's `exclude`. */
|
|
55
|
+
excluded: (relativePath: string) => boolean;
|
|
56
|
+
}
|
|
57
|
+
/** Resolves one specifier written in `importingFile` against the graph's scope. */
|
|
58
|
+
export declare function resolveReference(specifier: string, importingFile: string, scope: GraphScope): Resolution;
|
|
59
|
+
/** Whether a path is a file the graph can hold. */
|
|
60
|
+
export declare function isGraphFile(relativePath: string): boolean;
|
|
61
|
+
export interface GraphInput {
|
|
62
|
+
/** Root-relative path of the importing file. */
|
|
63
|
+
file: string;
|
|
64
|
+
references: readonly ModuleReference[];
|
|
65
|
+
}
|
|
66
|
+
export interface Unresolved {
|
|
67
|
+
file: string;
|
|
68
|
+
reference: ModuleReference;
|
|
69
|
+
}
|
|
70
|
+
export interface ImportGraph {
|
|
71
|
+
/** Every node, in path order. */
|
|
72
|
+
nodes: string[];
|
|
73
|
+
/** Out-edges of each node that has any, in path order, without duplicates. */
|
|
74
|
+
successors: Map<string, string[]>;
|
|
75
|
+
/** The first reference, in source order, that produced each edge. */
|
|
76
|
+
via: Map<string, ModuleReference>;
|
|
77
|
+
/** References that should have produced an edge and did not. */
|
|
78
|
+
unresolved: Unresolved[];
|
|
79
|
+
}
|
|
80
|
+
/** The key `via` stores an edge under. */
|
|
81
|
+
export declare function edgeKey(from: string, to: string): string;
|
|
82
|
+
/**
|
|
83
|
+
* Builds the graph from each file's references.
|
|
84
|
+
*
|
|
85
|
+
* Type-only references are left out when `includeTypes` is false, which is the
|
|
86
|
+
* difference between the coupling question and the runtime one - erased imports
|
|
87
|
+
* create no load-order cycle.
|
|
88
|
+
*/
|
|
89
|
+
export declare function buildGraph(inputs: readonly GraphInput[], scope: GraphScope, includeTypes: boolean): ImportGraph;
|
|
90
|
+
/**
|
|
91
|
+
* Tarjan's strongly connected components, iteratively.
|
|
92
|
+
*
|
|
93
|
+
* The recursive form is the textbook one and recurses once per node on a
|
|
94
|
+
* dependency chain, so a long enough chain - a generated barrel file will make
|
|
95
|
+
* one - overflows the stack. Here the call stack is an explicit array of frames,
|
|
96
|
+
* each remembering how far through its out-edges it had got.
|
|
97
|
+
*
|
|
98
|
+
* Every component is returned, including the single nodes that are not in any
|
|
99
|
+
* cycle; `cyclicComponents` is the filter.
|
|
100
|
+
*/
|
|
101
|
+
export declare function stronglyConnected(nodes: readonly string[], successors: ReadonlyMap<string, readonly string[]>): string[][];
|
|
102
|
+
/**
|
|
103
|
+
* The components that contain a cycle, each in path order, ordered by first
|
|
104
|
+
* member.
|
|
105
|
+
*
|
|
106
|
+
* A component of one node is a cycle only if that node imports itself. The
|
|
107
|
+
* ordering is for the report: the same tree yields the same list, whichever
|
|
108
|
+
* order the walk or the tokenizer happened to finish in.
|
|
109
|
+
*/
|
|
110
|
+
export declare function cyclicComponents(graph: Pick<ImportGraph, 'nodes' | 'successors'>): string[][];
|
|
111
|
+
/**
|
|
112
|
+
* One concrete cycle through a component: the shortest through its first file.
|
|
113
|
+
*
|
|
114
|
+
* A component is a set, and nobody fixes a set. What someone changes is an
|
|
115
|
+
* import, so the report has to name the imports that close a loop. Breadth-first
|
|
116
|
+
* from the first file, confined to the component - a node outside it cannot lead
|
|
117
|
+
* back, so searching there costs time and cannot change the answer - and the
|
|
118
|
+
* first node reached that imports the start closes the shortest loop.
|
|
119
|
+
*
|
|
120
|
+
* Returned with the start at both ends: `[a, b, a]`, or `[a, a]` for a file that
|
|
121
|
+
* imports itself.
|
|
122
|
+
*/
|
|
123
|
+
export declare function witness(component: readonly string[], successors: ReadonlyMap<string, readonly string[]>): string[];
|
|
124
|
+
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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E,eAAe,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,iCAAiC;IACjC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,8EAA8E;IAC9E,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC,qEAAqE;IACrE,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAClC,gEAAgE;IAChE,UAAU,EAAE,UAAU,EAAE,CAAC;CAC1B;AAED,0CAA0C;AAC1C,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,GAAG,WAAW,CAsB/G;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE,CAiD1H;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,YAAY,CAAC,GAAG,MAAM,EAAE,EAAE,CAU7F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAyBlH"}
|
package/dist/graph.js
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The import graph behind `@assert-import-cycle`.
|
|
3
|
+
*
|
|
4
|
+
* Pure: no filesystem, no reading. The runner walks and tokenizes; everything
|
|
5
|
+
* here is a function of the references it was handed and the list of files the
|
|
6
|
+
* walk produced. That is the one thing ADR-0011 changed about resolution. A
|
|
7
|
+
* specifier is still turned into a path by arithmetic alone, as ADR-0005
|
|
8
|
+
* requires - but the path may now be compared with a set the run already holds,
|
|
9
|
+
* and that membership test is what gives a reference a file to point at.
|
|
10
|
+
*
|
|
11
|
+
* Layering lives elsewhere, in `layers.ts`, and on purpose. A layering rule
|
|
12
|
+
* matches names and never needs to know which file a reference is; a cycle
|
|
13
|
+
* cannot be seen without knowing exactly that. The two rest on different
|
|
14
|
+
* foundations, and keeping them in different modules keeps either from
|
|
15
|
+
* borrowing the other's.
|
|
16
|
+
*/
|
|
17
|
+
import path from 'node:path';
|
|
18
|
+
import { comparePaths } from './engine.js';
|
|
19
|
+
import { JS_EXTENSIONS } from './imports.js';
|
|
20
|
+
/* --------------------------------------------------------------- resolution */
|
|
21
|
+
/** What an emitted extension was compiled from, in the order TypeScript tries. */
|
|
22
|
+
const SOURCE_EXTENSIONS = {
|
|
23
|
+
'.js': ['.ts', '.tsx'],
|
|
24
|
+
'.jsx': ['.tsx'],
|
|
25
|
+
'.mjs': ['.mts'],
|
|
26
|
+
'.cjs': ['.cts'],
|
|
27
|
+
};
|
|
28
|
+
/** Appended to an extensionless path, and to `/index`, in TypeScript's order. */
|
|
29
|
+
const APPENDED_EXTENSIONS = ['.ts', '.tsx', '.d.ts', '.js', '.jsx', '.mjs', '.cjs', '.mts', '.cts'];
|
|
30
|
+
/**
|
|
31
|
+
* Every file a relative specifier might mean, most likely first.
|
|
32
|
+
*
|
|
33
|
+
* The whole resolver, and deliberately short enough to read in one go: the
|
|
34
|
+
* TypeScript source of an emitted extension, the path as written, the path
|
|
35
|
+
* with an extension, the directory's index. No `tsconfig` paths, no `exports`
|
|
36
|
+
* maps, no guessing at a build - ADR-0011 has the table and the reasons.
|
|
37
|
+
*/
|
|
38
|
+
export function candidates(resolved) {
|
|
39
|
+
const extension = path.posix.extname(resolved);
|
|
40
|
+
const stem = resolved.slice(0, resolved.length - extension.length);
|
|
41
|
+
return [
|
|
42
|
+
...(SOURCE_EXTENSIONS[extension] ?? []).map((source) => `${stem}${source}`),
|
|
43
|
+
resolved,
|
|
44
|
+
...APPENDED_EXTENSIONS.map((appended) => `${resolved}${appended}`),
|
|
45
|
+
...APPENDED_EXTENSIONS.map((appended) => `${resolved}/index${appended}`),
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
function isRelative(specifier) {
|
|
49
|
+
return specifier === '.' || specifier === '..' || specifier.startsWith('./') || specifier.startsWith('../');
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A non-relative specifier that no package could be named.
|
|
53
|
+
*
|
|
54
|
+
* `#` is Node's prefix for imports private to the importing package, and `@/`,
|
|
55
|
+
* `~/` and a leading `/` are not valid package names. Something written that way
|
|
56
|
+
* has to be an alias for code inside the project, so an edge that cannot be
|
|
57
|
+
* followed is missing rather than absent. This is the only inference in the
|
|
58
|
+
* resolver, and it is made from npm's naming rules, not from anyone's config.
|
|
59
|
+
*/
|
|
60
|
+
function cannotBePackage(specifier) {
|
|
61
|
+
return /^(?:#|@\/|~\/|\/)/.test(specifier);
|
|
62
|
+
}
|
|
63
|
+
/** Resolves one specifier written in `importingFile` against the graph's scope. */
|
|
64
|
+
export function resolveReference(specifier, importingFile, scope) {
|
|
65
|
+
if (!isRelative(specifier)) {
|
|
66
|
+
return cannotBePackage(specifier) ? { kind: 'unresolved' } : { kind: 'external' };
|
|
67
|
+
}
|
|
68
|
+
const resolved = path.posix.join(path.posix.dirname(importingFile), specifier).replace(/\/$/, '');
|
|
69
|
+
const names = candidates(resolved);
|
|
70
|
+
const file = names.find((candidate) => scope.nodes.has(candidate));
|
|
71
|
+
if (file !== undefined)
|
|
72
|
+
return { kind: 'edge', file };
|
|
73
|
+
// Every name for `exclude`, not only the path as written: `exclude="src/b.ts"`
|
|
74
|
+
// names the file and `./b.js` is what imports it, and tested against the
|
|
75
|
+
// specifier alone an excluded file looked like a broken import and failed
|
|
76
|
+
// --strict. Targets need no such care - a candidate only ever appends to the
|
|
77
|
+
// path, so it is under a target exactly when the path is.
|
|
78
|
+
if (!scope.covers(resolved) || names.some(scope.excluded))
|
|
79
|
+
return { kind: 'outside' };
|
|
80
|
+
// Membership, not an extension list. `./styles.css` that exists is not code;
|
|
81
|
+
// `./widget.service` that does not exist is a broken import, whatever its
|
|
82
|
+
// suffix happens to look like.
|
|
83
|
+
if (scope.walked.has(resolved))
|
|
84
|
+
return { kind: 'not-code' };
|
|
85
|
+
return { kind: 'unresolved' };
|
|
86
|
+
}
|
|
87
|
+
/** Whether a path is a file the graph can hold. */
|
|
88
|
+
export function isGraphFile(relativePath) {
|
|
89
|
+
return JS_EXTENSIONS.has(path.posix.extname(relativePath));
|
|
90
|
+
}
|
|
91
|
+
/** The key `via` stores an edge under. */
|
|
92
|
+
export function edgeKey(from, to) {
|
|
93
|
+
return `${from}\n${to}`;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Builds the graph from each file's references.
|
|
97
|
+
*
|
|
98
|
+
* Type-only references are left out when `includeTypes` is false, which is the
|
|
99
|
+
* difference between the coupling question and the runtime one - erased imports
|
|
100
|
+
* create no load-order cycle.
|
|
101
|
+
*/
|
|
102
|
+
export function buildGraph(inputs, scope, includeTypes) {
|
|
103
|
+
const targets = new Map();
|
|
104
|
+
const via = new Map();
|
|
105
|
+
const unresolved = [];
|
|
106
|
+
for (const { file, references } of inputs) {
|
|
107
|
+
for (const reference of references) {
|
|
108
|
+
if (reference.typeOnly && !includeTypes)
|
|
109
|
+
continue;
|
|
110
|
+
const resolution = resolveReference(reference.specifier, file, scope);
|
|
111
|
+
if (resolution.kind === 'unresolved')
|
|
112
|
+
unresolved.push({ file, reference });
|
|
113
|
+
if (resolution.kind !== 'edge')
|
|
114
|
+
continue;
|
|
115
|
+
const out = targets.get(file) ?? new Set();
|
|
116
|
+
targets.set(file, out);
|
|
117
|
+
out.add(resolution.file);
|
|
118
|
+
const key = edgeKey(file, resolution.file);
|
|
119
|
+
if (!via.has(key))
|
|
120
|
+
via.set(key, reference);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
const successors = new Map([...targets].map(([file, out]) => [file, [...out].sort(comparePaths)]));
|
|
124
|
+
return { nodes: [...scope.nodes].sort(comparePaths), successors, via, unresolved };
|
|
125
|
+
}
|
|
126
|
+
/* ------------------------------------------------------------------- cycles */
|
|
127
|
+
/**
|
|
128
|
+
* Tarjan's strongly connected components, iteratively.
|
|
129
|
+
*
|
|
130
|
+
* The recursive form is the textbook one and recurses once per node on a
|
|
131
|
+
* dependency chain, so a long enough chain - a generated barrel file will make
|
|
132
|
+
* one - overflows the stack. Here the call stack is an explicit array of frames,
|
|
133
|
+
* each remembering how far through its out-edges it had got.
|
|
134
|
+
*
|
|
135
|
+
* Every component is returned, including the single nodes that are not in any
|
|
136
|
+
* cycle; `cyclicComponents` is the filter.
|
|
137
|
+
*/
|
|
138
|
+
export function stronglyConnected(nodes, successors) {
|
|
139
|
+
const index = new Map();
|
|
140
|
+
const low = new Map();
|
|
141
|
+
const stack = [];
|
|
142
|
+
const onStack = new Set();
|
|
143
|
+
const components = [];
|
|
144
|
+
const visit = (node) => {
|
|
145
|
+
const order = index.size;
|
|
146
|
+
index.set(node, order);
|
|
147
|
+
low.set(node, order);
|
|
148
|
+
stack.push(node);
|
|
149
|
+
onStack.add(node);
|
|
150
|
+
return { node, next: 0 };
|
|
151
|
+
};
|
|
152
|
+
for (const start of nodes) {
|
|
153
|
+
if (index.has(start))
|
|
154
|
+
continue;
|
|
155
|
+
const frames = [visit(start)];
|
|
156
|
+
while (frames.length > 0) {
|
|
157
|
+
const frame = frames[frames.length - 1];
|
|
158
|
+
const out = successors.get(frame.node) ?? [];
|
|
159
|
+
if (frame.next < out.length) {
|
|
160
|
+
const next = out[frame.next++];
|
|
161
|
+
if (!index.has(next))
|
|
162
|
+
frames.push(visit(next));
|
|
163
|
+
else if (onStack.has(next))
|
|
164
|
+
low.set(frame.node, Math.min(low.get(frame.node), index.get(next)));
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
frames.pop();
|
|
168
|
+
const parent = frames[frames.length - 1];
|
|
169
|
+
if (parent)
|
|
170
|
+
low.set(parent.node, Math.min(low.get(parent.node), low.get(frame.node)));
|
|
171
|
+
if (low.get(frame.node) === index.get(frame.node)) {
|
|
172
|
+
const component = [];
|
|
173
|
+
let member;
|
|
174
|
+
do {
|
|
175
|
+
member = stack.pop();
|
|
176
|
+
onStack.delete(member);
|
|
177
|
+
component.push(member);
|
|
178
|
+
} while (member !== frame.node);
|
|
179
|
+
components.push(component);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return components;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* The components that contain a cycle, each in path order, ordered by first
|
|
187
|
+
* member.
|
|
188
|
+
*
|
|
189
|
+
* A component of one node is a cycle only if that node imports itself. The
|
|
190
|
+
* ordering is for the report: the same tree yields the same list, whichever
|
|
191
|
+
* order the walk or the tokenizer happened to finish in.
|
|
192
|
+
*/
|
|
193
|
+
export function cyclicComponents(graph) {
|
|
194
|
+
return stronglyConnected(graph.nodes, graph.successors)
|
|
195
|
+
.filter((component) => {
|
|
196
|
+
const first = component[0];
|
|
197
|
+
// A file with no imports is not in the map at all; `?.` says so rather
|
|
198
|
+
// than inventing an empty list for it to be absent from.
|
|
199
|
+
return component.length > 1 || graph.successors.get(first)?.includes(first) === true;
|
|
200
|
+
})
|
|
201
|
+
.map((component) => component.sort(comparePaths))
|
|
202
|
+
.sort((a, b) => comparePaths(a[0], b[0]));
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* One concrete cycle through a component: the shortest through its first file.
|
|
206
|
+
*
|
|
207
|
+
* A component is a set, and nobody fixes a set. What someone changes is an
|
|
208
|
+
* import, so the report has to name the imports that close a loop. Breadth-first
|
|
209
|
+
* from the first file, confined to the component - a node outside it cannot lead
|
|
210
|
+
* back, so searching there costs time and cannot change the answer - and the
|
|
211
|
+
* first node reached that imports the start closes the shortest loop.
|
|
212
|
+
*
|
|
213
|
+
* Returned with the start at both ends: `[a, b, a]`, or `[a, a]` for a file that
|
|
214
|
+
* imports itself.
|
|
215
|
+
*/
|
|
216
|
+
export function witness(component, successors) {
|
|
217
|
+
const start = component[0];
|
|
218
|
+
const members = new Set(component);
|
|
219
|
+
const previous = new Map();
|
|
220
|
+
const queue = [start];
|
|
221
|
+
// No `?? []` on these lookups. Every file in a cyclic component imports at
|
|
222
|
+
// least one other file in it - that is what being in one means - so the
|
|
223
|
+
// fallback could never be taken, and a branch nothing can reach reads exactly
|
|
224
|
+
// like one that something can.
|
|
225
|
+
const out = (node) => successors.get(node);
|
|
226
|
+
for (let at = 0; at < queue.length; at++) {
|
|
227
|
+
const node = queue[at];
|
|
228
|
+
for (const next of out(node)) {
|
|
229
|
+
if (!members.has(next) || previous.has(next))
|
|
230
|
+
continue;
|
|
231
|
+
previous.set(next, node);
|
|
232
|
+
queue.push(next);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
const last = queue.find((node) => out(node).includes(start));
|
|
236
|
+
const loop = [start];
|
|
237
|
+
for (let node = last; node !== start; node = previous.get(node))
|
|
238
|
+
loop.splice(1, 0, node);
|
|
239
|
+
return [...loop, start];
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAwB,MAAM,cAAc,CAAC;AAEnE,gFAAgF;AAEhF,kFAAkF;AAClF,MAAM,iBAAiB,GAAgD;IACrE,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE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AAM,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IACnG,OAAO,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -23,12 +23,16 @@ export { analyzeJavaScript, analyzeSource, createImportIndex, extractReferences,
|
|
|
23
23
|
export type { AnalysisNote, FileImports, ImportIndex, ModuleReference, NoteKind, ReferenceKind } from './imports.js';
|
|
24
24
|
export { analyzePolyglot, expandUsePath, languageFor, literalValue, logicalLines, matchingClose, normalizeModule, Reader, MAX_EXPANSION, POLYGLOT_EXTENSIONS, } from './polyglot.js';
|
|
25
25
|
export type { ModuleLanguage } from './polyglot.js';
|
|
26
|
+
export { buildGraph, candidates, cyclicComponents, edgeKey, isGraphFile, resolveReference, stronglyConnected, witness, } from './graph.js';
|
|
27
|
+
export type { GraphInput, GraphScope, ImportGraph, Resolution, Unresolved } from './graph.js';
|
|
28
|
+
export { checkLayers, layerMatcher } from './layers.js';
|
|
29
|
+
export type { LayerInput, LayerReport, LayerViolation } from './layers.js';
|
|
26
30
|
export { lineStarts, locate, maskRanges } from './text.js';
|
|
27
|
-
export { maskCode, parseAttributes, parseDirectives } from './parser.js';
|
|
31
|
+
export { maskCode, parseAttributes, parseDirectives, parseStatus, INACTIVE_STATUSES } from './parser.js';
|
|
28
32
|
export type { ParseContext } from './parser.js';
|
|
29
33
|
export { applyBaseline, createScopeProbe, executeAssertion, resolveDirective, runSpecGuard, DEFAULT_CONCURRENCY, DEFAULT_MAX_SNIPPETS, } from './runner.js';
|
|
30
34
|
export type { ResolveContext, RunOptions, RunResult } from './runner.js';
|
|
31
35
|
export { createPainter, formatBaselines, formatJson, formatReport, formatSarif, shouldUseAscii, shouldUseColor } from './reporter.js';
|
|
32
36
|
export type { ReporterOptions } from './reporter.js';
|
|
33
|
-
export type { Assertion, AssertionResult, BaselineEntry, Bounds, Directive, DirectiveError, DirectiveKind, EngineName, ImportQuery, MatchLocation, ParseResult, RatchetMode, RunReport, RunSummary, SearchOptions, SearchResult, SourceLocation, StaleBaselineEntry, } from './types.js';
|
|
37
|
+
export type { Assertion, AssertionResult, BaselineEntry, Bounds, Directive, DirectiveError, DirectiveKind, EngineName, ImportQuery, InactiveSpec, MatchLocation, ParseResult, RatchetMode, RunReport, RunSummary, SearchOptions, SearchResult, SourceLocation, SpecStatus, StaleBaselineEntry, } from './types.js';
|
|
34
38
|
//# 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":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACxG,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEhE,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,WAAW,EACX,YAAY,EACZ,MAAM,EACN,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,OAAO,EACP,SAAS,GACV,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,W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
CHANGED
|
@@ -17,8 +17,10 @@ export { compareDirents, createExcludeMatcher, createGlobMatcher, defaultDirecto
|
|
|
17
17
|
export { createScope, isBinary, mergeLedgers, tallyLedger, LedgerBuilder, DEFAULT_SCOPE, DEFAULT_SKIPPED_DIRECTORIES, MAX_LEDGER_ENTRIES, SCAN_EVERYTHING, UNCERTAIN_REASONS, } from './scope.js';
|
|
18
18
|
export { analyzeJavaScript, analyzeSource, createImportIndex, extractReferences, resolveModule, resolveSpecifier, tokenize, ANALYSABLE_EXTENSIONS, JS_EXTENSIONS, } from './imports.js';
|
|
19
19
|
export { analyzePolyglot, expandUsePath, languageFor, literalValue, logicalLines, matchingClose, normalizeModule, Reader, MAX_EXPANSION, POLYGLOT_EXTENSIONS, } from './polyglot.js';
|
|
20
|
+
export { buildGraph, candidates, cyclicComponents, edgeKey, isGraphFile, resolveReference, stronglyConnected, witness, } from './graph.js';
|
|
21
|
+
export { checkLayers, layerMatcher } from './layers.js';
|
|
20
22
|
export { lineStarts, locate, maskRanges } from './text.js';
|
|
21
|
-
export { maskCode, parseAttributes, parseDirectives } from './parser.js';
|
|
23
|
+
export { maskCode, parseAttributes, parseDirectives, parseStatus, INACTIVE_STATUSES } from './parser.js';
|
|
22
24
|
export { applyBaseline, createScopeProbe, executeAssertion, resolveDirective, runSpecGuard, DEFAULT_CONCURRENCY, DEFAULT_MAX_SNIPPETS, } from './runner.js';
|
|
23
25
|
export { createPainter, formatBaselines, formatJson, formatReport, formatSarif, shouldUseAscii, shouldUseColor } from './reporter.js';
|
|
24
26
|
//# 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;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGxG,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAWrB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,OAAO,EACP,SAAS,GACV,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,aAAa,EACb,aAAa,EACb,2BAA2B,EAC3B,kBAAkB,EAClB,eAAe,EACf,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,qBAAqB,EACrB,aAAa,GACd,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,eAAe,EACf,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,eAAe,EACf,MAAM,EACN,aAAa,EACb,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE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