Skip to content

feat: use jiti for plugin loading - #1228

Draft
BioPhoton wants to merge 71 commits into
mainfrom
feat/jiti-module-loading
Draft

feat: use jiti for plugin loading#1228
BioPhoton wants to merge 71 commits into
mainfrom
feat/jiti-module-loading

Conversation

@BioPhoton

@BioPhotonBioPhoton commented Jan 21, 2026

Copy link
Copy Markdown
Collaborator

Supportive PRs:

Closes#1226

This PR includes switches from bundleRequire to jiti. It includes:

  • jiti wrapper code to resolve TS config paths and forward to jiti
  • importModule got refactored to use jiti

Errors:

  • Problem: Access of window.document through 'axe-core' import
    Reproduction:node --input-type=module -e "import('jiti').then(j=>j.default()( 'axe-core'))"
    Error:
    /node_modules/axe-core/axe.js:14
    var document = window.document;
    ^
    TypeError: Cannot read properties of undefined (reading 'document')
    at axeFunction (/cli/node_modules/axe-core/axe.js:14:25)
    at /cli/node_modules/axe-core/axe.js:32979:3
    at eval_evalModule (/cli/node_modules/jiti/dist/jiti.cjs:1:196325)
    at jitiRequire (/cli/node_modules/jiti/dist/jiti.cjs:1:190233)
    at /cli/node_modules/jiti/dist/jiti.cjs:1:199352
    at file:///cli/[eval1]:1:35
    Node.js v24.1.0
    Issues:axe.setup should set globals dequelabs/axe-core#3962
    Preliminalr fix:b7109fb

The following is here just to make it working and will get refactored if the PR is interesting:

  • polyfill for axe (access document as sinde effect)
  • cyclic eslint imports

Related: https://github.com/push-based/ts-jiti

@nx-cloud

nx-cloudBot commented Jan 21, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 290d88f

CommandStatusDurationResult
nx affected -t e2e-test --parallel=1❌ Failed15m 25sView ↗
nx affected -t lint --parallel=3❌ Failed6m 48sView ↗
nx affected -t int-test --parallel=3❌ Failed1m 14sView ↗
nx affected -t unit-test --parallel=3✅ Succeeded1m 32sView ↗
nx run-many --target=build --parallel=3✅ Succeeded36sView ↗

☁️ Nx Cloud last updated this comment at 2026-02-25 18:01:42 UTC

@nx-cloud

nx-cloudBot commented Jan 21, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit bbd8648


☁️ Nx Cloud last updated this comment at 2026-01-21 20:43:23 UTC

@pkg-pr-new

pkg-pr-newBot commented Jan 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@code-pushup/ci

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

@code-pushup/cli

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

@code-pushup/core

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

@code-pushup/create-cli

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

@code-pushup/models

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

@code-pushup/nx-plugin

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

@code-pushup/axe-plugin

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

@code-pushup/coverage-plugin

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

@code-pushup/eslint-plugin

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

@code-pushup/js-packages-plugin

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

@code-pushup/jsdocs-plugin

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

@code-pushup/lighthouse-plugin

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

@code-pushup/typescript-plugin

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

@code-pushup/utils

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

commit: 290d88f

@github-actions

github-actionsBot commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit bfe1b67 with previous commit 3137af7.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category⭐ Previous score⭐ Current score🔄 Score change
Type Safety🟡 67🟡 56↓ −11.1
Bug prevention🟡 75🟡 67↓ −8.3
Code style🟢 100🟢 96↓ −3.9
Performance🔴 40🔴 39↓ −0.9
Documentation🟡 53🟡 53↑ +0.1
Updates🟡 75🟡 75↑ +0.1
Code coverage🟢 93🟢 93↓ −0.1
Axe Accessibility🟡 88🟡 88↓ −0.1
Security🔴 47🔴 47
Miscellaneous🟡 67🟡 67
Accessibility🟢 92🟢 92
Best Practices🟢 100🟢 100
SEO🟢 92🟢 92
👍 2 groups improved, 👎 5 groups regressed, 👍 9 audits improved, 👎 14 audits regressed, 14 audits changed without impacting score

🗃️ Groups

🔌 Plugin🗃️ Group⭐ Previous score⭐ Current score🔄 Score change
ESLintNo Mutations (functional)🟢 100🟡 50↓ −50
TypeScriptProblems🔴 33🔴 0↓ −33.3
ESLintSuggestions🟢 100🟢 96↓ −3.9
LighthousePerformance🔴 40🔴 39↓ −0.9
JSDocs coverageDocumentation coverage🟡 53🟡 53↑ +0.1
JS packagesnpm outdated dependencies🟡 75🟡 75↑ +0.1
Code coverageCode coverage metrics🟢 93🟢 93↓ −0.1

