@scandipwa/magento-scripts 1.12.0-alpha.0 → 1.12.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/lib/config/dependencies-for-platforms.js +0 -1
- package/lib/config/index.js +2 -2
- package/lib/config/{php.js → php-config.js} +0 -0
- package/lib/config/{php-storm.js → phpstorm/debug-config.js} +0 -0
- package/lib/config/templates/vscode-launch.template.json +15 -0
- package/lib/config/versions/magento-2.3.0.js +1 -1
- package/lib/config/versions/magento-2.3.1.js +1 -1
- package/lib/config/versions/magento-2.3.2-p2.js +1 -1
- package/lib/config/versions/magento-2.3.2.js +1 -1
- package/lib/config/versions/magento-2.3.3-p1.js +1 -1
- package/lib/config/versions/magento-2.3.3.js +1 -1
- package/lib/config/versions/magento-2.3.4-p2.js +1 -1
- package/lib/config/versions/magento-2.3.4.js +1 -1
- package/lib/config/versions/magento-2.3.5-p1.js +1 -1
- package/lib/config/versions/magento-2.3.5-p2.js +1 -1
- package/lib/config/versions/magento-2.3.5.js +1 -1
- package/lib/config/versions/magento-2.3.6-p1.js +1 -1
- package/lib/config/versions/magento-2.3.6.js +1 -1
- package/lib/config/versions/magento-2.3.7-p1.js +3 -3
- package/lib/config/versions/magento-2.3.7.js +3 -3
- package/lib/config/versions/magento-2.4.0-p1.js +2 -2
- package/lib/config/versions/magento-2.4.0.js +2 -2
- package/lib/config/versions/magento-2.4.1-p1.js +2 -2
- package/lib/config/versions/magento-2.4.1.js +2 -2
- package/lib/config/versions/magento-2.4.2-p1.js +3 -3
- package/lib/config/versions/magento-2.4.2-p2.js +3 -3
- package/lib/config/versions/magento-2.4.2.js +3 -3
- package/lib/config/versions/magento-2.4.3-p1.js +3 -3
- package/lib/config/versions/magento-2.4.3.js +3 -3
- package/lib/tasks/composer/index.js +11 -4
- package/lib/tasks/file-system/create-vscode-config.js +111 -0
- package/lib/tasks/file-system/index.js +3 -1
- package/lib/tasks/php/compile.js +2 -2
- package/lib/tasks/php-fpm/start-php-fpm.js +1 -1
- package/lib/tasks/php-fpm/stop-php-fpm.js +1 -1
- package/lib/util/config-file-validator.js +7 -1
- package/package.json +3 -2
package/lib/config/index.js
CHANGED
|
@@ -4,10 +4,10 @@ const {
|
|
|
4
4
|
getConfigurations,
|
|
5
5
|
defaultConfiguration
|
|
6
6
|
} = require('./versions');
|
|
7
|
-
const getPhpConfig = require('./php');
|
|
7
|
+
const getPhpConfig = require('./php-config');
|
|
8
8
|
const getComposerConfig = require('./composer');
|
|
9
9
|
const { getMagentoConfig } = require('./magento-config');
|
|
10
|
-
const { getPhpStormConfig } = require('./
|
|
10
|
+
const { getPhpStormConfig } = require('./phpstorm/debug-config');
|
|
11
11
|
const resolveConfigurationWithOverrides = require('../util/resolve-configuration-with-overrides');
|
|
12
12
|
const { getPrefix, folderName } = require('../util/prefix');
|
|
13
13
|
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Listen for XDebug",
|
|
9
|
+
"type": "php",
|
|
10
|
+
"request": "launch",
|
|
11
|
+
"port": <%~ it.XDebugPort %>,
|
|
12
|
+
"runtimeExecutable": "<%~ it.PHPBinPath %>"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -5,7 +5,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
5
5
|
magentoVersion: '2.3.7-p1',
|
|
6
6
|
configuration: {
|
|
7
7
|
php: {
|
|
8
|
-
version: '7.4.
|
|
8
|
+
version: '7.4.27',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
11
|
gd: {},
|
|
@@ -15,7 +15,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
15
15
|
sockets: {},
|
|
16
16
|
SimpleXML: {},
|
|
17
17
|
xdebug: {
|
|
18
|
-
version: '
|
|
18
|
+
version: '3.1.2'
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
},
|
|
@@ -36,7 +36,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
36
36
|
version: '7.9.3'
|
|
37
37
|
},
|
|
38
38
|
composer: {
|
|
39
|
-
version: '2'
|
|
39
|
+
version: '2.1.14'
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
magento: defaultMagentoConfig,
|
|
@@ -5,7 +5,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
5
5
|
magentoVersion: '2.3.7',
|
|
6
6
|
configuration: {
|
|
7
7
|
php: {
|
|
8
|
-
version: '7.4.
|
|
8
|
+
version: '7.4.27',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
11
|
gd: {},
|
|
@@ -15,7 +15,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
15
15
|
sockets: {},
|
|
16
16
|
SimpleXML: {},
|
|
17
17
|
xdebug: {
|
|
18
|
-
version: '
|
|
18
|
+
version: '3.1.2'
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
},
|
|
@@ -36,7 +36,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
36
36
|
version: '7.9.3'
|
|
37
37
|
},
|
|
38
38
|
composer: {
|
|
39
|
-
version: '2'
|
|
39
|
+
version: '2.1.14'
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
magento: defaultMagentoConfig,
|
|
@@ -5,7 +5,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
5
5
|
magentoVersion: '2.4.0-p1',
|
|
6
6
|
configuration: {
|
|
7
7
|
php: {
|
|
8
|
-
version: '7.4.
|
|
8
|
+
version: '7.4.27',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
11
|
gd: {},
|
|
@@ -15,7 +15,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
15
15
|
sockets: {},
|
|
16
16
|
SimpleXML: {},
|
|
17
17
|
xdebug: {
|
|
18
|
-
version: '3.
|
|
18
|
+
version: '3.1.2'
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
},
|
|
@@ -5,7 +5,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
5
5
|
magentoVersion: '2.4.0',
|
|
6
6
|
configuration: {
|
|
7
7
|
php: {
|
|
8
|
-
version: '7.4.
|
|
8
|
+
version: '7.4.27',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
11
|
gd: {},
|
|
@@ -15,7 +15,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
15
15
|
sockets: {},
|
|
16
16
|
SimpleXML: {},
|
|
17
17
|
xdebug: {
|
|
18
|
-
version: '3.
|
|
18
|
+
version: '3.1.2'
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
},
|
|
@@ -6,7 +6,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
6
6
|
magentoVersion: '2.4.1-p1',
|
|
7
7
|
configuration: {
|
|
8
8
|
php: {
|
|
9
|
-
version: '7.4.
|
|
9
|
+
version: '7.4.27',
|
|
10
10
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
11
11
|
extensions: {
|
|
12
12
|
gd: {},
|
|
@@ -17,7 +17,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
17
17
|
SimpleXML: {},
|
|
18
18
|
libsodium,
|
|
19
19
|
xdebug: {
|
|
20
|
-
version: '3.
|
|
20
|
+
version: '3.1.2'
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
},
|
|
@@ -5,7 +5,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
5
5
|
magentoVersion: '2.4.1',
|
|
6
6
|
configuration: {
|
|
7
7
|
php: {
|
|
8
|
-
version: '7.4.
|
|
8
|
+
version: '7.4.27',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
11
|
gd: {},
|
|
@@ -15,7 +15,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
15
15
|
sockets: {},
|
|
16
16
|
SimpleXML: {},
|
|
17
17
|
xdebug: {
|
|
18
|
-
version: '3.
|
|
18
|
+
version: '3.1.2'
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
},
|
|
@@ -7,7 +7,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
7
7
|
isDefault: true,
|
|
8
8
|
configuration: {
|
|
9
9
|
php: {
|
|
10
|
-
version: '7.4.
|
|
10
|
+
version: '7.4.27',
|
|
11
11
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
12
12
|
extensions: {
|
|
13
13
|
gd: {},
|
|
@@ -19,7 +19,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
19
19
|
libsodium,
|
|
20
20
|
fileinfo: {},
|
|
21
21
|
xdebug: {
|
|
22
|
-
version: '3.
|
|
22
|
+
version: '3.1.2'
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
},
|
|
@@ -40,7 +40,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
40
40
|
version: '7.12.1'
|
|
41
41
|
},
|
|
42
42
|
composer: {
|
|
43
|
-
version: '2'
|
|
43
|
+
version: '2.1.14'
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
magento: defaultMagentoConfig,
|
|
@@ -7,7 +7,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
7
7
|
isDefault: true,
|
|
8
8
|
configuration: {
|
|
9
9
|
php: {
|
|
10
|
-
version: '7.4.
|
|
10
|
+
version: '7.4.27',
|
|
11
11
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
12
12
|
extensions: {
|
|
13
13
|
gd: {},
|
|
@@ -19,7 +19,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
19
19
|
libsodium,
|
|
20
20
|
fileinfo: {},
|
|
21
21
|
xdebug: {
|
|
22
|
-
version: '3.
|
|
22
|
+
version: '3.1.2'
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
},
|
|
@@ -40,7 +40,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
40
40
|
version: '7.12.1'
|
|
41
41
|
},
|
|
42
42
|
composer: {
|
|
43
|
-
version: '2'
|
|
43
|
+
version: '2.1.14'
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
magento: defaultMagentoConfig,
|
|
@@ -6,7 +6,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
6
6
|
magentoVersion: '2.4.2',
|
|
7
7
|
configuration: {
|
|
8
8
|
php: {
|
|
9
|
-
version: '7.4.
|
|
9
|
+
version: '7.4.27',
|
|
10
10
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
11
11
|
extensions: {
|
|
12
12
|
gd: {},
|
|
@@ -18,7 +18,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
18
18
|
libsodium,
|
|
19
19
|
fileinfo: {},
|
|
20
20
|
xdebug: {
|
|
21
|
-
version: '3.
|
|
21
|
+
version: '3.1.2'
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
},
|
|
@@ -39,7 +39,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
39
39
|
version: '7.12.1'
|
|
40
40
|
},
|
|
41
41
|
composer: {
|
|
42
|
-
version: '2'
|
|
42
|
+
version: '2.1.14'
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
magento: defaultMagentoConfig,
|
|
@@ -7,7 +7,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
7
7
|
isDefault: true,
|
|
8
8
|
configuration: {
|
|
9
9
|
php: {
|
|
10
|
-
version: '7.4.
|
|
10
|
+
version: '7.4.27',
|
|
11
11
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
12
12
|
extensions: {
|
|
13
13
|
gd: {},
|
|
@@ -19,7 +19,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
19
19
|
libsodium,
|
|
20
20
|
fileinfo: {},
|
|
21
21
|
xdebug: {
|
|
22
|
-
version: '3.
|
|
22
|
+
version: '3.1.2'
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
},
|
|
@@ -40,7 +40,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
40
40
|
version: '7.12.1'
|
|
41
41
|
},
|
|
42
42
|
composer: {
|
|
43
|
-
version: '2'
|
|
43
|
+
version: '2.1.14'
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
magento: defaultMagentoConfig,
|
|
@@ -7,7 +7,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
7
7
|
isDefault: true,
|
|
8
8
|
configuration: {
|
|
9
9
|
php: {
|
|
10
|
-
version: '7.4.
|
|
10
|
+
version: '7.4.27',
|
|
11
11
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
12
12
|
extensions: {
|
|
13
13
|
gd: {},
|
|
@@ -19,7 +19,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
19
19
|
libsodium,
|
|
20
20
|
fileinfo: {},
|
|
21
21
|
xdebug: {
|
|
22
|
-
version: '3.
|
|
22
|
+
version: '3.1.2'
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
},
|
|
@@ -40,7 +40,7 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
40
40
|
version: '7.12.1'
|
|
41
41
|
},
|
|
42
42
|
composer: {
|
|
43
|
-
version: '2'
|
|
43
|
+
version: '2.1.14'
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
magento: defaultMagentoConfig,
|
|
@@ -32,8 +32,12 @@ const createComposerDir = async ({ composer }) => {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const downloadComposerBinary = async ({ composer }) => {
|
|
35
|
+
const composerVersion = /^\d$/.test(composer.version)
|
|
36
|
+
? `latest-${composer.version}.x`
|
|
37
|
+
: composer.version;
|
|
38
|
+
|
|
35
39
|
try {
|
|
36
|
-
await downloadFile(`https://getcomposer.org/download
|
|
40
|
+
await downloadFile(`https://getcomposer.org/download/${composerVersion}/composer.phar`, {
|
|
37
41
|
destination: composer.binPath
|
|
38
42
|
});
|
|
39
43
|
} catch (e) {
|
|
@@ -59,11 +63,14 @@ const installComposer = () => ({
|
|
|
59
63
|
await downloadComposerBinary({ composer });
|
|
60
64
|
} else {
|
|
61
65
|
const currentComposerVersion = await getComposerVersion({ composer, php });
|
|
66
|
+
const expectedComposerVersion = /^\d$/.test(composer.version)
|
|
67
|
+
? `${composer.version}.x`
|
|
68
|
+
: composer.version;
|
|
62
69
|
|
|
63
|
-
if (!semver.satisfies(currentComposerVersion,
|
|
70
|
+
if (!semver.satisfies(currentComposerVersion, expectedComposerVersion)) {
|
|
64
71
|
const continueComposerBinaryVersionSwitch = await task.prompt({
|
|
65
72
|
type: 'Select',
|
|
66
|
-
message: `You have Composer ${logger.style.misc(`${currentComposerVersion}`)} while your Magento version requires ${logger.style.misc(
|
|
73
|
+
message: `You have Composer ${logger.style.misc(`${currentComposerVersion}`)} while your Magento version requires ${logger.style.misc(expectedComposerVersion)}!`,
|
|
67
74
|
choices: [
|
|
68
75
|
{
|
|
69
76
|
message: `Continue with current installed version (${logger.style.misc(`${currentComposerVersion}`)})`,
|
|
@@ -86,7 +93,7 @@ const installComposer = () => ({
|
|
|
86
93
|
break;
|
|
87
94
|
}
|
|
88
95
|
case 'exit': {
|
|
89
|
-
throw new Error(`Current composer version ${logger.style.misc(`v${currentComposerVersion}`)} is not compatible with version ${logger.style.misc(
|
|
96
|
+
throw new Error(`Current composer version ${logger.style.misc(`v${currentComposerVersion}`)} is not compatible with version ${logger.style.misc(expectedComposerVersion)}!`);
|
|
90
97
|
}
|
|
91
98
|
case 'continue':
|
|
92
99
|
default: {
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const semver = require('semver');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
const hjson = require('hjson');
|
|
6
|
+
const pathExists = require('../../util/path-exists');
|
|
7
|
+
const setConfigFile = require('../../util/set-config');
|
|
8
|
+
|
|
9
|
+
const phpXDebug2port = 9111;
|
|
10
|
+
const phpXDebug3port = 9003;
|
|
11
|
+
const listenForXDebugConfigName = 'Listen for XDebug';
|
|
12
|
+
|
|
13
|
+
const vscodeLaunchConfigPath = path.join(process.cwd(), '.vscode', 'launch.json');
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param {import('../../../typings/context').ListrContext['config']['php']} php
|
|
17
|
+
*/
|
|
18
|
+
const getCurrentXDebugPort = (php) => (semver.satisfies(php.extensions.xdebug.version, '>=3')
|
|
19
|
+
? phpXDebug3port
|
|
20
|
+
: phpXDebug2port);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @param {import('../../../typings/context').ListrContext['config']['php']} php
|
|
24
|
+
*/
|
|
25
|
+
const getPHPBinPathWithHomeVariable = (php) => php.binPath.replace(os.homedir(), '$HOME');
|
|
26
|
+
/**
|
|
27
|
+
* @param {import('../../../typings/context').ListrContext['config']['php']} php
|
|
28
|
+
*/
|
|
29
|
+
const addPHPDebugConfig = (vscodeLaunchConfig, php) => {
|
|
30
|
+
const phpXDebugConfig = vscodeLaunchConfig.configurations.find(
|
|
31
|
+
({ name }) => name === listenForXDebugConfigName
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const phpXDebugPort = getCurrentXDebugPort(php);
|
|
35
|
+
const phpBingPath = getPHPBinPathWithHomeVariable(php);
|
|
36
|
+
|
|
37
|
+
if (!phpXDebugConfig) {
|
|
38
|
+
vscodeLaunchConfig.configurations.push({
|
|
39
|
+
name: listenForXDebugConfigName,
|
|
40
|
+
type: 'php',
|
|
41
|
+
request: 'launch',
|
|
42
|
+
port: phpXDebugPort,
|
|
43
|
+
runtimeExecutable: phpBingPath
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (
|
|
50
|
+
phpXDebugConfig.port !== phpXDebugPort
|
|
51
|
+
&& phpXDebugConfig.runtimeExecutable !== phpBingPath
|
|
52
|
+
) {
|
|
53
|
+
phpXDebugConfig.port = phpXDebugPort;
|
|
54
|
+
phpXDebugConfig.runtimeExecutable = phpBingPath;
|
|
55
|
+
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return false;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @type {() => import('listr2').ListrTask<import('../../../typings/context').ListrContext>}
|
|
64
|
+
*/
|
|
65
|
+
const createPhpFpmConfig = () => ({
|
|
66
|
+
title: 'Setting VSCode config',
|
|
67
|
+
task: async ({ config: { php, baseConfig } }, task) => {
|
|
68
|
+
if (await pathExists(vscodeLaunchConfigPath)) {
|
|
69
|
+
const vscodeLaunchConfig = hjson.parse(await fs.promises.readFile(vscodeLaunchConfigPath, 'utf-8'), {
|
|
70
|
+
keepWsc: true
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const vscodeConfigEdited = addPHPDebugConfig(vscodeLaunchConfig, php);
|
|
74
|
+
|
|
75
|
+
// if vscode config is up-to-date, skip task
|
|
76
|
+
if (!vscodeConfigEdited) {
|
|
77
|
+
task.skip();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
await fs.promises.writeFile(vscodeLaunchConfigPath, hjson.stringify(vscodeLaunchConfig));
|
|
82
|
+
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (!await pathExists(path.join(process.cwd(), '.vscode'))) {
|
|
87
|
+
try {
|
|
88
|
+
await fs.promises.mkdir(path.join(process.cwd(), '.vscode'));
|
|
89
|
+
} catch (e) {
|
|
90
|
+
throw new Error(`Unable to creade .vscode directory in your project!\n\n${e}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
const phpXDebugPort = getCurrentXDebugPort(php);
|
|
96
|
+
const vscodeLaunchConfigTemplatePath = path.join(baseConfig.templateDir, 'vscode-launch.template.json');
|
|
97
|
+
await setConfigFile({
|
|
98
|
+
template: vscodeLaunchConfigTemplatePath,
|
|
99
|
+
configPathname: vscodeLaunchConfigPath,
|
|
100
|
+
templateArgs: {
|
|
101
|
+
XDebugPort: phpXDebugPort,
|
|
102
|
+
PHPBinPath: getPHPBinPathWithHomeVariable(php)
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
} catch (e) {
|
|
106
|
+
throw new Error(`Unexpected error accrued during launch.json config creation!\n\n${e}`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
module.exports = createPhpFpmConfig;
|
|
@@ -2,6 +2,7 @@ const createNginxConfig = require('./create-nginx-config');
|
|
|
2
2
|
const createPhpConfig = require('./create-php-config');
|
|
3
3
|
const createPhpFpmConfig = require('./create-php-fpm-config');
|
|
4
4
|
const createPhpStormConfig = require('./create-php-storm-config');
|
|
5
|
+
const createVSCodeConfig = require('./create-vscode-config');
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* @type {() => import('listr2').ListrTask<import('../../../typings/context').ListrContext>}
|
|
@@ -12,7 +13,8 @@ const prepareFileSystem = () => ({
|
|
|
12
13
|
createNginxConfig(),
|
|
13
14
|
createPhpFpmConfig(),
|
|
14
15
|
createPhpConfig(),
|
|
15
|
-
createPhpStormConfig()
|
|
16
|
+
createPhpStormConfig(),
|
|
17
|
+
createVSCodeConfig()
|
|
16
18
|
], {
|
|
17
19
|
concurrent: true
|
|
18
20
|
})
|
package/lib/tasks/php/compile.js
CHANGED
|
@@ -17,8 +17,8 @@ const compile = () => ({
|
|
|
17
17
|
platformCompileOptions.extraOptions.push('--with-libdir=lib64');
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
const
|
|
21
|
-
const phpCompileCommand = `${
|
|
20
|
+
const commandEnv = Object.entries(platformCompileOptions.env || {}).map(([key, value]) => `${key}="${value}"`).join(' && ');
|
|
21
|
+
const phpCompileCommand = `${commandEnv ? `${commandEnv} && ` : ''} \
|
|
22
22
|
phpbrew install -j ${platformCompileOptions.cpuCount} ${php.version} ${platformCompileOptions.variants.join(' ')} \
|
|
23
23
|
-- ${platformCompileOptions.extraOptions.join(' ')}`;
|
|
24
24
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { execAsyncSpawn } = require('../../util/exec-async-command');
|
|
2
|
-
const getPhpConfig = require('../../config/php');
|
|
2
|
+
const getPhpConfig = require('../../config/php-config');
|
|
3
3
|
const { getBaseConfig } = require('../../config/index');
|
|
4
4
|
const getProcessId = require('./get-process-id');
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const { execAsyncSpawn } = require('../../util/exec-async-command');
|
|
3
3
|
const pathExists = require('../../util/path-exists');
|
|
4
|
-
const getPhpConfig = require('../../config/php');
|
|
4
|
+
const getPhpConfig = require('../../config/php-config');
|
|
5
5
|
const { getBaseConfig } = require('../../config/index');
|
|
6
6
|
const getProcessId = require('./get-process-id');
|
|
7
7
|
|
|
@@ -83,7 +83,13 @@ const serviceConfigurationSchema = Joi.object({
|
|
|
83
83
|
* @type {Joi.ObjectSchema<import('../../typings').CMAConfiguration['configuration']['composer']>}
|
|
84
84
|
*/
|
|
85
85
|
const composerConfigurationSchema = Joi.object({
|
|
86
|
-
version: Joi.string().optional().
|
|
86
|
+
version: Joi.string().optional().custom((value) => {
|
|
87
|
+
if (['1', '2'].includes(value)) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return versionValidator(value);
|
|
92
|
+
})
|
|
87
93
|
});
|
|
88
94
|
|
|
89
95
|
/**
|
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": "1.12.0
|
|
6
|
+
"version": "1.12.0",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"types": "./typings/index.d.ts",
|
|
9
9
|
"license": "OSL-3.0",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"enquirer": "2.3.6",
|
|
28
28
|
"eta": "1.12.3",
|
|
29
29
|
"getos": "3.2.1",
|
|
30
|
+
"hjson": "^3.2.2",
|
|
30
31
|
"is-installed-globally": "0.4.0",
|
|
31
32
|
"joi": "17.4.2",
|
|
32
33
|
"listr2": "3.13.0",
|
|
@@ -41,5 +42,5 @@
|
|
|
41
42
|
"publishConfig": {
|
|
42
43
|
"access": "public"
|
|
43
44
|
},
|
|
44
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "24e277b08147a61ac53ae974895135d27668a9ca"
|
|
45
46
|
}
|