From af03043249c9a5480c4a245a6be20fa399b44412 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Mon, 8 Dec 2025 19:27:29 +0100 Subject: [PATCH 01/10] refactor: test new action --- .github/workflows/new-ci.yml | 145 +++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 .github/workflows/new-ci.yml diff --git a/.github/workflows/new-ci.yml b/.github/workflows/new-ci.yml new file mode 100644 index 0000000..4978505 --- /dev/null +++ b/.github/workflows/new-ci.yml @@ -0,0 +1,145 @@ +name: CI New + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + NX_NON_NATIVE_HASHER: true + +jobs: + format: + runs-on: ubuntu-latest + name: Format check + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v4 + - name: Install dependencies + run: npm ci + - name: Check formatting of affected files + run: npx nx format:check + + lint: + runs-on: ubuntu-latest + name: Linter + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v4 + - name: Install dependencies + run: npm ci + - name: Lint affected projects + run: npx nx affected -t lint --parallel=3 + + unit-test: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + name: Unit tests + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v4 + - name: Install dependencies + run: npm ci + - name: Unit test affected projects + run: npx nx affected -t unit-test --parallel=3 + + integration-test: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + name: Integration tests + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v4 + - name: Install dependencies + run: npm ci + - name: Integration test affected projects + run: npx nx affected -t int-test --parallel=3 + + e2e: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + name: E2E tests + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v4 + - name: Install dependencies + run: npm ci + - name: E2E test affected projects + run: npx nx affected -t e2e-test --parallel=1 + + build: + runs-on: ubuntu-latest + name: Build + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v4 + - name: Install dependencies + run: npm ci + - name: Build all projects # affected is not used to be able to test-releae packages + run: npx nx run-many --target=build --parallel=3 + - name: Test-release packages + run: npx pkg-pr-new publish "packages/**/dist" From 154a00f34b662bd00d98ebb71192b51c291e358f Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Mon, 8 Dec 2025 19:30:29 +0100 Subject: [PATCH 02/10] refactor: add pkg-new --- package-lock.json | 567 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 3 +- 2 files changed, 566 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4df43ee..ed49ff7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,6 +62,7 @@ "jest-util": "30.0.5", "jiti": "2.4.2", "nx": "22.1.3", + "pkg-pr-new": "^0.0.62", "prettier": "^3.3.2", "rollup": "^4.14.0", "ts-jest": "29.4.6", @@ -79,6 +80,45 @@ "@nx/nx-linux-x64-gnu": "16.7.4" } }, + "node_modules/@actions/core": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", + "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@actions/exec": "^1.1.1", + "@actions/http-client": "^2.0.1" + } + }, + "node_modules/@actions/exec": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", + "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@actions/io": "^1.0.1" + } + }, + "node_modules/@actions/http-client": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", + "integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tunnel": "^0.0.6", + "undici": "^5.25.4" + } + }, + "node_modules/@actions/io": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", + "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -3442,6 +3482,16 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/@graphql-typed-document-node/core": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", @@ -5193,6 +5243,22 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@jsdevtools/ez-spawn": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@jsdevtools/ez-spawn/-/ez-spawn-3.0.4.tgz", + "integrity": "sha512-f5DRIOZf7wxogefH03RjMPMdBF7ADTWUMoOs9kaJo06EfwF+aFhMZMDZxHg/Xe12hptN9xoZjGso2fdjapBRIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-me-maybe": "^1.0.1", + "cross-spawn": "^7.0.3", + "string-argv": "^0.3.1", + "type-detect": "^4.0.8" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@jsonjoy.com/base64": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@jsonjoy.com/base64/-/base64-1.1.2.tgz", @@ -6083,6 +6149,288 @@ "yargs-parser": "21.1.1" } }, + "node_modules/@octokit/action": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@octokit/action/-/action-6.1.0.tgz", + "integrity": "sha512-lo+nHx8kAV86bxvOVOI3vFjX3gXPd/L7guAUbvs3pUvnR2KC+R7yjBkA1uACt4gYhs4LcWP3AXSGQzsbeN2XXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/auth-action": "^4.0.0", + "@octokit/core": "^5.0.0", + "@octokit/plugin-paginate-rest": "^9.0.0", + "@octokit/plugin-rest-endpoint-methods": "^10.0.0", + "@octokit/types": "^12.0.0", + "undici": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/action/node_modules/undici": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.22.0.tgz", + "integrity": "sha512-hU/10obOIu62MGYjdskASR3CUAiYaFTtC9Pa6vHyf//mAipSvSQg6od2CnJswq7fvzNS3zJhxoRkgNVaHurWKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.17" + } + }, + "node_modules/@octokit/auth-action": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-action/-/auth-action-4.1.0.tgz", + "integrity": "sha512-m+3t7K46IYyMk7Bl6/lF4Rv09GqDZjYmNg8IWycJ2Fa3YE3DE7vQcV6G2hUPmR9NDqenefNJwVtlisMjzymPiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/auth-token": "^4.0.0", + "@octokit/types": "^13.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/auth-action/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/auth-action/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/auth-token": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/core": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.2.2.tgz", + "integrity": "sha512-/g2d4sW9nUDJOMz3mabVQvOGhVa4e/BN/Um7yca9Bb2XTzPPnfTWHWQg+IsEYO7M3Vx+EXvaM/I2pJWIMun1bg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/auth-token": "^4.0.0", + "@octokit/graphql": "^7.1.0", + "@octokit/request": "^8.4.1", + "@octokit/request-error": "^5.1.1", + "@octokit/types": "^13.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/core/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/core/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/endpoint": { + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.6.tgz", + "integrity": "sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^13.1.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/endpoint/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/endpoint/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/graphql": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.1.1.tgz", + "integrity": "sha512-3mkDltSfcDUoa176nlGoA32RGjeWjl3K7F/BwHwRMJUW/IteSa4bnSV8p2ThNkcIcZU2umkZWxwETSSCJf2Q7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/request": "^8.4.1", + "@octokit/types": "^13.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/graphql/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/graphql/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.2.2.tgz", + "integrity": "sha512-u3KYkGF7GcZnSD/3UP0S7K5XUFT2FkOQdcfXZGZQPGv3lm4F2Xbf71lvjldr8c1H3nNbF+33cLEkWYbokGWqiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^12.6.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": "5" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-10.4.1.tgz", + "integrity": "sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^12.6.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": "5" + } + }, + "node_modules/@octokit/request": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.1.tgz", + "integrity": "sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/endpoint": "^9.0.6", + "@octokit/request-error": "^5.1.1", + "@octokit/types": "^13.1.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/request-error": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.1.tgz", + "integrity": "sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^13.1.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/request-error/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/request-error/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/request/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/request/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/types": { + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^20.0.0" + } + }, "node_modules/@phenomnomnominal/tsquery": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-5.0.1.tgz", @@ -9137,6 +9485,13 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, + "node_modules/before-after-hook": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/bin-version": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/bin-version/-/bin-version-6.0.0.tgz", @@ -9420,6 +9775,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/call-me-maybe": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", + "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", + "dev": true, + "license": "MIT" + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -10323,6 +10685,16 @@ "devOptional": true, "license": "MIT" }, + "node_modules/decode-uri-component": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.4.1.tgz", + "integrity": "sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + } + }, "node_modules/decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", @@ -10479,6 +10851,13 @@ "node": ">=0.4.0" } }, + "node_modules/deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true, + "license": "ISC" + }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -12054,6 +12433,19 @@ "node": ">=8" } }, + "node_modules/filter-obj": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-5.1.0.tgz", + "integrity": "sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/find-cache-dir": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", @@ -13744,6 +14136,19 @@ "license": "MIT", "peer": true }, + "node_modules/isbinaryfile": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-5.0.7.tgz", + "integrity": "sha512-gnWD14Jh3FzS3CPhF0AxNOJ8CxqeblPTADzI38r0wt8ZyQl5edpy75myt08EG2oKvpyiqSqsx+Wkz9vtkbTqYQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/gjtorikian/" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -19358,6 +19763,26 @@ "node": ">=8" } }, + "node_modules/pkg-pr-new": { + "version": "0.0.62", + "resolved": "https://registry.npmjs.org/pkg-pr-new/-/pkg-pr-new-0.0.62.tgz", + "integrity": "sha512-K2jtf1PLCJJFDimQIpasPXDdnRTZSYPy36Ldz+QhMpLz2YN1Wi0ZQkomVt5Wi3NdBZcYuYGXekyFWfJ6fAHYjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@actions/core": "^1.11.1", + "@jsdevtools/ez-spawn": "^3.0.4", + "@octokit/action": "^6.1.0", + "ignore": "^5.3.1", + "isbinaryfile": "^5.0.2", + "pkg-types": "^1.1.1", + "query-registry": "^3.0.1", + "tinyglobby": "^0.2.9" + }, + "bin": { + "pkg-pr-new": "bin/cli.js" + } + }, "node_modules/pkg-types": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.0.tgz", @@ -20143,6 +20568,65 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/query-registry": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/query-registry/-/query-registry-3.0.1.tgz", + "integrity": "sha512-M9RxRITi2mHMVPU5zysNjctUT8bAPx6ltEXo/ir9+qmiM47Y7f0Ir3+OxUO5OjYAWdicBQRew7RtHtqUXydqlg==", + "dev": true, + "license": "MIT", + "dependencies": { + "query-string": "^9.0.0", + "quick-lru": "^7.0.0", + "url-join": "^5.0.0", + "validate-npm-package-name": "^5.0.1", + "zod": "^3.23.8", + "zod-package-json": "^1.0.3" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/query-registry/node_modules/quick-lru": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-7.3.0.tgz", + "integrity": "sha512-k9lSsjl36EJdK7I06v7APZCbyGT2vMTsYSRX1Q2nbYmnkBqgUhRkAuzH08Ciotteu/PLJmIF2+tti7o3C/ts2g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/query-registry/node_modules/url-join": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", + "integrity": "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/query-string": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-9.3.1.tgz", + "integrity": "sha512-5fBfMOcDi5SA9qj5jZhWAcTtDfKF5WFdd2uD9nVNlbxVv1baq65aALy6qofpNEGELHvisjjasxQp7BlM9gvMzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "decode-uri-component": "^0.4.1", + "filter-obj": "^5.1.0", + "split-on-first": "^3.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -21121,6 +21605,19 @@ "node": ">=0.10.0" } }, + "node_modules/split-on-first": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-3.0.0.tgz", + "integrity": "sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -21220,6 +21717,16 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, "node_modules/string-hash": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", @@ -22103,6 +22610,16 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -22318,6 +22835,19 @@ "through": "^2.3.8" } }, + "node_modules/undici": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz", + "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, "node_modules/undici-types": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", @@ -22376,6 +22906,13 @@ "node": ">= 0.8.0" } }, + "node_modules/universal-user-agent": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", + "dev": true, + "license": "ISC" + }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", @@ -22493,6 +23030,16 @@ "node": ">=10.12.0" } }, + "node_modules/validate-npm-package-name": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.1.tgz", + "integrity": "sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/vite": { "version": "7.2.6", "resolved": "https://registry.npmjs.org/vite/-/vite-7.2.6.tgz", @@ -24685,13 +25232,27 @@ } }, "node_modules/zod": { - "version": "3.24.1", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz", - "integrity": "sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==", + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" } }, + "node_modules/zod-package-json": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/zod-package-json/-/zod-package-json-1.2.0.tgz", + "integrity": "sha512-tamtgPM3MkP+obfO2dLr/G+nYoYkpJKmuHdYEy6IXRKfLybruoJ5NUj0lM0LxwOpC9PpoGLbll1ecoeyj43Wsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "zod": "^3.25.64" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/zod-validation-error": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-3.4.0.tgz", diff --git a/package.json b/package.json index 091a57f..6e97617 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "jest-util": "30.0.5", "jiti": "2.4.2", "nx": "22.1.3", + "pkg-pr-new": "^0.0.62", "prettier": "^3.3.2", "rollup": "^4.14.0", "ts-jest": "29.4.6", @@ -58,9 +59,9 @@ "dependencies": { "@code-pushup/cli": "^0.92.1", "@code-pushup/core": "^0.92.1", + "@code-pushup/models": "^0.92.1", "@code-pushup/portal-client": "^0.16.0", "@code-pushup/utils": "^0.92.1", - "@code-pushup/models": "^0.92.1", "@nx/devkit": "22.1.3", "@poppinss/cliui": "^6.4.1", "ansis": "^3.8.1", From 2a0d08d98dadcdb5d58bb763f36e3cb6dfd1c788 Mon Sep 17 00:00:00 2001 From: Michael Hladky <10064416+BioPhoton@users.noreply.github.com> Date: Mon, 8 Dec 2025 19:33:09 +0100 Subject: [PATCH 03/10] Potential fix for code scanning alert no. 2: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .github/workflows/new-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/new-ci.yml b/.github/workflows/new-ci.yml index 4978505..08d3287 100644 --- a/.github/workflows/new-ci.yml +++ b/.github/workflows/new-ci.yml @@ -1,4 +1,6 @@ name: CI New +permissions: + contents: read on: push: From d73234038a8fdd102d230a7a6566bc32db5fd695 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Mon, 8 Dec 2025 19:37:34 +0100 Subject: [PATCH 04/10] refactor: wip --- package-lock.json | 557 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 554 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1e1a113..65f8ea3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,6 +57,7 @@ "jest-util": "30.0.5", "jiti": "2.4.2", "nx": "21.6.9", + "pkg-pr-new": "^0.0.62", "prettier": "^3.3.2", "rollup": "^4.14.0", "ts-jest": "29.4.6", @@ -74,6 +75,45 @@ "@nx/nx-linux-x64-gnu": "16.7.4" } }, + "node_modules/@actions/core": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", + "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@actions/exec": "^1.1.1", + "@actions/http-client": "^2.0.1" + } + }, + "node_modules/@actions/exec": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", + "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@actions/io": "^1.0.1" + } + }, + "node_modules/@actions/http-client": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", + "integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tunnel": "^0.0.6", + "undici": "^5.25.4" + } + }, + "node_modules/@actions/io": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", + "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -3122,6 +3162,16 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/@graphql-typed-document-node/core": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", @@ -4875,6 +4925,22 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@jsdevtools/ez-spawn": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@jsdevtools/ez-spawn/-/ez-spawn-3.0.4.tgz", + "integrity": "sha512-f5DRIOZf7wxogefH03RjMPMdBF7ADTWUMoOs9kaJo06EfwF+aFhMZMDZxHg/Xe12hptN9xoZjGso2fdjapBRIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-me-maybe": "^1.0.1", + "cross-spawn": "^7.0.3", + "string-argv": "^0.3.1", + "type-detect": "^4.0.8" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@jsonjoy.com/base64": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@jsonjoy.com/base64/-/base64-1.1.2.tgz", @@ -7869,6 +7935,288 @@ "node": ">=8" } }, + "node_modules/@octokit/action": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@octokit/action/-/action-6.1.0.tgz", + "integrity": "sha512-lo+nHx8kAV86bxvOVOI3vFjX3gXPd/L7guAUbvs3pUvnR2KC+R7yjBkA1uACt4gYhs4LcWP3AXSGQzsbeN2XXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/auth-action": "^4.0.0", + "@octokit/core": "^5.0.0", + "@octokit/plugin-paginate-rest": "^9.0.0", + "@octokit/plugin-rest-endpoint-methods": "^10.0.0", + "@octokit/types": "^12.0.0", + "undici": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/action/node_modules/undici": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.22.0.tgz", + "integrity": "sha512-hU/10obOIu62MGYjdskASR3CUAiYaFTtC9Pa6vHyf//mAipSvSQg6od2CnJswq7fvzNS3zJhxoRkgNVaHurWKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.17" + } + }, + "node_modules/@octokit/auth-action": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-action/-/auth-action-4.1.0.tgz", + "integrity": "sha512-m+3t7K46IYyMk7Bl6/lF4Rv09GqDZjYmNg8IWycJ2Fa3YE3DE7vQcV6G2hUPmR9NDqenefNJwVtlisMjzymPiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/auth-token": "^4.0.0", + "@octokit/types": "^13.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/auth-action/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/auth-action/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/auth-token": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/core": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.2.2.tgz", + "integrity": "sha512-/g2d4sW9nUDJOMz3mabVQvOGhVa4e/BN/Um7yca9Bb2XTzPPnfTWHWQg+IsEYO7M3Vx+EXvaM/I2pJWIMun1bg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/auth-token": "^4.0.0", + "@octokit/graphql": "^7.1.0", + "@octokit/request": "^8.4.1", + "@octokit/request-error": "^5.1.1", + "@octokit/types": "^13.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/core/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/core/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/endpoint": { + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.6.tgz", + "integrity": "sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^13.1.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/endpoint/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/endpoint/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/graphql": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.1.1.tgz", + "integrity": "sha512-3mkDltSfcDUoa176nlGoA32RGjeWjl3K7F/BwHwRMJUW/IteSa4bnSV8p2ThNkcIcZU2umkZWxwETSSCJf2Q7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/request": "^8.4.1", + "@octokit/types": "^13.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/graphql/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/graphql/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.2.2.tgz", + "integrity": "sha512-u3KYkGF7GcZnSD/3UP0S7K5XUFT2FkOQdcfXZGZQPGv3lm4F2Xbf71lvjldr8c1H3nNbF+33cLEkWYbokGWqiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^12.6.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": "5" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-10.4.1.tgz", + "integrity": "sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^12.6.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": "5" + } + }, + "node_modules/@octokit/request": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.1.tgz", + "integrity": "sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/endpoint": "^9.0.6", + "@octokit/request-error": "^5.1.1", + "@octokit/types": "^13.1.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/request-error": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.1.tgz", + "integrity": "sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^13.1.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/request-error/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/request-error/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/request/node_modules/@octokit/openapi-types": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/request/node_modules/@octokit/types": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^24.2.0" + } + }, + "node_modules/@octokit/types": { + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^20.0.0" + } + }, "node_modules/@phenomnomnominal/tsquery": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-5.0.1.tgz", @@ -12129,6 +12477,13 @@ "optional": true, "peer": true }, + "node_modules/before-after-hook": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/bin-version": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/bin-version/-/bin-version-6.0.0.tgz", @@ -12524,6 +12879,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/call-me-maybe": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", + "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", + "dev": true, + "license": "MIT" + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -13387,6 +13749,16 @@ "devOptional": true, "license": "MIT" }, + "node_modules/decode-uri-component": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.4.1.tgz", + "integrity": "sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + } + }, "node_modules/decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", @@ -13558,6 +13930,13 @@ "node": ">= 0.8" } }, + "node_modules/deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true, + "license": "ISC" + }, "node_modules/destroy": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", @@ -15353,6 +15732,19 @@ "node": ">=8" } }, + "node_modules/filter-obj": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-5.1.0.tgz", + "integrity": "sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/finalhandler": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", @@ -17127,6 +17519,19 @@ "license": "MIT", "peer": true }, + "node_modules/isbinaryfile": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-5.0.7.tgz", + "integrity": "sha512-gnWD14Jh3FzS3CPhF0AxNOJ8CxqeblPTADzI38r0wt8ZyQl5edpy75myt08EG2oKvpyiqSqsx+Wkz9vtkbTqYQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/gjtorikian/" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -23175,6 +23580,26 @@ "node": ">=8" } }, + "node_modules/pkg-pr-new": { + "version": "0.0.62", + "resolved": "https://registry.npmjs.org/pkg-pr-new/-/pkg-pr-new-0.0.62.tgz", + "integrity": "sha512-K2jtf1PLCJJFDimQIpasPXDdnRTZSYPy36Ldz+QhMpLz2YN1Wi0ZQkomVt5Wi3NdBZcYuYGXekyFWfJ6fAHYjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@actions/core": "^1.11.1", + "@jsdevtools/ez-spawn": "^3.0.4", + "@octokit/action": "^6.1.0", + "ignore": "^5.3.1", + "isbinaryfile": "^5.0.2", + "pkg-types": "^1.1.1", + "query-registry": "^3.0.1", + "tinyglobby": "^0.2.9" + }, + "bin": { + "pkg-pr-new": "bin/cli.js" + } + }, "node_modules/pkg-types": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.0.tgz", @@ -23480,6 +23905,65 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/query-registry": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/query-registry/-/query-registry-3.0.1.tgz", + "integrity": "sha512-M9RxRITi2mHMVPU5zysNjctUT8bAPx6ltEXo/ir9+qmiM47Y7f0Ir3+OxUO5OjYAWdicBQRew7RtHtqUXydqlg==", + "dev": true, + "license": "MIT", + "dependencies": { + "query-string": "^9.0.0", + "quick-lru": "^7.0.0", + "url-join": "^5.0.0", + "validate-npm-package-name": "^5.0.1", + "zod": "^3.23.8", + "zod-package-json": "^1.0.3" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/query-registry/node_modules/quick-lru": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-7.3.0.tgz", + "integrity": "sha512-k9lSsjl36EJdK7I06v7APZCbyGT2vMTsYSRX1Q2nbYmnkBqgUhRkAuzH08Ciotteu/PLJmIF2+tti7o3C/ts2g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/query-registry/node_modules/url-join": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", + "integrity": "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/query-string": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-9.3.1.tgz", + "integrity": "sha512-5fBfMOcDi5SA9qj5jZhWAcTtDfKF5WFdd2uD9nVNlbxVv1baq65aALy6qofpNEGELHvisjjasxQp7BlM9gvMzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "decode-uri-component": "^0.4.1", + "filter-obj": "^5.1.0", + "split-on-first": "^3.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -24516,6 +25000,19 @@ "node": ">=0.10.0" } }, + "node_modules/split-on-first": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-3.0.0.tgz", + "integrity": "sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/split2": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", @@ -24683,6 +25180,16 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -25562,6 +26069,16 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -25829,6 +26346,19 @@ "through": "^2.3.8" } }, + "node_modules/undici": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz", + "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, "node_modules/undici-types": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", @@ -25887,6 +26417,13 @@ "node": ">= 0.8.0" } }, + "node_modules/universal-user-agent": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", + "dev": true, + "license": "ISC" + }, "node_modules/unix-crypt-td-js": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/unix-crypt-td-js/-/unix-crypt-td-js-1.1.4.tgz", @@ -28547,13 +29084,27 @@ } }, "node_modules/zod": { - "version": "3.24.1", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz", - "integrity": "sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==", + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" } }, + "node_modules/zod-package-json": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/zod-package-json/-/zod-package-json-1.2.0.tgz", + "integrity": "sha512-tamtgPM3MkP+obfO2dLr/G+nYoYkpJKmuHdYEy6IXRKfLybruoJ5NUj0lM0LxwOpC9PpoGLbll1ecoeyj43Wsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "zod": "^3.25.64" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/zod-validation-error": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-3.4.0.tgz", From 8e6fa17fbc0df1da1a2ee24b6cf8d2ae3acf8a82 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Mon, 8 Dec 2025 19:39:18 +0100 Subject: [PATCH 05/10] refactor: wip --- .github/workflows/ci.yml | 150 ++++++++++++++++++++++++++++++----- .github/workflows/new-ci.yml | 147 ---------------------------------- 2 files changed, 130 insertions(+), 167 deletions(-) delete mode 100644 .github/workflows/new-ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 117022c..3f5d85a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,37 +1,147 @@ name: CI +permissions: + contents: read on: push: - branches: - - main + branches: [main] pull_request: + branches: [main] -permissions: - actions: read - contents: read +env: + NX_NON_NATIVE_HASHER: true jobs: - main: + format: runs-on: ubuntu-latest + name: Format check steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v4 + - name: Install dependencies + run: npm ci + - name: Check formatting of affected files + run: npx nx format:check - # Connect your workspace on nx.app and uncomment this to enable task distribution. - # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested - # - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build" + lint: + runs-on: ubuntu-latest + name: Linter + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v4 + - name: Install dependencies + run: npm ci + - name: Lint affected projects + run: npx nx affected -t lint --parallel=3 - # Cache node_modules - - uses: actions/setup-node@v3 + unit-test: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + name: Unit tests + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 with: - node-version: 20 - cache: 'npm' - - run: npm ci - - uses: nrwl/nx-set-shas@v4 + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v4 + - name: Install dependencies + run: npm ci + - name: Unit test affected projects + run: npx nx affected -t unit-test --parallel=3 - - run: git branch --track main origin/main - if: ${{ github.event_name == 'pull_request' }} + integration-test: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + name: Integration tests + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v4 + - name: Install dependencies + run: npm ci + - name: Integration test affected projects + run: npx nx affected -t int-test --parallel=3 - - run: npx nx format:check - - run: npx nx affected -t lint unit-test int-test e2e-test build + e2e: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + name: E2E tests + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v4 + - name: Install dependencies + run: npm ci + - name: E2E test affected projects + run: npx nx affected -t e2e-test --parallel=1 + + build: + runs-on: ubuntu-latest + name: Build + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v4 + - name: Install dependencies + run: npm ci + - name: Build all projects # affected is not used to be able to test-releae packages + run: npx nx run-many --target=build --parallel=3 + - name: Test-release packages + run: npx pkg-pr-new publish "packages/**/dist" diff --git a/.github/workflows/new-ci.yml b/.github/workflows/new-ci.yml deleted file mode 100644 index 08d3287..0000000 --- a/.github/workflows/new-ci.yml +++ /dev/null @@ -1,147 +0,0 @@ -name: CI New -permissions: - contents: read - -on: - push: - branches: [main] - pull_request: - branches: [main] - -env: - NX_NON_NATIVE_HASHER: true - -jobs: - format: - runs-on: ubuntu-latest - name: Format check - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: npm - - name: Set base and head for Nx affected commands - uses: nrwl/nx-set-shas@v4 - - name: Install dependencies - run: npm ci - - name: Check formatting of affected files - run: npx nx format:check - - lint: - runs-on: ubuntu-latest - name: Linter - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: npm - - name: Set base and head for Nx affected commands - uses: nrwl/nx-set-shas@v4 - - name: Install dependencies - run: npm ci - - name: Lint affected projects - run: npx nx affected -t lint --parallel=3 - - unit-test: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - name: Unit tests - runs-on: ${{ matrix.os }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: npm - - name: Set base and head for Nx affected commands - uses: nrwl/nx-set-shas@v4 - - name: Install dependencies - run: npm ci - - name: Unit test affected projects - run: npx nx affected -t unit-test --parallel=3 - - integration-test: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - name: Integration tests - runs-on: ${{ matrix.os }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: npm - - name: Set base and head for Nx affected commands - uses: nrwl/nx-set-shas@v4 - - name: Install dependencies - run: npm ci - - name: Integration test affected projects - run: npx nx affected -t int-test --parallel=3 - - e2e: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - name: E2E tests - runs-on: ${{ matrix.os }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: npm - - name: Set base and head for Nx affected commands - uses: nrwl/nx-set-shas@v4 - - name: Install dependencies - run: npm ci - - name: E2E test affected projects - run: npx nx affected -t e2e-test --parallel=1 - - build: - runs-on: ubuntu-latest - name: Build - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: npm - - name: Set base and head for Nx affected commands - uses: nrwl/nx-set-shas@v4 - - name: Install dependencies - run: npm ci - - name: Build all projects # affected is not used to be able to test-releae packages - run: npx nx run-many --target=build --parallel=3 - - name: Test-release packages - run: npx pkg-pr-new publish "packages/**/dist" From d880fbe1c5fc4bf959c8ecc03e0e5c4ae7f53c4b Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Mon, 8 Dec 2025 19:46:53 +0100 Subject: [PATCH 06/10] refactor: wip --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f5d85a..961400f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,5 @@ name: CI -permissions: - contents: read + on: push: From aebd6a7c6659856cb6eb06809f4734ec3d5ba021 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Mon, 8 Dec 2025 19:48:29 +0100 Subject: [PATCH 07/10] refactor: wip --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 961400f..0a38a7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,6 @@ name: CI - +permissions: + contents: read on: push: @@ -140,7 +141,7 @@ jobs: uses: nrwl/nx-set-shas@v4 - name: Install dependencies run: npm ci - - name: Build all projects # affected is not used to be able to test-releae packages + - name: Build all projects # affected is not used to be able to test-release packages run: npx nx run-many --target=build --parallel=3 - - name: Test-release packages - run: npx pkg-pr-new publish "packages/**/dist" + #- name: Test-release packages + # run: npx pkg-pr-new publish "packages/**/dist" From 0915501efc31c9e27e5218aeccd38d393b313bfc Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Mon, 8 Dec 2025 19:56:48 +0100 Subject: [PATCH 08/10] refactor: fix unit-test for windows --- .../src/lib/reporter/reporter.unit.test.ts | 280 +++++++++--------- 1 file changed, 145 insertions(+), 135 deletions(-) diff --git a/packages/plugin-knip/src/lib/reporter/reporter.unit.test.ts b/packages/plugin-knip/src/lib/reporter/reporter.unit.test.ts index 9ee9f3c..a75b339 100644 --- a/packages/plugin-knip/src/lib/reporter/reporter.unit.test.ts +++ b/packages/plugin-knip/src/lib/reporter/reporter.unit.test.ts @@ -1,172 +1,182 @@ -import type { ReporterOptions } from 'knip'; -import type { IssueRecords, IssueSet } from 'knip/dist/types/issues'; -import { fs as memfsFs, vol } from 'memfs'; -import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type { AuditOutputs } from '@code-pushup/models'; -import { MEMFS_VOLUME } from '@code-pushup/test-utils'; -import { logger } from '@code-pushup/utils'; -import { rawReport } from '../../../mocks/fixtures/raw-knip.report'; -import { KNIP_RAW_REPORT_NAME, KNIP_REPORT_NAME } from '../constants.js'; -import { CustomReporterOptions } from './model.js'; -import { knipReporter } from './reporter.js'; +import type {ReporterOptions} from 'knip'; +import type {IssueRecords, IssueSet} from 'knip/dist/types/issues'; +import {fs as memfsFs, vol} from 'memfs'; +import {beforeEach, describe, expect, it, vi} from 'vitest'; +import type {AuditOutputs} from '@code-pushup/models'; +import {MEMFS_VOLUME} from '@code-pushup/test-utils'; +import {logger} from '@code-pushup/utils'; +import {rawReport} from '../../../mocks/fixtures/raw-knip.report'; +import {KNIP_RAW_REPORT_NAME, KNIP_REPORT_NAME} from '../constants.js'; +import {CustomReporterOptions} from './model.js'; +import {knipReporter} from './reporter.js'; vi.mock('@code-pushup/utils', async () => { - const actual = await vi.importActual('@code-pushup/utils'); - return { - ...actual, - getGitRoot: vi - .fn() - .mockResolvedValue('/Users/username/Projects/code-pushup-cli/'), - logger: { - info: vi.fn(), - error: vi.fn(), - warn: vi.fn(), - }, - }; + const actual = await vi.importActual('@code-pushup/utils'); + return { + ...actual, + getGitRoot: vi + .fn() + .mockResolvedValue('/Users/username/Projects/code-pushup-cli/'), + logger: { + info: vi.fn(), + error: vi.fn(), + warn: vi.fn(), + }, + }; }); describe('knipReporter', () => { - beforeEach(() => { - vol.reset(); - vol.fromJSON({ [MEMFS_VOLUME]: null }); - }); + beforeEach(() => { + vol.reset(); + vol.fromJSON({[MEMFS_VOLUME]: null}); + }); - it('should saves report to file system by default', async () => { - await expect( - knipReporter({ - report: { - files: true, - }, - issues: { - files: new Set(['main.js']), - }, - } as ReporterOptions), - ).resolves.toBeUndefined(); + it('should saves report to file system by default', async () => { + await expect( + knipReporter({ + report: { + files: true, + }, + issues: { + files: new Set(['main.js']), + }, + } as ReporterOptions), + ).resolves.toBeUndefined(); - expect(logger.info).not.toHaveBeenCalled(); - }); + expect(logger.info).not.toHaveBeenCalled(); + }); - it('should accept reporter option outputFile', async () => { - const outputFile = 'my-report.json'; - await expect( - knipReporter({ - report: { - files: true, - }, - issues: { - files: new Set(['main.js']), - }, - options: JSON.stringify({ outputFile } satisfies CustomReporterOptions), - } as ReporterOptions), - ).resolves.toBeUndefined(); + it('should accept reporter option outputFile', async () => { + const outputFile = 'my-report.json'; + await expect( + knipReporter({ + report: { + files: true, + }, + issues: { + files: new Set(['main.js']), + }, + options: JSON.stringify({outputFile} satisfies CustomReporterOptions), + } as ReporterOptions), + ).resolves.toBeUndefined(); - expect(logger.info).not.toHaveBeenCalled(); + expect(logger.info).not.toHaveBeenCalled(); - const auditOutputs = JSON.parse( - ( - await memfsFs.promises.readFile(outputFile, { encoding: 'utf8' }) - ).toString(), - ); - // Reporter returns all audits to match plugin configuration - expect(auditOutputs).toHaveLength(14); - expect(auditOutputs).toContainEqual( - expect.objectContaining({ slug: 'files', score: 0, value: 1 }), - ); - // Other audits should have score 1 (no issues) - expect( - auditOutputs.filter((audit: { slug: string }) => audit.slug !== 'files'), - ).toHaveLength(13); - }); + const auditOutputs = JSON.parse( + ( + await memfsFs.promises.readFile(outputFile, {encoding: 'utf8'}) + ).toString(), + ); + // Reporter returns all audits to match plugin configuration + expect(auditOutputs).toHaveLength(14); + expect(auditOutputs).toContainEqual( + expect.objectContaining({slug: 'files', score: 0, value: 1}), + ); + // Other audits should have score 1 (no issues) + expect( + auditOutputs.filter((audit: { slug: string }) => audit.slug !== 'files'), + ).toHaveLength(13); + }); - it('should accept reporter option rawOutputFile', async () => { - const rawOutputFile = KNIP_RAW_REPORT_NAME; - const fileIssueSet: IssueSet = new Set(['main.js']); - const unlistedIssueRecords: IssueRecords = { - '/User/username/code-pushup-cli/packages/utils/.eslintrc.json': { - 'jsonc-eslint-parser': { - type: 'unlisted', - symbol: 'jsonc-eslint-parser', - filePath: - '/User/username/code-pushup-cli/packages/utils/package.json', - }, - }, - }; + it('should accept reporter option rawOutputFile', async () => { + const rawOutputFile = KNIP_RAW_REPORT_NAME; + const fileIssueSet: IssueSet = new Set(['main.js']); + const unlistedIssueRecords: IssueRecords = { + '/User/username/code-pushup-cli/packages/utils/.eslintrc.json': { + 'jsonc-eslint-parser': { + type: 'unlisted', + symbol: 'jsonc-eslint-parser', + filePath: + '/User/username/code-pushup-cli/packages/utils/package.json', + }, + }, + }; - await expect( - knipReporter({ - report: { - files: true, - unlisted: true, - }, - issues: { - files: fileIssueSet, - unlisted: unlistedIssueRecords, - }, - options: JSON.stringify({ rawOutputFile }), - // other reporter options for debugging purpose - counters: { files: 1, unlisted: 1 }, - } as ReporterOptions), - ).resolves.toBeUndefined(); + await expect( + knipReporter({ + report: { + files: true, + unlisted: true, + }, + issues: { + files: fileIssueSet, + unlisted: unlistedIssueRecords, + }, + options: JSON.stringify({rawOutputFile}), + // other reporter options for debugging purpose + counters: {files: 1, unlisted: 1}, + } as ReporterOptions), + ).resolves.toBeUndefined(); - expect(logger.info).not.toHaveBeenCalled(); + expect(logger.info).not.toHaveBeenCalled(); - const rawKnipReport = JSON.parse( - ( - await memfsFs.promises.readFile(rawOutputFile, { encoding: 'utf8' }) - ).toString(), - ); - expect(rawKnipReport.report).toStrictEqual({ files: true, unlisted: true }); - expect(rawKnipReport.options).toStrictEqual({ rawOutputFile }); - expect(rawKnipReport.issues.files).toStrictEqual(['main.js']); - expect(rawKnipReport.issues.unlisted).toStrictEqual(unlistedIssueRecords); - expect(rawKnipReport.counters).toStrictEqual({ files: 1, unlisted: 1 }); - }); + const rawKnipReport = JSON.parse( + ( + await memfsFs.promises.readFile(rawOutputFile, {encoding: 'utf8'}) + ).toString(), + ); + expect(rawKnipReport.report).toStrictEqual({files: true, unlisted: true}); + expect(rawKnipReport.options).toStrictEqual({rawOutputFile}); + expect(rawKnipReport.issues.files).toStrictEqual(['main.js']); + expect(rawKnipReport.issues.unlisted).toStrictEqual({ + '/User/username/code-pushup-cli/packages/utils/.eslintrc.json': { + 'jsonc-eslint-parser': { + type: 'unlisted', + symbol: 'jsonc-eslint-parser', + filePath: expect.stringContaining('package.json') + }, + }, + }); + expect(rawKnipReport.counters).toStrictEqual({files: 1, unlisted: 1}); + }); +}); - it('should log if custom reporter option verbose is true', async () => { +it('should log if custom reporter option verbose is true', async () => { const reporterOptions: CustomReporterOptions = { - verbose: true, - outputFile: KNIP_REPORT_NAME, - rawOutputFile: KNIP_RAW_REPORT_NAME, + verbose: true, + outputFile: KNIP_REPORT_NAME, + rawOutputFile: KNIP_RAW_REPORT_NAME, }; await expect( - knipReporter({ - report: { files: true }, - issues: { files: new Set(['main.js']) }, - options: JSON.stringify(reporterOptions), - } as ReporterOptions), + knipReporter({ + report: {files: true}, + issues: {files: new Set(['main.js'])}, + options: JSON.stringify(reporterOptions), + } as ReporterOptions), ).resolves.toBeUndefined(); expect(logger.info).toHaveBeenCalledTimes(3); expect(logger.info).toHaveBeenNthCalledWith( - 1, - `Reporter called with options: ${JSON.stringify( - reporterOptions, - null, - 2, - )}`, + 1, + `Reporter called with options: ${JSON.stringify( + reporterOptions, + null, + 2, + )}`, ); expect(logger.info).toHaveBeenNthCalledWith( - 2, - `Saved raw report to ${reporterOptions.rawOutputFile}`, + 2, + `Saved raw report to ${reporterOptions.rawOutputFile}`, ); expect(logger.info).toHaveBeenNthCalledWith( - 3, - `Saved report to ${reporterOptions.outputFile}`, + 3, + `Saved report to ${reporterOptions.outputFile}`, ); - }); +}); - it('should produce valid audit outputs', async () => { +it('should produce valid audit outputs', async () => { await expect( - knipReporter(rawReport as ReporterOptions), + knipReporter(rawReport as ReporterOptions), ).resolves.toBeUndefined(); const auditOutputsContent = await memfsFs.promises.readFile( - 'knip-report.json', - { encoding: 'utf8' }, + 'knip-report.json', + {encoding: 'utf8'}, ); const auditOutputsJson = JSON.parse( - auditOutputsContent.toString(), + auditOutputsContent.toString(), ) as AuditOutputs; expect(auditOutputsJson).toMatchSnapshot(); - }); }); +}) +; From 94d48fbb34381c0582152bc5e8e623cf83066886 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Tue, 9 Dec 2025 16:08:12 +0100 Subject: [PATCH 09/10] refactor: wip --- .../tests/knip-reporter.e2e.test.ts | 5 +- e2e/plugin-knip-e2e/tsconfig.test.json | 3 +- .../src/lib/reporter/reporter.unit.test.ts | 95 +++++++++---------- packages/plugin-knip/tsconfig.test.json | 3 +- 4 files changed, 53 insertions(+), 53 deletions(-) diff --git a/e2e/plugin-knip-e2e/tests/knip-reporter.e2e.test.ts b/e2e/plugin-knip-e2e/tests/knip-reporter.e2e.test.ts index 745e099..4a63ed2 100644 --- a/e2e/plugin-knip-e2e/tests/knip-reporter.e2e.test.ts +++ b/e2e/plugin-knip-e2e/tests/knip-reporter.e2e.test.ts @@ -44,8 +44,7 @@ describe('knip reporter for code pushup audits', () => { 'knip', '--no-exit-code', `--reporter=${reporterPath}`, - /* eslint-disable-next-line unicorn/prefer-string-raw */ - `--reporter-options={\\"outputFile\\":\\"knip-report.json\\"}`, + `--reporter-options=${JSON.stringify(JSON.stringify({ outputFile: 'knip-report.json' }))}`, ], cwd: reporterSetupDir, }); @@ -66,7 +65,7 @@ describe('knip reporter for code pushup audits', () => { message: 'Unused dependency zod', severity: 'error', source: { - file: expect.stringContaining('package.json'), + file: expect.pathToEndWith('package.json'), position: { startColumn: 6, startLine: 4, diff --git a/e2e/plugin-knip-e2e/tsconfig.test.json b/e2e/plugin-knip-e2e/tsconfig.test.json index c212b68..a56a1a3 100644 --- a/e2e/plugin-knip-e2e/tsconfig.test.json +++ b/e2e/plugin-knip-e2e/tsconfig.test.json @@ -9,6 +9,7 @@ "vitest.e2e.config.ts", "tests/**/*.e2e.test.ts", "tests/**/*.d.ts", - "mocks/**/*.ts" + "mocks/**/*.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/packages/plugin-knip/src/lib/reporter/reporter.unit.test.ts b/packages/plugin-knip/src/lib/reporter/reporter.unit.test.ts index a75b339..c594287 100644 --- a/packages/plugin-knip/src/lib/reporter/reporter.unit.test.ts +++ b/packages/plugin-knip/src/lib/reporter/reporter.unit.test.ts @@ -123,60 +123,59 @@ describe('knipReporter', () => { 'jsonc-eslint-parser': { type: 'unlisted', symbol: 'jsonc-eslint-parser', - filePath: expect.stringContaining('package.json') + filePath: expect.pathToEndWith('package.json') }, }, }); expect(rawKnipReport.counters).toStrictEqual({files: 1, unlisted: 1}); }); -}); -it('should log if custom reporter option verbose is true', async () => { - const reporterOptions: CustomReporterOptions = { - verbose: true, - outputFile: KNIP_REPORT_NAME, - rawOutputFile: KNIP_RAW_REPORT_NAME, - }; - await expect( - knipReporter({ - report: {files: true}, - issues: {files: new Set(['main.js'])}, - options: JSON.stringify(reporterOptions), - } as ReporterOptions), - ).resolves.toBeUndefined(); - - expect(logger.info).toHaveBeenCalledTimes(3); - expect(logger.info).toHaveBeenNthCalledWith( - 1, - `Reporter called with options: ${JSON.stringify( - reporterOptions, - null, + it('should log if custom reporter option verbose is true', async () => { + const reporterOptions: CustomReporterOptions = { + verbose: true, + outputFile: KNIP_REPORT_NAME, + rawOutputFile: KNIP_RAW_REPORT_NAME, + }; + await expect( + knipReporter({ + report: {files: true}, + issues: {files: new Set(['main.js'])}, + options: JSON.stringify(reporterOptions), + } as ReporterOptions), + ).resolves.toBeUndefined(); + + expect(logger.info).toHaveBeenCalledTimes(3); + expect(logger.info).toHaveBeenNthCalledWith( + 1, + `Reporter called with options: ${JSON.stringify( + reporterOptions, + null, + 2, + )}`, + ); + expect(logger.info).toHaveBeenNthCalledWith( 2, - )}`, - ); - expect(logger.info).toHaveBeenNthCalledWith( - 2, - `Saved raw report to ${reporterOptions.rawOutputFile}`, - ); - expect(logger.info).toHaveBeenNthCalledWith( - 3, - `Saved report to ${reporterOptions.outputFile}`, - ); -}); + `Saved raw report to ${reporterOptions.rawOutputFile}`, + ); + expect(logger.info).toHaveBeenNthCalledWith( + 3, + `Saved report to ${reporterOptions.outputFile}`, + ); + }); -it('should produce valid audit outputs', async () => { - await expect( - knipReporter(rawReport as ReporterOptions), - ).resolves.toBeUndefined(); - - const auditOutputsContent = await memfsFs.promises.readFile( - 'knip-report.json', - {encoding: 'utf8'}, - ); - const auditOutputsJson = JSON.parse( - auditOutputsContent.toString(), - ) as AuditOutputs; - expect(auditOutputsJson).toMatchSnapshot(); -}); + it('should produce valid audit outputs', async () => { + await expect( + knipReporter(rawReport as ReporterOptions), + ).resolves.toBeUndefined(); + + const auditOutputsContent = await memfsFs.promises.readFile( + 'knip-report.json', + {encoding: 'utf8'}, + ); + const auditOutputsJson = JSON.parse( + auditOutputsContent.toString(), + ) as AuditOutputs; + expect(auditOutputsJson).toMatchSnapshot(); + }) }) -; + diff --git a/packages/plugin-knip/tsconfig.test.json b/packages/plugin-knip/tsconfig.test.json index 656d23e..8400081 100644 --- a/packages/plugin-knip/tsconfig.test.json +++ b/packages/plugin-knip/tsconfig.test.json @@ -12,6 +12,7 @@ "src/**/*.test.tsx", "src/**/*.test.js", "src/**/*.test.jsx", - "src/**/*.d.ts" + "src/**/*.d.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } From 88f0eca36a3167aa6af8759cfcd4b0dd42d9f3a1 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Tue, 9 Dec 2025 16:20:30 +0100 Subject: [PATCH 10/10] refactor: wip --- e2e/plugin-knip-e2e/tests/collect.e2e.test.ts | 1 - .../__snapshots__/reporter.unit.test.ts.snap | 180 --------- .../src/lib/reporter/reporter.unit.test.ts | 348 +++++++++--------- 3 files changed, 174 insertions(+), 355 deletions(-) diff --git a/e2e/plugin-knip-e2e/tests/collect.e2e.test.ts b/e2e/plugin-knip-e2e/tests/collect.e2e.test.ts index 075a2ac..8099990 100644 --- a/e2e/plugin-knip-e2e/tests/collect.e2e.test.ts +++ b/e2e/plugin-knip-e2e/tests/collect.e2e.test.ts @@ -42,7 +42,6 @@ describe('PLUGIN collect report with knip-plugin NPM package', () => { expect(code).toBe(0); expect(stdout).toContain('Knip audits'); - expect(stdout).toContain('Collecting report successful!'); const report = await readJsonFile( path.join(defaultSetupDir, '.code-pushup', 'report.json'), diff --git a/packages/plugin-knip/src/lib/reporter/__snapshots__/reporter.unit.test.ts.snap b/packages/plugin-knip/src/lib/reporter/__snapshots__/reporter.unit.test.ts.snap index 236399e..457d88a 100644 --- a/packages/plugin-knip/src/lib/reporter/__snapshots__/reporter.unit.test.ts.snap +++ b/packages/plugin-knip/src/lib/reporter/__snapshots__/reporter.unit.test.ts.snap @@ -3,226 +3,46 @@ exports[`knipReporter > should produce valid audit outputs 1`] = ` [ { - "details": { - "issues": [ - { - "message": "Unused file code-pushup.config.ts", - "severity": "info", - "source": { - "file": "code-pushup.config.ts", - }, - }, - ], - }, - "score": 0, "slug": "files", - "value": 1, }, { - "details": { - "issues": [ - { - "message": "Unused dependency cli-table3", - "severity": "error", - "source": { - "file": "package.json", - }, - }, - ], - }, - "score": 0, "slug": "dependencies", - "value": 1, }, { - "details": { - "issues": [ - { - "message": "Unused devDependency @trivago/prettier-plugin-sort-imports", - "severity": "error", - "source": { - "file": "package.json", - }, - }, - ], - }, - "score": 0, "slug": "dev-dependencies", - "value": 1, }, { - "details": { - "issues": [ - { - "message": "Unused devDependency ts-node", - "severity": "error", - "source": { - "file": "package.json", - }, - }, - ], - }, - "score": 0, "slug": "optional-peer-dependencies", - "value": 1, }, { - "details": { - "issues": [ - { - "message": "Unlisted dependency jsonc-eslint-parser", - "severity": "info", - "source": { - "file": "../../../../User/username/code-pushup-cli/packages/utils/package.json", - }, - }, - { - "message": "Unlisted dependency jsonc-eslint-parser", - "severity": "info", - "source": { - "file": "../../../../User/username/code-pushup-cli/packages/utils/package.json", - }, - }, - ], - }, - "score": 0, "slug": "unlisted", - "value": 2, }, { - "score": 1, "slug": "binaries", - "value": 0, }, { - "details": { - "issues": [ - { - "message": "Unresolved import smo-package", - "severity": "info", - "source": { - "file": "packages/models/src/lib/category-config.ts", - "position": { - "startColumn": 23, - "startLine": 8, - }, - }, - }, - ], - }, - "score": 0, "slug": "unresolved", - "value": 1, }, { - "details": { - "issues": [ - { - "message": "Unused export duplicateErrorMsg", - "severity": "error", - "source": { - "file": "packages/models/src/lib/category-config.ts", - "position": { - "startColumn": 17, - "startLine": 54, - }, - }, - }, - ], - }, - "score": 0, "slug": "exports", - "value": 1, }, { - "score": 1, "slug": "ns-exports", - "value": 0, }, { - "details": { - "issues": [ - { - "message": "Unused exported type GroupMeta", - "severity": "error", - "source": { - "file": "packages/models/src/lib/group.ts", - "position": { - "startColumn": 13, - "startLine": 26, - }, - }, - }, - ], - }, - "score": 0, "slug": "types", - "value": 1, }, { - "score": 1, "slug": "ns-types", - "value": 0, }, { - "details": { - "issues": [ - { - "message": "Unused exported enum member unusedMember", - "severity": "error", - "source": { - "file": "packages/models/src/lib/group.ts", - "position": { - "startColumn": 13, - "startLine": 26, - }, - }, - }, - ], - }, - "score": 0, "slug": "enum-members", - "value": 1, }, { - "details": { - "issues": [ - { - "message": "Unused exported class member unusedKey", - "severity": "error", - "source": { - "file": "packages/models/src/lib/group.ts", - "position": { - "startColumn": 687, - "startLine": 40, - }, - }, - }, - ], - }, - "score": 0, "slug": "class-members", - "value": 1, }, { - "details": { - "issues": [ - { - "message": "Duplicate export configurationGenerator|default", - "severity": "error", - "source": { - "file": "../quality-metrics-cli/packages/nx-plugin/src/generators/configuration/generator.ts", - "position": { - "startColumn": 15, - "startLine": 54, - }, - }, - }, - ], - }, - "score": 0, "slug": "duplicates", - "value": 1, }, ] `; diff --git a/packages/plugin-knip/src/lib/reporter/reporter.unit.test.ts b/packages/plugin-knip/src/lib/reporter/reporter.unit.test.ts index c594287..1f36825 100644 --- a/packages/plugin-knip/src/lib/reporter/reporter.unit.test.ts +++ b/packages/plugin-knip/src/lib/reporter/reporter.unit.test.ts @@ -1,181 +1,181 @@ -import type {ReporterOptions} from 'knip'; -import type {IssueRecords, IssueSet} from 'knip/dist/types/issues'; -import {fs as memfsFs, vol} from 'memfs'; -import {beforeEach, describe, expect, it, vi} from 'vitest'; -import type {AuditOutputs} from '@code-pushup/models'; -import {MEMFS_VOLUME} from '@code-pushup/test-utils'; -import {logger} from '@code-pushup/utils'; -import {rawReport} from '../../../mocks/fixtures/raw-knip.report'; -import {KNIP_RAW_REPORT_NAME, KNIP_REPORT_NAME} from '../constants.js'; -import {CustomReporterOptions} from './model.js'; -import {knipReporter} from './reporter.js'; +import type { ReporterOptions } from 'knip'; +import type { IssueRecords, IssueSet } from 'knip/dist/types/issues'; +import { fs as memfsFs, vol } from 'memfs'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; +import type { AuditOutputs } from '@code-pushup/models'; +import { MEMFS_VOLUME, omitVariableAuditData } from '@code-pushup/test-utils'; +import { logger } from '@code-pushup/utils'; +import { rawReport } from '../../../mocks/fixtures/raw-knip.report'; +import { KNIP_RAW_REPORT_NAME, KNIP_REPORT_NAME } from '../constants.js'; +import { CustomReporterOptions } from './model.js'; +import { knipReporter } from './reporter.js'; vi.mock('@code-pushup/utils', async () => { - const actual = await vi.importActual('@code-pushup/utils'); - return { - ...actual, - getGitRoot: vi - .fn() - .mockResolvedValue('/Users/username/Projects/code-pushup-cli/'), - logger: { - info: vi.fn(), - error: vi.fn(), - warn: vi.fn(), - }, - }; + const actual = await vi.importActual('@code-pushup/utils'); + return { + ...actual, + getGitRoot: vi + .fn() + .mockResolvedValue('/Users/username/Projects/code-pushup-cli/'), + logger: { + info: vi.fn(), + error: vi.fn(), + warn: vi.fn(), + }, + }; }); describe('knipReporter', () => { - beforeEach(() => { - vol.reset(); - vol.fromJSON({[MEMFS_VOLUME]: null}); - }); - - it('should saves report to file system by default', async () => { - await expect( - knipReporter({ - report: { - files: true, - }, - issues: { - files: new Set(['main.js']), - }, - } as ReporterOptions), - ).resolves.toBeUndefined(); - - expect(logger.info).not.toHaveBeenCalled(); - }); - - it('should accept reporter option outputFile', async () => { - const outputFile = 'my-report.json'; - await expect( - knipReporter({ - report: { - files: true, - }, - issues: { - files: new Set(['main.js']), - }, - options: JSON.stringify({outputFile} satisfies CustomReporterOptions), - } as ReporterOptions), - ).resolves.toBeUndefined(); - - expect(logger.info).not.toHaveBeenCalled(); - - const auditOutputs = JSON.parse( - ( - await memfsFs.promises.readFile(outputFile, {encoding: 'utf8'}) - ).toString(), - ); - // Reporter returns all audits to match plugin configuration - expect(auditOutputs).toHaveLength(14); - expect(auditOutputs).toContainEqual( - expect.objectContaining({slug: 'files', score: 0, value: 1}), - ); - // Other audits should have score 1 (no issues) - expect( - auditOutputs.filter((audit: { slug: string }) => audit.slug !== 'files'), - ).toHaveLength(13); - }); - - it('should accept reporter option rawOutputFile', async () => { - const rawOutputFile = KNIP_RAW_REPORT_NAME; - const fileIssueSet: IssueSet = new Set(['main.js']); - const unlistedIssueRecords: IssueRecords = { - '/User/username/code-pushup-cli/packages/utils/.eslintrc.json': { - 'jsonc-eslint-parser': { - type: 'unlisted', - symbol: 'jsonc-eslint-parser', - filePath: - '/User/username/code-pushup-cli/packages/utils/package.json', - }, - }, - }; - - await expect( - knipReporter({ - report: { - files: true, - unlisted: true, - }, - issues: { - files: fileIssueSet, - unlisted: unlistedIssueRecords, - }, - options: JSON.stringify({rawOutputFile}), - // other reporter options for debugging purpose - counters: {files: 1, unlisted: 1}, - } as ReporterOptions), - ).resolves.toBeUndefined(); - - expect(logger.info).not.toHaveBeenCalled(); - - const rawKnipReport = JSON.parse( - ( - await memfsFs.promises.readFile(rawOutputFile, {encoding: 'utf8'}) - ).toString(), - ); - expect(rawKnipReport.report).toStrictEqual({files: true, unlisted: true}); - expect(rawKnipReport.options).toStrictEqual({rawOutputFile}); - expect(rawKnipReport.issues.files).toStrictEqual(['main.js']); - expect(rawKnipReport.issues.unlisted).toStrictEqual({ - '/User/username/code-pushup-cli/packages/utils/.eslintrc.json': { - 'jsonc-eslint-parser': { - type: 'unlisted', - symbol: 'jsonc-eslint-parser', - filePath: expect.pathToEndWith('package.json') - }, - }, - }); - expect(rawKnipReport.counters).toStrictEqual({files: 1, unlisted: 1}); - }); - - it('should log if custom reporter option verbose is true', async () => { - const reporterOptions: CustomReporterOptions = { - verbose: true, - outputFile: KNIP_REPORT_NAME, - rawOutputFile: KNIP_RAW_REPORT_NAME, - }; - await expect( - knipReporter({ - report: {files: true}, - issues: {files: new Set(['main.js'])}, - options: JSON.stringify(reporterOptions), - } as ReporterOptions), - ).resolves.toBeUndefined(); + beforeEach(() => { + vol.reset(); + vol.fromJSON({ [MEMFS_VOLUME]: null }); + }); + + it('should saves report to file system by default', async () => { + await expect( + knipReporter({ + report: { + files: true, + }, + issues: { + files: new Set(['main.js']), + }, + } as ReporterOptions), + ).resolves.toBeUndefined(); + + expect(logger.info).not.toHaveBeenCalled(); + }); + + it('should accept reporter option outputFile', async () => { + const outputFile = 'my-report.json'; + await expect( + knipReporter({ + report: { + files: true, + }, + issues: { + files: new Set(['main.js']), + }, + options: JSON.stringify({ outputFile } satisfies CustomReporterOptions), + } as ReporterOptions), + ).resolves.toBeUndefined(); + + expect(logger.info).not.toHaveBeenCalled(); + + const auditOutputs = JSON.parse( + ( + await memfsFs.promises.readFile(outputFile, { encoding: 'utf8' }) + ).toString(), + ); + // Reporter returns all audits to match plugin configuration + expect(auditOutputs).toHaveLength(14); + expect(auditOutputs).toContainEqual( + expect.objectContaining({ slug: 'files', score: 0, value: 1 }), + ); + // Other audits should have score 1 (no issues) + expect( + auditOutputs.filter((audit: { slug: string }) => audit.slug !== 'files'), + ).toHaveLength(13); + }); + + it('should accept reporter option rawOutputFile', async () => { + const rawOutputFile = KNIP_RAW_REPORT_NAME; + const fileIssueSet: IssueSet = new Set(['main.js']); + const unlistedIssueRecords: IssueRecords = { + '/User/username/code-pushup-cli/packages/utils/.eslintrc.json': { + 'jsonc-eslint-parser': { + type: 'unlisted', + symbol: 'jsonc-eslint-parser', + filePath: + '/User/username/code-pushup-cli/packages/utils/package.json', + }, + }, + }; - expect(logger.info).toHaveBeenCalledTimes(3); - expect(logger.info).toHaveBeenNthCalledWith( - 1, - `Reporter called with options: ${JSON.stringify( - reporterOptions, - null, - 2, - )}`, - ); - expect(logger.info).toHaveBeenNthCalledWith( - 2, - `Saved raw report to ${reporterOptions.rawOutputFile}`, - ); - expect(logger.info).toHaveBeenNthCalledWith( - 3, - `Saved report to ${reporterOptions.outputFile}`, - ); + await expect( + knipReporter({ + report: { + files: true, + unlisted: true, + }, + issues: { + files: fileIssueSet, + unlisted: unlistedIssueRecords, + }, + options: JSON.stringify({ rawOutputFile }), + // other reporter options for debugging purpose + counters: { files: 1, unlisted: 1 }, + } as ReporterOptions), + ).resolves.toBeUndefined(); + + expect(logger.info).not.toHaveBeenCalled(); + + const rawKnipReport = JSON.parse( + ( + await memfsFs.promises.readFile(rawOutputFile, { encoding: 'utf8' }) + ).toString(), + ); + expect(rawKnipReport.report).toStrictEqual({ files: true, unlisted: true }); + expect(rawKnipReport.options).toStrictEqual({ rawOutputFile }); + expect(rawKnipReport.issues.files).toStrictEqual(['main.js']); + expect(rawKnipReport.issues.unlisted).toStrictEqual({ + '/User/username/code-pushup-cli/packages/utils/.eslintrc.json': { + 'jsonc-eslint-parser': { + type: 'unlisted', + symbol: 'jsonc-eslint-parser', + filePath: expect.pathToEndWith('package.json'), + }, + }, }); - - it('should produce valid audit outputs', async () => { - await expect( - knipReporter(rawReport as ReporterOptions), - ).resolves.toBeUndefined(); - - const auditOutputsContent = await memfsFs.promises.readFile( - 'knip-report.json', - {encoding: 'utf8'}, - ); - const auditOutputsJson = JSON.parse( - auditOutputsContent.toString(), - ) as AuditOutputs; - expect(auditOutputsJson).toMatchSnapshot(); - }) -}) - + expect(rawKnipReport.counters).toStrictEqual({ files: 1, unlisted: 1 }); + }); + + it('should log if custom reporter option verbose is true', async () => { + const reporterOptions: CustomReporterOptions = { + verbose: true, + outputFile: KNIP_REPORT_NAME, + rawOutputFile: KNIP_RAW_REPORT_NAME, + }; + await expect( + knipReporter({ + report: { files: true }, + issues: { files: new Set(['main.js']) }, + options: JSON.stringify(reporterOptions), + } as ReporterOptions), + ).resolves.toBeUndefined(); + + expect(logger.info).toHaveBeenCalledTimes(3); + expect(logger.info).toHaveBeenNthCalledWith( + 1, + `Reporter called with options: ${JSON.stringify( + reporterOptions, + null, + 2, + )}`, + ); + expect(logger.info).toHaveBeenNthCalledWith( + 2, + `Saved raw report to ${reporterOptions.rawOutputFile}`, + ); + expect(logger.info).toHaveBeenNthCalledWith( + 3, + `Saved report to ${reporterOptions.outputFile}`, + ); + }); + + it('should produce valid audit outputs', async () => { + await expect( + knipReporter(rawReport as ReporterOptions), + ).resolves.toBeUndefined(); + + const auditOutputsContent = await memfsFs.promises.readFile( + 'knip-report.json', + { encoding: 'utf8' }, + ); + const auditOutputsJson = JSON.parse( + auditOutputsContent.toString(), + ) as AuditOutputs; + // sanitize variable data before snapshotting + expect(auditOutputsJson.map(omitVariableAuditData)).toMatchSnapshot(); + }); +});