repometry 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/package.json +5 -4
- package/target/main/resources/report/json/config-v1.schema.json +0 -1
- package/target/main/resources/report/json/report-v2.schema.json +14 -0
- package/target/main/resources/viewer/index.html +10 -20
- package/target/main/resources/viewer/styles.css +3 -29
- package/target/main/ts/api/gh/github.js +1 -0
- package/target/main/ts/api/git/blob-batch.js +1 -0
- package/target/main/ts/api/git/changes.js +1 -0
- package/target/main/ts/api/git/commit-metadata.js +5 -6
- package/target/main/ts/api/git/git-churn.js +1 -0
- package/target/main/ts/api/git/git-reader.js +1 -0
- package/target/main/ts/api/git/git.js +1 -0
- package/target/main/ts/api/git/inspection-source.js +1 -0
- package/target/main/ts/api/git/local-sources.js +1 -0
- package/target/main/ts/api/git/local.js +1 -0
- package/target/main/ts/api/git/metabranch-worktree.js +1 -0
- package/target/main/ts/api/git/source-cache.js +1 -0
- package/target/main/ts/api/import/finding-import.js +1 -0
- package/target/main/ts/api/import/lcov-files.js +1 -0
- package/target/main/ts/api/import/profile-file.js +1 -0
- package/target/main/ts/api/worker/remote-executor.js +1 -0
- package/target/main/ts/api/worker/worker-protocol.js +1 -0
- package/target/main/ts/api/worker/worker.js +1 -0
- package/target/main/ts/cli/arguments.js +1 -0
- package/target/main/ts/cli/config.d.ts +0 -1
- package/target/main/ts/cli/config.js +3 -5
- package/target/main/ts/cli/imports.js +1 -0
- package/target/main/ts/cli/main.js +3 -2
- package/target/main/ts/cli/reporting.js +9 -13
- package/target/main/ts/cli/revisions.js +1 -0
- package/target/main/ts/cli/store.js +1 -0
- package/target/main/ts/compose/analyze-snapshot.js +1 -0
- package/target/main/ts/compose/attach-churn.js +13 -0
- package/target/main/ts/compose/diff-coverage.js +1 -0
- package/target/main/ts/compose/inspect.js +1 -0
- package/target/main/ts/compose/plugin-list.js +1 -0
- package/target/main/ts/compose/prepare-metabranch.js +1 -0
- package/target/main/ts/compose/review.js +1 -0
- package/target/main/ts/compose/sources.js +1 -0
- package/target/main/ts/core/engine/execute.js +1 -0
- package/target/main/ts/core/engine/manifest.js +1 -0
- package/target/main/ts/core/engine/plan.js +1 -0
- package/target/main/ts/core/engine/report-products.js +1 -0
- package/target/main/ts/core/model/changes.js +1 -0
- package/target/main/ts/core/model/clone-source.js +1 -0
- package/target/main/ts/core/model/code-structure.js +1 -0
- package/target/main/ts/core/model/finding-ignore.js +1 -0
- package/target/main/ts/core/model/measurement.d.ts +6 -0
- package/target/main/ts/core/model/measurement.js +6 -0
- package/target/main/ts/core/model/report.d.ts +8 -0
- package/target/main/ts/core/model/scanner-import.js +1 -0
- package/target/main/ts/core/model/snapshot.js +1 -0
- package/target/main/ts/core/ports/report.js +1 -0
- package/target/main/ts/core/ports/source-provider.js +1 -0
- package/target/main/ts/core/profile/exclusions.js +1 -0
- package/target/main/ts/core/profile/maintainability.js +1 -0
- package/target/main/ts/core/profile/profile.js +1 -0
- package/target/main/ts/core/usecases/compare.js +1 -0
- package/target/main/ts/core/usecases/diff-coverage-policy.js +1 -0
- package/target/main/ts/core/usecases/diff-coverage.js +1 -0
- package/target/main/ts/core/usecases/inspect.js +1 -0
- package/target/main/ts/core/usecases/review.js +1 -0
- package/target/main/ts/index.js +1 -0
- package/target/main/ts/plugin.js +1 -0
- package/target/main/ts/plugins/coverage/coverage.d.ts +2 -0
- package/target/main/ts/plugins/coverage/coverage.js +83 -4
- package/target/main/ts/plugins/coverage/diff-coverage.js +1 -0
- package/target/main/ts/plugins/duplication/duplication.js +1 -0
- package/target/main/ts/plugins/language-js/babel-provider.js +1 -0
- package/target/main/ts/plugins/language-js/clone-candidates.js +1 -0
- package/target/main/ts/plugins/language-js/code-lines.js +1 -0
- package/target/main/ts/plugins/language-js/function-facts.js +1 -0
- package/target/main/ts/plugins/language-js/structural-observations.js +1 -0
- package/target/main/ts/plugins/maintainability/maintainability.js +1 -0
- package/target/main/ts/plugins/maintainability/structural-smells.js +1 -0
- package/target/main/ts/plugins/source/forges.js +1 -0
- package/target/main/ts/plugins/structure/structure.js +1 -0
- package/target/main/ts/report/html/app/viewer-commits.d.ts +1 -1
- package/target/main/ts/report/html/app/viewer-commits.js +1 -1
- package/target/main/ts/report/html/app/viewer-data.d.ts +1 -1
- package/target/main/ts/report/html/app/viewer-data.js +4 -4
- package/target/main/ts/report/html/app/viewer-files.js +25 -8
- package/target/main/ts/report/html/app/viewer-metric-registry.d.ts +3 -1
- package/target/main/ts/report/html/app/viewer-metric-registry.js +24 -6
- package/target/main/ts/report/html/app/viewer-profile.js +3 -3
- package/target/main/ts/report/html/app/viewer-trends.d.ts +0 -1
- package/target/main/ts/report/html/app/viewer-trends.js +16 -6
- package/target/main/ts/report/html/app/viewer.js +48 -107
- package/target/main/ts/report/html/site/badges.js +1 -0
- package/target/main/ts/report/html/site/export-site.d.ts +2 -1
- package/target/main/ts/report/html/site/export-site.js +17 -24
- package/target/main/ts/report/html/site/exported-server.js +1 -0
- package/target/main/ts/report/html/site/local-server.js +1 -0
- package/target/main/ts/report/html/site/projects.js +1 -0
- package/target/main/ts/report/html/site/server.js +1 -0
- package/target/main/ts/report/html/site/source-route.js +1 -0
- package/target/main/ts/report/json/projections/commit-summary.d.ts +1 -0
- package/target/main/ts/report/json/projections/commit-summary.js +7 -1
- package/target/main/ts/report/json/projections/components.js +1 -0
- package/target/main/ts/report/json/projections/file-metrics.js +1 -0
- package/target/main/ts/report/json/projections/inspection-context.js +1 -0
- package/target/main/ts/report/json/projections/inspection-details.js +1 -0
- package/target/main/ts/report/json/projections/metric-values.js +1 -0
- package/target/main/ts/report/json/projections/public-history.js +1 -0
- package/target/main/ts/report/json/store/components.js +1 -0
- package/target/main/ts/report/json/store/local-store.js +1 -0
- package/target/main/ts/report/json/store/pull-review-store.js +1 -0
- package/target/main/ts/report/json/validation/metabranch.js +1 -0
- package/target/main/ts/report/json/validation/report.js +1 -0
- package/target/main/ts/report/json/validation/summary-validation.js +1 -0
- package/target/main/ts/report.js +1 -0
- package/target/main/ts/api/gh/github-pr-comment.d.ts +0 -4
- package/target/main/ts/api/gh/github-pr-comment.js +0 -107
- package/target/main/ts/cli/github-pr-comment.d.ts +0 -1
- package/target/main/ts/cli/github-pr-comment.js +0 -12
- package/target/main/ts/report/html/app/viewer-access.d.ts +0 -19
- package/target/main/ts/report/html/app/viewer-access.js +0 -25
package/README.md
CHANGED
|
@@ -17,12 +17,13 @@ Run each command in your repository as `npx repometry <command>`.
|
|
|
17
17
|
| `analyze` | Measures HEAD and saves the inspection under `.repometry/` |
|
|
18
18
|
| `analyze HEAD~50..HEAD` | Measures the last 50 commits, oldest first, to build history. `--skip-saved` leaves commits already saved. |
|
|
19
19
|
| `analyze --import lcov=coverage/lcov.info` | Adds coverage or scanner results from your tools. Repeat `--import` for each file. |
|
|
20
|
-
| `report html` | Writes the
|
|
21
|
-
| `report html --mode private -o DIR` | Writes the private report, with per-file metrics, findings and source links, to `DIR` |
|
|
20
|
+
| `report html` | Writes the report (history, files, findings, badges, source links) to `.repometry/report/html`; `-o DIR` picks another folder |
|
|
22
21
|
| `view` | Serves the report locally on a free port; `--port 3030` picks the port |
|
|
23
22
|
| `plugins` | Lists the import formats, reporters and CI adapters |
|
|
24
23
|
| `help [command]` | Shows the options of a command |
|
|
25
24
|
|
|
25
|
+
A report shows everything the store holds, so publish it only where you would publish that data.
|
|
26
|
+
|
|
26
27
|
## License
|
|
27
28
|
|
|
28
29
|
[MIT](LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repometry",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Track repository metrics without SaaS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -40,15 +40,16 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
|
-
"target/main"
|
|
43
|
+
"target/main",
|
|
44
|
+
"!target/main/**/*.map"
|
|
44
45
|
],
|
|
45
46
|
"publishConfig": {
|
|
46
47
|
"access": "public"
|
|
47
48
|
},
|
|
48
49
|
"scripts": {
|
|
49
50
|
"build": "node -e \"require('node:fs').rmSync('target/main', { recursive: true, force: true })\" && tsc -p tsconfig.json && tsc -p tsconfig.browser.json && node -e \"const fs = require('node:fs'); fs.chmodSync('target/main/ts/cli/main.js', 0o755); fs.cpSync('src/main/resources', 'target/main/resources', { recursive: true })\"",
|
|
50
|
-
"test": "npm run build && tsc -p tsconfig.test.json && node --test 'target/verification/test/ts/*.test.js'",
|
|
51
|
-
"coverage": "npm run build &&
|
|
51
|
+
"test": "npm run build && node -e \"require('node:fs').rmSync('target/verification', { recursive: true, force: true })\" && tsc -p tsconfig.test.json && node --test 'target/verification/test/ts/*.test.js'",
|
|
52
|
+
"coverage": "npm run build && node -e \"require('node:fs').rmSync('target/verification', { recursive: true, force: true })\" && tsc -p tsconfig.test.json && c8 --all --src target/main/ts --src target/verification/main/ts --include 'src/main/ts/**' --exclude-after-remap --reporter lcov --reporter text-summary --reports-dir target/coverage node --test 'target/verification/test/ts/*.test.js'",
|
|
52
53
|
"prepack": "npm run build",
|
|
53
54
|
"release": "npx --yes zx-semrel@1.25.1"
|
|
54
55
|
},
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
},
|
|
22
22
|
"imports": { "$ref": "#/$defs/strings" },
|
|
23
23
|
"reports": { "$ref": "#/$defs/strings" },
|
|
24
|
-
"mode": { "enum": ["public", "private"] },
|
|
25
24
|
"sources": { "type": "string", "minLength": 1 },
|
|
26
25
|
"branch": { "type": "string", "minLength": 1 },
|
|
27
26
|
"minCoverage": { "type": "number", "minimum": 0, "maximum": 100 },
|
|
@@ -26,6 +26,20 @@
|
|
|
26
26
|
"committedAt": {
|
|
27
27
|
"type": "string"
|
|
28
28
|
},
|
|
29
|
+
"commit": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"required": ["subject", "author"],
|
|
32
|
+
"properties": {
|
|
33
|
+
"subject": { "type": "string" },
|
|
34
|
+
"author": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"required": ["name", "email"],
|
|
37
|
+
"properties": { "name": { "type": "string" }, "email": { "type": "string" } },
|
|
38
|
+
"additionalProperties": false
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"additionalProperties": false
|
|
42
|
+
},
|
|
29
43
|
"appliedConfig": {
|
|
30
44
|
"$ref": "urn:repometry:schema:report:1#/properties/appliedConfig"
|
|
31
45
|
},
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<meta name="repometry-view" content="
|
|
6
|
+
<meta name="repometry-view" content="private">
|
|
7
7
|
<meta name="repometry-project" content="">
|
|
8
8
|
<title>Repometry</title>
|
|
9
9
|
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1 -1 32 32'%3E%3Cstyle%3E.f%7Bfill:%231f6b35%7D.s%7Bfill:%235fae6a%7D@media (prefers-color-scheme:dark)%7B.f%7Bfill:%238fe08f%7D.s%7Bfill:%233f8a4c%7D%7D%3C/style%3E%3Cpath class='f' d='M3 4 29 3 3 15z'/%3E%3Cpath class='s' d='M3 19 9 16.23V29H3zM13 14.38l6-2.77V29h-6zM23 9.77 29 7v22h-6z'/%3E%3C/svg%3E">
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
<div class="tabs-row">
|
|
25
25
|
<nav id="navigation" class="tabs" aria-label="Report">
|
|
26
26
|
<a data-page="overview" href="#overview">Overview</a>
|
|
27
|
-
<a data-page="issues" href="#issues" data-
|
|
28
|
-
<a data-page="hotspots" href="#hotspots" data-
|
|
29
|
-
<a data-page="metrics" href="#metrics" data-
|
|
27
|
+
<a data-page="issues" href="#issues" data-loaded hidden>Issues<span class="tab-count" id="issues-count"></span></a>
|
|
28
|
+
<a data-page="hotspots" href="#hotspots" data-loaded hidden>Hotspots</a>
|
|
29
|
+
<a data-page="metrics" href="#metrics" data-loaded hidden>Metrics</a>
|
|
30
30
|
<a data-page="trends" href="#trends">Trends</a>
|
|
31
|
-
<a data-page="pulls" href="#pulls" data-
|
|
32
|
-
<a data-page="settings" href="#settings" data-
|
|
33
|
-
<a data-page="diagnostics" href="#diagnostics" data-
|
|
31
|
+
<a data-page="pulls" href="#pulls" data-loaded hidden>Pull requests</a>
|
|
32
|
+
<a data-page="settings" href="#settings" data-loaded hidden>Profile</a>
|
|
33
|
+
<a data-page="diagnostics" href="#diagnostics" data-loaded hidden>Diagnostics<span class="tab-count" id="diagnostics-count"></span></a>
|
|
34
34
|
</nav>
|
|
35
35
|
<div id="inspection-meta" class="inspection-meta" hidden>
|
|
36
36
|
<a class="download" href="./history.json" download>Download data</a>
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
</div>
|
|
56
56
|
<div class="verdict">
|
|
57
57
|
<span id="coverage-mark" class="mark ring" aria-hidden="true"></span>
|
|
58
|
-
<span class="verdict-text"><button type="button" role="tab" class="verdict-tab" data-metric="coverage" aria-controls="trend" aria-describedby="coverage-detail">Coverage</button><span id="coverage-detail" class="verdict-detail"></span></span>
|
|
58
|
+
<span class="verdict-text"><button type="button" role="tab" class="verdict-tab" data-metric="coverage" aria-controls="trend" aria-describedby="coverage-detail coverage-kinds">Coverage</button><span id="coverage-detail" class="verdict-detail"></span><span id="coverage-kinds" class="verdict-detail verdict-more" hidden></span></span>
|
|
59
59
|
</div>
|
|
60
|
-
<div class="verdict" id="security-verdict" data-
|
|
60
|
+
<div class="verdict" id="security-verdict" data-loaded hidden>
|
|
61
61
|
<span id="security-mark" class="mark severity"></span>
|
|
62
62
|
<span class="verdict-text"><button type="button" role="tab" class="verdict-tab" data-metric="security" aria-controls="trend" aria-describedby="security-mark security-detail">Security</button><span id="security-detail" class="verdict-detail"></span></span>
|
|
63
63
|
</div>
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
<dl id="lead" class="lead"></dl>
|
|
73
73
|
</div>
|
|
74
74
|
</div>
|
|
75
|
-
<aside id="overview-hotspots" class="overview-aside" aria-labelledby="overview-hotspots-title" data-
|
|
75
|
+
<aside id="overview-hotspots" class="overview-aside" aria-labelledby="overview-hotspots-title" data-loaded hidden>
|
|
76
76
|
<div id="overview-sunburst"></div>
|
|
77
77
|
<div class="section-heading">
|
|
78
78
|
<h3 id="overview-hotspots-title">Hotspots</h3>
|
|
@@ -80,12 +80,6 @@
|
|
|
80
80
|
</div>
|
|
81
81
|
<div id="overview-hotspot-list"></div>
|
|
82
82
|
</aside>
|
|
83
|
-
<aside id="overview-public" class="overview-public" aria-labelledby="overview-public-title" hidden>
|
|
84
|
-
<div class="panel public-panel">
|
|
85
|
-
<h3 id="overview-public-title">Public report</h3>
|
|
86
|
-
<div id="overview-public-content"></div>
|
|
87
|
-
</div>
|
|
88
|
-
</aside>
|
|
89
83
|
</div>
|
|
90
84
|
</section>
|
|
91
85
|
|
|
@@ -115,10 +109,6 @@
|
|
|
115
109
|
<h2 id="settings-title">Profile</h2>
|
|
116
110
|
<div id="settings-content"></div>
|
|
117
111
|
</section>
|
|
118
|
-
<section id="unavailable" aria-labelledby="unavailable-title" hidden>
|
|
119
|
-
<h2 id="unavailable-title"></h2>
|
|
120
|
-
<div id="unavailable-content" class="report-notice"></div>
|
|
121
|
-
</section>
|
|
122
112
|
</main>
|
|
123
113
|
<footer class="site-footer">
|
|
124
114
|
<div class="site-footer-inner">
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/* Repometry viewer: light, flat and quiet. Every colour is a token; the dark theme follows the system. */
|
|
2
2
|
:root {
|
|
3
|
-
--copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.2'%3E%3Crect x='3.6' y='3.6' width='7.4' height='7.4' rx='1.2'/%3E%3Cpath d='M8.4 3.6V2a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v5.4a1 1 0 0 0 1 1h1.6'/%3E%3C/svg%3E");
|
|
4
|
-
--check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.4 4.8 9 10 3' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E");
|
|
5
|
-
--lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Cpath d='M2.5 5V3.5a2.5 2.5 0 0 1 5 0V5' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3Crect x='1' y='5' width='8' height='6.5' rx='1.2'/%3E%3C/svg%3E");
|
|
6
3
|
--branch-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='1.4'%3E%3Ccircle cx='3' cy='2.25' r='1.25'/%3E%3Ccircle cx='3' cy='9.75' r='1.25'/%3E%3Ccircle cx='9' cy='3.75' r='1.25'/%3E%3Cpath d='M3 3.5v5M9 5c0 2.5-6 1.5-6 3.5'/%3E%3C/svg%3E");
|
|
7
4
|
color-scheme: light dark;
|
|
8
5
|
--page: #ffffff;
|
|
@@ -214,31 +211,6 @@ label select, label input { color: var(--ink); font-weight: 400; font-size: .875
|
|
|
214
211
|
.tabs a { flex: none; display: inline-flex; align-items: center; gap: .375rem; min-height: 40px; padding: 0 .1rem; color: var(--secondary); font-size: .875rem; font-weight: 500; text-decoration: none; border-bottom: 2px solid transparent; }
|
|
215
212
|
.tabs a:hover { color: var(--ink); }
|
|
216
213
|
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
|
|
217
|
-
.tabs a[data-unavailable] { color: var(--muted); }
|
|
218
|
-
.tabs a[data-unavailable]::after { content: ""; width: .625rem; height: .75rem; background: currentColor; -webkit-mask: var(--lock) center / contain no-repeat; mask: var(--lock) center / contain no-repeat; }
|
|
219
|
-
.tabs a[data-unavailable]:hover { color: var(--secondary); }
|
|
220
|
-
.tabs a[data-unavailable][aria-current] { color: var(--secondary); border-bottom-color: var(--rule-strong); }
|
|
221
|
-
.report-notice { display: flex; flex-wrap: wrap; align-items: center; gap: .625rem 1rem; padding: .75rem 1rem; font-size: .875rem; color: var(--secondary); background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--radius); }
|
|
222
|
-
.report-notice-text { flex: 1 1 22rem; margin: 0; line-height: 1.55; }
|
|
223
|
-
.report-notice strong { font-weight: 600; color: var(--ink); }
|
|
224
|
-
.report-notice code { color: var(--ink); white-space: nowrap; -webkit-user-select: all; user-select: all; }
|
|
225
|
-
.report-notice-text > code, .report-notice-command { padding: .125rem .375rem; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 4px; }
|
|
226
|
-
.report-notice-command { display: inline-flex; align-items: center; gap: .375rem; margin: 0; line-height: inherit; vertical-align: baseline; cursor: copy; }
|
|
227
|
-
.report-notice-command code { font-size: .8125rem; }
|
|
228
|
-
.report-notice-command::after { content: ""; width: .75rem; height: .75rem; background: var(--muted); -webkit-mask: var(--copy) center / contain no-repeat; mask: var(--copy) center / contain no-repeat; }
|
|
229
|
-
.report-notice-command:hover { border-color: var(--secondary); }
|
|
230
|
-
.report-notice-command:hover::after { background: var(--ink); }
|
|
231
|
-
.report-notice-command[data-copied]::after { background: var(--good); -webkit-mask-image: var(--check); mask-image: var(--check); }
|
|
232
|
-
#unavailable-content { max-width: 46rem; }
|
|
233
|
-
.public-panel { padding: 1.25rem 1.25rem 1.375rem; }
|
|
234
|
-
.public-panel h3 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; font-size: 1rem; font-weight: 600; }
|
|
235
|
-
.public-panel h3::before { content: ""; width: .75rem; height: .875rem; background: var(--muted); -webkit-mask: var(--lock) center / contain no-repeat; mask: var(--lock) center / contain no-repeat; }
|
|
236
|
-
.public-panel p { margin: 0 0 .875rem; font-size: .875rem; line-height: 1.55; color: var(--secondary); }
|
|
237
|
-
.public-panel-command { display: flex; width: 100%; justify-content: space-between; min-height: 2.5rem; padding: 0 .75rem; background: var(--surface-2); border-radius: 6px; }
|
|
238
|
-
.public-panel code { color: var(--ink); white-space: nowrap; -webkit-user-select: all; user-select: all; }
|
|
239
|
-
.public-panel-command:hover { background: var(--surface); }
|
|
240
|
-
.public-panel-command code { font-size: .875rem; }
|
|
241
|
-
.public-panel > div > code { display: block; padding: .5rem .75rem; color: var(--ink); background: var(--surface-2); border: 1px solid var(--rule-strong); border-radius: 6px; }
|
|
242
214
|
.tab-count { min-width: 1.25rem; padding: 0 .35rem; border-radius: 999px; background: var(--rule); color: var(--secondary); font-size: .75rem; font-weight: 600; line-height: 1.25rem; text-align: center; font-variant-numeric: tabular-nums; }
|
|
243
215
|
.tab-count:empty { display: none; }
|
|
244
216
|
|
|
@@ -284,6 +256,9 @@ main:focus { outline: none; }
|
|
|
284
256
|
.verdict-tab:focus-visible { outline: none; }
|
|
285
257
|
.verdict:has(.verdict-tab:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
|
|
286
258
|
.verdict-detail { color: var(--secondary); font-size: .875rem; overflow-wrap: anywhere; }
|
|
259
|
+
/* The coverage kinds beyond lines: a quieter second line under the headline's detail. */
|
|
260
|
+
.verdict-more { font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
|
|
261
|
+
.verdict-more > span { white-space: nowrap; }
|
|
287
262
|
/* A detail that counts something leads to exactly what it counts. */
|
|
288
263
|
.verdict-detail a { position: relative; z-index: 1; color: inherit; text-decoration-color: var(--rule-strong); }
|
|
289
264
|
.verdict-detail a:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
|
|
@@ -486,7 +461,6 @@ tbody tr:last-child > * { border-bottom: 0; }
|
|
|
486
461
|
|
|
487
462
|
@media (max-width: 72rem) {
|
|
488
463
|
.overview-grid:has(> aside:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
|
|
489
|
-
.public-panel { max-width: 36rem; }
|
|
490
464
|
.overview-aside { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 0 2.5rem; align-items: start; }
|
|
491
465
|
.overview-aside > :not(#overview-sunburst) { grid-column: 2; }
|
|
492
466
|
.overview-aside #overview-sunburst { grid-row: 1 / span 4; }
|
|
@@ -12,12 +12,10 @@ export function commitMetadataReader(repository) {
|
|
|
12
12
|
result.set(sha, { subject: message.split(/\r?\n/, 1)[0], author: { name, email } });
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
result.set(sha, { ...commit, tags });
|
|
20
|
-
}
|
|
15
|
+
const requested = new Set(revisions);
|
|
16
|
+
for (const [sha, tags] of await tagsByCommit(repository)) {
|
|
17
|
+
if (requested.has(sha))
|
|
18
|
+
result.set(sha, { ...result.get(sha), tags });
|
|
21
19
|
}
|
|
22
20
|
return result;
|
|
23
21
|
};
|
|
@@ -52,3 +50,4 @@ export async function resolveGitBranch(repository, name) {
|
|
|
52
50
|
return resolveGitCommit(repository, `refs/remotes/origin/${name}`);
|
|
53
51
|
}
|
|
54
52
|
}
|
|
53
|
+
//# sourceMappingURL=commit-metadata.js.map
|
|
@@ -11,3 +11,4 @@ export async function readLcovFiles(input) {
|
|
|
11
11
|
sources.sort((a, b) => comparePaths(a.digest, b.digest));
|
|
12
12
|
return { text: sources.map(source => source.text).join('\n'), inputDigests: sources.map(source => source.digest) };
|
|
13
13
|
}
|
|
14
|
+
//# sourceMappingURL=lcov-files.js.map
|
|
@@ -4,7 +4,6 @@ export declare function readConfig(root: string, input: Invocation): Promise<{
|
|
|
4
4
|
ignore: readonly import("../index.js").FindingIgnoreRule[];
|
|
5
5
|
imports: readonly string[];
|
|
6
6
|
reports: readonly string[];
|
|
7
|
-
mode: string | undefined;
|
|
8
7
|
sources: string | undefined;
|
|
9
8
|
branch: string | undefined;
|
|
10
9
|
minCoverage: string | undefined;
|
|
@@ -3,17 +3,14 @@ import { resolve } from 'node:path';
|
|
|
3
3
|
import { isRecord } from '../core/engine/plugin.js';
|
|
4
4
|
import { normalizeProfile } from '../core/profile/profile.js';
|
|
5
5
|
import { invocationDirectory } from './store.js';
|
|
6
|
-
const keys = new Set(['$schema', 'exclude', 'ignore', 'imports', 'reports', '
|
|
6
|
+
const keys = new Set(['$schema', 'exclude', 'ignore', 'imports', 'reports', 'sources', 'branch',
|
|
7
7
|
'minCoverage', 'minLines', 'maxCoverageDrop', 'maxNewIssues']);
|
|
8
8
|
function parseConfig(value) {
|
|
9
9
|
if (!isRecord(value) || Object.keys(value).some(key => !keys.has(key)))
|
|
10
10
|
throw new Error('Invalid Repometry JSON configuration');
|
|
11
11
|
string(value.$schema, '$schema');
|
|
12
12
|
const profile = normalizeProfile({ exclude: value.exclude, ignore: value.ignore });
|
|
13
|
-
|
|
14
|
-
if (mode !== undefined && mode !== 'private' && mode !== 'public')
|
|
15
|
-
throw new Error('Config mode must be public or private');
|
|
16
|
-
return { ...profile, imports: list(value.imports, 'imports'), reports: list(value.reports, 'reports'), mode,
|
|
13
|
+
return { ...profile, imports: list(value.imports, 'imports'), reports: list(value.reports, 'reports'),
|
|
17
14
|
sources: string(value.sources, 'sources'), branch: string(value.branch, 'branch'),
|
|
18
15
|
minCoverage: number(value.minCoverage, 'minCoverage'), minLines: number(value.minLines, 'minLines'),
|
|
19
16
|
maxCoverageDrop: number(value.maxCoverageDrop, 'maxCoverageDrop'), maxNewIssues: number(value.maxNewIssues, 'maxNewIssues') };
|
|
@@ -58,3 +55,4 @@ function number(value, key) {
|
|
|
58
55
|
throw new Error(`Config ${key} must be a number`);
|
|
59
56
|
return String(value);
|
|
60
57
|
}
|
|
58
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -34,8 +34,8 @@ const outputOption = option('PATH', 'Set the report output path.', { short: 'o'
|
|
|
34
34
|
const baselineOption = option('PATH|git:REF', 'Select the baseline report store.');
|
|
35
35
|
const branchOption = option('NAME', 'Name the branch represented by the report.');
|
|
36
36
|
const renderOptions = {
|
|
37
|
-
output: outputOption,
|
|
38
|
-
sources: option('auto|none|ID[:SPEC]', 'Select
|
|
37
|
+
output: outputOption,
|
|
38
|
+
sources: option('auto|none|ID[:SPEC]', 'Select where the report reads source files.'),
|
|
39
39
|
title: option('NAME', 'Set the report title.'), components: option('FILE', 'Read component definitions.'),
|
|
40
40
|
'no-footer': flag('Omit the footer.'), branch: branchOption,
|
|
41
41
|
};
|
|
@@ -376,3 +376,4 @@ catch (error) {
|
|
|
376
376
|
process.stderr.write(`repometry: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
377
377
|
process.exitCode = 1;
|
|
378
378
|
}
|
|
379
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -18,11 +18,6 @@ export async function outputReports(root, store, requested, input, config) {
|
|
|
18
18
|
const output = input.text('output');
|
|
19
19
|
if (output !== undefined && requested.length !== 1)
|
|
20
20
|
throw new Error('--output requires exactly one report; use FORMAT=PATH for multiple reports');
|
|
21
|
-
const mode = input.text('mode') ?? config.mode ?? 'public';
|
|
22
|
-
if (mode !== 'public' && mode !== 'private')
|
|
23
|
-
throw new Error('--mode must be public or private');
|
|
24
|
-
if (input.text('components') && mode !== 'private')
|
|
25
|
-
throw new Error('--components requires --mode private');
|
|
26
21
|
const requests = requested.map(spec => {
|
|
27
22
|
const equal = spec.indexOf('=');
|
|
28
23
|
const format = equal < 0 ? spec : spec.slice(0, equal);
|
|
@@ -41,12 +36,12 @@ export async function outputReports(root, store, requested, input, config) {
|
|
|
41
36
|
const repository = await findRepository(root);
|
|
42
37
|
const readCommitMetadata = repository === undefined ? undefined : commitMetadataReader(repository);
|
|
43
38
|
const sourceOption = input.text('sources') ?? config.sources;
|
|
44
|
-
const sources =
|
|
45
|
-
const [components, pulls] =
|
|
39
|
+
const sources = resolveSourceLocator(sourceOption, { remotes: await sourceRemotes(root), env: process.env });
|
|
40
|
+
const [components, pulls] = await Promise.all([
|
|
46
41
|
readComponents(componentsPath(root, input), input.text('components') === undefined),
|
|
47
42
|
store.path ? listPullReviews(store.path) : [],
|
|
48
|
-
])
|
|
49
|
-
const options = {
|
|
43
|
+
]);
|
|
44
|
+
const options = { sources, components, pulls, readCommitMetadata, branch: input.text('branch') ?? config.branch,
|
|
50
45
|
title: input.text('title') ?? (input.text('repo') ? basename(root) : undefined),
|
|
51
46
|
footer: !input.flag('no-footer') };
|
|
52
47
|
for (const request of requests) {
|
|
@@ -55,16 +50,16 @@ export async function outputReports(root, store, requested, input, config) {
|
|
|
55
50
|
else {
|
|
56
51
|
const rows = await store.reader.listSummaries?.() ?? (await store.reader.list()).filter(report => report.subject.kind === 'commit').map(commitSummary);
|
|
57
52
|
const data = siteSummary(await withCommitMetadata(rows, readCommitMetadata), options);
|
|
58
|
-
await writeSummary(request.path, data
|
|
53
|
+
await writeSummary(request.path, data);
|
|
59
54
|
}
|
|
60
55
|
}
|
|
61
56
|
return requests;
|
|
62
57
|
}
|
|
63
|
-
async function writeSummary(path, data
|
|
58
|
+
async function writeSummary(path, data) {
|
|
64
59
|
await mkdir(dirname(path), { recursive: true });
|
|
65
60
|
const temporary = `${path}.${randomUUID()}.tmp`;
|
|
66
61
|
try {
|
|
67
|
-
await writeFile(temporary, data, { mode:
|
|
62
|
+
await writeFile(temporary, data, { mode: 0o644, flag: 'wx' });
|
|
68
63
|
await rename(temporary, path);
|
|
69
64
|
}
|
|
70
65
|
finally {
|
|
@@ -88,7 +83,7 @@ export async function viewTarget(input, port) {
|
|
|
88
83
|
throw new Error(`No report at ${target}: expected a repository, a .repometry folder or an exported report`);
|
|
89
84
|
}
|
|
90
85
|
const root = repository ?? target;
|
|
91
|
-
const store = selectStore(root, input.text('store') ?? (dataStore ? data : directStore ? target : undefined),
|
|
86
|
+
const store = selectStore(root, input.text('store') ?? (dataStore ? data : directStore ? target : undefined), invocationDirectory(input));
|
|
92
87
|
if ((await store.reader.listSummaries?.() ?? []).length === 0)
|
|
93
88
|
throw new Error(`No saved inspections in ${store.path ?? input.text('store')}. Run repometry analyze first.`);
|
|
94
89
|
const [components, pulls, config] = await Promise.all([
|
|
@@ -106,3 +101,4 @@ function componentsPath(root, input) {
|
|
|
106
101
|
const explicit = input.text('components');
|
|
107
102
|
return explicit === undefined ? resolve(root, '.repometry/components.json') : resolve(invocationDirectory(input), explicit);
|
|
108
103
|
}
|
|
104
|
+
//# sourceMappingURL=reporting.js.map
|
|
@@ -5,6 +5,9 @@ import { churnSettings, gitChurn } from '../api/git/git-churn.js';
|
|
|
5
5
|
export async function attachChurn(report, root, paths) {
|
|
6
6
|
if (report.subject.kind !== 'commit')
|
|
7
7
|
return report;
|
|
8
|
+
return withCommitDetails(await measureChurn(report, root, paths), root);
|
|
9
|
+
}
|
|
10
|
+
async function measureChurn(report, root, paths) {
|
|
8
11
|
if (paths.length === 0)
|
|
9
12
|
return withCommitTime(report, root);
|
|
10
13
|
const { churnWindow, ...appliedConfig } = report.appliedConfig;
|
|
@@ -35,3 +38,13 @@ async function withCommitTime(report, root) {
|
|
|
35
38
|
const time = Date.parse(timestamp.trim());
|
|
36
39
|
return Number.isFinite(time) ? { ...report, schema: reportSchema, committedAt: new Date(time).toISOString() } : report;
|
|
37
40
|
}
|
|
41
|
+
/** Message title and author of the inspected commit, kept with the inspection so exports need no Git history. */
|
|
42
|
+
async function withCommitDetails(report, root) {
|
|
43
|
+
const log = await gitText(root, ['show', '--no-show-signature', '--no-notes', '--no-patch', '--format=%an%x00%ae%x00%B', report.subject.id, '--'])
|
|
44
|
+
.catch(() => '');
|
|
45
|
+
const [name, email, message] = log.split('\0');
|
|
46
|
+
if (!name || email === undefined || message === undefined)
|
|
47
|
+
return report;
|
|
48
|
+
return { ...report, schema: reportSchema, commit: { subject: message.split(/\r?\n/, 1)[0], author: { name, email } } };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=attach-churn.js.map
|
|
@@ -42,3 +42,4 @@ export async function attachFindings(report, inputs, root, findingRoot, excludes
|
|
|
42
42
|
status: gaps.length > 0 ? 'partial' : report.status === 'not-applicable' && findingImports.some(item => item.units > 0)
|
|
43
43
|
? 'complete' : report.status, diagnostics: [...report.diagnostics, ...gaps] };
|
|
44
44
|
}
|
|
45
|
+
//# sourceMappingURL=inspect.js.map
|
|
@@ -7,3 +7,4 @@ import { structure } from '../plugins/structure/structure.js';
|
|
|
7
7
|
import { sourceProviders } from './sources.js';
|
|
8
8
|
export const builtInPlugins = [babelProvider, structure, maintainability, duplication, coverage, diffCoverage, ...sourceProviders]
|
|
9
9
|
.map(({ id, version, kinds, claims }) => ({ id, version, kinds, ...(claims ? { claims } : {}) }));
|
|
10
|
+
//# sourceMappingURL=plugin-list.js.map
|
|
@@ -14,3 +14,4 @@ export async function prepareMetabranch({ repository, worktree, branch, report }
|
|
|
14
14
|
await new LocalReportStore(target).save(report);
|
|
15
15
|
return ['manifest.json', 'summary.json', `commits/${report.subject.id}/report.json`];
|
|
16
16
|
}
|
|
17
|
+
//# sourceMappingURL=prepare-metabranch.js.map
|
|
@@ -83,3 +83,4 @@ function isJson(value, depth = 0) {
|
|
|
83
83
|
return isRecord(value) && (Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null)
|
|
84
84
|
&& Object.values(value).every(item => isJson(item, depth + 1));
|
|
85
85
|
}
|
|
86
|
+
//# sourceMappingURL=report-products.js.map
|