Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plugin-doc-coverage): add doc-coverage-plugin to analyze documentation in ts/js projects #896

Open
wants to merge 50 commits into
base: main
Choose a base branch
from

Conversation

aramirezj
Copy link

@aramirezj aramirezj commented Dec 17, 2024

This PR includes:

  • documentation
  • Unit testing
    • Source Files are mocked
  • Integration tests
    • Test case for every audit in a small codebase
  • e2e
  • usage of the plugin in the repository

Closes #908

Report Summary

Overview of Audit Groups, Audit Counts, and Diagnostic Issue Types.

📁 Group Name 📋 Audits 🐞 Issues
documentation-coverage classes-coverage, methods-coverage, functions-coverage, interfaces-coverage, variables-coverage, properties-coverage, types-coverage, enums-coverage Missing documentation
------------------------ ------------------------------------------------- -------------------
1 Group Total 8 Audits Total 1 Issue Type Total

@github-actions github-actions bot added 📖 Project documentation improvements or additions to the project documentation 🔬 testing writing tests 🛠️ tooling labels Dec 17, 2024
Copy link

github-actions bot commented Dec 17, 2024

Code PushUp

😟 Code PushUp report has regressed – compared target commit c219602 with source commit c219602.

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🟡 54 🔴 46 ↓ −8.2
Code coverage 🟢 91 🟢 91
Security 🟡 81 🟡 81
Updates 🟡 80 🟡 80
Accessibility 🟢 91 🟢 91
Best Practices 🟢 100 🟢 100
SEO 🟡 61 🟡 61
Bug prevention 🟢 100 🟢 100
Code style 🟢 100 🟢 100
👎 1 group regressed, 👎 5 audits regressed, 12 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🟡 54 🔴 46 ↓ −8.2

16 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Speed Index 🟨 4.9 s 🟥 6.3 s ↑ +28.5 %
Lighthouse Largest Contentful Paint 🟨 3.3 s 🟨 3.9 s ↑ +20.6 %
Lighthouse Time to Interactive 🟥 12.9 s 🟥 15.9 s ↑ +23.3 %
Lighthouse First Contentful Paint 🟥 3.1 s 🟥 3.3 s ↑ +4.7 %
Lighthouse Total Blocking Time 🟥 3,450 ms 🟥 5,880 ms ↑ +70.6 %
Lighthouse Minimizes main-thread work 🟥 13.7 s 🟥 18.7 s ↑ +36.6 %
Lighthouse JavaScript execution time 🟥 6.0 s 🟥 9.3 s ↑ +54 %
Lighthouse Metrics 🟩 100% 🟩 100% ↑ +23.3 %
Lighthouse Max Potential First Input Delay 🟥 2,470 ms 🟥 3,370 ms ↑ +36.7 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 66 KiB 🟥 Potential savings of 66 KiB ↑ +50 %
Lighthouse Eliminate render-blocking resources 🟥 Potential savings of 1,520 ms 🟥 Potential savings of 1,420 ms ↓ −6.4 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 1,816 KiB 🟩 Total size was 1,817 KiB ↑ +0.1 %
Lighthouse Server Backend Latencies 🟩 130 ms 🟩 120 ms ↓ −12.4 %
Lighthouse Initial server response time was short 🟩 Root document took 370 ms 🟩 Root document took 390 ms ↑ +4.1 %
Lighthouse Uses efficient cache policy on static assets 🟨 28 resources found 🟨 28 resources found ↓ −0.1 %
Lighthouse Network Round Trip Times 🟩 10 ms 🟩 20 ms ↑ +53.4 %
Lighthouse Avoids an excessive DOM size 🟥 2,141 elements 🟥 2,142 elements ↑ +0.1 %

571 other audits are unchanged.

@aramirezj aramirezj changed the title feat(plugin-doc-coverage): add mvp version of a plugin doc coverage based on compodoc feat(plugin-doc-coverage): add mvp version of a plugin doc coverage based on typedoc and TBD Dec 17, 2024
@aramirezj aramirezj marked this pull request as ready for review December 20, 2024 18:53
@aramirezj aramirezj changed the title feat(plugin-doc-coverage): add mvp version of a plugin doc coverage based on typedoc and TBD feat(plugin-doc-coverage): add doc-coverage-plugin to analyze documentation in ts/js projects Dec 21, 2024
code-pushup.config.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@BioPhoton BioPhoton left a comment

Choose a reason for hiding this comment

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

Thanks for adding the tests.

Last thing I found was a outdated readme. After that we are good to go.

Copy link
Collaborator

@BioPhoton BioPhoton left a comment

Choose a reason for hiding this comment

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

WONDERFUL!

cc @vmasek and @matejchalk

BioPhoton
BioPhoton previously approved these changes Dec 23, 2024
BioPhoton
BioPhoton previously approved these changes Dec 23, 2024
@vmasek
Copy link
Collaborator

vmasek commented Jan 2, 2025

@aramirezj thank you for putting this plugin together, we did discuss it on refinement today and we are exited to adopt it as one of the plugins that should live in this monorepo (there are plugins that we purposely do not maintain here as they do not meet the JS/TS tech stack).

We are also looking forward to setup automated docs generation, so it makes even more sense to start tracking it with plugin.

There are some things we need to figure out before we merge, mainly related to testing. We are thinking if there should already be a simple e2e tests similar to for the ESLint e2e exaple, is it something you'd also like to contribute?

@aramirezj aramirezj mentioned this pull request Jan 2, 2025
6 tasks
@aramirezj
Copy link
Author

@aramirezj thank you for putting this plugin together, we did discuss it on refinement today and we are exited to adopt it as one of the plugins that should live in this monorepo (there are plugins that we purposely do not maintain here as they do not meet the JS/TS tech stack).

We are also looking forward to setup automated docs generation, so it makes even more sense to start tracking it with plugin.

There are some things we need to figure out before we merge, mainly related to testing. We are thinking if there should already be a simple e2e tests similar to for the ESLint e2e exaple, is it something you'd also like to contribute?

I am glad to hear that! And sure! I will work into that ^^

nodesCount: 1,
issues: [
{
file: expect.stringContaining('classes-coverage'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
file: expect.stringContaining('classes-coverage'),
file: expect.stringContaining('classes-coverage.ts'),

To make sure it is at the end of the file, and not a different file with same path segment.

This is applicable to multiple places.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd even say it could be stringEndingWith('classes-coverage.ts')

Copy link
Author

Choose a reason for hiding this comment

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

I have added expect.stringMatching(/properties-coverage\.ts$/) that it should do the trick

Copy link
Collaborator

Choose a reason for hiding this comment

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

@aramirezj with the latest merge we have OS agnostic path helpers in the codebase:
https://github.com/code-pushup/cli/blob/main/testing/test-setup/src/lib/extend/path.matcher.unit.test.ts

Let's use them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 Project documentation improvements or additions to the project documentation 🔬 testing writing tests 🛠️ tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation Coverage Plugin
3 participants