Skip to content

Commit 39f4030

Browse files
committed
test: merge main and resolve conflicts
2 parents 1b94803 + a6d3965 commit 39f4030

File tree

113 files changed

+19448
-14431
lines changed

Some content is hidden

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

113 files changed

+19448
-14431
lines changed

.github/workflows/code-coverage.yml

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,33 @@ env:
99
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
1010

1111
jobs:
12+
list-packages:
13+
name: List packages
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout the repository
17+
uses: actions/checkout@v4
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version-file: .nvmrc
22+
cache: npm
23+
- name: Install dependencies
24+
run: npm ci
25+
- name: List packages using Nx CLI
26+
id: list-packages
27+
run: |
28+
matrix=$(node tools/scripts/create-codecov-matrix.js)
29+
echo "matrix=$matrix" >> $GITHUB_OUTPUT
30+
outputs:
31+
matrix: ${{ steps.list-packages.outputs.matrix }}
32+
1233
coverage:
34+
needs: [list-packages]
1335
strategy:
1436
fail-fast: false
15-
matrix:
16-
lib:
17-
- cli
18-
- core
19-
- models
20-
- utils
21-
- plugin-eslint
22-
- plugin-coverage
23-
- plugin-js-packages
24-
- plugin-lighthouse
25-
scope: [unit, int]
26-
name: Update code coverage
37+
matrix: ${{ fromJson(needs.list-packages.outputs.matrix) }}
38+
name: Collect code coverage
2739
runs-on: ubuntu-latest
2840
steps:
2941
- name: Checkout the repository
@@ -35,13 +47,13 @@ jobs:
3547
cache: npm
3648
- name: Install dependencies
3749
run: npm ci
38-
- name: Execute all tests and generate coverage reports
39-
run: npx nx run ${{ matrix.lib }}:${{ matrix.scope }}-test --coverage.enabled
50+
- name: Execute tests with coverage
51+
run: npx nx run ${{ matrix.project }}:${{ matrix.target }} --coverage.enabled
4052
- name: Upload coverage reports to Codecov
4153
uses: codecov/codecov-action@v4
4254
with:
43-
directory: coverage/${{ matrix.lib }}/${{ matrix.scope }}-tests/
55+
directory: coverage/${{ matrix.project }}/${{ matrix.target }}s/
4456
files: ./lcov.info
45-
flags: ${{ matrix.lib }}-${{ matrix.scope }}
57+
flags: ${{ matrix.project }}-${{ matrix.target }}
4658
token: ${{ secrets.CODECOV_TOKEN }}
4759
fail_ci_if_error: true

.github/workflows/code-pushup-fork.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Code PushUp (fork)
1+
name: Code PushUp - Standalone Mode (fork)
22

33
# separated from code-pushup.yml for security reasons
44
# => requires permissions to create PR comment
@@ -20,19 +20,23 @@ permissions:
2020
jobs:
2121
code-pushup:
2222
runs-on: ubuntu-latest
23-
name: Code PushUp
23+
name: Run Code PushUp (fork)
2424
if: github.event.pull_request.head.repo.fork
2525
steps:
2626
- name: Checkout repository
2727
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
2830
- name: Set up Node.js
2931
uses: actions/setup-node@v4
3032
with:
3133
node-version-file: .nvmrc
3234
cache: npm
35+
- name: Set base and head for Nx affected commands
36+
uses: nrwl/nx-set-shas@v4
3337
- name: Install dependencies
3438
run: npm ci
3539
- name: Run Code PushUp action
3640
uses: code-pushup/github-action@v0
3741
with:
38-
bin: npx nx code-pushup --
42+
bin: npx nx code-pushup --nx-bail --

.github/workflows/code-pushup.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Code PushUp
1+
name: Code PushUp - Standalone Mode
22

