Skip to content

Conversation

@BioPhoton
Copy link
Collaborator

@BioPhoton BioPhoton commented Aug 27, 2025

Precondition:

This PR includes:

  •  use plugin for main and cached targets
  • use executor on all targets
  • remove existing target configurations in projects
  • add docs
  • add validation helper script

Related:
closes #971

TODO Run local code

tsx is a utility to run TypeScript files in node which is growing in popularity:
https://tsx.is

Behind the scenes it is invoking node with relevant --require and --import flags.

If the user is invoking Nx via a script which is being invoked via tsx, then we
do not need to register any transpiler at all as the environment will have already
been configured by tsx. In fact, registering a transpiler such as ts-node or swc
in this case causes issues.

Because node is being invoked by tsx, the tsx binary does not end up in the final
process.argv and so we need to check a few possible things to account for usage
via different package managers (e.g. pnpm does not set process._ to tsx, but rather
pnpm itself, modern yarn does not set process._ at all etc.).

Changes where tested by:

  1. npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1091
  2. add plugin inc options to nx.json
{
  "pluginsConfig": {
    "@code-pushup/nx-plugin": {
      "projectPrefix": "cli",
      "bin": "packages/cli/src/index.ts",
      "env": {
        "NODE_OPTIONS": "--import tsx",
        "TSX_TSCONFIG_PATH": "tsconfig.base.json"
      }
    }
  },
  "plugins": [
    {
      "plugin": "@code-pushup/nx-plugin",
      "options": {
        "targetName": "cp"
      }
    }
  ]
}

@nx-cloud
Copy link

nx-cloud bot commented Aug 28, 2025

View your CI Pipeline Execution ↗ for commit 655a94f

Command Status Duration Result
nx run-many -t unit-test,int-test ✅ Succeeded 2m 7s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-03 18:09:12 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 28, 2025

Open in StackBlitz

@code-pushup/ci

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/ci@1091

@code-pushup/cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/cli@1091

@code-pushup/core

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/core@1091

@code-pushup/create-cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/create-cli@1091

@code-pushup/models

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models@1091

@code-pushup/axe-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/axe-plugin@1091

@code-pushup/nx-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1091

@code-pushup/coverage-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/coverage-plugin@1091

@code-pushup/eslint-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/eslint-plugin@1091

@code-pushup/js-packages-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/js-packages-plugin@1091

@code-pushup/jsdocs-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/jsdocs-plugin@1091

@code-pushup/lighthouse-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/lighthouse-plugin@1091

@code-pushup/typescript-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/typescript-plugin@1091

@code-pushup/utils

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/utils@1091

commit: 0b4ecf4

@github-actions github-actions bot added the 📖 Project documentation improvements or additions to the project documentation label Sep 4, 2025
# Conflicts:
#	packages/nx-plugin/src/executors/cli/schema.json
#	packages/nx-plugin/src/executors/cli/schema.ts
@BioPhoton BioPhoton marked this pull request as ready for review September 4, 2025 14:23
BioPhoton added a commit that referenced this pull request Dec 2, 2025
Related to #1091

---------

Co-authored-by: John Doe <john.doe@example.com>
# Conflicts:
#	e2e/nx-plugin-e2e/tests/executor-cli.e2e.test.ts
#	packages/nx-plugin/src/executors/cli/executor.ts
BioPhoton added a commit that referenced this pull request Dec 2, 2025
related to #1091 

