@ng-prism/plugin-coverage 22.2.1 → 22.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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Test coverage plugin for [@ng-prism/core](https://github.com/dyingangel666/ng-prism). Reads Istanbul/v8 coverage reports at build time and displays per-component test coverage metrics with a score circle in the tab bar.
4
4
 
5
- > **Full documentation:** [ng-prism Docs — Coverage Plugin](https://dyingangel666.github.io/ng-prism/#/plugins/coverage)
5
+ > **Full documentation:** [ng-prism Docs: Coverage Plugin](https://dyingangel666.github.io/ng-prism/#/plugins/coverage)
6
6
 
7
7
  ## Installation
8
8
 
@@ -25,11 +25,11 @@ import { defineConfig } from '@ng-prism/core/config';
25
25
  import { coveragePlugin } from '@ng-prism/plugin-coverage';
26
26
 
27
27
  export default defineConfig({
28
- plugins: [
29
- coveragePlugin({
30
- coveragePath: 'coverage/coverage-summary.json',
31
- }),
32
- ],
28
+ plugins: [
29
+ coveragePlugin({
30
+ coveragePath: 'coverage/coverage-summary.json'
31
+ })
32
+ ]
33
33
  });
34
34
  ```
35
35
 
@@ -43,18 +43,18 @@ export default defineConfig({
43
43
 
44
44
  ## Options
45
45
 
46
- | Option | Default | Description |
47
- | -------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
48
- | `coveragePath` | `'coverage/coverage-summary.json'` | Path to the Istanbul coverage summary file (relative to workspace root) |
49
- | `thresholds` | `80` for all metrics | Minimum acceptable percentage per metric. Files below the threshold are highlighted in red in the per-file table. Number → applied to all metrics; partial object → keys you omit fall back to `80`. |
46
+ | Option | Default | Description |
47
+ | -------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
48
+ | `coveragePath` | `'coverage/coverage-summary.json'` | Path to the Istanbul coverage summary file (relative to workspace root) |
49
+ | `thresholds` | `80` for all metrics | Minimum acceptable percentage per metric. Files below the threshold are highlighted in red in the per-file table. A number applies to all metrics; in a partial object, keys you omit fall back to `80`. |
50
50
 
51
51
  ```typescript
52
- // Single value — applied to lines, branches, functions, statements
52
+ // Single value, applied to lines, branches, functions, statements
53
53
  coveragePlugin({ thresholds: 90 });
54
54
 
55
- // Per-metric — others fall back to 80
55
+ // Per-metric; the others fall back to 80
56
56
  coveragePlugin({
57
- thresholds: { lines: 95, branches: 70 },
57
+ thresholds: { lines: 95, branches: 70 }
58
58
  });
59
59
  ```
60
60
 
@@ -2,11 +2,10 @@ import type { NavigationDecorationDefinition, PanelBadge, RuntimeComponent } fro
2
2
  /**
3
3
  * The score on the panel's own tab.
4
4
  *
5
- * Declared by the plugin rather than left to the core's built-in badge chain,
6
- * which graded every score on a fixed 90/70 scale and so could paint the tab
7
- * red for a component the navigation marker — reading this plugin's configured
8
- * thresholds — called amber. The `summary` written at build time wins when it
9
- * is there; deriving from `thresholds` covers the run where it is not.
5
+ * Declared by the plugin because the core's built-in badge uses a fixed 90/70
6
+ * scale and could show red where the navigation marker, which uses the
7
+ * configured thresholds, shows amber. The build-time `summary` wins when
8
+ * present; otherwise the badge is derived from `thresholds`.
10
9
  */
11
10
  export declare function coverageBadge(component: RuntimeComponent): PanelBadge | null;
12
11
  export declare const COVERAGE_NAVIGATION_DECORATION: NavigationDecorationDefinition;
@@ -1 +1 @@
1
- {"version":3,"file":"coverage-contributions.d.ts","sourceRoot":"","sources":["../src/coverage-contributions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,UAAU,EACV,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAiB/B;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,gBAAgB,GAAG,UAAU,GAAG,IAAI,CAW5E;AAED,eAAO,MAAM,8BAA8B,EAAE,8BAU5C,CAAC"}
1
+ {"version":3,"file":"coverage-contributions.d.ts","sourceRoot":"","sources":["../src/coverage-contributions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAa1G;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,gBAAgB,GAAG,UAAU,GAAG,IAAI,CAQ5E;AAED,eAAO,MAAM,8BAA8B,EAAE,8BAW5C,CAAC"}
@@ -5,25 +5,21 @@ import { deriveCoverageSummary } from './coverage-summary.js';
5
5
  * bundle, so the browser entry cannot import through it.
6
6
  */
7
7
  function componentMeta(component) {
8
- return (component.meta?.showcaseConfig?.meta?.['coverage'] ?? null);
8
+ return component.meta?.showcaseConfig?.meta?.['coverage'] ?? null;
9
9
  }
10
10
  /**
11
11
  * The score on the panel's own tab.
12
12
  *
13
- * Declared by the plugin rather than left to the core's built-in badge chain,
14
- * which graded every score on a fixed 90/70 scale and so could paint the tab
15
- * red for a component the navigation marker — reading this plugin's configured
16
- * thresholds — called amber. The `summary` written at build time wins when it
17
- * is there; deriving from `thresholds` covers the run where it is not.
13
+ * Declared by the plugin because the core's built-in badge uses a fixed 90/70
14
+ * scale and could show red where the navigation marker, which uses the
15
+ * configured thresholds, shows amber. The build-time `summary` wins when
16
+ * present; otherwise the badge is derived from `thresholds`.
18
17
  */
19
18
  export function coverageBadge(component) {
20
19
  const meta = componentMeta(component);
21
20
  if (!meta?.found)
22
21
  return null;
23
- const variant = meta.summary?.variant ??
24
- (meta.thresholds
25
- ? deriveCoverageSummary(meta.score, meta.thresholds).variant
26
- : 'default');
22
+ const variant = meta.summary?.variant ?? (meta.thresholds ? deriveCoverageSummary(meta.score, meta.thresholds).variant : 'default');
27
23
  return { text: String(meta.score), variant };
28
24
  }
29
25
  export const COVERAGE_NAVIGATION_DECORATION = {
@@ -37,5 +33,5 @@ export const COVERAGE_NAVIGATION_DECORATION = {
37
33
  if (meta.summary.variant === 'ok')
38
34
  return null;
39
35
  return { variant: meta.summary.variant, label: meta.summary.label };
40
- },
36
+ }
41
37
  };
@@ -1 +1 @@
1
- {"version":3,"file":"coverage-header-badge.component.d.ts","sourceRoot":"","sources":["../src/coverage-header-badge.component.ts"],"names":[],"mappings":";AAYA,qBAiBa,4BAA4B;IACvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2C;IAEpE,SAAS,CAAC,QAAQ,CAAC,IAAI;;;;cAqBpB;yCAxBQ,4BAA4B;2CAA5B,4BAA4B;CAyBxC"}
1
+ {"version":3,"file":"coverage-header-badge.component.d.ts","sourceRoot":"","sources":["../src/coverage-header-badge.component.ts"],"names":[],"mappings":";AAOA,qBAOa,4BAA4B;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2C;IAEpE,SAAS,CAAC,QAAQ,CAAC,IAAI;;;;cAoBpB;yCAvBM,4BAA4B;2CAA5B,4BAA4B;CAwBxC"}
@@ -1,6 +1,6 @@
1
- import { ChangeDetectionStrategy, Component, computed, inject, } from '@angular/core';
2
- import { PRISM_MANIFEST } from '@ng-prism/core/plugin';
1
+ import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';
3
2
  import { PrismMetricBadgeComponent } from '@ng-prism/core';
3
+ import { PRISM_MANIFEST } from '@ng-prism/core/plugin';
4
4
  import { deriveCoverageSummary } from './coverage-summary.js';
5
5
  import * as i0 from "@angular/core";
6
6
  function CoverageHeaderBadgeComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
@@ -26,7 +26,7 @@ export class CoverageHeaderBadgeComponent {
26
26
  `Lines ${meta.total.lines.pct}% · ` +
27
27
  `Branches ${meta.total.branches.pct}% · ` +
28
28
  `Functions ${meta.total.functions.pct}% · ` +
29
- `Statements ${meta.total.statements.pct}%`,
29
+ `Statements ${meta.total.statements.pct}%`
30
30
  };
31
31
  }, /* @ts-ignore */
32
32
  ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
@@ -40,22 +40,6 @@ export class CoverageHeaderBadgeComponent {
40
40
  }
41
41
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CoverageHeaderBadgeComponent, [{
42
42
  type: Component,
43
- args: [{
44
- selector: 'prism-coverage-header-badge',
45
- standalone: true,
46
- changeDetection: ChangeDetectionStrategy.OnPush,
47
- imports: [PrismMetricBadgeComponent],
48
- template: `
49
- @if (data(); as d) {
50
- <prism-metric-badge
51
- icon="shield-check"
52
- label="Library coverage"
53
- [value]="d.score + '%'"
54
- [variant]="d.variant"
55
- [title]="d.title"
56
- />
57
- }
58
- `,
59
- }]
43
+ args: [{ selector: 'prism-coverage-header-badge', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [PrismMetricBadgeComponent], template: "@if (data(); as d) {\n <prism-metric-badge\n icon=\"shield-check\"\n label=\"Library coverage\"\n [value]=\"d.score + '%'\"\n [variant]=\"d.variant\"\n [title]=\"d.title\" />\n}\n" }]
60
44
  }], null, null); })();
61
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CoverageHeaderBadgeComponent, { className: "CoverageHeaderBadgeComponent", filePath: "coverage-header-badge.component.ts", lineNumber: 30 }); })();
45
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CoverageHeaderBadgeComponent, { className: "CoverageHeaderBadgeComponent", filePath: "coverage-header-badge.component.ts", lineNumber: 15 }); })();
@@ -1 +1 @@
1
- {"version":3,"file":"coverage-panel.component.d.ts","sourceRoot":"","sources":["../src/coverage-panel.component.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;;AAS7B,qBAkKa,sBAAsB;IACjC,QAAQ,CAAC,eAAe,+CAAwB;IAEhD,SAAS,CAAC,QAAQ,CAAC,QAAQ,sDAKxB;IAEH,SAAS,CAAC,QAAQ,CAAC,YAAY;;;SAS5B;IAEH,SAAS,CAAC,QAAQ,CAAC,KAAK,uDAErB;IAEH,SAAS,CAAC,QAAQ,CAAC,UAAU,qDAE1B;IAEH,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;yCA7B7B,sBAAsB;2CAAtB,sBAAsB;CAiClC"}
1
+ {"version":3,"file":"coverage-panel.component.d.ts","sourceRoot":"","sources":["../src/coverage-panel.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;;AAShG,qBAOa,sBAAsB;IAC/B,QAAQ,CAAC,eAAe,+CAAwB;IAEhD,SAAS,CAAC,QAAQ,CAAC,QAAQ,sDAIxB;IAEH,SAAS,CAAC,QAAQ,CAAC,YAAY;;;SAU5B;IAEH,SAAS,CAAC,QAAQ,CAAC,KAAK,uDAErB;IAEH,SAAS,CAAC,QAAQ,CAAC,UAAU,qDAE1B;IAEH,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;yCA7B/B,sBAAsB;2CAAtB,sBAAsB;CAkClC"}
@@ -1,4 +1,4 @@
1
- import { ChangeDetectionStrategy, Component, computed, input, } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  const _forTrack0 = ($index, $item) => $item.label;
4
4
  const _forTrack1 = ($index, $item) => $item.path;
@@ -106,14 +106,14 @@ const FALLBACK_THRESHOLDS = {
106
106
  lines: 80,
107
107
  branches: 80,
108
108
  functions: 80,
109
- statements: 80,
109
+ statements: 80
110
110
  };
111
111
  export class CoveragePanelComponent {
112
112
  activeComponent = input(null, /* @ts-ignore */
113
113
  ...(ngDevMode ? [{ debugName: "activeComponent" }] : /* istanbul ignore next */ []));
114
114
  coverage = computed(() => {
115
115
  const comp = this.activeComponent();
116
- return (comp?.meta?.showcaseConfig?.meta?.['coverage'] ?? null);
116
+ return comp?.meta?.showcaseConfig?.meta?.['coverage'] ?? null;
117
117
  }, /* @ts-ignore */
118
118
  ...(ngDevMode ? [{ debugName: "coverage" }] : /* istanbul ignore next */ []));
119
119
  summaryStats = computed(() => {
@@ -124,7 +124,7 @@ export class CoveragePanelComponent {
124
124
  { label: 'Lines', pct: c.lines.pct },
125
125
  { label: 'Branches', pct: c.branches.pct },
126
126
  { label: 'Functions', pct: c.functions.pct },
127
- { label: 'Statements', pct: c.statements.pct },
127
+ { label: 'Statements', pct: c.statements.pct }
128
128
  ];
129
129
  }, /* @ts-ignore */
130
130
  ...(ngDevMode ? [{ debugName: "summaryStats" }] : /* istanbul ignore next */ []));
@@ -145,67 +145,10 @@ export class CoveragePanelComponent {
145
145
  i0.ɵɵconditionalCreate(0, CoveragePanelComponent_Conditional_0_Template, 5, 1, "div", 0)(1, CoveragePanelComponent_Conditional_1_Template, 3, 0, "div", 1);
146
146
  } if (rf & 2) {
147
147
  i0.ɵɵconditional(ctx.coverage()?.found ? 0 : 1);
148
- } }, styles: ["[_nghost-%COMP%] { display: block; height: 100%; overflow: auto; }\n\n .cov-body[_ngcontent-%COMP%] { padding: 20px 24px; }\n\n .cov-summary[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n gap: 12px;\n margin-bottom: 18px;\n }\n\n .cov-stat[_ngcontent-%COMP%] {\n padding: 12px 14px;\n background: var(--%NS%prism-bg-surface);\n border: 1px solid var(--%NS%prism-border);\n border-radius: 8px;\n }\n .cov-stat-k[_ngcontent-%COMP%] {\n font-size: 10.5px;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: var(--%NS%prism-text-ghost);\n font-weight: 700;\n margin-bottom: 6px;\n }\n .cov-stat-v[_ngcontent-%COMP%] {\n font-family: var(--%NS%font-mono);\n font-size: 22px;\n font-weight: 700;\n color: var(--%NS%prism-text);\n letter-spacing: -0.02em;\n }\n .cov-stat-v[_ngcontent-%COMP%] small[_ngcontent-%COMP%] {\n font-size: 13px;\n color: var(--%NS%prism-text-muted);\n font-weight: 500;\n }\n .cov-bar[_ngcontent-%COMP%] {\n margin-top: 8px;\n height: 4px;\n background: var(--%NS%prism-input-bg);\n border-radius: 2px;\n overflow: hidden;\n }\n .cov-bar-fill[_ngcontent-%COMP%] {\n height: 100%;\n background: linear-gradient(90deg, var(--%NS%prism-primary-from), var(--%NS%prism-primary-to));\n border-radius: 2px;\n transition: width 0.6s;\n }\n\n .cov-files[_ngcontent-%COMP%] {\n padding: 12px;\n background: var(--%NS%prism-bg-surface);\n border: 1px solid var(--%NS%prism-border);\n border-radius: 8px;\n }\n\n .cov-file[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: 1fr auto auto auto auto;\n align-items: center;\n gap: 16px;\n padding: 7px 4px;\n font-family: var(--%NS%font-mono);\n font-size: 12px;\n border-bottom: 1px solid var(--%NS%prism-border);\n }\n .cov-file[_ngcontent-%COMP%]:last-child { border-bottom: 0; }\n\n .cov-file--header[_ngcontent-%COMP%] {\n border-bottom: 1px solid var(--%NS%prism-border-strong);\n padding-bottom: 8px;\n color: var(--%NS%prism-text-ghost);\n font-size: 10.5px;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n font-weight: 700;\n }\n\n .cov-file-name[_ngcontent-%COMP%] { color: var(--%NS%prism-text-2); }\n .cov-file-val[_ngcontent-%COMP%] {\n color: var(--%NS%prism-text);\n min-width: 54px;\n text-align: right;\n }\n .cov-file-val.bad[_ngcontent-%COMP%] { color: var(--%NS%prism-warn); }\n\n .cov-empty[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 120px;\n color: var(--%NS%prism-text-muted);\n font-size: 13px;\n text-align: center;\n }"] });
148
+ } }, styles: ["[_nghost-%COMP%] {\n display: block;\n height: 100%;\n overflow: auto;\n}\n\n.cov-body[_ngcontent-%COMP%] {\n padding: 20px 24px;\n}\n\n.cov-summary[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n gap: 12px;\n margin-bottom: 18px;\n}\n\n.cov-stat[_ngcontent-%COMP%] {\n padding: 12px 14px;\n background: var(--%NS%prism-bg-surface);\n border: 1px solid var(--%NS%prism-border);\n border-radius: 8px;\n}\n\n.cov-stat-k[_ngcontent-%COMP%] {\n margin-bottom: 6px;\n font-size: 10.5px;\n font-weight: 700;\n color: var(--%NS%prism-text-ghost);\n text-transform: uppercase;\n letter-spacing: 0.08em;\n}\n\n.cov-stat-v[_ngcontent-%COMP%] {\n font-family: var(--%NS%font-mono);\n font-size: 22px;\n font-weight: 700;\n color: var(--%NS%prism-text);\n letter-spacing: -0.02em;\n}\n\n.cov-stat-v[_ngcontent-%COMP%] small[_ngcontent-%COMP%] {\n font-size: 13px;\n font-weight: 500;\n color: var(--%NS%prism-text-muted);\n}\n\n.cov-bar[_ngcontent-%COMP%] {\n height: 4px;\n margin-top: 8px;\n overflow: hidden;\n background: var(--%NS%prism-input-bg);\n border-radius: 2px;\n}\n\n.cov-bar-fill[_ngcontent-%COMP%] {\n height: 100%;\n background: linear-gradient(90deg, var(--%NS%prism-primary-from), var(--%NS%prism-primary-to));\n border-radius: 2px;\n transition: width 0.6s;\n}\n\n.cov-files[_ngcontent-%COMP%] {\n padding: 12px;\n background: var(--%NS%prism-bg-surface);\n border: 1px solid var(--%NS%prism-border);\n border-radius: 8px;\n}\n\n.cov-file[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: 1fr auto auto auto auto;\n gap: 16px;\n align-items: center;\n padding: 7px 4px;\n font-family: var(--%NS%font-mono);\n font-size: 12px;\n border-bottom: 1px solid var(--%NS%prism-border);\n}\n\n.cov-file[_ngcontent-%COMP%]:last-child {\n border-bottom: 0;\n}\n\n.cov-file--header[_ngcontent-%COMP%] {\n padding-bottom: 8px;\n font-size: 10.5px;\n font-weight: 700;\n color: var(--%NS%prism-text-ghost);\n text-transform: uppercase;\n letter-spacing: 0.06em;\n border-bottom: 1px solid var(--%NS%prism-border-strong);\n}\n\n.cov-file-name[_ngcontent-%COMP%] {\n color: var(--%NS%prism-text-2);\n}\n\n.cov-file-val[_ngcontent-%COMP%] {\n min-width: 54px;\n color: var(--%NS%prism-text);\n text-align: right;\n}\n\n.cov-file-val.bad[_ngcontent-%COMP%] {\n color: var(--%NS%prism-warn);\n}\n\n.cov-empty[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 120px;\n font-size: 13px;\n color: var(--%NS%prism-text-muted);\n text-align: center;\n}"] });
149
149
  }
150
150
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CoveragePanelComponent, [{
151
151
  type: Component,
152
- args: [{ selector: 'prism-coverage-panel', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
153
- @if (coverage()?.found) {
154
- <div class="cov-body">
155
- <div class="cov-summary">
156
- @for (stat of summaryStats(); track stat.label) {
157
- <div class="cov-stat">
158
- <div class="cov-stat-k">{{ stat.label }}</div>
159
- <div class="cov-stat-v">{{ stat.pct }}<small>%</small></div>
160
- <div class="cov-bar">
161
- <div class="cov-bar-fill" [style.width.%]="stat.pct"></div>
162
- </div>
163
- </div>
164
- }
165
- </div>
166
-
167
- @if (files().length) {
168
- <div class="cov-files">
169
- <div class="cov-file cov-file--header">
170
- <span>File</span>
171
- <span>Lines</span>
172
- <span>Branch</span>
173
- <span>Func</span>
174
- <span>Stmt</span>
175
- </div>
176
- @for (file of files(); track file.path) {
177
- <div class="cov-file">
178
- <span class="cov-file-name">{{ fileName(file.path) }}</span>
179
- <span
180
- class="cov-file-val"
181
- [class.bad]="file.lines.pct < thresholds().lines"
182
- >{{ file.lines.pct }}%</span
183
- >
184
- <span
185
- class="cov-file-val"
186
- [class.bad]="file.branches.pct < thresholds().branches"
187
- >{{ file.branches.pct }}%</span
188
- >
189
- <span
190
- class="cov-file-val"
191
- [class.bad]="file.functions.pct < thresholds().functions"
192
- >{{ file.functions.pct }}%</span
193
- >
194
- <span
195
- class="cov-file-val"
196
- [class.bad]="file.statements.pct < thresholds().statements"
197
- >{{ file.statements.pct }}%</span
198
- >
199
- </div>
200
- }
201
- </div>
202
- }
203
- </div>
204
- } @else {
205
- <div class="cov-empty">
206
- <p>No coverage data. Run tests with coverage enabled.</p>
207
- </div>
208
- }
209
- `, styles: ["\n :host { display: block; height: 100%; overflow: auto; }\n\n .cov-body { padding: 20px 24px; }\n\n .cov-summary {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n gap: 12px;\n margin-bottom: 18px;\n }\n\n .cov-stat {\n padding: 12px 14px;\n background: var(--prism-bg-surface);\n border: 1px solid var(--prism-border);\n border-radius: 8px;\n }\n .cov-stat-k {\n font-size: 10.5px;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: var(--prism-text-ghost);\n font-weight: 700;\n margin-bottom: 6px;\n }\n .cov-stat-v {\n font-family: var(--font-mono);\n font-size: 22px;\n font-weight: 700;\n color: var(--prism-text);\n letter-spacing: -0.02em;\n }\n .cov-stat-v small {\n font-size: 13px;\n color: var(--prism-text-muted);\n font-weight: 500;\n }\n .cov-bar {\n margin-top: 8px;\n height: 4px;\n background: var(--prism-input-bg);\n border-radius: 2px;\n overflow: hidden;\n }\n .cov-bar-fill {\n height: 100%;\n background: linear-gradient(90deg, var(--prism-primary-from), var(--prism-primary-to));\n border-radius: 2px;\n transition: width 0.6s;\n }\n\n .cov-files {\n padding: 12px;\n background: var(--prism-bg-surface);\n border: 1px solid var(--prism-border);\n border-radius: 8px;\n }\n\n .cov-file {\n display: grid;\n grid-template-columns: 1fr auto auto auto auto;\n align-items: center;\n gap: 16px;\n padding: 7px 4px;\n font-family: var(--font-mono);\n font-size: 12px;\n border-bottom: 1px solid var(--prism-border);\n }\n .cov-file:last-child { border-bottom: 0; }\n\n .cov-file--header {\n border-bottom: 1px solid var(--prism-border-strong);\n padding-bottom: 8px;\n color: var(--prism-text-ghost);\n font-size: 10.5px;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n font-weight: 700;\n }\n\n .cov-file-name { color: var(--prism-text-2); }\n .cov-file-val {\n color: var(--prism-text);\n min-width: 54px;\n text-align: right;\n }\n .cov-file-val.bad { color: var(--prism-warn); }\n\n .cov-empty {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 120px;\n color: var(--prism-text-muted);\n font-size: 13px;\n text-align: center;\n }\n "] }]
152
+ args: [{ selector: 'prism-coverage-panel', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (coverage()?.found) {\n <div class=\"cov-body\">\n <div class=\"cov-summary\">\n @for (stat of summaryStats(); track stat.label) {\n <div class=\"cov-stat\">\n <div class=\"cov-stat-k\">{{ stat.label }}</div>\n <div class=\"cov-stat-v\">{{ stat.pct }}<small>%</small></div>\n <div class=\"cov-bar\">\n <div\n class=\"cov-bar-fill\"\n [style.width.%]=\"stat.pct\"></div>\n </div>\n </div>\n }\n </div>\n\n @if (files().length) {\n <div class=\"cov-files\">\n <div class=\"cov-file cov-file--header\">\n <span>File</span>\n <span>Lines</span>\n <span>Branch</span>\n <span>Func</span>\n <span>Stmt</span>\n </div>\n @for (file of files(); track file.path) {\n <div class=\"cov-file\">\n <span class=\"cov-file-name\">{{ fileName(file.path) }}</span>\n <span\n class=\"cov-file-val\"\n [class.bad]=\"file.lines.pct < thresholds().lines\"\n >{{ file.lines.pct }}%</span\n >\n <span\n class=\"cov-file-val\"\n [class.bad]=\"file.branches.pct < thresholds().branches\"\n >{{ file.branches.pct }}%</span\n >\n <span\n class=\"cov-file-val\"\n [class.bad]=\"file.functions.pct < thresholds().functions\"\n >{{ file.functions.pct }}%</span\n >\n <span\n class=\"cov-file-val\"\n [class.bad]=\"file.statements.pct < thresholds().statements\"\n >{{ file.statements.pct }}%</span\n >\n </div>\n }\n </div>\n }\n </div>\n} @else {\n <div class=\"cov-empty\">\n <p>No coverage data. Run tests with coverage enabled.</p>\n </div>\n}\n", styles: [":host {\n display: block;\n height: 100%;\n overflow: auto;\n}\n\n.cov-body {\n padding: 20px 24px;\n}\n\n.cov-summary {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n gap: 12px;\n margin-bottom: 18px;\n}\n\n.cov-stat {\n padding: 12px 14px;\n background: var(--prism-bg-surface);\n border: 1px solid var(--prism-border);\n border-radius: 8px;\n}\n\n.cov-stat-k {\n margin-bottom: 6px;\n font-size: 10.5px;\n font-weight: 700;\n color: var(--prism-text-ghost);\n text-transform: uppercase;\n letter-spacing: 0.08em;\n}\n\n.cov-stat-v {\n font-family: var(--font-mono);\n font-size: 22px;\n font-weight: 700;\n color: var(--prism-text);\n letter-spacing: -0.02em;\n}\n\n.cov-stat-v small {\n font-size: 13px;\n font-weight: 500;\n color: var(--prism-text-muted);\n}\n\n.cov-bar {\n height: 4px;\n margin-top: 8px;\n overflow: hidden;\n background: var(--prism-input-bg);\n border-radius: 2px;\n}\n\n.cov-bar-fill {\n height: 100%;\n background: linear-gradient(90deg, var(--prism-primary-from), var(--prism-primary-to));\n border-radius: 2px;\n transition: width 0.6s;\n}\n\n.cov-files {\n padding: 12px;\n background: var(--prism-bg-surface);\n border: 1px solid var(--prism-border);\n border-radius: 8px;\n}\n\n.cov-file {\n display: grid;\n grid-template-columns: 1fr auto auto auto auto;\n gap: 16px;\n align-items: center;\n padding: 7px 4px;\n font-family: var(--font-mono);\n font-size: 12px;\n border-bottom: 1px solid var(--prism-border);\n}\n\n.cov-file:last-child {\n border-bottom: 0;\n}\n\n.cov-file--header {\n padding-bottom: 8px;\n font-size: 10.5px;\n font-weight: 700;\n color: var(--prism-text-ghost);\n text-transform: uppercase;\n letter-spacing: 0.06em;\n border-bottom: 1px solid var(--prism-border-strong);\n}\n\n.cov-file-name {\n color: var(--prism-text-2);\n}\n\n.cov-file-val {\n min-width: 54px;\n color: var(--prism-text);\n text-align: right;\n}\n\n.cov-file-val.bad {\n color: var(--prism-warn);\n}\n\n.cov-empty {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 120px;\n font-size: 13px;\n color: var(--prism-text-muted);\n text-align: center;\n}\n"] }]
210
153
  }], null, { activeComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeComponent", required: false }] }] }); })();
211
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CoveragePanelComponent, { className: "CoveragePanelComponent", filePath: "coverage-panel.component.ts", lineNumber: 182 }); })();
154
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CoveragePanelComponent, { className: "CoveragePanelComponent", filePath: "coverage-panel.component.ts", lineNumber: 18 }); })();
@@ -1 +1 @@
1
- {"version":3,"file":"coverage-plugin.browser.d.ts","sourceRoot":"","sources":["../src/coverage-plugin.browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAMjE,wBAAgB,cAAc,CAC5B,QAAQ,CAAC,EAAE,qBAAqB,GAC/B,aAAa,CA8Bf"}
1
+ {"version":3,"file":"coverage-plugin.browser.d.ts","sourceRoot":"","sources":["../src/coverage-plugin.browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,wBAAgB,cAAc,CAAC,QAAQ,CAAC,EAAE,qBAAqB,GAAG,aAAa,CAwB9E"}
@@ -1,4 +1,4 @@
1
- import { coverageBadge, COVERAGE_NAVIGATION_DECORATION, } from './coverage-contributions.js';
1
+ import { COVERAGE_NAVIGATION_DECORATION, coverageBadge } from './coverage-contributions.js';
2
2
  export function coveragePlugin(_options) {
3
3
  return {
4
4
  name: '@ng-prism/plugin-coverage',
@@ -9,17 +9,17 @@ export function coveragePlugin(_options) {
9
9
  badge: coverageBadge,
10
10
  icon: 'shield-check',
11
11
  loadComponent: () => import('./coverage-panel.component.js').then((m) => m.CoveragePanelComponent),
12
- position: 'bottom',
13
- },
12
+ position: 'bottom'
13
+ }
14
14
  ],
15
15
  headerWidgets: [
16
16
  {
17
17
  id: 'coverage-total',
18
18
  placement: 'end',
19
19
  order: -10,
20
- loadComponent: () => import('./coverage-header-badge.component.js').then((m) => m.CoverageHeaderBadgeComponent),
21
- },
20
+ loadComponent: () => import('./coverage-header-badge.component.js').then((m) => m.CoverageHeaderBadgeComponent)
21
+ }
22
22
  ],
23
- navigationDecorations: [COVERAGE_NAVIGATION_DECORATION],
23
+ navigationDecorations: [COVERAGE_NAVIGATION_DECORATION]
24
24
  };