33
on:
44
push:
@@ -16,7 +16,7 @@ permissions:
1616
jobs:
1717
code-pushup:
1818
runs-on: ubuntu-latest
19-
name: Code PushUp
19+
name: Run Code PushUp
2020
# ignore PRs from forks, handled by code-pushup-fork.yml
2121
if: ${{ !github.event.pull_request.head.repo.fork }}
2222
env:
@@ -27,14 +27,18 @@ jobs:
2727
steps:
2828
- name: Checkout repository
2929
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
3032
- name: Set up Node.js
3133
uses: actions/setup-node@v4
3234
with:
3335
node-version-file: .nvmrc
3436
cache: npm
37+
- name: Set base and head for Nx affected commands
38+
uses: nrwl/nx-set-shas@v4
3539
- name: Install dependencies
3640
run: npm ci
3741
- name: Run Code PushUp action
3842
uses: code-pushup/github-action@v0
3943
with:
40-
bin: npx nx code-pushup --
44+
bin: npx nx code-pushup --nx-bail --

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,19 @@ testem.log
4343
.DS_Store
4444
Thumbs.db
4545

46+
# generated eslint reports
47+
.eslint
48+
4649
# generated Code PushUp reports
47-
/.code-pushup
50+
.code-pushup
4851

4952
# Nx workspace cache
5053
.nx
5154

