Skip to content

Commit 643bfd8

Browse files
committed
refactor(node)!: Rename corepackOverride
Align the name with the one in `YarnCommand` and thereby make it a tad more speaking. Signed-off-by: Frank Viernau <[email protected]>
1 parent c496127 commit 643bfd8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

plugins/package-managers/node/src/main/kotlin/yarn2/Yarn2.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ data class Yarn2Config(
6767
* auto-detection can be disabled, and the enabled status of Corepack can be explicitly specified. This is useful to
6868
* force a specific behavior in some environments.
6969
*/
70-
val corepackOverride: Boolean?
70+
val corepackEnabled: Boolean?
7171
)
7272

7373
/**
@@ -82,7 +82,7 @@ class Yarn2(override val descriptor: PluginDescriptor = Yarn2Factory.descriptor,
8282
NodePackageManager(NodePackageManagerType.YARN2) {
8383
override val globsForDefinitionFiles = listOf(NodePackageManagerType.DEFINITION_FILE)
8484
private val yarnInfoCache = mutableMapOf<String, PackageJson>()
85-
internal val yarn2Command = Yarn2Command(config.corepackOverride)
85+
internal val yarn2Command = Yarn2Command(config.corepackEnabled)
8686
private val handler = Yarn2DependencyHandler(this)
8787
override val graphBuilder = DependencyGraphBuilder(handler)
8888

plugins/package-managers/node/src/test/kotlin/yarn2/Yarn2Test.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class Yarn2Test : WordSpec({
7575
"return the default executable name if Corepack is enabled based on the configuration option" {
7676
val workingDir = tempdir()
7777

78-
val yarn = Yarn2Factory.create(corepackOverride = true)
78+
val yarn = Yarn2Factory.create(corepackEnabled = true)
7979
val command = yarn.yarn2Command.command(workingDir)
8080

8181
command shouldBe "yarn"
@@ -94,7 +94,7 @@ class Yarn2Test : WordSpec({
9494
val workingDir = tempdir()
9595
writePackageJson(workingDir, "[email protected]")
9696

97-
checkExecutableFromYarnRc(workingDir, corepackOverride = false)
97+
checkExecutableFromYarnRc(workingDir, corepackEnabled = false)
9898
}
9999
}
100100
})
@@ -103,7 +103,7 @@ class Yarn2Test : WordSpec({
103103
* Check whether an executable defined in a `.yarnrc.yml` file is used when invoked with the given [workingDir]
104104
* and [config]. This should be the case when Corepack is not enabled.
105105
*/
106-
private fun checkExecutableFromYarnRc(workingDir: File, corepackOverride: Boolean? = null) {
106+
private fun checkExecutableFromYarnRc(workingDir: File, corepackEnabled: Boolean? = null) {
107107
val executable = "yarn-wrapper.js"
108108

109109
workingDir.resolve(".yarnrc.yml").writeText("yarnPath: $executable")
@@ -112,7 +112,7 @@ private fun checkExecutableFromYarnRc(workingDir: File, corepackOverride: Boolea
112112
writeText("#!/usr/bin/env node\nconsole.log('yarn')")
113113
}
114114

115-
val yarn = Yarn2Factory.create(corepackOverride = corepackOverride)
115+
val yarn = Yarn2Factory.create(corepackEnabled = corepackEnabled)
116116
val command = yarn.yarn2Command.command(workingDir)
117117

118118
if (Os.isWindows) {

0 commit comments

Comments
 (0)