@scandipwa/magento-scripts 2.1.4 → 2.2.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.
Files changed (98) hide show
  1. package/lib/config/docker.js +29 -12
  2. package/lib/config/get-magento-version-config.js +4 -1
  3. package/lib/config/php-config.js +2 -1
  4. package/lib/config/services/composer/versions/composer-1.js +1 -1
  5. package/lib/config/services/composer/versions/composer-2.2.js +8 -0
  6. package/lib/config/services/composer/versions/composer-2.js +1 -1
  7. package/lib/config/services/composer/versions/index.js +2 -1
  8. package/lib/config/services/elasticsearch/versions/elasticsearch-8.4.js +4 -1
  9. package/lib/config/services/elasticsearch/versions/elasticsearch-8.5.js +4 -1
  10. package/lib/config/services/elasticsearch/versions/elasticsearch-8.7.js +14 -0
  11. package/lib/config/services/elasticsearch/versions/index.js +3 -1
  12. package/lib/config/services/mysql/versions/mysql-8.0.js +1 -1
  13. package/lib/config/services/php/default-php-env.js +6 -0
  14. package/lib/config/services/php/versions/php-7.2.js +3 -1
  15. package/lib/config/services/php/versions/php-7.3.js +3 -1
  16. package/lib/config/services/php/versions/php-7.4.js +3 -1
  17. package/lib/config/services/php/versions/php-8.1.js +3 -1
  18. package/lib/config/services/php/versions/php-8.2.js +3 -1
  19. package/lib/config/ssl-config.js +9 -0
  20. package/lib/config/templates/nginx.fastcgi_params.template +2 -2
  21. package/lib/config/templates/nginx.template.conf +19 -2
  22. package/lib/config/templates/ssl-terminator.template.conf +2 -6
  23. package/lib/config/versions/index.js +16 -33
  24. package/lib/config/versions/magento-2.2.10.js +3 -12
  25. package/lib/config/versions/magento-2.3.0.js +3 -12
  26. package/lib/config/versions/magento-2.3.1.js +3 -12
  27. package/lib/config/versions/magento-2.3.2-p1.js +3 -12
  28. package/lib/config/versions/magento-2.3.2-p2.js +3 -12
  29. package/lib/config/versions/magento-2.3.2.js +3 -12
  30. package/lib/config/versions/magento-2.3.3-p1.js +3 -12
  31. package/lib/config/versions/magento-2.3.3.js +3 -12
  32. package/lib/config/versions/magento-2.3.4-p1.js +3 -12
  33. package/lib/config/versions/magento-2.3.4-p2.js +3 -12
  34. package/lib/config/versions/magento-2.3.4.js +3 -12
  35. package/lib/config/versions/magento-2.3.5-p1.js +3 -12
  36. package/lib/config/versions/magento-2.3.5-p2.js +3 -12
  37. package/lib/config/versions/magento-2.3.5.js +3 -17
  38. package/lib/config/versions/magento-2.3.6-p1.js +3 -12
  39. package/lib/config/versions/magento-2.3.6.js +3 -12
  40. package/lib/config/versions/magento-2.3.7-p1.js +3 -12
  41. package/lib/config/versions/magento-2.3.7-p2.js +3 -12
  42. package/lib/config/versions/magento-2.3.7-p3.js +3 -12
  43. package/lib/config/versions/magento-2.3.7-p4.js +3 -12
  44. package/lib/config/versions/magento-2.3.7.js +3 -12
  45. package/lib/config/versions/magento-2.4.0-p1.js +3 -12
  46. package/lib/config/versions/magento-2.4.0.js +3 -12
  47. package/lib/config/versions/magento-2.4.1-p1.js +3 -12
  48. package/lib/config/versions/magento-2.4.1.js +3 -12
  49. package/lib/config/versions/magento-2.4.2-p1.js +3 -13
  50. package/lib/config/versions/magento-2.4.2-p2.js +3 -13
  51. package/lib/config/versions/magento-2.4.2.js +3 -12
  52. package/lib/config/versions/magento-2.4.3-p1.js +3 -13
  53. package/lib/config/versions/magento-2.4.3-p2.js +3 -13
  54. package/lib/config/versions/magento-2.4.3-p3.js +3 -13
  55. package/lib/config/versions/magento-2.4.3.js +3 -13
  56. package/lib/config/versions/magento-2.4.4-p1.js +3 -13
  57. package/lib/config/versions/magento-2.4.4-p2.js +3 -13
  58. package/lib/config/versions/magento-2.4.4-p3.js +3 -13
  59. package/lib/config/versions/magento-2.4.4-p4.js +1 -10
  60. package/lib/config/versions/magento-2.4.4-p5.js +38 -0
  61. package/lib/config/versions/magento-2.4.4-p6.js +38 -0
  62. package/lib/config/versions/magento-2.4.4.js +3 -13
  63. package/lib/config/versions/magento-2.4.5-p1.js +3 -13
  64. package/lib/config/versions/magento-2.4.5-p2.js +3 -13
  65. package/lib/config/versions/magento-2.4.5-p3.js +1 -10
  66. package/lib/config/versions/magento-2.4.5-p4.js +38 -0
  67. package/lib/config/versions/magento-2.4.5-p5.js +38 -0
  68. package/lib/config/versions/magento-2.4.5.js +3 -12
  69. package/lib/config/versions/magento-2.4.6-p1.js +1 -10
  70. package/lib/config/versions/magento-2.4.6-p2.js +38 -0
  71. package/lib/config/versions/magento-2.4.6-p3.js +39 -0
  72. package/lib/config/versions/magento-2.4.6.js +1 -10
  73. package/lib/config/versions/magento-2.4.7-beta2.js +38 -0
  74. package/lib/tasks/database/import-dump-to-database.js +1 -1
  75. package/lib/tasks/database/import-remote-db/ssh/database-dump-command.js +0 -2
  76. package/lib/tasks/database/import-remote-db/ssh/readymage.js +29 -28
  77. package/lib/tasks/docker/containers/container-api.d.ts +5 -0
  78. package/lib/tasks/docker/containers/container-api.js +4 -1
  79. package/lib/tasks/docker/project-image-builder.js +21 -0
  80. package/lib/tasks/file-system/create-nginx-config.js +7 -2
  81. package/lib/tasks/file-system/create-phpstorm-config/workspace-config/workspace-config.js +1 -1
  82. package/lib/tasks/file-system/create-ssl-terminator-config.js +9 -7
  83. package/lib/tasks/magento/install-magento-project.js +10 -7
  84. package/lib/tasks/magento/setup-magento/configure-elasticsearch.js +1 -1
  85. package/lib/tasks/magento/setup-magento/index-products.js +41 -1
  86. package/lib/tasks/magento/setup-magento/index.js +4 -1
  87. package/lib/tasks/magento/setup-magento/set-base-url.js +121 -13
  88. package/lib/tasks/requirements/elasticsearch-version.js +21 -6
  89. package/lib/util/config-file-validator.js +60 -19
  90. package/lib/util/config-php-json.js +2 -0
  91. package/lib/util/database.js +83 -1
  92. package/lib/util/instance-metadata.js +16 -19
  93. package/lib/util/match-filesystem.js +1 -0
  94. package/lib/util/run-magento.js +1 -0
  95. package/package.json +2 -2
  96. package/tsconfig.json +2 -1
  97. package/typings/common.d.ts +53 -0
  98. package/typings/index.d.ts +55 -0