5255
# Bundled Vitest configuration files
5356
**/*.bundled_*.mjs
57+
58+
vite.config.*.timestamp*
59+
vitest.config.*.timestamp*
60+
.cursor/rules/nx-rules.mdc
61+
.github/instructions/nx.instructions.md

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
## 0.77.0 (2025-08-28)
2+
3+
### 🚀 Features
4+
5+
- **core:** pass config to plugin runner ([#1087](https://github.com/code-pushup/cli/pull/1087))
6+
- **plugin-eslint:** add artifact loading logic ([#1077](https://github.com/code-pushup/cli/pull/1077))
7+
8+
### 🩹 Fixes
9+
10+
- **ci:** prevent parallel git diff when detecting new issues in monorepo ([f5f9114d](https://github.com/code-pushup/cli/commit/f5f9114d))
11+
12+
### ❤️ Thank You
13+
14+
- Matěj Chalk
15+
- Michael Hladky @BioPhoton
16+
17+
## 0.76.0 (2025-08-25)
18+
19+
### 🚀 Features
20+
21+
- implement scoreTargets for audits ([5db68e2e](https://github.com/code-pushup/cli/commit/5db68e2e))
22+
- **ci:** add helper function for parsing configPatterns from json string ([fd5edb09](https://github.com/code-pushup/cli/commit/fd5edb09))
23+
- **ci:** export default settings and min/max limits ([a6a485ee](https://github.com/code-pushup/cli/commit/a6a485ee))
24+
- **models:** export default persist config ([18e95ff5](https://github.com/code-pushup/cli/commit/18e95ff5))
25+
- **models:** export default persist.skipReports value ([dfc15aeb](https://github.com/code-pushup/cli/commit/dfc15aeb))
26+
27+
### ❤️ Thank You
28+
29+
- Hanna Skryl @hanna-skryl
30+
- Matěj Chalk @matejchalk
31+
132
## 0.75.0 (2025-08-22)
233

334
### 🚀 Features

README.md

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

1717
---
1818

19-
![Type safety](https://api.staging.code-pushup.dev/badges/code-pushup/cli/type-safety?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
20-
![Bug prevention](https://api.staging.code-pushup.dev/badges/code-pushup/cli/bug-prevention?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
21-
![Code style](https://api.staging.code-pushup.dev/badges/code-pushup/cli/code-style?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
22-
![Code coverage](https://api.staging.code-pushup.dev/badges/code-pushup/cli/code-coverage?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
23-
![Security](https://api.staging.code-pushup.dev/badges/code-pushup/cli/security?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
24-
![Updates](https://api.staging.code-pushup.dev/badges/code-pushup/cli/updates?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
25-
![Documentation](https://api.staging.code-pushup.dev/badges/code-pushup/cli/docs?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
19+
![Type safety](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/type-safety?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
20+
![Bug prevention](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/bug-prevention?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
21+
![Code style](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/code-style?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
22+
![Code coverage](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/code-coverage?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
23+
![Security](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/security?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
24+
![Updates](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/updates?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
25+
![Documentation](https://api.staging.code-pushup.dev/badges/code-pushup/cli-workspace/docs?apiKey=cp_def67c4efe558a9149061d0c62de893e1689ad793071db332790238446173fef)
2626

2727
---
2828

code-pushup.config.ts

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'dotenv/config';
2-
import { z } from 'zod';
32
import {
43
coverageCoreConfigNx,
54
eslintCoreConfigNx,
@@ -11,25 +10,17 @@ import {
1110
import type { CoreConfig } from './packages/models/src/index.js';
1211
import { mergeConfigs } from './packages/utils/src/index.js';
1312

14-
// load upload configuration from environment
15-
const envSchema = z.object({
16-
CP_SERVER: z.string().url(),
17-
CP_API_KEY: z.string().min(1),
18-
CP_ORGANIZATION: z.string().min(1),
19-
CP_PROJECT: z.string().min(1),
20-
});
21-
const { data: env } = await envSchema.safeParseAsync(process.env);
13+
const project = process.env['NX_TASK_TARGET_PROJECT'] || 'cli-workspace';
2214

2315
const config: CoreConfig = {
24-
...(env && {
16+
...(process.env['CP_API_KEY'] && {
2517
upload: {
26-
server: env.CP_SERVER,
27-
apiKey: env.CP_API_KEY,
28-
organization: env.CP_ORGANIZATION,
29-
project: 'cli-workspace',
18+
project,
19+
organization: 'code-pushup',
20+
server: 'https://api.staging.code-pushup.dev/graphql',
21+
apiKey: process.env['CP_API_KEY'],
3022
},
3123
}),
32-
3324
plugins: [],
3425
};
3526

code-pushup.preset.ts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import coveragePlugin, {
88
} from './packages/plugin-coverage/src/index.js';
99
import eslintPlugin, {
1010
eslintConfigFromAllNxProjects,
11-
eslintConfigFromNxProject,
1211
} from './packages/plugin-eslint/src/index.js';
12+
import type { ESLintTarget } from './packages/plugin-eslint/src/lib/config.js';
13+
import { nxProjectsToConfig } from './packages/plugin-eslint/src/lib/nx/projects-to-config.js';
1314
import jsPackagesPlugin from './packages/plugin-js-packages/src/index.js';
1415
import jsDocsPlugin from './packages/plugin-jsdocs/src/index.js';
1516
import type { JsDocsPluginTransformedConfig } from './packages/plugin-jsdocs/src/lib/config.js';
@@ -156,15 +157,27 @@ export const jsDocsCoreConfig = (
156157
),
157158
});
158159

160+
export async function eslintConfigFromPublishableNxProjects(): Promise<
161+
ESLintTarget[]
162+
> {
163+
const { createProjectGraphAsync } = await import('@nx/devkit');
164+
const projectGraph = await createProjectGraphAsync({ exitOnError: false });
165+
return nxProjectsToConfig(
166+
projectGraph,
167+
project => project.tags?.includes('publishable') ?? false,
168+
);
169+
}
170+
159171
export const eslintCoreConfigNx = async (
160172
projectName?: string,
161173
): Promise<CoreConfig> => ({
162174
plugins: [
163-
await eslintPlugin(
164-
await (projectName
165-
? eslintConfigFromNxProject(projectName)
166-
: eslintConfigFromAllNxProjects()),
167-
),
175+
projectName
176+
? await eslintPlugin({
177+
eslintrc: `packages/${projectName}/eslint.config.js`,
178+
patterns: ['.'],
179+
})
180+
: await eslintPlugin(await eslintConfigFromAllNxProjects()),
168181
],
169182
categories: eslintCategories,
170183
});

e2e/ci-e2e/tests/nx-monorepo.e2e.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,6 @@ describe('CI - monorepo mode (Nx)', () => {
215215
).toMatchFileSnapshot(
216216
path.join(TEST_SNAPSHOTS_DIR, 'nx-monorepo-report-diff.md'),
217217
);
218-
});
218+
}, 120_000);
219219
});
220220
});

e2e/cli-e2e/vitest.e2e.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export default defineConfig(() => {
66
const baseConfig = createSharedE2eVitestConfig({
77
projectRoot: __dirname,
88
workspaceRoot: '../..',
9-
testTimeout: 20_000,
109
});
1110

1211
return {

0 commit comments

Comments
 (0)