Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/pr-node-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- examples/22
- examples/23
- examples/24
- examples/25
lando-version:
- 3-edge
os:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Added support for Node `25` (up to `25.7`)
* Updated Node support to include latest minor versions for `24` (up to `24.14`), `23` (up to `23.11`), `22` (up to `22.22`), and `20` (up to `20.20`)
* Moved Node `15`, `17`, and `19` to legacy versions in docs
* Updated docs and README examples to use Node 25

* Updated `@lando/argv` to `1.2.0`
* Updated `lodash` to `4.17.23`
* Updated `lodash-es` to `4.17.23`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Add a `node` service to your Landofile
```yaml
services:
myservice:
type: node:24
type: node:25
command: npm start
```

Expand Down
16 changes: 16 additions & 0 deletions builders/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@ const _ = require('lodash');
// Constants
const LEGACY_DEFAULT_VERSION = '14';
const supportedVersions = [
'25',
'25.7',
'25.6',
'25.5',
'25.4',
'25.3',
'25.2',
'25.1',
'24',
'24.14',
'24.13',
'24.12',
'24.11',
'24.10',
'24.9',
Expand All @@ -19,6 +30,9 @@ const supportedVersions = [
'24.2',
'24.1',
'23',
'23.11',
'23.10',
'23.9',
'23.8',
'23.7',
'23.6',
Expand All @@ -28,6 +42,7 @@ const supportedVersions = [
'23.2',
'23.1',
'22',
'22.22',
'22.21',
'22.20',
'22.19',
Expand Down Expand Up @@ -58,6 +73,7 @@ const supportedVersions = [
'21.2',
'21.1',
'20',
'20.20',
'20.19',
'20.18',
'20.17',
Expand Down
8 changes: 4 additions & 4 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Also note that options, in addition to the [build steps](https://docs.lando.dev/
```yaml
services:
myservice:
type: node:24
type: node:25
ssl: false
command: tail -f /dev/null
globals: []
Expand Down Expand Up @@ -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:24
type: node:25
port: 3000
ssl: 4444
```
Expand All @@ -90,7 +90,7 @@ An example of globally installing the `latest` `gulp-cli` is shown below:
```yaml
services:
myservice:
type: node:24
type: node:25
globals:
gulp-cli: latest
command: npm start
Expand All @@ -101,7 +101,7 @@ An example of using a [build step](https://docs.lando.dev/services/lando-3.html#
```yaml
services:
myservice:
type: node:24
type: node:25
build:
- npm install
command: yarn start-app
Expand Down
9 changes: 5 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,30 @@ You can easily add it to your Lando app by adding an entry to the [services](htt
```yaml
services:
myservice:
type: node:24
type: node:25
command: npm start
```

## Supported versions

* [25](https://hub.docker.com/_/node)
* [24](https://hub.docker.com/_/node)
* [23](https://hub.docker.com/_/node)
* [22](https://hub.docker.com/_/node)
* [21](https://hub.docker.com/_/node)
* [20](https://hub.docker.com/_/node)
* [19](https://hub.docker.com/_/node)
* [18](https://hub.docker.com/_/node)
* [17](https://hub.docker.com/_/node)
* [16](https://hub.docker.com/_/node)
* [15](https://hub.docker.com/_/node)
* [14](https://hub.docker.com/_/node)
* [custom](https://docs.lando.dev/services/lando-3.html#overrides)

## Legacy versions

You can still run these versions with Lando but for all intents and purposes they should be considered deprecated (e.g. YMMV and do not expect a ton of support if you have an issue).

* [19](https://hub.docker.com/_/node)
* [17](https://hub.docker.com/_/node)
* [15](https://hub.docker.com/_/node)
* [13](https://hub.docker.com/_/node)
* [12](https://hub.docker.com/_/node)
* [11](https://hub.docker.com/_/node)
Expand Down
3 changes: 3 additions & 0 deletions examples/25/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
*.log
package-lock.json
39 changes: 39 additions & 0 deletions examples/25/.lando.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: lando-node-25
services:
defaults:
type: node:25
build:
- yarn
command: /app/node_modules/.bin/nodemon src/app-http.js --watch src --ignore *.test.js
cli:
type: node
compass:
type: node:25
globals:
grunt-cli: latest
custom:
type: node:25
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:25.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": ../..
86 changes: 86 additions & 0 deletions examples/25/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Node 25 Example

This example exists primarily to test the following documentation:

* [Node 14-25 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 25.x as the default version
lando exec defaults -- "env | grep NODE_VERSION=25."

# Should use a user specified version if given
lando exec custom -- "env | grep NODE_VERSION=25."

# Should use a user specified patch version if given
lando exec custom2 -- "env | grep NODE_VERSION=25.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 1025
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 1025 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
```
27 changes: 27 additions & 0 deletions examples/25/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
28 changes: 28 additions & 0 deletions examples/25/src/app-custom.js
Original file line number Diff line number Diff line change
@@ -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('<h1>DANCING DANCING STARLIGHT</h1>');
});
21 changes: 21 additions & 0 deletions examples/25/src/app-http.js
Original file line number Diff line number Diff line change
@@ -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('<h1>I said "Oh my!" What a marvelous tune!!!</h1>');
});
28 changes: 28 additions & 0 deletions examples/25/src/app-https.js
Original file line number Diff line number Diff line change
@@ -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('<h1>I said "Oh my!" What a marvelous tune!!!</h1>');
});
Loading