Skip to content

Commit 484fde1

Browse files
authored
ci(models): add generated models to docs (#441)
1 parent 0af4b6b commit 484fde1

12 files changed

Lines changed: 514 additions & 15 deletions

File tree

examples/plugins/project.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,32 @@
4343
"dependsOn": [
4444
"build",
4545
"^build",
46-
{ "projects": ["cli"], "target": "build" }
46+
{
47+
"projects": ["cli"],
48+
"target": "build"
49+
}
4750
]
4851
},
4952
"run-print-config": {
5053
"command": "npx dist/packages/cli print-config --config=examples/plugins/code-pushup.config.ts",
5154
"dependsOn": [
5255
"build",
5356
"^build",
54-
{ "projects": ["cli"], "target": "build" }
57+
{
58+
"projects": ["cli"],
59+
"target": "build"
60+
}
5561
]
5662
},
5763
"run-help": {
5864
"command": "npx dist/packages/cli help",
5965
"dependsOn": [
6066
"build",
6167
"^build",
62-
{ "projects": ["cli"], "target": "build" }
68+
{
69+
"projects": ["cli"],
70+
"target": "build"
71+
}
6372
]
6473
}
6574
},

nx.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"!{projectRoot}/vite.config.@(unit|integration|e2e).[jt]s",
5050
"!{projectRoot}/@(test|mocks)/**/*",
5151
"!{projectRoot}/perf/**/*",
52+
"!{projectRoot}/tools/**/*",
5253
"!{projectRoot}/code-pushup.config.?(m)[jt]s"
5354
],
5455
"sharedGlobals": []

package-lock.json

Lines changed: 14 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@
123123
"typescript": "5.2.2",
124124
"verdaccio": "^5.0.4",
125125
"vite": "~4.3.9",
126-
"vitest": "~0.32.0"
126+
"vitest": "~0.32.0",
127+
"zod-to-ts": "^1.2.0"
127128
},
128129
"optionalDependencies": {
129130
"@esbuild/darwin-arm64": "^0.19.4",

packages/cli/docs/custom-plugins.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ export default {
2626

2727
## Plugin Structure
2828

29-
Every plugin is defined in [`PluginConfig`](@TODO - link models) object.
29+
Every plugin is defined in [`PluginConfig`](../../models/docs/core-config-types.md) object.
3030

3131
The plugin configuration contains:
3232

33-
- metadata about the plugin [`PluginMeta`](@TODO - link models)
34-
- metadata about the available [audit](#audits) [`Audit`](@TODO - link models)
35-
- a [runner](#plugin-runner) that maintains the internal logic that produces the [plugin output](#plugin-output) as [`AuditOutputs`](@TODO - link models).
33+
- metadata about the plugin [`PluginMeta`](../../models/docs/core-config-types.md)
34+
- metadata about the available [audit](#audits) [`Audit`](../../models/docs/core-config-types.md)
35+
- a [runner](#plugin-runner) that maintains the internal logic that produces the [plugin output](#plugin-output) as [`AuditOutputs`](../../models/docs/core-config-types.md).
3636
- optional [`groups`](#audit-groups) to pre score audits
3737

3838
See the following example that shows a minimal implementation of a custom plugin containing all required fields:
@@ -121,7 +121,7 @@ const myAuditOutput: AuditOutput = {
121121
};
122122
```
123123

124-
- An audit output always includes the metadata of the audit. [`Audit`](@TODO - link models)
124+
- An audit output always includes the metadata of the audit. [`Audit`](../../models/docs/core-config-types.md)
125125

126126
- `score` and `value` are important to calculate a score from a given metric and display it.
127127
Here you can read more about [audits and scoring](#audit-score).
@@ -140,7 +140,7 @@ const pluginOutput: AuditOutputs = [myAuditOutput];
140140
## Plugin runner
141141

142142
The `runner` property defines the core of a plugin.
143-
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).
143+
It also serves as the entry point of your plugin and is executed by the CLI. It should return the audit results as [`AuditOutputs`](../../models/docs/core-config-types.md).
144144

145145
A runner can be implemented in two ways:
146146

packages/models/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": ["../../.eslintrc.json"],
3-
"ignorePatterns": ["!**/*"],
3+
"ignorePatterns": ["!**/*", "**/tools/**/*.ts", "*.generated.ts"],
44
"overrides": [
55
{
66
"files": ["*.ts", "*.tsx"],

0 commit comments

Comments
 (0)