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

Fix: GetPackageExports works regardless of version #7

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

jackw
Copy link
Contributor

@jackw jackw commented Feb 5, 2025

This PR fixes a bug due to grafana npm packages < 9.2 not having a dist directory which was causing the lint rule to not report warnings as it silently failed to find types files. Additionally initial linting is greatly sped up if the version passed is > 9.2.

Locally, running the tests that pull the packages(cold cache) now pass in ~2.5s. Doing the same against main currently takes ~30s locally as npm installs 350 packages. CI test step drops from ~22s to ~12s. 🚀

This PR addresses the following issues:

  • Normalise package export paths so regardless of package version the path is consistent. e.g. ${tmpDir}/node_modules/${pkg}/index.d.ts.
  • To speed up initial linting, if version passed in is > 9.2 only download the single types file via cdn.jsdelivr.net rather than use npm to install the package and all its dependencies.

@jackw jackw added the bug Something isn't working label Feb 5, 2025
@jackw jackw self-assigned this Feb 5, 2025
Copy link

@leventebalogh leventebalogh left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jackw jackw merged commit ab6d90e into main Feb 5, 2025
2 checks passed
@jackw jackw deleted the jackw/fix-false-positives branch February 5, 2025 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants