repometry 0.0.0-dev.0 → 0.1.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.
Files changed (281) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +24 -1
  3. package/package.json +48 -7
  4. package/target/main/resources/report/json/compact-json-v1.schema.json +24 -0
  5. package/target/main/resources/report/json/comparison-v1.schema.json +65 -0
  6. package/target/main/resources/report/json/config-v1.schema.json +34 -0
  7. package/target/main/resources/report/json/diff-coverage-v1.schema.json +55 -0
  8. package/target/main/resources/report/json/file-metrics-v1.schema.json +134 -0
  9. package/target/main/resources/report/json/inspection-context-v1.schema.json +172 -0
  10. package/target/main/resources/report/json/metabranch-v1.schema.json +9 -0
  11. package/target/main/resources/report/json/metric-catalog-v1.schema.json +31 -0
  12. package/target/main/resources/report/json/public-history-v1.schema.json +50 -0
  13. package/target/main/resources/report/json/pull-review-v1.schema.json +97 -0
  14. package/target/main/resources/report/json/quality-history-v1.schema.json +51 -0
  15. package/target/main/resources/report/json/report-v1.schema.json +65 -0
  16. package/target/main/resources/report/json/report-v2.schema.json +238 -0
  17. package/target/main/resources/report/json/repository-summary-v1.schema.json +181 -0
  18. package/target/main/resources/report/json/viewer-details-v1.schema.json +343 -0
  19. package/target/main/resources/report/json/viewer-inspection-v1.schema.json +13 -0
  20. package/target/main/resources/viewer/files.css +578 -0
  21. package/target/main/resources/viewer/index.html +130 -0
  22. package/target/main/resources/viewer/projects.html +52 -0
  23. package/target/main/resources/viewer/styles.css +586 -0
  24. package/target/main/resources/viewer/viewer-pulls.css +64 -0
  25. package/target/main/ts/api/gh/github-pr-comment.d.ts +4 -0
  26. package/target/main/ts/api/gh/github-pr-comment.js +107 -0
  27. package/target/main/ts/api/gh/github.d.ts +6 -0
  28. package/target/main/ts/api/gh/github.js +91 -0
  29. package/target/main/ts/api/git/blob-batch.d.ts +10 -0
  30. package/target/main/ts/api/git/blob-batch.js +105 -0
  31. package/target/main/ts/api/git/changes.d.ts +22 -0
  32. package/target/main/ts/api/git/changes.js +107 -0
  33. package/target/main/ts/api/git/commit-metadata.d.ts +3 -0
  34. package/target/main/ts/api/git/commit-metadata.js +54 -0
  35. package/target/main/ts/api/git/git-churn.d.ts +9 -0
  36. package/target/main/ts/api/git/git-churn.js +70 -0
  37. package/target/main/ts/api/git/git-reader.d.ts +16 -0
  38. package/target/main/ts/api/git/git-reader.js +73 -0
  39. package/target/main/ts/api/git/git.d.ts +21 -0
  40. package/target/main/ts/api/git/git.js +152 -0
  41. package/target/main/ts/api/git/inspection-source.d.ts +15 -0
  42. package/target/main/ts/api/git/inspection-source.js +30 -0
  43. package/target/main/ts/api/git/local-sources.d.ts +5 -0
  44. package/target/main/ts/api/git/local-sources.js +46 -0
  45. package/target/main/ts/api/git/local.d.ts +3 -0
  46. package/target/main/ts/api/git/local.js +35 -0
  47. package/target/main/ts/api/git/metabranch-worktree.d.ts +1 -0
  48. package/target/main/ts/api/git/metabranch-worktree.js +34 -0
  49. package/target/main/ts/api/git/source-cache.d.ts +3 -0
  50. package/target/main/ts/api/git/source-cache.js +56 -0
  51. package/target/main/ts/api/import/finding-import.d.ts +9 -0
  52. package/target/main/ts/api/import/finding-import.js +226 -0
  53. package/target/main/ts/api/import/lcov-files.d.ts +5 -0
  54. package/target/main/ts/api/import/lcov-files.js +13 -0
  55. package/target/main/ts/api/import/profile-file.d.ts +4 -0
  56. package/target/main/ts/api/import/profile-file.js +16 -0
  57. package/target/main/ts/api/worker/remote-executor.d.ts +2 -0
  58. package/target/main/ts/api/worker/remote-executor.js +45 -0
  59. package/target/main/ts/api/worker/worker-protocol.d.ts +7 -0
  60. package/target/main/ts/api/worker/worker-protocol.js +101 -0
  61. package/target/main/ts/api/worker/worker.d.ts +5 -0
  62. package/target/main/ts/api/worker/worker.js +85 -0
  63. package/target/main/ts/cli/arguments.d.ts +28 -0
  64. package/target/main/ts/cli/arguments.js +110 -0
  65. package/target/main/ts/cli/config.d.ts +14 -0
  66. package/target/main/ts/cli/config.js +60 -0
  67. package/target/main/ts/cli/github-pr-comment.d.ts +1 -0
  68. package/target/main/ts/cli/github-pr-comment.js +12 -0
  69. package/target/main/ts/cli/imports.d.ts +7 -0
  70. package/target/main/ts/cli/imports.js +29 -0
  71. package/target/main/ts/cli/main.d.ts +2 -0
  72. package/target/main/ts/cli/main.js +343 -284
  73. package/target/main/ts/cli/reporting.d.ts +18 -0
  74. package/target/main/ts/cli/reporting.js +108 -0
  75. package/target/main/ts/cli/revisions.d.ts +6 -0
  76. package/target/main/ts/cli/revisions.js +15 -0
  77. package/target/main/ts/cli/store.d.ts +13 -0
  78. package/target/main/ts/cli/store.js +38 -0
  79. package/target/main/ts/compose/analyze-snapshot.d.ts +4 -0
  80. package/target/main/ts/compose/analyze-snapshot.js +163 -0
  81. package/target/main/ts/compose/attach-churn.d.ts +2 -0
  82. package/target/main/ts/compose/attach-churn.js +37 -0
  83. package/target/main/ts/compose/diff-coverage.d.ts +20 -0
  84. package/target/main/ts/compose/diff-coverage.js +56 -0
  85. package/target/main/ts/compose/inspect.d.ts +23 -0
  86. package/target/main/ts/compose/inspect.js +44 -0
  87. package/target/main/ts/compose/plugin-list.d.ts +6 -0
  88. package/target/main/ts/compose/plugin-list.js +9 -0
  89. package/target/main/ts/compose/prepare-metabranch.d.ts +9 -0
  90. package/target/main/ts/compose/prepare-metabranch.js +16 -0
  91. package/target/main/ts/compose/review.d.ts +16 -0
  92. package/target/main/ts/compose/review.js +38 -0
  93. package/target/main/ts/compose/sources.d.ts +3 -0
  94. package/target/main/ts/compose/sources.js +29 -0
  95. package/target/main/ts/core/engine/execute.d.ts +10 -0
  96. package/target/main/ts/core/engine/execute.js +49 -0
  97. package/target/main/ts/core/engine/manifest.d.ts +4 -0
  98. package/target/main/ts/core/engine/manifest.js +104 -0
  99. package/target/main/ts/core/engine/plan.d.ts +22 -0
  100. package/target/main/ts/core/engine/plan.js +106 -0
  101. package/target/main/ts/core/engine/plugin.d.ts +59 -0
  102. package/target/main/ts/core/engine/plugin.js +4 -0
  103. package/target/main/ts/core/engine/report-products.d.ts +16 -0
  104. package/target/main/ts/core/engine/report-products.js +85 -0
  105. package/target/main/ts/core/model/changes.d.ts +8 -0
  106. package/target/main/ts/core/model/changes.js +1 -0
  107. package/target/main/ts/core/model/churn.d.ts +11 -0
  108. package/target/main/ts/core/model/churn.js +5 -0
  109. package/target/main/ts/core/model/clone-source.d.ts +16 -0
  110. package/target/main/ts/core/model/clone-source.js +14 -0
  111. package/target/main/ts/core/model/code-structure.d.ts +30 -0
  112. package/target/main/ts/core/model/code-structure.js +31 -0
  113. package/target/main/ts/core/model/comparison.d.ts +24 -0
  114. package/target/main/ts/core/model/comparison.js +1 -0
  115. package/target/main/ts/core/model/diff-coverage.d.ts +23 -0
  116. package/target/main/ts/core/model/diff-coverage.js +1 -0
  117. package/target/main/ts/core/model/finding-ignore.d.ts +8 -0
  118. package/target/main/ts/core/model/finding-ignore.js +35 -0
  119. package/target/main/ts/core/model/finding.d.ts +28 -0
  120. package/target/main/ts/core/model/finding.js +29 -0
  121. package/target/main/ts/core/model/ignore-rule.d.ts +11 -0
  122. package/target/main/ts/core/model/ignore-rule.js +1 -0
  123. package/target/main/ts/core/model/measurement.d.ts +27 -0
  124. package/target/main/ts/core/model/measurement.js +24 -0
  125. package/target/main/ts/core/model/metric-descriptor.d.ts +17 -0
  126. package/target/main/ts/core/model/metric-descriptor.js +1 -0
  127. package/target/main/ts/core/model/plugin-data.d.ts +25 -0
  128. package/target/main/ts/core/model/plugin-data.js +1 -0
  129. package/target/main/ts/core/model/pull-review.d.ts +48 -0
  130. package/target/main/ts/core/model/pull-review.js +1 -0
  131. package/target/main/ts/core/model/quality-summary.d.ts +42 -0
  132. package/target/main/ts/core/model/quality-summary.js +64 -0
  133. package/target/main/ts/core/model/report.d.ts +32 -0
  134. package/target/main/ts/core/model/report.js +5 -0
  135. package/target/main/ts/core/model/scanner-import.d.ts +39 -0
  136. package/target/main/ts/core/model/scanner-import.js +28 -0
  137. package/target/main/ts/core/model/snapshot.d.ts +15 -0
  138. package/target/main/ts/core/model/snapshot.js +50 -0
  139. package/target/main/ts/core/model/source-locator.d.ts +7 -0
  140. package/target/main/ts/core/model/source-locator.js +1 -0
  141. package/target/main/ts/core/model/source.d.ts +23 -0
  142. package/target/main/ts/core/model/source.js +1 -0
  143. package/target/main/ts/core/ports/report.d.ts +9 -0
  144. package/target/main/ts/core/ports/report.js +1 -0
  145. package/target/main/ts/core/ports/source-provider.d.ts +14 -0
  146. package/target/main/ts/core/ports/source-provider.js +4 -0
  147. package/target/main/ts/core/profile/exclusions.d.ts +11 -0
  148. package/target/main/ts/core/profile/exclusions.js +57 -0
  149. package/target/main/ts/core/profile/maintainability.d.ts +31 -0
  150. package/target/main/ts/core/profile/maintainability.js +9 -0
  151. package/target/main/ts/core/profile/profile.d.ts +4 -0
  152. package/target/main/ts/core/profile/profile.js +10 -0
  153. package/target/main/ts/core/usecases/compare.d.ts +6 -0
  154. package/target/main/ts/core/usecases/compare.js +145 -0
  155. package/target/main/ts/core/usecases/diff-coverage-policy.d.ts +6 -0
  156. package/target/main/ts/core/usecases/diff-coverage-policy.js +10 -0
  157. package/target/main/ts/core/usecases/diff-coverage.d.ts +40 -0
  158. package/target/main/ts/core/usecases/diff-coverage.js +15 -0
  159. package/target/main/ts/core/usecases/inspect.d.ts +38 -0
  160. package/target/main/ts/core/usecases/inspect.js +41 -0
  161. package/target/main/ts/core/usecases/review.d.ts +31 -0
  162. package/target/main/ts/core/usecases/review.js +128 -0
  163. package/target/main/ts/index.d.ts +35 -0
  164. package/target/main/ts/index.js +17 -13
  165. package/target/main/ts/plugin.d.ts +14 -0
  166. package/target/main/ts/plugin.js +5 -0
  167. package/target/main/ts/plugins/coverage/coverage.d.ts +23 -0
  168. package/target/main/ts/plugins/coverage/coverage.js +120 -0
  169. package/target/main/ts/plugins/coverage/diff-coverage.d.ts +7 -0
  170. package/target/main/ts/plugins/coverage/diff-coverage.js +89 -0
  171. package/target/main/ts/plugins/duplication/duplication.d.ts +4 -0
  172. package/target/main/ts/plugins/duplication/duplication.js +93 -0
  173. package/target/main/ts/plugins/language-js/babel-provider.d.ts +10 -0
  174. package/target/main/ts/plugins/language-js/babel-provider.js +46 -0
  175. package/target/main/ts/plugins/language-js/clone-candidates.d.ts +3 -0
  176. package/target/main/ts/plugins/language-js/clone-candidates.js +64 -0
  177. package/target/main/ts/plugins/language-js/code-lines.d.ts +6 -0
  178. package/target/main/ts/plugins/language-js/code-lines.js +35 -0
  179. package/target/main/ts/plugins/language-js/function-facts.d.ts +8 -0
  180. package/target/main/ts/plugins/language-js/function-facts.js +60 -0
  181. package/target/main/ts/plugins/language-js/structural-observations.d.ts +8 -0
  182. package/target/main/ts/plugins/language-js/structural-observations.js +79 -0
  183. package/target/main/ts/plugins/maintainability/maintainability.d.ts +9 -0
  184. package/target/main/ts/plugins/maintainability/maintainability.js +42 -0
  185. package/target/main/ts/plugins/maintainability/structural-smells.d.ts +3 -0
  186. package/target/main/ts/plugins/maintainability/structural-smells.js +15 -0
  187. package/target/main/ts/plugins/source/forges.d.ts +4 -0
  188. package/target/main/ts/plugins/source/forges.js +79 -0
  189. package/target/main/ts/plugins/structure/structure.d.ts +2 -0
  190. package/target/main/ts/plugins/structure/structure.js +37 -0
  191. package/target/main/ts/report/html/app/viewer-access.d.ts +19 -0
  192. package/target/main/ts/report/html/app/viewer-access.js +25 -0
  193. package/target/main/ts/report/html/app/viewer-chart.d.ts +101 -0
  194. package/target/main/ts/report/html/app/viewer-chart.js +711 -0
  195. package/target/main/ts/report/html/app/viewer-commits.d.ts +36 -0
  196. package/target/main/ts/report/html/app/viewer-commits.js +280 -0
  197. package/target/main/ts/report/html/app/viewer-data.d.ts +23 -0
  198. package/target/main/ts/report/html/app/viewer-data.js +105 -0
  199. package/target/main/ts/report/html/app/viewer-files.d.ts +117 -0
  200. package/target/main/ts/report/html/app/viewer-files.js +2087 -0
  201. package/target/main/ts/report/html/app/viewer-filter.d.ts +113 -0
  202. package/target/main/ts/report/html/app/viewer-filter.js +492 -0
  203. package/target/main/ts/report/html/app/viewer-metric-registry.d.ts +68 -0
  204. package/target/main/ts/report/html/app/viewer-metric-registry.js +206 -0
  205. package/target/main/ts/report/html/app/viewer-metrics.d.ts +44 -0
  206. package/target/main/ts/report/html/app/viewer-metrics.js +172 -0
  207. package/target/main/ts/report/html/app/viewer-profile.d.ts +17 -0
  208. package/target/main/ts/report/html/app/viewer-profile.js +401 -0
  209. package/target/main/ts/report/html/app/viewer-projects.d.ts +1 -0
  210. package/target/main/ts/report/html/app/viewer-projects.js +90 -0
  211. package/target/main/ts/report/html/app/viewer-pulls.d.ts +3 -0
  212. package/target/main/ts/report/html/app/viewer-pulls.js +242 -0
  213. package/target/main/ts/report/html/app/viewer-source.d.ts +75 -0
  214. package/target/main/ts/report/html/app/viewer-source.js +313 -0
  215. package/target/main/ts/report/html/app/viewer-trends.d.ts +74 -0
  216. package/target/main/ts/report/html/app/viewer-trends.js +413 -0
  217. package/target/main/ts/report/html/app/viewer.d.ts +1 -0
  218. package/target/main/ts/report/html/app/viewer.js +794 -0
  219. package/target/main/ts/report/html/site/badges.d.ts +14 -0
  220. package/target/main/ts/report/html/site/badges.js +39 -0
  221. package/target/main/ts/report/html/site/export-site.d.ts +21 -0
  222. package/target/main/ts/report/html/site/export-site.js +157 -0
  223. package/target/main/ts/report/html/site/exported-server.d.ts +6 -0
  224. package/target/main/ts/report/html/site/exported-server.js +70 -0
  225. package/target/main/ts/report/html/site/local-server.d.ts +7 -0
  226. package/target/main/ts/report/html/site/local-server.js +64 -0
  227. package/target/main/ts/report/html/site/projects.d.ts +3 -0
  228. package/target/main/ts/report/html/site/projects.js +79 -0
  229. package/target/main/ts/report/html/site/server.d.ts +4 -0
  230. package/target/main/ts/report/html/site/server.js +64 -0
  231. package/target/main/ts/report/html/site/source-route.d.ts +6 -0
  232. package/target/main/ts/report/html/site/source-route.js +22 -0
  233. package/target/main/ts/report/json/projections/commit-summary.d.ts +11 -0
  234. package/target/main/ts/report/json/projections/commit-summary.js +118 -0
  235. package/target/main/ts/report/json/projections/components.d.ts +4 -0
  236. package/target/main/ts/report/json/projections/components.js +29 -0
  237. package/target/main/ts/report/json/projections/file-metrics.d.ts +5 -0
  238. package/target/main/ts/report/json/projections/file-metrics.js +243 -0
  239. package/target/main/ts/report/json/projections/inspection-context.d.ts +6 -0
  240. package/target/main/ts/report/json/projections/inspection-context.js +92 -0
  241. package/target/main/ts/report/json/projections/inspection-details.d.ts +11 -0
  242. package/target/main/ts/report/json/projections/inspection-details.js +69 -0
  243. package/target/main/ts/report/json/projections/metric-values.d.ts +7 -0
  244. package/target/main/ts/report/json/projections/metric-values.js +57 -0
  245. package/target/main/ts/report/json/projections/public-history.d.ts +4 -0
  246. package/target/main/ts/report/json/projections/public-history.js +16 -0
  247. package/target/main/ts/report/json/store/components.d.ts +2 -0
  248. package/target/main/ts/report/json/store/components.js +31 -0
  249. package/target/main/ts/report/json/store/local-store.d.ts +13 -0
  250. package/target/main/ts/report/json/store/local-store.js +179 -0
  251. package/target/main/ts/report/json/store/pull-review-store.d.ts +3 -0
  252. package/target/main/ts/report/json/store/pull-review-store.js +51 -0
  253. package/target/main/ts/report/json/validation/metabranch.d.ts +4 -0
  254. package/target/main/ts/report/json/validation/metabranch.js +7 -0
  255. package/target/main/ts/report/json/validation/report.d.ts +15 -0
  256. package/target/main/ts/report/json/validation/report.js +64 -0
  257. package/target/main/ts/report/json/validation/summary-validation.d.ts +4 -0
  258. package/target/main/ts/report/json/validation/summary-validation.js +27 -0
  259. package/target/main/ts/report/json/wire/compact-json.d.ts +11 -0
  260. package/target/main/ts/report/json/wire/compact-json.js +76 -0
  261. package/target/main/ts/report/json/wire/component-model.d.ts +9 -0
  262. package/target/main/ts/report/json/wire/component-model.js +1 -0
  263. package/target/main/ts/report/json/wire/domain-types.d.ts +2 -0
  264. package/target/main/ts/report/json/wire/domain-types.js +1 -0
  265. package/target/main/ts/report/json/wire/file-metrics-model.d.ts +77 -0
  266. package/target/main/ts/report/json/wire/file-metrics-model.js +1 -0
  267. package/target/main/ts/report/json/wire/inspection-context-model.d.ts +26 -0
  268. package/target/main/ts/report/json/wire/inspection-context-model.js +1 -0
  269. package/target/main/ts/report/json/wire/inspection-details-model.d.ts +82 -0
  270. package/target/main/ts/report/json/wire/inspection-details-model.js +1 -0
  271. package/target/main/ts/report/json/wire/project-model.d.ts +7 -0
  272. package/target/main/ts/report/json/wire/project-model.js +1 -0
  273. package/target/main/ts/report/json/wire/public-history-model.d.ts +42 -0
  274. package/target/main/ts/report/json/wire/public-history-model.js +6 -0
  275. package/target/main/ts/report/json/wire/pull-review-model.d.ts +7 -0
  276. package/target/main/ts/report/json/wire/pull-review-model.js +1 -0
  277. package/target/main/ts/report/json/wire/summary-model.d.ts +45 -0
  278. package/target/main/ts/report/json/wire/summary-model.js +1 -0
  279. package/target/main/ts/report.d.ts +11 -0
  280. package/target/main/ts/report.js +5 -0
  281. package/index.js +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Idleware
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Repometry
2
2
 
