@repometry/cli 0.0.0-stage → 0.0.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/LICENSE +21 -0
- package/README.md +70 -2
- package/package.json +75 -4
- package/target/main/resources/language-catalog.json +61 -0
- package/target/main/resources/report/json/compact-json-v1.schema.json +24 -0
- package/target/main/resources/report/json/comparison-v1.schema.json +65 -0
- package/target/main/resources/report/json/config-v2.schema.json +224 -0
- package/target/main/resources/report/json/diff-coverage-v1.schema.json +55 -0
- package/target/main/resources/report/json/file-metrics-v1.schema.json +157 -0
- package/target/main/resources/report/json/metabranch-v1.schema.json +9 -0
- package/target/main/resources/report/json/metric-catalog-v1.schema.json +31 -0
- package/target/main/resources/report/json/pull-review-v1.schema.json +97 -0
- package/target/main/resources/report/json/pull-review-v2.schema.json +100 -0
- package/target/main/resources/report/json/report-v2.schema.json +530 -0
- package/target/main/resources/report/json/repository-summary-v1.schema.json +337 -0
- package/target/main/resources/report/json/viewer-inspection-v1.schema.json +534 -0
- package/target/main/resources/viewer/files.css +616 -0
- package/target/main/resources/viewer/index.html +120 -0
- package/target/main/resources/viewer/projects.html +52 -0
- package/target/main/resources/viewer/styles.css +579 -0
- package/target/main/resources/viewer/viewer-pulls.css +64 -0
- package/target/main/ts/api/cache/root.d.ts +2 -0
- package/target/main/ts/api/cache/root.js +21 -0
- package/target/main/ts/api/gh/github.d.ts +4 -0
- package/target/main/ts/api/gh/github.js +47 -0
- package/target/main/ts/api/git/blob-batch.d.ts +10 -0
- package/target/main/ts/api/git/blob-batch.js +107 -0
- package/target/main/ts/api/git/blob-history.d.ts +20 -0
- package/target/main/ts/api/git/blob-history.js +54 -0
- package/target/main/ts/api/git/changes.d.ts +27 -0
- package/target/main/ts/api/git/changes.js +117 -0
- package/target/main/ts/api/git/commit-metadata.d.ts +2 -0
- package/target/main/ts/api/git/commit-metadata.js +46 -0
- package/target/main/ts/api/git/git-churn.d.ts +9 -0
- package/target/main/ts/api/git/git-churn.js +72 -0
- package/target/main/ts/api/git/git-executable.d.ts +1 -0
- package/target/main/ts/api/git/git-executable.js +31 -0
- package/target/main/ts/api/git/git-reader.d.ts +24 -0
- package/target/main/ts/api/git/git-reader.js +113 -0
- package/target/main/ts/api/git/git.d.ts +47 -0
- package/target/main/ts/api/git/git.js +289 -0
- package/target/main/ts/api/git/inspection-source.d.ts +17 -0
- package/target/main/ts/api/git/inspection-source.js +36 -0
- package/target/main/ts/api/git/line-changes.d.ts +6 -0
- package/target/main/ts/api/git/line-changes.js +57 -0
- package/target/main/ts/api/git/local-sources.d.ts +5 -0
- package/target/main/ts/api/git/local-sources.js +48 -0
- package/target/main/ts/api/git/local.d.ts +7 -0
- package/target/main/ts/api/git/local.js +106 -0
- package/target/main/ts/api/git/source-cache.d.ts +1 -0
- package/target/main/ts/api/git/source-cache.js +42 -0
- package/target/main/ts/api/import/cobertura.d.ts +2 -0
- package/target/main/ts/api/import/cobertura.js +160 -0
- package/target/main/ts/api/import/coverage-xml.d.ts +7 -0
- package/target/main/ts/api/import/coverage-xml.js +135 -0
- package/target/main/ts/api/import/finding-import.d.ts +9 -0
- package/target/main/ts/api/import/finding-import.js +227 -0
- package/target/main/ts/api/import/go-cover.d.ts +13 -0
- package/target/main/ts/api/import/go-cover.js +150 -0
- package/target/main/ts/api/import/lcov-files.d.ts +12 -0
- package/target/main/ts/api/import/lcov-files.js +53 -0
- package/target/main/ts/api/import/profile-file.d.ts +4 -0
- package/target/main/ts/api/import/profile-file.js +17 -0
- package/target/main/ts/api/process/docker-tool-runner.d.ts +13 -0
- package/target/main/ts/api/process/docker-tool-runner.js +92 -0
- package/target/main/ts/api/process/failure.d.ts +1 -0
- package/target/main/ts/api/process/failure.js +12 -0
- package/target/main/ts/api/process/plugin.d.ts +13 -0
- package/target/main/ts/api/process/plugin.js +100 -0
- package/target/main/ts/api/process/tool-snapshot.d.ts +3 -0
- package/target/main/ts/api/process/tool-snapshot.js +26 -0
- package/target/main/ts/cli/arguments.d.ts +28 -0
- package/target/main/ts/cli/arguments.js +109 -0
- package/target/main/ts/cli/config.d.ts +63 -0
- package/target/main/ts/cli/config.js +165 -0
- package/target/main/ts/cli/imports.d.ts +9 -0
- package/target/main/ts/cli/imports.js +37 -0
- package/target/main/ts/cli/main.d.ts +2 -0
- package/target/main/ts/cli/main.js +4 -0
- package/target/main/ts/cli/range-inspection.d.ts +38 -0
- package/target/main/ts/cli/range-inspection.js +34 -0
- package/target/main/ts/cli/range-jobs.d.ts +23 -0
- package/target/main/ts/cli/range-jobs.js +152 -0
- package/target/main/ts/cli/range-worker.d.ts +1 -0
- package/target/main/ts/cli/range-worker.js +40 -0
- package/target/main/ts/cli/reporting.d.ts +42 -0
- package/target/main/ts/cli/reporting.js +98 -0
- package/target/main/ts/cli/revisions.d.ts +6 -0
- package/target/main/ts/cli/revisions.js +16 -0
- package/target/main/ts/cli/run.d.ts +2 -0
- package/target/main/ts/cli/run.js +306 -0
- package/target/main/ts/cli/store.d.ts +13 -0
- package/target/main/ts/cli/store.js +39 -0
- package/target/main/ts/compose/analysis-report.d.ts +6 -0
- package/target/main/ts/compose/analysis-report.js +131 -0
- package/target/main/ts/compose/analysis-results.d.ts +42 -0
- package/target/main/ts/compose/analysis-results.js +84 -0
- package/target/main/ts/compose/analysis-steps.d.ts +23 -0
- package/target/main/ts/compose/analysis-steps.js +217 -0
- package/target/main/ts/compose/analyze-snapshot.d.ts +7 -0
- package/target/main/ts/compose/analyze-snapshot.js +21 -0
- package/target/main/ts/compose/attach-churn.d.ts +2 -0
- package/target/main/ts/compose/attach-churn.js +50 -0
- package/target/main/ts/compose/built-ins.d.ts +6 -0
- package/target/main/ts/compose/built-ins.js +12 -0
- package/target/main/ts/compose/diff-coverage.d.ts +25 -0
- package/target/main/ts/compose/diff-coverage.js +82 -0
- package/target/main/ts/compose/distribution.d.ts +17 -0
- package/target/main/ts/compose/distribution.js +13 -0
- package/target/main/ts/compose/docker-image.d.ts +5 -0
- package/target/main/ts/compose/docker-image.js +49 -0
- package/target/main/ts/compose/file-selection.d.ts +9 -0
- package/target/main/ts/compose/file-selection.js +38 -0
- package/target/main/ts/compose/history-cache.d.ts +31 -0
- package/target/main/ts/compose/history-cache.js +62 -0
- package/target/main/ts/compose/inspect.d.ts +34 -0
- package/target/main/ts/compose/inspect.js +51 -0
- package/target/main/ts/compose/inspection-coverage.d.ts +9 -0
- package/target/main/ts/compose/inspection-coverage.js +9 -0
- package/target/main/ts/compose/js-plugin.d.ts +113 -0
- package/target/main/ts/compose/js-plugin.js +99 -0
- package/target/main/ts/compose/language-discovery.d.ts +12 -0
- package/target/main/ts/compose/language-discovery.js +51 -0
- package/target/main/ts/compose/languages.d.ts +64 -0
- package/target/main/ts/compose/languages.js +98 -0
- package/target/main/ts/compose/load-plugins.d.ts +6 -0
- package/target/main/ts/compose/load-plugins.js +71 -0
- package/target/main/ts/compose/parser-order.d.ts +20 -0
- package/target/main/ts/compose/parser-order.js +90 -0
- package/target/main/ts/compose/phases.d.ts +140 -0
- package/target/main/ts/compose/phases.js +147 -0
- package/target/main/ts/compose/plugin-list.d.ts +37 -0
- package/target/main/ts/compose/plugin-list.js +30 -0
- package/target/main/ts/compose/plugin-manifest.d.ts +14 -0
- package/target/main/ts/compose/plugin-manifest.js +50 -0
- package/target/main/ts/compose/plugin-options.d.ts +2 -0
- package/target/main/ts/compose/plugin-options.js +29 -0
- package/target/main/ts/compose/plugin-reference.d.ts +9 -0
- package/target/main/ts/compose/plugin-reference.js +40 -0
- package/target/main/ts/compose/plugin-requirements.d.ts +5 -0
- package/target/main/ts/compose/plugin-requirements.js +83 -0
- package/target/main/ts/compose/plugin-scope.d.ts +9 -0
- package/target/main/ts/compose/plugin-scope.js +60 -0
- package/target/main/ts/compose/process-plugins.d.ts +89 -0
- package/target/main/ts/compose/process-plugins.js +74 -0
- package/target/main/ts/compose/registered-plugin.d.ts +17 -0
- package/target/main/ts/compose/registered-plugin.js +8 -0
- package/target/main/ts/compose/review.d.ts +26 -0
- package/target/main/ts/compose/review.js +54 -0
- package/target/main/ts/compose/schema-error.d.ts +2 -0
- package/target/main/ts/compose/schema-error.js +16 -0
- package/target/main/ts/compose/sources.d.ts +2 -0
- package/target/main/ts/compose/sources.js +32 -0
- package/target/main/ts/compose/structure-measures.d.ts +9 -0
- package/target/main/ts/compose/structure-measures.js +63 -0
- package/target/main/ts/index.d.ts +8 -0
- package/target/main/ts/index.js +5 -0
- package/target/main/ts/plugin.d.ts +2 -0
- package/target/main/ts/plugin.js +2 -0
- package/target/main/ts/plugins/built-in.d.ts +3 -0
- package/target/main/ts/plugins/built-in.js +19 -0
- package/target/main/ts/plugins/coverage/coverage.d.ts +11 -0
- package/target/main/ts/plugins/coverage/coverage.js +289 -0
- package/target/main/ts/plugins/coverage/diff-coverage.d.ts +3 -0
- package/target/main/ts/plugins/coverage/diff-coverage.js +85 -0
- package/target/main/ts/plugins/duplication/duplication.d.ts +2 -0
- package/target/main/ts/plugins/duplication/duplication.js +95 -0
- package/target/main/ts/plugins/language-js/babel-provider.d.ts +10 -0
- package/target/main/ts/plugins/language-js/babel-provider.js +54 -0
- package/target/main/ts/plugins/language-js/clone-candidates.d.ts +3 -0
- package/target/main/ts/plugins/language-js/clone-candidates.js +65 -0
- package/target/main/ts/plugins/language-js/code-lines.d.ts +6 -0
- package/target/main/ts/plugins/language-js/code-lines.js +36 -0
- package/target/main/ts/plugins/language-js/extensions.d.ts +1 -0
- package/target/main/ts/plugins/language-js/extensions.js +3 -0
- package/target/main/ts/plugins/language-js/function-facts.d.ts +9 -0
- package/target/main/ts/plugins/language-js/function-facts.js +74 -0
- package/target/main/ts/plugins/language-js/js-security.d.ts +4 -0
- package/target/main/ts/plugins/language-js/js-security.js +497 -0
- package/target/main/ts/plugins/language-js/qualified-names.d.ts +11 -0
- package/target/main/ts/plugins/language-js/qualified-names.js +63 -0
- package/target/main/ts/plugins/language-js/structural-observations.d.ts +9 -0
- package/target/main/ts/plugins/language-js/structural-observations.js +85 -0
- package/target/main/ts/plugins/language-js/syntax.d.ts +2 -0
- package/target/main/ts/plugins/language-js/syntax.js +11 -0
- package/target/main/ts/plugins/maintainability/maintainability.d.ts +2 -0
- package/target/main/ts/plugins/maintainability/maintainability.js +38 -0
- package/target/main/ts/plugins/maintainability/structural-smells.d.ts +3 -0
- package/target/main/ts/plugins/maintainability/structural-smells.js +17 -0
- package/target/main/ts/plugins/security/actions-security.d.ts +2 -0
- package/target/main/ts/plugins/security/actions-security.js +581 -0
- package/target/main/ts/plugins/security/dockerfile.d.ts +2 -0
- package/target/main/ts/plugins/security/dockerfile.js +487 -0
- package/target/main/ts/plugins/security/npm-supply-chain.d.ts +4 -0
- package/target/main/ts/plugins/security/npm-supply-chain.js +368 -0
- package/target/main/ts/plugins/security/secrets.d.ts +12 -0
- package/target/main/ts/plugins/security/secrets.js +254 -0
- package/target/main/ts/plugins/source/forges.d.ts +4 -0
- package/target/main/ts/plugins/source/forges.js +80 -0
- package/target/main/ts/plugins/structure/structure.d.ts +2 -0
- package/target/main/ts/plugins/structure/structure.js +42 -0
- package/target/main/ts/report/html/app/viewer-chart-bars.d.ts +13 -0
- package/target/main/ts/report/html/app/viewer-chart-bars.js +59 -0
- package/target/main/ts/report/html/app/viewer-chart-label.d.ts +15 -0
- package/target/main/ts/report/html/app/viewer-chart-label.js +43 -0
- package/target/main/ts/report/html/app/viewer-chart-line.d.ts +33 -0
- package/target/main/ts/report/html/app/viewer-chart-line.js +88 -0
- package/target/main/ts/report/html/app/viewer-chart-points.d.ts +52 -0
- package/target/main/ts/report/html/app/viewer-chart-points.js +65 -0
- package/target/main/ts/report/html/app/viewer-chart-scale.d.ts +21 -0
- package/target/main/ts/report/html/app/viewer-chart-scale.js +93 -0
- package/target/main/ts/report/html/app/viewer-chart-svg.d.ts +28 -0
- package/target/main/ts/report/html/app/viewer-chart-svg.js +41 -0
- package/target/main/ts/report/html/app/viewer-chart-time.d.ts +26 -0
- package/target/main/ts/report/html/app/viewer-chart-time.js +150 -0
- package/target/main/ts/report/html/app/viewer-chart-tip.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-chart-tip.js +210 -0
- package/target/main/ts/report/html/app/viewer-chart-x.d.ts +12 -0
- package/target/main/ts/report/html/app/viewer-chart-x.js +50 -0
- package/target/main/ts/report/html/app/viewer-chart.d.ts +7 -0
- package/target/main/ts/report/html/app/viewer-chart.js +50 -0
- package/target/main/ts/report/html/app/viewer-code-map.d.ts +27 -0
- package/target/main/ts/report/html/app/viewer-code-map.js +176 -0
- package/target/main/ts/report/html/app/viewer-columns.d.ts +40 -0
- package/target/main/ts/report/html/app/viewer-columns.js +97 -0
- package/target/main/ts/report/html/app/viewer-commit-picker.d.ts +12 -0
- package/target/main/ts/report/html/app/viewer-commit-picker.js +229 -0
- package/target/main/ts/report/html/app/viewer-commits.d.ts +32 -0
- package/target/main/ts/report/html/app/viewer-commits.js +81 -0
- package/target/main/ts/report/html/app/viewer-controls.d.ts +43 -0
- package/target/main/ts/report/html/app/viewer-controls.js +141 -0
- package/target/main/ts/report/html/app/viewer-copy.d.ts +17 -0
- package/target/main/ts/report/html/app/viewer-copy.js +64 -0
- package/target/main/ts/report/html/app/viewer-data.d.ts +24 -0
- package/target/main/ts/report/html/app/viewer-data.js +78 -0
- package/target/main/ts/report/html/app/viewer-diagnostics.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-diagnostics.js +60 -0
- package/target/main/ts/report/html/app/viewer-dom.d.ts +27 -0
- package/target/main/ts/report/html/app/viewer-dom.js +99 -0
- package/target/main/ts/report/html/app/viewer-file-aside.d.ts +15 -0
- package/target/main/ts/report/html/app/viewer-file-aside.js +134 -0
- package/target/main/ts/report/html/app/viewer-file-figures.d.ts +17 -0
- package/target/main/ts/report/html/app/viewer-file-figures.js +65 -0
- package/target/main/ts/report/html/app/viewer-file-source.d.ts +7 -0
- package/target/main/ts/report/html/app/viewer-file-source.js +119 -0
- package/target/main/ts/report/html/app/viewer-files.d.ts +11 -0
- package/target/main/ts/report/html/app/viewer-files.js +40 -0
- package/target/main/ts/report/html/app/viewer-filter.d.ts +65 -0
- package/target/main/ts/report/html/app/viewer-filter.js +161 -0
- package/target/main/ts/report/html/app/viewer-hotspots.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-hotspots.js +133 -0
- package/target/main/ts/report/html/app/viewer-inspection.d.ts +69 -0
- package/target/main/ts/report/html/app/viewer-inspection.js +38 -0
- package/target/main/ts/report/html/app/viewer-issue-group.d.ts +27 -0
- package/target/main/ts/report/html/app/viewer-issue-group.js +174 -0
- package/target/main/ts/report/html/app/viewer-issues.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-issues.js +173 -0
- package/target/main/ts/report/html/app/viewer-language-bar.d.ts +11 -0
- package/target/main/ts/report/html/app/viewer-language-bar.js +76 -0
- package/target/main/ts/report/html/app/viewer-languages.d.ts +35 -0
- package/target/main/ts/report/html/app/viewer-languages.js +97 -0
- package/target/main/ts/report/html/app/viewer-layout.d.ts +14 -0
- package/target/main/ts/report/html/app/viewer-layout.js +134 -0
- package/target/main/ts/report/html/app/viewer-line-coverage.d.ts +47 -0
- package/target/main/ts/report/html/app/viewer-line-coverage.js +108 -0
- package/target/main/ts/report/html/app/viewer-locations.d.ts +16 -0
- package/target/main/ts/report/html/app/viewer-locations.js +31 -0
- package/target/main/ts/report/html/app/viewer-map-scale.d.ts +26 -0
- package/target/main/ts/report/html/app/viewer-map-scale.js +147 -0
- package/target/main/ts/report/html/app/viewer-map-shape.d.ts +42 -0
- package/target/main/ts/report/html/app/viewer-map-shape.js +102 -0
- package/target/main/ts/report/html/app/viewer-metric-format.d.ts +23 -0
- package/target/main/ts/report/html/app/viewer-metric-format.js +93 -0
- package/target/main/ts/report/html/app/viewer-metric-registry.d.ts +47 -0
- package/target/main/ts/report/html/app/viewer-metric-registry.js +138 -0
- package/target/main/ts/report/html/app/viewer-metrics-view.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-metrics-view.js +159 -0
- package/target/main/ts/report/html/app/viewer-metrics.d.ts +51 -0
- package/target/main/ts/report/html/app/viewer-metrics.js +195 -0
- package/target/main/ts/report/html/app/viewer-overview-cards.d.ts +12 -0
- package/target/main/ts/report/html/app/viewer-overview-cards.js +121 -0
- package/target/main/ts/report/html/app/viewer-overview-hotspots.d.ts +9 -0
- package/target/main/ts/report/html/app/viewer-overview-hotspots.js +173 -0
- package/target/main/ts/report/html/app/viewer-overview-lead.d.ts +12 -0
- package/target/main/ts/report/html/app/viewer-overview-lead.js +116 -0
- package/target/main/ts/report/html/app/viewer-profile-badges.d.ts +11 -0
- package/target/main/ts/report/html/app/viewer-profile-badges.js +119 -0
- package/target/main/ts/report/html/app/viewer-profile-table.d.ts +29 -0
- package/target/main/ts/report/html/app/viewer-profile-table.js +124 -0
- package/target/main/ts/report/html/app/viewer-profile.d.ts +13 -0
- package/target/main/ts/report/html/app/viewer-profile.js +180 -0
- package/target/main/ts/report/html/app/viewer-projects.d.ts +1 -0
- package/target/main/ts/report/html/app/viewer-projects.js +90 -0
- package/target/main/ts/report/html/app/viewer-pull-sections.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-pull-sections.js +118 -0
- package/target/main/ts/report/html/app/viewer-pull-trend.d.ts +5 -0
- package/target/main/ts/report/html/app/viewer-pull-trend.js +63 -0
- package/target/main/ts/report/html/app/viewer-pulls.d.ts +2 -0
- package/target/main/ts/report/html/app/viewer-pulls.js +92 -0
- package/target/main/ts/report/html/app/viewer-query-field.d.ts +19 -0
- package/target/main/ts/report/html/app/viewer-query-field.js +203 -0
- package/target/main/ts/report/html/app/viewer-route.d.ts +34 -0
- package/target/main/ts/report/html/app/viewer-route.js +55 -0
- package/target/main/ts/report/html/app/viewer-shell.d.ts +20 -0
- package/target/main/ts/report/html/app/viewer-shell.js +113 -0
- package/target/main/ts/report/html/app/viewer-source-view.d.ts +49 -0
- package/target/main/ts/report/html/app/viewer-source-view.js +150 -0
- package/target/main/ts/report/html/app/viewer-source.d.ts +27 -0
- package/target/main/ts/report/html/app/viewer-source.js +57 -0
- package/target/main/ts/report/html/app/viewer-suggest.d.ts +13 -0
- package/target/main/ts/report/html/app/viewer-suggest.js +91 -0
- package/target/main/ts/report/html/app/viewer-sunburst.d.ts +5 -0
- package/target/main/ts/report/html/app/viewer-sunburst.js +40 -0
- package/target/main/ts/report/html/app/viewer-table-cells.d.ts +25 -0
- package/target/main/ts/report/html/app/viewer-table-cells.js +135 -0
- package/target/main/ts/report/html/app/viewer-table-rows.d.ts +56 -0
- package/target/main/ts/report/html/app/viewer-table-rows.js +97 -0
- package/target/main/ts/report/html/app/viewer-tokenizer.d.ts +15 -0
- package/target/main/ts/report/html/app/viewer-tokenizer.js +241 -0
- package/target/main/ts/report/html/app/viewer-totals.d.ts +20 -0
- package/target/main/ts/report/html/app/viewer-totals.js +100 -0
- package/target/main/ts/report/html/app/viewer-treemap.d.ts +24 -0
- package/target/main/ts/report/html/app/viewer-treemap.js +112 -0
- package/target/main/ts/report/html/app/viewer-trend-data.d.ts +54 -0
- package/target/main/ts/report/html/app/viewer-trend-data.js +109 -0
- package/target/main/ts/report/html/app/viewer-trend-nav.d.ts +5 -0
- package/target/main/ts/report/html/app/viewer-trend-nav.js +86 -0
- package/target/main/ts/report/html/app/viewer-trend-points.d.ts +30 -0
- package/target/main/ts/report/html/app/viewer-trend-points.js +128 -0
- package/target/main/ts/report/html/app/viewer-trend-series.d.ts +32 -0
- package/target/main/ts/report/html/app/viewer-trend-series.js +128 -0
- package/target/main/ts/report/html/app/viewer-trends.d.ts +5 -0
- package/target/main/ts/report/html/app/viewer-trends.js +89 -0
- package/target/main/ts/report/html/app/viewer.d.ts +1 -0
- package/target/main/ts/report/html/app/viewer.js +222 -0
- package/target/main/ts/report/html/site/badges.d.ts +11 -0
- package/target/main/ts/report/html/site/badges.js +72 -0
- package/target/main/ts/report/html/site/export-site.d.ts +16 -0
- package/target/main/ts/report/html/site/export-site.js +129 -0
- package/target/main/ts/report/html/site/exported-server.d.ts +6 -0
- package/target/main/ts/report/html/site/exported-server.js +72 -0
- package/target/main/ts/report/html/site/local-server.d.ts +7 -0
- package/target/main/ts/report/html/site/local-server.js +59 -0
- package/target/main/ts/report/html/site/projects.d.ts +1 -0
- package/target/main/ts/report/html/site/projects.js +69 -0
- package/target/main/ts/report/html/site/server.d.ts +4 -0
- package/target/main/ts/report/html/site/server.js +65 -0
- package/target/main/ts/report/html/site/source-route.d.ts +6 -0
- package/target/main/ts/report/html/site/source-route.js +23 -0
- package/target/main/ts/report/json/projections/commit-summary.d.ts +13 -0
- package/target/main/ts/report/json/projections/commit-summary.js +125 -0
- package/target/main/ts/report/json/projections/components.d.ts +4 -0
- package/target/main/ts/report/json/projections/components.js +30 -0
- package/target/main/ts/report/json/projections/file-metrics.d.ts +4 -0
- package/target/main/ts/report/json/projections/file-metrics.js +260 -0
- package/target/main/ts/report/json/projections/ignore-view.d.ts +2 -0
- package/target/main/ts/report/json/projections/ignore-view.js +13 -0
- package/target/main/ts/report/json/projections/inspection-context.d.ts +5 -0
- package/target/main/ts/report/json/projections/inspection-context.js +104 -0
- package/target/main/ts/report/json/projections/inspection-details.d.ts +14 -0
- package/target/main/ts/report/json/projections/inspection-details.js +98 -0
- package/target/main/ts/report/json/projections/metric-values.d.ts +14 -0
- package/target/main/ts/report/json/projections/metric-values.js +104 -0
- package/target/main/ts/report/json/projections/profile-selectors.d.ts +8 -0
- package/target/main/ts/report/json/projections/profile-selectors.js +34 -0
- package/target/main/ts/report/json/projections/security-summary.d.ts +11 -0
- package/target/main/ts/report/json/projections/security-summary.js +22 -0
- package/target/main/ts/report/json/store/directory.d.ts +3 -0
- package/target/main/ts/report/json/store/directory.js +19 -0
- package/target/main/ts/report/json/store/local-store.d.ts +25 -0
- package/target/main/ts/report/json/store/local-store.js +214 -0
- package/target/main/ts/report/json/store/object-store.d.ts +14 -0
- package/target/main/ts/report/json/store/object-store.js +73 -0
- package/target/main/ts/report/json/store/operation-cache.d.ts +8 -0
- package/target/main/ts/report/json/store/operation-cache.js +32 -0
- package/target/main/ts/report/json/store/pull-review-store.d.ts +2 -0
- package/target/main/ts/report/json/store/pull-review-store.js +33 -0
- package/target/main/ts/report/json/store/replace-file.d.ts +1 -0
- package/target/main/ts/report/json/store/replace-file.js +35 -0
- package/target/main/ts/report/json/store/report-tree.d.ts +46 -0
- package/target/main/ts/report/json/store/report-tree.js +295 -0
- package/target/main/ts/report/json/store/store-check.d.ts +32 -0
- package/target/main/ts/report/json/store/store-check.js +153 -0
- package/target/main/ts/report/json/validation/metabranch.d.ts +4 -0
- package/target/main/ts/report/json/validation/metabranch.js +11 -0
- package/target/main/ts/report/json/validation/report.d.ts +20 -0
- package/target/main/ts/report/json/validation/report.js +77 -0
- package/target/main/ts/report/json/validation/summary-validation.d.ts +4 -0
- package/target/main/ts/report/json/validation/summary-validation.js +26 -0
- package/target/main/ts/report/json/wire/compact-json.d.ts +11 -0
- package/target/main/ts/report/json/wire/compact-json.js +76 -0
- package/target/main/ts/report/json/wire/component-model.d.ts +9 -0
- package/target/main/ts/report/json/wire/component-model.js +1 -0
- package/target/main/ts/report/json/wire/domain-types.d.ts +2 -0
- package/target/main/ts/report/json/wire/domain-types.js +1 -0
- package/target/main/ts/report/json/wire/file-metrics-model.d.ts +81 -0
- package/target/main/ts/report/json/wire/file-metrics-model.js +1 -0
- package/target/main/ts/report/json/wire/inspection-context-model.d.ts +31 -0
- package/target/main/ts/report/json/wire/inspection-context-model.js +1 -0
- package/target/main/ts/report/json/wire/inspection-details-model.d.ts +87 -0
- package/target/main/ts/report/json/wire/inspection-details-model.js +1 -0
- package/target/main/ts/report/json/wire/project-model.d.ts +7 -0
- package/target/main/ts/report/json/wire/project-model.js +1 -0
- package/target/main/ts/report/json/wire/public-history-model.d.ts +36 -0
- package/target/main/ts/report/json/wire/public-history-model.js +5 -0
- package/target/main/ts/report/json/wire/pull-review-model.d.ts +54 -0
- package/target/main/ts/report/json/wire/pull-review-model.js +3 -0
- package/target/main/ts/report/json/wire/summary-model.d.ts +45 -0
- package/target/main/ts/report/json/wire/summary-model.js +1 -0
- package/target/main/ts/report/markdown/pull-review.d.ts +5 -0
- package/target/main/ts/report/markdown/pull-review.js +132 -0
- package/target/main/ts/report.d.ts +23 -0
- package/target/main/ts/report.js +12 -0
- package/target/main/ts/runtime.d.ts +17 -0
- package/target/main/ts/runtime.js +30 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { fork } from 'node:child_process';
|
|
2
|
+
import { lstat, realpath } from 'node:fs/promises';
|
|
3
|
+
import { availableParallelism } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { LocalReportStore } from '../report/json/store/local-store.js';
|
|
6
|
+
import { inspectCommits, rangeInspector } from './range-inspection.js';
|
|
7
|
+
const minimumChunkSize = 25;
|
|
8
|
+
const workerMemoryBytes = 512 * 1024 * 1024;
|
|
9
|
+
export function historyChunks(commits, concurrency, memory) {
|
|
10
|
+
if (commits.length === 0)
|
|
11
|
+
return [];
|
|
12
|
+
const workers = Math.max(1, Math.min(concurrency, Math.floor(memory / workerMemoryBytes), Math.floor(commits.length / minimumChunkSize)));
|
|
13
|
+
const size = Math.floor(commits.length / workers);
|
|
14
|
+
const remainder = commits.length % workers;
|
|
15
|
+
return Array.from({ length: workers }, (_, index) => {
|
|
16
|
+
const start = index * size + Math.min(index, remainder);
|
|
17
|
+
return commits.slice(start, start + size + Number(index < remainder));
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export async function analyzeCommits(commits, options) {
|
|
21
|
+
const { inspection, config, configuration, concurrency, skipSaved } = options;
|
|
22
|
+
const inspectCommit = rangeInspector(inspection, config);
|
|
23
|
+
const outcomes = new Map();
|
|
24
|
+
const control = new AbortController();
|
|
25
|
+
const { signal } = control;
|
|
26
|
+
const stop = () => {
|
|
27
|
+
if (signal.aborted)
|
|
28
|
+
return;
|
|
29
|
+
control.abort();
|
|
30
|
+
process.stderr.write('Stopping after the current commit in each worker.\n');
|
|
31
|
+
};
|
|
32
|
+
process.on('SIGINT', stop);
|
|
33
|
+
const width = String(commits.length).length;
|
|
34
|
+
const record = (outcome) => {
|
|
35
|
+
outcomes.set(outcome.commit, outcome);
|
|
36
|
+
const state = outcome.state === 'failed' ? `failed: ${outcome.error}` : outcome.state;
|
|
37
|
+
process.stderr.write(`[${String(outcomes.size).padStart(width)}/${commits.length}] ${outcome.commit.slice(0, 7)} ${state}\n`);
|
|
38
|
+
};
|
|
39
|
+
try {
|
|
40
|
+
const pending = await pendingCommits(commits, inspection.output, skipSaved, signal, record);
|
|
41
|
+
const chunks = historyChunks(pending, concurrency ?? availableParallelism(), process.availableMemory());
|
|
42
|
+
if (!signal.aborted && chunks.length === 1) {
|
|
43
|
+
await inspectCommits(chunks[0], inspectCommit, () => signal.aborted, record);
|
|
44
|
+
}
|
|
45
|
+
else if (!signal.aborted) {
|
|
46
|
+
await Promise.all(chunks.map(chunk => runChunk(chunk, inspection, configuration, signal, record)));
|
|
47
|
+
}
|
|
48
|
+
const results = collectOutcomes(commits, outcomes);
|
|
49
|
+
if (results.analyzed.length || results.skipped.length) {
|
|
50
|
+
await new LocalReportStore(await realpath(inspection.output)).refreshSummary();
|
|
51
|
+
}
|
|
52
|
+
const latest = outcomes.get(results.analyzed.at(-1) ?? '');
|
|
53
|
+
const missingLanguagePlugins = latest && 'missingLanguagePlugins' in latest ? latest.missingLanguagePlugins : [];
|
|
54
|
+
return { ...results, interrupted: signal.aborted, missingLanguagePlugins };
|
|
55
|
+
}
|
|
56
|
+
finally {
|
|
57
|
+
process.removeListener('SIGINT', stop);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async function pendingCommits(commits, store, skipSaved, signal, record) {
|
|
61
|
+
if (!skipSaved)
|
|
62
|
+
return commits;
|
|
63
|
+
const pending = [];
|
|
64
|
+
for (const commit of commits) {
|
|
65
|
+
if (signal.aborted)
|
|
66
|
+
break;
|
|
67
|
+
if (await isSaved(store, commit))
|
|
68
|
+
record({ commit, state: 'skipped' });
|
|
69
|
+
else
|
|
70
|
+
pending.push(commit);
|
|
71
|
+
}
|
|
72
|
+
return pending;
|
|
73
|
+
}
|
|
74
|
+
export async function isSaved(store, id) {
|
|
75
|
+
try {
|
|
76
|
+
return (await lstat(join(store, 'commits', id, 'report.json'))).isFile();
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
if (error instanceof Error && 'code' in error && (error.code === 'ENOENT' || error.code === 'ENOTDIR'))
|
|
80
|
+
return false;
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function collectOutcomes(commits, outcomes) {
|
|
85
|
+
const analyzed = [], partial = [], skipped = [];
|
|
86
|
+
const failed = [];
|
|
87
|
+
for (const commit of commits) {
|
|
88
|
+
const outcome = outcomes.get(commit);
|
|
89
|
+
switch (outcome?.state) {
|
|
90
|
+
case 'partial': partial.push(commit);
|
|
91
|
+
// Partial analysis still leaves a saved report.
|
|
92
|
+
case 'analyzed':
|
|
93
|
+
analyzed.push(commit);
|
|
94
|
+
break;
|
|
95
|
+
case 'skipped':
|
|
96
|
+
skipped.push(commit);
|
|
97
|
+
break;
|
|
98
|
+
case 'failed':
|
|
99
|
+
failed.push({ commit, error: outcome.error });
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return { analyzed, partial, skipped, failed };
|
|
104
|
+
}
|
|
105
|
+
async function runChunk(commits, inspection, configuration, signal, record) {
|
|
106
|
+
const pending = new Set(commits);
|
|
107
|
+
try {
|
|
108
|
+
// A terminal interrupt reaches the coordinator. Workers finish their current Git and analyzer subprocesses.
|
|
109
|
+
const worker = fork(new URL('./range-worker.js', import.meta.url), [], {
|
|
110
|
+
detached: process.platform !== 'win32', execArgv: [], stdio: ['ignore', 'ignore', 'inherit', 'ipc'],
|
|
111
|
+
});
|
|
112
|
+
const message = { kind: 'start', commits, inspection, configuration };
|
|
113
|
+
await runWorker(worker, message, signal, outcome => {
|
|
114
|
+
if (pending.delete(outcome.commit))
|
|
115
|
+
record(outcome);
|
|
116
|
+
});
|
|
117
|
+
failPending('Range worker exited before reporting the remaining commits');
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
failPending(error instanceof Error ? error.message : String(error));
|
|
121
|
+
}
|
|
122
|
+
function failPending(error) {
|
|
123
|
+
if (!signal.aborted)
|
|
124
|
+
for (const commit of pending)
|
|
125
|
+
record({ commit, state: 'failed', error });
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function runWorker(worker, message, signal, record) {
|
|
129
|
+
return new Promise((resolve, reject) => {
|
|
130
|
+
const stop = () => {
|
|
131
|
+
const interrupt = { kind: 'stop' };
|
|
132
|
+
if (worker.connected)
|
|
133
|
+
worker.send(interrupt, () => { });
|
|
134
|
+
};
|
|
135
|
+
worker.on('message', record);
|
|
136
|
+
worker.once('error', reject);
|
|
137
|
+
worker.once('close', (code, cause) => {
|
|
138
|
+
signal.removeEventListener('abort', stop);
|
|
139
|
+
if (code === 0 || signal.aborted)
|
|
140
|
+
resolve();
|
|
141
|
+
else
|
|
142
|
+
reject(new Error(`Range worker exited with ${cause ?? code}`));
|
|
143
|
+
});
|
|
144
|
+
worker.send(message, error => { if (error && !signal.aborted)
|
|
145
|
+
reject(error); });
|
|
146
|
+
if (signal.aborted)
|
|
147
|
+
stop();
|
|
148
|
+
else
|
|
149
|
+
signal.addEventListener('abort', stop, { once: true });
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=range-jobs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { loadConfig } from './config.js';
|
|
2
|
+
import { inspectCommits, rangeInspector } from './range-inspection.js';
|
|
3
|
+
let stopped = false;
|
|
4
|
+
let started = false;
|
|
5
|
+
const stop = () => { stopped = true; };
|
|
6
|
+
process.on('SIGINT', stop);
|
|
7
|
+
process.on('disconnect', stop);
|
|
8
|
+
process.on('message', (message) => {
|
|
9
|
+
if (message.kind === 'stop')
|
|
10
|
+
stop();
|
|
11
|
+
else if (!started) {
|
|
12
|
+
started = true;
|
|
13
|
+
void run(message);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
async function run({ commits, inspection, configuration }) {
|
|
17
|
+
try {
|
|
18
|
+
const { value, root, file, distributionModule } = configuration;
|
|
19
|
+
const distribution = distributionModule === undefined ? undefined
|
|
20
|
+
: (await import(distributionModule)).default;
|
|
21
|
+
const config = await loadConfig(value, root, file, false, distribution);
|
|
22
|
+
await inspectCommits(commits, rangeInspector(inspection, config), () => stopped, send);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
26
|
+
process.exitCode = 1;
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
if (process.connected)
|
|
30
|
+
process.disconnect();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function send(outcome) {
|
|
34
|
+
if (!process.connected)
|
|
35
|
+
return Promise.resolve();
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
process.send(outcome, error => error ? reject(error) : resolve());
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=range-worker.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Distribution } from '../compose/distribution.js';
|
|
2
|
+
import { readDisplayConfig } from './config.js';
|
|
3
|
+
import type { Invocation } from './arguments.js';
|
|
4
|
+
import type { Store } from './store.js';
|
|
5
|
+
export declare const reporterIds: string[];
|
|
6
|
+
type Config = Awaited<ReturnType<typeof readDisplayConfig>>;
|
|
7
|
+
export declare function displayLanguages(distribution?: Distribution): {
|
|
8
|
+
select: (path: string) => import("../compose/languages.js").LanguageProvider | undefined;
|
|
9
|
+
isSource: (path: string) => boolean;
|
|
10
|
+
id: (path: string) => string;
|
|
11
|
+
extensions: string[];
|
|
12
|
+
globs: string[];
|
|
13
|
+
catalog: {
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
color?: string | undefined;
|
|
17
|
+
}[];
|
|
18
|
+
providers: import("../compose/languages.js").LanguageProvider[];
|
|
19
|
+
plugins: readonly import("../compose/parser-order.js").ParserPlugin[];
|
|
20
|
+
reportSelection: (present: ReadonlySet<string>) => {
|
|
21
|
+
extensions: string[];
|
|
22
|
+
globs: string[];
|
|
23
|
+
catalog: {
|
|
24
|
+
id: string;
|
|
25
|
+
label: string;
|
|
26
|
+
color?: string | undefined;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
describe: (plugin: import("../compose/parser-order.js").ParserPlugin) => import("../compose/parser-order.js").ParserPlugin;
|
|
30
|
+
syntax: (id: string) => import("@repometry/core").LanguageSyntax | undefined;
|
|
31
|
+
skipped: (path: string) => boolean;
|
|
32
|
+
};
|
|
33
|
+
export declare function outputReports(root: string, store: Store, input: Invocation, config: Config, distribution?: Distribution): Promise<{
|
|
34
|
+
format: "html" | "json";
|
|
35
|
+
path: string;
|
|
36
|
+
}[]>;
|
|
37
|
+
export declare function viewTarget(input: Invocation, port: number, distribution?: Distribution): Promise<{
|
|
38
|
+
url: string;
|
|
39
|
+
close: () => void;
|
|
40
|
+
label: string;
|
|
41
|
+
}>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { mkdir, rename, rm, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { basename, dirname, resolve } from 'node:path';
|
|
4
|
+
import { commitMetadataReader } from '../api/git/commit-metadata.js';
|
|
5
|
+
import { readLocalSources, sourceRemotes } from '../api/git/local-sources.js';
|
|
6
|
+
import { defaultLanguages, languageRegistry } from '../compose/languages.js';
|
|
7
|
+
import { resolveSourceLocator } from '../compose/sources.js';
|
|
8
|
+
import { commitSummary, withCommitMetadata } from '../report/json/projections/commit-summary.js';
|
|
9
|
+
import { exportSite, siteSummary } from '../report/html/site/export-site.js';
|
|
10
|
+
import { readExportedSummary, serveExportedSite } from '../report/html/site/exported-server.js';
|
|
11
|
+
import { serveSite } from '../report/html/site/local-server.js';
|
|
12
|
+
import { listPullReviews } from '../report/json/store/pull-review-store.js';
|
|
13
|
+
import { readDisplayConfig } from './config.js';
|
|
14
|
+
import { findRepository, invocationDirectory, isDirectory, selectStore } from './store.js';
|
|
15
|
+
const reporters = { html: '.repometry/report/html', json: '.repometry/report/summary.json' };
|
|
16
|
+
export const reporterIds = Object.keys(reporters);
|
|
17
|
+
export function displayLanguages(distribution) {
|
|
18
|
+
return distribution === undefined ? defaultLanguages : languageRegistry(distribution.bundled, distribution.parsers);
|
|
19
|
+
}
|
|
20
|
+
export async function outputReports(root, store, input, config, distribution) {
|
|
21
|
+
const typed = input.args.length > 0;
|
|
22
|
+
const base = typed ? invocationDirectory(input) : root;
|
|
23
|
+
const configured = config.reports.length ? config.reports : ['html'];
|
|
24
|
+
const requested = typed ? input.args : configured;
|
|
25
|
+
const requests = requested.map(spec => {
|
|
26
|
+
const equal = spec.indexOf('=');
|
|
27
|
+
const format = equal < 0 ? spec : spec.slice(0, equal);
|
|
28
|
+
const path = equal < 0 ? undefined : spec.slice(equal + 1);
|
|
29
|
+
if (!Object.hasOwn(reporters, format))
|
|
30
|
+
throw new Error(`Unknown reporter: ${format}. Choose ${reporterIds.join(', ')}.`);
|
|
31
|
+
if (path === '')
|
|
32
|
+
throw new Error('Expected an output path after FORMAT=');
|
|
33
|
+
const name = format;
|
|
34
|
+
return { format: name, path: path === undefined ? resolve(root, reporters[name]) : resolve(base, path) };
|
|
35
|
+
});
|
|
36
|
+
if (new Set(requests.map(request => request.path)).size !== requests.length)
|
|
37
|
+
throw new Error('Each report requires a separate output');
|
|
38
|
+
const repository = await findRepository(root);
|
|
39
|
+
const readCommitMetadata = repository === undefined ? undefined : commitMetadataReader(repository);
|
|
40
|
+
const sourceOption = input.text('source') ?? config.source;
|
|
41
|
+
const sources = resolveSourceLocator(sourceOption, { remotes: await sourceRemotes(root), env: process.env });
|
|
42
|
+
const pulls = store.path ? await listPullReviews(store.path) : [];
|
|
43
|
+
const options = { languages: displayLanguages(distribution), sources,
|
|
44
|
+
components: config.components, pulls, readCommitMetadata, branch: input.text('branch') ?? config.branch,
|
|
45
|
+
title: input.text('title') ?? basename(root) };
|
|
46
|
+
for (const request of requests) {
|
|
47
|
+
if (request.format === 'html')
|
|
48
|
+
await exportSite(store.reader, request.path, options);
|
|
49
|
+
else {
|
|
50
|
+
const rows = await store.reader.listSummaries?.() ?? (await store.reader.list()).filter(report => report.subject.kind === 'commit').map(commitSummary);
|
|
51
|
+
const data = siteSummary(await withCommitMetadata(rows, readCommitMetadata), options);
|
|
52
|
+
await writeSummary(request.path, data);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return requests;
|
|
56
|
+
}
|
|
57
|
+
async function writeSummary(path, data) {
|
|
58
|
+
await mkdir(dirname(path), { recursive: true });
|
|
59
|
+
const temporary = `${path}.${randomUUID()}.tmp`;
|
|
60
|
+
try {
|
|
61
|
+
await writeFile(temporary, data, { mode: 0o644, flag: 'wx' });
|
|
62
|
+
await rename(temporary, path);
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
await rm(temporary, { force: true });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export async function viewTarget(input, port, distribution) {
|
|
69
|
+
const target = resolve(input.args[0] ?? '.');
|
|
70
|
+
const storeOption = input.text('store');
|
|
71
|
+
const exported = storeOption === undefined ? await readExportedSummary(target) : undefined;
|
|
72
|
+
const repository = await findRepository(target);
|
|
73
|
+
if (exported) {
|
|
74
|
+
const local = exported.sources?.provider === 'local' && repository ? readLocalSources(repository) : undefined;
|
|
75
|
+
return { ...await serveExportedSite(target, port, local), label: target + ' (exported report)' };
|
|
76
|
+
}
|
|
77
|
+
const root = repository ?? target;
|
|
78
|
+
const store = await liveStore(root, target, storeOption, input, repository !== undefined);
|
|
79
|
+
const [pulls, config] = await Promise.all([store.path ? listPullReviews(store.path) : [], readDisplayConfig(root, input, distribution)]);
|
|
80
|
+
const local = repository ? readLocalSources(repository) : undefined;
|
|
81
|
+
const server = await serveSite(store.reader, port, { languages: displayLanguages(distribution), title: input.text('title') ?? basename(root), components: config.components, pulls,
|
|
82
|
+
branch: input.text('branch') ?? config.branch, readCommitMetadata: repository ? commitMetadataReader(repository) : undefined,
|
|
83
|
+
sources: local ? resolveSourceLocator('local', { remotes: [], env: {} }) : undefined }, local);
|
|
84
|
+
return { ...server, label: `${basename(root)} (live from ${store.path ?? storeOption})` };
|
|
85
|
+
}
|
|
86
|
+
async function liveStore(root, target, storeOption, input, inRepository) {
|
|
87
|
+
const data = resolve(target, 'data');
|
|
88
|
+
const dataStore = basename(target) === '.repometry' && await isDirectory(data);
|
|
89
|
+
const directStore = await isDirectory(resolve(target, 'commits'));
|
|
90
|
+
if (!inRepository && !dataStore && !directStore && storeOption === undefined) {
|
|
91
|
+
throw new Error(`No report at ${target}: expected a repository, a .repometry folder or an exported report`);
|
|
92
|
+
}
|
|
93
|
+
const store = selectStore(root, storeOption ?? (dataStore ? data : directStore ? target : undefined), invocationDirectory(input));
|
|
94
|
+
if ((await store.reader.listSummaries?.() ?? []).length === 0)
|
|
95
|
+
throw new Error(`No saved inspections in ${store.path ?? storeOption}. Run repometry analyze first.`);
|
|
96
|
+
return store;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=reporting.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface RevisionRange {
|
|
2
|
+
readonly base: string;
|
|
3
|
+
readonly head: string;
|
|
4
|
+
}
|
|
5
|
+
/** Reads `BASE..HEAD` or `BASE..`; returns undefined for a single revision. Git refnames cannot contain `..`. */
|
|
6
|
+
export declare function parseRange(value: string): RevisionRange | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Reads `BASE..HEAD` or `BASE..`; returns undefined for a single revision. Git refnames cannot contain `..`. */
|
|
2
|
+
export function parseRange(value) {
|
|
3
|
+
if (!value.includes('..'))
|
|
4
|
+
return undefined;
|
|
5
|
+
if (value.includes('...'))
|
|
6
|
+
throw new Error(`${value}: a symmetric range has no first-parent line; use BASE..HEAD`);
|
|
7
|
+
const index = value.indexOf('..');
|
|
8
|
+
const base = value.slice(0, index);
|
|
9
|
+
const head = value.slice(index + 2);
|
|
10
|
+
if (!base)
|
|
11
|
+
throw new Error(`${value}: a range needs a base, as in HEAD~10..HEAD`);
|
|
12
|
+
if (head.includes('..'))
|
|
13
|
+
throw new Error(`${value}: use one BASE..HEAD range`);
|
|
14
|
+
return { base, head: head || 'HEAD' };
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=revisions.js.map
|