Skip to content

Commit 9e60d56

Browse files
author
John Doe
committed
Merge branch 'main' into chore/add-zod2md-nx-plugin
# Conflicts: # package-lock.json # package.json
2 parents e88d62d + 7ea0cc1 commit 9e60d56

File tree

122 files changed

+3943
-3379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+3943
-3379
lines changed

CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,67 @@
1+
## 0.100.1 (2025-12-29)
2+
3+
### 🩹 Fixes
4+
5+
- update to nx v22 ([#1196](https://github.com/code-pushup/cli/pull/1196))
6+
7+
### ❤️ Thank You
8+
9+
- Michael Hladky @BioPhoton
10+
11+
## 0.100.0 (2025-12-20)
12+
13+
### 🚀 Features
14+
15+
- **plugin-axe:** log initializer steps ([f226f67e](https://github.com/code-pushup/cli/commit/f226f67e))
16+
- **plugin-axe:** log runner steps, incl. stats and incomplete results ([0cd87769](https://github.com/code-pushup/cli/commit/0cd87769))
17+
- **plugin-jsdocs:** log initializer and runner steps ([18db8310](https://github.com/code-pushup/cli/commit/18db8310))
18+
- **plugin-lighthouse:** log initializer steps (audit/group counts, expanded, skipped) ([b868bc09](https://github.com/code-pushup/cli/commit/b868bc09))
19+
- **plugin-lighthouse:** log runner steps (incl. categories per url, config loading) ([e23c97e7](https://github.com/code-pushup/cli/commit/e23c97e7))
20+
21+
### 🩹 Fixes
22+
23+
- **utils:** break urls in ascii table differently to regular words ([964441c8](https://github.com/code-pushup/cli/commit/964441c8))
24+
25+
### ❤️ Thank You
26+
27+
- Matěj Chalk
28+
29+
## 0.99.0 (2025-12-18)
30+
31+
### 🚀 Features
32+
33+
- **plugin-typescript:** log initializer and runner steps ([53384e0a](https://github.com/code-pushup/cli/commit/53384e0a))
34+
35+
### ❤️ Thank You
36+
37+
- Matěj Chalk
38+
39+
## 0.98.0 (2025-12-17)
40+
41+
### 🚀 Features
42+
43+
- **plugin-js-packages:** log initializer and runner steps ([1b8bbd2e](https://github.com/code-pushup/cli/commit/1b8bbd2e))
44+
45+
### ❤️ Thank You
46+
47+
- Matěj Chalk
48+
49+
## 0.97.0 (2025-12-17)
50+
51+
### 🚀 Features
52+
53+
- **plugin-coverage:** log initializer and nx helper steps ([2eb0cc82](https://github.com/code-pushup/cli/commit/2eb0cc82))
54+
- **plugin-coverage:** log runner steps and statistics ([639a4471](https://github.com/code-pushup/cli/commit/639a4471))
55+
- **utils:** truncate paths with shared prefix and/or suffix ([5f10cf9c](https://github.com/code-pushup/cli/commit/5f10cf9c))
56+
57+
### 🩹 Fixes
58+
59+
- **utils:** handle suffixes like -ch and -sh in pluralize helper ([f680f5e1](https://github.com/code-pushup/cli/commit/f680f5e1))
60+
61+
### ❤️ Thank You
62+
63+
- Matěj Chalk
64+
165
## 0.96.1 (2025-12-11)
266

367
### 🩹 Fixes

README.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,18 @@
1616

1717
---
1818

19+
### 🏷️ Category labels
20+
21+
See how your project measures up. With [portal integration](./packages/cli/README.md#portal-integration), category scores are embeddable and always reflect your latest report.
22+
1923
![Type safety](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/type-safety?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
2024
![Bug prevention](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/bug-prevention?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
2125
![Code style](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/code-style?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
2226
![Code coverage](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/code-coverage?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
2327
![Security](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/security?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
2428
![Updates](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/updates?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
2529
![Documentation](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/docs?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
30+
![Axe Accessibility](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/axe-a11y?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
2631

2732
---
2833

@@ -31,8 +36,7 @@
3136
_Common problems with keeping track of technical quality:_
3237

3338
- When **tech debt is invisible**, it's difficult to plan much-needed maintenance efforts 🔧
34-
- Individual tools measure different metrics, inability to combine them leads to
35-
a **lack of comprehensive overview** 🧑‍🦯
39+
- Individual tools measure different metrics, the inability to combine them leads to a **lack of comprehensive overview** 🧑‍🦯
3640
- Open-source tools typically used for failing checks in CI, which **can't measure incremental improvements** due to arbitrary pass/fail thresholds 🤖
3741
- Off-the-shelf solutions tend to be opinionated and **hard to customize**, so may not fit your specific needs 🧱
3842

@@ -42,15 +46,15 @@ _We want to change that!_
4246

4347
## 🔎🔬 Code quality integrations for any tool 📉🔍
4448

45-
| [🚀 Get started](./packages/cli/README.md#getting-started) | [🤖 CI automation](https://github.com/marketplace/actions/code-pushup) |
46-
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
47-
| <a href="./packages/cli/README.md#getting-started"><img alt="Getting started cover image" title="Getting started with code-pushup" src="packages/cli/docs/images/cli-terminal-overview.png" width="1000"></a> | <a href="./packages/cli/README.md#-ci-automation"><img alt="CI Automation cover" title="CI automation guide" src="docs/images/gh-action.png" width="1000"></a> |
48-
| <ul><li>Run **[📦 `@code-pushup/cli`](./packages/cli#readme)** to collect **reports**.</li><li>[Get started](./packages/cli/README.md#getting-started) quickly with our [**official plugins**](#-officially-supported-plugins)! ⏱️</li></ul> | <ul><li>Easy **CI** setup with **[🤖 `code-pushup/github-action`](https://github.com/marketplace/actions/code-pushup)**.</li><li>Import logic from **[📦 `@code-pushup/core`](./packages/core#readme)** to craft **custom tools**.</li></ul> |
49+
| [🚀 Get started](./packages/cli/README.md#getting-started)| [🤖 CI automation](https://github.com/marketplace/actions/code-pushup) |
50+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
51+
| <a href="./packages/cli/README.md#getting-started"><img alt="Getting started cover image" title="Getting started with code-pushup" src="packages/cli/docs/images/cli-terminal-overview.png" width="1000"></a> | <a href="./packages/cli/README.md#-ci-automation"><img alt="CI Automation cover" title="CI automation guide" src="docs/images/gh-action.png" width="1000"></a> |
52+
| <ul><li>Run **[📦 `@code-pushup/cli`](./packages/cli#readme)** to collect **reports**.</li><li>Get started quickly with our [**official plugins**](#-officially-supported-plugins)! ⏱️</li></ul> | <ul><li>Easy **CI** setup with **[🤖 `code-pushup/github-action`](https://github.com/marketplace/actions/code-pushup)**.</li><li>Import logic from **[📦 `@code-pushup/core`](./packages/core#readme)** to craft **custom tools**.</li></ul> |
4953

50-
| 📈 [Portal](https://code-pushup.dev#portal) | 🔌 [Custom plugins](./packages/cli/docs/custom-plugins.md) |
51-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
52-
| <a href="#portal-integration"><img alt="Portal integration cover image" title="Inetegrate code-pushup portal" src="packages/cli/docs/images/portal-cover.png" width="1000"></a> | <a href="#custom-plugins"><img alt="Custom plugins" title="Create custom code-pushup plugins" src="docs/images/code-pushup-custom-plugins.png" width="1000"></a> |
53-
| <ul><li>**[Portal](https://code-pushup.dev#portal)** 🌐 **visualizes reports** in a slick UI.</li><li>Track **historical data** from uploads. ⬆️</li></ul> | <ul><li>All the [data models](./packages/models/docs/models-reference.md) you need are provided in **[📦 `@code-pushup/models`](./packages/models/README.md)**.</li><li>Find tons of useful utilities in **[📦 `@code-pushup/utils`](./packages/utils/README.md)**.</li></ul> |
54+
| 📈 [Portal](https://code-pushup.dev/features) | 🔌 [Custom plugins](./packages/cli/docs/custom-plugins.md) |
55+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
56+
| <a href="./packages/cli/README.md#portal-integration"><img alt="Portal integration cover image" title="Integrate code-pushup portal" src="packages/cli/docs/images/portal-cover.png" width="1000"></a> | <a href="./packages/cli/docs/custom-plugins.md"><img alt="Custom plugins" title="Create custom code-pushup plugins" src="docs/images/code-pushup-custom-plugins.png" width="1000"></a> |
57+
| <ul><li>**[Portal](https://code-pushup.dev/features)** 🌐 **visualizes reports** in a slick UI.</li><li>Track **historical data** from uploads. ⬆️</li></ul> | <ul><li>All the [data models](./packages/models/docs/models-reference.md) you need are provided in **[📦 `@code-pushup/models`](./packages/models/README.md)**.</li><li>Find tons of useful utilities in **[📦 `@code-pushup/utils`](./packages/utils/README.md)**.</li></ul> |
5458

5559
---
5660

@@ -64,6 +68,7 @@ _We want to change that!_
6468
| <img width="24" src="docs/images/plugin-lighthouse.icon.png"> | [Lighthouse](./packages/plugin-lighthouse#readme) | Measures web performance and best practices with **Lighthouse**. |
6569
| <img width="24" src="docs/images/plugin-jsdocs.icon.png"> | [JSDocs](./packages/plugin-jsdocs#readme) | Analyzes how much source code is **documented** using JSDocs comments. |
6670
| <img width="24" src="docs/images/plugin-typescript.icon.png"> | [TypeScript](./packages/plugin-typescript#readme) | Checks for **TypeScript** errors using strict compiler flags. |
71+
| <img width="24" src="docs/images/plugin-axe.icon.png"> | [Axe](./packages/plugin-axe#readme) | Detects accessibility issues using **Axe**. |
6772

6873
---
6974

@@ -75,7 +80,7 @@ _We want to change that!_
7580
2. **[Integrate](https://github.com/marketplace/actions/code-pushup)**
7681
Use our integration guide and packages to set up CI integration in minutes. ⏱️
7782

78-
3. **[Observe](https://code-pushup.dev#portal)**
83+
3. **[Observe](https://code-pushup.dev/features)**
7984
Guard regressions and track improvements with every code change. 🔍
8085

8186
4. **Relax!**

code-pushup.preset.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ import eslintPlugin, {
1515
} from './packages/plugin-eslint/src/index.js';
1616
import jsPackagesPlugin from './packages/plugin-js-packages/src/index.js';
1717
import jsDocsPlugin from './packages/plugin-jsdocs/src/index.js';
18-
import {
19-
PLUGIN_SLUG,
20-
groups,
21-
} from './packages/plugin-jsdocs/src/lib/constants.js';
2218
import {
2319
lighthouseCategories,
2420
lighthouseGroupRef,
@@ -185,12 +181,14 @@ export function configureJsDocsPlugin(projectName?: string): CoreConfig {
185181
slug: 'docs',
186182
title: 'Documentation',
187183
description: 'Measures how much of your code is **documented**.',
188-
refs: groups.map(group => ({
189-
weight: 1,
190-
type: 'group',
191-
plugin: PLUGIN_SLUG,
192-
slug: group.slug,
193-
})),
184+
refs: [
185+
{
186+
type: 'group',
187+
plugin: 'jsdocs',
188+
slug: 'documentation-coverage',
189+
weight: 1,
190+
},
191+
],
194192
},
195193
],
196194
};

docs/images/plugin-axe.icon.png

3.81 KB
Loading

docs/images/plugin-jsdocs.icon.png

1.28 KB
Loading

e2e/ci-e2e/project.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
"projectType": "application",
66
"targets": {
77
"lint": {},
8-
"e2e": {
9-
"executor": "@nx/vite:test",
10-
"options": {
11-
"configFile": "{projectRoot}/vitest.e2e.config.ts"
12-
}
13-
}
8+
"e2e": {}
149
},
1510
"implicitDependencies": ["cli", "ci"],
1611
"tags": ["scope:tooling", "type:e2e"]

e2e/cli-e2e/project.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
"projectType": "application",
66
"targets": {
77
"lint": {},
8-
"e2e": {
9-
"executor": "@nx/vite:test",
10-
"options": {
11-
"configFile": "{projectRoot}/vitest.e2e.config.ts"
12-
}
13-
}
8+
"e2e": {}
149
},
1510
"implicitDependencies": ["cli"],
1611
"tags": ["scope:core", "scope:plugin", "type:e2e"]

e2e/create-cli-e2e/project.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@
55
"projectType": "application",
66
"targets": {
77
"lint": {},
8-
"e2e": {
9-
"executor": "@nx/vite:test",
10-
"options": {
11-
"keepServerRunning": true,
12-
"configFile": "{projectRoot}/vitest.e2e.config.ts"
13-
}
14-
}
8+
"e2e": {}
159
},
1610
"implicitDependencies": ["create-cli"],
1711
"tags": ["scope:tooling", "type:e2e"]

e2e/nx-plugin-e2e/project.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
"projectType": "application",
66
"targets": {
77
"lint": {},
8-
"e2e": {
9-
"executor": "@nx/vite:test",
10-
"options": {
11-
"configFile": "{projectRoot}/vitest.e2e.config.ts"
12-
}
13-
}
8+
"e2e": {}
149
},
1510
"implicitDependencies": ["test-utils", "nx-plugin"],
1611
"tags": ["scope:tooling", "type:e2e"]
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import type { Tree } from '@nx/devkit';
2+
import path from 'node:path';
3+
import { readProjectConfiguration } from 'nx/src/generators/utils/project-configuration';
4+
import { afterEach, expect } from 'vitest';
5+
import { generateCodePushupConfig } from '@code-pushup/nx-plugin';
6+
import {
7+
generateWorkspaceAndProject,
8+
materializeTree,
9+
nxShowProjectJson,
10+
nxTargetProject,
11+
registerPluginInWorkspace,
12+
} from '@code-pushup/test-nx-utils';
13+
import {
14+
E2E_ENVIRONMENTS_DIR,
15+
TEST_OUTPUT_DIR,
16+
teardownTestFolder,
17+
} from '@code-pushup/test-utils';
18+
import { INLINE_PLUGIN } from '../mocks/inline-plugin.js';
19+
20+
describe('nx-plugin pluginsConfig', () => {
21+
let tree: Tree;
22+
const project = 'my-lib';
23+
const testFileDir = path.join(
24+
E2E_ENVIRONMENTS_DIR,
25+
nxTargetProject(),
26+
TEST_OUTPUT_DIR,
27+
'plugin-plugins-config',
28+
);
29+
30+
beforeEach(async () => {
31+
tree = await generateWorkspaceAndProject(project);
32+
});
33+
34+
afterEach(async () => {
35+
await teardownTestFolder(testFileDir);
36+
});
37+
38+
it('should apply pluginsConfig options to executor target', async () => {
39+
const cwd = path.join(testFileDir, 'plugins-config-applied');
40+
const binPath = 'packages/cli/src/index.ts';
41+
const configPath = '{projectRoot}/code-pushup.config.ts';
42+
const projectPrefix = 'cli';
43+
44+
// Register plugin with options in the plugins array and pluginsConfig
45+
registerPluginInWorkspace(
46+
tree,
47+
{
48+
plugin: '@code-pushup/nx-plugin',
49+
options: {
50+
config: configPath,
51+
persist: {
52+
outputDir: '.code-pushup/{projectName}',
53+
},
54+
},
55+
},
56+
{
57+
projectPrefix,
58+
bin: binPath,
59+
env: {
60+
NODE_OPTIONS: '--import tsx',
61+
TSX_TSCONFIG_PATH: 'tsconfig.base.json',
62+
},
63+
},
64+
);
65+
66+
const { root } = readProjectConfiguration(tree, project);
67+
generateCodePushupConfig(tree, root, {
68+
plugins: [
69+
{
70+
fileImports: '',
71+
codeStrings: INLINE_PLUGIN,
72+
},
73+
],
74+
});
75+
76+
await materializeTree(tree, cwd);
77+
78+
const { code, projectJson } = await nxShowProjectJson(cwd, project);
79+
expect(code).toBe(0);
80+
81+
expect(projectJson).toStrictEqual(
82+
expect.objectContaining({
83+
targets: expect.objectContaining({
84+
'code-pushup': expect.objectContaining({
85+
executor: '@code-pushup/nx-plugin:cli',
86+
options: expect.objectContaining({
87+
projectPrefix,
88+
bin: binPath,
89+
env: {
90+
NODE_OPTIONS: '--import tsx',
91+
TSX_TSCONFIG_PATH: 'tsconfig.base.json',
92+
},
93+
}),
94+
}),
95+
}),
96+
}),
97+
);
98+
});
99+
});

0 commit comments

Comments
 (0)