**This PR includes:**
- alignments of terminal args helper
- add command formatter helper to `utils`
- reuse utils in `nx-plugin` and remove old code
- remove bin logic from config target (left over of #1109)

---------

Co-authored-by: John Doe <john.doe@example.com>
Michael Hladky added 2 commits December 4, 2025 21:11
# Conflicts:
#	e2e/nx-plugin-e2e/tests/plugin-create-nodes.e2e.test.ts
#	packages/nx-plugin/src/executors/cli/executor.int.test.ts
#	packages/nx-plugin/src/executors/cli/executor.unit.test.ts
#	packages/utils/src/index.ts
#	packages/utils/src/lib/logger.ts
#	packages/utils/src/lib/transform.unit.test.ts
@github-actions
Copy link
Contributor

github-actions bot commented Dec 15, 2025

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit c5137ea with previous commit 7b6e72c.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Security 🔴 47 🔴 45 ↓ −2.5
Performance 🔴 33 🔴 34 ↑ +1.2
Bug prevention 🟡 75 🟡 75 ↓ −0.1
Axe Accessibility 🟡 88 🟡 88 ↓ −0.1
Code style 🟢 100 🟢 100
Code coverage 🟢 93 🟢 93
Updates 🟡 78 🟡 78
Type Safety 🟡 67 🟡 67
Miscellaneous 🟡 67 🟡 67
Documentation 🟡 53 🟡 53
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟢 92 🟢 92
👍 1 group improved, 👎 1 group regressed, 👍 3 audits improved, 👎 2 audits regressed, 18 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
JS packages npm audit 🔴 47 🔴 45 ↓ −2.5
Lighthouse Performance 🔴 33 🔴 34 ↑ +1.2

32 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Initial server response time was short 🟥 Root document took 620 ms 🟩 Root document took 550 ms ↓ −12.4 %
Lighthouse Minify CSS 🟩 0 🟨 Potential savings of 10 KiB  −∞ %
Lighthouse Total Blocking Time 🟥 3,150 ms 🟥 2,150 ms ↓ −31.8 %
JS packages Vulnerabilities for npm prod dependencies. 🟨 11 vulnerabilities (2 high, 2 moderate, 7 low) 🟨 11 vulnerabilities (2 high, 3 moderate, 6 low)  +0 %
Lighthouse Time to Interactive 🟥 14.2 s 🟥 14.0 s ↓ −1.9 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 2,087 KiB 🟩 Total size was 2,097 KiB ↑ +0.5 %
Lighthouse Minimizes main-thread work 🟥 13.9 s 🟥 12.1 s ↓ −13.1 %
Lighthouse JavaScript execution time 🟥 4.6 s 🟥 3.9 s ↓ −15.5 %
Lighthouse Server Backend Latencies 🟩 640 ms 🟩 1,250 ms ↑ +97.3 %
Lighthouse Uses efficient cache policy on static assets 🟨 31 resources found 🟨 31 resources found ↑ +0.1 %
Lighthouse Metrics 🟩 100% 🟩 100% ↓ −1.9 %
Lighthouse Reduce unused JavaScript 🟥 Potential savings of 225 KiB 🟥 Potential savings of 225 KiB ↓ −10.7 %
Lighthouse Max Potential First Input Delay 🟥 1,190 ms 🟥 1,320 ms ↑ +10.5 %
Lighthouse Largest Contentful Paint 🟥 11.7 s 🟥 11.8 s ↑ +0.9 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 125 KiB 🟥 Potential savings of 143 KiB ↑ +3.3 %
Lighthouse First Contentful Paint 🟥 3.1 s 🟥 3.1 s ↓ −0.6 %
Lighthouse Speed Index 🟥 7.3 s 🟥 7.3 s ↑ +0.2 %
Lighthouse Remove duplicate modules in JavaScript bundles 🟥 Potential savings of 86 KiB 🟥 Potential savings of 86 KiB ↑ +2.2 %
Lighthouse Network Round Trip Times 🟩 10 ms 🟩 10 ms ↑ +32.2 %
JS packages Outdated npm prod dependencies. 🟨 19 outdated package versions (5 major, 11 minor, 3 patch) 🟨 20 outdated package versions (5 major, 12 minor, 3 patch) ↑ +5.3 %
Lighthouse ARIA tooltip elements have accessible names 🟩 passed 🟩 0 ↓ −100 %
Axe ARIA hidden element must not be focusable or contain focusable elements 🟩 201 elements 🟩 202 elements ↑ +0.5 %
Lighthouse Cumulative Layout Shift 🟩 0 🟩 0.001 ↑ +∞ %

656 other audits are unchanged.

package.json Outdated
"private": true,
"dependencies": {
"@axe-core/playwright": "^4.11.0",
"@code-pushup/cli": "^0.96.1",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to install it as it is a normal dependency, but in our nx.json we configure the execution of the local TS code.

package.json Outdated
"@axe-core/playwright": "^4.11.0",
"@code-pushup/cli": "^0.96.1",
"@code-pushup/models": "^0.96.1",
"@code-pushup/nx-plugin": "^0.96.1",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to install it because ATM Nx plugins don't take import aliases in any way. This means our nx-plugin code is always 1 release behind the current PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants