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

Make Pnpm separate from Npm #9274

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Make Pnpm separate from Npm #9274

wants to merge 4 commits into from

Conversation

fviernau
Copy link
Member

@fviernau fviernau commented Oct 11, 2024

Part of #9261.

val declaredLicenses = packageJson.licenses.mapNpmLicenses()
val authors = parseNpmAuthor(packageJson.authors.firstOrNull()) // TODO: parse all authors.

var description = packageJson.description.orEmpty()

Check warning

Code scanning / detekt

Var declaration could be val. Warning

Variable 'description' could be val.
val authors = parseNpmAuthor(packageJson.authors.firstOrNull()) // TODO: parse all authors.

var description = packageJson.description.orEmpty()
var homepageUrl = packageJson.homepage.orEmpty()

Check warning

Code scanning / detekt

Var declaration could be val. Warning

Variable 'homepageUrl' could be val.
expandNpmShortcutUrl(fromVersion).takeIf { it != fromVersion }.orEmpty()
}

var hash = Hash.create(packageJson.integrity.orEmpty())

Check warning

Code scanning / detekt

Var declaration could be val. Warning

Variable 'hash' could be val.
val declaredLicenses = packageJson.licenses.mapNpmLicenses()
val authors = parseNpmAuthor(packageJson.authors.firstOrNull()) // TODO: parse all authors.

var description = packageJson.description.orEmpty()

Check warning

Code scanning / QDJVMC

Local 'var' is never modified and can be declared as 'val' Warning

Variable is never modified, so it can be declared using 'val'
val authors = parseNpmAuthor(packageJson.authors.firstOrNull()) // TODO: parse all authors.

var description = packageJson.description.orEmpty()
var homepageUrl = packageJson.homepage.orEmpty()

Check warning

Code scanning / QDJVMC

Local 'var' is never modified and can be declared as 'val' Warning

Variable is never modified, so it can be declared using 'val'
expandNpmShortcutUrl(fromVersion).takeIf { it != fromVersion }.orEmpty()
}

var hash = Hash.create(packageJson.integrity.orEmpty())

Check warning

Code scanning / QDJVMC

Local 'var' is never modified and can be declared as 'val' Warning

Variable is never modified, so it can be declared using 'val'
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 1.57480% with 125 lines in your changes missing coverage. Please review.

Project coverage is 66.61%. Comparing base (0b82618) to head (f29ee32).

Files with missing lines Patch % Lines
...package-managers/node/src/main/kotlin/pnpm/Pnpm.kt 2.19% 89 Missing ⚠️
...e-managers/node/src/main/kotlin/pnpm/ModuleInfo.kt 0.00% 20 Missing ⚠️
...node/src/main/kotlin/pnpm/PnpmDependencyHandler.kt 0.00% 16 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9274      +/-   ##
============================================
- Coverage     67.67%   66.61%   -1.06%     
  Complexity     1187     1187              
============================================
  Files           239      242       +3     
  Lines          7796     7923     +127     
  Branches        900      916      +16     
============================================
+ Hits           5276     5278       +2     
- Misses         2153     2278     +125     
  Partials        367      367              
Flag Coverage Δ
funTest-non-docker 34.71% <ø> (ø)
test 36.48% <1.57%> (-0.57%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@fviernau fviernau changed the title Pnpm rewrite Make Pnpm separate from Npm Oct 11, 2024
Signed-off-by: Frank Viernau <[email protected]>
Prepare for re-use in an upcoming change.

Signed-off-by: Frank Viernau <[email protected]>
Prepare for adding further `Pnpm` specific classes.

Signed-off-by: Frank Viernau <[email protected]>
@fviernau fviernau force-pushed the pnpm-rewrite branch 4 times, most recently from 6ca5623 to 5e3706e Compare October 11, 2024 10:46
Stop inheriting from `Npm` and rely entirely on the output of `pnpm`
commands to figure out the necessary information. For example, do not
re-construct the dependency from the file structure within
`node_modles`, but rely on `pnpm list` instead. This tremendously
reduces complexity and makes the implementation easy to understand and
maintain.

Apart from that it corrects issues with the dependency tree, such as:

1. htmlparser2 now dependends on domutils 1.7.0 instead of 1.5.1, which
   is inline with the dependency tree output by `pnpm list --depth 1000`
2. The cyclic reference from the workspace root project to itself is now
   included.

Signed-off-by: Frank Viernau <[email protected]>
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.

1 participant