Skip to content

Commit 98f7a92

Browse files
authored
Merge pull request #283 from node-gradle/upgrade-default-nodejs
Upgrade default node to 18 (newest LTS)
2 parents 633c204 + 72a73ba commit 98f7a92

File tree

17 files changed

+3318
-1807
lines changed

17 files changed

+3318
-1807
lines changed

.github/workflows/build-examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Install Node.js
1515
uses: actions/setup-node@v3
1616
with:
17-
node-version: 16
17+
node-version: 18
1818
- name: Install yarn
1919
run: npm install -g yarn@1.22.17
2020
- name: Gradle Version

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install Node.js
2222
uses: actions/setup-node@v3
2323
with:
24-
node-version: 16
24+
node-version: 18
2525
- name: Install yarn
2626
run: npm install -g yarn@1.22.17
2727
- name: Setup Gradle

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install Node.js
2020
uses: actions/setup-node@v3
2121
with:
22-
node-version: 16
22+
node-version: 18
2323
- name: Install yarn
2424
run: npm install -g yarn@1.22.17
2525
- name: Build

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## Version 6.x *(unreleased)*
4+
* Upgrade default Node to 18.17.1 and npm to 9.6.7
45

56
## Version 6.0.0 *(2023-08-15)*
67
* Removed deprecated `nodeModulesDir` from `NodeExtension`

docs/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ node {
204204
205205
// Version of node to download and install (only used if download is true)
206206
// It will be unpacked in the workDir
207-
version = "16.14.0"
207+
version = "18.17.1"
208208
209209
// Version of npm to use
210210
// If specified, installs it in the npmWorkDir

src/main/kotlin/com/github/gradle/node/NodeExtension.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ open class NodeExtension(project: Project) {
186186
/**
187187
* Default version of Node to download if none is set
188188
*/
189-
const val DEFAULT_NODE_VERSION = "16.14.2"
189+
const val DEFAULT_NODE_VERSION = "18.17.1"
190190

191191
/**
192192
* Default version of npm to download if none is set
193193
*/
194-
const val DEFAULT_NPM_VERSION = "8.5.0"
194+
const val DEFAULT_NPM_VERSION = "9.6.7"
195195

196196
@JvmStatic
197197
operator fun get(project: Project): NodeExtension {

src/test/groovy/com/github/gradle/node/task/NodeTask_integTest.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.github.gradle.node.task
22

33
import com.github.gradle.AbstractIntegTest
4+
import com.github.gradle.node.NodeExtension
45
import org.gradle.testkit.runner.TaskOutcome
56
import org.gradle.util.GradleVersion
67
import org.junit.Assume
@@ -87,7 +88,7 @@ class NodeTask_integTest extends AbstractIntegTest {
8788
8889
then:
8990
result9.task(":version").outcome == TaskOutcome.SUCCESS
90-
result9.output.contains("Version: v16.14.2")
91+
result9.output.contains("Version: v${DEFAULT_NODE_VERSION}")
9192
9293
where:
9394
gv << GRADLE_VERSIONS_UNDER_TEST

src/test/groovy/com/github/gradle/node/yarn/task/YarnInstall_integTest.groovy

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.github.gradle.node.yarn.task
22

33
import com.github.gradle.AbstractIntegTest
4+
import com.github.gradle.node.NodeExtension
5+
import com.github.gradle.node.NodePlugin
46
import org.gradle.testkit.runner.TaskOutcome
57

68
class YarnInstall_integTest extends AbstractIntegTest {
@@ -45,18 +47,18 @@ class YarnInstall_integTest extends AbstractIntegTest {
4547
given:
4648
gradleVersion = gv
4749
48-
writeBuild('''
50+
writeBuild("""
4951
plugins {
5052
id 'com.github.node-gradle.node'
5153
}
5254
5355
node {
5456
download = true
5557
yarnWorkDir = file('build/yarn')
56-
version = '16.14.2'
58+
version = '${NodeExtension.DEFAULT_NODE_VERSION}'
5759
npmVersion = '7.0.1'
5860
}
59-
''')
61+
""")
6062
writeEmptyPackageJson()
6163
6264
when:

src/test/resources/fixtures/kotlin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ plugins {
1616
}
1717

1818
node {
19-
version.set("16.14.0")
19+
version.set("18.17.1")
2020
npmVersion.set("")
2121
yarnVersion.set("")
2222
npmInstallCommand.set("install")

src/test/resources/fixtures/node-allow-insecure-protocol/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
}
44

55
node {
6-
version = "16.14.2"
6+
version = "18.17.1"
77
distBaseUrl = "http://nodejs.org/dist/"
88
download = true
99
allowInsecureProtocol = true

0 commit comments

Comments
 (0)