@scandipwa/magento-scripts 2.4.10-alpha.0 → 2.4.11
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/lib/commands/cli.js +25 -9
- package/lib/commands/execute.js +18 -4
- package/lib/config/docker.js +17 -12
- package/lib/config/magento/required-php-extensions/magento-2.4.js +1 -0
- package/lib/config/php-config.js +2 -1
- package/lib/config/services/composer/versions/composer-1.js +1 -1
- package/lib/config/services/composer/versions/composer-2.9.js +8 -0
- package/lib/config/services/composer/versions/index.js +2 -1
- package/lib/config/services/elasticsearch/versions/elasticsearch-6.8.js +4 -4
- package/lib/config/services/elasticsearch/versions/elasticsearch-7.6.js +2 -1
- package/lib/config/services/mariadb/versions/index.js +2 -1
- package/lib/config/services/mariadb/versions/mariadb-11.8.js +11 -0
- package/lib/config/services/nginx/versions/nginx-1.18.js +2 -1
- package/lib/config/services/nginx/versions/nginx-1.22.js +2 -1
- package/lib/config/services/nginx/versions/nginx-1.24.js +2 -1
- package/lib/config/services/nginx/versions/nginx-1.26.js +2 -1
- package/lib/config/services/nginx/versions/nginx-1.28.js +3 -2
- package/lib/config/services/php/versions/php-8.1.js +1 -1
- package/lib/config/services/php/versions/php-8.2.js +1 -1
- package/lib/config/services/php/versions/php-8.3.js +1 -1
- package/lib/config/services/php/versions/php-8.4.js +1 -1
- package/lib/config/services/php/versions/php-8.5.js +32 -0
- package/lib/config/services/redis/index.js +3 -1
- package/lib/config/services/redis/valkey-9.0.js +8 -0
- package/lib/config/services/varnish/index.js +2 -1
- package/lib/config/services/varnish/varnish-8-0.js +15 -0
- package/lib/config/templates/magentorc.template +1 -0
- package/lib/config/templates/nginx.template.conf +1 -1
- package/lib/config/versions/magento-2.4.4-p16.js +1 -1
- package/lib/config/versions/magento-2.4.4-p17.js +41 -0
- package/lib/config/versions/magento-2.4.4-p18.js +43 -0
- package/lib/config/versions/magento-2.4.5-p16.js +41 -0
- package/lib/config/versions/magento-2.4.5-p17.js +43 -0
- package/lib/config/versions/magento-2.4.6-p14.js +41 -0
- package/lib/config/versions/magento-2.4.6-p15.js +43 -0
- package/lib/config/versions/magento-2.4.7-p1.js +2 -2
- package/lib/config/versions/magento-2.4.7-p10.js +42 -0
- package/lib/config/versions/magento-2.4.7-p2.js +2 -2
- package/lib/config/versions/magento-2.4.7-p3.js +2 -2
- package/lib/config/versions/magento-2.4.7-p4.js +2 -2
- package/lib/config/versions/magento-2.4.7-p5.js +2 -2
- package/lib/config/versions/magento-2.4.7-p6.js +2 -2
- package/lib/config/versions/magento-2.4.7-p7.js +2 -2
- package/lib/config/versions/magento-2.4.7-p8.js +2 -2
- package/lib/config/versions/magento-2.4.7-p9.js +41 -0
- package/lib/config/versions/magento-2.4.7.js +2 -2
- package/lib/config/versions/magento-2.4.8-p1.js +2 -2
- package/lib/config/versions/magento-2.4.8-p2.js +2 -2
- package/lib/config/versions/magento-2.4.8-p3.js +2 -3
- package/lib/config/versions/magento-2.4.8-p4.js +42 -0
- package/lib/config/versions/magento-2.4.8-p5.js +42 -0
- package/lib/config/versions/magento-2.4.8.js +2 -2
- package/lib/config/versions/magento-2.4.9-beta1.js +41 -0
- package/lib/config/versions/magento-2.4.9.js +44 -0
- package/lib/tasks/docker/containers/container-api.d.ts +4 -4
- package/lib/tasks/docker/containers/container-api.js +2 -2
- package/lib/tasks/docker/containers/tasks.js +31 -18
- package/lib/tasks/docker/image/image-api.d.ts +12 -0
- package/lib/tasks/docker/image/image-api.js +22 -1
- package/lib/tasks/docker/project-image-builder.js +25 -13
- package/lib/tasks/execute.js +51 -7
- package/lib/tasks/magento/setup-magento/clear-logs.js +31 -0
- package/lib/tasks/magento/setup-magento/disable-2fa.js +13 -0
- package/lib/tasks/magento/setup-magento/index.js +29 -1
- package/lib/tasks/magento/setup-magento/set-base-url.js +42 -15
- package/lib/tasks/magento/setup-magento/urn-highlighter.js +84 -2
- package/lib/tasks/requirements/searchengine-version.js +25 -30
- package/lib/tasks/start.js +9 -5
- package/lib/util/config-file-validator.js +15 -7
- package/lib/util/execute-in-container.js +88 -6
- package/lib/util/instance-metadata.js +15 -9
- package/lib/util/open-browser.js +7 -0
- package/lib/util/wait-for-logs.js +5 -2
- package/package.json +2 -2
- package/typings/context.d.ts +4 -2
- package/typings/index.d.ts +22 -0
- package/lib/config/services/elasticsearch/base-repo.js +0 -3
|
@@ -8,8 +8,8 @@ const pathExists = require('../../../util/path-exists')
|
|
|
8
8
|
*
|
|
9
9
|
* @reference https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-urn.html
|
|
10
10
|
*/
|
|
11
|
-
const
|
|
12
|
-
title: 'Generating URN highlighter',
|
|
11
|
+
const urnHighlighterForPHPStorm = () => ({
|
|
12
|
+
title: 'Generating URN highlighter for PHPStorm',
|
|
13
13
|
task: async (ctx, task) => {
|
|
14
14
|
if (!(await pathExists(path.join(process.cwd(), './.idea')))) {
|
|
15
15
|
await fs.promises.mkdir(path.join(process.cwd(), './.idea'))
|
|
@@ -26,4 +26,86 @@ const urnHighlighter = () => ({
|
|
|
26
26
|
}
|
|
27
27
|
})
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* @returns {import('listr2').ListrTask<import('../../../../typings/context').ListrContext>}
|
|
31
|
+
*/
|
|
32
|
+
const vscodeSettingsXmlCatalogs = () => ({
|
|
33
|
+
task: async (ctx, task) => {
|
|
34
|
+
const settingsPath = path.join(process.cwd(), './.vscode/settings.json')
|
|
35
|
+
const catalogEntry = './.vscode/catalog.xml'
|
|
36
|
+
|
|
37
|
+
let settings = {}
|
|
38
|
+
if (await pathExists(settingsPath)) {
|
|
39
|
+
try {
|
|
40
|
+
const content = await fs.promises.readFile(settingsPath, 'utf8')
|
|
41
|
+
settings = JSON.parse(content)
|
|
42
|
+
} catch {
|
|
43
|
+
// If the file is not valid JSON, we'll overwrite the xml.catalogs key only
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const existing = settings['xml.catalogs']
|
|
48
|
+
/** @type {string[]} */
|
|
49
|
+
const catalogs = Array.isArray(existing) ? existing : []
|
|
50
|
+
|
|
51
|
+
if (catalogs.includes(catalogEntry)) {
|
|
52
|
+
task.skip()
|
|
53
|
+
return
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
settings['xml.catalogs'] = [...catalogs, catalogEntry]
|
|
57
|
+
await fs.promises.writeFile(
|
|
58
|
+
settingsPath,
|
|
59
|
+
JSON.stringify(settings, null, 4),
|
|
60
|
+
'utf8'
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @returns {import('listr2').ListrTask<import('../../../../typings/context').ListrContext>}
|
|
67
|
+
*
|
|
68
|
+
* @reference https://www.thebeardeddeveloper.co.uk/resources/articles/vscode-xml-autocomplete-for-magento
|
|
69
|
+
*/
|
|
70
|
+
const urnHighlighterForVSCode = () => ({
|
|
71
|
+
title: 'Generating URN highlighter for VSCode',
|
|
72
|
+
task: async (ctx, task) => {
|
|
73
|
+
if (!(await pathExists(path.join(process.cwd(), './.vscode')))) {
|
|
74
|
+
await fs.promises.mkdir(path.join(process.cwd(), './.vscode'))
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const subtasks = []
|
|
78
|
+
|
|
79
|
+
if (
|
|
80
|
+
!(await pathExists(
|
|
81
|
+
path.join(process.cwd(), './.vscode/catalog.xml')
|
|
82
|
+
))
|
|
83
|
+
) {
|
|
84
|
+
subtasks.push(
|
|
85
|
+
magentoTask(
|
|
86
|
+
'dev:urn-catalog:generate --ide=vscode ./.vscode/catalog.xml'
|
|
87
|
+
)
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
subtasks.push(vscodeSettingsXmlCatalogs())
|
|
92
|
+
|
|
93
|
+
return task.newListr(subtasks)
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @returns {import('listr2').ListrTask<import('../../../../typings/context').ListrContext>}
|
|
99
|
+
*/
|
|
100
|
+
const urnHighlighter = () => ({
|
|
101
|
+
title: 'Generating URN highlighter',
|
|
102
|
+
task: (ctx, task) =>
|
|
103
|
+
task.newListr(
|
|
104
|
+
[urnHighlighterForPHPStorm(), urnHighlighterForVSCode()],
|
|
105
|
+
{
|
|
106
|
+
concurrent: true
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
})
|
|
110
|
+
|
|
29
111
|
module.exports = urnHighlighter
|
|
@@ -92,38 +92,33 @@ const checkSearchEngineVersion = () => ({
|
|
|
92
92
|
}
|
|
93
93
|
)
|
|
94
94
|
} else {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
/** @param {string} line */
|
|
96
|
+
const legacyMatcher = (line) => {
|
|
97
|
+
if (!line.startsWith('[')) {
|
|
98
|
+
return false
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
const message = line.replaceAll(/\[[\s\S]+\]/g, '').trim()
|
|
102
|
+
|
|
103
|
+
return message.startsWith('started')
|
|
104
|
+
} catch {
|
|
105
|
+
return false
|
|
106
|
+
}
|
|
107
|
+
}
|
|
102
108
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
: {
|
|
110
|
-
containerName: elasticsearch.name,
|
|
111
|
-
customLineParser: (line) => {
|
|
112
|
-
if (!line.startsWith('[')) {
|
|
113
|
-
return false
|
|
114
|
-
}
|
|
115
|
-
try {
|
|
116
|
-
const message = line
|
|
117
|
-
.replaceAll(/\[[\s\S]+\]/g, '')
|
|
118
|
-
.trim()
|
|
109
|
+
await waitForLogs({
|
|
110
|
+
containerName: elasticsearch.name,
|
|
111
|
+
customLineParser: (line) => {
|
|
112
|
+
try {
|
|
113
|
+
const logObject = JSON.parse(line)
|
|
119
114
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
)
|
|
115
|
+
return logObject.message.startsWith('started')
|
|
116
|
+
} catch {
|
|
117
|
+
return legacyMatcher(line)
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
successOnTimeout: true
|
|
121
|
+
})
|
|
127
122
|
|
|
128
123
|
try {
|
|
129
124
|
const response = await request(
|
package/lib/tasks/start.js
CHANGED
|
@@ -27,7 +27,7 @@ const getIsWsl = require('../util/is-wsl')
|
|
|
27
27
|
const checkForXDGOpen = require('../util/xdg-open-exists')
|
|
28
28
|
const {
|
|
29
29
|
getInstanceMetadata,
|
|
30
|
-
constants: {
|
|
30
|
+
constants: { WEB_ADMIN_LOCATION_TITLE }
|
|
31
31
|
} = require('../util/instance-metadata')
|
|
32
32
|
const waitingForVarnish = require('./magento/setup-magento/waiting-for-varnish')
|
|
33
33
|
const checkPHPVersion = require('./requirements/php-version')
|
|
@@ -38,6 +38,7 @@ const { setProjectConfigTask } = require('./project-config')
|
|
|
38
38
|
const {
|
|
39
39
|
convertComposerHomeToComposerCacheVolume
|
|
40
40
|
} = require('./docker/convert-composer-home-to-composer-cache-volume')
|
|
41
|
+
const clearLogs = require('./magento/setup-magento/clear-logs')
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
44
|
* @returns {import('listr2').ListrTask<import('../../typings/context').ListrContext>}
|
|
@@ -148,7 +149,7 @@ const finishProjectConfiguration = () => ({
|
|
|
148
149
|
title: 'Finishing project configuration',
|
|
149
150
|
skip: ({ skipSetup }) => Boolean(skipSetup),
|
|
150
151
|
task: (ctx, task) =>
|
|
151
|
-
task.newListr([setupThemes(), waitingForVarnish()], {
|
|
152
|
+
task.newListr([setupThemes(), waitingForVarnish(), clearLogs()], {
|
|
152
153
|
rendererOptions: {
|
|
153
154
|
collapse: false
|
|
154
155
|
}
|
|
@@ -191,9 +192,12 @@ const start = () => ({
|
|
|
191
192
|
},
|
|
192
193
|
task: (ctx) => {
|
|
193
194
|
const instanceMetadata = getInstanceMetadata(ctx)
|
|
194
|
-
const locationOnTheWeb =
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
const locationOnTheWeb =
|
|
196
|
+
instanceMetadata.frontend[0] ||
|
|
197
|
+
instanceMetadata.admin.find(
|
|
198
|
+
(u) => u.title === WEB_ADMIN_LOCATION_TITLE
|
|
199
|
+
)
|
|
200
|
+
|
|
197
201
|
if (locationOnTheWeb) {
|
|
198
202
|
openBrowser(locationOnTheWeb.text)
|
|
199
203
|
}
|
|
@@ -101,7 +101,8 @@ const phpConfigurationSchema = Joi.object({
|
|
|
101
101
|
extensions: phpExtensionConfiguration.optional(),
|
|
102
102
|
env: Joi.object()
|
|
103
103
|
.pattern(Joi.string(), [Joi.string(), Joi.number()])
|
|
104
|
-
.optional()
|
|
104
|
+
.optional(),
|
|
105
|
+
platform: Joi.string().optional()
|
|
105
106
|
})
|
|
106
107
|
|
|
107
108
|
/**
|
|
@@ -109,7 +110,9 @@ const phpConfigurationSchema = Joi.object({
|
|
|
109
110
|
*/
|
|
110
111
|
const nginxConfigurationSchema = Joi.object({
|
|
111
112
|
image: Joi.string().optional(),
|
|
112
|
-
configTemplate: Joi.string().optional().custom(fileExistsValidator)
|
|
113
|
+
configTemplate: Joi.string().optional().custom(fileExistsValidator),
|
|
114
|
+
platform: Joi.string().optional(),
|
|
115
|
+
runType: Joi.string().valid('website', 'store').optional()
|
|
113
116
|
})
|
|
114
117
|
|
|
115
118
|
/**
|
|
@@ -119,14 +122,16 @@ const varnishConfigurationSchema = Joi.object({
|
|
|
119
122
|
enabled: Joi.boolean().optional(),
|
|
120
123
|
healthCheck: Joi.boolean().optional(),
|
|
121
124
|
image: Joi.string().optional(),
|
|
122
|
-
configTemplate: Joi.string().optional().custom(fileExistsValidator)
|
|
125
|
+
configTemplate: Joi.string().optional().custom(fileExistsValidator),
|
|
126
|
+
platform: Joi.string().optional()
|
|
123
127
|
})
|
|
124
128
|
|
|
125
129
|
/**
|
|
126
130
|
* @type {Joi.ObjectSchema<import('../../typings').ServiceWithImage>}
|
|
127
131
|
*/
|
|
128
132
|
const serviceConfigurationSchema = Joi.object({
|
|
129
|
-
image: Joi.string().optional()
|
|
133
|
+
image: Joi.string().optional(),
|
|
134
|
+
platform: Joi.string().optional()
|
|
130
135
|
})
|
|
131
136
|
|
|
132
137
|
/**
|
|
@@ -136,7 +141,8 @@ const mariadbConfigurationSchema = Joi.object({
|
|
|
136
141
|
image: Joi.string().optional(),
|
|
137
142
|
useOptimizerSwitch: Joi.alternatives()
|
|
138
143
|
.try(Joi.string(), Joi.boolean())
|
|
139
|
-
.optional()
|
|
144
|
+
.optional(),
|
|
145
|
+
platform: Joi.string().optional()
|
|
140
146
|
})
|
|
141
147
|
|
|
142
148
|
/**
|
|
@@ -144,12 +150,14 @@ const mariadbConfigurationSchema = Joi.object({
|
|
|
144
150
|
*/
|
|
145
151
|
const elasticsearchConfigurationSchema = Joi.object({
|
|
146
152
|
image: Joi.string().optional(),
|
|
147
|
-
env: Joi.object().optional()
|
|
153
|
+
env: Joi.object().optional(),
|
|
154
|
+
platform: Joi.string().optional()
|
|
148
155
|
})
|
|
149
156
|
|
|
150
157
|
const opensearchConfigurationSchema = Joi.object({
|
|
151
158
|
image: Joi.string().optional(),
|
|
152
|
-
env: Joi.object().optional()
|
|
159
|
+
env: Joi.object().optional(),
|
|
160
|
+
platform: Joi.string().optional()
|
|
153
161
|
})
|
|
154
162
|
|
|
155
163
|
const searchEngineConfiguration = Joi.string().valid(
|
|
@@ -1,10 +1,35 @@
|
|
|
1
1
|
const { spawn } = require('child_process')
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
execCommand,
|
|
4
|
+
run,
|
|
5
|
+
exec
|
|
6
|
+
} = require('../tasks/docker/containers/container-api')
|
|
3
7
|
|
|
4
8
|
/**
|
|
5
|
-
*
|
|
9
|
+
* Escape an argument for use in a shell command string.
|
|
10
|
+
* Wrap in single quotes and escape single quotes inside.
|
|
11
|
+
* @param {string} arg
|
|
12
|
+
* @returns {string}
|
|
6
13
|
*/
|
|
7
|
-
const
|
|
14
|
+
const shellEscapeArg = (arg) => "'" + String(arg).replace(/'/g, "'\\''") + "'"
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Join command args to survive shell re-parsing in `docker run`.
|
|
18
|
+
* @param {string[]} args
|
|
19
|
+
* @returns {string}
|
|
20
|
+
*/
|
|
21
|
+
const joinCommandArgs = (...args) =>
|
|
22
|
+
args
|
|
23
|
+
.map((arg) => {
|
|
24
|
+
const value = String(arg)
|
|
25
|
+
return /[\s'"\\$`]/.test(value) ? shellEscapeArg(value) : value
|
|
26
|
+
})
|
|
27
|
+
.join(' ')
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @param {{ containerName: string, commands: string[], user?: string, env?: Record<string, string> }} param0
|
|
31
|
+
*/
|
|
32
|
+
const executeInContainer = ({ containerName, commands, user, env }) => {
|
|
8
33
|
if (!process.stdin.isTTY) {
|
|
9
34
|
process.stderr.write('This app works only in TTY mode')
|
|
10
35
|
process.exit(1)
|
|
@@ -16,7 +41,8 @@ const executeInContainer = ({ containerName, commands, user }) => {
|
|
|
16
41
|
command: commandBin,
|
|
17
42
|
user,
|
|
18
43
|
tty: true,
|
|
19
|
-
interactive: true
|
|
44
|
+
interactive: true,
|
|
45
|
+
env: env || {}
|
|
20
46
|
})
|
|
21
47
|
const [command, ...args] = execArgs
|
|
22
48
|
|
|
@@ -29,6 +55,37 @@ const executeInContainer = ({ containerName, commands, user }) => {
|
|
|
29
55
|
})
|
|
30
56
|
}
|
|
31
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Non-interactive version of executeInContainer for AI terminals and scripts.
|
|
60
|
+
* @param {{ containerName: string, commands: string[], user?: string, workdir?: string, env?: Record<string, string> }} param0
|
|
61
|
+
* @returns {Promise<{ code: number, result: string }>}
|
|
62
|
+
*/
|
|
63
|
+
const executeInContainerNonInteractive = async ({
|
|
64
|
+
containerName,
|
|
65
|
+
commands,
|
|
66
|
+
user,
|
|
67
|
+
workdir,
|
|
68
|
+
env
|
|
69
|
+
}) => {
|
|
70
|
+
const [commandBin, ...commandsArgs] = commands
|
|
71
|
+
const fullCommand = joinCommandArgs(commandBin, ...commandsArgs)
|
|
72
|
+
|
|
73
|
+
return exec(
|
|
74
|
+
{
|
|
75
|
+
container: containerName,
|
|
76
|
+
command: fullCommand,
|
|
77
|
+
user,
|
|
78
|
+
workdir,
|
|
79
|
+
tty: false,
|
|
80
|
+
interactive: false,
|
|
81
|
+
env: env || {}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
withCode: true
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
32
89
|
/**
|
|
33
90
|
* @param {import('../tasks/docker/containers/container-api').ContainerRunOptions} options
|
|
34
91
|
* @param {string[]} commands
|
|
@@ -44,7 +101,7 @@ const runInContainer = async (options, commands) => {
|
|
|
44
101
|
const runResult = await run(
|
|
45
102
|
{
|
|
46
103
|
...options,
|
|
47
|
-
command:
|
|
104
|
+
command: joinCommandArgs(commandBin, ...commandsArgs),
|
|
48
105
|
tty: true,
|
|
49
106
|
detach: false,
|
|
50
107
|
rm: true
|
|
@@ -58,7 +115,32 @@ const runInContainer = async (options, commands) => {
|
|
|
58
115
|
process.exit(runResult.code)
|
|
59
116
|
}
|
|
60
117
|
|
|
118
|
+
/**
|
|
119
|
+
* Non-interactive version of runInContainer for AI terminals and scripts.
|
|
120
|
+
* @param {import('../tasks/docker/containers/container-api').ContainerRunOptions} options
|
|
121
|
+
* @param {string[]} commands
|
|
122
|
+
* @returns {Promise<{ code: number, result: string }>}
|
|
123
|
+
*/
|
|
124
|
+
const runInContainerNonInteractive = async (options, commands) => {
|
|
125
|
+
const [commandBin, ...commandsArgs] = commands
|
|
126
|
+
|
|
127
|
+
return run(
|
|
128
|
+
{
|
|
129
|
+
...options,
|
|
130
|
+
command: joinCommandArgs(commandBin, ...commandsArgs),
|
|
131
|
+
tty: false,
|
|
132
|
+
detach: false,
|
|
133
|
+
rm: true
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
withCode: true
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
}
|
|
140
|
+
|
|
61
141
|
module.exports = {
|
|
62
142
|
executeInContainer,
|
|
63
|
-
|
|
143
|
+
executeInContainerNonInteractive,
|
|
144
|
+
runInContainer,
|
|
145
|
+
runInContainerNonInteractive
|
|
64
146
|
}
|
|
@@ -24,7 +24,11 @@ const getInstanceMetadata = (ctx) => {
|
|
|
24
24
|
ports,
|
|
25
25
|
config: {
|
|
26
26
|
magentoConfiguration,
|
|
27
|
-
overridenConfiguration: {
|
|
27
|
+
overridenConfiguration: {
|
|
28
|
+
ssl,
|
|
29
|
+
storeDomains,
|
|
30
|
+
magento: { adminuri }
|
|
31
|
+
}
|
|
28
32
|
}
|
|
29
33
|
} = ctx
|
|
30
34
|
|
|
@@ -66,14 +70,16 @@ const getInstanceMetadata = (ctx) => {
|
|
|
66
70
|
})
|
|
67
71
|
}
|
|
68
72
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
admin.push({
|
|
74
|
+
title: WEB_ADMIN_LOCATION_TITLE,
|
|
75
|
+
text: logger.style.link(
|
|
76
|
+
`${ssl.enabled ? 'https' : 'http'}://${storeDomains.admin}${
|
|
77
|
+
ssl.enabled || ports.sslTerminator === 80
|
|
78
|
+
? ''
|
|
79
|
+
: `:${ports.sslTerminator}`
|
|
80
|
+
}/${adminuri}/`
|
|
81
|
+
)
|
|
82
|
+
})
|
|
77
83
|
|
|
78
84
|
admin.push({
|
|
79
85
|
title: WEB_ADMIN_CREDENTIALS_TITLE,
|
package/lib/util/open-browser.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
const { execAsync } = require('./exec-async')
|
|
2
2
|
|
|
3
|
+
const isCMANoOpen =
|
|
4
|
+
process.env.CMA_NO_OPEN === '1' || process.env.CMA_NO_OPEN === 'true'
|
|
5
|
+
|
|
3
6
|
// eslint-disable-next-line no-control-regex
|
|
4
7
|
const consoleStyleReplacer = /[\u001b]\[\S+?m/g
|
|
5
8
|
/**
|
|
6
9
|
* @param {string} url
|
|
7
10
|
*/
|
|
8
11
|
const openBrowser = async (url) => {
|
|
12
|
+
if (isCMANoOpen) {
|
|
13
|
+
return
|
|
14
|
+
}
|
|
15
|
+
|
|
9
16
|
const start = process.platform === 'darwin' ? 'open' : 'xdg-open'
|
|
10
17
|
|
|
11
18
|
await execAsync(`${start} ${url.replace(consoleStyleReplacer, '')}`)
|
|
@@ -2,12 +2,13 @@ const { execAsyncSpawn } = require('./exec-async-command')
|
|
|
2
2
|
const sleep = require('./sleep')
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @param {{ containerName: string, timeout?: number, matchText?: string | string[], customLineParser?: (line: string) => boolean }} param0
|
|
5
|
+
* @param {{ containerName: string, timeout?: number, matchText?: string | string[], customLineParser?: (line: string) => boolean, successOnTimeout?: boolean }} param0
|
|
6
6
|
* @returns {Promise<void>}
|
|
7
7
|
*/
|
|
8
8
|
const waitForLogs = ({
|
|
9
9
|
containerName,
|
|
10
10
|
timeout = 30 * 1000,
|
|
11
|
+
successOnTimeout = false,
|
|
11
12
|
matchText,
|
|
12
13
|
customLineParser
|
|
13
14
|
}) =>
|
|
@@ -58,8 +59,10 @@ const waitForLogs = ({
|
|
|
58
59
|
})
|
|
59
60
|
])
|
|
60
61
|
|
|
61
|
-
if (timeoutExceeded) {
|
|
62
|
+
if (timeoutExceeded && !successOnTimeout) {
|
|
62
63
|
reject(new Error('Timeout exception'))
|
|
64
|
+
} else {
|
|
65
|
+
resolve()
|
|
63
66
|
}
|
|
64
67
|
})
|
|
65
68
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Scripts and configuration used by CMA.",
|
|
4
4
|
"homepage": "https://docs.create-magento-app.com/",
|
|
5
5
|
"repository": "github:scandipwa/create-magento-app",
|
|
6
|
-
"version": "2.4.
|
|
6
|
+
"version": "2.4.11",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"types": "./typings/index.d.ts",
|
|
9
9
|
"license": "OSL-3.0",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"@types/node": "^20.14.11",
|
|
60
60
|
"@types/yargs": "^17.0.32"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "64c177af194cf32de4d8ae08116f016d30ec7f01"
|
|
63
63
|
}
|
package/typings/context.d.ts
CHANGED
|
@@ -67,15 +67,16 @@ export interface ListrContext {
|
|
|
67
67
|
edition?: 'community' | 'enterprise'
|
|
68
68
|
config: {
|
|
69
69
|
php: {
|
|
70
|
+
iniPath: string
|
|
70
71
|
iniTemplatePath: string
|
|
71
72
|
fpmConfPath: string
|
|
72
73
|
fpmTemplatePath: string
|
|
73
74
|
debugIniPath: string
|
|
74
75
|
debugTemplatePath: string
|
|
75
76
|
debugFpmConfPath: string
|
|
76
|
-
debugFpmTemplatePath: string
|
|
77
77
|
extensions: PHPExtensions
|
|
78
|
-
|
|
78
|
+
env: Record<string, unknown>
|
|
79
|
+
platform?: 'linux/amd64' | 'linux/arm64' | (string & {})
|
|
79
80
|
}
|
|
80
81
|
composer: {
|
|
81
82
|
dirPath: string
|
|
@@ -120,6 +121,7 @@ export interface ListrContext {
|
|
|
120
121
|
dependsOn?: string[]
|
|
121
122
|
serviceReadyLog?: string
|
|
122
123
|
platform?: string
|
|
124
|
+
execCommandEnv?: Record<string, string>
|
|
123
125
|
}
|
|
124
126
|
>
|
|
125
127
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -14,6 +14,11 @@ export interface ServiceWithImage {
|
|
|
14
14
|
* Service Docker image
|
|
15
15
|
*/
|
|
16
16
|
image: string
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Service platform
|
|
20
|
+
*/
|
|
21
|
+
platform?: 'linux/amd64' | 'linux/arm64' | (string & {})
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
export interface ServiceWithoutImage {
|
|
@@ -21,6 +26,11 @@ export interface ServiceWithoutImage {
|
|
|
21
26
|
* Service Docker image
|
|
22
27
|
*/
|
|
23
28
|
image: string
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Service platform
|
|
32
|
+
*/
|
|
33
|
+
platform?: 'linux/amd64' | 'linux/arm64' | (string & {})
|
|
24
34
|
}
|
|
25
35
|
|
|
26
36
|
export interface MariaDBConfiguration extends ServiceWithImage {
|
|
@@ -58,6 +68,13 @@ export interface NginxConfiguration extends ServiceWithImage {
|
|
|
58
68
|
* @example ./my-nginx-config.conf
|
|
59
69
|
*/
|
|
60
70
|
configTemplate: string
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Magento run type for nginx configuration
|
|
74
|
+
*
|
|
75
|
+
* @default 'website'
|
|
76
|
+
*/
|
|
77
|
+
runType?: 'website' | 'store' | (string & {})
|
|
61
78
|
}
|
|
62
79
|
|
|
63
80
|
export interface ElasticSearchConfiguration extends ServiceWithImage {
|
|
@@ -228,6 +245,11 @@ export interface PHPConfiguration {
|
|
|
228
245
|
* Environmental variables used for PHP container
|
|
229
246
|
*/
|
|
230
247
|
env: Record<string, unknown>
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Service platform
|
|
251
|
+
*/
|
|
252
|
+
platform?: 'linux/amd64' | 'linux/arm64' | (string & {})
|
|
231
253
|
}
|
|
232
254
|
export interface SSLConfiguration {
|
|
233
255
|
/**
|