@@ -10,14 +10,17 @@ const logger = require('@scandipwa/scandipwa-dev-utils/logger')
10
10
  const defaultMagentoUser = require('../tasks/database/default-magento-user')
11
11
 
12
12
  /**
13
- *
14
13
  * @param {import('../../typings/context').ListrContext} ctx
15
14
  * @param {import('../../typings/context').ListrContext['config']['overridenConfiguration']} overridenConfiguration
16
15
  * @param {import('../../typings/context').ListrContext['config']['baseConfig']} baseConfig
17
16
  */
18
17
  module.exports = async (ctx, overridenConfiguration, baseConfig) => {
19
- const { configuration, ssl, host } = overridenConfiguration
20
- const { nginx, redis, elasticsearch, mariadb, varnish, maildev } =
18
+ const {
19
+ configuration,
20
+ ssl,
21
+ storeDomains: { admin: host }
22
+ } = overridenConfiguration
23
+ const { nginx, redis, elasticsearch, mariadb, varnish, maildev, newRelic } =
21
24
  configuration
22
25
 
23
26
  const php = getPhpConfig(overridenConfiguration, baseConfig)
@@ -120,6 +123,16 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
120
123
  * @param {Record<string, number>} ports
121
124
  */
122
125
  const getContainers = (ports = {}) => {
126
+ const composerAuthEnv = process.env.COMPOSER_AUTH
127
+ ? {
128
+ COMPOSER_AUTH: JSON.stringify(
129
+ JSON.parse(process.env.COMPOSER_AUTH),
130
+ null,
131
+ 0
132
+ )
133
+ }
134
+ : {}
135
+
123
136
  /**
124
137
  * @type {Record<string, import('../tasks/docker/containers/container-api').ContainerRunOptions & { _?: string, forwardedPorts?: string[], debugImage?: string, remoteImages?: string[], connectCommand?: string[], description?: string }>}
125
138
  */
@@ -153,15 +166,7 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
153
166
  ]
154
167
  : []
155
168
  ),
