@florianpat/lando-core 3.23.22-test2 → 3.23.27-1florianPat.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -1
- package/app.js +2 -0
- package/builders/_init.js +2 -2
- package/builders/_lando.js +19 -6
- package/builders/lando-v4.js +3 -0
- package/config.yml +4 -4
- package/hooks/app-run-events.js +23 -1
- package/hooks/lando-setup-build-engine-darwin.js +3 -0
- package/hooks/lando-setup-build-engine-win32.js +2 -0
- package/hooks/lando-setup-build-engine-wsl.js +2 -0
- package/hooks/lando-setup-orchestrator.js +2 -2
- package/lib/app.js +15 -4
- package/lib/daemon.js +1 -1
- package/lib/docker.js +1 -1
- package/lib/updates.js +9 -1
- package/netlify.toml +1 -0
- package/node_modules/undici/docs/docs/api/Dispatcher.md +51 -0
- package/node_modules/undici/index.js +2 -1
- package/node_modules/undici/lib/api/api-request.js +1 -1
- package/node_modules/undici/lib/core/connect.js +5 -0
- package/node_modules/undici/lib/dispatcher/client-h2.js +20 -6
- package/node_modules/undici/lib/handler/retry-handler.js +3 -3
- package/node_modules/undici/lib/interceptor/dns.js +375 -0
- package/node_modules/undici/lib/web/cache/cache.js +1 -0
- package/node_modules/undici/lib/web/cache/cachestorage.js +2 -0
- package/node_modules/undici/lib/web/eventsource/eventsource.js +2 -0
- package/node_modules/undici/lib/web/fetch/body.js +9 -1
- package/node_modules/undici/lib/web/fetch/formdata.js +2 -0
- package/node_modules/undici/lib/web/fetch/headers.js +2 -0
- package/node_modules/undici/lib/web/fetch/index.js +1 -1
- package/node_modules/undici/lib/web/fetch/request.js +1 -0
- package/node_modules/undici/lib/web/fetch/response.js +1 -0
- package/node_modules/undici/lib/web/fetch/webidl.js +2 -0
- package/node_modules/undici/lib/web/websocket/events.js +4 -0
- package/node_modules/undici/lib/web/websocket/websocket.js +2 -0
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/interceptors.d.ts +14 -0
- package/node_modules/undici/types/retry-handler.d.ts +1 -1
- package/node_modules/undici/types/webidl.d.ts +6 -0
- package/package.json +6 -6
- package/release-aliases/3-EDGE +1 -1
- package/release-aliases/3-STABLE +1 -1
- package/scripts/install-docker-desktop.sh +1 -1
- package/scripts/install-docker-engine.sh +1 -1
- package/scripts/lando-entrypoint.sh +1 -1
- package/utils/build-tooling-task.js +1 -1
- package/utils/get-app.js +1 -2
- package/utils/get-compose-x.js +1 -1
- package/utils/get-config-defaults.js +5 -5
- package/utils/get-init-runner-defaults.js +2 -1
- package/utils/parse-events-config.js +21 -1
- package/utils/parse-tooling-config.js +6 -6
- package/utils/to-lando-container.js +16 -2
- package/checksums.txt +0 -0
package/utils/get-compose-x.js
CHANGED
|
@@ -27,7 +27,7 @@ const getDockerBin = (bin, base, pathFallback = true) => {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
module.exports = ({orchestratorVersion = '2.
|
|
30
|
+
module.exports = ({orchestratorVersion = '2.31.0', userConfRoot = os.tmpdir()} = {}) => {
|
|
31
31
|
const orchestratorBin = `docker-compose-v${orchestratorVersion}`;
|
|
32
32
|
switch (process.platform) {
|
|
33
33
|
case 'darwin':
|
|
@@ -8,20 +8,20 @@ const os = require('os');
|
|
|
8
8
|
const getBuildEngineVersion = (platform = process.landoPlatform ?? process.platform) => {
|
|
9
9
|
switch (platform) {
|
|
10
10
|
case 'darwin':
|
|
11
|
-
return '4.
|
|
11
|
+
return '4.37.2';
|
|
12
12
|
case 'linux':
|
|
13
|
-
return '27.
|
|
13
|
+
return '27.5.0';
|
|
14
14
|
case 'win32':
|
|
15
|
-
return '4.
|
|
15
|
+
return '4.37.1';
|
|
16
16
|
case 'wsl':
|
|
17
|
-
return '4.
|
|
17
|
+
return '4.37.1';
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
// Default config
|
|
22
22
|
const defaultConfig = options => ({
|
|
23
23
|
orchestratorSeparator: '_',
|
|
24
|
-
orchestratorVersion: '2.
|
|
24
|
+
orchestratorVersion: '2.31.0',
|
|
25
25
|
configSources: [],
|
|
26
26
|
coreBase: path.resolve(__dirname, '..'),
|
|
27
27
|
disablePlugins: [],
|
|
@@ -10,6 +10,7 @@ module.exports = (lando, options) => {
|
|
|
10
10
|
lando.config.userConfRoot,
|
|
11
11
|
lando.config.home,
|
|
12
12
|
options.destination,
|
|
13
|
+
_.get(options, '_app', {}),
|
|
13
14
|
_.cloneDeep(lando.config.appEnv),
|
|
14
15
|
_.cloneDeep(lando.config.appLabels),
|
|
15
16
|
_.get(options, 'initImage', 'devwithlando/util:4'),
|
|
@@ -17,7 +18,7 @@ module.exports = (lando, options) => {
|
|
|
17
18
|
const initDir = path.join(lando.config.userConfRoot, 'init', options.name);
|
|
18
19
|
const initFiles = require('./dump-compose-data')(initData, initDir);
|
|
19
20
|
// Start to build out some propz and shiz
|
|
20
|
-
const project = `${lando.config.product}init` +
|
|
21
|
+
const project = `${lando.config.product}init` + options.name;
|
|
21
22
|
const separator = lando.config.orchestratorSeparator;
|
|
22
23
|
// Return
|
|
23
24
|
return {
|
|
@@ -38,6 +38,26 @@ module.exports = (cmds, app, data, lando) => _.map(cmds, cmd => {
|
|
|
38
38
|
// Discover the service
|
|
39
39
|
const command = getCommand(cmd);
|
|
40
40
|
const service = getService(cmd, data, app._defaultService);
|
|
41
|
+
|
|
42
|
+
if ('lando' === service) {
|
|
43
|
+
const yargs = require('yargs');
|
|
44
|
+
const argv = yargs(_.isArray(command) ? command.join(' ') : command).parse();
|
|
45
|
+
const $0 = _.pullAt(argv._, [0])[0];
|
|
46
|
+
const toolingTask = _.find(app.tasks, task => $0 === task.command);
|
|
47
|
+
argv._eventArgs = argv._;
|
|
48
|
+
argv.$0 = undefined;
|
|
49
|
+
argv._ = undefined;
|
|
50
|
+
argv._app = app;
|
|
51
|
+
|
|
52
|
+
if (undefined === toolingTask) {
|
|
53
|
+
throw new Error('Could not find tooling command: ' + $0);
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
toolingTask,
|
|
57
|
+
answers: argv,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
41
61
|
// compute stdio based on compose major version
|
|
42
62
|
const cstdio = _.get(app, '_config.orchestratorMV', 2) ? 'inherit' : ['inherit', 'pipe', 'pipe'];
|
|
43
63
|
|
|
@@ -67,7 +87,7 @@ module.exports = (cmds, app, data, lando) => _.map(cmds, cmd => {
|
|
|
67
87
|
{},
|
|
68
88
|
require('./build-init-runner')(_.merge(
|
|
69
89
|
{},
|
|
70
|
-
require('./get-init-runner-defaults')(lando, {destination: app.root, name: app.project}),
|
|
90
|
+
require('./get-init-runner-defaults')(lando, {destination: app.root, name: app.project, _app: app}),
|
|
71
91
|
{cmd, workdir: '/app'},
|
|
72
92
|
)),
|
|
73
93
|
{isInitEventCommand: true},
|
|
@@ -19,11 +19,11 @@ const getDynamicKeys = (answer, answers = {}) => _(answers)
|
|
|
19
19
|
* Set SERVICE from answers and strip out that noise from the rest of
|
|
20
20
|
* stuff, check answers/argv for --service or -s, validate and then remove
|
|
21
21
|
*/
|
|
22
|
-
const handleDynamic = (config, options = {}, answers = {}, execs = {}) => {
|
|
22
|
+
const handleDynamic = (config, argv, options = {}, answers = {}, execs = {}) => {
|
|
23
23
|
if (_.startsWith(config.service, ':')) {
|
|
24
24
|
const answer = answers[config.service.split(':')[1]];
|
|
25
25
|
// Remove dynamic service option from argv
|
|
26
|
-
_.remove(
|
|
26
|
+
_.remove(argv, arg => _.includes(getDynamicKeys(answer, answers).concat(answer), arg));
|
|
27
27
|
// get the service
|
|
28
28
|
const service = answers[config.service.split(':')[1]];
|
|
29
29
|
// Return updated config
|
|
@@ -40,9 +40,9 @@ const handleDynamic = (config, options = {}, answers = {}, execs = {}) => {
|
|
|
40
40
|
* the first three assuming they are [node, lando.js, options.name]'
|
|
41
41
|
* Check to see if we have global lando opts and remove them if we do
|
|
42
42
|
*/
|
|
43
|
-
const handleOpts = (config, name, argopts = []) => {
|
|
43
|
+
const handleOpts = (config, name, argv, argopts = []) => {
|
|
44
44
|
// Append any user specificed opts
|
|
45
|
-
argopts = argopts.concat(
|
|
45
|
+
argopts = argopts.concat(argv.slice(argv.findIndex(value => value === name.split(' ')[0]) + 1));
|
|
46
46
|
// If we have no args then just return right away
|
|
47
47
|
if (_.isEmpty(argopts)) return config;
|
|
48
48
|
// Return
|
|
@@ -72,9 +72,9 @@ module.exports = (cmd, service, name, options = {}, answers = {}, execs = {}) =>
|
|
|
72
72
|
// Put into an object so we can handle "multi-service" tooling
|
|
73
73
|
.map(cmd => parseCommand(cmd, service, execs))
|
|
74
74
|
// Handle dynamic services
|
|
75
|
-
.map(config => handleDynamic(config, options, answers, execs))
|
|
75
|
+
.map(config => handleDynamic(config, answers._eventArgs ?? process.argv, options, answers, execs))
|
|
76
76
|
// Add in any argv extras if they've been passed in
|
|
77
|
-
.map(config => handleOpts(config, name, handlePassthruOpts(options, answers)))
|
|
77
|
+
.map(config => handleOpts(config, name, answers._eventArgs ?? process.argv, handlePassthruOpts(options, answers)))
|
|
78
78
|
// Wrap the command in /bin/sh if that makes sense
|
|
79
79
|
.map(config => _.merge({}, config, {command: require('./shell-escape')(config.command, true, config.args, config.exec)})) // eslint-disable-line max-len
|
|
80
80
|
// Add any args to the command and compact to remove undefined
|
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
module.exports = ({Labels, Id, Status}, separator = '_', src = []) => {
|
|
4
6
|
// Get name of docker container.
|
|
5
7
|
const app = Labels['com.docker.compose.project'];
|
|
6
8
|
const service = Labels['com.docker.compose.service'];
|
|
7
9
|
const num = Labels['com.docker.compose.container-number'];
|
|
8
10
|
const lando = Labels['io.lando.container'];
|
|
9
11
|
const special = Labels['io.lando.service-container'];
|
|
12
|
+
|
|
13
|
+
// if we have io.lando.root and io.lando.
|
|
14
|
+
if (Labels['io.lando.root'] && Labels['io.lando.landofiles']) {
|
|
15
|
+
src = Labels['io.lando.landofiles'].split(',').map(landofile => path.join(Labels['io.lando.root'], landofile));
|
|
16
|
+
|
|
17
|
+
// or legacy support for Labels['io.lando.src']
|
|
18
|
+
} else if (Labels['io.lando.src']) {
|
|
19
|
+
src = Labels['io.lando.src'].split(',');
|
|
20
|
+
|
|
21
|
+
// or its just unknown
|
|
22
|
+
} else src = 'unknown';
|
|
23
|
+
|
|
10
24
|
// Build generic container.
|
|
11
25
|
return {
|
|
12
26
|
id: Id,
|
|
13
27
|
service: service,
|
|
14
28
|
name: [app, service, num].join(separator),
|
|
15
29
|
app: (special !== 'TRUE') ? app : '_global_',
|
|
16
|
-
src: (Labels['io.lando.src']) ? Labels['io.lando.src'].split(',') : 'unknown',
|
|
17
30
|
kind: (special !== 'TRUE') ? 'app' : 'service',
|
|
18
31
|
lando: (lando === 'TRUE') ? true : false,
|
|
19
32
|
instance: Labels['io.lando.id'] || 'unknown',
|
|
20
33
|
status: Status,
|
|
34
|
+
src,
|
|
21
35
|
};
|
|
22
36
|
};
|
package/checksums.txt
DELETED
|
File without changes
|