27 other groups are unchanged.

🛡️ Audits

🔌 Plugin🛡️ Audit📏 Previous value📏 Current value🔄 Value change
ESLintdisallow alias methods🟩 passed🟥 463 warnings↑ +∞ %
LighthouseInitial server response time was short🟥 Root document took 660 ms🟩 Root document took 400 ms↓ −40.3 %
ESLintEnforce treating data as immutable.🟩 passed🟥 3 warnings↑ +∞ %
ESLintdisallow the use of process.exit()🟩 passed🟥 3 warnings↑ +∞ %
TypeScriptNo implicit any errors🟩 passed🟥 3 errors↑ +∞ %
ESLintDisallow the use of console🟩 passed🟥 2 warnings↑ +∞ %
ESLintDisallow negated conditions.🟩 passed🟥 1 warning↑ +∞ %
ESLintRequire braces around arrow function bodies🟩 passed🟥 1 warning↑ +∞ %
ESLintRequire template literals instead of string concatenation🟩 passed🟥 1 warning↑ +∞ %
ESLintEnforce padding around describe blocks🟩 passed🟥 1 warning↑ +∞ %
ESLintrequire toThrow() to be called with an error message🟩 passed🟥 1 warning↑ +∞ %
LighthouseFirst Contentful Paint🟥 3.3 s🟨 2.9 s↓ −12.9 %
LighthouseTotal Blocking Time🟥 1,040 ms🟥 1,330 ms↑ +28 %
LighthouseMax Potential First Input Delay🟥 620 ms🟥 1,000 ms↑ +61 %
LighthouseTime to Interactive🟥 13.1 s🟥 13.0 s↓ −1 %
LighthouseSpeed Index🟥 6.8 s🟥 6.8 s↓ −0.4 %
JS packagesOutdated npm dev dependencies.🟨 62 outdated package versions (29 major, 25 minor, 8 patch)🟨 61 outdated package versions (29 major, 24 minor, 8 patch)↓ −1.6 %
JSDocs coverageFunctions coverage🟥 585 undocumented functions🟥 587 undocumented functions↑ +0.3 %
JSDocs coverageVariables coverage🟥 274 undocumented variables🟥 279 undocumented variables↑ +1.8 %
Code coverageBranch coverage🟨 89.2 %🟨 89 %↓ −0.2 %
Code coverageLine coverage🟩 92.8 %🟩 92.6 %↓ −0.2 %
JSDocs coverageTypes coverage🟥 264 undocumented types🟥 266 undocumented types↑ +0.8 %
Code coverageFunction coverage🟩 94.4 %🟩 94.4 %↑ +0.1 %
LighthouseAvoids enormous network payloads🟩 Total size was 2,089 KiB🟩 Total size was 2,080 KiB↓ −0.5 %
LighthouseMinimizes main-thread work🟥 8.1 s🟥 10.1 s↑ +24.7 %
LighthouseJavaScript execution time🟥 2.1 s🟥 3.1 s↑ +45.4 %
LighthouseUses efficient cache policy on static assets🟨 31 resources found🟨 31 resources found↑ +0.1 %
LighthouseLargest Contentful Paint🟥 11.7 s🟥 11.5 s↓ −1.8 %
LighthouseReduce unused CSS🟥 Potential savings of 111 KiB🟥 Potential savings of 111 KiB↓ −23.3 %
LighthouseMetrics🟩 100%🟩 100%↓ −1 %
LighthouseReduce unused JavaScript🟥 Potential savings of 225 KiB🟥 Potential savings of 225 KiB↓ −10 %
LighthouseServer Backend Latencies🟩 300 ms🟩 200 ms↓ −34 %
LighthouseNetwork Round Trip Times🟩 70 ms🟩 10 ms↓ −89.3 %
TypeScriptSemantic errors🟥 44 errors🟥 90 errors↑ +104.5 %
LighthouseRemove duplicate modules in JavaScript bundles🟥 Potential savings of 65 KiB🟥 Potential savings of 93 KiB↑ +3.3 %
TypeScriptSyntax errors🟥 7 errors🟥 9 errors↑ +28.6 %
LighthouseCumulative Layout Shift🟩 0.003🟩 0↓ −100 %

641 other audits are unchanged.

# Conflicts:
#	packages/cli/mocks/configs/code-pushup.needs-tsconfig.config.ts
#	packages/plugin-axe/src/lib/runner/transform.unit.test.ts
#	packages/utils/src/lib/import-module.int.test.ts
#	packages/utils/src/lib/import-module.ts
@github-actionsgithub-actionsBot removed the 📖 Project documentation improvements or additions to the project documentation label Feb 23, 2026
Sign up for freeto 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.

Test jiti as loader and executor

1 participant

@BioPhoton