3
- **Track repository metrics without SaaS**
3
+ > Track repository metrics without SaaS
4
4
 
5
5
  Git can serve as a project’s single source of truth for code, tests, docs, and CI configuration. Repometry lets you keep coverage and maintainability metrics alongside your code, commit by commit.
6
+
7
+ ## Requirements
8
+
9
+ Node.js >= 24
10
+
11
+ ## Usage
12
+
13
+ Run each command in your repository as `npx repometry <command>`.
14
+
15
+ | Command | What it does |
16
+ |---|---|
17
+ | `analyze` | Measures HEAD and saves the inspection under `.repometry/` |
18
+ | `analyze HEAD~50..HEAD` | Measures the last 50 commits, oldest first, to build history. `--skip-saved` leaves commits already saved. |
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 public report (history, aggregates, badges) to `.repometry/report/html` |
21
+ | `report html --mode private -o DIR` | Writes the private report, with per-file metrics, findings and source links, to `DIR` |
22
+ | `view` | Serves the report locally on a free port; `--port 3030` picks the port |
23
+ | `plugins` | Lists the import formats, reporters and CI adapters |
24
+ | `help [command]` | Shows the options of a command |
25
+
26
+ ## License
27
+
28
+ [MIT](LICENSE)
package/package.json CHANGED
@@ -1,16 +1,56 @@
1
1
  {
2
2
  "name": "repometry",
3
- "version": "0.0.0-dev.0",
3
+ "version": "0.1.0",
4
4
  "description": "Track repository metrics without SaaS",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/idleware/repometry.git"
9
+ },
10
+ "homepage": "https://github.com/idleware/repometry#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/idleware/repometry/issues"
13
+ },
14
+ "keywords": [
15
+ "repository",
16
+ "metrics",
17
+ "coverage",
18
+ "maintainability",
19
+ "static-analysis"
20
+ ],
5
21
  "type": "module",
