@c2l2c/backstage-plugin-dora-metrics 0.3.2 → 0.4.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/dist/index.d.ts DELETED
@@ -1,100 +0,0 @@
1
- export { default as doraMetricsPlugin } from './alpha.js';
2
- import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
3
- import { OAuthApi, ConfigApi } from '@backstage/core-plugin-api';
4
- import * as react_jsx_runtime from 'react/jsx-runtime';
5
- import '@backstage/catalog-model';
6
- import 'react';
7
- import '@backstage/filter-predicates';
8
- import '@backstage/frontend-plugin-api';
9
-
10
- type DoraRating = 'elite' | 'high' | 'medium' | 'low';
11
- interface PrDetail {
12
- number: number;
13
- title: string;
14
- url: string;
15
- durationHours: number;
16
- mergedAt: string;
17
- author?: string;
18
- authorAvatar?: string;
19
- }
20
- interface DoraMetricValue {
21
- value: number;
22
- unit: string;
23
- rating: DoraRating;
24
- target: number;
25
- slowestPRs?: PrDetail[];
26
- }
27
- interface DoraEnvironment {
28
- name: string;
29
- /**
30
- * Raw branch pattern as configured — a single branch name, a comma-separated
31
- * list ("main,master"), or a JavaScript regex string ("^(main|master)$").
32
- * The client resolves this to a concrete list of branches at query time.
33
- */
34
- branch: string;
35
- isProduction: boolean;
36
- label: string;
37
- }
38
- interface DoraTargets {
39
- deploymentFrequency: number;
40
- leadTime: number;
41
- changeFailureRate: number;
42
- mttr: number;
43
- }
44
- interface DoraMetrics {
45
- deploymentFrequency: DoraMetricValue;
46
- leadTime: DoraMetricValue;
47
- /** null for non-production environments */
48
- changeFailureRate: DoraMetricValue | null;
49
- /** null for non-production environments */
50
- mttr: DoraMetricValue | null;
51
- /** null for non-production environments */
52
- numberOfHotfixes: DoraMetricValue | null;
53
- }
54
- interface DoraHistoryPoint {
55
- weekLabel: string;
56
- bucketMidMs: number;
57
- deploymentCount: number;
58
- leadTimeHours: number;
59
- changeFailureRate?: number;
60
- mttrHours?: number;
61
- }
62
- interface DoraMetricsApi {
63
- getEnvironments(): DoraEnvironment[];
64
- getDefaultDays(): number;
65
- getTargets(): DoraTargets;
66
- getMetrics(projectSlug: string, env: DoraEnvironment, days: number, targetsOverride?: Partial<DoraTargets>): Promise<DoraMetrics>;
67
- getHistory(projectSlug: string, env: DoraEnvironment, days: number): Promise<DoraHistoryPoint[]>;
68
- }
69
- declare const doraMetricsApiRef: _backstage_core_plugin_api.ApiRef<DoraMetricsApi>;
70
-
71
- declare class DoraMetricsClient implements DoraMetricsApi {
72
- private readonly githubAuthApi;
73
- private readonly configApi;
74
- constructor(githubAuthApi: OAuthApi, configApi: ConfigApi);
75
- private getConfig;
76
- getEnvironments(): DoraEnvironment[];
77
- getDefaultDays(): number;
78
- getTargets(): DoraTargets;
79
- private fetchWithAuth;
80
- /**
81
- * Fetch all merged PRs for an environment, resolving branch patterns and
82
- * deduplicating across multiple branches by PR number.
83
- */
84
- private fetchMergedPRs;
85
- getMetrics(projectSlug: string, env: DoraEnvironment, days: number, targetsOverride?: Partial<DoraTargets>): Promise<DoraMetrics>;
86
- getHistory(projectSlug: string, env: DoraEnvironment, days: number): Promise<DoraHistoryPoint[]>;
87
- }
88
-
89
- declare class MockDoraMetricsClient implements DoraMetricsApi {
90
- getEnvironments(): DoraEnvironment[];
91
- getDefaultDays(): number;
92
- getTargets(): DoraTargets;
93
- getMetrics(_projectSlug: string, env: DoraEnvironment, _days: number, _targetsOverride?: Partial<DoraTargets>): Promise<DoraMetrics>;
94
- getHistory(_projectSlug: string, env: DoraEnvironment, _days: number): Promise<DoraHistoryPoint[]>;
95
- }
96
-
97
- declare function DoraMetricsContent(): react_jsx_runtime.JSX.Element | null;
98
-
99
- export { DoraMetricsClient, DoraMetricsContent, MockDoraMetricsClient, doraMetricsApiRef };
100
- export type { DoraEnvironment, DoraMetricValue, DoraMetrics, DoraMetricsApi, DoraRating, DoraTargets, PrDetail };
package/dist/index.esm.js DELETED
@@ -1,6 +0,0 @@
1
- export { doraMetricsPlugin } from './plugin.esm.js';
2
- export { doraMetricsApiRef } from './api/types.esm.js';
3
- export { DoraMetricsClient } from './api/DoraMetricsClient.esm.js';
4
- export { MockDoraMetricsClient } from './api/MockDoraMetricsClient.esm.js';
5
- export { DoraMetricsContent } from './components/DoraMetricsContent.esm.js';
6
- //# sourceMappingURL=index.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,11 +0,0 @@
1
- import { createFrontendPlugin } from '@backstage/frontend-plugin-api';
2
- import { doraMetricsEntityContentExtension } from './extensions/entityContent.esm.js';
3
- import { doraMetricsApiExtension } from './extensions/api.esm.js';
4
-
5
- const doraMetricsPlugin = createFrontendPlugin({
6
- pluginId: "dora-metrics",
7
- extensions: [doraMetricsEntityContentExtension, doraMetricsApiExtension]
8
- });
9
-
10
- export { doraMetricsPlugin };
11
- //# sourceMappingURL=plugin.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["import { createFrontendPlugin } from '@backstage/frontend-plugin-api';\nimport { doraMetricsEntityContentExtension } from './extensions/entityContent';\nimport { doraMetricsApiExtension } from './extensions/api';\n\nexport const doraMetricsPlugin = createFrontendPlugin({\n pluginId: 'dora-metrics',\n extensions: [doraMetricsEntityContentExtension, doraMetricsApiExtension],\n});\n"],"names":[],"mappings":";;;;AAIO,MAAM,oBAAoB,oBAAA,CAAqB;AAAA,EACpD,QAAA,EAAU,cAAA;AAAA,EACV,UAAA,EAAY,CAAC,iCAAA,EAAmC,uBAAuB;AACzE,CAAC;;;;"}