156
- env: process.env.COMPOSER_AUTH
157
- ? {
158
- COMPOSER_AUTH: JSON.stringify(
159
- JSON.parse(process.env.COMPOSER_AUTH),
160
- null,
161
- 0
162
- )
163
- }
164
- : {},
169
+ env: deepmerge(composerAuthEnv, php.env || {}),
165
170
  restart: 'on-failure:5',
166
171
  image: `local-cma-project:${prefix}`,
167
172
  debugImage: `local-cma-project:${prefix}.debug`,
@@ -397,6 +402,8 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
397
402
  }
398
403
 
399
404
  if (ssl && ssl.enabled && isDockerDesktop) {
405
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
406
+ // @ts-ignore
400
407
  dockerConfig.sslTerminator.ports.push(
401
408
  `${isIpAddress(host) ? host : '127.0.0.1'}:443:443`
402
409
  )
@@ -446,6 +453,16 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
446
453
  }
447
454
  }
448
455
 
456
+ if (newRelic.enabled) {
457
+ dockerConfig.newRelicPHPDaemon = {
458
+ _: 'New Relic PHP daemon',
459
+ ports: [],
460
+ name: `${prefix}_newrelic-php-daemon`,
461
+ network: isDockerDesktop ? network.name : 'host',
462
+ image: 'newrelic/php-daemon'
463
+ }
464
+ }
465
+
449
466
  return dockerConfig
450
467
  }
451
468
 
@@ -7,6 +7,10 @@ const longestMagentoName = allVersions
7
7
  .map(({ name }) => name)
8
8
  .reduce((acc, val) => (val.length > acc ? val.length : acc), 0)
9
9
 