6
- "engines": { "node": ">=24" },
7
- "bin": { "repometry": "./target/main/ts/cli/main.js" },
8
- "exports": { ".": { "types": "./target/main/ts/index.d.ts", "default": "./target/main/ts/index.js" } },
9
- "files": ["index.js"],
22
+ "engines": {
23
+ "node": ">=24"
24
+ },
25
+ "bin": {
26
+ "repometry": "target/main/ts/cli/main.js"
27
+ },
28
+ "exports": {
29
+ ".": {
30
+ "types": "./target/main/ts/index.d.ts",
31
+ "default": "./target/main/ts/index.js"
32
+ },
33
+ "./plugin": {
34
+ "types": "./target/main/ts/plugin.d.ts",
35
+ "default": "./target/main/ts/plugin.js"
36
+ },
37
+ "./report": {
38
+ "types": "./target/main/ts/report.d.ts",
39
+ "default": "./target/main/ts/report.js"
40
+ }
41
+ },
42
+ "files": [
43
+ "target/main"
44
+ ],
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
10
48
  "scripts": {
11
- "build": "tsc -p tsconfig.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 })\"",
49
+ "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 })\"",
12
50
  "test": "npm run build && tsc -p tsconfig.test.json && node --test 'target/verification/test/ts/*.test.js'",
13
- "prepack": "npm run build"
51
+ "coverage": "npm run build && tsc -p tsconfig.json --sourceMap && tsc -p tsconfig.browser.json --sourceMap && tsc -p tsconfig.test.json --sourceMap && 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
+ "prepack": "npm run build",
53
+ "release": "npx --yes zx-semrel@1.25.1"
14
54
  },