25
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"coverage-plugin.d.ts","sourceRoot":"","sources":["../src/coverage-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAQ7B,eAAO,MAAM,2BAA2B,EAAE,kBAKzC,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,GAC3C,kBAAkB,CAWpB;AAED,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,aAAa,CAgE7E"}
1
+ {"version":3,"file":"coverage-plugin.d.ts","sourceRoot":"","sources":["../src/coverage-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAIrF,eAAO,MAAM,2BAA2B,EAAE,kBAKzC,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAW1G;AAED,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,aAAa,CA0D7E"}
@@ -1,10 +1,10 @@
1
- import { coverageBadge, COVERAGE_NAVIGATION_DECORATION, } from './coverage-contributions.js';
1
+ import { COVERAGE_NAVIGATION_DECORATION, coverageBadge } from './coverage-contributions.js';
2
2
  const DEFAULT_COVERAGE_PATH = 'coverage/coverage-summary.json';
3
3
  export const DEFAULT_COVERAGE_THRESHOLDS = {
4
4
  lines: 80,
5
5
  branches: 80,
6
6
  functions: 80,
7
- statements: 80,
7
+ statements: 80
8
8
  };
9
9
  export function resolveCoverageThresholds(input) {
10
10
  if (input === undefined)
@@ -14,7 +14,7 @@ export function resolveCoverageThresholds(input) {
14
14
  lines: input,
15
15
  branches: input,
16
16
  functions: input,
17
- statements: input,
17
+ statements: input
18
18
  };
19
19
  }
20
20
  return { ...DEFAULT_COVERAGE_THRESHOLDS, ...input };
@@ -37,12 +37,10 @@ export function coveragePlugin(options) {
37
37
  coverage: {
38
38
  ...coverage,
39
39
  thresholds,
40
- ...(coverage.found
41
- ? { summary: deriveCoverageSummary(coverage.score, thresholds) }
42
- : {}),
43
- },
44
- },
45
- },
40
+ ...(coverage.found ? { summary: deriveCoverageSummary(coverage.score, thresholds) } : {})
41
+ }
42
+ }
43
+ }
46
44
  };