10
+ /**
11
+ * @param {{ name: string }} version
12
+ * @returns {string}
13
+ */
10
14
  const getMagentoVersionMessage = (version) => {
11
15
  const pureMagentoVersion = version.name.replace(/-p[0-9]+$/i, '')
12
16
  if (scandipwaMagentoVersionMapping[pureMagentoVersion]) {
@@ -25,7 +29,6 @@ const getMagentoVersionMessage = (version) => {
25
29
  * @returns {import('listr2').ListrTask<import('../../typings/context').ListrContext>}
26
30
  */
27
31
  const getMagentoVersion = () => ({
28
- // title: 'Loading Magento version',
29
32
  task: async (ctx, task) => {
30
33
  const {
31
34
  throwMagentoVersionMissing = false,
@@ -18,7 +18,8 @@ module.exports = (overridenConfiguration, baseConfig) => {
18
18
  debugTemplatePath: php.debugTemplate,
19
19
  fpmTemplatePath: php.fpmConfigTemplate,
20
20
  fpmConfPath: path.join(cacheDir, 'php-fpm.conf'),
21
- extensions: php.extensions
21
+ extensions: php.extensions,
22
+ env: php.env
22
23
  }
23
24
 
24
25
  return phpConfiguration
@@ -2,7 +2,7 @@
2
2
  * @returns {import('../../../../../typings/index').ComposerConfiguration}
3
3
  */
4
4
  const composer1 = () => ({
5
- version: '1',
5
+ version: 'latest-1.x',
6
6
  plugins: {
7
7
  'hirak/prestissimo': {
8
8
  enabled: true
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @returns {import('../../../../../typings/index').ComposerConfiguration}
3
+ */
4
+ const composer22 = () => ({
5
+ version: 'latest-2.2.x'
6
+ })
7
+
8
+ module.exports = composer22
@@ -2,7 +2,7 @@
2
2
  * @returns {import('../../../../../typings/index').ComposerConfiguration}
3
3
  */
4
4
  const composer2 = () => ({
5
- version: '2'
5
+ version: 'latest-2.x'
6
6
  })
7
7
 
8
8
  module.exports = composer2
@@ -1,4 +1,5 @@
1
1
  module.exports = {
2
2
  composer1: require('./composer-1'),
3
- composer2: require('./composer-2')
3
+ composer2: require('./composer-2'),
4
+ composer22: require('./composer-2.2')
4
5
  }
@@ -5,7 +5,10 @@ const defaultEnv = require('../default-es-env')
5
5
  */
6
6
  const elasticsearch84 = () => ({
7
7
  image: 'elasticsearch:8.4.3',
8
- env: defaultEnv
8
+ env: {
9
+ ...defaultEnv,
10
+ 'indices.id_field_data.enabled': true
11
+ }
9
12
  })
10
13
 
11
14
  module.exports = elasticsearch84
@@ -5,7 +5,10 @@ const defaultEnv = require('../default-es-env')
5
5
  */
6
6
  const elasticsearch85 = () => ({
7
7
  image: 'elasticsearch:8.5.3',
8
- env: defaultEnv
8
+ env: {
9
+ ...defaultEnv,
10
+ 'indices.id_field_data.enabled': true
11
+ }
9
12
  })
10
13
 
11
14
  module.exports = elasticsearch85
@@ -0,0 +1,14 @@
1
+ const defaultEnv = require('../default-es-env')
2
+
3
+ /**
4
+ * @returns {import('../../../../../typings/index').ElasticSearchConfiguration}
5
+ */
6
+ const elasticsearch85 = () => ({
7
+ image: 'elasticsearch:8.7.1',
8
+ env: {
9
+ ...defaultEnv,
10
+ 'indices.id_field_data.enabled': true
11
+ }
12
+ })
13
+
14
+ module.exports = elasticsearch85
@@ -8,6 +8,7 @@ const elasticsearch716 = require('./elasticsearch-7.16')
8
8
  const elasticsearch717 = require('./elasticsearch-7.17')
9
9
  const elasticsearch84 = require('./elasticsearch-8.4')
10
10
  const elasticsearch85 = require('./elasticsearch-8.5')
11
+ const elasticsearch87 = require('./elasticsearch-8.7')
11
12
 
12
13
  module.exports = {
13
14
  elasticsearch68,
@@ -19,5 +20,6 @@ module.exports = {
19
20
  elasticsearch716,
20
21
  elasticsearch717,
21
22
  elasticsearch84,
22
- elasticsearch85
23
+ elasticsearch85,
24
+ elasticsearch87
23
25
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @returns {import('../../../../../typings/index').ServiceWithImage}
2
+ * @returns {import("../../../../../typings/common").CMAConfigurationWithMySQL['configuration']['mysql']}
3
3
  */
4
4
  const mysql80 = () => ({
5
5
  image: 'mysql:8.0'
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @type {import("../../../../typings").PHPConfiguration['env']}
3
+ */
4
+ module.exports = {
5
+ COMPOSER_MEMORY_LIMIT: -1
6
+ }
@@ -1,6 +1,7 @@
1
1
  const path = require('path')
2
2
  const { repo } = require('../base-repo')
3
3
  const xdebug = require('../extensions/xdebug')
4
+ const defaultPhpEnv = require('../default-php-env')
4
5
 
5
6
  /**
6
7
  * @param {Object} param0
@@ -22,7 +23,8 @@ const php72 = ({
22
23
  extensions: {
23
24
  xdebug,
24
25
  ...extensions
25
- }
26
+ },
27
+ env: defaultPhpEnv
26
28
  })
27
29
 
28
30
  module.exports = php72
@@ -1,6 +1,7 @@
1
1
  const path = require('path')
2
2
  const { repo } = require('../base-repo')
3
3
  const xdebug = require('../extensions/xdebug')
4
+ const defaultPhpEnv = require('../default-php-env')
4
5
 
5
6
  /**
6
7
  * @param {Object} param0
@@ -22,7 +23,8 @@ const php73 = ({
22
23
  extensions: {
23
24
  xdebug,
24
25
  ...extensions
25
- }
26
+ },
27
+ env: defaultPhpEnv
26
28
  })
27
29
 
28
30
  module.exports = php73
@@ -1,6 +1,7 @@
1
1
  const path = require('path')
2
2
  const { repo } = require('../base-repo')
3
3
  const xdebug = require('../extensions/xdebug')
4
+ const defaultPhpEnv = require('../default-php-env')
4
5
 
5
6
  /**
6
7
  * @param {Object} param0
@@ -22,7 +23,8 @@ const php74 = ({
22
23
  extensions: {
23
24
  xdebug,
24
25
  ...extensions
25
- }
26
+ },
27
+ env: defaultPhpEnv
26
28
  })
27
29
 
28
30
  module.exports = php74
@@ -1,6 +1,7 @@
1
1
  const path = require('path')
2
2
  const { repo } = require('../base-repo')
3
3
  const xdebug = require('../extensions/xdebug')
4
+ const defaultPhpEnv = require('../default-php-env')
4
5
 
5
6
  /**
6
7
  * @param {Object} param0
@@ -22,7 +23,8 @@ const php81 = ({
22
23
  extensions: {
23
24
  xdebug,
24
25
  ...extensions
25
- }
26
+ },
27
+ env: defaultPhpEnv
26
28
  })
27
29
 
28
30
  module.exports = php81
@@ -1,6 +1,7 @@
1
1
  const path = require('path')
2
2
  const { repo } = require('../base-repo')
3
3
  const xdebug = require('../extensions/xdebug')
4
+ const defaultPhpEnv = require('../default-php-env')
4
5
 
5
6
  /**
6
7
  * @param {Object} param0
@@ -25,7 +26,8 @@ const php82 = ({
25
26
  version: '3.2.1'
26
27
  },
27
28
  ...extensions
28
- }
29
+ },
30
+ env: defaultPhpEnv
29
31
  })
30
32
 
31
33
  module.exports = php82
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @type {import("../../typings").SSLConfiguration}
3
+ */
4
+ const sslConfig = {
5
+ enabled: false,
6
+ ssl_external_provider: false
7
+ }
8
+
9
+ module.exports = sslConfig
@@ -10,10 +10,10 @@ fastcgi_param DOCUMENT_URI $document_uri;
10
10
  fastcgi_param DOCUMENT_ROOT $document_root;
11
11
  fastcgi_param SERVER_PROTOCOL $server_protocol;
12
12
  fastcgi_param REQUEST_SCHEME $scheme;
13
- <% if (it.isNgrok) { %>
13
+ <% if (it.sslEnabled) { %>
14
14
  fastcgi_param HTTPS on;
15
15
  <% } else { %>
16
- fastcgi_param HTTPS $https if_not_empty;
16
+ fastcgi_param HTTPS off;
17
17
  <% } %>
18
18
 
19
19
  fastcgi_param GATEWAY_INTERFACE CGI/1.1;
@@ -5,11 +5,23 @@ upstream fastcgi_backend {
5
5
  keepalive 16;
6
6
  }
7
7
 
8
+ <% if (it.useStoreDomainMapping) { %>
9
+ map $http_host $SITE_CODE_MAPPING {
10
+ <% for (const [key, value] of Object.entries(it.storeDomains)) { %>
11
+ <%= value %> <%= key %>;
12
+ <% } %>
13
+ }
14
+ <% } %>
15
+
8
16
  server {
9
17
  listen <%= it.hostPort %>;
10
18
  server_name _;
11
-
19
+ set $MAGE_MODE <%= it.config.magento.mode %>;
12
20
  set $MAGE_ROOT "<%= it.mageRoot %>";
21
+ set $MAGE_RUN_TYPE website;
22
+ <% if (it.useStoreDomainMapping) { %>
23
+ set $MAGE_RUN_CODE $SITE_CODE_MAPPING;
24
+ <% } %>
13
25
  resolver 127.0.0.11;
14
26
 
15
27
  root $MAGE_ROOT/pub;
@@ -20,7 +32,6 @@ server {
20
32
  client_max_body_size 64M;
21
33
  error_page 404 403 = /errors/404.php;
22
34
 
23
-
24
35
  # Deny access to sensitive files
25
36
  location /.user.ini {
26
37
  deny all;
@@ -168,6 +179,12 @@ server {
168
179
  fastcgi_keep_conn on;
169
180
  fastcgi_index index.php;
170
181
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
182
+
183
+ fastcgi_param MAGE_RUN_TYPE $MAGE_RUN_TYPE;
184
+ <% if (it.useStoreDomainMapping) { %>
185
+ fastcgi_param MAGE_RUN_CODE $MAGE_RUN_CODE;
186
+ <% } %>
187
+
171
188
  include fastcgi_params;
172
189
  }
173
190
 
@@ -11,18 +11,14 @@ upstream app_backend {
11
11
 
12
12
  server {
13
13
  listen <%= it.hostPort %>;
14
- <% if (it.config.ssl.enabled) { %> listen 443 ssl;
14
+ <% if (it.config.ssl.enabled && it.config.ssl.external_provider === false) { %> listen 443 ssl;
15
15
 
16
16
  ssl on;
17
17
  ssl_certificate /etc/nginx/conf.d/ssl_certificate.pem;
18
18
  ssl_certificate_key /etc/nginx/conf.d/ssl_certificate-key.pem;
19
19
  ssl_protocols TLSv1.2;<% } %>
20
20
 
21
- <% if (it.config.host) { %>
22
- server_name <%= it.config.host %><% if (it.config.ssl.enabled) { %> <%= it.networkToBindTo %><% } %>;
23
- <% } else { %>
24
- server_name <% if (it.config.ssl.enabled) { %> <%= it.networkToBindTo %><% } else { %>_<% } %>;
25
- <% } %>
21
+ server_name _;
26
22
 
27
23
  location / {
28
24
  proxy_buffer_size 128k;
@@ -1,10 +1,23 @@
1
1
  const path = require('path')
2
2
  const fs = require('fs')
3
- const semver = require('semver')
4
3
  const { deepmerge } = require('../../util/deepmerge')
4
+ const { defaultMagentoConfig } = require('../magento-config')
5
5
 
6
6
  const defaultCMAConfig = {
7
- prefix: true
7
+ prefix: true,
8
+ configuration: {
9
+ newRelic: {
10
+ enabled: false,
11
+ agentVersion: '10.11.0.3'
12
+ }
13
+ },
14
+ magento: defaultMagentoConfig,
15
+ ssl: {
16
+ enabled: false
17
+ },
18
+ storeDomains: {
19
+ admin: 'localhost'
20
+ }
8
21
  }
9
22
 
10
23
  const magentoVersions = fs
@@ -28,37 +41,7 @@ const getConfigurations = (config = {}) =>
28
41
 
29
42
  const allVersions = Object.entries(getConfigurations())
30
43
  .map(([name, magentoConfig]) => ({ ...magentoConfig, name }))
31
- .sort((a, b) => {
32
- if (
33
- a.magentoVersion.replace(/-p[0-9]+$/i, '') ===
34
- b.magentoVersion.replace(/-p[0-9]+$/i, '')
35
- ) {
36
- if (
37
- a.magentoVersion.includes('-p') &&
38
- !b.magentoVersion.includes('-p')
39
- ) {
40
- return 1
41
- }
42
- const aPatchVersion =
43
- (a.magentoVersion.includes('-p') &&
44
- Number.parseInt(
45
- a.magentoVersion.match(/-p([0-9]+)$/i)[1],
46
- 10
47
- )) ||
48
- 0
49
- const bPatchVersion =
50
- (b.magentoVersion.includes('-p') &&
51
- Number.parseInt(
52
- b.magentoVersion.match(/-p([0-9]+)$/i)[1],
53
- 10
54
- )) ||
55
- 0
56
-
57
- return aPatchVersion - bPatchVersion
58
- }
59
-
60
- return semver.gt(a.magentoVersion, b.magentoVersion) ? 1 : -1
61
- })
44
+ .sort((a, b) => a.magentoVersion.localeCompare(b.magentoVersion))
62
45
  .reverse()
63
46
 
64
47
  module.exports = {
@@ -1,4 +1,3 @@
1
- const { defaultMagentoConfig } = require('../magento-config')
2
1
  const {
3
2
  magento23PHPExtensionList
4
3
  } = require('../magento/required-php-extensions')
@@ -12,11 +11,10 @@ const { redis50 } = require('../services/redis')
12
11
  const { sslTerminator } = require('../services/ssl-terminator')
13
12
  const { varnish66 } = require('../services/varnish')
14
13
  const { mariadb102 } = require('../services/mariadb/versions')
14
+ const { mysql57 } = require('../services/mysql/versions')
15
15
 
16
16
  /**
17
- * @param {Object} param0
18
- * @param {string} param0.templateDir
19
- * @returns {import('../../../typings/index').CMAConfiguration & { magentoVersion: string, isDefault?: boolean }}
17
+ * @type {import('../../../typings/common').MagentoVersionConfigurationFunction}
20
18
  */
21
19
  module.exports = ({ templateDir }) => ({
22
20
  magentoVersion: '2.2.10',
@@ -28,19 +26,12 @@ module.exports = ({ templateDir }) => ({
28
26
  }),
29
27
  nginx: nginx118({ templateDir }),
30
28
  redis: redis50(),
31
- mysql: {
32
- version: '5.7'
33
- },
29
+ mysql: mysql57(),
34
30
  mariadb: mariadb102(),
35
31
  elasticsearch: elasticsearch68(),
36
32
  composer: composer1(),
37
33
  varnish: varnish66({ templateDir }),
38
34
  sslTerminator: sslTerminator({ templateDir }),
39
35
  maildev: maildev()
40
- },
41
- magento: defaultMagentoConfig,
42
- host: 'localhost',
43
- ssl: {
44
- enabled: false
45
36
  }
46
37
  })
@@ -1,4 +1,3 @@
1
- const { defaultMagentoConfig } = require('../magento-config')
2
1
  const {
3
2
  magento23PHPExtensionList
4
3
  } = require('../magento/required-php-extensions')
@@ -12,11 +11,10 @@ const { redis50 } = require('../services/redis')
12
11
  const { sslTerminator } = require('../services/ssl-terminator')
13
12
  const { varnish66 } = require('../services/varnish')
14
13
  const { mariadb102 } = require('../services/mariadb/versions')
14
+ const { mysql57 } = require('../services/mysql/versions')
15
15
 
16
16
  /**
17
- * @param {Object} param0
18
- * @param {string} param0.templateDir
19
- * @returns {import('../../../typings/index').CMAConfiguration & { magentoVersion: string, isDefault?: boolean }}
17
+ * @type {import('../../../typings/common').MagentoVersionConfigurationFunction}
20
18
  */
21
19
  module.exports = ({ templateDir }) => ({
22
20
  magentoVersion: '2.3.0',
@@ -28,19 +26,12 @@ module.exports = ({ templateDir }) => ({
28
26
  }),
29
27
  nginx: nginx118({ templateDir }),
30
28
  redis: redis50(),
31
- mysql: {
32
- version: '5.7'
33
- },
29
+ mysql: mysql57(),
34
30
  mariadb: mariadb102(),
35
31
  elasticsearch: elasticsearch68(),
36
32
  composer: composer1(),
37
33
  varnish: varnish66({ templateDir }),
38
34
  sslTerminator: sslTerminator({ templateDir }),
39
35
  maildev: maildev()
40
- },
41
- magento: defaultMagentoConfig,
42
- host: 'localhost',
43
- ssl: {
44
- enabled: false
45
36
  }
46
37
  })
@@ -1,5 +1,4 @@
1
1
  const { elasticsearch68 } = require('../services/elasticsearch/versions')
2
- const { defaultMagentoConfig } = require('../magento-config')
3
2
  const {
4
3
  magento23PHPExtensionList
5
4
  } = require('../magento/required-php-extensions')
@@ -12,11 +11,10 @@ const { composer1 } = require('../services/composer/versions')
12
11
  const { maildev } = require('../services/maildev')
13
12
  const { redis50 } = require('../services/redis')
14
13
  const { mariadb102 } = require('../services/mariadb/versions')
14
+ const { mysql57 } = require('../services/mysql/versions')
15
15
 
16
16
  /**
17
- * @param {Object} param0
18
- * @param {string} param0.templateDir
19
- * @returns {import('../../../typings/index').CMAConfiguration & { magentoVersion: string, isDefault?: boolean }}
17
+ * @type {import('../../../typings/common').MagentoVersionConfigurationFunction}
20
18
  */
21
19
  module.exports = ({ templateDir }) => ({
22
20
  magentoVersion: '2.3.1',
@@ -28,19 +26,12 @@ module.exports = ({ templateDir }) => ({
28
26
  }),
29
27
  nginx: nginx118({ templateDir }),
30
28
  redis: redis50(),
31
- mysql: {
32
- version: '5.7'
33
- },
29
+ mysql: mysql57(),
34
30
  mariadb: mariadb102(),
35
31
  elasticsearch: elasticsearch68(),
36
32
  composer: composer1(),
37
33
  varnish: varnish66({ templateDir }),
38
34
  sslTerminator: sslTerminator({ templateDir }),
39
35
  maildev: maildev()
40
- },
41
- magento: defaultMagentoConfig,
42
- host: 'localhost',
43
- ssl: {
44
- enabled: false
45
36
  }
46
37
  })
@@ -1,5 +1,4 @@
1
1
  const { elasticsearch68 } = require('../services/elasticsearch/versions')
2
- const { defaultMagentoConfig } = require('../magento-config')
3
2
  const {
4
3
  magento23PHPExtensionList
5
4
  } = require('../magento/required-php-extensions')
@@ -12,11 +11,10 @@ const { composer1 } = require('../services/composer/versions')
12
11
  const { maildev } = require('../services/maildev')
13
12
  const { redis50 } = require('../services/redis')
14
13
  const { mariadb102 } = require('../services/mariadb/versions')
14
+ const { mysql57 } = require('../services/mysql/versions')
15
15
 
16
16
  /**
17
- * @param {Object} param0
18
- * @param {string} param0.templateDir
19
- * @returns {import('../../../typings/index').CMAConfiguration & { magentoVersion: string, isDefault?: boolean }}
17
+ * @type {import('../../../typings/common').MagentoVersionConfigurationFunction}
20
18
  */
21
19
  module.exports = ({ templateDir }) => ({
22
20
  magentoVersion: '2.3.2-p1',
@@ -28,19 +26,12 @@ module.exports = ({ templateDir }) => ({
28
26
  }),
29
27
  nginx: nginx118({ templateDir }),
30
28
  redis: redis50(),
31
- mysql: {
32
- version: '5.7'
33
- },
29
+ mysql: mysql57(),
34
30
  mariadb: mariadb102(),
35
31
  elasticsearch: elasticsearch68(),
36
32
  composer: composer1(),
37
33
  varnish: varnish66({ templateDir }),
38
34
  sslTerminator: sslTerminator({ templateDir }),
39
35
  maildev: maildev()
40
- },
41
- magento: defaultMagentoConfig,
42
- host: 'localhost',
43
- ssl: {
44
- enabled: false
45
36
  }
46
37
  })