15
55
  "dependencies": {
16
56
  "@babel/parser": "7.29.15",
@@ -19,6 +59,7 @@
19
59
  },
20
60
  "devDependencies": {
21
61
  "@types/node": "24.19.2",
62
+ "c8": "12.0.0",
22
63
  "typescript": "7.0.2"
23
64
  }
24
65
  }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:repometry:schema:compact-json:1",
4
+ "type": "object",
5
+ "required": ["schema", "strings", "shapes", "data"],
6
+ "properties": {
7
+ "schema": { "const": "urn:repometry:schema:compact-json:1" },
8
+ "summary": { "$ref": "urn:repometry:schema:repository-summary:1#/$defs/commit" },
9
+ "strings": { "type": "array", "items": { "type": "string" } },
10
+ "shapes": { "type": "array", "items": { "type": "array", "uniqueItems": true, "items": { "type": "string" } } },
11
+ "data": { "$ref": "#/$defs/node" }
12
+ },
13
+ "additionalProperties": false,
14
+ "$defs": {
15
+ "node": {
16
+ "anyOf": [
17
+ { "type": "null" },
18
+ { "type": "number" },
19
+ { "type": "boolean" },
20
+ { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/node" } }
21
+ ]
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:repometry:schema:comparison:1",
4
+ "type": "object",
5
+ "required": ["schema", "baseline", "current", "metrics"],
6
+ "properties": {
7
+ "schema": { "const": "urn:repometry:schema:comparison:1" },
8
+ "baseline": { "$ref": "#/$defs/inspection" },
9
+ "current": { "$ref": "#/$defs/inspection" },
10
+ "metrics": {
11
+ "type": "object",
12
+ "required": ["physicalLines", "functions", "maxCyclomaticComplexity", "lineCoverage"],
13
+ "properties": {
14
+ "physicalLines": { "$ref": "#/$defs/metric" },
15
+ "functions": { "$ref": "#/$defs/metric" },
16
+ "maxCyclomaticComplexity": { "$ref": "#/$defs/metric" },
17
+ "lineCoverage": { "$ref": "#/$defs/metric" }
18
+ },
19
+ "additionalProperties": false
20
+ }
21
+ },
22
+ "additionalProperties": false,
23
+ "$defs": {
24
+ "inspection": {
25
+ "type": "object",
26
+ "required": ["subject", "generatedAt", "status", "scope"],
27
+ "properties": {
28
+ "subject": { "$ref": "urn:repometry:schema:report:1#/$defs/subject" },
29
+ "generatedAt": { "$ref": "urn:repometry:schema:report:1#/properties/generatedAt" },
30
+ "status": { "$ref": "urn:repometry:schema:report:1#/properties/status" },
31
+ "scope": { "$ref": "urn:repometry:schema:report:1#/properties/scope" }
32
+ },
33
+ "additionalProperties": false
34
+ },
35
+ "observation": {
36
+ "type": "object",
37
+ "required": ["status", "value"],
38
+ "properties": {
39
+ "status": { "enum": ["complete", "partial", "not-applicable", "unavailable"] },
40
+ "value": { "type": ["number", "null"], "minimum": 0 },
41
+ "covered": { "$ref": "urn:repometry:schema:report:1#/$defs/count" },
42
+ "total": { "$ref": "urn:repometry:schema:report:1#/$defs/count" }
43
+ },
44
+ "dependentRequired": { "covered": ["total"], "total": ["covered"] },
45
+ "additionalProperties": false
46
+ },
47
+ "metric": {
48
+ "type": "object",
49
+ "required": ["definition", "unit", "baseline", "current", "status", "reason", "delta"],
50
+ "properties": {
51
+ "definition": { "type": "string" },
52
+ "unit": { "enum": ["count", "percent"] },
53
+ "baseline": { "$ref": "#/$defs/observation" },
54
+ "current": { "$ref": "#/$defs/observation" },
55
+ "status": { "enum": ["comparable", "incompatible", "unavailable"] },
56
+ "reason": { "enum": [null, "observations-unavailable", "source-scope-unknown", "source-scope-changed", "method-unknown", "method-changed"] },
57
+ "delta": { "type": ["number", "null"] }
58
+ },
59
+ "if": { "properties": { "status": { "const": "comparable" } } },
60
+ "then": { "properties": { "reason": { "const": null }, "delta": { "type": "number" } } },
61
+ "else": { "properties": { "reason": { "type": "string" }, "delta": { "const": null } } },
62
+ "additionalProperties": false
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:repometry:schema:config:1",
4
+ "type": "object",
5
+ "properties": {
6
+ "$schema": { "type": "string" },
7
+ "exclude": { "$ref": "#/$defs/strings" },
8
+ "ignore": {
9
+ "type": "array",
10
+ "items": {
11
+ "type": "object",
12
+ "properties": {
13
+ "tool": { "type": "string", "minLength": 1 },
14
+ "rule": { "type": "string", "minLength": 1 },
15
+ "path": { "type": "string", "minLength": 1 },
16
+ "reason": { "type": "string", "minLength": 1 }
17
+ },
18
+ "anyOf": [{ "required": ["tool"] }, { "required": ["rule"] }, { "required": ["path"] }],
19
+ "additionalProperties": false
20
+ }
21
+ },
22
+ "imports": { "$ref": "#/$defs/strings" },
23
+ "reports": { "$ref": "#/$defs/strings" },
24
+ "mode": { "enum": ["public", "private"] },
25
+ "sources": { "type": "string", "minLength": 1 },
26
+ "branch": { "type": "string", "minLength": 1 },
27
+ "minCoverage": { "type": "number", "minimum": 0, "maximum": 100 },
28
+ "minLines": { "type": "integer", "minimum": 0 },
29
+ "maxCoverageDrop": { "type": "number", "minimum": 0, "maximum": 100 },
30
+ "maxNewIssues": { "type": "integer", "minimum": 0 }
31
+ },
32
+ "additionalProperties": false,
33
+ "$defs": { "strings": { "type": "array", "items": { "type": "string", "minLength": 1 } } }
34
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:repometry:schema:diff-coverage:1",
4
+ "type": "object",
5
+ "required": ["schema", "requestedBase", "base", "head", "generatedAt", "appliedConfig", "status", "covered", "total", "percent", "files", "gaps", "decision"],
6
+ "properties": {
7
+ "schema": { "const": "urn:repometry:schema:diff-coverage:1" },
8
+ "requestedBase": { "$ref": "#/$defs/sha" },
9
+ "base": { "$ref": "#/$defs/sha" },
10
+ "head": { "$ref": "#/$defs/sha" },
11
+ "generatedAt": { "type": "string" },
12
+ "appliedConfig": { "type": "object", "minProperties": 1 },
13
+ "status": { "enum": ["complete", "partial", "not-applicable"] },
14
+ "covered": { "$ref": "#/$defs/count" },
15
+ "total": { "$ref": "#/$defs/count" },
16
+ "percent": { "anyOf": [{ "$ref": "#/$defs/percent" }, { "type": "null" }] },
17
+ "files": { "type": "array", "items": { "$ref": "#/$defs/file" } },
18
+ "gaps": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "object",
22
+ "required": ["path", "reason"],
23
+ "properties": { "path": { "type": "string" }, "reason": { "type": "string" } },
24
+ "additionalProperties": false
25
+ }
26
+ },
27
+ "decision": { "anyOf": [{ "$ref": "#/$defs/decision" }, { "type": "null" }] }
28
+ },
29
+ "additionalProperties": false,
30
+ "$defs": {
31
+ "sha": { "type": "string", "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})$" },
32
+ "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
33
+ "percent": { "type": "number", "minimum": 0, "maximum": 100 },
34
+ "file": {
35
+ "type": "object",
36
+ "required": ["path", "addedLines", "covered", "total"],
37
+ "properties": {
38
+ "path": { "type": "string", "minLength": 1 },
39
+ "addedLines": { "$ref": "#/$defs/count" },
40
+ "covered": { "anyOf": [{ "$ref": "#/$defs/count" }, { "type": "null" }] },
41
+ "total": { "anyOf": [{ "$ref": "#/$defs/count" }, { "type": "null" }] }
42
+ },
43
+ "additionalProperties": false
44
+ },
45
+ "decision": {
46
+ "type": "object",
47
+ "required": ["status", "minimumPercent"],
48
+ "properties": {
49
+ "status": { "enum": ["passed", "failed", "indeterminate", "not-applicable"] },
50
+ "minimumPercent": { "$ref": "#/$defs/percent" }
51
+ },
52
+ "additionalProperties": false
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,134 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:repometry:schema:file-metrics:1",
4
+ "type": "object",
5
+ "required": ["schema", "subject", "generatedAt", "status", "scope", "files", "directories", "unassignedDiagnostics", "hotspots"],
6
+ "properties": {
7
+ "schema": { "const": "urn:repometry:schema:file-metrics:1" },
8
+ "subject": { "$ref": "urn:repometry:schema:report:1#/$defs/subject" },
9
+ "generatedAt": { "$ref": "urn:repometry:schema:report:1#/properties/generatedAt" },
10
+ "status": { "$ref": "urn:repometry:schema:report:1#/properties/status" },
11
+ "scope": { "$ref": "urn:repometry:schema:report:1#/properties/scope" },
12
+ "files": { "type": "array", "items": { "$ref": "#/$defs/file" } },
13
+ "directories": { "type": "array", "items": { "$ref": "#/$defs/directory" } },
14
+ "languages": {
15
+ "type": "array",
16
+ "items": {
17
+ "type": "object",
18
+ "required": ["id", "analysed"],
19
+ "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "analysed": { "type": "boolean" } },
20
+ "additionalProperties": false
21
+ }
22
+ },
23
+ "catalog": { "$ref": "urn:repometry:schema:metric-catalog:1" },
24
+ "unassignedDiagnostics": { "$ref": "#/$defs/count" },
25
+ "churnWindow": {
26
+ "type": "object",
27
+ "required": ["lookbackDays", "maxCommits", "endingAt", "commits", "shallow", "capReached"],
28
+ "properties": {
29
+ "lookbackDays": { "type": "integer", "minimum": 1 },
30
+ "maxCommits": { "type": "integer", "minimum": 1 },
31
+ "endingAt": { "type": "string" },
32
+ "commits": { "$ref": "#/$defs/count" },
33
+ "shallow": { "type": "boolean" },
34
+ "capReached": { "type": "boolean" }
35
+ },
36
+ "additionalProperties": false
37
+ },
38
+ "hotspots": {
39
+ "type": "object",
40
+ "required": ["complexity", "missedLines"],
41
+ "properties": {
42
+ "complexity": { "type": "array", "items": { "type": "string" } },
43
+ "missedLines": { "type": "array", "items": { "type": "string" } },
44
+ "cognitive": { "type": "array", "items": { "type": "string" } },
45
+ "duplication": { "type": "array", "items": { "type": "string" } },
46
+ "churn": { "type": "array", "items": { "type": "string" } }
47
+ },
48
+ "additionalProperties": false
49
+ }
50
+ },
51
+ "additionalProperties": false,
52
+ "$defs": {
53
+ "count": { "$ref": "urn:repometry:schema:report:1#/$defs/count" },
54
+ "optionalCount": { "anyOf": [{ "$ref": "#/$defs/count" }, { "type": "null" }] },
55
+ "observations": {
56
+ "type": "object",
57
+ "required": ["path", "lines", "functions", "complexity", "lineCoverage", "diagnosticCount"],
58
+ "properties": {
59
+ "language": { "type": "integer", "minimum": 0 },
60
+ "analysed": { "type": "boolean" },
61
+ "values": {
62
+ "type": "object",
63
+ "propertyNames": { "pattern": "^(?:0|[1-9][0-9]*)$" },
64
+ "additionalProperties": { "type": ["number", "null"] }
65
+ },
66
+ "path": { "type": "string" },
67
+ "lines": { "$ref": "#/$defs/optionalCount" },
68
+ "bytes": { "$ref": "#/$defs/count" },
69
+ "functions": { "$ref": "#/$defs/optionalCount" },
70
+ "complexity": {
71
+ "type": ["object", "null"],
72
+ "required": ["sum", "maximum", "measuredFunctions"],
73
+ "properties": {
74
+ "sum": { "$ref": "#/$defs/count" },
75
+ "maximum": { "$ref": "#/$defs/optionalCount" },
76
+ "measuredFunctions": { "$ref": "#/$defs/count" }
77
+ },
78
+ "additionalProperties": false
79
+ },
80
+ "lineCoverage": {
81
+ "type": ["object", "null"],
82
+ "required": ["covered", "total"],
83
+ "properties": {
84
+ "covered": { "$ref": "#/$defs/count" },
85
+ "total": { "$ref": "#/$defs/count" }
86
+ },
87
+ "additionalProperties": false
88
+ },
89
+ "diagnosticCount": { "$ref": "#/$defs/count" },
90
+ "quality": {
91
+ "type": "object",
92
+ "properties": {
93
+ "codeLines": { "$ref": "#/$defs/count" },
94
+ "commentLines": { "$ref": "#/$defs/count" },
95
+ "classes": { "$ref": "#/$defs/count" },
96
+ "cognitiveComplexity": { "$ref": "#/$defs/count" },
97
+ "churn": { "$ref": "#/$defs/count" },
98
+ "duplication": {
99
+ "type": "object",
100
+ "required": ["duplicatedLines", "codeLines"],
101
+ "properties": {
102
+ "duplicatedLines": { "$ref": "#/$defs/count" },
103
+ "codeLines": { "$ref": "#/$defs/count" }
104
+ },
105
+ "additionalProperties": false
106
+ },
107
+ "maintainability": {
108
+ "type": "object",
109
+ "required": ["smells", "effortMinutes"],
110
+ "properties": {
111
+ "smells": { "$ref": "#/$defs/count" },
112
+ "effortMinutes": { "$ref": "#/$defs/optionalCount" }
113
+ },
114
+ "additionalProperties": false
115
+ }
116
+ },
117
+ "additionalProperties": false
118
+ }
119
+ }
120
+ },
121
+ "file": { "type": "object", "allOf": [{ "$ref": "#/$defs/observations" }], "unevaluatedProperties": false },
122
+ "directory": {
123
+ "type": "object",
124
+ "allOf": [{ "$ref": "#/$defs/observations" }],
125
+ "required": ["files", "sizeMeasuredFiles", "coverageMeasuredFiles"],
126
+ "properties": {
127
+ "files": { "$ref": "#/$defs/count" },
128
+ "sizeMeasuredFiles": { "$ref": "#/$defs/count" },
129
+ "coverageMeasuredFiles": { "$ref": "#/$defs/count" }
130
+ },
131
+ "unevaluatedProperties": false
132
+ }
133
+ }
134
+ }
@@ -0,0 +1,172 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:repometry:schema:inspection-context:1",
4
+ "type": "object",
5
+ "patternProperties": {
6
+ "^(?:[a-f0-9]{40}|[a-f0-9]{64})$": {
7
+ "$ref": "#/$defs/inspectionContext"
8
+ }
9
+ },
10
+ "additionalProperties": false,
11
+ "$defs": {
12
+ "complexFunctions": {
13
+ "type": "array",
14
+ "maxItems": 5,
15
+ "items": {
16
+ "type": "object",
17
+ "required": [
18
+ "name",
19
+ "path",
20
+ "line",
21
+ "complexity"
22
+ ],
23
+ "properties": {
24
+ "name": {
25
+ "type": "string"
26
+ },
27
+ "path": {
28
+ "type": "string"
29
+ },
30
+ "line": {
31
+ "type": [
32
+ "integer",
33
+ "null"
34
+ ],
35
+ "minimum": 1
36
+ },
37
+ "complexity": {
38
+ "type": "number"
39
+ }
40
+ },
41
+ "additionalProperties": false
42
+ }
43
+ },
44
+ "inspectionContext": {
45
+ "type": "object",
46
+ "required": [
47
+ "exclusions",
48
+ "boundary"
49
+ ],
50
+ "properties": {
51
+ "exclusions": {
52
+ "type": [
53
+ "object",
54
+ "null"
55
+ ],
56
+ "required": [
57
+ "paths",
58
+ "directories"
59
+ ],
60
+ "properties": {
61
+ "paths": {
62
+ "type": "array",
63
+ "items": {
64
+ "type": "string"
65
+ }
66
+ },
67
+ "directories": {
68
+ "type": "array",
69
+ "items": {
70
+ "type": "string"
71
+ }
72
+ }
73
+ },
74
+ "additionalProperties": false
75
+ },
76
+ "boundary": {
77
+ "enum": [
78
+ null,
79
+ "changed",
80
+ "unavailable"
81
+ ]
82
+ },
83
+ "scanners": {
84
+ "type": "array",
85
+ "items": {
86
+ "type": "object",
87
+ "required": [
88
+ "name",
89
+ "version"
90
+ ],
91
+ "properties": {
92
+ "name": {
93
+ "type": "string"
94
+ },
95
+ "version": {
96
+ "type": [
97
+ "string",
98
+ "null"
99
+ ]
100
+ }
101
+ },
102
+ "additionalProperties": false
103
+ }
104
+ },
105
+ "ignores": {
106
+ "type": "object",
107
+ "required": [
108
+ "rules",
109
+ "count"
110
+ ],
111
+ "properties": {
112
+ "count": {
113
+ "type": "integer",
114
+ "minimum": 0
115
+ },
116
+ "rules": {
117
+ "type": "array",
118
+ "items": {
119
+ "type": "object",
120
+ "properties": {
121
+ "tool": {
122
+ "type": "string"
123
+ },
124
+ "rule": {
125
+ "type": "string"
126
+ },
127
+ "path": {
128
+ "type": "string"
129
+ },
130
+ "reason": {
131
+ "type": "string"
132
+ }
133
+ },
134
+ "additionalProperties": false
135
+ }
136
+ }
137
+ },
138
+ "additionalProperties": false
139
+ },
140
+ "security": {
141
+ "type": "object",
142
+ "required": [
143
+ "low",
144
+ "medium",
145
+ "high",
146
+ "unknown"
147
+ ],
148
+ "properties": {
149
+ "low": {
150
+ "type": "integer",
151
+ "minimum": 0
152
+ },
153
+ "medium": {
154
+ "type": "integer",
155
+ "minimum": 0
156
+ },
157
+ "high": {
158
+ "type": "integer",
159
+ "minimum": 0
160
+ },
161
+ "unknown": {
162
+ "type": "integer",
163
+ "minimum": 0
164
+ }
165
+ },
166
+ "additionalProperties": false
167
+ }
168
+ },
169
+ "additionalProperties": false
170
+ }
171
+ }
172
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:repometry:schema:metabranch:1",
4
+ "type": "object",
5
+ "required": ["schema"],
6
+ "properties": {
7
+ "schema": { "const": "urn:repometry:schema:metabranch:1" }
8
+ }
9
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:repometry:schema:metric-catalog:1",
4
+ "type": "array",
5
+ "items": {
6
+ "type": "object",
7
+ "required": ["id", "label", "unit", "scope", "aggregate", "better"],
8
+ "properties": {
9
+ "id": { "type": "string", "minLength": 1 },
10
+ "label": { "type": "string", "minLength": 1 },
11
+ "short": { "type": "string", "minLength": 1 },
12
+ "description": { "type": "string", "minLength": 1 },
13
+ "unit": { "enum": ["count", "ratio", "minutes"] },
14
+ "scope": { "enum": ["repository", "file", "function"] },
15
+ "aggregate": { "enum": ["sum", "max", "none"] },
16
+ "ratio": {
17
+ "type": "object",
18
+ "required": ["of", "over"],
19
+ "properties": {
20
+ "of": { "type": "string", "minLength": 1 },
21
+ "over": { "type": "string", "minLength": 1 }
22
+ },
23
+ "additionalProperties": false
24
+ },
25
+ "better": { "enum": ["lower", "higher", "none"] },
26
+ "bands": { "type": "array", "minItems": 4, "maxItems": 4, "items": { "type": "number" } },
27
+ "group": { "type": "string", "minLength": 1 }
28
+ },
29
+ "additionalProperties": false
30
+ }
31
+ }