@backstage-community/plugin-code-coverage 0.2.28
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/CHANGELOG.md +1701 -0
- package/README.md +51 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.esm.js +622 -0
- package/dist/index.esm.js.map +1 -0
- package/package.json +72 -0
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# code-coverage
|
|
2
|
+
|
|
3
|
+
This is the frontend part of the code-coverage plugin. It displays code coverage summaries for your entities.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
# From your Backstage root directory
|
|
9
|
+
yarn --cwd packages/app add @backstage-community/plugin-code-coverage
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Finally you need to import and render the code coverage entity, in `packages/app/src/components/catalog/EntityPage.tsx` add the following:
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
@@ -70,6 +70,7 @@ import {
|
|
16
|
+
|
|
17
|
+
import { TechDocsAddons } from '@backstage/plugin-techdocs-react';
|
|
18
|
+
import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';
|
|
19
|
+
+import { EntityCodeCoverageContent } from '@backstage-community/plugin-code-coverage';
|
|
20
|
+
|
|
21
|
+
@@ -226,6 +227,10 @@ const defaultEntityPage = (
|
|
22
|
+
<EntityLayout.Route path="/docs" title="Docs">
|
|
23
|
+
{techdocsContent}
|
|
24
|
+
</EntityLayout.Route>
|
|
25
|
+
+
|
|
26
|
+
+ <EntityLayout.Route path="/code-coverage" title="Code Coverage">
|
|
27
|
+
+ <EntityCodeCoverageContent />
|
|
28
|
+
+ </EntityLayout.Route>
|
|
29
|
+
</EntityLayout>
|
|
30
|
+
);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Configuring your entity
|
|
34
|
+
|
|
35
|
+
In order to use this plugin, you must set the `backstage.io/code-coverage` annotation on entities for which coverage ingestion has been enabled.
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
metadata:
|
|
39
|
+
annotations:
|
|
40
|
+
backstage.io/code-coverage: enabled
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
There's a feature to only include files that are in VCS in the coverage report, this is helpful to not count generated files for example. To enable this set the `backstage.io/code-coverage` annotation to `scm-only`.
|
|
44
|
+
|
|
45
|
+
```yaml
|
|
46
|
+
metadata:
|
|
47
|
+
annotations:
|
|
48
|
+
backstage.io/code-coverage: scm-only
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Note: It may be required to set the [`backstage.io/source-location` annotation](https://backstage.io/docs/features/software-catalog/well-known-annotations#backstageiosource-location), however this should generally not be needed.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Entity } from '@backstage/catalog-model';
|
|
3
|
+
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns true if the given entity has code coverage enabled.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
declare function isCodeCoverageAvailable(entity: Entity): boolean;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
declare const codeCoveragePlugin: _backstage_core_plugin_api.BackstagePlugin<{
|
|
16
|
+
root: _backstage_core_plugin_api.RouteRef<undefined>;
|
|
17
|
+
}, {}, {}>;
|
|
18
|
+
/**
|
|
19
|
+
* An entity code coverage page.
|
|
20
|
+
*
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
declare const EntityCodeCoverageContent: () => JSX.Element;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A Backstage plugin that helps you keep track of your code coverage
|
|
27
|
+
*
|
|
28
|
+
* @packageDocumentation
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @public
|
|
33
|
+
* @deprecated Use `isPluginApplicableToEntity` instead.
|
|
34
|
+
*/
|
|
35
|
+
declare const isPluginApplicableToEntity: typeof isCodeCoverageAvailable;
|
|
36
|
+
|
|
37
|
+
export { EntityCodeCoverageContent, codeCoveragePlugin, isCodeCoverageAvailable, isPluginApplicableToEntity };
|