@scandipwa/magento-scripts 1.16.1 → 1.17.1
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 +2 -1
- package/lib/config/php/releases/php-7.2.js +0 -1
- package/lib/config/php/releases/php-7.3.js +0 -1
- package/lib/config/php/releases/php-7.4.js +0 -1
- package/lib/config/php/releases/php-8.1.js +0 -1
- package/lib/config/versions/magento-2.3.2-p1.js +38 -0
- package/lib/config/versions/magento-2.3.4-p1.js +38 -0
- package/lib/config/versions/magento-2.3.7-p4.js +38 -0
- package/lib/config/versions/magento-2.4.3-p3.js +46 -0
- package/lib/config/versions/magento-2.4.4-p1.js +39 -0
- package/lib/config/versions/magento-2.4.4-p2.js +39 -0
- package/lib/config/versions/magento-2.4.5-p1.js +39 -0
- package/lib/config/versions/magento-2.4.5.js +39 -0
- package/lib/tasks/cache/create-cache-folder.js +3 -1
- package/lib/tasks/file-system/create-phpstorm-config/exclude-folder-config.js +13 -3
- package/lib/tasks/magento/enable-magento-composer-plugins.js +85 -30
- package/package.json +2 -2
|
@@ -57,6 +57,7 @@ const dependenciesForPlatforms = {
|
|
|
57
57
|
dependencies: [
|
|
58
58
|
'openssl-devel',
|
|
59
59
|
'libjpeg-turbo-devel',
|
|
60
|
+
'readline-devel',
|
|
60
61
|
'libpng-devel',
|
|
61
62
|
'gd-devel',
|
|
62
63
|
'libicu',
|
|
@@ -68,7 +69,7 @@ const dependenciesForPlatforms = {
|
|
|
68
69
|
'oniguruma-devel',
|
|
69
70
|
'libxml2-devel',
|
|
70
71
|
'bzip2-devel',
|
|
71
|
-
'
|
|
72
|
+
'libcurl-devel',
|
|
72
73
|
'libxslt-devel',
|
|
73
74
|
'autoconf',
|
|
74
75
|
'php'
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { defaultMagentoConfig } = require('../magento-config');
|
|
3
|
+
const { php72 } = require('../php/releases');
|
|
4
|
+
const { sslTerminator } = require('../ssl-terminator');
|
|
5
|
+
const { varnish66 } = require('../varnish/varnish-6-6');
|
|
6
|
+
|
|
7
|
+
module.exports = ({ templateDir } = {}) => ({
|
|
8
|
+
magentoVersion: '2.3.2-p1',
|
|
9
|
+
configuration: {
|
|
10
|
+
php: php72({ templateDir }),
|
|
11
|
+
nginx: {
|
|
12
|
+
version: '1.18.0',
|
|
13
|
+
configTemplate: path.join(templateDir || '', 'nginx.template.conf')
|
|
14
|
+
},
|
|
15
|
+
redis: {
|
|
16
|
+
version: '5'
|
|
17
|
+
},
|
|
18
|
+
mysql: {
|
|
19
|
+
version: '5.7'
|
|
20
|
+
},
|
|
21
|
+
mariadb: {
|
|
22
|
+
version: '10.2'
|
|
23
|
+
},
|
|
24
|
+
elasticsearch: {
|
|
25
|
+
version: '6.8.16'
|
|
26
|
+
},
|
|
27
|
+
composer: {
|
|
28
|
+
version: '1'
|
|
29
|
+
},
|
|
30
|
+
varnish: varnish66({ templateDir }),
|
|
31
|
+
sslTerminator: sslTerminator({ templateDir })
|
|
32
|
+
},
|
|
33
|
+
magento: defaultMagentoConfig,
|
|
34
|
+
host: 'localhost',
|
|
35
|
+
ssl: {
|
|
36
|
+
enabled: false
|
|
37
|
+
}
|
|
38
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { defaultMagentoConfig } = require('../magento-config');
|
|
3
|
+
const { php73 } = require('../php/releases');
|
|
4
|
+
const { sslTerminator } = require('../ssl-terminator');
|
|
5
|
+
const { varnish66 } = require('../varnish/varnish-6-6');
|
|
6
|
+
|
|
7
|
+
module.exports = ({ templateDir } = {}) => ({
|
|
8
|
+
magentoVersion: '2.3.4-p1',
|
|
9
|
+
configuration: {
|
|
10
|
+
php: php73({ templateDir }),
|
|
11
|
+
nginx: {
|
|
12
|
+
version: '1.18.0',
|
|
13
|
+
configTemplate: path.join(templateDir || '', 'nginx.template.conf')
|
|
14
|
+
},
|
|
15
|
+
redis: {
|
|
16
|
+
version: '5'
|
|
17
|
+
},
|
|
18
|
+
mysql: {
|
|
19
|
+
version: '5.7'
|
|
20
|
+
},
|
|
21
|
+
mariadb: {
|
|
22
|
+
version: '10.2'
|
|
23
|
+
},
|
|
24
|
+
elasticsearch: {
|
|
25
|
+
version: '6.8.16'
|
|
26
|
+
},
|
|
27
|
+
composer: {
|
|
28
|
+
version: '1'
|
|
29
|
+
},
|
|
30
|
+
varnish: varnish66({ templateDir }),
|
|
31
|
+
sslTerminator: sslTerminator({ templateDir })
|
|
32
|
+
},
|
|
33
|
+
magento: defaultMagentoConfig,
|
|
34
|
+
host: 'localhost',
|
|
35
|
+
ssl: {
|
|
36
|
+
enabled: false
|
|
37
|
+
}
|
|
38
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { defaultMagentoConfig } = require('../magento-config');
|
|
3
|
+
const { php74 } = require('../php/releases');
|
|
4
|
+
const { sslTerminator } = require('../ssl-terminator');
|
|
5
|
+
const { varnish66 } = require('../varnish/varnish-6-6');
|
|
6
|
+
|
|
7
|
+
module.exports = ({ templateDir } = {}) => ({
|
|
8
|
+
magentoVersion: '2.3.7-p4',
|
|
9
|
+
configuration: {
|
|
10
|
+
php: php74({ templateDir }),
|
|
11
|
+
nginx: {
|
|
12
|
+
version: '1.18.0',
|
|
13
|
+
configTemplate: path.join(templateDir || '', 'nginx.template.conf')
|
|
14
|
+
},
|
|
15
|
+
redis: {
|
|
16
|
+
version: '6'
|
|
17
|
+
},
|
|
18
|
+
mysql: {
|
|
19
|
+
version: '5.7'
|
|
20
|
+
},
|
|
21
|
+
mariadb: {
|
|
22
|
+
version: '10.2'
|
|
23
|
+
},
|
|
24
|
+
elasticsearch: {
|
|
25
|
+
version: '7.9.3'
|
|
26
|
+
},
|
|
27
|
+
composer: {
|
|
28
|
+
version: '2'
|
|
29
|
+
},
|
|
30
|
+
varnish: varnish66({ templateDir }),
|
|
31
|
+
sslTerminator: sslTerminator({ templateDir })
|
|
32
|
+
},
|
|
33
|
+
magento: defaultMagentoConfig,
|
|
34
|
+
host: 'localhost',
|
|
35
|
+
ssl: {
|
|
36
|
+
enabled: false
|
|
37
|
+
}
|
|
38
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { defaultMagentoConfig } = require('../magento-config');
|
|
3
|
+
const { libsodium } = require('../php/extensions');
|
|
4
|
+
const { php74 } = require('../php/releases');
|
|
5
|
+
const { sslTerminator } = require('../ssl-terminator');
|
|
6
|
+
const { varnish66 } = require('../varnish/varnish-6-6');
|
|
7
|
+
|
|
8
|
+
module.exports = ({ templateDir } = {}) => ({
|
|
9
|
+
magentoVersion: '2.4.3-p3',
|
|
10
|
+
isDefault: true,
|
|
11
|
+
configuration: {
|
|
12
|
+
php: php74({
|
|
13
|
+
templateDir,
|
|
14
|
+
additionalExtensions: {
|
|
15
|
+
libsodium,
|
|
16
|
+
fileinfo: {}
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
19
|
+
nginx: {
|
|
20
|
+
version: '1.18.0',
|
|
21
|
+
configTemplate: path.join(templateDir || '', 'nginx.template.conf')
|
|
22
|
+
},
|
|
23
|
+
redis: {
|
|
24
|
+
version: '6.0'
|
|
25
|
+
},
|
|
26
|
+
mysql: {
|
|
27
|
+
version: '8.0'
|
|
28
|
+
},
|
|
29
|
+
mariadb: {
|
|
30
|
+
version: '10.4'
|
|
31
|
+
},
|
|
32
|
+
elasticsearch: {
|
|
33
|
+
version: '7.12.1'
|
|
34
|
+
},
|
|
35
|
+
composer: {
|
|
36
|
+
version: '2'
|
|
37
|
+
},
|
|
38
|
+
varnish: varnish66({ templateDir }),
|
|
39
|
+
sslTerminator: sslTerminator({ templateDir })
|
|
40
|
+
},
|
|
41
|
+
magento: defaultMagentoConfig,
|
|
42
|
+
host: 'localhost',
|
|
43
|
+
ssl: {
|
|
44
|
+
enabled: false
|
|
45
|
+
}
|
|
46
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { defaultMagentoConfig } = require('../magento-config');
|
|
3
|
+
const { php81 } = require('../php/releases');
|
|
4
|
+
const { sslTerminator } = require('../ssl-terminator');
|
|
5
|
+
const { varnish70 } = require('../varnish/varnish-7-0');
|
|
6
|
+
|
|
7
|
+
module.exports = ({ templateDir } = {}) => ({
|
|
8
|
+
magentoVersion: '2.4.4-p1',
|
|
9
|
+
isDefault: true,
|
|
10
|
+
configuration: {
|
|
11
|
+
php: php81({ templateDir }),
|
|
12
|
+
nginx: {
|
|
13
|
+
version: '1.18.0',
|
|
14
|
+
configTemplate: path.join(templateDir || '', 'nginx.template.conf')
|
|
15
|
+
},
|
|
16
|
+
redis: {
|
|
17
|
+
version: '6.0'
|
|
18
|
+
},
|
|
19
|
+
mysql: {
|
|
20
|
+
version: '8.0'
|
|
21
|
+
},
|
|
22
|
+
mariadb: {
|
|
23
|
+
version: '10.4'
|
|
24
|
+
},
|
|
25
|
+
elasticsearch: {
|
|
26
|
+
version: '7.16.3'
|
|
27
|
+
},
|
|
28
|
+
composer: {
|
|
29
|
+
version: '2'
|
|
30
|
+
},
|
|
31
|
+
varnish: varnish70({ templateDir }),
|
|
32
|
+
sslTerminator: sslTerminator({ templateDir })
|
|
33
|
+
},
|
|
34
|
+
magento: defaultMagentoConfig,
|
|
35
|
+
host: 'localhost',
|
|
36
|
+
ssl: {
|
|
37
|
+
enabled: false
|
|
38
|
+
}
|
|
39
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { defaultMagentoConfig } = require('../magento-config');
|
|
3
|
+
const { php81 } = require('../php/releases');
|
|
4
|
+
const { sslTerminator } = require('../ssl-terminator');
|
|
5
|
+
const { varnish70 } = require('../varnish/varnish-7-0');
|
|
6
|
+
|
|
7
|
+
module.exports = ({ templateDir } = {}) => ({
|
|
8
|
+
magentoVersion: '2.4.4-p2',
|
|
9
|
+
isDefault: true,
|
|
10
|
+
configuration: {
|
|
11
|
+
php: php81({ templateDir }),
|
|
12
|
+
nginx: {
|
|
13
|
+
version: '1.18.0',
|
|
14
|
+
configTemplate: path.join(templateDir || '', 'nginx.template.conf')
|
|
15
|
+
},
|
|
16
|
+
redis: {
|
|
17
|
+
version: '6.0'
|
|
18
|
+
},
|
|
19
|
+
mysql: {
|
|
20
|
+
version: '8.0'
|
|
21
|
+
},
|
|
22
|
+
mariadb: {
|
|
23
|
+
version: '10.4'
|
|
24
|
+
},
|
|
25
|
+
elasticsearch: {
|
|
26
|
+
version: '7.16.3'
|
|
27
|
+
},
|
|
28
|
+
composer: {
|
|
29
|
+
version: '2'
|
|
30
|
+
},
|
|
31
|
+
varnish: varnish70({ templateDir }),
|
|
32
|
+
sslTerminator: sslTerminator({ templateDir })
|
|
33
|
+
},
|
|
34
|
+
magento: defaultMagentoConfig,
|
|
35
|
+
host: 'localhost',
|
|
36
|
+
ssl: {
|
|
37
|
+
enabled: false
|
|
38
|
+
}
|
|
39
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { defaultMagentoConfig } = require('../magento-config');
|
|
3
|
+
const { php81 } = require('../php/releases');
|
|
4
|
+
const { sslTerminator } = require('../ssl-terminator');
|
|
5
|
+
const { varnish70 } = require('../varnish/varnish-7-0');
|
|
6
|
+
|
|
7
|
+
module.exports = ({ templateDir } = {}) => ({
|
|
8
|
+
magentoVersion: '2.4.5-p1',
|
|
9
|
+
isDefault: true,
|
|
10
|
+
configuration: {
|
|
11
|
+
php: php81({ templateDir }),
|
|
12
|
+
nginx: {
|
|
13
|
+
version: '1.18.0',
|
|
14
|
+
configTemplate: path.join(templateDir || '', 'nginx.template.conf')
|
|
15
|
+
},
|
|
16
|
+
redis: {
|
|
17
|
+
version: '6.0'
|
|
18
|
+
},
|
|
19
|
+
mysql: {
|
|
20
|
+
version: '8.0'
|
|
21
|
+
},
|
|
22
|
+
mariadb: {
|
|
23
|
+
version: '10.4'
|
|
24
|
+
},
|
|
25
|
+
elasticsearch: {
|
|
26
|
+
version: '7.17.6'
|
|
27
|
+
},
|
|
28
|
+
composer: {
|
|
29
|
+
version: '2'
|
|
30
|
+
},
|
|
31
|
+
varnish: varnish70({ templateDir }),
|
|
32
|
+
sslTerminator: sslTerminator({ templateDir })
|
|
33
|
+
},
|
|
34
|
+
magento: defaultMagentoConfig,
|
|
35
|
+
host: 'localhost',
|
|
36
|
+
ssl: {
|
|
37
|
+
enabled: false
|
|
38
|
+
}
|
|
39
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { defaultMagentoConfig } = require('../magento-config');
|
|
3
|
+
const { php81 } = require('../php/releases');
|
|
4
|
+
const { sslTerminator } = require('../ssl-terminator');
|
|
5
|
+
const { varnish70 } = require('../varnish/varnish-7-0');
|
|
6
|
+
|
|
7
|
+
module.exports = ({ templateDir } = {}) => ({
|
|
8
|
+
magentoVersion: '2.4.5',
|
|
9
|
+
isDefault: true,
|
|
10
|
+
configuration: {
|
|
11
|
+
php: php81({ templateDir }),
|
|
12
|
+
nginx: {
|
|
13
|
+
version: '1.18.0',
|
|
14
|
+
configTemplate: path.join(templateDir || '', 'nginx.template.conf')
|
|
15
|
+
},
|
|
16
|
+
redis: {
|
|
17
|
+
version: '6.0'
|
|
18
|
+
},
|
|
19
|
+
mysql: {
|
|
20
|
+
version: '8.0'
|
|
21
|
+
},
|
|
22
|
+
mariadb: {
|
|
23
|
+
version: '10.4'
|
|
24
|
+
},
|
|
25
|
+
elasticsearch: {
|
|
26
|
+
version: '7.17.6'
|
|
27
|
+
},
|
|
28
|
+
composer: {
|
|
29
|
+
version: '2'
|
|
30
|
+
},
|
|
31
|
+
varnish: varnish70({ templateDir }),
|
|
32
|
+
sslTerminator: sslTerminator({ templateDir })
|
|
33
|
+
},
|
|
34
|
+
magento: defaultMagentoConfig,
|
|
35
|
+
host: 'localhost',
|
|
36
|
+
ssl: {
|
|
37
|
+
enabled: false
|
|
38
|
+
}
|
|
39
|
+
});
|
|
@@ -17,11 +17,21 @@ const excludeFoldersPaths = [
|
|
|
17
17
|
/**
|
|
18
18
|
* Will retrieve project config file path from module.xml
|
|
19
19
|
*
|
|
20
|
-
* @returns {Promise<String>}
|
|
20
|
+
* @returns {Promise<String | null>}
|
|
21
21
|
*/
|
|
22
22
|
const getProjectConfigFilePath = async () => {
|
|
23
23
|
const modulesConfigData = await loadXmlFile(pathToModulesConfig);
|
|
24
|
-
|
|
24
|
+
const {
|
|
25
|
+
project: {
|
|
26
|
+
component: {
|
|
27
|
+
modules: {
|
|
28
|
+
module
|
|
29
|
+
} = {}
|
|
30
|
+
} = {}
|
|
31
|
+
} = {}
|
|
32
|
+
} = modulesConfigData || {};
|
|
33
|
+
const filePath = module && module['@_filepath'];
|
|
34
|
+
return filePath ? filePath.replace('$PROJECT_DIR$', process.cwd()) : null;
|
|
25
35
|
};
|
|
26
36
|
|
|
27
37
|
/**
|
|
@@ -127,7 +137,7 @@ const setupExcludedFoldersConfig = () => ({
|
|
|
127
137
|
task: async (ctx, task) => {
|
|
128
138
|
if (await pathExists(pathToModulesConfig)) {
|
|
129
139
|
const projectFilePath = await getProjectConfigFilePath();
|
|
130
|
-
if (await pathExists(projectFilePath)) {
|
|
140
|
+
if (projectFilePath && await pathExists(projectFilePath)) {
|
|
131
141
|
const projectConfigData = await loadXmlFile(projectFilePath);
|
|
132
142
|
const excludedFoldersConfig = getExcludedFoldersConfig(projectConfigData);
|
|
133
143
|
const hasChanges = setupExcludedFolders(excludedFoldersConfig);
|
|
@@ -4,7 +4,6 @@ const logger = require('@scandipwa/scandipwa-dev-utils/logger');
|
|
|
4
4
|
const semver = require('semver');
|
|
5
5
|
const pathExists = require('../../util/path-exists');
|
|
6
6
|
const getJsonfileData = require('../../util/get-jsonfile-data');
|
|
7
|
-
const KnownError = require('../../errors/known-error');
|
|
8
7
|
|
|
9
8
|
const vendorPath = path.join(process.cwd(), 'vendor');
|
|
10
9
|
const composerJsonPath = path.join(process.cwd(), 'composer.json');
|
|
@@ -86,29 +85,80 @@ const enableMagentoComposerPlugins = () => ({
|
|
|
86
85
|
} = composerJsonData;
|
|
87
86
|
const allowPluginsKeys = Object.keys(allowPlugins);
|
|
88
87
|
|
|
88
|
+
const missingPluginsFromAllowPlugins = composerPlugins.filter((plugin) => {
|
|
89
|
+
const [pluginVendor, pluginName] = plugin.split('/');
|
|
90
|
+
return !allowPluginsKeys.some((allowedPlugin) => {
|
|
91
|
+
const [allowedPluginVendor, allowedPluginName] = allowedPlugin.split('/');
|
|
92
|
+
if (allowedPluginVendor === pluginVendor) {
|
|
93
|
+
if (allowedPluginName === '*') {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return allowedPluginName === pluginName;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return false;
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
89
104
|
if (
|
|
90
105
|
allowPluginsKeys.length === 0
|
|
91
|
-
||
|
|
106
|
+
|| missingPluginsFromAllowPlugins.length > 0
|
|
92
107
|
) {
|
|
93
|
-
const
|
|
108
|
+
const missingVendors = missingPluginsFromAllowPlugins.reduce((acc, val) => {
|
|
109
|
+
const [pluginVendor] = val.split('/');
|
|
110
|
+
|
|
111
|
+
if (acc.length === 0) {
|
|
112
|
+
return [pluginVendor];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (!acc.includes(pluginVendor)) {
|
|
116
|
+
return [...acc, pluginVendor];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return acc;
|
|
120
|
+
}, []);
|
|
121
|
+
|
|
122
|
+
const pluginOptions = [
|
|
123
|
+
{
|
|
124
|
+
name: 'all-individual',
|
|
125
|
+
message: 'Enable all individually'
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'manual',
|
|
129
|
+
message: 'Configure manually'
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'skip',
|
|
133
|
+
message: 'Skip this step'
|
|
134
|
+
}
|
|
135
|
+
];
|
|
136
|
+
|
|
137
|
+
if (missingVendors.length === 1) {
|
|
138
|
+
pluginOptions.unshift({
|
|
139
|
+
name: 'all',
|
|
140
|
+
message: `Enable all (${logger.style.code(`"${missingVendors[0]}/*"`)})`
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
94
144
|
const answerForEnablingPlugins = await task.prompt({
|
|
95
145
|
type: 'Select',
|
|
96
146
|
message: `Composer 2.2 requires manually allowing composer-plugins to run.
|
|
97
147
|
Magento requires the following plugins to correctly operate:
|
|
98
148
|
|
|
99
|
-
${
|
|
149
|
+
${missingPluginsFromAllowPlugins.map((p) => logger.style.code(p)).join('\n')}
|
|
100
150
|
|
|
101
151
|
Do you want to enable them all or disable some of them?`,
|
|
102
|
-
choices:
|
|
152
|
+
choices: pluginOptions
|
|
103
153
|
});
|
|
104
154
|
|
|
105
155
|
switch (answerForEnablingPlugins.toLowerCase()) {
|
|
106
|
-
case '
|
|
156
|
+
case 'all': {
|
|
107
157
|
composerJsonData.config = {
|
|
108
158
|
...(composerJsonData.config || {}),
|
|
109
159
|
'allow-plugins': {
|
|
110
160
|
...allowPlugins,
|
|
111
|
-
|
|
161
|
+
[`${missingVendors[0]}/*`]: true
|
|
112
162
|
}
|
|
113
163
|
};
|
|
114
164
|
|
|
@@ -117,36 +167,41 @@ Do you want to enable them all or disable some of them?`,
|
|
|
117
167
|
});
|
|
118
168
|
break;
|
|
119
169
|
}
|
|
120
|
-
case '
|
|
170
|
+
case 'all-individual': {
|
|
171
|
+
composerJsonData.config = {
|
|
172
|
+
...(composerJsonData.config || {}),
|
|
173
|
+
'allow-plugins': {
|
|
174
|
+
...allowPlugins,
|
|
175
|
+
...missingPluginsFromAllowPlugins.reduce((acc, val) => ({ ...acc, [val]: true }), {})
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
await fs.promises.writeFile(composerJsonPath, JSON.stringify(composerJsonData, null, 4), {
|
|
180
|
+
encoding: 'utf-8'
|
|
181
|
+
});
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
case 'manual': {
|
|
121
185
|
const userEnabledPlugins = await task.prompt({
|
|
122
186
|
type: 'MultiSelect',
|
|
123
187
|
message: 'Please pick plugins you want to enable!',
|
|
124
|
-
choices:
|
|
188
|
+
choices: missingPluginsFromAllowPlugins.map((p) => ({ name: p }))
|
|
125
189
|
});
|
|
126
190
|
|
|
127
|
-
const
|
|
128
|
-
type: 'Confirm',
|
|
129
|
-
message: `Please confirm enabling of the following plugins:\n\n${userEnabledPlugins.map((p) => logger.style.code(p)).join('\n')}\n`
|
|
130
|
-
});
|
|
191
|
+
const disabledPlugins = composerPlugins.filter((p) => !userEnabledPlugins.includes(p));
|
|
131
192
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
...(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
...userEnabledPlugins.reduce((acc, val) => ({ ...acc, [val]: true }), {})
|
|
141
|
-
}
|
|
142
|
-
};
|
|
193
|
+
composerJsonData.config = {
|
|
194
|
+
...(composerJsonData.config || {}),
|
|
195
|
+
'allow-plugins': {
|
|
196
|
+
...allowPlugins,
|
|
197
|
+
...disabledPlugins.reduce((acc, val) => ({ ...acc, [val]: false }), {}),
|
|
198
|
+
...userEnabledPlugins.reduce((acc, val) => ({ ...acc, [val]: true }), {})
|
|
199
|
+
}
|
|
200
|
+
};
|
|
143
201
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
} else {
|
|
148
|
-
throw new KnownError('Please confirm your choice or choose other option.');
|
|
149
|
-
}
|
|
202
|
+
await fs.promises.writeFile(composerJsonPath, JSON.stringify(composerJsonData, null, 4), {
|
|
203
|
+
encoding: 'utf-8'
|
|
204
|
+
});
|
|
150
205
|
|
|
151
206
|
break;
|
|
152
207
|
}
|
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.
|
|
6
|
+
"version": "1.17.1",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"types": "./typings/index.d.ts",
|
|
9
9
|
"license": "OSL-3.0",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"mysql",
|
|
54
54
|
"scandipwa"
|
|
55
55
|
],
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "7132c339615e8772bf3dd4a0b43ab0022a7ef9db"
|
|
57
57
|
}
|