You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/cli/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,7 @@ jobs:
139
139
We provide comprehensive documentation on [how to create a custom plugin](./docs/custom-plugins.md).
140
140
141
141
The repository also maintains a set of plugin examples showcasing different scenarios.
142
-
Each example is fully tested to give demonstrate best practices for plugin testing.
142
+
Each example is fully tested to demonstrate best practices for plugin testing as well.
143
143
144
144
**Example for custom plugins:**
145
145
@@ -170,7 +170,7 @@ Each example is fully tested to give demonstrate best practices for plugin testi
170
170
| **`--onlyPlugins`** | `string[]` | `[]` | Only run the specified plugins. Applicable to all commands except `upload`. |
171
171
172
172
> [!NOTE]
173
-
> All common options, expect `--onlyPlugins`, can be specified in the configuration file as well.
173
+
> All common options, except `--onlyPlugins`, can be specified in the configuration file as well.
174
174
> CLI arguments take precedence over configuration file options.
175
175
176
176
> [!NOTE]
@@ -184,7 +184,7 @@ Usage:
184
184
`code-pushup collect [options]`
185
185
186
186
Description:
187
-
The command initializes the necessary plugins, runs them, and then collects the results. After collecting the results, it generates a comprehensive report.
187
+
The command initializes and executes the necessary pluginsand collects the results. Based on the results it generates a comprehensive report.
188
188
189
189
Refer to the [Common Command Options](#common-command-options) for the list of available options.
190
190
@@ -204,7 +204,7 @@ Usage:
204
204
`code-pushup autorun [options]`
205
205
206
206
Description:
207
-
Run plugins, collect results and upload report to the Code PushUp portal.
207
+
Run plugins, collect results and upload the report to the Code PushUp portal.
208
208
209
209
Refer to the [Common Command Options](#common-command-options) for the list of available options.
Copy file name to clipboardExpand all lines: packages/cli/docs/custom-plugins.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
# Integrating a custom plugin in the CLI
2
2
3
-
One of the main features of Code PushUp is the ability to write custom plugins and track your own metrics.
4
-
It enables you to implement nearly any kind of metric you want to track progress with minimum effort.
3
+
One of the main features of Code PushUp is the ability to track your own metrics by writing custom plugins.
4
+
It enables you to implement any kind of metric you want to track progress with minimum effort.
5
5
In this section we will go through the steps needed to create a custom plugin and integrate it in your project.
6
6
7
7
## Set up the core config
8
8
9
-
To start crafting custom plugins you need a minimum `code-pushup.config.(ts|js|mjs)` file maintaining a `plugins` property.
10
-
All plugins are registered in a core configuration object and can take potential options to configure its behaviour.
11
-
The following example shows where to register the plugin:
9
+
All plugins are registered in a core configuration, also allowing for further configuration of the plugins behavior.
10
+
Creating custom plugins requires you to create a `code-pushup.config.(ts|js|mjs)` file, that exposes a `plugins` property.
11
+
See the following example:
12
12
13
13
```typescript
14
14
// code-pushup.config.ts
@@ -35,7 +35,7 @@ The plugin configuration contains:
35
35
- a [runner](#plugin-runner) that maintains the internal logic that produces the [plugin output](#plugin-output) as [`AuditOutputs`](@TODO - link models).
36
36
- optional [`groups`](#audit-groups) to pre score audits
37
37
38
-
A minimal custom plugin containing the required fields looks like the following:
38
+
See the following example that shows a minimal implementation of a custom plugin containing all required fields:
The core of a plugin is defined under the `runner` property.
149
-
The `runner` property is the entry point of your plugin and is called by the CLI. It should return the audit results
150
-
as [`AuditOutputs`](@TODO - link models).
148
+
The `runner` property defines the core of a plugin.
149
+
It also serves as the entry point of your plugin and is executed by the CLI. It should return the audit results as [`AuditOutputs`](@TODO - link models).
151
150
152
-
A plugins runner logic can get implemented in 2 ways:
0 commit comments