Skip to content

Commit ce6a72c

Browse files
rtfm-47AaronFeledy
authored andcommitted
release v3.24.1 generated by @lando/prepare-release-action
1 parent ae89492 commit ce6a72c

File tree

18 files changed

+979
-205
lines changed

18 files changed

+979
-205
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})
22

3+
## v3.24.1 - [March 3, 2025](https://github.com/lando/core/releases/tag/v3.24.1)
4+
35
### Bug Fixes
46

57
* Fixed bug causing legacy excluding to fail with `utils.getNamedVolumes is not a function` [#346](https://github.com/lando/core/issues/346)

builders/_lando.js

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* @module builders/_lando
3+
* @description Lando service builder for Lando services. This module provides the base
4+
* implementation for all Lando services, handling configuration, environment setup,
5+
* and container orchestration.
6+
*/
7+
18
'use strict';
29

310
// Modules
@@ -10,13 +17,68 @@ const write = require('../utils/write-file');
1017
const {color} = require('listr2');
1118
const {nanoid} = require('nanoid');
1219

13-
/*
14-
* The lowest level lando service, this is where a lot of the deep magic lives
20+
/**
21+
* Configuration options for a Lando service.
22+
* @typedef {Object} LandoServiceConfig
23+
* @property {string} name - Service name
24+
* @property {Object} [healthcheck] - Health check configuration
25+
* @property {string} type - Service type (e.g., 'apache', 'nginx', 'php')
26+
* @property {string} userConfRoot - User config root directory
27+
* @property {string} version - Service version
28+
* @property {string} [confDest] - Config destination path in container
29+
* @property {string} [confSrc] - Config source path on host
30+
* @property {Object} [config] - Configuration files mapping (remote path -> local path)
31+
* @property {string} [data] - Data directory name for persistent storage
32+
* @property {string} [dataHome] - Data home directory name for user data
33+
* @property {string} [entrypoint] - Container entrypoint script
34+
* @property {string} [home] - Home directory path in container
35+
* @property {string[]} [moreHttpPorts] - Additional HTTP ports to expose
36+
* @property {Object} [info] - Service information for display
37+
* @property {string[]} [legacy] - Legacy versions to warn about
38+
* @property {string} [meUser] - Service user inside container
39+
* @property {boolean} [patchesSupported] - Whether patch versions are supported
40+
* @property {Object} [pinPairs] - Version pinning configuration
41+
* @property {string[]} [ports] - Ports to expose
42+
* @property {string} [project] - Project name for namespacing
43+
* @property {Object} [overrides] - Docker compose overrides
44+
* @property {boolean} [refreshCerts] - Whether to refresh SSL certificates
45+
* @property {Object} [remoteFiles] - Remote files mapping
46+
* @property {string[]} [scripts] - Additional scripts to mount
47+
* @property {boolean|string} [scriptsDir] - Scripts directory to mount
48+
* @property {string} [sport] - SSL port number
49+
* @property {boolean} [ssl] - Whether SSL is enabled
50+
* @property {boolean} [sslExpose] - Whether to expose SSL ports
51+
* @property {string[]} [supported] - List of supported versions
52+
* @property {boolean} [supportedIgnore] - Whether to ignore version support check
53+
* @property {string} [root] - Root directory for relative paths
54+
*/
55+
56+
/**
57+
* The lowest level lando service definition.
58+
* @typedef {Object} ServiceTypeLando
59+
* @property {string} parent - The parent service type to extend from.
60+
* @property {(parent: any) => any} builder - Builder function that returns a service class.
61+
*/
62+
63+
/**
64+
* Base Lando service implementation.
65+
* @type {ServiceTypeLando}
1566
*/
1667
module.exports = {
1768
name: '_lando',
1869
parent: '_compose',
70+
/**
71+
* Creates a new LandoLando service class.
72+
* @param {any} parent - The parent class to extend from.
73+
* @return {any} The LandoLando service class.
74+
*/
1975
builder: parent => class LandoLando extends parent {
76+
/**
77+
* Creates a new LandoLando service instance.
78+
* @param {string} id - The unique identifier for the service.
79+
* @param {Partial<LandoServiceConfig>} options - Service configuration options.
80+
* @param {...Object} sources - Additional configuration sources to merge.
81+
*/
2082
constructor(
2183
id,
2284
{
@@ -25,7 +87,6 @@ module.exports = {
2587
type,
2688
userConfRoot,
2789
version,
28-
// app = '',
2990
confDest = '',
3091
confSrc = '',
3192
config = {},
@@ -52,7 +113,6 @@ module.exports = {
52113
supported = ['custom'],
53114
supportedIgnore = false,
54115
root = '',
55-
// webroot = '/app',
56116
} = {},
57117
...sources
58118
) {

builders/_service.js

Lines changed: 76 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,113 @@
33
// Modules
44
const _ = require('lodash');
55

6-
/*
7-
* The lowest level lando service
6+
/**
7+
* @typedef {import('../lib/factory').ComposeService} ComposeService
8+
* @typedef {import('./_lando').LandoServiceConfig} LandoServiceConfig
9+
*/
10+
11+
/**
12+
* Configuration options for a Lando service.
13+
* @typedef {Object} ServiceConfig
14+
* @extends {LandoServiceConfig}
15+
* @property {string} [webroot] - The webroot path relative to /app
16+
* @property {number} [port] - The port to expose
17+
* @property {boolean|number} [portforward] - Whether to forward ports (true) or a specific port number
18+
* @property {Object} [_app] - Internal app configuration
19+
* @property {Object} [_app._config] - App configuration settings
20+
* @property {string} [_app._config.bindAddress] - The address to bind services to
21+
* @property {Object} [healthcheck] - Health check configuration
22+
* @property {Object} [creds] - Service credentials
23+
*/
24+
25+
/**
26+
* Base service implementation that extends the Lando base service.
27+
* @type {Object}
828
*/
929
module.exports = {
30+
/**
31+
* The name of the service.
32+
* @type {string}
33+
*/
1034
name: '_service',
35+
36+
/**
37+
* The parent service type to extend from.
38+
* @type {string}
39+
*/
1140
parent: '_lando',
41+
42+
/**
43+
* Creates a new LandoService class extending the parent class.
44+
* @param {any} parent - The parent class to extend from.
45+
* @return {any} The LandoService class.
46+
*/
1247
builder: parent => class LandoService extends parent {
48+
/**
49+
* Creates a new LandoService instance.
50+
* @param {string} id - The unique identifier for the service.
51+
* @param {Partial<ServiceConfig>} options - Service configuration options.
52+
* @param {...Object} sources - Additional configuration sources to merge.
53+
*/
1354
constructor(id, options = {}, ...sources) {
55+
// Add the service environment settings
1456
sources.push({services: _.set({}, options.name, {
1557
environment: {
58+
/**
59+
* The webroot path for the service.
60+
* @type {string}
61+
*/
1662
LANDO_WEBROOT: `/app/${options.webroot}`,
63+
/**
64+
* The type of the service.
65+
* @type {string}
66+
*/
1767
LANDO_SERVICE_TYPE: 'service',
1868
},
1969
})});
20-
// @TODO: add in any envvars for this?
21-
// Add in relevant portforward data
70+
71+
// Add port forwarding settings if specified
2272
if (options.portforward) {
2373
if (options.portforward === true) {
74+
// Add port forwarding for the service using the default port
2475
sources.push({services: _.set({}, options.name, {ports: [options.port]})});
2576
} else {
77+
// Add port forwarding with a custom port mapping
2678
sources.push({services: _.set({}, options.name, {ports: [`${options.portforward}:${options.port}`]})});
2779
}
2880
}
29-
// Add in relevant info
81+
82+
// Merge the info object with default connection settings
3083
options.info = _.merge({}, options.info, {
84+
/**
85+
* Internal connection details for service-to-service communication.
86+
* @type {Object}
87+
* @property {string} host - The service hostname
88+
* @property {number} port - The service port
89+
*/
3190
internal_connection: {
3291
host: options.name,
3392
port: options.port,
3493
},
94+
/**
95+
* External connection details for host machine access.
96+
* @type {Object}
97+
* @property {string} host - The bind address
98+
* @property {number|string} port - The forwarded port or 'not forwarded'
99+
*/
35100
external_connection: {
36101
host: options._app._config.bindAddress,
37102
port: _.get(options, 'portforward', 'not forwarded'),
38103
},
39104
});
40-
// Add in a our healthcheck if we have one
105+
106+
// Add healthcheck settings if specified
41107
if (options.healthcheck) options.info.healthcheck = options.healthcheck;
42-
// Add in creds if we have them
108+
109+
// Add credentials if specified
43110
if (options.creds) options.info.creds = options.creds;
111+
112+
// Call the parent constructor with the merged configuration
44113
super(id, options, ...sources);
45114
}
46115
},

builders/_webserver.js

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,75 @@
33
// Modules
44
const _ = require('lodash');
55

6-
/*
7-
* The lowest level lando service
6+
/**
7+
* @typedef {import('../lib/factory').ComposeService} ComposeService
8+
* @typedef {import('./_lando').LandoServiceConfig} LandoServiceConfig
9+
*/
10+
11+
/**
12+
* Configuration options for a Lando webserver service.
13+
* @typedef {Object} WebServerConfig
14+
* @extends {LandoServiceConfig}
15+
* @property {string} webroot - The webroot path relative to /app
16+
*/
17+
18+
/**
19+
* Base webserver service implementation.
20+
* @type {Object}
821
*/
922
module.exports = {
23+
/**
24+
* The name of the service.
25+
* @type {string}
26+
*/
1027
name: '_webserver',
28+
29+
/**
30+
* The parent service type to extend from.
31+
* @type {string}
32+
*/
1133
parent: '_lando',
34+
35+
/**
36+
* Creates a new LandoWebServer class extending the parent class.
37+
* @param {any} parent - The parent class to extend from.
38+
* @return {any} The LandoWebServer class.
39+
*/
1240
builder: parent => class LandoWebServer extends parent {
41+
/**
42+
* Creates a new LandoWebServer instance.
43+
* @param {string} id - The unique identifier for the service.
44+
* @param {Partial<WebServerConfig>} options - Service configuration options.
45+
* @param {...Object} sources - Additional configuration sources to merge.
46+
*/
1347
constructor(id, options = {}, ...sources) {
48+
// Add webserver-specific environment settings
1449
sources.push({services: _.set({}, options.name, {
1550
environment: {
51+
/**
52+
* The webroot path for the service.
53+
* @type {string}
54+
*/
1655
LANDO_WEBROOT: `/app/${options.webroot}`,
56+
/**
57+
* The type of the service.
58+
* @type {string}
59+
*/
1760
LANDO_SERVICE_TYPE: 'webserver',
1861
},
1962
working_dir: '/app',
2063
})});
21-
// Add in relevant info
64+
65+
// Add webserver-specific info
2266
options.info = _.merge({}, options.info, {
67+
/**
68+
* The webroot path for the service.
69+
* @type {string}
70+
*/
2371
webroot: options.webroot,
2472
});
73+
74+
// Call parent constructor with merged configuration
2575
super(id, options, ...sources);
2676
}
2777
},

builders/lando.js

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,76 @@
11
'use strict';
22

3+
/**
4+
* @typedef {import('../lib/factory').ComposeService} ComposeService
5+
* @typedef {import('./_lando').LandoServiceConfig} LandoServiceConfig
6+
*/
7+
38
const _ = require('lodash');
49

5-
/*
6-
* this should be the same as the v3 "compose" service but we are stealth loading it in core so that we can
7-
* use it for testing when the cli is decoupled from its plugins. you shouldnt really use it directly but theoretically
8-
* it should have the same docs as https://docs.lando.dev/compose/ except with "type: lando"
9-
*
10-
* we've named it "type: lando" as it most closely resembles the new lowest level typed v4 service which is also named
11-
* lando
12-
*
10+
/**
11+
* Configuration options for a Lando v3 service.
12+
* @typedef {Object} LandoV3Config
13+
* @extends {LandoServiceConfig}
14+
* @property {string} version - The version of the service
15+
* @property {Object} services - Docker compose services configuration
16+
* @property {Object} networks - Docker compose networks configuration
17+
* @property {Object} volumes - Docker compose volumes configuration
18+
*/
19+
20+
/**
21+
* This module exports a configuration object for the Lando service in Lando.
22+
* It is designed to mimic the v3 "compose" service for testing purposes when the CLI is decoupled from its plugins.
23+
* Direct use is discouraged, but it should theoretically have the same documentation as https://docs.lando.dev/compose/, except with "type: lando".
24+
* The name "type: lando" is chosen because it closely resembles the new lowest level typed v4 service, also named lando.
25+
* @type {Object}
1326
*/
1427
module.exports = {
28+
/**
29+
* The name of the service.
30+
* @type {string}
31+
*/
1532
name: 'lando',
33+
34+
/**
35+
* The API version of the service.
36+
* @type {number}
37+
*/
1638
api: 3,
39+
40+
/**
41+
* The default configuration for the service.
42+
* @type {LandoV3Config}
43+
*/
1744
config: {
1845
version: 'custom',
1946
services: {},
2047
networks: {},
2148
volumes: {},
2249
},
50+
51+
/**
52+
* The parent service type to extend from.
53+
* @type {string}
54+
*/
2355
parent: '_lando',
56+
57+
/**
58+
* Creates a new LandoServiceV3 class extending the parent class.
59+
* @param {any} parent - The parent class to extend from.
60+
* @param {LandoV3Config} config - The configuration for the service.
61+
* @return {any} The LandoServiceV3 class.
62+
*/
2463
builder: (parent, config) => class LandoServiceV3 extends parent {
64+
/**
65+
* Creates a new LandoServiceV3 instance.
66+
* @param {string} id - The unique identifier for the service.
67+
* @param {Partial<LandoV3Config>} options - Service configuration options.
68+
*/
2569
constructor(id, options = {}) {
70+
// Merge default config with provided options
2671
options = _.merge({}, config, options);
72+
73+
// Call parent constructor with merged configuration and compose settings
2774
super(id, options, {
2875
services: _.set(
2976
{},

0 commit comments

Comments
 (0)