Skip to content

Commit

Permalink
Merge pull request #283 from node-gradle/upgrade-default-nodejs
Browse files Browse the repository at this point in the history
Upgrade default node to 18 (newest LTS)
  • Loading branch information
deepy authored Aug 16, 2023
2 parents 633c204 + 72a73ba commit 98f7a92
Show file tree
Hide file tree
Showing 17 changed files with 3,318 additions and 1,807 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Install yarn
run: npm install -g yarn@1.22.17
- name: Gradle Version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Install yarn
run: npm install -g yarn@1.22.17
- name: Setup Gradle
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Install yarn
run: npm install -g yarn@1.22.17
- name: Build
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

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

## Version 6.0.0 *(2023-08-15)*
* Removed deprecated `nodeModulesDir` from `NodeExtension`
Expand Down
2 changes: 1 addition & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ node {
// Version of node to download and install (only used if download is true)
// It will be unpacked in the workDir
version = "16.14.0"
version = "18.17.1"
// Version of npm to use
// If specified, installs it in the npmWorkDir
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/github/gradle/node/NodeExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ open class NodeExtension(project: Project) {
/**
* Default version of Node to download if none is set
*/
const val DEFAULT_NODE_VERSION = "16.14.2"
const val DEFAULT_NODE_VERSION = "18.17.1"

/**
* Default version of npm to download if none is set
*/
const val DEFAULT_NPM_VERSION = "8.5.0"
const val DEFAULT_NPM_VERSION = "9.6.7"

@JvmStatic
operator fun get(project: Project): NodeExtension {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.gradle.node.task

import com.github.gradle.AbstractIntegTest
import com.github.gradle.node.NodeExtension
import org.gradle.testkit.runner.TaskOutcome
import org.gradle.util.GradleVersion
import org.junit.Assume
Expand Down Expand Up @@ -87,7 +88,7 @@ class NodeTask_integTest extends AbstractIntegTest {
then:
result9.task(":version").outcome == TaskOutcome.SUCCESS
result9.output.contains("Version: v16.14.2")
result9.output.contains("Version: v${DEFAULT_NODE_VERSION}")
where:
gv << GRADLE_VERSIONS_UNDER_TEST
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.github.gradle.node.yarn.task

import com.github.gradle.AbstractIntegTest
import com.github.gradle.node.NodeExtension
import com.github.gradle.node.NodePlugin
import org.gradle.testkit.runner.TaskOutcome

class YarnInstall_integTest extends AbstractIntegTest {
Expand Down Expand Up @@ -45,18 +47,18 @@ class YarnInstall_integTest extends AbstractIntegTest {
given:
gradleVersion = gv
writeBuild('''
writeBuild("""
plugins {
id 'com.github.node-gradle.node'
}
node {
download = true
yarnWorkDir = file('build/yarn')
version = '16.14.2'
version = '${NodeExtension.DEFAULT_NODE_VERSION}'
npmVersion = '7.0.1'
}
''')
""")
writeEmptyPackageJson()
when:
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/fixtures/kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ plugins {
}

node {
version.set("16.14.0")
version.set("18.17.1")
npmVersion.set("")
yarnVersion.set("")
npmInstallCommand.set("install")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

node {
version = "16.14.2"
version = "18.17.1"
distBaseUrl = "http://nodejs.org/dist/"
download = true
allowInsecureProtocol = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

node {
version = "16.14.2"
version = "18.17.1"
distBaseUrl = "https://nodejs.org/dist/"
download = true
allowInsecureProtocol = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

node {
version = "16.14.2"
version = "18.17.1"
distBaseUrl = null
download = true
workDir = file("build/node")
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/fixtures/node/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

node {
version = "16.14.2"
version = "18.17.1"
download = true
workDir = file("build/node")
}
Expand Down
Loading

0 comments on commit 98f7a92

Please sign in to comment.