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(node): Re-write Yarn to no more rely on node_modules file hierarchy #9427

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions plugins/package-managers/node/src/main/kotlin/NpmSupport.kt
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,21 @@ internal fun parseNpmVcsInfo(packageJson: PackageJson): VcsInfo {
)
}

internal fun parsePackage(
workingDir: File,
packageJsonFile: File,
getRemotePackageDetails: (workingDir: File, packageName: String) -> PackageJson?
) = parsePackage(workingDir, parsePackageJson(packageJsonFile), getRemotePackageDetails)

/**
* Construct a [Package] by parsing its _package.json_ file and - if applicable - querying additional
* content via the `npm view` command. The result is a [Pair] with the raw identifier and the new package.
*/
internal fun parsePackage(
workingDir: File,
packageJsonFile: File,
packageJson: PackageJson,
getRemotePackageDetails: (workingDir: File, packageName: String) -> PackageJson?
): Package {
val packageJson = parsePackageJson(packageJsonFile)

// The "name" and "version" fields are only required if the package is going to be published, otherwise they are
// optional, see
// - https://docs.npmjs.com/cli/v10/configuring-npm/package-json#name
Expand Down
Loading
Loading