From 3261c0eb04d2c5ab1f5c2301a4ccaebf9668e3f1 Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 12 Aug 2025 23:28:29 +0200 Subject: [PATCH 01/15] chore: refactor unit and int test targets --- nx.json | 14 ++++++++++++++ packages/ci/project.json | 9 ++------- packages/cli/project.json | 9 ++------- packages/core/project.json | 9 ++------- packages/create-cli/project.json | 9 ++------- packages/models/project.json | 9 ++------- packages/nx-plugin/project.json | 9 ++------- packages/plugin-coverage/project.json | 9 ++------- packages/plugin-eslint/project.json | 9 ++------- packages/plugin-js-packages/project.json | 9 ++------- packages/plugin-jsdocs/project.json | 9 ++------- packages/plugin-lighthouse/project.json | 9 ++------- packages/plugin-typescript/project.json | 9 ++------- packages/utils/project.json | 9 ++------- 14 files changed, 40 insertions(+), 91 deletions(-) diff --git a/nx.json b/nx.json index a6f3b45a0..53b7fe496 100644 --- a/nx.json +++ b/nx.json @@ -14,6 +14,20 @@ "assets": ["{projectRoot}/*.md"] } }, + "unit-test": { + "cache": true, + "executor": "@nx/vite:test", + "options": { + "configFile": "{projectRoot}/vitest.unit.config.ts" + } + }, + "int-test": { + "cache": true, + "executor": "@nx/vite:test", + "options": { + "configFile": "{projectRoot}/vitest.int.config.ts" + } + }, "lint": { "inputs": ["default", "{workspaceRoot}/eslint.config.?(c)js"], "executor": "@nx/linter:eslint", diff --git a/packages/ci/project.json b/packages/ci/project.json index 433089f77..ee895fca5 100644 --- a/packages/ci/project.json +++ b/packages/ci/project.json @@ -6,16 +6,11 @@ "targets": { "build": {}, "lint": {}, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "packages/ci/vitest.unit.config.ts" - } - }, + "unit-test": {}, "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "packages/ci/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts" } } }, diff --git a/packages/cli/project.json b/packages/cli/project.json index f25d2cccf..c7c0a59b4 100644 --- a/packages/cli/project.json +++ b/packages/cli/project.json @@ -6,16 +6,11 @@ "targets": { "build": {}, "lint": {}, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "packages/cli/vitest.unit.config.ts" - } - }, + "unit-test": {}, "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "packages/cli/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts" } }, "run-help": { diff --git a/packages/core/project.json b/packages/core/project.json index fe36dba07..4379a3c1e 100644 --- a/packages/core/project.json +++ b/packages/core/project.json @@ -6,16 +6,11 @@ "targets": { "build": {}, "lint": {}, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "packages/core/vitest.unit.config.ts" - } - }, + "unit-test": {}, "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "packages/core/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts" } } }, diff --git a/packages/create-cli/project.json b/packages/create-cli/project.json index 11e1ef907..11193d2cf 100644 --- a/packages/create-cli/project.json +++ b/packages/create-cli/project.json @@ -6,16 +6,11 @@ "targets": { "build": {}, "lint": {}, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "packages/create-cli/vitest.unit.config.ts" - } - }, + "unit-test": {}, "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "packages/create-cli/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts" } }, "exec-node": { diff --git a/packages/models/project.json b/packages/models/project.json index d80e38793..22243ac11 100644 --- a/packages/models/project.json +++ b/packages/models/project.json @@ -18,16 +18,11 @@ ] }, "lint": {}, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "packages/models/vitest.unit.config.ts" - } - }, + "unit-test": {}, "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "packages/models/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts" } } }, diff --git a/packages/nx-plugin/project.json b/packages/nx-plugin/project.json index df20084e3..d214b726b 100644 --- a/packages/nx-plugin/project.json +++ b/packages/nx-plugin/project.json @@ -41,16 +41,11 @@ ] } }, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "packages/nx-plugin/vitest.unit.config.ts" - } - }, + "unit-test": {}, "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "packages/nx-plugin/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts" } } }, diff --git a/packages/plugin-coverage/project.json b/packages/plugin-coverage/project.json index ddef42a9d..56488ba8c 100644 --- a/packages/plugin-coverage/project.json +++ b/packages/plugin-coverage/project.json @@ -6,16 +6,11 @@ "targets": { "build": {}, "lint": {}, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "packages/plugin-coverage/vitest.unit.config.ts" - } - }, + "unit-test": {}, "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "packages/plugin-coverage/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts" } } }, diff --git a/packages/plugin-eslint/project.json b/packages/plugin-eslint/project.json index 0f23cf33d..7347d86b2 100644 --- a/packages/plugin-eslint/project.json +++ b/packages/plugin-eslint/project.json @@ -6,16 +6,11 @@ "targets": { "build": {}, "lint": {}, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "packages/plugin-eslint/vitest.unit.config.ts" - } - }, + "unit-test": {}, "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "packages/plugin-eslint/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts" } } }, diff --git a/packages/plugin-js-packages/project.json b/packages/plugin-js-packages/project.json index d664a3817..6c36a0948 100644 --- a/packages/plugin-js-packages/project.json +++ b/packages/plugin-js-packages/project.json @@ -6,16 +6,11 @@ "targets": { "build": {}, "lint": {}, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "packages/plugin-js-packages/vitest.unit.config.ts" - } - }, + "unit-test": {}, "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "packages/plugin-js-packages/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts" } } }, diff --git a/packages/plugin-jsdocs/project.json b/packages/plugin-jsdocs/project.json index ebe839f44..5217e993f 100644 --- a/packages/plugin-jsdocs/project.json +++ b/packages/plugin-jsdocs/project.json @@ -7,16 +7,11 @@ "targets": { "build": {}, "lint": {}, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "packages/plugin-jsdocs/vitest.unit.config.ts" - } - }, + "unit-test": {}, "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "packages/plugin-jsdocs/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts" } } } diff --git a/packages/plugin-lighthouse/project.json b/packages/plugin-lighthouse/project.json index 9442227f4..bf55f2e95 100644 --- a/packages/plugin-lighthouse/project.json +++ b/packages/plugin-lighthouse/project.json @@ -6,16 +6,11 @@ "targets": { "build": {}, "lint": {}, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "packages/plugin-lighthouse/vitest.unit.config.ts" - } - }, + "unit-test": {}, "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "packages/plugin-lighthouse/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts" } } }, diff --git a/packages/plugin-typescript/project.json b/packages/plugin-typescript/project.json index 9b2265b73..27bf5d835 100644 --- a/packages/plugin-typescript/project.json +++ b/packages/plugin-typescript/project.json @@ -6,16 +6,11 @@ "targets": { "build": {}, "lint": {}, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "packages/plugin-typescript/vitest.unit.config.ts" - } - }, + "unit-test": {}, "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "packages/plugin-typescript/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts" } } }, diff --git a/packages/utils/project.json b/packages/utils/project.json index 30e7fa046..5d0755f4a 100644 --- a/packages/utils/project.json +++ b/packages/utils/project.json @@ -18,16 +18,11 @@ "cwd": "./packages/utils/perf" } }, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "packages/utils/vitest.unit.config.ts" - } - }, + "unit-test": {}, "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "packages/utils/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts" } } }, From ad988ab00b9bc1fe0a53cac65dee9135474e8bc0 Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 12 Aug 2025 23:34:36 +0200 Subject: [PATCH 02/15] chore: refactor unit and int test targets 2 --- testing/test-nx-utils/project.json | 7 +------ testing/test-setup/project.json | 7 +------ testing/test-utils/project.json | 7 +------ 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/testing/test-nx-utils/project.json b/testing/test-nx-utils/project.json index 9fc33df87..d76cad67e 100644 --- a/testing/test-nx-utils/project.json +++ b/testing/test-nx-utils/project.json @@ -6,12 +6,7 @@ "targets": { "build": {}, "lint": {}, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "testing/test-nx-utils/vitest.unit.config.ts" - } - } + "unit-test": {} }, "tags": ["scope:shared", "type:testing"] } diff --git a/testing/test-setup/project.json b/testing/test-setup/project.json index 6320cfaab..0657658a2 100644 --- a/testing/test-setup/project.json +++ b/testing/test-setup/project.json @@ -6,12 +6,7 @@ "targets": { "build": {}, "lint": {}, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "testing/test-setup/vitest.unit.config.ts" - } - } + "unit-test": {} }, "tags": ["scope:shared", "type:testing"] } diff --git a/testing/test-utils/project.json b/testing/test-utils/project.json index ccc11d50c..a23396a9e 100644 --- a/testing/test-utils/project.json +++ b/testing/test-utils/project.json @@ -6,12 +6,7 @@ "targets": { "build": {}, "lint": {}, - "unit-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "testing/test-utils/vitest.unit.config.ts" - } - }, + "unit-test": {}, "nx-release-publish": { "executor": "nx:noop" } From 822a3235aeb188f82f25e73f9e1e58d3cf343fec Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Aug 2025 00:39:27 +0200 Subject: [PATCH 03/15] chore: add coverage to existing test targets --- code-pushup.preset.ts | 7 +------ nx.json | 10 ++++++++-- packages/ci/project.json | 5 ++++- packages/cli/project.json | 5 ++++- packages/core/project.json | 5 ++++- packages/create-cli/project.json | 5 ++++- packages/models/project.json | 5 ++++- packages/nx-plugin/project.json | 5 ++++- packages/plugin-coverage/project.json | 5 ++++- packages/plugin-eslint/project.json | 5 ++++- packages/plugin-js-packages/project.json | 5 ++++- packages/plugin-jsdocs/project.json | 5 ++++- packages/plugin-lighthouse/project.json | 5 ++++- packages/plugin-typescript/project.json | 5 ++++- packages/utils/project.json | 5 ++++- 15 files changed, 61 insertions(+), 21 deletions(-) diff --git a/code-pushup.preset.ts b/code-pushup.preset.ts index 15ba02ccc..c6d5652f1 100644 --- a/code-pushup.preset.ts +++ b/code-pushup.preset.ts @@ -184,12 +184,7 @@ export const coverageCoreConfigNx = async ( throw new Error('coverageCoreConfigNx for single projects not implemented'); } const targetNames = ['unit-test', 'int-test']; - const targetArgs = [ - '-t', - ...targetNames, - '--coverage.enabled', - '--skipNxCache', - ]; + const targetArgs = ['-t', ...targetNames]; return { plugins: [ await coveragePlugin({ diff --git a/nx.json b/nx.json index 53b7fe496..088d1d11d 100644 --- a/nx.json +++ b/nx.json @@ -18,14 +18,20 @@ "cache": true, "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.unit.config.ts" + "configFile": "{projectRoot}/vitest.unit.config.ts", + "coverage": { + "enabled": true + } } }, "int-test": { "cache": true, "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } }, "lint": { diff --git a/packages/ci/project.json b/packages/ci/project.json index ee895fca5..dbe33d05f 100644 --- a/packages/ci/project.json +++ b/packages/ci/project.json @@ -10,7 +10,10 @@ "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } } }, diff --git a/packages/cli/project.json b/packages/cli/project.json index c7c0a59b4..9157b25ad 100644 --- a/packages/cli/project.json +++ b/packages/cli/project.json @@ -10,7 +10,10 @@ "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } }, "run-help": { diff --git a/packages/core/project.json b/packages/core/project.json index 4379a3c1e..4dbbe86c7 100644 --- a/packages/core/project.json +++ b/packages/core/project.json @@ -10,7 +10,10 @@ "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } } }, diff --git a/packages/create-cli/project.json b/packages/create-cli/project.json index 11193d2cf..8e4b13b58 100644 --- a/packages/create-cli/project.json +++ b/packages/create-cli/project.json @@ -10,7 +10,10 @@ "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } }, "exec-node": { diff --git a/packages/models/project.json b/packages/models/project.json index 22243ac11..9e8ff7b11 100644 --- a/packages/models/project.json +++ b/packages/models/project.json @@ -22,7 +22,10 @@ "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } } }, diff --git a/packages/nx-plugin/project.json b/packages/nx-plugin/project.json index d214b726b..1ec43129e 100644 --- a/packages/nx-plugin/project.json +++ b/packages/nx-plugin/project.json @@ -45,7 +45,10 @@ "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } } }, diff --git a/packages/plugin-coverage/project.json b/packages/plugin-coverage/project.json index 56488ba8c..670030ce1 100644 --- a/packages/plugin-coverage/project.json +++ b/packages/plugin-coverage/project.json @@ -10,7 +10,10 @@ "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } } }, diff --git a/packages/plugin-eslint/project.json b/packages/plugin-eslint/project.json index 7347d86b2..49fc49313 100644 --- a/packages/plugin-eslint/project.json +++ b/packages/plugin-eslint/project.json @@ -10,7 +10,10 @@ "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } } }, diff --git a/packages/plugin-js-packages/project.json b/packages/plugin-js-packages/project.json index 6c36a0948..9164982fc 100644 --- a/packages/plugin-js-packages/project.json +++ b/packages/plugin-js-packages/project.json @@ -10,7 +10,10 @@ "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } } }, diff --git a/packages/plugin-jsdocs/project.json b/packages/plugin-jsdocs/project.json index 5217e993f..b08eaec07 100644 --- a/packages/plugin-jsdocs/project.json +++ b/packages/plugin-jsdocs/project.json @@ -11,7 +11,10 @@ "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } } } diff --git a/packages/plugin-lighthouse/project.json b/packages/plugin-lighthouse/project.json index bf55f2e95..f45bcf0c1 100644 --- a/packages/plugin-lighthouse/project.json +++ b/packages/plugin-lighthouse/project.json @@ -10,7 +10,10 @@ "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } } }, diff --git a/packages/plugin-typescript/project.json b/packages/plugin-typescript/project.json index 27bf5d835..94698b289 100644 --- a/packages/plugin-typescript/project.json +++ b/packages/plugin-typescript/project.json @@ -10,7 +10,10 @@ "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } } }, diff --git a/packages/utils/project.json b/packages/utils/project.json index 5d0755f4a..32b23aeb1 100644 --- a/packages/utils/project.json +++ b/packages/utils/project.json @@ -22,7 +22,10 @@ "int-test": { "executor": "@nx/vite:test", "options": { - "configFile": "{projectRoot}/vitest.int.config.ts" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } } }, From 31666454798b86337f546f85b00ed056ea962c33 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Aug 2025 01:44:12 +0200 Subject: [PATCH 04/15] chore: refine e2e and int test targets --- code-pushup.preset.ts | 45 ++++++++++++++++--- e2e/ci-e2e/project.json | 7 +-- e2e/cli-e2e/project.json | 13 ++---- e2e/create-cli-e2e/project.json | 14 ++---- e2e/nx-plugin-e2e/project.json | 13 ++---- e2e/plugin-coverage-e2e/project.json | 13 ++---- e2e/plugin-eslint-e2e/project.json | 13 ++---- e2e/plugin-js-packages-e2e/project.json | 11 ++--- examples/plugins/project.json | 37 ++++----------- nx.json | 14 ++++-- packages/ci/project.json | 2 + packages/cli/project.json | 2 + packages/core/project.json | 2 + packages/create-cli/project.json | 2 + packages/nx-plugin/project.json | 2 + packages/plugin-coverage/project.json | 2 + .../src/lib/nx/coverage-paths.ts | 7 ++- packages/plugin-eslint/project.json | 2 + packages/plugin-js-packages/project.json | 2 + packages/plugin-jsdocs/project.json | 2 + packages/plugin-lighthouse/project.json | 2 + packages/plugin-typescript/project.json | 2 + packages/utils/project.json | 2 + 23 files changed, 114 insertions(+), 97 deletions(-) diff --git a/code-pushup.preset.ts b/code-pushup.preset.ts index c6d5652f1..55d20548c 100644 --- a/code-pushup.preset.ts +++ b/code-pushup.preset.ts @@ -100,12 +100,16 @@ export const eslintCategories: CategoryConfig[] = [ export function getJsDocsCategories( config: JsDocsPluginConfig, ): CategoryConfig[] { + const filterOptions = + typeof config === 'string' || Array.isArray(config) + ? {} + : { onlyAudits: config.onlyAudits, skipAudits: config.skipAudits }; return [ { slug: 'docs', title: 'Documentation', description: 'Measures how much of your code is **documented**.', - refs: filterGroupsByOnlyAudits(groups, config).map(group => ({ + refs: filterGroupsByOnlyAudits(groups, filterOptions).map(group => ({ weight: 1, type: 'group', plugin: PLUGIN_SLUG, @@ -159,12 +163,13 @@ export const jsDocsCoreConfig = ( export const eslintCoreConfigNx = async ( projectName?: string, + options?: { exclude?: string[] }, ): Promise => ({ plugins: [ await eslintPlugin( await (projectName ? eslintConfigFromNxProject(projectName) - : eslintConfigFromAllNxProjects()), + : eslintConfigFromAllNxProjects(options)), ), ], categories: eslintCategories, @@ -178,13 +183,42 @@ export const typescriptPluginConfig = async ( }); export const coverageCoreConfigNx = async ( - projectName?: string, + projectOrConfig?: + | string + | { + projectName: string; + targetNames: string[]; + }, + options?: { exclude?: string[] }, ): Promise => { + const projectName = + typeof projectOrConfig === 'string' + ? projectOrConfig + : projectOrConfig?.projectName; + const targetNames = + typeof projectOrConfig === 'object' && projectOrConfig?.targetNames?.length + ? projectOrConfig.targetNames + : ['unit-test', 'int-test']; + if (projectName) { throw new Error('coverageCoreConfigNx for single projects not implemented'); } - const targetNames = ['unit-test', 'int-test']; + const targetArgs = ['-t', ...targetNames]; + + // Compute projects list and apply exclude for efficient run-many execution + const { createProjectGraphAsync } = await import('@nx/devkit'); + const { nodes } = await createProjectGraphAsync({ exitOnError: false }); + const projectsWithTargets = Object.values(nodes).filter(node => + targetNames.some(t => node.data.targets && t in node.data.targets), + ); + const filteredProjects = options?.exclude?.length + ? projectsWithTargets.filter(node => !options.exclude!.includes(node.name)) + : projectsWithTargets; + const projectsArg = `--projects=${filteredProjects + .map(p => p.name) + .join(',')}`; + return { plugins: [ await coveragePlugin({ @@ -194,9 +228,10 @@ export const coverageCoreConfigNx = async ( 'nx', projectName ? `run --project ${projectName}` : 'run-many', ...targetArgs, + projectsArg, ], }, - reports: await getNxCoveragePaths(targetNames), + reports: await getNxCoveragePaths(targetNames, false, options?.exclude), }), ], categories: coverageCategories, diff --git a/e2e/ci-e2e/project.json b/e2e/ci-e2e/project.json index 29a33f65d..704b13730 100644 --- a/e2e/ci-e2e/project.json +++ b/e2e/ci-e2e/project.json @@ -5,12 +5,7 @@ "projectType": "application", "targets": { "lint": {}, - "e2e": { - "executor": "@nx/vite:test", - "options": { - "configFile": "e2e/ci-e2e/vitest.e2e.config.ts" - } - } + "e2e": {} }, "implicitDependencies": ["cli", "ci"], "tags": ["scope:tooling", "type:e2e"] diff --git a/e2e/cli-e2e/project.json b/e2e/cli-e2e/project.json index ba2f90352..181dd4854 100644 --- a/e2e/cli-e2e/project.json +++ b/e2e/cli-e2e/project.json @@ -3,15 +3,10 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "e2e/cli-e2e/src", "projectType": "application", + "tags": ["scope:core", "scope:plugin", "type:e2e"], + "implicitDependencies": ["cli"], "targets": { "lint": {}, - "e2e": { - "executor": "@nx/vite:test", - "options": { - "configFile": "e2e/cli-e2e/vitest.e2e.config.ts" - } - } - }, - "implicitDependencies": ["cli"], - "tags": ["scope:core", "scope:plugin", "type:e2e"] + "e2e": {} + } } diff --git a/e2e/create-cli-e2e/project.json b/e2e/create-cli-e2e/project.json index beeb09874..aad7d6f5f 100644 --- a/e2e/create-cli-e2e/project.json +++ b/e2e/create-cli-e2e/project.json @@ -3,16 +3,10 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "examples/create-cli-e2e/src", "projectType": "application", + "tags": ["scope:tooling", "type:e2e"], + "implicitDependencies": ["create-cli"], "targets": { "lint": {}, - "e2e": { - "executor": "@nx/vite:test", - "options": { - "keepServerRunning": true, - "configFile": "e2e/create-cli-e2e/vitest.e2e.config.ts" - } - } - }, - "implicitDependencies": ["create-cli"], - "tags": ["scope:tooling", "type:e2e"] + "e2e": {} + } } diff --git a/e2e/nx-plugin-e2e/project.json b/e2e/nx-plugin-e2e/project.json index 9c7a190fc..1c7d2a00f 100644 --- a/e2e/nx-plugin-e2e/project.json +++ b/e2e/nx-plugin-e2e/project.json @@ -3,15 +3,10 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "e2e/nx-plugin-e2e/src", "projectType": "application", + "tags": ["scope:tooling", "type:e2e"], + "implicitDependencies": ["test-utils", "nx-plugin"], "targets": { "lint": {}, - "e2e": { - "executor": "@nx/vite:test", - "options": { - "configFile": "e2e/nx-plugin-e2e/vitest.e2e.config.ts" - } - } - }, - "implicitDependencies": ["test-utils", "nx-plugin"], - "tags": ["scope:tooling", "type:e2e"] + "e2e": {} + } } diff --git a/e2e/plugin-coverage-e2e/project.json b/e2e/plugin-coverage-e2e/project.json index 7b127aa13..f8a9e46e9 100644 --- a/e2e/plugin-coverage-e2e/project.json +++ b/e2e/plugin-coverage-e2e/project.json @@ -3,15 +3,10 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "e2e/plugin-coverage-e2e/src", "projectType": "application", + "tags": ["scope:plugin", "type:e2e"], + "implicitDependencies": ["cli", "plugin-coverage"], "targets": { "lint": {}, - "e2e": { - "executor": "@nx/vite:test", - "options": { - "configFile": "e2e/plugin-coverage-e2e/vitest.e2e.config.ts" - } - } - }, - "implicitDependencies": ["cli", "plugin-coverage"], - "tags": ["scope:plugin", "type:e2e"] + "e2e": {} + } } diff --git a/e2e/plugin-eslint-e2e/project.json b/e2e/plugin-eslint-e2e/project.json index 544d6a8ef..82e3ff70b 100644 --- a/e2e/plugin-eslint-e2e/project.json +++ b/e2e/plugin-eslint-e2e/project.json @@ -3,15 +3,10 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "e2e/plugin-eslint-e2e/src", "projectType": "application", + "tags": ["scope:plugin", "type:e2e"], + "implicitDependencies": ["cli", "plugin-eslint"], "targets": { "lint": {}, - "e2e": { - "executor": "@nx/vite:test", - "options": { - "configFile": "e2e/plugin-eslint-e2e/vitest.e2e.config.ts" - } - } - }, - "implicitDependencies": ["cli", "plugin-eslint"], - "tags": ["scope:plugin", "type:e2e"] + "e2e": {} + } } diff --git a/e2e/plugin-js-packages-e2e/project.json b/e2e/plugin-js-packages-e2e/project.json index 901c92dd4..d1aaaaf01 100644 --- a/e2e/plugin-js-packages-e2e/project.json +++ b/e2e/plugin-js-packages-e2e/project.json @@ -3,15 +3,10 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "sourceRoot": "e2e/plugin-js-packages-e2e/src", + "tags": ["scope:plugin", "type:e2e"], "implicitDependencies": ["cli", "plugin-js-packages"], "targets": { "lint": {}, - "e2e": { - "executor": "@nx/vite:test", - "options": { - "configFile": "e2e/plugin-eslint-e2e/vitest.e2e.config.ts" - } - } - }, - "tags": ["scope:plugin", "type:e2e"] + "e2e": {} + } } diff --git a/examples/plugins/project.json b/examples/plugins/project.json index f64b7c7b7..8f784340b 100644 --- a/examples/plugins/project.json +++ b/examples/plugins/project.json @@ -4,37 +4,18 @@ "sourceRoot": "examples/plugins/src", "projectType": "library", "targets": { - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/examples/plugins", - "main": "examples/plugins/src/index.ts", - "tsConfig": "examples/plugins/tsconfig.lib.json", - "assets": ["examples/plugins/*.md"] - } - }, - "lint": { - "executor": "@nx/linter:eslint", - "outputs": ["{options.outputFile}"], - "options": { - "lintFilePatterns": ["examples/plugins/**/*.ts"] - } - }, - "unit-test": { - "executor": "@nx/vite:test", - "outputs": ["{options.reportsDirectory}"], - "options": { - "configFile": "examples/plugins/vitest.unit.config.ts", - "reportsDirectory": "../../coverage/examples-plugins/unit-tests" - } - }, + "build": {}, + "lint": {}, + "unit-test": {}, "int-test": { + "cache": true, + "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], "executor": "@nx/vite:test", - "outputs": ["{options.reportsDirectory}"], "options": { - "configFile": "examples/plugins/vitest.int.config.ts", - "reportsDirectory": "../../coverage/examples-plugins/int-tests" + "configFile": "{projectRoot}/vitest.int.config.ts", + "coverage": { + "enabled": true + } } }, "run-collect": { diff --git a/nx.json b/nx.json index 088d1d11d..816ba1b5a 100644 --- a/nx.json +++ b/nx.json @@ -16,6 +16,9 @@ }, "unit-test": { "cache": true, + "outputs": [ + "{workspaceRoot}/coverage/{projectName}/unit-tests/lcov.info" + ], "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.unit.config.ts", @@ -26,6 +29,7 @@ }, "int-test": { "cache": true, + "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.int.config.ts", @@ -34,6 +38,13 @@ } } }, + "e2e": { + "dependsOn": ["^build"], + "executor": "@nx/vite:test", + "options": { + "configFile": "{projectRoot}/vitest.e2e.config.ts" + } + }, "lint": { "inputs": ["default", "{workspaceRoot}/eslint.config.?(c)js"], "executor": "@nx/linter:eslint", @@ -47,9 +58,6 @@ ] } }, - "e2e": { - "dependsOn": ["^build"] - }, "nxv-pkg-install": { "parallelism": false }, diff --git a/packages/ci/project.json b/packages/ci/project.json index dbe33d05f..0b514dee8 100644 --- a/packages/ci/project.json +++ b/packages/ci/project.json @@ -8,6 +8,8 @@ "lint": {}, "unit-test": {}, "int-test": { + "cache": true, + "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.int.config.ts", diff --git a/packages/cli/project.json b/packages/cli/project.json index 9157b25ad..1de7d070f 100644 --- a/packages/cli/project.json +++ b/packages/cli/project.json @@ -8,6 +8,8 @@ "lint": {}, "unit-test": {}, "int-test": { + "cache": true, + "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.int.config.ts", diff --git a/packages/core/project.json b/packages/core/project.json index 4dbbe86c7..f543a6579 100644 --- a/packages/core/project.json +++ b/packages/core/project.json @@ -8,6 +8,8 @@ "lint": {}, "unit-test": {}, "int-test": { + "cache": true, + "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.int.config.ts", diff --git a/packages/create-cli/project.json b/packages/create-cli/project.json index 8e4b13b58..77c2af03d 100644 --- a/packages/create-cli/project.json +++ b/packages/create-cli/project.json @@ -8,6 +8,8 @@ "lint": {}, "unit-test": {}, "int-test": { + "cache": true, + "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.int.config.ts", diff --git a/packages/nx-plugin/project.json b/packages/nx-plugin/project.json index 1ec43129e..4d3763b49 100644 --- a/packages/nx-plugin/project.json +++ b/packages/nx-plugin/project.json @@ -43,6 +43,8 @@ }, "unit-test": {}, "int-test": { + "cache": true, + "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.int.config.ts", diff --git a/packages/plugin-coverage/project.json b/packages/plugin-coverage/project.json index 670030ce1..f2188a633 100644 --- a/packages/plugin-coverage/project.json +++ b/packages/plugin-coverage/project.json @@ -8,6 +8,8 @@ "lint": {}, "unit-test": {}, "int-test": { + "cache": true, + "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.int.config.ts", diff --git a/packages/plugin-coverage/src/lib/nx/coverage-paths.ts b/packages/plugin-coverage/src/lib/nx/coverage-paths.ts index a74b0a195..fdf734ae2 100644 --- a/packages/plugin-coverage/src/lib/nx/coverage-paths.ts +++ b/packages/plugin-coverage/src/lib/nx/coverage-paths.ts @@ -18,6 +18,7 @@ import type { CoverageResult } from '../config.js'; export async function getNxCoveragePaths( targets: string[] = ['test'], verbose?: boolean, + exclude?: string[], ): Promise { if (verbose) { ui().logger.info( @@ -34,8 +35,12 @@ export async function getNxCoveragePaths( hasNxTarget(graph, target), ); + const filteredNodes = exclude?.length + ? relevantNodes.filter(node => !exclude.includes(node.name)) + : relevantNodes; + return await Promise.all( - relevantNodes.map>(async ({ name, data }) => { + filteredNodes.map>(async ({ name, data }) => { const coveragePaths = await getCoveragePathsForTarget(data, target); if (verbose) { ui().logger.info(`- ${name}: ${target}`); diff --git a/packages/plugin-eslint/project.json b/packages/plugin-eslint/project.json index 49fc49313..3d8cb9a6c 100644 --- a/packages/plugin-eslint/project.json +++ b/packages/plugin-eslint/project.json @@ -8,6 +8,8 @@ "lint": {}, "unit-test": {}, "int-test": { + "cache": true, + "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.int.config.ts", diff --git a/packages/plugin-js-packages/project.json b/packages/plugin-js-packages/project.json index 9164982fc..0c084d3ca 100644 --- a/packages/plugin-js-packages/project.json +++ b/packages/plugin-js-packages/project.json @@ -8,6 +8,8 @@ "lint": {}, "unit-test": {}, "int-test": { + "cache": true, + "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.int.config.ts", diff --git a/packages/plugin-jsdocs/project.json b/packages/plugin-jsdocs/project.json index b08eaec07..fbb7ea361 100644 --- a/packages/plugin-jsdocs/project.json +++ b/packages/plugin-jsdocs/project.json @@ -9,6 +9,8 @@ "lint": {}, "unit-test": {}, "int-test": { + "cache": true, + "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.int.config.ts", diff --git a/packages/plugin-lighthouse/project.json b/packages/plugin-lighthouse/project.json index f45bcf0c1..f664a4ce1 100644 --- a/packages/plugin-lighthouse/project.json +++ b/packages/plugin-lighthouse/project.json @@ -8,6 +8,8 @@ "lint": {}, "unit-test": {}, "int-test": { + "cache": true, + "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.int.config.ts", diff --git a/packages/plugin-typescript/project.json b/packages/plugin-typescript/project.json index 94698b289..10549bd1a 100644 --- a/packages/plugin-typescript/project.json +++ b/packages/plugin-typescript/project.json @@ -8,6 +8,8 @@ "lint": {}, "unit-test": {}, "int-test": { + "cache": true, + "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.int.config.ts", diff --git a/packages/utils/project.json b/packages/utils/project.json index 32b23aeb1..ebcfe1c4a 100644 --- a/packages/utils/project.json +++ b/packages/utils/project.json @@ -20,6 +20,8 @@ }, "unit-test": {}, "int-test": { + "cache": true, + "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.int.config.ts", From 28213f0b23794b7529825e8663d63da3e2a9830e Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Aug 2025 01:54:37 +0200 Subject: [PATCH 05/15] chore: refine preset --- code-pushup.preset.ts | 52 ++++--------------- .../src/lib/nx/coverage-paths.ts | 7 +-- 2 files changed, 12 insertions(+), 47 deletions(-) diff --git a/code-pushup.preset.ts b/code-pushup.preset.ts index 55d20548c..15ba02ccc 100644 --- a/code-pushup.preset.ts +++ b/code-pushup.preset.ts @@ -100,16 +100,12 @@ export const eslintCategories: CategoryConfig[] = [ export function getJsDocsCategories( config: JsDocsPluginConfig, ): CategoryConfig[] { - const filterOptions = - typeof config === 'string' || Array.isArray(config) - ? {} - : { onlyAudits: config.onlyAudits, skipAudits: config.skipAudits }; return [ { slug: 'docs', title: 'Documentation', description: 'Measures how much of your code is **documented**.', - refs: filterGroupsByOnlyAudits(groups, filterOptions).map(group => ({ + refs: filterGroupsByOnlyAudits(groups, config).map(group => ({ weight: 1, type: 'group', plugin: PLUGIN_SLUG, @@ -163,13 +159,12 @@ export const jsDocsCoreConfig = ( export const eslintCoreConfigNx = async ( projectName?: string, - options?: { exclude?: string[] }, ): Promise => ({ plugins: [ await eslintPlugin( await (projectName ? eslintConfigFromNxProject(projectName) - : eslintConfigFromAllNxProjects(options)), + : eslintConfigFromAllNxProjects()), ), ], categories: eslintCategories, @@ -183,42 +178,18 @@ export const typescriptPluginConfig = async ( }); export const coverageCoreConfigNx = async ( - projectOrConfig?: - | string - | { - projectName: string; - targetNames: string[]; - }, - options?: { exclude?: string[] }, + projectName?: string, ): Promise => { - const projectName = - typeof projectOrConfig === 'string' - ? projectOrConfig - : projectOrConfig?.projectName; - const targetNames = - typeof projectOrConfig === 'object' && projectOrConfig?.targetNames?.length - ? projectOrConfig.targetNames - : ['unit-test', 'int-test']; - if (projectName) { throw new Error('coverageCoreConfigNx for single projects not implemented'); } - - const targetArgs = ['-t', ...targetNames]; - - // Compute projects list and apply exclude for efficient run-many execution - const { createProjectGraphAsync } = await import('@nx/devkit'); - const { nodes } = await createProjectGraphAsync({ exitOnError: false }); - const projectsWithTargets = Object.values(nodes).filter(node => - targetNames.some(t => node.data.targets && t in node.data.targets), - ); - const filteredProjects = options?.exclude?.length - ? projectsWithTargets.filter(node => !options.exclude!.includes(node.name)) - : projectsWithTargets; - const projectsArg = `--projects=${filteredProjects - .map(p => p.name) - .join(',')}`; - + const targetNames = ['unit-test', 'int-test']; + const targetArgs = [ + '-t', + ...targetNames, + '--coverage.enabled', + '--skipNxCache', + ]; return { plugins: [ await coveragePlugin({ @@ -228,10 +199,9 @@ export const coverageCoreConfigNx = async ( 'nx', projectName ? `run --project ${projectName}` : 'run-many', ...targetArgs, - projectsArg, ], }, - reports: await getNxCoveragePaths(targetNames, false, options?.exclude), + reports: await getNxCoveragePaths(targetNames), }), ], categories: coverageCategories, diff --git a/packages/plugin-coverage/src/lib/nx/coverage-paths.ts b/packages/plugin-coverage/src/lib/nx/coverage-paths.ts index fdf734ae2..a74b0a195 100644 --- a/packages/plugin-coverage/src/lib/nx/coverage-paths.ts +++ b/packages/plugin-coverage/src/lib/nx/coverage-paths.ts @@ -18,7 +18,6 @@ import type { CoverageResult } from '../config.js'; export async function getNxCoveragePaths( targets: string[] = ['test'], verbose?: boolean, - exclude?: string[], ): Promise { if (verbose) { ui().logger.info( @@ -35,12 +34,8 @@ export async function getNxCoveragePaths( hasNxTarget(graph, target), ); - const filteredNodes = exclude?.length - ? relevantNodes.filter(node => !exclude.includes(node.name)) - : relevantNodes; - return await Promise.all( - filteredNodes.map>(async ({ name, data }) => { + relevantNodes.map>(async ({ name, data }) => { const coveragePaths = await getCoveragePathsForTarget(data, target); if (verbose) { ui().logger.info(`- ${name}: ${target}`); From 139b9418179df5eec58825c7f6369a00835ea404 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Aug 2025 02:11:24 +0200 Subject: [PATCH 06/15] chore: refine targets --- e2e/plugin-lighthouse-e2e/project.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/e2e/plugin-lighthouse-e2e/project.json b/e2e/plugin-lighthouse-e2e/project.json index f8f4c9cb4..9aafc3cdc 100644 --- a/e2e/plugin-lighthouse-e2e/project.json +++ b/e2e/plugin-lighthouse-e2e/project.json @@ -5,12 +5,7 @@ "projectType": "application", "targets": { "lint": {}, - "e2e": { - "executor": "@nx/vite:test", - "options": { - "configFile": "e2e/plugin-lighthouse-e2e/vitest.e2e.config.ts" - } - } + "e2e": {} }, "implicitDependencies": ["cli", "plugin-lighthouse"], "tags": ["scope:plugin", "type:e2e"] From 454f9866e6563dcf37cfb37acaa653a8f6ddfd65 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Aug 2025 02:43:02 +0200 Subject: [PATCH 07/15] chore: refine targets 2 --- e2e/plugin-lighthouse-e2e/project.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/e2e/plugin-lighthouse-e2e/project.json b/e2e/plugin-lighthouse-e2e/project.json index 9aafc3cdc..a29950ee3 100644 --- a/e2e/plugin-lighthouse-e2e/project.json +++ b/e2e/plugin-lighthouse-e2e/project.json @@ -5,7 +5,12 @@ "projectType": "application", "targets": { "lint": {}, - "e2e": {} + "e2e": { + "executor": "@nx/vite:test", + "options": { + "configFile": "{projectRoot}/vitest.e2e.config.ts" + } + } }, "implicitDependencies": ["cli", "plugin-lighthouse"], "tags": ["scope:plugin", "type:e2e"] From 55bc6282ad4fb0338292a82eb7c4b374112768ca Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Aug 2025 02:49:15 +0200 Subject: [PATCH 08/15] chore: refine targets 3 --- e2e/ci-e2e/project.json | 7 ++++++- e2e/cli-e2e/project.json | 13 +++++++++---- e2e/create-cli-e2e/project.json | 14 ++++++++++---- e2e/nx-plugin-e2e/project.json | 13 +++++++++---- e2e/plugin-coverage-e2e/project.json | 13 +++++++++---- e2e/plugin-eslint-e2e/project.json | 13 +++++++++---- e2e/plugin-js-packages-e2e/project.json | 11 ++++++++--- nx.json | 6 +----- 8 files changed, 61 insertions(+), 29 deletions(-) diff --git a/e2e/ci-e2e/project.json b/e2e/ci-e2e/project.json index 704b13730..f458d8d9d 100644 --- a/e2e/ci-e2e/project.json +++ b/e2e/ci-e2e/project.json @@ -5,7 +5,12 @@ "projectType": "application", "targets": { "lint": {}, - "e2e": {} + "e2e": { + "executor": "@nx/vite:test", + "options": { + "configFile": "{projectRoot}/vitest.e2e.config.ts" + } + } }, "implicitDependencies": ["cli", "ci"], "tags": ["scope:tooling", "type:e2e"] diff --git a/e2e/cli-e2e/project.json b/e2e/cli-e2e/project.json index 181dd4854..6cdabf9ae 100644 --- a/e2e/cli-e2e/project.json +++ b/e2e/cli-e2e/project.json @@ -3,10 +3,15 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "e2e/cli-e2e/src", "projectType": "application", - "tags": ["scope:core", "scope:plugin", "type:e2e"], - "implicitDependencies": ["cli"], "targets": { "lint": {}, - "e2e": {} - } + "e2e": { + "executor": "@nx/vite:test", + "options": { + "configFile": "{projectRoot}/vitest.e2e.config.ts" + } + } + }, + "implicitDependencies": ["cli"], + "tags": ["scope:core", "scope:plugin", "type:e2e"] } diff --git a/e2e/create-cli-e2e/project.json b/e2e/create-cli-e2e/project.json index aad7d6f5f..bf0b88071 100644 --- a/e2e/create-cli-e2e/project.json +++ b/e2e/create-cli-e2e/project.json @@ -3,10 +3,16 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "examples/create-cli-e2e/src", "projectType": "application", - "tags": ["scope:tooling", "type:e2e"], - "implicitDependencies": ["create-cli"], "targets": { "lint": {}, - "e2e": {} - } + "e2e": { + "executor": "@nx/vite:test", + "options": { + "keepServerRunning": true, + "configFile": "{projectRoot}/vitest.e2e.config.ts" + } + } + }, + "implicitDependencies": ["create-cli"], + "tags": ["scope:tooling", "type:e2e"] } diff --git a/e2e/nx-plugin-e2e/project.json b/e2e/nx-plugin-e2e/project.json index 1c7d2a00f..f569a465f 100644 --- a/e2e/nx-plugin-e2e/project.json +++ b/e2e/nx-plugin-e2e/project.json @@ -3,10 +3,15 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "e2e/nx-plugin-e2e/src", "projectType": "application", - "tags": ["scope:tooling", "type:e2e"], - "implicitDependencies": ["test-utils", "nx-plugin"], "targets": { "lint": {}, - "e2e": {} - } + "e2e": { + "executor": "@nx/vite:test", + "options": { + "configFile": "{projectRoot}/vitest.e2e.config.ts" + } + } + }, + "implicitDependencies": ["test-utils", "nx-plugin"], + "tags": ["scope:tooling", "type:e2e"] } diff --git a/e2e/plugin-coverage-e2e/project.json b/e2e/plugin-coverage-e2e/project.json index f8a9e46e9..ca5b5b3fd 100644 --- a/e2e/plugin-coverage-e2e/project.json +++ b/e2e/plugin-coverage-e2e/project.json @@ -3,10 +3,15 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "e2e/plugin-coverage-e2e/src", "projectType": "application", - "tags": ["scope:plugin", "type:e2e"], - "implicitDependencies": ["cli", "plugin-coverage"], "targets": { "lint": {}, - "e2e": {} - } + "e2e": { + "executor": "@nx/vite:test", + "options": { + "configFile": "{projectRoot}/vitest.e2e.config.ts" + } + } + }, + "implicitDependencies": ["cli", "plugin-coverage"], + "tags": ["scope:plugin", "type:e2e"] } diff --git a/e2e/plugin-eslint-e2e/project.json b/e2e/plugin-eslint-e2e/project.json index 82e3ff70b..c4000be23 100644 --- a/e2e/plugin-eslint-e2e/project.json +++ b/e2e/plugin-eslint-e2e/project.json @@ -3,10 +3,15 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "e2e/plugin-eslint-e2e/src", "projectType": "application", - "tags": ["scope:plugin", "type:e2e"], - "implicitDependencies": ["cli", "plugin-eslint"], "targets": { "lint": {}, - "e2e": {} - } + "e2e": { + "executor": "@nx/vite:test", + "options": { + "configFile": "{projectRoot}/vitest.e2e.config.ts" + } + } + }, + "implicitDependencies": ["cli", "plugin-eslint"], + "tags": ["scope:plugin", "type:e2e"] } diff --git a/e2e/plugin-js-packages-e2e/project.json b/e2e/plugin-js-packages-e2e/project.json index d1aaaaf01..5c6382c06 100644 --- a/e2e/plugin-js-packages-e2e/project.json +++ b/e2e/plugin-js-packages-e2e/project.json @@ -3,10 +3,15 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "sourceRoot": "e2e/plugin-js-packages-e2e/src", - "tags": ["scope:plugin", "type:e2e"], "implicitDependencies": ["cli", "plugin-js-packages"], "targets": { "lint": {}, - "e2e": {} - } + "e2e": { + "executor": "@nx/vite:test", + "options": { + "configFile": "{projectRoot}/vitest.e2e.config.ts" + } + } + }, + "tags": ["scope:plugin", "type:e2e"] } diff --git a/nx.json b/nx.json index 816ba1b5a..9fa2bacf6 100644 --- a/nx.json +++ b/nx.json @@ -39,11 +39,7 @@ } }, "e2e": { - "dependsOn": ["^build"], - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.e2e.config.ts" - } + "dependsOn": ["^build"] }, "lint": { "inputs": ["default", "{workspaceRoot}/eslint.config.?(c)js"], From 3541c80eb3e8e3e5906d4301184183da5d7865da Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Aug 2025 04:13:12 +0200 Subject: [PATCH 09/15] chore: refine preset 2 --- code-pushup.preset.ts | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/code-pushup.preset.ts b/code-pushup.preset.ts index 15ba02ccc..a1551a4b9 100644 --- a/code-pushup.preset.ts +++ b/code-pushup.preset.ts @@ -11,9 +11,8 @@ import eslintPlugin, { eslintConfigFromNxProject, } from './packages/plugin-eslint/src/index.js'; import jsPackagesPlugin from './packages/plugin-js-packages/src/index.js'; -import jsDocsPlugin, { - JsDocsPluginConfig, -} from './packages/plugin-jsdocs/src/index.js'; +import jsDocsPlugin from './packages/plugin-jsdocs/src/index.js'; +import type { JsDocsPluginTransformedConfig } from './packages/plugin-jsdocs/src/lib/config.js'; import { PLUGIN_SLUG, groups, @@ -98,7 +97,7 @@ export const eslintCategories: CategoryConfig[] = [ ]; export function getJsDocsCategories( - config: JsDocsPluginConfig, + config: JsDocsPluginTransformedConfig, ): CategoryConfig[] { return [ { @@ -147,7 +146,7 @@ export const lighthouseCoreConfig = async ( }; export const jsDocsCoreConfig = ( - config: JsDocsPluginConfig | string[], + config: JsDocsPluginTransformedConfig | string[], ): CoreConfig => ({ plugins: [ jsDocsPlugin(Array.isArray(config) ? { patterns: config } : config), @@ -180,9 +179,6 @@ export const typescriptPluginConfig = async ( export const coverageCoreConfigNx = async ( projectName?: string, ): Promise => { - if (projectName) { - throw new Error('coverageCoreConfigNx for single projects not implemented'); - } const targetNames = ['unit-test', 'int-test']; const targetArgs = [ '-t', @@ -195,13 +191,18 @@ export const coverageCoreConfigNx = async ( await coveragePlugin({ coverageToolCommand: { command: 'npx', - args: [ - 'nx', - projectName ? `run --project ${projectName}` : 'run-many', - ...targetArgs, - ], + args: projectName + ? ['nx', 'run-many', '-p', projectName, ...targetArgs] + : ['nx', 'run-many', ...targetArgs], }, - reports: await getNxCoveragePaths(targetNames), + reports: projectName + ? [ + { + pathToProject: `packages/${projectName}`, + resultsPath: `packages/${projectName}/coverage/lcov.info`, + }, + ] + : await getNxCoveragePaths(targetNames), }), ], categories: coverageCategories, From 61eb942f940658ef9b5a37729161cc788d93dab1 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Aug 2025 17:10:36 +0200 Subject: [PATCH 10/15] chore: adjust int-test targets --- packages/ci/project.json | 12 +----------- packages/cli/project.json | 12 +----------- packages/core/project.json | 12 +----------- packages/create-cli/project.json | 12 +----------- packages/models/project.json | 8 +------- packages/nx-plugin/project.json | 12 +----------- packages/plugin-coverage/project.json | 12 +----------- packages/plugin-eslint/project.json | 12 +----------- packages/plugin-js-packages/project.json | 12 +----------- packages/plugin-jsdocs/project.json | 12 +----------- packages/plugin-lighthouse/project.json | 12 +----------- packages/plugin-typescript/project.json | 12 +----------- packages/utils/project.json | 12 +----------- 13 files changed, 13 insertions(+), 139 deletions(-) diff --git a/packages/ci/project.json b/packages/ci/project.json index 0b514dee8..9215f87b3 100644 --- a/packages/ci/project.json +++ b/packages/ci/project.json @@ -7,17 +7,7 @@ "build": {}, "lint": {}, "unit-test": {}, - "int-test": { - "cache": true, - "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.int.config.ts", - "coverage": { - "enabled": true - } - } - } + "int-test": {} }, "tags": ["scope:tooling", "type:feature", "publishable"] } diff --git a/packages/cli/project.json b/packages/cli/project.json index 1de7d070f..bc3b384a7 100644 --- a/packages/cli/project.json +++ b/packages/cli/project.json @@ -7,17 +7,7 @@ "build": {}, "lint": {}, "unit-test": {}, - "int-test": { - "cache": true, - "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.int.config.ts", - "coverage": { - "enabled": true - } - } - }, + "int-test": {}, "run-help": { "command": "npx dist/packages/cli --help", "dependsOn": ["build"] diff --git a/packages/core/project.json b/packages/core/project.json index f543a6579..4924717c5 100644 --- a/packages/core/project.json +++ b/packages/core/project.json @@ -7,17 +7,7 @@ "build": {}, "lint": {}, "unit-test": {}, - "int-test": { - "cache": true, - "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.int.config.ts", - "coverage": { - "enabled": true - } - } - } + "int-test": {} }, "tags": ["scope:core", "type:feature", "publishable"] } diff --git a/packages/create-cli/project.json b/packages/create-cli/project.json index 77c2af03d..2e7544e59 100644 --- a/packages/create-cli/project.json +++ b/packages/create-cli/project.json @@ -7,17 +7,7 @@ "build": {}, "lint": {}, "unit-test": {}, - "int-test": { - "cache": true, - "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.int.config.ts", - "coverage": { - "enabled": true - } - } - }, + "int-test": {}, "exec-node": { "dependsOn": ["build"], "command": "node ./dist/packages/create-cli/src/index.js", diff --git a/packages/models/project.json b/packages/models/project.json index 9e8ff7b11..1d4453151 100644 --- a/packages/models/project.json +++ b/packages/models/project.json @@ -20,13 +20,7 @@ "lint": {}, "unit-test": {}, "int-test": { - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.int.config.ts", - "coverage": { - "enabled": true - } - } + "options": {} } }, "tags": ["scope:shared", "type:util", "publishable"] diff --git a/packages/nx-plugin/project.json b/packages/nx-plugin/project.json index 4d3763b49..52c8f2290 100644 --- a/packages/nx-plugin/project.json +++ b/packages/nx-plugin/project.json @@ -42,17 +42,7 @@ } }, "unit-test": {}, - "int-test": { - "cache": true, - "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.int.config.ts", - "coverage": { - "enabled": true - } - } - } + "int-test": {} }, "tags": ["scope:tooling", "type:feature", "publishable"] } diff --git a/packages/plugin-coverage/project.json b/packages/plugin-coverage/project.json index f2188a633..edb62346f 100644 --- a/packages/plugin-coverage/project.json +++ b/packages/plugin-coverage/project.json @@ -7,17 +7,7 @@ "build": {}, "lint": {}, "unit-test": {}, - "int-test": { - "cache": true, - "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.int.config.ts", - "coverage": { - "enabled": true - } - } - } + "int-test": {} }, "tags": ["scope:plugin", "type:feature", "publishable"] } diff --git a/packages/plugin-eslint/project.json b/packages/plugin-eslint/project.json index 3d8cb9a6c..241101850 100644 --- a/packages/plugin-eslint/project.json +++ b/packages/plugin-eslint/project.json @@ -7,17 +7,7 @@ "build": {}, "lint": {}, "unit-test": {}, - "int-test": { - "cache": true, - "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.int.config.ts", - "coverage": { - "enabled": true - } - } - } + "int-test": {} }, "tags": ["scope:plugin", "type:feature", "publishable"] } diff --git a/packages/plugin-js-packages/project.json b/packages/plugin-js-packages/project.json index 0c084d3ca..9f0dc7789 100644 --- a/packages/plugin-js-packages/project.json +++ b/packages/plugin-js-packages/project.json @@ -7,17 +7,7 @@ "build": {}, "lint": {}, "unit-test": {}, - "int-test": { - "cache": true, - "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.int.config.ts", - "coverage": { - "enabled": true - } - } - } + "int-test": {} }, "tags": ["scope:plugin", "type:feature", "publishable"], "description": "A plugin for JavaScript packages." diff --git a/packages/plugin-jsdocs/project.json b/packages/plugin-jsdocs/project.json index fbb7ea361..745540438 100644 --- a/packages/plugin-jsdocs/project.json +++ b/packages/plugin-jsdocs/project.json @@ -8,16 +8,6 @@ "build": {}, "lint": {}, "unit-test": {}, - "int-test": { - "cache": true, - "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.int.config.ts", - "coverage": { - "enabled": true - } - } - } + "int-test": {} } } diff --git a/packages/plugin-lighthouse/project.json b/packages/plugin-lighthouse/project.json index f664a4ce1..5c639347b 100644 --- a/packages/plugin-lighthouse/project.json +++ b/packages/plugin-lighthouse/project.json @@ -7,17 +7,7 @@ "build": {}, "lint": {}, "unit-test": {}, - "int-test": { - "cache": true, - "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.int.config.ts", - "coverage": { - "enabled": true - } - } - } + "int-test": {} }, "tags": ["scope:plugin", "type:feature", "publishable"] } diff --git a/packages/plugin-typescript/project.json b/packages/plugin-typescript/project.json index 10549bd1a..645259554 100644 --- a/packages/plugin-typescript/project.json +++ b/packages/plugin-typescript/project.json @@ -7,17 +7,7 @@ "build": {}, "lint": {}, "unit-test": {}, - "int-test": { - "cache": true, - "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.int.config.ts", - "coverage": { - "enabled": true - } - } - } + "int-test": {} }, "tags": ["scope:plugin", "type:feature", "publishable"] } diff --git a/packages/utils/project.json b/packages/utils/project.json index ebcfe1c4a..021205deb 100644 --- a/packages/utils/project.json +++ b/packages/utils/project.json @@ -19,17 +19,7 @@ } }, "unit-test": {}, - "int-test": { - "cache": true, - "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.int.config.ts", - "coverage": { - "enabled": true - } - } - } + "int-test": {} }, "tags": ["scope:shared", "type:util", "publishable"] } From 5b75d06fd6e34a8dc5322161a66a4355075c0de1 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Aug 2025 17:14:32 +0200 Subject: [PATCH 11/15] chore: adjust int-test target --- examples/plugins/project.json | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/examples/plugins/project.json b/examples/plugins/project.json index 8f784340b..1370e0782 100644 --- a/examples/plugins/project.json +++ b/examples/plugins/project.json @@ -7,17 +7,7 @@ "build": {}, "lint": {}, "unit-test": {}, - "int-test": { - "cache": true, - "outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"], - "executor": "@nx/vite:test", - "options": { - "configFile": "{projectRoot}/vitest.int.config.ts", - "coverage": { - "enabled": true - } - } - }, + "int-test": {}, "run-collect": { "command": "npx dist/packages/cli collect --config=examples/plugins/code-pushup.config.ts --persist.format=md", "dependsOn": [ From 867b3c690b774020eba00f749489b2528acb15bc Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Aug 2025 17:43:25 +0200 Subject: [PATCH 12/15] chore: remove int-target as no int tests available --- packages/create-cli/project.json | 1 - packages/create-cli/vitest.int.config.ts | 29 ------------------------ 2 files changed, 30 deletions(-) delete mode 100644 packages/create-cli/vitest.int.config.ts diff --git a/packages/create-cli/project.json b/packages/create-cli/project.json index 2e7544e59..c2bc6ef60 100644 --- a/packages/create-cli/project.json +++ b/packages/create-cli/project.json @@ -7,7 +7,6 @@ "build": {}, "lint": {}, "unit-test": {}, - "int-test": {}, "exec-node": { "dependsOn": ["build"], "command": "node ./dist/packages/create-cli/src/index.js", diff --git a/packages/create-cli/vitest.int.config.ts b/packages/create-cli/vitest.int.config.ts deleted file mode 100644 index 2495fbe9c..000000000 --- a/packages/create-cli/vitest.int.config.ts +++ /dev/null @@ -1,29 +0,0 @@ -/// -import { defineConfig } from 'vite'; -import { tsconfigPathAliases } from '../../tools/vitest-tsconfig-path-aliases.js'; - -export default defineConfig({ - cacheDir: '../../node_modules/.vite/create-cli', - test: { - reporters: ['basic'], - globals: true, - cache: { - dir: '../../node_modules/.vitest', - }, - alias: tsconfigPathAliases(), - pool: 'threads', - poolOptions: { threads: { singleThread: true } }, - coverage: { - reporter: ['text', 'lcov'], - reportsDirectory: '../../coverage/create-cli/int-tests', - exclude: ['mocks/**', '**/types.ts'], - }, - environment: 'node', - include: ['src/**/*.int.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], - globalSetup: ['../../global-setup.ts'], - setupFiles: [ - '../../testing/test-setup/src/lib/console.mock.ts', - '../../testing/test-setup/src/lib/reset.mocks.ts', - ], - }, -}); From 88e43d59d63dd7e7f5ec9a298d56d502b69ed9b4 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Aug 2025 17:47:24 +0200 Subject: [PATCH 13/15] chore: add passWithNoTests:true to all test configs --- nx.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nx.json b/nx.json index e998706a8..99e48af53 100644 --- a/nx.json +++ b/nx.json @@ -22,6 +22,7 @@ "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.unit.config.ts", + "passWithNoTests": true, "coverage": { "enabled": true } @@ -33,6 +34,7 @@ "executor": "@nx/vite:test", "options": { "configFile": "{projectRoot}/vitest.int.config.ts", + "passWithNoTests": true, "coverage": { "enabled": true } From bdb7f021695d27568f52491bf75a4abe4dea5352 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Aug 2025 17:52:42 +0200 Subject: [PATCH 14/15] chore: remove unused int test config from models and plugin-lighthouse --- packages/models/project.json | 5 +--- packages/models/vitest.int.config.ts | 29 ------------------ packages/plugin-lighthouse/project.json | 3 +- .../plugin-lighthouse/vitest.int.config.ts | 30 ------------------- 4 files changed, 2 insertions(+), 65 deletions(-) delete mode 100644 packages/models/vitest.int.config.ts delete mode 100644 packages/plugin-lighthouse/vitest.int.config.ts diff --git a/packages/models/project.json b/packages/models/project.json index 1d4453151..15981781f 100644 --- a/packages/models/project.json +++ b/packages/models/project.json @@ -18,10 +18,7 @@ ] }, "lint": {}, - "unit-test": {}, - "int-test": { - "options": {} - } + "unit-test": {} }, "tags": ["scope:shared", "type:util", "publishable"] } diff --git a/packages/models/vitest.int.config.ts b/packages/models/vitest.int.config.ts deleted file mode 100644 index fc651cceb..000000000 --- a/packages/models/vitest.int.config.ts +++ /dev/null @@ -1,29 +0,0 @@ -/// -import { defineConfig } from 'vite'; -import { tsconfigPathAliases } from '../../tools/vitest-tsconfig-path-aliases.js'; - -export default defineConfig({ - cacheDir: '../../node_modules/.vite/models', - test: { - reporters: ['basic'], - globals: true, - cache: { - dir: '../../node_modules/.vitest', - }, - alias: tsconfigPathAliases(), - pool: 'threads', - poolOptions: { threads: { singleThread: true } }, - coverage: { - reporter: ['text', 'lcov'], - reportsDirectory: '../../coverage/models/int-tests', - exclude: ['mocks/**', '**/types.ts', 'zod2md.config.ts'], - }, - environment: 'node', - include: ['src/**/*.int.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], - globalSetup: ['../../global-setup.ts'], - setupFiles: [ - '../../testing/test-setup/src/lib/console.mock.ts', - '../../testing/test-setup/src/lib/reset.mocks.ts', - ], - }, -}); diff --git a/packages/plugin-lighthouse/project.json b/packages/plugin-lighthouse/project.json index 5c639347b..b93152ffb 100644 --- a/packages/plugin-lighthouse/project.json +++ b/packages/plugin-lighthouse/project.json @@ -6,8 +6,7 @@ "targets": { "build": {}, "lint": {}, - "unit-test": {}, - "int-test": {} + "unit-test": {} }, "tags": ["scope:plugin", "type:feature", "publishable"] } diff --git a/packages/plugin-lighthouse/vitest.int.config.ts b/packages/plugin-lighthouse/vitest.int.config.ts deleted file mode 100644 index 6d7eae79b..000000000 --- a/packages/plugin-lighthouse/vitest.int.config.ts +++ /dev/null @@ -1,30 +0,0 @@ -/// -import { defineConfig } from 'vite'; -import { tsconfigPathAliases } from '../../tools/vitest-tsconfig-path-aliases.js'; - -export default defineConfig({ - cacheDir: '../../node_modules/.vite/plugin-lighthouse', - test: { - reporters: ['basic'], - globals: true, - cache: { - dir: '../../node_modules/.vitest', - }, - alias: tsconfigPathAliases(), - pool: 'threads', - poolOptions: { threads: { singleThread: true } }, - coverage: { - reporter: ['text', 'lcov'], - reportsDirectory: '../../coverage/plugin-lighthouse/int-tests', - exclude: ['mocks/**', '**/types.ts'], - }, - environment: 'node', - include: ['src/**/*.int.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], - globalSetup: ['../../global-setup.ts'], - setupFiles: [ - '../../testing/test-setup/src/lib/cliui.mock.ts', - '../../testing/test-setup/src/lib/reset.mocks.ts', - '../../testing/test-setup/src/lib/chrome-path.mock.ts', - ], - }, -}); From 95651288da4eb54eeb82734e2d00d404718942b6 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Aug 2025 18:21:47 +0200 Subject: [PATCH 15/15] chore: adjust preset --- code-pushup.preset.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/code-pushup.preset.ts b/code-pushup.preset.ts index a1551a4b9..af7633ea9 100644 --- a/code-pushup.preset.ts +++ b/code-pushup.preset.ts @@ -180,12 +180,7 @@ export const coverageCoreConfigNx = async ( projectName?: string, ): Promise => { const targetNames = ['unit-test', 'int-test']; - const targetArgs = [ - '-t', - ...targetNames, - '--coverage.enabled', - '--skipNxCache', - ]; + const targetArgs = ['-t', ...targetNames]; return { plugins: [ await coveragePlugin({