Skip to content

Commit

Permalink
refactor(node)!: Also move npm into its own dedicated directory
Browse files Browse the repository at this point in the history
Establish consistency and prepare for an upcoming refactoring of `Npm`
which will add further classes under the `npm` directory.

Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Nov 6, 2024
1 parent b44a1e5 commit 0ede477
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* License-Filename: LICENSE
*/

package org.ossreviewtoolkit.plugins.packagemanagers.node
package org.ossreviewtoolkit.plugins.packagemanagers.node.npm

import io.kotest.core.spec.style.WordSpec
import io.kotest.engine.spec.tempdir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

@file:Suppress("TooManyFunctions")

package org.ossreviewtoolkit.plugins.packagemanagers.node
package org.ossreviewtoolkit.plugins.packagemanagers.node.npm

import java.io.File

Expand All @@ -29,6 +29,7 @@ import org.ossreviewtoolkit.analyzer.AbstractPackageManagerFactory
import org.ossreviewtoolkit.model.config.AnalyzerConfiguration
import org.ossreviewtoolkit.model.config.PackageManagerConfiguration
import org.ossreviewtoolkit.model.config.RepositoryConfiguration
import org.ossreviewtoolkit.plugins.packagemanagers.node.PackageJson
import org.ossreviewtoolkit.plugins.packagemanagers.node.utils.NodePackageManager
import org.ossreviewtoolkit.plugins.packagemanagers.node.utils.NpmDetection
import org.ossreviewtoolkit.plugins.packagemanagers.node.yarn.Yarn
Expand Down Expand Up @@ -94,7 +95,7 @@ class Npm(
return runCatching {
val process = run(workingDir, "info", "--json", packageName)

parsePackageJson(process.stdout)
org.ossreviewtoolkit.plugins.packagemanagers.node.parsePackageJson(process.stdout)
}.onFailure { e ->
logger.warn { "Error getting details for $packageName in directory $workingDir: ${e.message.orEmpty()}" }
}.onSuccess {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import org.ossreviewtoolkit.model.Project
import org.ossreviewtoolkit.model.RemoteArtifact
import org.ossreviewtoolkit.model.VcsInfo
import org.ossreviewtoolkit.model.VcsType
import org.ossreviewtoolkit.plugins.packagemanagers.node.Npm
import org.ossreviewtoolkit.plugins.packagemanagers.node.npm.Npm
import org.ossreviewtoolkit.plugins.packagemanagers.node.PackageJson
import org.ossreviewtoolkit.plugins.packagemanagers.node.parsePackageJson
import org.ossreviewtoolkit.utils.common.realFile
Expand Down
2 changes: 1 addition & 1 deletion plugins/package-managers/node/src/main/kotlin/yarn/Yarn.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import org.ossreviewtoolkit.model.createAndLogIssue
import org.ossreviewtoolkit.model.readTree
import org.ossreviewtoolkit.model.utils.DependencyGraphBuilder
import org.ossreviewtoolkit.plugins.packagemanagers.node.PackageJson
import org.ossreviewtoolkit.plugins.packagemanagers.node.groupLines
import org.ossreviewtoolkit.plugins.packagemanagers.node.npm.groupLines
import org.ossreviewtoolkit.plugins.packagemanagers.node.parsePackageJson
import org.ossreviewtoolkit.plugins.packagemanagers.node.utils.NodePackageManager
import org.ossreviewtoolkit.plugins.packagemanagers.node.utils.NpmDetection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.ossreviewtoolkit.plugins.packagemanagers.node.Npm$Factory
org.ossreviewtoolkit.plugins.packagemanagers.node.npm.Npm$Factory
org.ossreviewtoolkit.plugins.packagemanagers.node.pnpm.Pnpm$Factory
org.ossreviewtoolkit.plugins.packagemanagers.node.yarn.Yarn$Factory
org.ossreviewtoolkit.plugins.packagemanagers.node.yarn2.Yarn2$Factory
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* License-Filename: LICENSE
*/

package org.ossreviewtoolkit.plugins.packagemanagers.node
package org.ossreviewtoolkit.plugins.packagemanagers.node.npm

import io.kotest.core.spec.style.WordSpec
import io.kotest.engine.spec.tempdir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import org.ossreviewtoolkit.model.Identifier
import org.ossreviewtoolkit.model.PackageLinkage
import org.ossreviewtoolkit.model.config.AnalyzerConfiguration
import org.ossreviewtoolkit.model.config.RepositoryConfiguration
import org.ossreviewtoolkit.plugins.packagemanagers.node.Npm
import org.ossreviewtoolkit.plugins.packagemanagers.node.npm.Npm
import org.ossreviewtoolkit.plugins.packagemanagers.node.yarn.NpmModuleInfo
import org.ossreviewtoolkit.plugins.packagemanagers.node.yarn.YarnDependencyHandler
import org.ossreviewtoolkit.utils.test.USER_DIR
Expand Down

0 comments on commit 0ede477

Please sign in to comment.