Skip to content

Commit a30e519

Browse files
author
John Doe
committed
Merge branch 'main' into chore/cleanup-tools-1
2 parents 5ccc241 + 38ad415 commit a30e519

File tree

120 files changed

+1272
-1177
lines changed

Some content is hidden

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

120 files changed

+1272
-1177
lines changed

.github/actions/code-pushup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ runs:
1717
run: npx tsx .github/actions/code-pushup/src/runner.ts
1818
shell: bash
1919
env:
20-
TSX_TSCONFIG_PATH: .github/actions/code-pushup/tsconfig.json
20+
TSX_TSCONFIG_PATH: ${{ github.workspace }}/.github/actions/code-pushup/tsconfig.json
2121
GH_TOKEN: ${{ inputs.token }}
2222
MODE: ${{ inputs.mode }}

.github/actions/code-pushup/src/runner.ts

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -129,42 +129,51 @@ function createGitHubApiClient(): ProviderAPIClient {
129129
};
130130
}
131131

132+
function setupOptions(): Options {
133+
const isMonorepo = process.env['MODE'] === 'monorepo';
134+
135+
if (isMonorepo) {
136+
return {
137+
jobId: 'monorepo-mode',
138+
monorepo: 'nx',
139+
nxProjectsFilter: '--with-target=code-pushup --exclude=workspace',
140+
configPatterns: {
141+
persist: {
142+
...DEFAULT_PERSIST_CONFIG,
143+
outputDir: '.code-pushup/{projectName}',
144+
},
145+
...(process.env['CP_API_KEY'] && {
146+
upload: {
147+
server: 'https://api.staging.code-pushup.dev/graphql',
148+
apiKey: process.env['CP_API_KEY'],
149+
organization: 'code-pushup',
150+
project: 'cli-{projectName}',
151+
},
152+
}),
153+
},
154+
};
155+
}
156+
157+
// tsx importer need to resolve plugin runner scripts
158+
// eslint-disable-next-line functional/immutable-data
159+
process.env['NODE_OPTIONS'] = '--import=tsx';
160+
161+
return {
162+
jobId: 'standalone-mode',
163+
// run without Nx to demonstrate native GitHub Actions log groups
164+
bin: 'node packages/cli/src/index.ts',
165+
};
166+
}
167+
132168
async function run(): Promise<void> {
133169
try {
134170
if (core.isDebug()) {
135171
logger.setVerbose(true);
136172
}
137173

138-
const isMonorepo = process.env['MODE'] === 'monorepo';
139-
140-
const options: Options = isMonorepo
141-
? {
142-
jobId: 'monorepo-mode',
143-
monorepo: 'nx',
144-
nxProjectsFilter: '--with-target=code-pushup --exclude=workspace',
145-
configPatterns: {
146-
persist: {
147-
...DEFAULT_PERSIST_CONFIG,
148-
outputDir: '.code-pushup/{projectName}',
149-
},
150-
...(process.env['CP_API_KEY'] && {
151-
upload: {
152-
server: 'https://api.staging.code-pushup.dev/graphql',
153-
apiKey: process.env['CP_API_KEY'],
154-
organization: 'code-pushup',
155-
project: 'cli-{projectName}',
156-
},
157-
}),
158-
},
159-
}
160-
: {
161-
jobId: 'standalone-mode',
162-
bin: 'npx nx code-pushup --',
163-
};
164-
165174
const gitRefs = parseGitRefs();
166-
167175
const apiClient = createGitHubApiClient();
176+
const options = setupOptions();
168177

169178
const result = await runInCI(gitRefs, apiClient, options);
170179

.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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
## 0.94.0 (2025-12-09)
2+
3+
### 🚀 Features
4+
5+
- **cli:** include logo and version in initial log ([52266a7f](https://github.com/code-pushup/cli/commit/52266a7f))
6+
- **cli:** log config import and validation steps ([f3cebd3b](https://github.com/code-pushup/cli/commit/f3cebd3b))
7+
- **cli:** simplify sticker hints ([db44dff0](https://github.com/code-pushup/cli/commit/db44dff0))
8+
- **cli:** improve collect and upload logs ([239c7c7e](https://github.com/code-pushup/cli/commit/239c7c7e))
9+
- **cli:** drop print-config to stdout, output arg is now required ([88096844](https://github.com/code-pushup/cli/commit/88096844))
10+
- **utils:** support custom return values in logger.task ([e0793eeb](https://github.com/code-pushup/cli/commit/e0793eeb))
11+
- **utils:** ensure consistent line breaks in stdout report ([7093fe4d](https://github.com/code-pushup/cli/commit/7093fe4d))
12+
13+
### ❤️ Thank You
14+
15+
- Matěj Chalk
16+
17+
## 0.93.0 (2025-12-08)
18+
19+
### 🚀 Features
20+
21+
- **plugin-axe:** use category-based groups ([aa7b7f63](https://github.com/code-pushup/cli/commit/aa7b7f63))
22+
23+
### 🩹 Fixes
24+
25+
- **plugin-axe:** wrap HTML tags in audit metadata ([9ac95d60](https://github.com/code-pushup/cli/commit/9ac95d60))
26+
27+
### ❤️ Thank You
28+
29+
- hanna-skryl
30+
31+
## 0.92.1 (2025-12-03)
32+
33+
### 🩹 Fixes
34+
35+
- **utils:** prevent nested github actions log groups when run within nx target ([cb9ffd52](https://github.com/code-pushup/cli/commit/cb9ffd52))
36+
- **utils:** fix long word wrapping with ansis styles in tables ([f20b3b87](https://github.com/code-pushup/cli/commit/f20b3b87))
37+
38+
### ❤️ Thank You
39+
40+
- Matěj Chalk
41+
142
## 0.92.0 (2025-12-02)
243

344
### 🚀 Features

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

Lines changed: 1 addition & 1 deletion
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

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: 1 addition & 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(
@@ -192,6 +147,7 @@ describe('executor command', () => {
192147
`${project}:code-pushup`,
193148
'collect',
194149
'--persist.filename=terminal-report',
150+
'--verbose',
195151
],
196152
cwd,
197153
});

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,14 @@ describe('nx-plugin', () => {
173173
});
174174

175175
const cleanStdout = removeColorCodes(stdout);
176+
176177
// Nx command
177-
expect(cleanStdout).toContain('nx run my-lib:code-pushup');
178+
expect(cleanStdout).toContain('nx run my-lib:code-pushup --dryRun');
178179
// Run CLI executor
179-
expect(cleanStdout).toContain('Command:');
180+
expect(cleanStdout).toContain('DryRun execution of:');
180181
expect(cleanStdout).toContain('npx @code-pushup/cli');
181-
expect(cleanStdout).toContain('--verbose');
182-
expect(cleanStdout).toContain('--dryRun ');
182+
expect(cleanStdout).not.toContain('--verbose');
183+
expect(cleanStdout).toContain('CP_VERBOSE="true"');
183184
});
184185

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

0 commit comments

Comments
 (0)