From cf5220ca19f74f95348ecb6e40413ef68c8e23f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Viemero=CC=88?= Date: Fri, 26 Sep 2025 08:47:49 +0300 Subject: [PATCH 01/11] Add latest minor versions for LTS versions --- builders/node.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/builders/node.js b/builders/node.js index 0ce200f..c1cb148 100644 --- a/builders/node.js +++ b/builders/node.js @@ -16,6 +16,12 @@ const supportedVersions = [ '23.2', '23.1', '22', + '22.20', + '22.19', + '22.18', + '22.17', + '22.16', + '22.15', '22.14', '22.13', '22.12', @@ -39,6 +45,7 @@ const supportedVersions = [ '21.2', '21.1', '20', + '20.19', '20.18', '20.17', '20.16', From 2a3764fc73a6170ad5bc1b3e36cc7217aa3b1a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Viemero=CC=88?= Date: Fri, 26 Sep 2025 08:48:42 +0300 Subject: [PATCH 02/11] Add support for Node 24 --- builders/node.js | 10 ++++ examples/24/.gitignore | 3 ++ examples/24/.lando.yml | 39 ++++++++++++++++ examples/24/README.md | 86 +++++++++++++++++++++++++++++++++++ examples/24/package.json | 27 +++++++++++ examples/24/src/app-custom.js | 28 ++++++++++++ examples/24/src/app-http.js | 21 +++++++++ examples/24/src/app-https.js | 28 ++++++++++++ 8 files changed, 242 insertions(+) create mode 100644 examples/24/.gitignore create mode 100644 examples/24/.lando.yml create mode 100644 examples/24/README.md create mode 100644 examples/24/package.json create mode 100644 examples/24/src/app-custom.js create mode 100644 examples/24/src/app-http.js create mode 100644 examples/24/src/app-https.js diff --git a/builders/node.js b/builders/node.js index c1cb148..9cc08f0 100644 --- a/builders/node.js +++ b/builders/node.js @@ -6,6 +6,16 @@ const _ = require('lodash'); // Constants const LEGACY_DEFAULT_VERSION = '14'; const supportedVersions = [ + '24', + '24.9', + '24.8', + '24.7', + '24.6', + '24.5', + '24.4', + '24.3', + '24.2', + '24.1', '23', '23.8', '23.7', diff --git a/examples/24/.gitignore b/examples/24/.gitignore new file mode 100644 index 0000000..740a0a4 --- /dev/null +++ b/examples/24/.gitignore @@ -0,0 +1,3 @@ +node_modules +*.log +package-lock.json diff --git a/examples/24/.lando.yml b/examples/24/.lando.yml new file mode 100644 index 0000000..97e784f --- /dev/null +++ b/examples/24/.lando.yml @@ -0,0 +1,39 @@ +name: lando-node-24 +services: + defaults: + type: node:24 + build: + - yarn + command: /app/node_modules/.bin/nodemon src/app-http.js --watch src --ignore *.test.js + cli: + type: node + compass: + type: node:24 + globals: + grunt-cli: latest + custom: + type: node:24 + ssl: true + globals: + gulp-cli: latest + port: 3000 + build: + - yarn + command: /app/node_modules/.bin/nodemon src/app-https.js --watch src --ignore *.test.js + custom2: + type: node:24.7.0 + ssl: 4444 + port: 3000 + build: + - yarn + command: /app/node_modules/.bin/nodemon src/app-custom.js --watch src --ignore *.test.js +tooling: + grunt: + service: compass + npx: + service: cli + +# This is important because it lets lando know to test against the plugin in this repo +# DO NOT REMOVE THIS! +plugins: + "@lando/node": ../.. diff --git a/examples/24/README.md b/examples/24/README.md new file mode 100644 index 0000000..7dd65b8 --- /dev/null +++ b/examples/24/README.md @@ -0,0 +1,86 @@ +# Node 24 Example + +This example exists primarily to test the following documentation: + +* [Node 14-24 Service](https://docs.devwithlando.io/tutorials/node.html) +* [Installing compass in your node service](https://docs.lando.dev/guides/using-compass-on-a-lando-node-service.html) + +## Start up tests + +Run the following commands to get up and running with this example. + +```bash +# Should start up successfully +lando poweroff +lando start +``` + +## Verification commands + +Run the following commands to validate things are rolling as they should. + +```bash +# Should use 24.x as the default version +lando exec defaults -- "env | grep NODE_VERSION=24." + +# Should use a user specified version if given +lando exec custom -- "env | grep NODE_VERSION=24." + +# Should use a user specified patch version if given +lando exec custom2 -- "env | grep NODE_VERSION=24.7.0" + +# Should serve over port 80 by default +lando exec defaults -- "curl http://localhost | grep tune" + +# Should set NODE_EXTRA_CA_CERTS with lando domain CA +lando exec defaults -- "env" | grep NODE_EXTRA_CA_CERTS | grep "$LANDO_CA_CERT" + +# Should only serve over http by default +lando exec defaults -- "curl https://localhost" || echo $? | grep 7 + +# Should serve over specified ports if given +lando exec custom -- "curl http://localhost:3000 | grep tune" + +# Should serve over https is ssl is set by user +lando exec custom -- "curl https://localhost | grep tune" + +# Should serve over a custom https port if ssl is set to a specific port +lando exec custom2 -- "curl https://localhost:4444 | grep DANCING" + +# Should run as root if using ports below 1024 +lando exec defaults -- pgrep -c -u root -f "node src/app-http.js" | grep 1 +lando exec custom -- pgrep -c -u root -f "node src/app-https.js" | grep 1 + +# Should run as node if using ports 1024 and above +lando exec custom2 -- pgrep -c -u node -f "node src/app-custom.js" | grep 1 + +# Should install global dependencies if specified by user and have them available in PATH +lando exec custom -- "gulp -v" +lando exec custom -- "which gulp | grep /var/www/.npm-global" + +# Should PATH prefer node dependency binaries installed in /app/node_modules over global ones +lando exec custom -- "npm install gulp-cli --no-save" +lando exec custom -- "gulp -v" +lando exec custom -- "which gulp | grep /app/node_modules/.bin" +lando exec custom -- "npm uninstall gulp-cli" +lando exec custom -- "which gulp | grep /var/www/.npm-global" + +# Should not serve port for cli +lando exec cli -- "curl http://localhost" || echo $? | grep 7 + +# Should install gruntcli +lando grunt -V + +# Should execute npx scripts +lando npx cowsay "Hello World" +``` + +## Destroy tests + +Run the following commands to trash this app like nothing ever happened. + +```bash +# Should be destroyed with success +lando destroy -y +lando poweroff +``` diff --git a/examples/24/package.json b/examples/24/package.json new file mode 100644 index 0000000..7f9f428 --- /dev/null +++ b/examples/24/package.json @@ -0,0 +1,27 @@ +{ + "name": "node-lando", + "version": "1.0.0", + "description": "Node example for Lando", + "main": "app.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/lando/lando/tree/master/examples/node" + }, + "keywords": [ + "node", + "docker", + "localdev" + ], + "author": "Mike Pirog", + "license": "MIT", + "dependencies": { + "express": "^4.19.2" + }, + "devDependencies": { + "grunt-contrib-compass": "^1.1.1", + "nodemon": "^3.0.1" + } +} diff --git a/examples/24/src/app-custom.js b/examples/24/src/app-custom.js new file mode 100644 index 0000000..b47fc14 --- /dev/null +++ b/examples/24/src/app-custom.js @@ -0,0 +1,28 @@ +/** + * Lando node express example + * + * @name taylorswift + */ + +'use strict'; + +// Load modules +const fs = require('fs'); +const http = require('http'); +const https = require('https'); +const express = require('express'); +const app = express(); + +// Create our HTTPS server options +const key = fs.readFileSync('/certs/cert.key'); +const cert = fs.readFileSync('/certs/cert.crt'); + +// Create our servers +https.createServer({key, cert}, app).listen(4444); +http.createServer(app).listen(3000); + +// Basic HTTP response +app.get('/', (req, res) => { + res.header('Content-type', 'text/html'); + return res.end('

DANCING DANCING STARLIGHT

'); +}); diff --git a/examples/24/src/app-http.js b/examples/24/src/app-http.js new file mode 100644 index 0000000..fe682e2 --- /dev/null +++ b/examples/24/src/app-http.js @@ -0,0 +1,21 @@ +/** + * Lando node express example + * + * @name taylorswift + */ + +'use strict'; + +// Load modules +const http = require('http'); +const express = require('express'); +const app = express(); + +// Create our server +http.createServer(app).listen(80); + +// Basic HTTP response +app.get('/', (req, res) => { + res.header('Content-type', 'text/html'); + return res.end('

I said "Oh my!" What a marvelous tune!!!

'); +}); diff --git a/examples/24/src/app-https.js b/examples/24/src/app-https.js new file mode 100644 index 0000000..84c81bf --- /dev/null +++ b/examples/24/src/app-https.js @@ -0,0 +1,28 @@ +/** + * Lando node express example + * + * @name taylorswift + */ + +'use strict'; + +// Load modules +const fs = require('fs'); +const http = require('http'); +const https = require('https'); +const express = require('express'); +const app = express(); + +// Create our HTTPS server options +const key = fs.readFileSync('/certs/cert.key'); +const cert = fs.readFileSync('/certs/cert.crt'); + +// Create our servers +https.createServer({key, cert}, app).listen(443); +http.createServer(app).listen(3000); + +// Basic HTTP response +app.get('/', (req, res) => { + res.header('Content-type', 'text/html'); + return res.end('

I said "Oh my!" What a marvelous tune!!!

'); +}); From 373aba04bb40f6de8409051451fa0e9f7193bb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Viemero=CC=88?= Date: Fri, 26 Sep 2025 08:48:51 +0300 Subject: [PATCH 03/11] Fix test:leia --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5914f2c..c90fec4 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "docs:preview": "vitepress preview docs", "lint": "eslint . --ext .js --ext .mjs ", "test:unit": "nyc --reporter=html --reporter=text mocha --timeout 5000 test/**/*.spec.js", - "test:leia": "npm run leia \"examples/**/README.md\" -c 'Destroy tests' --stdin", + "test:leia": "leia \"examples/**/README.md\" -c 'Destroy tests' --stdin", "test": "npm run lint && npm run test:unit" }, "dependencies": { From b1e198ca4074ad4bf605b9b2dc67c699368210c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Viemero=CC=88?= Date: Fri, 26 Sep 2025 08:48:57 +0300 Subject: [PATCH 04/11] Bump changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc551ea..497ad2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +* Added support for Node `24` (up to `24.9`) +* Updated Node LTS support to include the latest minor versions for `22` (up to `22.20`) and `20` (up to `20.19`) +* Fixed `test:leia` + ## v1.5.0 - [March 5, 2025](https://github.com/lando/node/releases/tag/v1.5.0) * Updated Node support to include the latest minor versions for Node `23` (up to `23.8`), `22` (up to `22.14`), `20` (up to `20.18`), `19` (up to `19.9`), `18` (up to `18.20`), and `16` (up to `16.20`) From c5fef3027231d195a529ee89bb9d35c091972247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Viemero=CC=88?= Date: Fri, 26 Sep 2025 09:01:28 +0300 Subject: [PATCH 05/11] Add 24 to docs and workflow --- .github/workflows/pr-node-tests.yml | 1 + docs/index.md | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/pr-node-tests.yml b/.github/workflows/pr-node-tests.yml index 81ee1df..4437449 100644 --- a/.github/workflows/pr-node-tests.yml +++ b/.github/workflows/pr-node-tests.yml @@ -22,6 +22,7 @@ jobs: - examples/21 - examples/22 - examples/23 + - examples/24 lando-version: - 3-edge os: diff --git a/docs/index.md b/docs/index.md index f84f7e9..d888d36 100644 --- a/docs/index.md +++ b/docs/index.md @@ -19,6 +19,7 @@ services: ## Supported versions +* [24](https://hub.docker.com/_/node) * [23](https://hub.docker.com/_/node) * [22](https://hub.docker.com/_/node) * [21](https://hub.docker.com/_/node) From 29cba7a4a755ea925543b9b6e02ea0cd32113501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Viemero=CC=88?= Date: Sat, 18 Oct 2025 14:37:55 +0300 Subject: [PATCH 06/11] Node 24.10 was released --- CHANGELOG.md | 2 +- builders/node.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 497ad2c..81a0e40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) -* Added support for Node `24` (up to `24.9`) +* Added support for Node `24` (up to `24.10`) * Updated Node LTS support to include the latest minor versions for `22` (up to `22.20`) and `20` (up to `20.19`) * Fixed `test:leia` diff --git a/builders/node.js b/builders/node.js index 9cc08f0..b60bde2 100644 --- a/builders/node.js +++ b/builders/node.js @@ -7,6 +7,7 @@ const _ = require('lodash'); const LEGACY_DEFAULT_VERSION = '14'; const supportedVersions = [ '24', + '24.10', '24.9', '24.8', '24.7', From 9dc402da1c7d271474be48d5aae54f9873486de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Viemero=CC=88?= Date: Tue, 28 Oct 2025 19:53:23 +0200 Subject: [PATCH 07/11] LTS 24.11 was released --- CHANGELOG.md | 50 ++-- builders/node.js | 601 ++++++++++++++++++++++++----------------------- 2 files changed, 334 insertions(+), 317 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81a0e40..a662dee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,73 +1,73 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) -* Added support for Node `24` (up to `24.10`) -* Updated Node LTS support to include the latest minor versions for `22` (up to `22.20`) and `20` (up to `20.19`) -* Fixed `test:leia` +- Added support for Node LTS `24` (up to `24.11`) +- Updated Node LTS support to include the latest minor versions for `22` (up to `22.20`) and `20` (up to `20.19`) +- Fixed `test:leia` ## v1.5.0 - [March 5, 2025](https://github.com/lando/node/releases/tag/v1.5.0) -* Updated Node support to include the latest minor versions for Node `23` (up to `23.8`), `22` (up to `22.14`), `20` (up to `20.18`), `19` (up to `19.9`), `18` (up to `18.20`), and `16` (up to `16.20`) -* Fixed issue causing npx scripts to fail ([#97](https://github.com/lando/node/issues/97)) +- Updated Node support to include the latest minor versions for Node `23` (up to `23.8`), `22` (up to `22.14`), `20` (up to `20.18`), `19` (up to `19.9`), `18` (up to `18.20`), and `16` (up to `16.20`) +- Fixed issue causing npx scripts to fail ([#97](https://github.com/lando/node/issues/97)) ## v1.4.0 - [December 20, 2024](https://github.com/lando/node/releases/tag/v1.4.0) -* Added support for Node 23, 22 and 21. [#92](https://github.com/lando/node/issues/92) +- Added support for Node 23, 22 and 21. [#92](https://github.com/lando/node/issues/92) ## v1.3.3 - [December 6, 2024](https://github.com/lando/node/releases/tag/v1.3.3) -* Updated the version index.md to get Docuverse page to build correctly. +- Updated the version index.md to get Docuverse page to build correctly. ## v1.3.2 - [December 4, 2024](https://github.com/lando/node/releases/tag/v1.3.2) -* Updated to [@lando/vitepress-theme-default-plus@v1.1.0-beta.24](https://github.com/lando/vitepress-theme-default-plus/releases/tag/v1.1.0-beta.24). +- Updated to [@lando/vitepress-theme-default-plus@v1.1.0-beta.24](https://github.com/lando/vitepress-theme-default-plus/releases/tag/v1.1.0-beta.24). ## v1.3.1 - [November 4, 2024](https://github.com/lando/node/releases/tag/v1.3.1) -* Updated to [@lando/vitepress-theme-default-plus@v1.1.0-beta.18](https://github.com/lando/vitepress-theme-default-plus/releases/tag/v1.1.0-beta.18). +- Updated to [@lando/vitepress-theme-default-plus@v1.1.0-beta.18](https://github.com/lando/vitepress-theme-default-plus/releases/tag/v1.1.0-beta.18). ## v1.3.0 - [October 25, 2024](https://github.com/lando/node/releases/tag/v1.3.0) -* Updated release process to generate an edge release when stable releases are created. +- Updated release process to generate an edge release when stable releases are created. ## v1.2.1 - [October 16, 2024](https://github.com/lando/node/releases/tag/v1.2.1) -* Fixed issue with `NODE_EXTRA_CA_CERTS` not being set correctly or dynamically [#85](https://github.com/lando/node/issues/85) +- Fixed issue with `NODE_EXTRA_CA_CERTS` not being set correctly or dynamically [#85](https://github.com/lando/node/issues/85) ## v1.2.0 - [March 8, 2024](https://github.com/lando/node/releases/tag/v1.2.0) -* Updated to latest database services. +- Updated to latest database services. ## v1.1.0 - [January 2, 2023](https://github.com/lando/node/releases/tag/v1.1.0) -* Added support for Node 20. [#47](https://github.com/lando/node/issues/47) +- Added support for Node 20. [#47](https://github.com/lando/node/issues/47) ## v1.0.0 - [December 7, 2023](https://github.com/lando/node/releases/tag/v1.0.0) -* Dialed fully for `lando update` +- Dialed fully for `lando update` ## v0.10.0 - [Dec 6, 2023](https://github.com/lando/node/releases/tag/v0.10.0) -* Refactored plugin structure and isolated. [#59](https://github.com/lando/node/pull/59) -* Updated dependencies. +- Refactored plugin structure and isolated. [#59](https://github.com/lando/node/pull/59) +- Updated dependencies. ## v0.9.0 - [July 3, 2023](https://github.com/lando/node/releases/tag/v0.9.0) -* Removed bundle-dependencies and version-bump-prompt from plugin. -* Updated package to use prepare-release-action. -* Updated documentation to reflect new release process. +- Removed bundle-dependencies and version-bump-prompt from plugin. +- Updated package to use prepare-release-action. +- Updated documentation to reflect new release process. ## v0.8.1 - [January 26, 2023](https://github.com/lando/node/releases/tag/v0.8.1) -* Add support for Node 13/15/17. +- Add support for Node 13/15/17. ## v0.8.0 - [January 26, 2023](https://github.com/lando/node/releases/tag/v0.8.0) -* Add support for Node 18 and 19. +- Add support for Node 18 and 19. ## v0.7.0 - [December 12, 2022](https://github.com/lando/node/releases/tag/v0.7.0) -* Added bundle-dependencies to release process. -* Fixed bug in plugin dogfooding test. +- Added bundle-dependencies to release process. +- Fixed bug in plugin dogfooding test. ## v0.6.0 - [September 7, 2022](https://github.com/lando/node/releases/tag/v0.6.0) @@ -75,10 +75,10 @@ Lando is **free** and **open source** software that relies on contributions from developers like you! If you like Lando then help us spend more time making, updating and supporting it by [contributing](https://github.com/sponsors/lando). -* Clean up unused dependencies +- Clean up unused dependencies ## v0.5.0 - [November 9, 2021](https://github.com/lando/node/releases/tag/v0.5.0) Lando is **free** and **open source** software that relies on contributions from developers like you! If you like Lando then help us spend more time making, updating and supporting it by [contributing](https://github.com/sponsors/lando). -* Initial Release +- Initial Release diff --git a/builders/node.js b/builders/node.js index b60bde2..6790a4b 100644 --- a/builders/node.js +++ b/builders/node.js @@ -1,318 +1,335 @@ -'use strict'; +"use strict"; // Modules -const _ = require('lodash'); +const _ = require("lodash"); // Constants -const LEGACY_DEFAULT_VERSION = '14'; +const LEGACY_DEFAULT_VERSION = "14"; const supportedVersions = [ - '24', - '24.10', - '24.9', - '24.8', - '24.7', - '24.6', - '24.5', - '24.4', - '24.3', - '24.2', - '24.1', - '23', - '23.8', - '23.7', - '23.6', - '23.5', - '23.4', - '23.3', - '23.2', - '23.1', - '22', - '22.20', - '22.19', - '22.18', - '22.17', - '22.16', - '22.15', - '22.14', - '22.13', - '22.12', - '22.11', - '22.10', - '22.9', - '22.8', - '22.7', - '22.6', - '22.5', - '22.4', - '22.3', - '22.2', - '22.1', - '21', - '21.7', - '21.6', - '21.5', - '21.4', - '21.3', - '21.2', - '21.1', - '20', - '20.19', - '20.18', - '20.17', - '20.16', - '20.15', - '20.14', - '20.13', - '20.12', - '20.11', - '20.10', - '20.9', - '20.8', - '20.7', - '20.6', - '20.5', - '20.4', - '20.3', - '20.2', - '20.1', - '19', - '19.9', - '19.8', - '19.7', - '19.6', - '19.5', - '19.4', - '19.3', - '19.2', - '19.1', - '18', - '18.20', - '18.19', - '18.18', - '18.17', - '18.16', - '18.15', - '18.14', - '18.13', - '18.12', - '18.11', - '18.10', - '18.9', - '18.8', - '18.7', - '18.6', - '18.5', - '18.4', - '18.3', - '18.2', - '18.1', - '17', - '17.9', - '17.8', - '17.7', - '17.6', - '17.5', - '17.4', - '17.3', - '17.2', - '17.1', - '16', - '16.20', - '16.19', - '16.18', - '16.17', - '16.16', - '16.15', - '16.14', - '16.13', - '16.12', - '16.11', - '16.10', - '16.9', - '16.8', - '16.7', - '16.6', - '16.5', - '16.4', - '16.3', - '16.2', - '16.1', - '15', - '15.14', - '15.13', - '15.12', - '15.11', - '15.10', - '15.9', - '15.8', - '15.7', - '15.6', - '15.5', - '15.4', - '15.3', - '15.2', - '15.1', - '14', - '14.21', - '14.20', - '14.19', - '14.18', - '14.17', - '14.16', - '14.15', - '14.14', - '14.13', - '14.12', - '14.11', - '14.10', - '14.9', - '14.8', - '14.7', - '14.6', - '14.5', - '14.4', - '14.3', - '14.2', - '14.1', - '13', - '13.14', - '13.13', - '13.12', - '13.11', - '13.10', - '13.9', - '13.8', - '13.7', - '13.6', - '13.5', - '13.4', - '13.3', - '13.2', - '13.1', - '12', - '12.16', - '12.15', - '12.14', - '12.13', - '12.12', - '12.11', - '12.10', - '12.9', - '12.8', - '12.7', - '12.6', - '12.5', - '12.4', - '11', - '11.15', - '11.14', - '11.13', - '11.12', - '11.11', - '11.10', - '11.9', - '11.8', - '11.7', - '11.6', - '11.5', - '11.4', - '10', - '10.19', - '10.18', - '10.17', - '10.16', - '10.15', - '10.14', - '10.13', - '8', - '8.14', - '6', - '6.15', + "24", + "24.11", + "24.10", + "24.9", + "24.8", + "24.7", + "24.6", + "24.5", + "24.4", + "24.3", + "24.2", + "24.1", + "23", + "23.8", + "23.7", + "23.6", + "23.5", + "23.4", + "23.3", + "23.2", + "23.1", + "22", + "22.20", + "22.19", + "22.18", + "22.17", + "22.16", + "22.15", + "22.14", + "22.13", + "22.12", + "22.11", + "22.10", + "22.9", + "22.8", + "22.7", + "22.6", + "22.5", + "22.4", + "22.3", + "22.2", + "22.1", + "21", + "21.7", + "21.6", + "21.5", + "21.4", + "21.3", + "21.2", + "21.1", + "20", + "20.19", + "20.18", + "20.17", + "20.16", + "20.15", + "20.14", + "20.13", + "20.12", + "20.11", + "20.10", + "20.9", + "20.8", + "20.7", + "20.6", + "20.5", + "20.4", + "20.3", + "20.2", + "20.1", + "19", + "19.9", + "19.8", + "19.7", + "19.6", + "19.5", + "19.4", + "19.3", + "19.2", + "19.1", + "18", + "18.20", + "18.19", + "18.18", + "18.17", + "18.16", + "18.15", + "18.14", + "18.13", + "18.12", + "18.11", + "18.10", + "18.9", + "18.8", + "18.7", + "18.6", + "18.5", + "18.4", + "18.3", + "18.2", + "18.1", + "17", + "17.9", + "17.8", + "17.7", + "17.6", + "17.5", + "17.4", + "17.3", + "17.2", + "17.1", + "16", + "16.20", + "16.19", + "16.18", + "16.17", + "16.16", + "16.15", + "16.14", + "16.13", + "16.12", + "16.11", + "16.10", + "16.9", + "16.8", + "16.7", + "16.6", + "16.5", + "16.4", + "16.3", + "16.2", + "16.1", + "15", + "15.14", + "15.13", + "15.12", + "15.11", + "15.10", + "15.9", + "15.8", + "15.7", + "15.6", + "15.5", + "15.4", + "15.3", + "15.2", + "15.1", + "14", + "14.21", + "14.20", + "14.19", + "14.18", + "14.17", + "14.16", + "14.15", + "14.14", + "14.13", + "14.12", + "14.11", + "14.10", + "14.9", + "14.8", + "14.7", + "14.6", + "14.5", + "14.4", + "14.3", + "14.2", + "14.1", + "13", + "13.14", + "13.13", + "13.12", + "13.11", + "13.10", + "13.9", + "13.8", + "13.7", + "13.6", + "13.5", + "13.4", + "13.3", + "13.2", + "13.1", + "12", + "12.16", + "12.15", + "12.14", + "12.13", + "12.12", + "12.11", + "12.10", + "12.9", + "12.8", + "12.7", + "12.6", + "12.5", + "12.4", + "11", + "11.15", + "11.14", + "11.13", + "11.12", + "11.11", + "11.10", + "11.9", + "11.8", + "11.7", + "11.6", + "11.5", + "11.4", + "10", + "10.19", + "10.18", + "10.17", + "10.16", + "10.15", + "10.14", + "10.13", + "8", + "8.14", + "6", + "6.15", ]; /* * Helper to build a package string */ -const pkger = (pkg, version = 'latest') => `${pkg}@${version}`; +const pkger = (pkg, version = "latest") => `${pkg}@${version}`; // Builder module.exports = { - name: 'node', + name: "node", config: { version: LEGACY_DEFAULT_VERSION, supported: supportedVersions, patchesSupported: true, - legacy: ['12', '10', '8', '6'], - command: 'tail -f /dev/null', + legacy: ["12", "10", "8", "6"], + command: "tail -f /dev/null", moreHttpPorts: [], path: [ - '/app/node_modules/.bin', - '/var/www/.npm-global/bin', - '/usr/local/sbin', - '/usr/local/bin', - '/usr/sbin', - '/usr/bin', - '/sbin', - '/bin', + "/app/node_modules/.bin", + "/var/www/.npm-global/bin", + "/usr/local/sbin", + "/usr/local/bin", + "/usr/sbin", + "/usr/bin", + "/sbin", + "/bin", ], - port: '80', + port: "80", ssl: false, - volumes: ['/usr/local/bin', '/usr/local/share'], + volumes: ["/usr/local/bin", "/usr/local/share"], }, - parent: '_appserver', - builder: (parent, config) => class LandoNode extends parent { - constructor(id, options = {}) { - options = _.merge({}, config, options); - // Make sure our command is an array - if (!_.isArray(options.command)) options.command = [options.command]; - options.command = options.command.join(' && '); + parent: "_appserver", + builder: (parent, config) => + class LandoNode extends parent { + constructor(id, options = {}) { + options = _.merge({}, config, options); + // Make sure our command is an array + if (!_.isArray(options.command)) options.command = [options.command]; + options.command = options.command.join(" && "); - // Build the nodez - const node = { - image: `node:${options.version}`, - environment: { - PATH: options.path.join(':'), - NODE_EXTRA_CA_CERTS: _.get(options, '_app._config.appEnv.LANDO_CA_CERT', '/lando/certs/LandoCA.crt'), - NODE_OPTIONS: '--use-openssl-ca', - NPM_CONFIG_PREFIX: '/var/www/.npm-global', - LANDO_WEBROOT_USER: 'node', - LANDO_WEBROOT_GROUP: 'node', - LANDO_WEBROOT_UID: '1000', - LANDO_WEBROOT_GID: '1000', - }, - ports: (options.command !== 'tail -f /dev/null' && options.port !== false) ? [options.port] : [], - volumes: options.volumes, - command: `/bin/sh -c "${options.command}"`, - }; - // Change the me user - options.meUser = 'node'; - // Add port to "moreHttpsPorts" - options.moreHttpPorts.push(options.port); - // Add our npm things to run step - let commands = ['mkdir -p $NPM_CONFIG_PREFIX/{bin,lib,share}']; - if (!_.isEmpty(options.globals)) { - commands = require('../utils/get-install-commands')(options.globals, pkger, ['npm', 'install', '-g']); - } - require('../utils/add-build-step')(commands, options._app, options.name); - // Set the sport and moreHttpPorts if ssl is numeric - if (options.ssl) { - options.sport = _.isInteger(options.ssl) ? options.ssl : 443; - options.moreHttpPorts.push(options.sport); - options.ssl = true; - } + // Build the nodez + const node = { + image: `node:${options.version}`, + environment: { + PATH: options.path.join(":"), + NODE_EXTRA_CA_CERTS: _.get( + options, + "_app._config.appEnv.LANDO_CA_CERT", + "/lando/certs/LandoCA.crt" + ), + NODE_OPTIONS: "--use-openssl-ca", + NPM_CONFIG_PREFIX: "/var/www/.npm-global", + LANDO_WEBROOT_USER: "node", + LANDO_WEBROOT_GROUP: "node", + LANDO_WEBROOT_UID: "1000", + LANDO_WEBROOT_GID: "1000", + }, + ports: + options.command !== "tail -f /dev/null" && options.port !== false + ? [options.port] + : [], + volumes: options.volumes, + command: `/bin/sh -c "${options.command}"`, + }; + // Change the me user + options.meUser = "node"; + // Add port to "moreHttpsPorts" + options.moreHttpPorts.push(options.port); + // Add our npm things to run step + let commands = ["mkdir -p $NPM_CONFIG_PREFIX/{bin,lib,share}"]; + if (!_.isEmpty(options.globals)) { + commands = require("../utils/get-install-commands")( + options.globals, + pkger, + ["npm", "install", "-g"] + ); + } + require("../utils/add-build-step")( + commands, + options._app, + options.name + ); + // Set the sport and moreHttpPorts if ssl is numeric + if (options.ssl) { + options.sport = _.isInteger(options.ssl) ? options.ssl : 443; + options.moreHttpPorts.push(options.sport); + options.ssl = true; + } - // Determine the user to run as based on port requirements - if (_.min([options.port, options.sport]) >= 1024) { - // For ports 1024 and above, we can run as the node user - node.environment.LANDO_RESET_DIR = '/certs'; - node.environment.LANDO_DROP_USER = 'node'; - } else { - // For ports below 1024, we require root privileges to bind due to Linux's security restrictions - node.environment.LANDO_DROP_USER = 'root'; - } + // Determine the user to run as based on port requirements + if (_.min([options.port, options.sport]) >= 1024) { + // For ports 1024 and above, we can run as the node user + node.environment.LANDO_RESET_DIR = "/certs"; + node.environment.LANDO_DROP_USER = "node"; + } else { + // For ports below 1024, we require root privileges to bind due to Linux's security restrictions + node.environment.LANDO_DROP_USER = "root"; + } - // Send it downstream - super(id, options, {services: _.set({}, options.name, node)}); - }; - }, + // Send it downstream + super(id, options, { services: _.set({}, options.name, node) }); + } + }, }; From e4676f09fbe8d1f2dbe3d371b2e7b2e142af8fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Viemero=CC=88?= Date: Tue, 28 Oct 2025 19:54:43 +0200 Subject: [PATCH 08/11] Revert "LTS 24.11 was released" This reverts commit 9dc402da1c7d271474be48d5aae54f9873486de2. --- CHANGELOG.md | 50 ++-- builders/node.js | 601 +++++++++++++++++++++++------------------------ 2 files changed, 317 insertions(+), 334 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a662dee..81a0e40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,73 +1,73 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) -- Added support for Node LTS `24` (up to `24.11`) -- Updated Node LTS support to include the latest minor versions for `22` (up to `22.20`) and `20` (up to `20.19`) -- Fixed `test:leia` +* Added support for Node `24` (up to `24.10`) +* Updated Node LTS support to include the latest minor versions for `22` (up to `22.20`) and `20` (up to `20.19`) +* Fixed `test:leia` ## v1.5.0 - [March 5, 2025](https://github.com/lando/node/releases/tag/v1.5.0) -- Updated Node support to include the latest minor versions for Node `23` (up to `23.8`), `22` (up to `22.14`), `20` (up to `20.18`), `19` (up to `19.9`), `18` (up to `18.20`), and `16` (up to `16.20`) -- Fixed issue causing npx scripts to fail ([#97](https://github.com/lando/node/issues/97)) +* Updated Node support to include the latest minor versions for Node `23` (up to `23.8`), `22` (up to `22.14`), `20` (up to `20.18`), `19` (up to `19.9`), `18` (up to `18.20`), and `16` (up to `16.20`) +* Fixed issue causing npx scripts to fail ([#97](https://github.com/lando/node/issues/97)) ## v1.4.0 - [December 20, 2024](https://github.com/lando/node/releases/tag/v1.4.0) -- Added support for Node 23, 22 and 21. [#92](https://github.com/lando/node/issues/92) +* Added support for Node 23, 22 and 21. [#92](https://github.com/lando/node/issues/92) ## v1.3.3 - [December 6, 2024](https://github.com/lando/node/releases/tag/v1.3.3) -- Updated the version index.md to get Docuverse page to build correctly. +* Updated the version index.md to get Docuverse page to build correctly. ## v1.3.2 - [December 4, 2024](https://github.com/lando/node/releases/tag/v1.3.2) -- Updated to [@lando/vitepress-theme-default-plus@v1.1.0-beta.24](https://github.com/lando/vitepress-theme-default-plus/releases/tag/v1.1.0-beta.24). +* Updated to [@lando/vitepress-theme-default-plus@v1.1.0-beta.24](https://github.com/lando/vitepress-theme-default-plus/releases/tag/v1.1.0-beta.24). ## v1.3.1 - [November 4, 2024](https://github.com/lando/node/releases/tag/v1.3.1) -- Updated to [@lando/vitepress-theme-default-plus@v1.1.0-beta.18](https://github.com/lando/vitepress-theme-default-plus/releases/tag/v1.1.0-beta.18). +* Updated to [@lando/vitepress-theme-default-plus@v1.1.0-beta.18](https://github.com/lando/vitepress-theme-default-plus/releases/tag/v1.1.0-beta.18). ## v1.3.0 - [October 25, 2024](https://github.com/lando/node/releases/tag/v1.3.0) -- Updated release process to generate an edge release when stable releases are created. +* Updated release process to generate an edge release when stable releases are created. ## v1.2.1 - [October 16, 2024](https://github.com/lando/node/releases/tag/v1.2.1) -- Fixed issue with `NODE_EXTRA_CA_CERTS` not being set correctly or dynamically [#85](https://github.com/lando/node/issues/85) +* Fixed issue with `NODE_EXTRA_CA_CERTS` not being set correctly or dynamically [#85](https://github.com/lando/node/issues/85) ## v1.2.0 - [March 8, 2024](https://github.com/lando/node/releases/tag/v1.2.0) -- Updated to latest database services. +* Updated to latest database services. ## v1.1.0 - [January 2, 2023](https://github.com/lando/node/releases/tag/v1.1.0) -- Added support for Node 20. [#47](https://github.com/lando/node/issues/47) +* Added support for Node 20. [#47](https://github.com/lando/node/issues/47) ## v1.0.0 - [December 7, 2023](https://github.com/lando/node/releases/tag/v1.0.0) -- Dialed fully for `lando update` +* Dialed fully for `lando update` ## v0.10.0 - [Dec 6, 2023](https://github.com/lando/node/releases/tag/v0.10.0) -- Refactored plugin structure and isolated. [#59](https://github.com/lando/node/pull/59) -- Updated dependencies. +* Refactored plugin structure and isolated. [#59](https://github.com/lando/node/pull/59) +* Updated dependencies. ## v0.9.0 - [July 3, 2023](https://github.com/lando/node/releases/tag/v0.9.0) -- Removed bundle-dependencies and version-bump-prompt from plugin. -- Updated package to use prepare-release-action. -- Updated documentation to reflect new release process. +* Removed bundle-dependencies and version-bump-prompt from plugin. +* Updated package to use prepare-release-action. +* Updated documentation to reflect new release process. ## v0.8.1 - [January 26, 2023](https://github.com/lando/node/releases/tag/v0.8.1) -- Add support for Node 13/15/17. +* Add support for Node 13/15/17. ## v0.8.0 - [January 26, 2023](https://github.com/lando/node/releases/tag/v0.8.0) -- Add support for Node 18 and 19. +* Add support for Node 18 and 19. ## v0.7.0 - [December 12, 2022](https://github.com/lando/node/releases/tag/v0.7.0) -- Added bundle-dependencies to release process. -- Fixed bug in plugin dogfooding test. +* Added bundle-dependencies to release process. +* Fixed bug in plugin dogfooding test. ## v0.6.0 - [September 7, 2022](https://github.com/lando/node/releases/tag/v0.6.0) @@ -75,10 +75,10 @@ Lando is **free** and **open source** software that relies on contributions from developers like you! If you like Lando then help us spend more time making, updating and supporting it by [contributing](https://github.com/sponsors/lando). -- Clean up unused dependencies +* Clean up unused dependencies ## v0.5.0 - [November 9, 2021](https://github.com/lando/node/releases/tag/v0.5.0) Lando is **free** and **open source** software that relies on contributions from developers like you! If you like Lando then help us spend more time making, updating and supporting it by [contributing](https://github.com/sponsors/lando). -- Initial Release +* Initial Release diff --git a/builders/node.js b/builders/node.js index 6790a4b..b60bde2 100644 --- a/builders/node.js +++ b/builders/node.js @@ -1,335 +1,318 @@ -"use strict"; +'use strict'; // Modules -const _ = require("lodash"); +const _ = require('lodash'); // Constants -const LEGACY_DEFAULT_VERSION = "14"; +const LEGACY_DEFAULT_VERSION = '14'; const supportedVersions = [ - "24", - "24.11", - "24.10", - "24.9", - "24.8", - "24.7", - "24.6", - "24.5", - "24.4", - "24.3", - "24.2", - "24.1", - "23", - "23.8", - "23.7", - "23.6", - "23.5", - "23.4", - "23.3", - "23.2", - "23.1", - "22", - "22.20", - "22.19", - "22.18", - "22.17", - "22.16", - "22.15", - "22.14", - "22.13", - "22.12", - "22.11", - "22.10", - "22.9", - "22.8", - "22.7", - "22.6", - "22.5", - "22.4", - "22.3", - "22.2", - "22.1", - "21", - "21.7", - "21.6", - "21.5", - "21.4", - "21.3", - "21.2", - "21.1", - "20", - "20.19", - "20.18", - "20.17", - "20.16", - "20.15", - "20.14", - "20.13", - "20.12", - "20.11", - "20.10", - "20.9", - "20.8", - "20.7", - "20.6", - "20.5", - "20.4", - "20.3", - "20.2", - "20.1", - "19", - "19.9", - "19.8", - "19.7", - "19.6", - "19.5", - "19.4", - "19.3", - "19.2", - "19.1", - "18", - "18.20", - "18.19", - "18.18", - "18.17", - "18.16", - "18.15", - "18.14", - "18.13", - "18.12", - "18.11", - "18.10", - "18.9", - "18.8", - "18.7", - "18.6", - "18.5", - "18.4", - "18.3", - "18.2", - "18.1", - "17", - "17.9", - "17.8", - "17.7", - "17.6", - "17.5", - "17.4", - "17.3", - "17.2", - "17.1", - "16", - "16.20", - "16.19", - "16.18", - "16.17", - "16.16", - "16.15", - "16.14", - "16.13", - "16.12", - "16.11", - "16.10", - "16.9", - "16.8", - "16.7", - "16.6", - "16.5", - "16.4", - "16.3", - "16.2", - "16.1", - "15", - "15.14", - "15.13", - "15.12", - "15.11", - "15.10", - "15.9", - "15.8", - "15.7", - "15.6", - "15.5", - "15.4", - "15.3", - "15.2", - "15.1", - "14", - "14.21", - "14.20", - "14.19", - "14.18", - "14.17", - "14.16", - "14.15", - "14.14", - "14.13", - "14.12", - "14.11", - "14.10", - "14.9", - "14.8", - "14.7", - "14.6", - "14.5", - "14.4", - "14.3", - "14.2", - "14.1", - "13", - "13.14", - "13.13", - "13.12", - "13.11", - "13.10", - "13.9", - "13.8", - "13.7", - "13.6", - "13.5", - "13.4", - "13.3", - "13.2", - "13.1", - "12", - "12.16", - "12.15", - "12.14", - "12.13", - "12.12", - "12.11", - "12.10", - "12.9", - "12.8", - "12.7", - "12.6", - "12.5", - "12.4", - "11", - "11.15", - "11.14", - "11.13", - "11.12", - "11.11", - "11.10", - "11.9", - "11.8", - "11.7", - "11.6", - "11.5", - "11.4", - "10", - "10.19", - "10.18", - "10.17", - "10.16", - "10.15", - "10.14", - "10.13", - "8", - "8.14", - "6", - "6.15", + '24', + '24.10', + '24.9', + '24.8', + '24.7', + '24.6', + '24.5', + '24.4', + '24.3', + '24.2', + '24.1', + '23', + '23.8', + '23.7', + '23.6', + '23.5', + '23.4', + '23.3', + '23.2', + '23.1', + '22', + '22.20', + '22.19', + '22.18', + '22.17', + '22.16', + '22.15', + '22.14', + '22.13', + '22.12', + '22.11', + '22.10', + '22.9', + '22.8', + '22.7', + '22.6', + '22.5', + '22.4', + '22.3', + '22.2', + '22.1', + '21', + '21.7', + '21.6', + '21.5', + '21.4', + '21.3', + '21.2', + '21.1', + '20', + '20.19', + '20.18', + '20.17', + '20.16', + '20.15', + '20.14', + '20.13', + '20.12', + '20.11', + '20.10', + '20.9', + '20.8', + '20.7', + '20.6', + '20.5', + '20.4', + '20.3', + '20.2', + '20.1', + '19', + '19.9', + '19.8', + '19.7', + '19.6', + '19.5', + '19.4', + '19.3', + '19.2', + '19.1', + '18', + '18.20', + '18.19', + '18.18', + '18.17', + '18.16', + '18.15', + '18.14', + '18.13', + '18.12', + '18.11', + '18.10', + '18.9', + '18.8', + '18.7', + '18.6', + '18.5', + '18.4', + '18.3', + '18.2', + '18.1', + '17', + '17.9', + '17.8', + '17.7', + '17.6', + '17.5', + '17.4', + '17.3', + '17.2', + '17.1', + '16', + '16.20', + '16.19', + '16.18', + '16.17', + '16.16', + '16.15', + '16.14', + '16.13', + '16.12', + '16.11', + '16.10', + '16.9', + '16.8', + '16.7', + '16.6', + '16.5', + '16.4', + '16.3', + '16.2', + '16.1', + '15', + '15.14', + '15.13', + '15.12', + '15.11', + '15.10', + '15.9', + '15.8', + '15.7', + '15.6', + '15.5', + '15.4', + '15.3', + '15.2', + '15.1', + '14', + '14.21', + '14.20', + '14.19', + '14.18', + '14.17', + '14.16', + '14.15', + '14.14', + '14.13', + '14.12', + '14.11', + '14.10', + '14.9', + '14.8', + '14.7', + '14.6', + '14.5', + '14.4', + '14.3', + '14.2', + '14.1', + '13', + '13.14', + '13.13', + '13.12', + '13.11', + '13.10', + '13.9', + '13.8', + '13.7', + '13.6', + '13.5', + '13.4', + '13.3', + '13.2', + '13.1', + '12', + '12.16', + '12.15', + '12.14', + '12.13', + '12.12', + '12.11', + '12.10', + '12.9', + '12.8', + '12.7', + '12.6', + '12.5', + '12.4', + '11', + '11.15', + '11.14', + '11.13', + '11.12', + '11.11', + '11.10', + '11.9', + '11.8', + '11.7', + '11.6', + '11.5', + '11.4', + '10', + '10.19', + '10.18', + '10.17', + '10.16', + '10.15', + '10.14', + '10.13', + '8', + '8.14', + '6', + '6.15', ]; /* * Helper to build a package string */ -const pkger = (pkg, version = "latest") => `${pkg}@${version}`; +const pkger = (pkg, version = 'latest') => `${pkg}@${version}`; // Builder module.exports = { - name: "node", + name: 'node', config: { version: LEGACY_DEFAULT_VERSION, supported: supportedVersions, patchesSupported: true, - legacy: ["12", "10", "8", "6"], - command: "tail -f /dev/null", + legacy: ['12', '10', '8', '6'], + command: 'tail -f /dev/null', moreHttpPorts: [], path: [ - "/app/node_modules/.bin", - "/var/www/.npm-global/bin", - "/usr/local/sbin", - "/usr/local/bin", - "/usr/sbin", - "/usr/bin", - "/sbin", - "/bin", + '/app/node_modules/.bin', + '/var/www/.npm-global/bin', + '/usr/local/sbin', + '/usr/local/bin', + '/usr/sbin', + '/usr/bin', + '/sbin', + '/bin', ], - port: "80", + port: '80', ssl: false, - volumes: ["/usr/local/bin", "/usr/local/share"], + volumes: ['/usr/local/bin', '/usr/local/share'], }, - parent: "_appserver", - builder: (parent, config) => - class LandoNode extends parent { - constructor(id, options = {}) { - options = _.merge({}, config, options); - // Make sure our command is an array - if (!_.isArray(options.command)) options.command = [options.command]; - options.command = options.command.join(" && "); + parent: '_appserver', + builder: (parent, config) => class LandoNode extends parent { + constructor(id, options = {}) { + options = _.merge({}, config, options); + // Make sure our command is an array + if (!_.isArray(options.command)) options.command = [options.command]; + options.command = options.command.join(' && '); - // Build the nodez - const node = { - image: `node:${options.version}`, - environment: { - PATH: options.path.join(":"), - NODE_EXTRA_CA_CERTS: _.get( - options, - "_app._config.appEnv.LANDO_CA_CERT", - "/lando/certs/LandoCA.crt" - ), - NODE_OPTIONS: "--use-openssl-ca", - NPM_CONFIG_PREFIX: "/var/www/.npm-global", - LANDO_WEBROOT_USER: "node", - LANDO_WEBROOT_GROUP: "node", - LANDO_WEBROOT_UID: "1000", - LANDO_WEBROOT_GID: "1000", - }, - ports: - options.command !== "tail -f /dev/null" && options.port !== false - ? [options.port] - : [], - volumes: options.volumes, - command: `/bin/sh -c "${options.command}"`, - }; - // Change the me user - options.meUser = "node"; - // Add port to "moreHttpsPorts" - options.moreHttpPorts.push(options.port); - // Add our npm things to run step - let commands = ["mkdir -p $NPM_CONFIG_PREFIX/{bin,lib,share}"]; - if (!_.isEmpty(options.globals)) { - commands = require("../utils/get-install-commands")( - options.globals, - pkger, - ["npm", "install", "-g"] - ); - } - require("../utils/add-build-step")( - commands, - options._app, - options.name - ); - // Set the sport and moreHttpPorts if ssl is numeric - if (options.ssl) { - options.sport = _.isInteger(options.ssl) ? options.ssl : 443; - options.moreHttpPorts.push(options.sport); - options.ssl = true; - } - - // Determine the user to run as based on port requirements - if (_.min([options.port, options.sport]) >= 1024) { - // For ports 1024 and above, we can run as the node user - node.environment.LANDO_RESET_DIR = "/certs"; - node.environment.LANDO_DROP_USER = "node"; - } else { - // For ports below 1024, we require root privileges to bind due to Linux's security restrictions - node.environment.LANDO_DROP_USER = "root"; - } + // Build the nodez + const node = { + image: `node:${options.version}`, + environment: { + PATH: options.path.join(':'), + NODE_EXTRA_CA_CERTS: _.get(options, '_app._config.appEnv.LANDO_CA_CERT', '/lando/certs/LandoCA.crt'), + NODE_OPTIONS: '--use-openssl-ca', + NPM_CONFIG_PREFIX: '/var/www/.npm-global', + LANDO_WEBROOT_USER: 'node', + LANDO_WEBROOT_GROUP: 'node', + LANDO_WEBROOT_UID: '1000', + LANDO_WEBROOT_GID: '1000', + }, + ports: (options.command !== 'tail -f /dev/null' && options.port !== false) ? [options.port] : [], + volumes: options.volumes, + command: `/bin/sh -c "${options.command}"`, + }; + // Change the me user + options.meUser = 'node'; + // Add port to "moreHttpsPorts" + options.moreHttpPorts.push(options.port); + // Add our npm things to run step + let commands = ['mkdir -p $NPM_CONFIG_PREFIX/{bin,lib,share}']; + if (!_.isEmpty(options.globals)) { + commands = require('../utils/get-install-commands')(options.globals, pkger, ['npm', 'install', '-g']); + } + require('../utils/add-build-step')(commands, options._app, options.name); + // Set the sport and moreHttpPorts if ssl is numeric + if (options.ssl) { + options.sport = _.isInteger(options.ssl) ? options.ssl : 443; + options.moreHttpPorts.push(options.sport); + options.ssl = true; + } - // Send it downstream - super(id, options, { services: _.set({}, options.name, node) }); + // Determine the user to run as based on port requirements + if (_.min([options.port, options.sport]) >= 1024) { + // For ports 1024 and above, we can run as the node user + node.environment.LANDO_RESET_DIR = '/certs'; + node.environment.LANDO_DROP_USER = 'node'; + } else { + // For ports below 1024, we require root privileges to bind due to Linux's security restrictions + node.environment.LANDO_DROP_USER = 'root'; } - }, + + // Send it downstream + super(id, options, {services: _.set({}, options.name, node)}); + }; + }, }; From ca29c5e91e4fe6c3677c3d550031b0894653e220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Viemero=CC=88?= Date: Tue, 28 Oct 2025 19:55:18 +0200 Subject: [PATCH 09/11] LTS 24.11 was released Fixed commit without breaking formatting. --- CHANGELOG.md | 2 +- builders/node.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81a0e40..58a060d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) -* Added support for Node `24` (up to `24.10`) +* Added support for Node LTS `24` (up to `24.11`) * Updated Node LTS support to include the latest minor versions for `22` (up to `22.20`) and `20` (up to `20.19`) * Fixed `test:leia` diff --git a/builders/node.js b/builders/node.js index b60bde2..55606ed 100644 --- a/builders/node.js +++ b/builders/node.js @@ -7,6 +7,7 @@ const _ = require('lodash'); const LEGACY_DEFAULT_VERSION = '14'; const supportedVersions = [ '24', + '24.11', '24.10', '24.9', '24.8', From 9b3f3cfd48a419a5dd433afbf876d702acd29edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Viemero=CC=88?= Date: Wed, 29 Oct 2025 08:27:18 +0200 Subject: [PATCH 10/11] Node 22.21 was released --- CHANGELOG.md | 2 +- builders/node.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58a060d..bcbc0ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) * Added support for Node LTS `24` (up to `24.11`) -* Updated Node LTS support to include the latest minor versions for `22` (up to `22.20`) and `20` (up to `20.19`) +* Updated Node LTS support to include the latest minor versions for `22` (up to `22.21`) and `20` (up to `20.19`) * Fixed `test:leia` ## v1.5.0 - [March 5, 2025](https://github.com/lando/node/releases/tag/v1.5.0) diff --git a/builders/node.js b/builders/node.js index 55606ed..55a0883 100644 --- a/builders/node.js +++ b/builders/node.js @@ -28,6 +28,7 @@ const supportedVersions = [ '23.2', '23.1', '22', + '22.21', '22.20', '22.19', '22.18', From 776e00d2ef2a8ed691119a93ac572a92d4977a9e Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Fri, 5 Dec 2025 19:44:17 -0500 Subject: [PATCH 11/11] refresh docs & devops --- .github/workflows/pr-docs-tests.yml | 6 +++--- .github/workflows/pr-linter.yml | 6 +++--- .github/workflows/pr-node-tests.yml | 6 +++--- .github/workflows/pr-unit-tests.yml | 8 ++++---- .github/workflows/release.yml | 17 +++++++++-------- README.md | 2 +- docs/config.md | 8 ++++---- docs/development.md | 2 +- docs/index.md | 5 ++--- docs/install.md | 2 +- netlify.toml | 6 +----- package.json | 2 +- 12 files changed, 33 insertions(+), 37 deletions(-) diff --git a/.github/workflows/pr-docs-tests.yml b/.github/workflows/pr-docs-tests.yml index ea07050..908d18d 100644 --- a/.github/workflows/pr-docs-tests.yml +++ b/.github/workflows/pr-docs-tests.yml @@ -11,11 +11,11 @@ jobs: os: - ubuntu-24.04 node-version: - - '18' + - '20' steps: # Install deps and cache - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Cache version builds uses: actions/cache@v4 with: @@ -23,7 +23,7 @@ jobs: path: docs/.vitepress/cache/@lando/mvb save-always: true - name: Install node ${{ matrix.node-version }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} cache: npm diff --git a/.github/workflows/pr-linter.yml b/.github/workflows/pr-linter.yml index dcad303..37bc23b 100644 --- a/.github/workflows/pr-linter.yml +++ b/.github/workflows/pr-linter.yml @@ -11,13 +11,13 @@ jobs: os: - ubuntu-24.04 node-version: - - '18' + - '20' steps: # Install deps and cache - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install node ${{ matrix.node-version }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} cache: npm diff --git a/.github/workflows/pr-node-tests.yml b/.github/workflows/pr-node-tests.yml index 4437449..dc690dd 100644 --- a/.github/workflows/pr-node-tests.yml +++ b/.github/workflows/pr-node-tests.yml @@ -28,12 +28,12 @@ jobs: os: - ubuntu-24.04 node-version: - - '18' + - '20' steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install node ${{ matrix.node-version }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} registry-url: https://registry.npmjs.org diff --git a/.github/workflows/pr-unit-tests.yml b/.github/workflows/pr-unit-tests.yml index e9047c8..ad21efc 100644 --- a/.github/workflows/pr-unit-tests.yml +++ b/.github/workflows/pr-unit-tests.yml @@ -11,15 +11,15 @@ jobs: os: - windows-2022 - ubuntu-24.04 - - macos-14 + - macos-15 node-version: - - '18' + - '20' steps: # Install deps and cache - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install node ${{ matrix.node-version }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} cache: npm diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1135c23..f794ea7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,11 @@ name: Publish to NPM on: release: types: - - published - - edited + - created + +permissions: + id-token: write + contents: read jobs: deploy: @@ -18,11 +21,10 @@ jobs: node-version: - '20' steps: - # Install deps and cache - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install node ${{ matrix.node-version }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} registry-url: https://registry.npmjs.org @@ -30,13 +32,11 @@ jobs: - name: Install dependencies run: npm clean-install --prefer-offline --frozen-lockfile - # Let's do tests rq just to make sure we dont push something that is fundamentally broken - name: Lint code run: npm run lint - name: Run unit tests run: npm run test:unit - # Prepare release. - name: Prepare release uses: lando/prepare-release-action@v3 with: @@ -45,7 +45,8 @@ jobs: sync-token: ${{ secrets.RTFM47_COAXIUM_INJECTOR }} sync-username: rtfm-47 - # Deploy + - name: Upgrade npm for trusted publishing + run: npm install -g "npm@^11.5.1" - name: Publish to npm run: | VERSION=$(node -p "require('./package.json').version") diff --git a/README.md b/README.md index c83108d..96d0301 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Add a `node` service to your Landofile ```yaml services: myservice: - type: node:16 + type: node:24 command: npm start ``` diff --git a/docs/config.md b/docs/config.md index d925ef6..cab9c17 100644 --- a/docs/config.md +++ b/docs/config.md @@ -12,7 +12,7 @@ Also note that options, in addition to the [build steps](https://docs.lando.dev/ ```yaml services: myservice: - type: node:18 + type: node:24 ssl: false command: tail -f /dev/null globals: [] @@ -70,7 +70,7 @@ You can also set `ssl` to a specific port. This will do the same thing as `ssl: ```yaml services: myservice: - type: node + type: node:24 port: 3000 ssl: 4444 ``` @@ -90,7 +90,7 @@ An example of globally installing the `latest` `gulp-cli` is shown below: ```yaml services: myservice: - type: node + type: node:24 globals: gulp-cli: latest command: npm start @@ -101,7 +101,7 @@ An example of using a [build step](https://docs.lando.dev/services/lando-3.html# ```yaml services: myservice: - type: node + type: node:24 build: - npm install command: yarn start-app diff --git a/docs/development.md b/docs/development.md index f18922d..78bd6af 100644 --- a/docs/development.md +++ b/docs/development.md @@ -13,7 +13,7 @@ At the very least you will need to have the following installed: * [Lando 3.21.0+](https://docs.lando.dev/getting-started/installation.html) preferably installed [from source](https://docs.lando.dev/install/source.html). * [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) -* [Node 18](https://nodejs.org/dist/latest-v18.x/) +* [Node 20](https://nodejs.org/dist/latest-v20.x/) ## Installation diff --git a/docs/index.md b/docs/index.md index d888d36..052257d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,7 +1,6 @@ --- title: Node Lando Plugin description: Add a highly configurable NodeJS service to Lando for local development with all the power of Docker and Docker Compose; comes with composer, xdebug and multiple versions for lols. -next: ./config.html --- # Node @@ -13,7 +12,7 @@ You can easily add it to your Lando app by adding an entry to the [services](htt ```yaml services: myservice: - type: node:16 + type: node:24 command: npm start ``` @@ -29,7 +28,7 @@ services: * [17](https://hub.docker.com/_/node) * [16](https://hub.docker.com/_/node) * [15](https://hub.docker.com/_/node) -* **[14](https://hub.docker.com/_/node)** **(default)** +* [14](https://hub.docker.com/_/node) * [custom](https://docs.lando.dev/services/lando-3.html#overrides) ## Legacy versions diff --git a/docs/install.md b/docs/install.md index 8fc3a7f..f5cf098 100644 --- a/docs/install.md +++ b/docs/install.md @@ -30,7 +30,7 @@ mkdir -p ~/.lando/plugins # Install plugin # NOTE: Modify the "npm install @lando/node" line to install a particular version eg # npm install @lando/node@0.5.2 -docker run --rm -it -v ${HOME}/.lando/plugins:/plugins -w /tmp node:18-alpine sh -c \ +docker run --rm -it -v ${HOME}/.lando/plugins:/plugins -w /tmp node:20-alpine sh -c \ "npm init -y \ && npm install @lando/node --production --flat --no-default-rc --no-lockfile --link-duplicates \ && npm install --production --cwd /tmp/node_modules/@lando/node \ diff --git a/netlify.toml b/netlify.toml index f8697f5..760a4d7 100644 --- a/netlify.toml +++ b/netlify.toml @@ -10,12 +10,10 @@ [[context.deploy-preview.plugins]] package = "netlify-plugin-checklinks" [context.deploy-preview.plugins.inputs] - todoPatterns = [ "load", "CHANGELOG.html", "x.com", "twitter.com", "/v/" ] + todoPatterns = [ "load", "CHANGELOG.html", "x.com", "twitter.com", "/v/", "https://hub.docker.com/_/node" ] skipPatterns = [ ".rss", ".gif", ".jpg" ] checkExternal = true - - # Sets our asset optimization [build.processing.css] bundle = true @@ -41,8 +39,6 @@ [plugins.inputs.audits] output_path = "reports/lighthouse.html" - - # We need this so preview environments and the base site look ok on their own [[redirects]] from = "/" diff --git a/package.json b/package.json index c90fec4..ee6f540 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "node" ], "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" }, "lando": {}, "main": "index.js",