47
45
  },
48
46
  async onManifestReady(manifest) {
@@ -52,8 +50,8 @@ export function coveragePlugin(options) {
52
50
  ...manifest,
53
51
  meta: {
54
52
  ...manifest.meta,
55
- coverage: { total, thresholds },
56
- },
53
+ coverage: { total, thresholds }
54
+ }
57
55
  };
58
56
  },
59
57
  panels: [
@@ -62,17 +60,17 @@ export function coveragePlugin(options) {
62
60
  label: 'Coverage',
63
61
  badge: coverageBadge,
64
62
  loadComponent: () => import('./coverage-panel.component.js').then((m) => m.CoveragePanelComponent),
65
- position: 'bottom',
66
- },
63
+ position: 'bottom'
64
+ }
67
65
  ],
68
66
  headerWidgets: [
69
67
  {
70
68
  id: 'coverage-total',
71
69
  placement: 'end',
72
70
  order: -10,
73
- loadComponent: () => import('./coverage-header-badge.component.js').then((m) => m.CoverageHeaderBadgeComponent),
74
- },
71
+ loadComponent: () => import('./coverage-header-badge.component.js').then((m) => m.CoverageHeaderBadgeComponent)
72
+ }
75
73
  ],
76
- navigationDecorations: [COVERAGE_NAVIGATION_DECORATION],
74
+ navigationDecorations: [COVERAGE_NAVIGATION_DECORATION]
77
75
  };
