@scandipwa/magento-scripts 1.16.1 → 1.17.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.
@@ -68,7 +68,7 @@ const dependenciesForPlatforms = {
68
68
  'oniguruma-devel',
69
69
  'libxml2-devel',
70
70
  'bzip2-devel',
71
- 'curl-devel',
71
+ 'libcurl-devel',
72
72
  'libxslt-devel',
73
73
  'autoconf',
74
74
  'php'
@@ -8,7 +8,6 @@ const php72 = ({ templateDir, additionalExtensions = {} }) => ({
8
8
  gd: {
9
9
  macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
10
10
  },
11
- intl: {},
12
11
  zlib: {},
13
12
  openssl: {},
14
13
  sockets: {},
@@ -8,7 +8,6 @@ const php73 = ({ templateDir, additionalExtensions = {} }) => ({
8
8
  gd: {
9
9
  macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
10
10
  },
11
- intl: {},
12
11
  zlib: {},
13
12
  openssl: {},
14
13
  sockets: {},
@@ -6,7 +6,6 @@ const php74 = ({ templateDir, additionalExtensions = {} } = {}) => ({
6
6
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
7
7
  extensions: {
8
8
  gd: {},
9
- intl: {},
10
9
  zlib: {},
11
10
  openssl: {},
12
11
  sockets: {},
@@ -6,7 +6,6 @@ const php81 = ({ templateDir, additionalExtensions = {} } = {}) => ({
6
6
  configTemplate: path.join(templateDir || '', 'php.template.ini'),
7
7
  extensions: {
8
8
  gd: {},
9
- intl: {},
10
9
  zlib: {},
11
10
  openssl: {},
12
11
  sockets: {},
@@ -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.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.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
+ });
@@ -15,7 +15,9 @@ const createCacheFolder = () => ({
15
15
 
16
16
  task.title = 'Creating cache folder';
17
17
 
18
- await fs.promises.mkdir(baseConfig.cacheDir);
18
+ await fs.promises.mkdir(baseConfig.cacheDir, {
19
+ recursive: true
20
+ });
19
21
  }
20
22
  });
21
23
 
@@ -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
- || composerPlugins.some((p) => !allowPluginsKeys.includes(p))
106
+ || missingPluginsFromAllowPlugins.length > 0
92
107
  ) {
93
- const missingPlugins = composerPlugins.filter((p) => !allowPluginsKeys.includes(p));
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
- ${missingPlugins.map((p) => logger.style.code(p)).join('\n')}
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: ['Enable all', 'Configure manually', 'Skip this step']
152
+ choices: pluginOptions
103
153
  });
104
154
 
105
155
  switch (answerForEnablingPlugins.toLowerCase()) {
106
- case 'enable all': {
156
+ case 'all': {
107
157
  composerJsonData.config = {
108
158
  ...(composerJsonData.config || {}),
109
159
  'allow-plugins': {
110
160
  ...allowPlugins,
111
- ...missingPlugins.reduce((acc, val) => ({ ...acc, [val]: true }), {})
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 'configure manually': {
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: missingPlugins.map((p) => ({ name: p }))
188
+ choices: missingPluginsFromAllowPlugins.map((p) => ({ name: p }))
125
189
  });
126
190
 
127
- const userConfirmation = await task.prompt({
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
- if (userConfirmation) {
133
- const disabledPlugins = composerPlugins.filter((p) => !userEnabledPlugins.includes(p));
134
-
135
- composerJsonData.config = {
136
- ...(composerJsonData.config || {}),
137
- 'allow-plugins': {
138
- ...allowPlugins,
139
- ...disabledPlugins.reduce((acc, val) => ({ ...acc, [val]: false }), {}),
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
- await fs.promises.writeFile(composerJsonPath, JSON.stringify(composerJsonData, null, 4), {
145
- encoding: 'utf-8'
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.16.1",
6
+ "version": "1.17.0",
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": "ced1b75c1b448ef198a658edf010f53179aaaeb0"
56
+ "gitHead": "0698c02d64c2570c0f546e6c99747232242e7123"
57
57
  }