@md-code/follow-architecture 0.3.0 → 0.3.3
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 +38 -0
- package/README.md +1341 -472
- package/dist/args.d.ts +4 -0
- package/dist/args.js +18 -1
- package/dist/bin/follow-architecture.js +3 -3
- package/dist/closure-project.d.ts +4 -0
- package/dist/closure-project.js +122 -0
- package/dist/code-entities/classify.d.ts +11 -0
- package/dist/code-entities/classify.js +45 -0
- package/dist/code-entities/connector.d.ts +8 -0
- package/dist/code-entities/connector.js +119 -0
- package/dist/code-entities/entities.d.ts +9 -0
- package/dist/{code-roles/roles.js → code-entities/entities.js} +81 -54
- package/dist/code-entities/project.d.ts +21 -0
- package/dist/code-entities/project.js +249 -0
- package/dist/code-entities/walk.d.ts +31 -0
- package/dist/code-entities/walk.js +95 -0
- package/dist/config-options.d.ts +23 -0
- package/dist/config-options.js +18 -1
- package/dist/config-project.js +10 -2
- package/dist/config-report.d.ts +1 -1
- package/dist/config-report.js +20 -3
- package/dist/config-rule.d.ts +25 -0
- package/dist/config-rule.js +89 -6
- package/dist/config-state.d.ts +14 -3
- package/dist/config-state.js +180 -17
- package/dist/config.d.ts +25 -0
- package/dist/css/index.d.ts +11 -7
- package/dist/css/index.js +124 -23
- package/dist/css/syntax/css/gate.js +5 -5
- package/dist/css/syntax/css/index.d.ts +1 -1
- package/dist/css/syntax/css/index.js +1 -1
- package/dist/css/syntax/css/reference.d.ts +1 -1
- package/dist/css/syntax/css/reference.js +15 -3
- package/dist/css/syntax/language.d.ts +1 -1
- package/dist/css/syntax/language.js +4 -2
- package/dist/css/syntax/scss/index.d.ts +2 -2
- package/dist/css/syntax/scss/index.js +1 -1
- package/dist/css/syntax/scss/reference.d.ts +1 -1
- package/dist/css/syntax/scss/reference.js +7 -1
- package/dist/css/syntax/styled/document.d.ts +3 -3
- package/dist/css/syntax/styled/document.js +17 -7
- package/dist/css/syntax/styled/markup.d.ts +1 -1
- package/dist/css/syntax/styled/markup.js +22 -14
- package/dist/css/syntax/styled/tags.d.ts +2 -0
- package/dist/css/syntax/styled/tags.js +22 -0
- package/dist/css/syntax/styled/template.js +10 -4
- package/dist/css/syntax/tailwind/tailwind.js +4 -4
- package/dist/css/value/check.d.ts +1 -1
- package/dist/css/value/check.js +1 -1
- package/dist/css/value/expression/arithmetic.d.ts +2 -2
- package/dist/css/value/expression/arithmetic.js +7 -3
- package/dist/css/value/expression/block.d.ts +2 -2
- package/dist/css/value/expression/block.js +4 -3
- package/dist/css/value/expression/conditional.d.ts +2 -2
- package/dist/css/value/expression/conditional.js +1 -1
- package/dist/css/value/expression/index.d.ts +2 -2
- package/dist/css/value/expression/index.js +10 -6
- package/dist/css/value/expression/map.d.ts +2 -2
- package/dist/css/value/expression/map.js +2 -2
- package/dist/css/value/object/index.d.ts +2 -2
- package/dist/css/value/object/index.js +14 -4
- package/dist/css/value/object/members.d.ts +2 -2
- package/dist/css/value/object/node.js +9 -4
- package/dist/css/value/object/path.d.ts +3 -3
- package/dist/css/value/object/path.js +10 -4
- package/dist/css/value/pieces.d.ts +3 -3
- package/dist/css/value/pieces.js +14 -4
- package/dist/css/value/resolve.js +15 -5
- package/dist/css/value/scope.d.ts +3 -2
- package/dist/css/value/scope.js +25 -7
- package/dist/css/value/substitute.js +43 -11
- package/dist/entities/architecture.d.ts +28 -25
- package/dist/entities/ast/assignments-raw.d.ts +1 -1
- package/dist/entities/ast/assignments-raw.js +61 -8
- package/dist/entities/ast/assignments-tagged.d.ts +1 -1
- package/dist/entities/ast/assignments-tagged.js +22 -7
- package/dist/entities/ast/assignments.d.ts +1 -1
- package/dist/entities/ast/assignments.js +6 -4
- package/dist/entities/ast/branches.d.ts +1 -1
- package/dist/entities/ast/calls.d.ts +1 -1
- package/dist/entities/ast/calls.js +19 -3
- package/dist/entities/ast/classes.d.ts +1 -1
- package/dist/entities/ast/classes.js +5 -1
- package/dist/entities/ast/comments.d.ts +3 -2
- package/dist/entities/ast/comments.js +47 -17
- package/dist/entities/ast/declaration.d.ts +1 -1
- package/dist/entities/ast/depth.d.ts +2 -2
- package/dist/entities/ast/depth.js +15 -8
- package/dist/entities/ast/enums.d.ts +1 -1
- package/dist/entities/ast/export-chain.d.ts +15 -0
- package/dist/entities/ast/export-chain.js +171 -0
- package/dist/entities/ast/file-exports.d.ts +1 -1
- package/dist/entities/ast/file-exports.js +26 -3
- package/dist/entities/ast/file-facts.d.ts +6 -3
- package/dist/entities/ast/file-facts.js +33 -4
- package/dist/entities/ast/file-imports.d.ts +1 -1
- package/dist/entities/ast/file-imports.js +26 -3
- package/dist/entities/ast/file.d.ts +2 -2
- package/dist/entities/ast/file.js +2 -1
- package/dist/entities/ast/functions.d.ts +1 -1
- package/dist/entities/ast/functions.js +13 -4
- package/dist/entities/ast/heritage.d.ts +1 -1
- package/dist/entities/ast/heritage.js +9 -1
- package/dist/entities/ast/index.d.ts +6 -3
- package/dist/entities/ast/index.js +82 -26
- package/dist/entities/ast/kind.d.ts +1 -1
- package/dist/entities/ast/kind.js +7 -1
- package/dist/entities/ast/modifiers.d.ts +1 -1
- package/dist/entities/ast/modifiers.js +4 -4
- package/dist/entities/ast/project.js +33 -2
- package/dist/entities/ast/properties.d.ts +1 -1
- package/dist/entities/ast/properties.js +10 -5
- package/dist/entities/ast/resolve.d.ts +1 -1
- package/dist/entities/ast/resolve.js +4 -4
- package/dist/entities/ast/tree.d.ts +4 -2
- package/dist/entities/ast/tree.js +184 -17
- package/dist/entities/ast/types.d.ts +1 -1
- package/dist/entities/ast/types.js +2 -1
- package/dist/entities/ast/usage.d.ts +1 -1
- package/dist/entities/ast/usage.js +1 -1
- package/dist/entities/ast/variables.d.ts +1 -1
- package/dist/entities/context.d.ts +4 -4
- package/dist/entities/facts.d.ts +36 -13
- package/dist/entities/findings.d.ts +3 -3
- package/dist/entities/kinds.d.ts +1 -1
- package/dist/entities/kinds.js +131 -30
- package/dist/entities/location/homes.d.ts +10 -10
- package/dist/entities/location/homes.js +74 -48
- package/dist/entities/location/place.d.ts +1 -1
- package/dist/entities/location/place.js +10 -3
- package/dist/entities/location/where.d.ts +8 -6
- package/dist/entities/location/where.js +79 -30
- package/dist/entities/location.d.ts +3 -3
- package/dist/entities/location.js +17 -17
- package/dist/entities/operators.js +1 -1
- package/dist/entities/overview/data.d.ts +6 -6
- package/dist/entities/overview/decision.d.ts +11 -11
- package/dist/entities/overview/finding.d.ts +10 -10
- package/dist/entities/overview/graph.d.ts +28 -11
- package/dist/entities/overview/input.d.ts +2 -2
- package/dist/entities/overview/summaries.d.ts +17 -15
- package/dist/entities/queries.d.ts +1 -1
- package/dist/entities/queries.js +72 -12
- package/dist/entities/repair.d.ts +1 -1
- package/dist/entities/repair.js +8 -2
- package/dist/entities/schema.d.ts +17 -3
- package/dist/entities/schema.js +74 -16
- package/dist/entities/story.d.ts +5 -5
- package/dist/entities/structure-facts.d.ts +1 -1
- package/dist/entities/token.d.ts +4 -4
- package/dist/entities/tree/build.d.ts +4 -3
- package/dist/entities/tree/build.js +95 -44
- package/dist/entities/tree/entries.d.ts +3 -3
- package/dist/entities/tree/entries.js +41 -16
- package/dist/entities/tree/index.d.ts +2 -2
- package/dist/entities/tree/index.js +1 -1
- package/dist/entities/tree/match.d.ts +2 -2
- package/dist/entities/tree/match.js +9 -5
- package/dist/fa-index.d.ts +16 -0
- package/dist/fa-index.js +165 -0
- package/dist/fa-open.d.ts +51 -0
- package/dist/fa-open.js +232 -0
- package/dist/fa-store.d.ts +22 -0
- package/dist/fa-store.js +222 -0
- package/dist/fa-values.d.ts +37 -0
- package/dist/fa-values.js +104 -0
- package/dist/facts-record.d.ts +45 -0
- package/dist/facts-record.js +287 -0
- package/dist/frameworks/angular/index.d.ts +2 -2
- package/dist/frameworks/angular/index.js +2 -1
- package/dist/frameworks/facet.d.ts +3 -1
- package/dist/frameworks/facet.js +13 -0
- package/dist/frameworks/index.d.ts +1 -1
- package/dist/frameworks/index.js +8 -4
- package/dist/frameworks/react/index.d.ts +2 -2
- package/dist/frameworks/react/index.js +33 -10
- package/dist/frameworks/test/index.d.ts +6 -0
- package/dist/frameworks/test/index.js +157 -0
- package/dist/frameworks/vue/index.d.ts +2 -2
- package/dist/frameworks/vue/index.js +2 -1
- package/dist/ignore.d.ts +3 -0
- package/dist/ignore.js +48 -0
- package/dist/index-file.d.ts +43 -0
- package/dist/index-file.js +218 -0
- package/dist/index-run.d.ts +39 -0
- package/dist/index-run.js +217 -0
- package/dist/index-zone.d.ts +25 -0
- package/dist/index-zone.js +209 -0
- package/dist/main.d.ts +5 -2
- package/dist/main.js +207 -34
- package/dist/nodes/child-entities.d.ts +3 -0
- package/dist/nodes/child-entities.js +12 -0
- package/dist/nodes/children.d.ts +4 -4
- package/dist/nodes/children.js +54 -11
- package/dist/nodes/finally/emit.d.ts +3 -3
- package/dist/nodes/finally/emit.js +26 -10
- package/dist/nodes/finally/entities.d.ts +13 -0
- package/dist/nodes/finally/entities.js +42 -0
- package/dist/nodes/finally/index.d.ts +6 -6
- package/dist/nodes/finally/index.js +8 -8
- package/dist/nodes/finally/queries.d.ts +2 -2
- package/dist/nodes/finally/queries.js +7 -4
- package/dist/nodes/finally/relations-access.d.ts +2 -2
- package/dist/nodes/finally/relations-access.js +22 -18
- package/dist/nodes/finally/relations-edge.d.ts +5 -5
- package/dist/nodes/finally/relations-edge.js +67 -44
- package/dist/nodes/finally/relations-group.d.ts +7 -7
- package/dist/nodes/finally/relations-group.js +28 -25
- package/dist/nodes/finally/relations.d.ts +2 -2
- package/dist/nodes/finally/relations.js +16 -12
- package/dist/nodes/finally/required.d.ts +3 -3
- package/dist/nodes/finally/required.js +9 -7
- package/dist/nodes/finally/violation.d.ts +2 -2
- package/dist/nodes/similar.d.ts +3 -3
- package/dist/nodes/similar.js +61 -49
- package/dist/piece-forms.d.ts +9 -0
- package/dist/piece-forms.js +68 -0
- package/dist/{pipeline-roles.d.ts → pipeline-entities.d.ts} +2 -2
- package/dist/{pipeline-roles.js → pipeline-entities.js} +32 -28
- package/dist/pipeline-facts.d.ts +4 -3
- package/dist/pipeline-facts.js +47 -55
- package/dist/{pipeline-unroled.d.ts → pipeline-unclassified.d.ts} +2 -2
- package/dist/{pipeline-unroled.js → pipeline-unclassified.js} +58 -63
- package/dist/pipeline.js +19 -64
- package/dist/release-file.d.ts +3 -0
- package/dist/release-file.js +13 -0
- package/dist/report/asks.d.ts +3 -3
- package/dist/report/asks.js +16 -6
- package/dist/report/configErrors.d.ts +55 -27
- package/dist/report/configErrors.js +81 -35
- package/dist/report/errorTypes/codes/structure.d.ts +1 -1
- package/dist/report/errorTypes/codes/structure.js +9 -9
- package/dist/report/errorTypes/decision-maker.d.ts +5 -5
- package/dist/report/errorTypes/decision-maker.js +4 -4
- package/dist/report/errorTypes/destinations.d.ts +5 -5
- package/dist/report/errorTypes/destinations.js +52 -34
- package/dist/report/errorTypes/finding-type.d.ts +3 -3
- package/dist/report/errorTypes/index.d.ts +1 -1
- package/dist/report/errorTypes/types/fileContents.d.ts +4 -4
- package/dist/report/errorTypes/types/fileContents.js +11 -5
- package/dist/report/errorTypes/types/unknownEntity.d.ts +9 -0
- package/dist/report/errorTypes/types/{unknownRole.js → unknownEntity.js} +12 -7
- package/dist/report/errorTypes/types/wrongAction.d.ts +5 -5
- package/dist/report/errorTypes/types/wrongAction.js +18 -13
- package/dist/report/errorTypes/types/wrongPlacement.d.ts +4 -4
- package/dist/report/errorTypes/types/wrongPlacement.js +19 -9
- package/dist/report/errorTypes/vocabulary/ids.d.ts +2 -2
- package/dist/report/errorTypes/vocabulary/ids.js +3 -3
- package/dist/report/errorTypes/vocabulary/phrases.d.ts +2 -2
- package/dist/report/errorTypes/vocabulary/phrases.js +39 -26
- package/dist/report/errorTypes/vocabulary/places.d.ts +3 -3
- package/dist/report/errorTypes/vocabulary/places.js +13 -13
- package/dist/report/finding-from.d.ts +3 -3
- package/dist/report/finding-from.js +14 -9
- package/dist/report/notices.d.ts +6 -1
- package/dist/report/notices.js +46 -20
- package/dist/report/observed.d.ts +19 -0
- package/dist/report/observed.js +87 -0
- package/dist/report/render-report.d.ts +1 -1
- package/dist/report/render-report.js +33 -30
- package/dist/report/user-report/build/bundle.js +9 -0
- package/dist/report/user-report/build/bundle.prebuilt.js +799 -297
- package/dist/report/user-report/data/collect.d.ts +2 -2
- package/dist/report/user-report/data/collect.js +15 -12
- package/dist/report/user-report/data/entities.d.ts +7 -0
- package/dist/report/user-report/data/{roles.js → entities.js} +27 -22
- package/dist/report/user-report/data/{role-examples.d.ts → entity-examples.d.ts} +3 -3
- package/dist/report/user-report/data/entity-examples.js +126 -0
- package/dist/report/user-report/data/{role-filters.d.ts → entity-filters.d.ts} +2 -2
- package/dist/report/user-report/data/{role-filters.js → entity-filters.js} +7 -7
- package/dist/report/user-report/data/entity-marks.d.ts +5 -0
- package/dist/report/user-report/data/{role-marks.js → entity-marks.js} +11 -11
- package/dist/report/user-report/data/file-tree.d.ts +3 -3
- package/dist/report/user-report/data/file-tree.js +13 -5
- package/dist/report/user-report/data/finding-boundary.d.ts +4 -4
- package/dist/report/user-report/data/finding-boundary.js +2 -2
- package/dist/report/user-report/data/finding-plan.d.ts +5 -5
- package/dist/report/user-report/data/finding-plan.js +10 -10
- package/dist/report/user-report/data/finding-title.d.ts +2 -2
- package/dist/report/user-report/data/finding-title.js +8 -8
- package/dist/report/user-report/data/findings.d.ts +4 -4
- package/dist/report/user-report/data/findings.js +30 -20
- package/dist/report/user-report/data/graph-edges.d.ts +4 -4
- package/dist/report/user-report/data/graph-edges.js +19 -19
- package/dist/report/user-report/data/graph-entities.d.ts +6 -0
- package/dist/report/user-report/data/graph-entities.js +158 -0
- package/dist/report/user-report/data/graph-helpers.d.ts +5 -5
- package/dist/report/user-report/data/graph-helpers.js +15 -15
- package/dist/report/user-report/data/graph.d.ts +5 -4
- package/dist/report/user-report/data/graph.js +28 -21
- package/dist/report/user-report/data/nodes.d.ts +2 -2
- package/dist/report/user-report/data/nodes.js +16 -16
- package/dist/report/user-report/data/rules.d.ts +7 -0
- package/dist/report/user-report/data/{invariants.js → rules.js} +13 -13
- package/dist/report/user-report/data/scan.d.ts +1 -1
- package/dist/report/user-report/data/scan.js +2 -2
- package/dist/report/user-report/html/shell.d.ts +1 -1
- package/dist/report/user-report/html/shell.js +1 -1
- package/dist/report/user-report/index.d.ts +1 -1
- package/dist/report/user-report/shared/describe.d.ts +1 -1
- package/dist/report/user-report/shared/describe.js +6 -6
- package/dist/rules/index.d.ts +7 -0
- package/dist/{invariants → rules}/index.js +85 -57
- package/dist/{invariants → rules}/list-vars.d.ts +2 -2
- package/dist/{invariants → rules}/list-vars.js +9 -3
- package/dist/{invariants → rules}/name.js +2 -2
- package/dist/rules/normalize.d.ts +5 -0
- package/dist/{invariants → rules}/normalize.js +35 -32
- package/dist/{invariants → rules}/vars.d.ts +9 -7
- package/dist/{invariants → rules}/vars.js +5 -5
- package/dist/scan-run.d.ts +20 -0
- package/dist/scan-run.js +130 -0
- package/dist/scripts/audit-report.js +2 -2
- package/dist/usage-index.d.ts +4 -0
- package/dist/usage-index.js +272 -0
- package/dist/usage-mode.d.ts +7 -0
- package/dist/usage-mode.js +16 -0
- package/dist/usage-pass.d.ts +19 -0
- package/dist/usage-pass.js +136 -0
- package/dist/usage-prepare.d.ts +2 -0
- package/dist/usage-prepare.js +22 -0
- package/dist/usage-sweep.d.ts +10 -0
- package/dist/usage-sweep.js +254 -0
- package/dist/utils/aliases.d.ts +22 -0
- package/dist/utils/aliases.js +163 -0
- package/dist/utils/classify.d.ts +2 -2
- package/dist/utils/classify.js +4 -4
- package/dist/utils/distinct.js +4 -2
- package/dist/utils/files.js +24 -30
- package/dist/utils/fixpoint.js +2 -2
- package/dist/utils/host.d.ts +1 -1
- package/dist/utils/host.js +4 -1
- package/dist/utils/imports.js +66 -12
- package/dist/utils/keyed.js +2 -2
- package/dist/utils/map-record.js +2 -2
- package/dist/utils/packages.d.ts +15 -0
- package/dist/utils/packages.js +197 -0
- package/dist/utils/path-label.js +3 -1
- package/dist/utils/pattern.d.ts +5 -4
- package/dist/utils/pattern.js +38 -8
- package/dist/utils/permission.d.ts +3 -3
- package/dist/utils/permission.js +4 -2
- package/dist/utils/plural.js +2 -2
- package/dist/utils/qualified.js +4 -4
- package/dist/utils/rank.js +2 -2
- package/dist/utils/record.js +1 -1
- package/dist/utils/search.js +7 -2
- package/dist/utils/speak.js +1 -1
- package/dist/utils/split.js +14 -1
- package/dist/utils/template.d.ts +1 -1
- package/dist/utils/template.js +1 -1
- package/dist/utils/tokenize.js +6 -1
- package/dist/utils/typed-field.js +2 -2
- package/dist/utils/verdicts.js +1 -1
- package/entities/operators.ts +1 -1
- package/package.json +101 -90
- package/report/errorTypes/vocabulary/ids.ts +7 -2
- package/report/errorTypes/vocabulary/phrases.ts +47 -27
- package/report/errorTypes/vocabulary/places.ts +21 -16
- package/report/user-report/shared/describe.ts +7 -7
- package/dist/code-roles/classify.d.ts +0 -11
- package/dist/code-roles/classify.js +0 -43
- package/dist/code-roles/connector.d.ts +0 -5
- package/dist/code-roles/connector.js +0 -114
- package/dist/code-roles/project.d.ts +0 -12
- package/dist/code-roles/project.js +0 -122
- package/dist/code-roles/roles.d.ts +0 -8
- package/dist/invariants/index.d.ts +0 -6
- package/dist/invariants/normalize.d.ts +0 -4
- package/dist/nodes/child-roles.d.ts +0 -3
- package/dist/nodes/child-roles.js +0 -12
- package/dist/nodes/finally/roles.d.ts +0 -13
- package/dist/nodes/finally/roles.js +0 -41
- package/dist/report/errorTypes/types/unknownRole.d.ts +0 -9
- package/dist/report/user-report/data/graph-roles.d.ts +0 -5
- package/dist/report/user-report/data/graph-roles.js +0 -71
- package/dist/report/user-report/data/invariants.d.ts +0 -7
- package/dist/report/user-report/data/role-examples.js +0 -94
- package/dist/report/user-report/data/role-marks.d.ts +0 -5
- package/dist/report/user-report/data/roles.d.ts +0 -7
- /package/dist/{invariants → rules}/name.d.ts +0 -0
|
@@ -1,43 +1,81 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.entryKey = exports.fillTemplate = exports.labelOf = exports.accessorLabel = exports.checkWhere = exports.matchesWhere = exports.parseWhere = exports.parseWhereEntry = exports.toList = void 0;
|
|
4
27
|
// THE `where` GRAMMAR — one implementation of "here" / "by this code", shared by
|
|
5
|
-
// node `
|
|
28
|
+
// node `entity:` homes, entity actions and rule `where`/`except`.
|
|
6
29
|
//
|
|
7
30
|
// An entry is one of:
|
|
8
|
-
// {
|
|
9
|
-
// {
|
|
31
|
+
// { entity } code that IS that entity (its file declares it)
|
|
32
|
+
// { entity, same } …and in the SAME node instance as the target
|
|
10
33
|
// { node } any file under that declared node
|
|
11
|
-
// { template } a path built from the tree (
|
|
34
|
+
// { template } a path built from the tree (entity homes)
|
|
12
35
|
// "glob" a path pattern
|
|
13
36
|
// { <filter> } any filter over the file's facts
|
|
14
|
-
const pattern_1 = require("
|
|
15
|
-
const
|
|
16
|
-
const
|
|
37
|
+
const pattern_1 = require("@md-code/follow-architecture/utils/pattern");
|
|
38
|
+
const aliases_1 = require("@md-code/follow-architecture/utils/aliases");
|
|
39
|
+
const match_1 = require("@md-code/follow-architecture/entities/tree/match");
|
|
40
|
+
const queries_1 = require("@md-code/follow-architecture/entities/queries");
|
|
17
41
|
const place_1 = require("./place");
|
|
18
|
-
const
|
|
42
|
+
const configError = __importStar(require("@md-code/follow-architecture/report/configErrors"));
|
|
43
|
+
const field_1 = require("@md-code/follow-architecture/utils/field");
|
|
19
44
|
Object.defineProperty(exports, "toList", { enumerable: true, get: function () { return field_1.toList; } });
|
|
20
45
|
const queryMatcher = () => queries_1.matches;
|
|
21
46
|
const readObjEntry = (entry) => {
|
|
22
|
-
if (
|
|
23
|
-
|
|
47
|
+
if ("role" in entry)
|
|
48
|
+
throw configError.unknownWhereKey({ key: "role" });
|
|
49
|
+
if (entry.entity != null)
|
|
50
|
+
return {
|
|
51
|
+
type: "entity",
|
|
52
|
+
entity: String(entry.entity),
|
|
53
|
+
same: Boolean(entry.same),
|
|
54
|
+
via: entry.via === "import" ? "import" : null,
|
|
55
|
+
};
|
|
24
56
|
if (entry.node != null)
|
|
25
57
|
return { type: "node", node: String(entry.node) };
|
|
26
58
|
if (entry.template != null)
|
|
27
59
|
return { type: "template", template: String(entry.template) };
|
|
28
60
|
return { type: "query", query: entry };
|
|
29
61
|
};
|
|
30
|
-
// Normalize one entry. `
|
|
31
|
-
// names
|
|
32
|
-
|
|
62
|
+
// Normalize one entry. `entities` (a Set of declared slugs) lets a bare string that
|
|
63
|
+
// names an entity become an entity reference; without it every string is a glob.
|
|
64
|
+
// `aliases` turns a `@`-prefixed glob or a `location` filter into the repo path it
|
|
65
|
+
// names — ONE reading of the alias map, shared with the import resolver and the
|
|
66
|
+
// node tree.
|
|
67
|
+
const parseWhereEntry = (entry, entities = null, aliases = null) => {
|
|
33
68
|
if (typeof entry === "string")
|
|
34
|
-
return
|
|
69
|
+
return entities?.has(entry) && !entry.includes("/") && !entry.includes("*")
|
|
70
|
+
? { type: "entity", entity: entry, same: false }
|
|
71
|
+
: { type: "glob", glob: (0, aliases_1.expandPattern)(aliases, entry) };
|
|
35
72
|
if (!(0, queries_1.isObj)(entry))
|
|
36
73
|
return { type: "query", query: entry };
|
|
37
|
-
|
|
74
|
+
const rewritten = (0, aliases_1.expandLocationFilters)(entry, aliases);
|
|
75
|
+
return readObjEntry((0, queries_1.isObj)(rewritten) ? rewritten : entry);
|
|
38
76
|
};
|
|
39
77
|
exports.parseWhereEntry = parseWhereEntry;
|
|
40
|
-
const parseWhere = (value,
|
|
78
|
+
const parseWhere = (value, entities = null, aliases = null) => (0, field_1.toList)(value).map((e) => parseWhereEntry(e, entities, aliases));
|
|
41
79
|
exports.parseWhere = parseWhere;
|
|
42
80
|
const patternOf = (entry) => {
|
|
43
81
|
if (entry.type === "glob")
|
|
@@ -67,15 +105,15 @@ const sameCaps = (source, target) => {
|
|
|
67
105
|
}
|
|
68
106
|
return true;
|
|
69
107
|
};
|
|
70
|
-
// `{
|
|
71
|
-
const
|
|
108
|
+
// `{ entity }` — the file declares that entity, and (for `same`) in the SAME node.
|
|
109
|
+
const matchesEntity = (...args) => {
|
|
72
110
|
const [entry, rel, arch, facts, targetCaps] = args;
|
|
73
|
-
if (!(facts?.
|
|
111
|
+
if (!(facts?.entities ?? []).includes(entry.entity ?? ""))
|
|
74
112
|
return false;
|
|
75
113
|
if (!entry.same)
|
|
76
114
|
return true;
|
|
77
115
|
const nodeM = (0, match_1.deepestMatch)(rel, arch);
|
|
78
|
-
return sameCaps(nodeM ? (0, match_1.matchNode)(nodeM.node, rel)?.caps ?? {} : {}, targetCaps);
|
|
116
|
+
return sameCaps(nodeM ? ((0, match_1.matchNode)(nodeM.node, rel)?.caps ?? {}) : {}, targetCaps);
|
|
79
117
|
};
|
|
80
118
|
// `{ node }` — the path is inside that declared node.
|
|
81
119
|
const matchesNodeEntry = (entry, rel, arch) => {
|
|
@@ -92,8 +130,8 @@ const matchesWhere = (...args) => {
|
|
|
92
130
|
const pattern = patternOf(entry);
|
|
93
131
|
if (pattern != null)
|
|
94
132
|
return capsAgree(pattern, rel, targetCaps);
|
|
95
|
-
if (entry.type === "
|
|
96
|
-
return
|
|
133
|
+
if (entry.type === "entity")
|
|
134
|
+
return matchesEntity(entry, rel, arch, facts, targetCaps);
|
|
97
135
|
if (entry.type === "node")
|
|
98
136
|
return matchesNodeEntry(entry, rel, arch);
|
|
99
137
|
// The scope IS the facts (plus the file and the tree), so a `$ref` can compare
|
|
@@ -111,13 +149,20 @@ const checkWhere = (...args) => {
|
|
|
111
149
|
};
|
|
112
150
|
exports.checkWhere = checkWhere;
|
|
113
151
|
// How code is reached through a declared accessor without an import.
|
|
114
|
-
|
|
152
|
+
// A typed door is spelled by its parameter: `(value: DefaultTheme)`.
|
|
153
|
+
const typeLabel = (type) => `(value: ${type.slice(type.lastIndexOf(".") + 1)})`;
|
|
154
|
+
const accessorLabel = (e) => {
|
|
155
|
+
const segments = e?.segments ?? [];
|
|
156
|
+
if (!segments.length && e?.type)
|
|
157
|
+
return typeLabel(e.type);
|
|
158
|
+
return e?.scope === "function" || e?.scope === "method" ? `${segments.join(".")}(…)` : segments.join(".");
|
|
159
|
+
};
|
|
115
160
|
exports.accessorLabel = accessorLabel;
|
|
116
161
|
const kindOf = (entry) => {
|
|
117
162
|
if (entry.type)
|
|
118
163
|
return entry.type;
|
|
119
|
-
if (entry.
|
|
120
|
-
return "
|
|
164
|
+
if (entry.entity)
|
|
165
|
+
return "entity";
|
|
121
166
|
if (entry.node)
|
|
122
167
|
return "node";
|
|
123
168
|
if (entry.glob)
|
|
@@ -127,15 +172,15 @@ const kindOf = (entry) => {
|
|
|
127
172
|
return null;
|
|
128
173
|
};
|
|
129
174
|
const orText = (value, fallback) => value ?? fallback;
|
|
130
|
-
const
|
|
175
|
+
const entityLabel = (entry) => `entity ${orText(entry.entity, "")}${entry.same ? " (same instance)" : ""}`;
|
|
131
176
|
// How one `where` entry reads inside a sentence — the ONE place that knows the
|
|
132
177
|
// entry vocabulary.
|
|
133
178
|
const labelOf = (entry) => {
|
|
134
179
|
if (!entry)
|
|
135
180
|
return "—";
|
|
136
181
|
const kind = kindOf(entry);
|
|
137
|
-
if (kind === "
|
|
138
|
-
return
|
|
182
|
+
if (kind === "entity")
|
|
183
|
+
return entityLabel(entry);
|
|
139
184
|
if (kind === "node")
|
|
140
185
|
return `node ${orText(entry.node, "")}`;
|
|
141
186
|
if (kind === "glob")
|
|
@@ -183,7 +228,9 @@ const fillTemplate = (template, rel = null, caps = null) => {
|
|
|
183
228
|
if (template == null)
|
|
184
229
|
return null;
|
|
185
230
|
const segs = String(template).split("/");
|
|
186
|
-
const relSegs = String(rel ?? "")
|
|
231
|
+
const relSegs = String(rel ?? "")
|
|
232
|
+
.split("/")
|
|
233
|
+
.filter(Boolean);
|
|
187
234
|
const out = [];
|
|
188
235
|
for (let i = 0; i < segs.length; i += 1) {
|
|
189
236
|
const seg = segs[i];
|
|
@@ -210,7 +257,9 @@ const entryKey = (entry, rel, arch, facts) => {
|
|
|
210
257
|
return fileDir;
|
|
211
258
|
// A template that names a FAMILY (`…/actions/*.ts`) designates the folder the
|
|
212
259
|
// family lives in.
|
|
213
|
-
const star = String(template)
|
|
260
|
+
const star = String(template)
|
|
261
|
+
.split("/")
|
|
262
|
+
.findIndex((s) => s.includes("*"));
|
|
214
263
|
if (star === -1)
|
|
215
264
|
return filled;
|
|
216
265
|
return filled.split("/").slice(0, star).join("/") || fileDir;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldValue } from "
|
|
1
|
+
import type { FieldValue } from "@md-code/follow-architecture/utils/field";
|
|
2
2
|
import type { Arch, QueryScope, WhereEntry } from "./architecture";
|
|
3
3
|
type AsFilter = (loc: FieldValue, entry: FieldValue) => boolean;
|
|
4
4
|
declare const matchesLocation: (value: FieldValue, entry: FieldValue, scope?: QueryScope, asFilter?: AsFilter | null) => boolean;
|
|
@@ -10,7 +10,7 @@ declare const resolveLocation: (arch: Arch, location: WhereEntry | string | (Whe
|
|
|
10
10
|
declare const boxOfPlace: (arch: Arch, path: string | null | undefined) => string | null;
|
|
11
11
|
export { matchesLocation, resolveLocation, boxOfPlace };
|
|
12
12
|
export { wordsIn, nameOnly, segmentsOf, parentOf, leafOf, placeOf, placeholdersOf, dirOf } from "./location/place";
|
|
13
|
-
export { toList, parseWhereEntry, parseWhere, matchesWhere, checkWhere, accessorLabel, labelOf, fillTemplate, entryKey } from "./location/where";
|
|
14
|
-
export { homesOf, sharedPrefix, destinationsIn, destinationOf, placeFor,
|
|
13
|
+
export { toList, parseWhereEntry, parseWhere, matchesWhere, checkWhere, accessorLabel, labelOf, fillTemplate, entryKey, } from "./location/where";
|
|
14
|
+
export { homesOf, sharedPrefix, destinationsIn, destinationOf, placeFor, entityFitsAt, entitiesAtPath, homeForEntity, } from "./location/homes";
|
|
15
15
|
export type { Resolved };
|
|
16
16
|
export type { Caps } from "./location/where";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.homeForEntity = exports.entitiesAtPath = exports.entityFitsAt = exports.placeFor = exports.destinationOf = exports.destinationsIn = exports.sharedPrefix = exports.homesOf = exports.entryKey = exports.fillTemplate = exports.labelOf = exports.accessorLabel = exports.checkWhere = exports.matchesWhere = exports.parseWhere = exports.parseWhereEntry = exports.toList = exports.dirOf = exports.placeholdersOf = exports.placeOf = exports.leafOf = exports.parentOf = exports.segmentsOf = exports.nameOnly = exports.wordsIn = exports.boxOfPlace = exports.resolveLocation = exports.matchesLocation = void 0;
|
|
4
4
|
// WHERE a piece of code is, and WHERE a rule points — one vocabulary, one
|
|
5
5
|
// implementation, used by both sides:
|
|
6
6
|
//
|
|
7
7
|
// • `matchesLocation(value, entry, { arch }, asFilter)` — the `location:`
|
|
8
8
|
// FILTER: "is this candidate / file / edge at that place?" (`"glob"`,
|
|
9
|
-
// `{ node }`, `{
|
|
9
|
+
// `{ node }`, `{ entity }`, or a query over the location itself).
|
|
10
10
|
// • `resolveLocation(arch, location, rel)` — the `fix.location` of a REPAIR:
|
|
11
11
|
// the place AND the box it is, for this file, asked of the tree.
|
|
12
12
|
//
|
|
@@ -14,9 +14,9 @@ exports.homeForRole = exports.rolesAtPath = exports.roleFitsAt = exports.placeFo
|
|
|
14
14
|
// "where" vocabulary live in sibling modules and are re-exported here, so every
|
|
15
15
|
// consumer keeps importing `entities/location`:
|
|
16
16
|
// • `./location/place` — ONE PATH, cut into its parts;
|
|
17
|
-
// • `./location/where` — the `where` grammar (
|
|
18
|
-
// • `./location/homes` — the
|
|
19
|
-
const pattern_1 = require("
|
|
17
|
+
// • `./location/where` — the `where` grammar (entities / nodes / globs / filters);
|
|
18
|
+
// • `./location/homes` — the entity → place answer.
|
|
19
|
+
const pattern_1 = require("@md-code/follow-architecture/utils/pattern");
|
|
20
20
|
const tree_1 = require("./tree");
|
|
21
21
|
const queries_1 = require("./queries");
|
|
22
22
|
const place_1 = require("./location/place");
|
|
@@ -32,7 +32,7 @@ const pathOf = (loc) => {
|
|
|
32
32
|
};
|
|
33
33
|
// The `arch` carried in a scope: a plain-data record may hold anything readable,
|
|
34
34
|
// but `arch` is the built model (compiled regexes), so it is recognised apart.
|
|
35
|
-
const isArch = (v) => v != null && typeof v === "object" && "nodes" in v && "
|
|
35
|
+
const isArch = (v) => v != null && typeof v === "object" && "nodes" in v && "entities" in v;
|
|
36
36
|
const isScopeRecord = (scope) => scope !== null && scope !== undefined && typeof scope === "object" && !Array.isArray(scope);
|
|
37
37
|
const archOf = (scope) => {
|
|
38
38
|
if (!isScopeRecord(scope))
|
|
@@ -46,7 +46,7 @@ const pathInNode = (arch, nodeSlug, itemPath) => {
|
|
|
46
46
|
return false;
|
|
47
47
|
return node.variants.some((v) => v.re.test(itemPath));
|
|
48
48
|
};
|
|
49
|
-
const
|
|
49
|
+
const pathInEntity = (arch, entity, itemPath) => (arch?.nodes.entityHomes[entity] ?? []).some((h) => (0, pattern_1.compilePattern)(h.template).re.test(itemPath));
|
|
50
50
|
// The `location:` filter. `value` is a candidate, a file fact, an edge or a bare
|
|
51
51
|
// path — they all answer the same question.
|
|
52
52
|
const matchesLocation = (value, entry, scope = {}, asFilter = null) => {
|
|
@@ -61,15 +61,15 @@ const matchesLocation = (value, entry, scope = {}, asFilter = null) => {
|
|
|
61
61
|
// `{ node: "slug" }` — the path is inside that node.
|
|
62
62
|
if ((0, queries_1.isObj)(entry) && typeof entry.node === "string")
|
|
63
63
|
return pathInNode(arch, entry.node, itemPath);
|
|
64
|
-
// `{
|
|
65
|
-
if ((0, queries_1.isObj)(entry) && typeof entry.
|
|
66
|
-
return
|
|
64
|
+
// `{ entity }` — the path is one of the places that entity is declared to live in.
|
|
65
|
+
if ((0, queries_1.isObj)(entry) && typeof entry.entity === "string")
|
|
66
|
+
return pathInEntity(arch, entry.entity, itemPath);
|
|
67
67
|
// A query over the location itself: `{ piece: { isNull: true } }`.
|
|
68
68
|
return asFilter ? asFilter(loc, entry) : true;
|
|
69
69
|
};
|
|
70
70
|
exports.matchesLocation = matchesLocation;
|
|
71
|
-
const
|
|
72
|
-
const hit = (0, homes_1.
|
|
71
|
+
const resolveEntity = (arch, entity, rel) => {
|
|
72
|
+
const hit = (0, homes_1.homeForEntity)(arch, entity, rel);
|
|
73
73
|
return hit?.node ? { node: hit.node, path: hit.path } : null;
|
|
74
74
|
};
|
|
75
75
|
const resolveNode = (arch, nodeSlug, rel) => {
|
|
@@ -85,8 +85,8 @@ const resolveOne = (arch, entry, rel) => {
|
|
|
85
85
|
return null;
|
|
86
86
|
if (typeof entry === "string")
|
|
87
87
|
return { path: entry, node: (0, tree_1.folderOwner)(arch, (0, place_1.dirOf)(entry))?.slug ?? null };
|
|
88
|
-
if (entry.
|
|
89
|
-
return
|
|
88
|
+
if (entry.entity)
|
|
89
|
+
return resolveEntity(arch, entry.entity, rel);
|
|
90
90
|
if (entry.node)
|
|
91
91
|
return resolveNode(arch, entry.node, rel);
|
|
92
92
|
return null;
|
|
@@ -135,6 +135,6 @@ Object.defineProperty(exports, "sharedPrefix", { enumerable: true, get: function
|
|
|
135
135
|
Object.defineProperty(exports, "destinationsIn", { enumerable: true, get: function () { return homes_2.destinationsIn; } });
|
|
136
136
|
Object.defineProperty(exports, "destinationOf", { enumerable: true, get: function () { return homes_2.destinationOf; } });
|
|
137
137
|
Object.defineProperty(exports, "placeFor", { enumerable: true, get: function () { return homes_2.placeFor; } });
|
|
138
|
-
Object.defineProperty(exports, "
|
|
139
|
-
Object.defineProperty(exports, "
|
|
140
|
-
Object.defineProperty(exports, "
|
|
138
|
+
Object.defineProperty(exports, "entityFitsAt", { enumerable: true, get: function () { return homes_2.entityFitsAt; } });
|
|
139
|
+
Object.defineProperty(exports, "entitiesAtPath", { enumerable: true, get: function () { return homes_2.entitiesAtPath; } });
|
|
140
|
+
Object.defineProperty(exports, "homeForEntity", { enumerable: true, get: function () { return homes_2.homeForEntity; } });
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SCALAR_OPS = exports.QUANTIFIERS = exports.CONTAINERS = void 0;
|
|
4
4
|
// The operator vocabulary AS THE REPORT READS IT: which keys stand for a list,
|
|
5
5
|
// which of them say "one of them", and how a scalar operator is spelled for a
|
|
6
|
-
// human. Two readers share it — the Node-side summarizer (`data/
|
|
6
|
+
// human. Two readers share it — the Node-side summarizer (`data/rules.js`)
|
|
7
7
|
// and the browser describer (`src/utils/describe.js`) — because they used to
|
|
8
8
|
// carry the same three tables twice and printed two different truths.
|
|
9
9
|
//
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AccessGraph } from "./graph";
|
|
2
2
|
import type { EnrichedFinding } from "./finding";
|
|
3
3
|
import type { FileTreeEntry } from "./file-tree";
|
|
4
|
-
import type {
|
|
4
|
+
import type { RuleSummary, NodeSummary, EntitySummary } from "./summaries";
|
|
5
5
|
type CountGroup = {
|
|
6
6
|
key: string;
|
|
7
7
|
count: number;
|
|
@@ -18,8 +18,8 @@ type OverviewStats = {
|
|
|
18
18
|
nodes: number;
|
|
19
19
|
folders: number;
|
|
20
20
|
fileNodes: number;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
entities: number;
|
|
22
|
+
rules: number;
|
|
23
23
|
findings: number;
|
|
24
24
|
filesWithFindings: number;
|
|
25
25
|
edges: number;
|
|
@@ -30,13 +30,13 @@ type OverviewData = {
|
|
|
30
30
|
stats: OverviewStats;
|
|
31
31
|
nodes: NodeSummary[];
|
|
32
32
|
access: AccessGraph;
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
entities: EntitySummary[];
|
|
34
|
+
rules: RuleSummary[];
|
|
35
35
|
findings: EnrichedFinding[];
|
|
36
36
|
fileTree: FileTreeEntry;
|
|
37
37
|
groups: {
|
|
38
38
|
byCategory: CountGroup[];
|
|
39
|
-
|
|
39
|
+
byRule: CountGroup[];
|
|
40
40
|
byNode: CountGroup[];
|
|
41
41
|
};
|
|
42
42
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { FieldValue } from "
|
|
2
|
-
import type { Arch } from "
|
|
3
|
-
import type { Finding } from "
|
|
1
|
+
import type { FieldValue } from "@md-code/follow-architecture/utils/field";
|
|
2
|
+
import type { Arch } from "@md-code/follow-architecture/entities/architecture";
|
|
3
|
+
import type { Finding } from "@md-code/follow-architecture/entities/findings";
|
|
4
4
|
import type { NodeSummary } from "./summaries";
|
|
5
|
-
import type { RelationToken } from "
|
|
5
|
+
import type { RelationToken } from "@md-code/follow-architecture/entities/token";
|
|
6
6
|
type Places = {
|
|
7
7
|
folderOf: (slug: string | null | undefined) => string | null;
|
|
8
8
|
pathOf: (slug: string) => string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
homeTemplates: (
|
|
12
|
-
homeFor: (
|
|
13
|
-
|
|
9
|
+
entities: () => string[];
|
|
10
|
+
entitiesAtPath: (rel: string) => string[];
|
|
11
|
+
homeTemplates: (entity: string) => string[];
|
|
12
|
+
homeFor: (entity: string, rel: string) => {
|
|
13
|
+
entity: string;
|
|
14
14
|
path: string;
|
|
15
15
|
folder: boolean;
|
|
16
16
|
concrete: boolean;
|
|
@@ -35,7 +35,7 @@ type CtxOwner = {
|
|
|
35
35
|
slug?: string;
|
|
36
36
|
path?: string;
|
|
37
37
|
paths?: string[];
|
|
38
|
-
|
|
38
|
+
entities?: string[];
|
|
39
39
|
} | null | undefined;
|
|
40
40
|
type CtxViolation = {
|
|
41
41
|
kind?: string;
|
|
@@ -54,7 +54,7 @@ type DecisionCtx = {
|
|
|
54
54
|
plan?: CtxPlan;
|
|
55
55
|
nodes?: NodeSummary[];
|
|
56
56
|
arch?: Arch;
|
|
57
|
-
|
|
57
|
+
rule?: string | null;
|
|
58
58
|
places: Places;
|
|
59
59
|
};
|
|
60
60
|
export type { Places, CtxPlan, CtxOwner, CtxViolation, DecisionCtx };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { RelationToken } from "
|
|
2
|
-
import type { Repair } from "
|
|
3
|
-
import type { Story } from "
|
|
4
|
-
import type { Place } from "
|
|
5
|
-
import type { FindingHighlight } from "
|
|
6
|
-
import type { Violation } from "
|
|
1
|
+
import type { RelationToken } from "@md-code/follow-architecture/entities/token";
|
|
2
|
+
import type { Repair } from "@md-code/follow-architecture/entities/repair";
|
|
3
|
+
import type { Story } from "@md-code/follow-architecture/entities/story";
|
|
4
|
+
import type { Place } from "@md-code/follow-architecture/entities/place";
|
|
5
|
+
import type { FindingHighlight } from "@md-code/follow-architecture/entities/findings";
|
|
6
|
+
import type { Violation } from "@md-code/follow-architecture/nodes/finally/violation";
|
|
7
7
|
type PlanPlace = Place;
|
|
8
8
|
type PlanRelation = Place & {
|
|
9
9
|
kind: string;
|
|
10
10
|
line: number | null;
|
|
11
11
|
};
|
|
12
12
|
type Plan = {
|
|
13
|
-
|
|
13
|
+
entity: string | null;
|
|
14
14
|
before: PlanPlace | null;
|
|
15
15
|
after: PlanPlace | null;
|
|
16
16
|
target: PlanPlace | null;
|
|
@@ -45,10 +45,10 @@ type EnrichedFinding = {
|
|
|
45
45
|
fixOptions: Repair[];
|
|
46
46
|
errorType: string;
|
|
47
47
|
ownerNode: string | null;
|
|
48
|
-
|
|
48
|
+
nodeEntities: string[];
|
|
49
49
|
ownerPaths: string[];
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
entity: string | null;
|
|
51
|
+
ruleId: string | null;
|
|
52
52
|
violation: FindingViolation | null;
|
|
53
53
|
boundary: Boundary | null;
|
|
54
54
|
plan: Plan;
|
|
@@ -8,38 +8,54 @@ type AccessEdge = {
|
|
|
8
8
|
toPath: string;
|
|
9
9
|
actor: string;
|
|
10
10
|
actorPath?: string;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
actorEntities?: string[];
|
|
12
|
+
actorEntity: string | null;
|
|
13
13
|
subject: string;
|
|
14
14
|
subjectPath?: string;
|
|
15
|
-
|
|
15
|
+
fromEntities?: string[];
|
|
16
16
|
same: boolean;
|
|
17
17
|
via: string;
|
|
18
18
|
target: string;
|
|
19
19
|
broken?: boolean;
|
|
20
20
|
brokenCount?: number;
|
|
21
21
|
option?: boolean;
|
|
22
|
+
count?: number;
|
|
23
|
+
sample?: ObservedPlace;
|
|
24
|
+
declared?: boolean;
|
|
25
|
+
};
|
|
26
|
+
type ObservedPlace = {
|
|
27
|
+
file: string;
|
|
28
|
+
line: number;
|
|
29
|
+
sentence: string;
|
|
30
|
+
};
|
|
31
|
+
type ObservedEdge = {
|
|
32
|
+
kind: string;
|
|
33
|
+
from: string;
|
|
34
|
+
to: string;
|
|
35
|
+
count: number;
|
|
36
|
+
broken: number;
|
|
37
|
+
sample: ObservedPlace;
|
|
22
38
|
};
|
|
23
39
|
type Unplaceable = {
|
|
24
40
|
kind: string;
|
|
25
|
-
|
|
41
|
+
targetEntity: string;
|
|
26
42
|
who: string;
|
|
27
43
|
};
|
|
28
44
|
type Mention = {
|
|
29
45
|
kind: string;
|
|
30
|
-
|
|
46
|
+
targetEntity: string;
|
|
31
47
|
targetPaths: string[];
|
|
32
48
|
};
|
|
33
49
|
type GraphViolation = {
|
|
34
50
|
kind: string;
|
|
35
51
|
from: string;
|
|
36
52
|
to: string;
|
|
37
|
-
|
|
53
|
+
entity: string;
|
|
38
54
|
file: string;
|
|
39
55
|
line: number;
|
|
40
56
|
title: string;
|
|
41
57
|
};
|
|
42
|
-
type
|
|
58
|
+
type EntityNode = {
|
|
43
59
|
slug: string;
|
|
44
60
|
name: string;
|
|
45
61
|
paths: string[];
|
|
@@ -53,13 +69,14 @@ type Adjacency = {
|
|
|
53
69
|
};
|
|
54
70
|
type AccessGraph = {
|
|
55
71
|
kinds: string[];
|
|
56
|
-
|
|
72
|
+
entities: string[];
|
|
57
73
|
edges: AccessEdge[];
|
|
58
74
|
violations: GraphViolation[];
|
|
59
75
|
unplaceable: Unplaceable[];
|
|
60
76
|
mentions: Record<string, Mention[]>;
|
|
61
77
|
byNode: Record<string, Adjacency>;
|
|
62
|
-
|
|
63
|
-
|
|
78
|
+
entityNodes: EntityNode[];
|
|
79
|
+
entityEdges: AccessEdge[];
|
|
80
|
+
observed: ObservedEdge[];
|
|
64
81
|
};
|
|
65
|
-
export type { AccessEdge, Unplaceable, Mention, GraphViolation,
|
|
82
|
+
export type { AccessEdge, ObservedEdge, ObservedPlace, Unplaceable, Mention, GraphViolation, EntityNode, Adjacency, AccessGraph, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Project } from "ts-morph";
|
|
2
|
-
import type { Arch } from "
|
|
3
|
-
import type { Finding } from "
|
|
2
|
+
import type { Arch } from "@md-code/follow-architecture/entities/architecture";
|
|
3
|
+
import type { Finding } from "@md-code/follow-architecture/entities/findings";
|
|
4
4
|
type OverviewInput = {
|
|
5
5
|
arch: Arch;
|
|
6
6
|
findings: Finding[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { FieldValue } from "
|
|
2
|
-
import type { Located } from "
|
|
3
|
-
import type {
|
|
1
|
+
import type { FieldValue } from "@md-code/follow-architecture/utils/field";
|
|
2
|
+
import type { Located } from "@md-code/follow-architecture/entities/facts";
|
|
3
|
+
import type { EntityDef, ReportObject } from "@md-code/follow-architecture/entities/architecture";
|
|
4
4
|
type Snippet = {
|
|
5
5
|
startLine: number;
|
|
6
6
|
lines: string[];
|
|
@@ -11,36 +11,38 @@ type MatchedRange = {
|
|
|
11
11
|
to: number;
|
|
12
12
|
why: string;
|
|
13
13
|
};
|
|
14
|
-
type
|
|
14
|
+
type EntityExample = Required<Pick<Located, "name" | "line">> & {
|
|
15
15
|
file: string;
|
|
16
16
|
rank: number;
|
|
17
17
|
code: Snippet | null;
|
|
18
18
|
matched: MatchedRange[];
|
|
19
19
|
};
|
|
20
|
-
type
|
|
20
|
+
type EntityHome = {
|
|
21
21
|
slug: string;
|
|
22
22
|
paths: string[];
|
|
23
23
|
label: string;
|
|
24
24
|
labels: string[];
|
|
25
25
|
};
|
|
26
|
-
type
|
|
26
|
+
type EntityAction = {
|
|
27
27
|
kind: string;
|
|
28
28
|
of: string | null;
|
|
29
29
|
from: string[];
|
|
30
30
|
scopeAccess: {
|
|
31
31
|
scope: string;
|
|
32
32
|
segments: string[];
|
|
33
|
+
type?: string;
|
|
34
|
+
entity?: string[];
|
|
33
35
|
}[];
|
|
34
36
|
};
|
|
35
|
-
type
|
|
37
|
+
type EntitySummary = Pick<EntityDef, "slug" | "name"> & {
|
|
36
38
|
infer: FieldValue;
|
|
37
39
|
report: {
|
|
38
40
|
message: string | null;
|
|
39
41
|
fix: string | null;
|
|
40
42
|
};
|
|
41
|
-
actions:
|
|
42
|
-
homes:
|
|
43
|
-
examples:
|
|
43
|
+
actions: EntityAction[];
|
|
44
|
+
homes: EntityHome[];
|
|
45
|
+
examples: EntityExample[];
|
|
44
46
|
exampleCount: number;
|
|
45
47
|
};
|
|
46
48
|
type NodeSummary = {
|
|
@@ -58,22 +60,22 @@ type NodeSummary = {
|
|
|
58
60
|
sample: ({
|
|
59
61
|
file: string;
|
|
60
62
|
} & Snippet) | null;
|
|
61
|
-
|
|
63
|
+
entities: string[];
|
|
62
64
|
closed?: boolean;
|
|
63
65
|
};
|
|
64
|
-
type
|
|
66
|
+
type RuleCondition = {
|
|
65
67
|
conditions: string[];
|
|
66
68
|
message: string | null;
|
|
67
69
|
fix: FieldValue | ReportObject["fix"];
|
|
68
70
|
};
|
|
69
|
-
type
|
|
71
|
+
type RuleSummary = {
|
|
70
72
|
id: string;
|
|
71
73
|
where: string[];
|
|
72
74
|
ignore: string[];
|
|
73
75
|
when: string[];
|
|
74
76
|
dedupeBy: string[];
|
|
75
77
|
report: string | null;
|
|
76
|
-
infer:
|
|
78
|
+
infer: RuleCondition[];
|
|
77
79
|
findingCount: number;
|
|
78
80
|
};
|
|
79
|
-
export type { Snippet, MatchedRange,
|
|
81
|
+
export type { Snippet, MatchedRange, EntityExample, EntityHome, EntityAction, EntitySummary, NodeSummary, RuleCondition, RuleSummary, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isObj, isList, type FieldValue } from "
|
|
1
|
+
import { isObj, isList, type FieldValue } from "@md-code/follow-architecture/utils/field";
|
|
2
2
|
import type { QueryFilter, QueryScope } from "./architecture";
|
|
3
3
|
declare const COMPOSITION_OPS: Set<string>;
|
|
4
4
|
declare const KNOWN_OPS: Set<string>;
|