@ng-prism/plugin-coverage 22.3.0 → 22.4.1

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
@@ -1,8 +1,8 @@
1
1
  # @ng-prism/plugin-coverage
2
2
 
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.
3
+ Test coverage plugin for [@ng-prism/core](https://github.com/ng-prism/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://ng-prism.github.io/ng-prism/#/plugins/coverage)
6
6
 
7
7
  ## Installation
8
8
 
@@ -43,16 +43,16 @@ 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
57
  thresholds: { lines: 95, branches: 70 }
58
58
  });
@@ -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,EAAE,8BAA8B,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAa1G;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,gBAAgB,GAAG,UAAU,GAAG,IAAI,CAQ5E;AAED,eAAO,MAAM,8BAA8B,EAAE,8BAW5C,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"}
@@ -10,11 +10,10 @@ function componentMeta(component) {
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);
@@ -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,CAEnE;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,eAAe,CAKpG"}
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,7 +6,7 @@
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
11
  return Math.round((thresholds.lines + thresholds.branches + thresholds.functions + thresholds.statements) / 4);
12
12
  }
@@ -12,10 +12,10 @@ function injectPlugin(options) {
12
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-prism/plugin-coverage",
3
- "version": "22.3.0",
3
+ "version": "22.4.1",
4
4
  "description": "Test coverage panel for ng-prism.",
5
5
  "ng-add": {
6
6
  "save": "devDependencies"
@@ -35,7 +35,7 @@
35
35
  ],
36
36
  "peerDependencies": {
37
37
  "@angular/core": ">=20.0.0",
38
- "@ng-prism/core": "^22.3.0-0",
38
+ "@ng-prism/core": "^22.4.1-0",
39
39
  "@angular-devkit/schematics": ">=20.0.0"
40
40
  },
41
41
  "devDependencies": {
@@ -46,9 +46,9 @@
46
46
  },
47
47
  "repository": {
48
48
  "type": "git",
49
- "url": "https://github.com/dyingangel666/ng-prism.git",
49
+ "url": "https://github.com/ng-prism/ng-prism.git",
50
50
  "directory": "packages/plugin-coverage"
51
51
  },
52
- "homepage": "https://dyingangel666.github.io/ng-prism/",
53
- "bugs": "https://github.com/dyingangel666/ng-prism/issues"
52
+ "homepage": "https://ng-prism.github.io/ng-prism/",
53
+ "bugs": "https://github.com/ng-prism/ng-prism/issues"
54
54
  }