Skip to content

Commit

Permalink
Mk/Uses/nodejs.mk: Add nodejs 21 and update current and lts
Browse files Browse the repository at this point in the history
Node.js 20 is the new LTS with active LTS support since October 24, 2023.
Node.js 21 is the new current.

Reference:	https://github.com/nodejs/Release/blob/main/README.md#release-schedule
  • Loading branch information
sunpoet committed Nov 1, 2023
1 parent a102526 commit 5577e1f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Mk/Uses/nodejs.mk
Expand Up @@ -7,13 +7,13 @@
# - build use node as build-time dependency
# - run use node as runtime dependency
# - env set the environment (NODEJS_VERSION and NODEJS_SUFFIX)
# - version available version: lts, current, 16, 18, 20
# - version available version: lts, current, 16, 18, 20, 21
#
# Note:
# - The supported versions follow upstream release schedule
# https://github.com/nodejs/Release/blob/main/README.md#release-schedule
# - lts is 18 now
# - current is 20 now
# - lts is 20 now
# - current is 21 now
# - USES=nodejs means USES=nodejs:build,run
# - If you define a version, you must provide run and/or build
#
Expand All @@ -22,13 +22,13 @@
.if !defined(_INCLUDE_USES_NODEJS_MK)
_INCLUDE_USES_NODEJS_MK= yes

_VALID_NODEJS_VERSIONS= 16 18 20 current lts
_VALID_NODEJS_VERSIONS= 16 18 20 21 current lts

. if ! ${_VALID_NODEJS_VERSIONS:M${NODEJS_DEFAULT}}
IGNORE= Invalid default nodejs version ${NODEJS_DEFAULT}; valid versions are ${_VALID_NODEJS_VERSIONS}
. endif

. if !empty(nodejs_ARGS:Nbuild:Nenv:Nrun:Nlts:Ncurrent:N16:N18:N20)
. if !empty(nodejs_ARGS:Nbuild:Nenv:Nrun:Nlts:Ncurrent:N16:N18:N20:N21)
IGNORE= USES=nodejs has invalid arguments ${nodejs_ARGS}
. endif

Expand All @@ -47,7 +47,7 @@ _NODEJS_VER= ${version}
_NODEJS_VER= ${NODEJS_DEFAULT}
. endif

NODEJS_VERSION= ${_NODEJS_VER:S|current|20|:S|lts|18|}
NODEJS_VERSION= ${_NODEJS_VER:S|current|21|:S|lts|20|}
NODEJS_SUFFIX= -node${NODEJS_VERSION}

. if ${nodejs_ARGS:M*build*}
Expand Down

0 comments on commit 5577e1f

Please sign in to comment.