78
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"coverage-reader.d.ts","sourceRoot":"","sources":["../src/coverage-reader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAEnB,MAAM,qBAAqB,CAAC;AAgE7B,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,iBAAiB,EAAE,MAAM,GACxB,YAAY,CAwBd;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,YAAY,CAuBpE;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,kBAAkB,GAAG,MAAM,CAQvE;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
1
+ {"version":3,"file":"coverage-reader.d.ts","sourceRoot":"","sources":["../src/coverage-reader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAmB,MAAM,qBAAqB,CAAC;AA+D7F,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,YAAY,CAoBjG;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,YAAY,CAmBpE;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,kBAAkB,GAAG,MAAM,CAEvE;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
@@ -6,7 +6,7 @@ const EMPTY_COVERAGE = {
6
6
  branches: { ...EMPTY_METRIC },
7
7
  functions: { ...EMPTY_METRIC },
8
8
  lines: { ...EMPTY_METRIC },
9
- found: false,
9
+ found: false
10
10
  };
11
11
  const cache = new Map();
12
12
  function normalizePath(p) {
@@ -37,8 +37,7 @@ function findEntry(summary, componentPath) {
37
37
  }
38
38
  for (const key of keys) {
39
39
  const normalizedKey = normalizePath(key);
40
- if (normalizedKey.endsWith(normalizedComponent) ||
41
- normalizedComponent.endsWith(normalizedKey)) {
40
+ if (normalizedKey.endsWith(normalizedComponent) || normalizedComponent.endsWith(normalizedKey)) {
42
41
  return key;
43
42
  }
44
43
  }
@@ -57,18 +56,14 @@ export function readCoverageForFile(coveragePath, componentFilePath) {
57
56
  if (!entryKey)
58
57
  return { ...EMPTY_COVERAGE };
59
58
  const entry = summary[entryKey];
60
- const score = Math.round((entry.statements.pct +
61
- entry.branches.pct +
62
- entry.functions.pct +
63
- entry.lines.pct) /
64
- 4);
59
+ const score = Math.round((entry.statements.pct + entry.branches.pct + entry.functions.pct + entry.lines.pct) / 4);
65
60
  return {
66
61
  score,
67
62
  statements: { ...entry.statements },
68
63
  branches: { ...entry.branches },
69
64
  functions: { ...entry.functions },
70
65
  lines: { ...entry.lines },
71
- found: true,
66
+ found: true
72
67
  };
73
68
  }
74
69
  export function readTotalCoverage(coveragePath) {
@@ -78,26 +73,18 @@ export function readTotalCoverage(coveragePath) {
78
73
  const total = summary['total'];
79
74
  if (!total)
80
75
  return { ...EMPTY_COVERAGE };
81
- const score = Math.round((total.statements.pct +
82
- total.branches.pct +
83
- total.functions.pct +
84
- total.lines.pct) /
85
- 4);
76
+ const score = Math.round((total.statements.pct + total.branches.pct + total.functions.pct + total.lines.pct) / 4);
86
77
  return {
87
78
  score,
88
79
  statements: { ...total.statements },
89
80
  branches: { ...total.branches },
90
81
  functions: { ...total.functions },
91
82
  lines: { ...total.lines },
92
- found: true,
83
+ found: true
93
84
  };
94
85
  }
95
86
  export function averageThreshold(thresholds) {
96
- return Math.round((thresholds.lines +
97
- thresholds.branches +
98
- thresholds.functions +
99
- thresholds.statements) /
100
- 4);
87
+ return Math.round((thresholds.lines + thresholds.branches + thresholds.functions + thresholds.statements) / 4);
101
88
  }
102
89
  export function clearCoverageCache() {
103
90
  cache.clear();
@@ -7,7 +7,7 @@ import type { CoverageSummary, CoverageThresholds } from './coverage.types.js';
7
7
  *
8
8
  * Same motive as `thresholds.ts` in `plugin-visual-regression`.
9
9
  */
10
- /** The single number the badge compares against — the mean of the four metrics. */
10
+ /** The single number the badge compares against: the mean of the four metrics. */
11
11
  export declare function avgThreshold(thresholds: CoverageThresholds): number;
12
12
  export declare function deriveCoverageSummary(score: number, thresholds: CoverageThresholds): CoverageSummary;
13
13
  //# sourceMappingURL=coverage-summary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"coverage-summary.d.ts","sourceRoot":"","sources":["../src/coverage-summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE/E;;;;;;;GAOG;AACH,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,UAAU,EAAE,kBAAkB,GAAG,MAAM,CAQnE;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,kBAAkB,GAC7B,eAAe,CAMjB"}
1
+ {"version":3,"file":"coverage-summary.d.ts","sourceRoot":"","sources":["../src/coverage-summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE/E;;;;;;;GAOG;AACH,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,UAAU,EAAE,kBAAkB,GAAG,MAAM,CAEnE;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,eAAe,CAKpG"}
@@ -6,13 +6,9 @@
6
6
  *
7
7
  * Same motive as `thresholds.ts` in `plugin-visual-regression`.
8
8
  */
9
- /** The single number the badge compares against — the mean of the four metrics. */
9
+ /** The single number the badge compares against: the mean of the four metrics. */
10
10
  export function avgThreshold(thresholds) {
11
- return Math.round((thresholds.lines +
12
- thresholds.branches +
13
- thresholds.functions +
14
- thresholds.statements) /
15
- 4);
11
+ return Math.round((thresholds.lines + thresholds.branches + thresholds.functions + thresholds.statements) / 4);
16
12
  }
17
13
  export function deriveCoverageSummary(score, thresholds) {
18
14
  const avg = avgThreshold(thresholds);
@@ -1 +1 @@
1
- {"version":3,"file":"coverage.types.d.ts","sourceRoot":"","sources":["../src/coverage.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,YAAY,CAAC;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,YAAY,CAAC;IACxB,KAAK,EAAE,YAAY,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,YAAY,CAAC;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,YAAY,CAAC;IACxB,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACnD;AAED,mDAAmD;AACnD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,YAAY,CAAC;IACpB,UAAU,EAAE,kBAAkB,CAAC;CAChC;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,YAAY,CAAC;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,YAAY,CAAC;IACxB,KAAK,EAAE,YAAY,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,CAAC;CAC1C"}
1
+ {"version":3,"file":"coverage.types.d.ts","sourceRoot":"","sources":["../src/coverage.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,YAAY,CAAC;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,YAAY,CAAC;IACxB,KAAK,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,YAAY,CAAC;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,YAAY,CAAC;IACxB,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACrD;AAED,mDAAmD;AACnD,MAAM,WAAW,oBAAoB;IACjC,KAAK,EAAE,YAAY,CAAC;IACpB,UAAU,EAAE,kBAAkB,CAAC;CAClC;AAED,MAAM,WAAW,oBAAoB;IACjC,UAAU,EAAE,YAAY,CAAC;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,YAAY,CAAC;IACxB,KAAK,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC5B,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,CAAC;CAC5C"}
@@ -1,5 +1,5 @@
1
1
  export { coveragePlugin } from './coverage-plugin.browser.js';
2
2
  export { CoveragePanelComponent } from './coverage-panel.component.js';
3
3
  export { CoverageHeaderBadgeComponent } from './coverage-header-badge.component.js';
4
- export type { CoverageData, CoverageManifestMeta, CoveragePluginOptions, CoverageSummary, CoverageThresholds, MetricDetail, } from './coverage.types.js';
4
+ export type { CoverageData, CoverageManifestMeta, CoveragePluginOptions, CoverageSummary, CoverageThresholds, MetricDetail } from './coverage.types.js';
5
5
  //# sourceMappingURL=index.browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,YAAY,GACb,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,eAAe,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { coveragePlugin } from './coverage-plugin.js';
2
2
  export { CoveragePanelComponent } from './coverage-panel.component.js';
3
3
  export { CoverageHeaderBadgeComponent } from './coverage-header-badge.component.js';
4
- export type { CoverageData, CoverageManifestMeta, CoveragePluginOptions, CoverageSummary, CoverageThresholds, MetricDetail, } from './coverage.types.js';
4
+ export type { CoverageData, CoverageManifestMeta, CoveragePluginOptions, CoverageSummary, CoverageThresholds, MetricDetail } from './coverage.types.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,YAAY,GACb,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,eAAe,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,IAAI,EAGV,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAyBtD,wBAAgB,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAEvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,IAAI,EAAoC,MAAM,4BAA4B,CAAC;AAEhG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAwBtD,wBAAgB,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAEvD"}
@@ -1,4 +1,4 @@
1
- import { chain, } from '@angular-devkit/schematics';
1
+ import { chain } from '@angular-devkit/schematics';
2
2
  import { addPluginToConfig } from '@ng-prism/core/schematics/utils';
3
3
  const PLUGIN_IMPORT_NAME = 'coveragePlugin';
4
4
  const PLUGIN_IMPORT_FROM = '@ng-prism/plugin-coverage';
@@ -9,13 +9,13 @@ function injectPlugin(options) {
9
9
  const changed = addPluginToConfig(tree, configPath, {
10
10
  importName: PLUGIN_IMPORT_NAME,
11
11
  importFrom: PLUGIN_IMPORT_FROM,
12
- call: PLUGIN_CALL,
12
+ call: PLUGIN_CALL
13
13
  });
14
14
  if (changed) {
15
- context.logger.info(` ${PLUGIN_IMPORT_FROM} → added to ${configPath}`);
15
+ context.logger.info(` ${PLUGIN_IMPORT_FROM} added to ${configPath}`);
16
16
  }
17
17
  else {
18
- context.logger.info(` ${PLUGIN_IMPORT_FROM} already configured — skipped`);
18
+ context.logger.info(` ${PLUGIN_IMPORT_FROM} already configured, skipped`);
19
19
  }
20
20
  return tree;
21
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-prism/plugin-coverage",
3
- "version": "22.2.1",
3
+ "version": "22.4.0",
4
4
  "description": "Test coverage panel for ng-prism.",
5
5
  "ng-add": {
6
6
  "save": "devDependencies"
@@ -35,7 +35,8 @@
35
35
  ],
36
36
  "peerDependencies": {
37
37
  "@angular/core": ">=20.0.0",
38
- "@ng-prism/core": "^22.2.1-0"
38
+ "@ng-prism/core": "^22.4.0-0",
39
+ "@angular-devkit/schematics": ">=20.0.0"
39
40
  },
40
41
  "devDependencies": {
41
42
  "@ng-prism/core": "*"
@@ -1,10 +1,10 @@
1
1
  {
2
- "$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
3
- "schematics": {
4
- "ng-add": {
5
- "description": "Adds @ng-prism/plugin-coverage to the ng-prism config",
6
- "factory": "../dist/schematics/ng-add/index#ngAdd",
7
- "schema": "./ng-add/schema.json"
2
+ "$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
3
+ "schematics": {
4
+ "ng-add": {
5
+ "description": "Adds @ng-prism/plugin-coverage to the ng-prism config",
6
+ "factory": "../dist/schematics/ng-add/index#ngAdd",
7
+ "schema": "./ng-add/schema.json"
8
+ }
8
9
  }
9
- }
10
10
  }
@@ -1,16 +1,16 @@
1
1
  {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "NgPrismPluginCoverageNgAdd",
4
- "title": "Add @ng-prism/plugin-coverage",
5
- "description": "Registers @ng-prism/plugin-coverage in ng-prism.config.ts",
6
- "type": "object",
7
- "properties": {
8
- "configPath": {
9
- "type": "string",
10
- "description": "Path to ng-prism.config.ts",
11
- "default": "ng-prism.config.ts"
12
- }
13
- },
14
- "required": [],
15
- "additionalProperties": false
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "NgPrismPluginCoverageNgAdd",
4
+ "title": "Add @ng-prism/plugin-coverage",
5
+ "description": "Registers @ng-prism/plugin-coverage in ng-prism.config.ts",
6
+ "type": "object",
7
+ "properties": {
8
+ "configPath": {
9
+ "type": "string",
10
+ "description": "Path to ng-prism.config.ts",
11
+ "default": "ng-prism.config.ts"
12
+ }
13
+ },
14
+ "required": [],
15
+ "additionalProperties": false
16
16
  }