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

Refactor NpmLocation class #2038

Merged
merged 8 commits into from
Dec 18, 2023
Merged

Refactor NpmLocation class #2038

merged 8 commits into from
Dec 18, 2023

Conversation

FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Dec 13, 2023

Refactor NpmLocation to move most logic to a BaseNpmLocation class that can be extended in the mobile client. A class extending the base class only need to implement fetchNpmTarball reducing code duplication. As part of this refactor I've also simplified the implementation in multiple places and improved the coverage.

Fixes #2040

Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (58b9318) 96.13% compared to head (7af8763) 96.22%.

Files Patch % Lines
...ckages/snaps-controllers/src/snaps/location/npm.ts 97.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2038      +/-   ##
==========================================
+ Coverage   96.13%   96.22%   +0.09%     
==========================================
  Files         270      270              
  Lines        6309     6310       +1     
  Branches     1023     1023              
==========================================
+ Hits         6065     6072       +7     
+ Misses        244      238       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@FrederikBolding FrederikBolding changed the title Refactor NPM location class Refactor NpmLocation class Dec 15, 2023
@FrederikBolding FrederikBolding marked this pull request as ready for review December 15, 2023 09:04
@FrederikBolding FrederikBolding requested a review from a team as a code owner December 15, 2023 09:04
@FrederikBolding FrederikBolding merged commit d3d4a0f into main Dec 18, 2023
141 checks passed
@FrederikBolding FrederikBolding deleted the fb/npm-refactor branch December 18, 2023 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor NPM implementation to allow for easier mobile integration
2 participants