Skip to content

Commit 6d41b5e

Browse files
author
John Doe
committed
Merge branch 'main' into use-cp-nx-plugin
2 parents 90e0260 + 7b82402 commit 6d41b5e

File tree

172 files changed

+2134
-2255
lines changed

Some content is hidden

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

172 files changed

+2134
-2255
lines changed

.github/labeler.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050
- changed-files:
5151
- any-glob-to-any-file: 'packages/plugin-typescript/src/**'
5252

53+
🧩 axe-plugin:
54+
- changed-files:
55+
- any-glob-to-any-file: 'packages/plugin-axe/src/**'
56+
5357
🔬 testing:
5458
- changed-files:
5559
- any-glob-to-any-file:

CHANGELOG.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,87 @@
1+
## 0.96.1 (2025-12-11)
2+
3+
### 🩹 Fixes
4+
5+
- **plugin-eslint:** replace static @nx/devkit import ([c4c9f2a2](https://github.com/code-pushup/cli/commit/c4c9f2a2))
6+
- **plugin-lighthouse:** generate categories for single URL ([827be4de](https://github.com/code-pushup/cli/commit/827be4de))
7+
8+
### ❤️ Thank You
9+
10+
- hanna-skryl
11+
- Matěj Chalk
12+
13+
## 0.96.0 (2025-12-11)
14+
15+
### 🚀 Features
16+
17+
- **plugin-axe:** aggregate categories ([84bb067a](https://github.com/code-pushup/cli/commit/84bb067a))
18+
19+
### ❤️ Thank You
20+
21+
- Hanna Skryl @hanna-skryl
22+
23+
## 0.95.2 (2025-12-10)
24+
25+
### 🩹 Fixes
26+
27+
- ensure CLI bin directory is included in published package with executable permissions ([#1183](https://github.com/code-pushup/cli/pull/1183))
28+
29+
### ❤️ Thank You
30+
31+
- Nicolas Beaussart @beaussan
32+
33+
## 0.95.1 (2025-12-10)
34+
35+
### 🩹 Fixes
36+
37+
- **cli:** respect CP_VERBOSE if --verbose argument not given ([26a13c6c](https://github.com/code-pushup/cli/commit/26a13c6c))
38+
39+
### ❤️ Thank You
40+
41+
- Matěj Chalk
42+
43+
## 0.95.0 (2025-12-10)
44+
45+
### 🚀 Features
46+
47+
- **plugin-eslint:** log initializer steps (rules discovery, group creation, nx helpers) ([64d40a16](https://github.com/code-pushup/cli/commit/64d40a16))
48+
- **plugin-eslint:** log runner steps (lint results stats, artifacts usage) ([9c9b3ac7](https://github.com/code-pushup/cli/commit/9c9b3ac7))
49+
- **utils:** provide helper for consistent plugin meta logs formatting ([29e80390](https://github.com/code-pushup/cli/commit/29e80390))
50+
51+
### ❤️ Thank You
52+
53+
- Matěj Chalk
54+
55+
## 0.94.0 (2025-12-09)
56+
57+
### 🚀 Features
58+
59+
- **cli:** include logo and version in initial log ([52266a7f](https://github.com/code-pushup/cli/commit/52266a7f))
60+
- **cli:** log config import and validation steps ([f3cebd3b](https://github.com/code-pushup/cli/commit/f3cebd3b))
61+
- **cli:** simplify sticker hints ([db44dff0](https://github.com/code-pushup/cli/commit/db44dff0))
62+
- **cli:** improve collect and upload logs ([239c7c7e](https://github.com/code-pushup/cli/commit/239c7c7e))
63+
- **cli:** drop print-config to stdout, output arg is now required ([88096844](https://github.com/code-pushup/cli/commit/88096844))
64+
- **utils:** support custom return values in logger.task ([e0793eeb](https://github.com/code-pushup/cli/commit/e0793eeb))
65+
- **utils:** ensure consistent line breaks in stdout report ([7093fe4d](https://github.com/code-pushup/cli/commit/7093fe4d))
66+
67+
### ❤️ Thank You
68+
69+
- Matěj Chalk
70+
71+
## 0.93.0 (2025-12-08)
72+
73+
### 🚀 Features
74+
75+
- **plugin-axe:** use category-based groups ([aa7b7f63](https://github.com/code-pushup/cli/commit/aa7b7f63))
76+
77+
### 🩹 Fixes
78+
79+
- **plugin-axe:** wrap HTML tags in audit metadata ([9ac95d60](https://github.com/code-pushup/cli/commit/9ac95d60))
80+
81+
### ❤️ Thank You
82+
83+
- hanna-skryl
84+
185
## 0.92.1 (2025-12-03)
286

387
### 🩹 Fixes

code-pushup.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'dotenv/config';
22
import {
3-
axeCoreConfig,
3+
configureAxePlugin,
44
configureCoveragePlugin,
55
configureEslintPlugin,
66
configureJsDocsPlugin,
@@ -23,5 +23,5 @@ export default mergeConfigs(
2323
configureTypescriptPlugin(),
2424
configureJsDocsPlugin(),
2525
await configureLighthousePlugin(TARGET_URL),
26-
axeCoreConfig(TARGET_URL),
26+
configureAxePlugin(TARGET_URL),
2727
);

code-pushup.preset.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type {
55
CoreConfig,
66
PluginUrls,
77
} from './packages/models/src/index.js';
8-
import axePlugin from './packages/plugin-axe/src/index.js';
8+
import axePlugin, { axeCategories } from './packages/plugin-axe/src/index.js';
99
import coveragePlugin, {
1010
type CoveragePluginConfig,
1111
getNxCoveragePaths,
@@ -20,9 +20,9 @@ import {
2020
groups,
2121
} from './packages/plugin-jsdocs/src/lib/constants.js';
2222
import {
23+
lighthouseCategories,
2324
lighthouseGroupRef,
2425
lighthousePlugin,
25-
mergeLighthouseCategories,
2626
} from './packages/plugin-lighthouse/src/index.js';
2727
import typescriptPlugin, {
2828
getCategories,
@@ -224,12 +224,14 @@ export async function configureLighthousePlugin(
224224
];
225225
return {
226226
plugins: [lhPlugin],
227-
categories: mergeLighthouseCategories(lhPlugin, lhCategories),
227+
categories: lighthouseCategories(lhPlugin, lhCategories),
228228
};
229229
}
230230

231-
export function axeCoreConfig(urls: PluginUrls): CoreConfig {
231+
export function configureAxePlugin(urls: PluginUrls): CoreConfig {
232+
const axe = axePlugin(urls);
232233
return {
233-
plugins: [axePlugin(urls)],
234+
plugins: [axe],
235+
categories: axeCategories(axe),
234236
};
235237
}

e2e/cli-e2e/tests/__snapshots__/help.e2e.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Commands:
88
[default]
99
code-pushup autorun Shortcut for running collect followed by upload
1010
11-
code-pushup collect Run Plugins and collect results
11+
code-pushup collect Run plugins and collect results
1212
code-pushup upload Upload report results to the portal
1313
code-pushup history Collect reports for commit history
1414
code-pushup compare Compare 2 report files and create a diff file
@@ -18,9 +18,9 @@ Commands:
1818
1919
2020
Global Options:
21-
--verbose When true creates more verbose output. This is helpful w
22-
hen debugging. You may also set CP_VERBOSE env variable
23-
instead. [boolean] [default: false]
21+
--verbose Toggles whether to print debug logs. The default value i
22+
s derived from the CP_VERBOSE environment variable (fals
23+
e if not set). [boolean]
2424
--config Path to config file. By default it loads code-pushup.con
2525
fig.(ts|mjs|js). [string]
2626
--tsconfig Path to a TypeScript config, to be used when loading con

e2e/cli-e2e/tests/collect.e2e.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('CLI collect', () => {
5959

6060
const md = await readTextFile(path.join(dummyOutputDir, 'report.md'));
6161

62-
expect(md).toContain('# Code PushUp Report');
62+
expect(md).toContain('# Code PushUp report');
6363
expect(md).toContain(dummyPluginTitle);
6464
expect(md).toContain(dummyAuditTitle);
6565
});
@@ -112,7 +112,7 @@ describe('CLI collect', () => {
112112

113113
expect(code).toBe(0);
114114

115-
expect(stdout).toContain('Code PushUp Report');
115+
expect(stdout).toContain('Code PushUp report');
116116
expect(stdout).not.toContain('Generated reports');
117117
expect(stdout).toContain(dummyPluginTitle);
118118
expect(stdout).toContain(dummyAuditTitle);

e2e/cli-e2e/tests/print-config.e2e.test.ts

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ describe('CLI print-config', () => {
4040
it.each(extensions)(
4141
'should load .%s config file with correct arguments',
4242
async ext => {
43-
const { code, stdout } = await executeProcess({
43+
const { code } = await executeProcess({
4444
command: 'npx',
4545
args: [
4646
'@code-pushup/cli',
4747
'print-config',
48+
'--output=config.json',
4849
`--config=${configFilePath(ext)}`,
4950
'--tsconfig=tsconfig.base.json',
5051
'--persist.outputDir=output-dir',
@@ -56,7 +57,11 @@ describe('CLI print-config', () => {
5657

5758
expect(code).toBe(0);
5859

59-
expect(JSON.parse(stdout)).toEqual(
60+
const output = await readFile(
61+
path.join(testFileDummySetup, 'config.json'),
62+
'utf8',
63+
);
64+
expect(JSON.parse(output)).toEqual(
6065
expect.objectContaining({
6166
config: expect.stringContaining(`code-pushup.config.${ext}`),
6267
tsconfig: 'tsconfig.base.json',
@@ -71,30 +76,4 @@ describe('CLI print-config', () => {
7176
);
7277
},
7378
);
74-
75-
it('should print config to output file', async () => {
76-
const { code, stdout } = await executeProcess({
77-
command: 'npx',
78-
args: ['@code-pushup/cli', 'print-config', '--output=config.json'],
79-
cwd: testFileDummySetup,
80-
});
81-
82-
expect(code).toBe(0);
83-
84-
const output = await readFile(
85-
path.join(testFileDummySetup, 'config.json'),
86-
'utf8',
87-
);
88-
expect(JSON.parse(output)).toEqual(
89-
expect.objectContaining({
90-
plugins: [
91-
expect.objectContaining({
92-
slug: 'dummy-plugin',
93-
title: 'Dummy Plugin',
94-
}),
95-
],
96-
}),
97-
);
98-
expect(stdout).not.toContain('dummy-plugin');
99-
});
10079
});

e2e/nx-plugin-e2e/tests/executor-cli.e2e.test.ts

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -100,25 +100,6 @@ describe('executor command', () => {
100100
expect(cleanStdout).toContain('nx run my-lib:code-pushup');
101101
});
102102

103-
it('should execute print-config executor', async () => {
104-
const cwd = path.join(testFileDir, 'execute-print-config-command');
105-
await addTargetToWorkspace(tree, { cwd, project });
106-
107-
const { stdout, code } = await executeProcess({
108-
command: 'npx',
109-
args: ['nx', 'run', `${project}:code-pushup`, 'print-config'],
110-
cwd,
111-
});
112-
113-
expect(code).toBe(0);
114-
const cleanStdout = removeColorCodes(stdout);
115-
expect(cleanStdout).toContain('nx run my-lib:code-pushup print-config');
116-
117-
await expect(() =>
118-
readJsonFile(path.join(cwd, '.code-pushup', project, 'report.json')),
119-
).rejects.toThrow('');
120-
});
121-
122103
it('should execute print-config executor with output', async () => {
123104
const cwd = path.join(testFileDir, 'execute-print-config-command');
124105
await addTargetToWorkspace(tree, { cwd, project });
@@ -144,32 +125,6 @@ describe('executor command', () => {
144125
).resolves.not.toThrow();
145126
});
146127

147-
it('should execute print-config executor with api key', async () => {
148-
const cwd = path.join(testFileDir, 'execute-print-config-command');
149-
await addTargetToWorkspace(tree, { cwd, project });
150-
151-
const { stdout, code } = await executeProcess({
152-
command: 'npx',
153-
args: [
154-
'nx',
155-
'run',
156-
`${project}:code-pushup`,
157-
'print-config',
158-
'--upload.apiKey=a123a',
159-
],
160-
cwd,
161-
});
162-
163-
expect(code).toBe(0);
164-
const cleanStdout = removeColorCodes(stdout);
165-
expect(cleanStdout).toContain('nx run my-lib:code-pushup print-config');
166-
expect(cleanStdout).toContain('a123a');
167-
168-
await expect(() =>
169-
readJsonFile(path.join(cwd, '.code-pushup', project, 'report.json')),
170-
).rejects.toThrow('');
171-
});
172-
173128
it('should execute collect executor and merge target and command-line options', async () => {
174129
const cwd = path.join(testFileDir, 'execute-collect-with-merged-options');
175130
await addTargetToWorkspace(

e2e/nx-plugin-e2e/tests/plugin-create-nodes.e2e.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ describe('nx-plugin', () => {
179179
// Run CLI executor
180180
expect(cleanStdout).toContain('DryRun execution of:');
181181
expect(cleanStdout).toContain('npx @code-pushup/cli');
182-
expect(cleanStdout).not.toContain('--verbose');
183-
expect(cleanStdout).toContain('CP_VERBOSE="true"');
184182
});
185183

186184
it('should consider plugin option bin in executor target', async () => {

0 commit comments

Comments
 (0)