@md-code/follow-architecture 0.3.0 → 0.3.2
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 +21 -0
- package/README.md +1310 -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 +132 -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} +98 -61
- package/dist/code-entities/project.d.ts +21 -0
- package/dist/code-entities/project.js +259 -0
- package/dist/code-entities/walk.d.ts +31 -0
- package/dist/code-entities/walk.js +105 -0
- package/dist/config-options.d.ts +23 -0
- package/dist/config-options.js +18 -1
- package/dist/config-project.js +27 -9
- package/dist/config-report.d.ts +1 -1
- package/dist/config-report.js +37 -10
- package/dist/config-rule.d.ts +25 -0
- package/dist/config-rule.js +106 -13
- package/dist/config-state.d.ts +14 -3
- package/dist/config-state.js +197 -24
- package/dist/config.d.ts +25 -0
- package/dist/css/index.d.ts +11 -7
- package/dist/css/index.js +141 -30
- 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 +18 -8
- 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 +21 -9
- package/dist/css/syntax/scss/index.d.ts +2 -2
- package/dist/css/syntax/scss/index.js +18 -8
- 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 +34 -14
- 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 +32 -15
- 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 +21 -11
- 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 +148 -37
- 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 +10 -8
- package/dist/entities/location/where.js +89 -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 +89 -19
- 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 +112 -51
- package/dist/entities/tree/entries.d.ts +4 -4
- 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 +26 -12
- 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 +242 -0
- package/dist/fa-store.d.ts +22 -0
- package/dist/fa-store.js +232 -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 +297 -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 +25 -11
- 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 +62 -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 +219 -0
- package/dist/main.d.ts +5 -2
- package/dist/main.js +223 -41
- 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 +64 -11
- package/dist/nodes/finally/emit.d.ts +4 -4
- 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 +78 -56
- 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 +64 -62
- 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.d.ts +1 -1
- 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 +21 -11
- 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/index.js +17 -7
- 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 +26 -7
- 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 +32 -19
- 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 +136 -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 +33 -23
- 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 +19 -9
- 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/index.js +17 -7
- 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/rules/normalize.js +108 -0
- 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 +19 -9
- package/dist/usage-index.d.ts +4 -0
- package/dist/usage-index.js +282 -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 +264 -0
- package/dist/utils/aliases.d.ts +22 -0
- package/dist/utils/aliases.js +173 -0
- package/dist/utils/classify.d.ts +2 -2
- package/dist/utils/classify.js +4 -4
- package/dist/utils/configs.js +17 -7
- package/dist/utils/distinct.js +4 -2
- package/dist/utils/files.js +41 -37
- 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 +83 -19
- 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 +207 -0
- package/dist/utils/path-label.js +3 -1
- package/dist/utils/pattern.d.ts +5 -4
- package/dist/utils/pattern.js +55 -15
- 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/invariants/normalize.js +0 -95
- 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,91 @@
|
|
|
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.entryKey = exports.fillTemplate = exports.labelOf = exports.accessorLabel = exports.checkWhere = exports.matchesWhere = exports.parseWhere = exports.parseWhereEntry = exports.toList = void 0;
|
|
4
37
|
// THE `where` GRAMMAR — one implementation of "here" / "by this code", shared by
|
|
5
|
-
// node `
|
|
38
|
+
// node `entity:` homes, entity actions and rule `where`/`except`.
|
|
6
39
|
//
|
|
7
40
|
// An entry is one of:
|
|
8
|
-
// {
|
|
9
|
-
// {
|
|
41
|
+
// { entity } code that IS that entity (its file declares it)
|
|
42
|
+
// { entity, same } …and in the SAME node instance as the target
|
|
10
43
|
// { node } any file under that declared node
|
|
11
|
-
// { template } a path built from the tree (
|
|
44
|
+
// { template } a path built from the tree (entity homes)
|
|
12
45
|
// "glob" a path pattern
|
|
13
46
|
// { <filter> } any filter over the file's facts
|
|
14
|
-
const pattern_1 = require("
|
|
15
|
-
const
|
|
16
|
-
const
|
|
47
|
+
const pattern_1 = require("@md-code/follow-architecture/utils/pattern");
|
|
48
|
+
const aliases_1 = require("@md-code/follow-architecture/utils/aliases");
|
|
49
|
+
const match_1 = require("@md-code/follow-architecture/entities/tree/match");
|
|
50
|
+
const queries_1 = require("@md-code/follow-architecture/entities/queries");
|
|
17
51
|
const place_1 = require("./place");
|
|
18
|
-
const
|
|
52
|
+
const configError = __importStar(require("@md-code/follow-architecture/report/configErrors"));
|
|
53
|
+
const field_1 = require("@md-code/follow-architecture/utils/field");
|
|
19
54
|
Object.defineProperty(exports, "toList", { enumerable: true, get: function () { return field_1.toList; } });
|
|
20
55
|
const queryMatcher = () => queries_1.matches;
|
|
21
56
|
const readObjEntry = (entry) => {
|
|
22
|
-
if (
|
|
23
|
-
|
|
57
|
+
if ("role" in entry)
|
|
58
|
+
throw configError.unknownWhereKey({ key: "role" });
|
|
59
|
+
if (entry.entity != null)
|
|
60
|
+
return {
|
|
61
|
+
type: "entity",
|
|
62
|
+
entity: String(entry.entity),
|
|
63
|
+
same: Boolean(entry.same),
|
|
64
|
+
via: entry.via === "import" ? "import" : null,
|
|
65
|
+
};
|
|
24
66
|
if (entry.node != null)
|
|
25
67
|
return { type: "node", node: String(entry.node) };
|
|
26
68
|
if (entry.template != null)
|
|
27
69
|
return { type: "template", template: String(entry.template) };
|
|
28
70
|
return { type: "query", query: entry };
|
|
29
71
|
};
|
|
30
|
-
// Normalize one entry. `
|
|
31
|
-
// names
|
|
32
|
-
|
|
72
|
+
// Normalize one entry. `entities` (a Set of declared slugs) lets a bare string that
|
|
73
|
+
// names an entity become an entity reference; without it every string is a glob.
|
|
74
|
+
// `aliases` turns a `@`-prefixed glob or a `location` filter into the repo path it
|
|
75
|
+
// names — ONE reading of the alias map, shared with the import resolver and the
|
|
76
|
+
// node tree.
|
|
77
|
+
const parseWhereEntry = (entry, entities = null, aliases = null) => {
|
|
33
78
|
if (typeof entry === "string")
|
|
34
|
-
return
|
|
79
|
+
return entities?.has(entry) && !entry.includes("/") && !entry.includes("*")
|
|
80
|
+
? { type: "entity", entity: entry, same: false }
|
|
81
|
+
: { type: "glob", glob: (0, aliases_1.expandPattern)(aliases, entry) };
|
|
35
82
|
if (!(0, queries_1.isObj)(entry))
|
|
36
83
|
return { type: "query", query: entry };
|
|
37
|
-
|
|
84
|
+
const rewritten = (0, aliases_1.expandLocationFilters)(entry, aliases);
|
|
85
|
+
return readObjEntry((0, queries_1.isObj)(rewritten) ? rewritten : entry);
|
|
38
86
|
};
|
|
39
87
|
exports.parseWhereEntry = parseWhereEntry;
|
|
40
|
-
const parseWhere = (value,
|
|
88
|
+
const parseWhere = (value, entities = null, aliases = null) => (0, field_1.toList)(value).map((e) => parseWhereEntry(e, entities, aliases));
|
|
41
89
|
exports.parseWhere = parseWhere;
|
|
42
90
|
const patternOf = (entry) => {
|
|
43
91
|
if (entry.type === "glob")
|
|
@@ -67,15 +115,15 @@ const sameCaps = (source, target) => {
|
|
|
67
115
|
}
|
|
68
116
|
return true;
|
|
69
117
|
};
|
|
70
|
-
// `{
|
|
71
|
-
const
|
|
118
|
+
// `{ entity }` — the file declares that entity, and (for `same`) in the SAME node.
|
|
119
|
+
const matchesEntity = (...args) => {
|
|
72
120
|
const [entry, rel, arch, facts, targetCaps] = args;
|
|
73
|
-
if (!(facts?.
|
|
121
|
+
if (!(facts?.entities ?? []).includes(entry.entity ?? ""))
|
|
74
122
|
return false;
|
|
75
123
|
if (!entry.same)
|
|
76
124
|
return true;
|
|
77
125
|
const nodeM = (0, match_1.deepestMatch)(rel, arch);
|
|
78
|
-
return sameCaps(nodeM ? (0, match_1.matchNode)(nodeM.node, rel)?.caps ?? {} : {}, targetCaps);
|
|
126
|
+
return sameCaps(nodeM ? ((0, match_1.matchNode)(nodeM.node, rel)?.caps ?? {}) : {}, targetCaps);
|
|
79
127
|
};
|
|
80
128
|
// `{ node }` — the path is inside that declared node.
|
|
81
129
|
const matchesNodeEntry = (entry, rel, arch) => {
|
|
@@ -92,8 +140,8 @@ const matchesWhere = (...args) => {
|
|
|
92
140
|
const pattern = patternOf(entry);
|
|
93
141
|
if (pattern != null)
|
|
94
142
|
return capsAgree(pattern, rel, targetCaps);
|
|
95
|
-
if (entry.type === "
|
|
96
|
-
return
|
|
143
|
+
if (entry.type === "entity")
|
|
144
|
+
return matchesEntity(entry, rel, arch, facts, targetCaps);
|
|
97
145
|
if (entry.type === "node")
|
|
98
146
|
return matchesNodeEntry(entry, rel, arch);
|
|
99
147
|
// The scope IS the facts (plus the file and the tree), so a `$ref` can compare
|
|
@@ -111,13 +159,20 @@ const checkWhere = (...args) => {
|
|
|
111
159
|
};
|
|
112
160
|
exports.checkWhere = checkWhere;
|
|
113
161
|
// How code is reached through a declared accessor without an import.
|
|
114
|
-
|
|
162
|
+
// A typed door is spelled by its parameter: `(value: DefaultTheme)`.
|
|
163
|
+
const typeLabel = (type) => `(value: ${type.slice(type.lastIndexOf(".") + 1)})`;
|
|
164
|
+
const accessorLabel = (e) => {
|
|
165
|
+
const segments = e?.segments ?? [];
|
|
166
|
+
if (!segments.length && e?.type)
|
|
167
|
+
return typeLabel(e.type);
|
|
168
|
+
return e?.scope === "function" || e?.scope === "method" ? `${segments.join(".")}(…)` : segments.join(".");
|
|
169
|
+
};
|
|
115
170
|
exports.accessorLabel = accessorLabel;
|
|
116
171
|
const kindOf = (entry) => {
|
|
117
172
|
if (entry.type)
|
|
118
173
|
return entry.type;
|
|
119
|
-
if (entry.
|
|
120
|
-
return "
|
|
174
|
+
if (entry.entity)
|
|
175
|
+
return "entity";
|
|
121
176
|
if (entry.node)
|
|
122
177
|
return "node";
|
|
123
178
|
if (entry.glob)
|
|
@@ -127,15 +182,15 @@ const kindOf = (entry) => {
|
|
|
127
182
|
return null;
|
|
128
183
|
};
|
|
129
184
|
const orText = (value, fallback) => value ?? fallback;
|
|
130
|
-
const
|
|
185
|
+
const entityLabel = (entry) => `entity ${orText(entry.entity, "")}${entry.same ? " (same instance)" : ""}`;
|
|
131
186
|
// How one `where` entry reads inside a sentence — the ONE place that knows the
|
|
132
187
|
// entry vocabulary.
|
|
133
188
|
const labelOf = (entry) => {
|
|
134
189
|
if (!entry)
|
|
135
190
|
return "—";
|
|
136
191
|
const kind = kindOf(entry);
|
|
137
|
-
if (kind === "
|
|
138
|
-
return
|
|
192
|
+
if (kind === "entity")
|
|
193
|
+
return entityLabel(entry);
|
|
139
194
|
if (kind === "node")
|
|
140
195
|
return `node ${orText(entry.node, "")}`;
|
|
141
196
|
if (kind === "glob")
|
|
@@ -183,7 +238,9 @@ const fillTemplate = (template, rel = null, caps = null) => {
|
|
|
183
238
|
if (template == null)
|
|
184
239
|
return null;
|
|
185
240
|
const segs = String(template).split("/");
|
|
186
|
-
const relSegs = String(rel ?? "")
|
|
241
|
+
const relSegs = String(rel ?? "")
|
|
242
|
+
.split("/")
|
|
243
|
+
.filter(Boolean);
|
|
187
244
|
const out = [];
|
|
188
245
|
for (let i = 0; i < segs.length; i += 1) {
|
|
189
246
|
const seg = segs[i];
|
|
@@ -210,7 +267,9 @@ const entryKey = (entry, rel, arch, facts) => {
|
|
|
210
267
|
return fileDir;
|
|
211
268
|
// A template that names a FAMILY (`…/actions/*.ts`) designates the folder the
|
|
212
269
|
// family lives in.
|
|
213
|
-
const star = String(template)
|
|
270
|
+
const star = String(template)
|
|
271
|
+
.split("/")
|
|
272
|
+
.findIndex((s) => s.includes("*"));
|
|
214
273
|
if (star === -1)
|
|
215
274
|
return filled;
|
|
216
275
|
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>;
|