Skip to content

Commit 3b81864

Browse files
authored
Merge pull request #135 from scandipwa/2.2.0
2.2.0
2 parents c02bac8 + f6408d2 commit 3b81864

File tree

161 files changed

+188307
-870
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+188307
-870
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// imagick 3.7.0 is latest release of imagick on peck and supports PHP 5.4.0 and newer
2+
// requires ImageMagick version 6.5.3-10+
3+
module.exports = {
4+
command: `apk add --no-cache --virtual .build-deps \\$PHPIZE_DEPS \
5+
&& pecl install imagick 3.7.0 \
6+
&& docker-php-ext-enable imagick \
7+
&& apk del -f .build-deps`,
8+
dependencies: ['imagemagick-dev', 'libgomp']
9+
}

build-packages/magento-scripts-php-extensions/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ const pdo_sqlsrv = require('./extensions/pdo_sqlsrv')
33
const sqlsrv = require('./extensions/sqlsrv')
44
const ioncube = require('./extensions/ioncube')
55
const memcached = require('./extensions/memcached')
6+
const imagick = require('./extensions/imagick')
67

78
module.exports = {
89
sqlsrv,
910
pdo_sqlsrv,
1011
ioncube,
11-
memcached
12+
memcached,
13+
imagick
1214
}

build-packages/magento-scripts-php-extensions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"repository": "github:scandipwa/create-magento-app",
66
"main": "./index.js",
77
"license": "OSL-3.0",
8-
"version": "1.0.5",
8+
"version": "1.0.6-alpha.0",
99
"os": [
1010
"darwin",
1111
"linux"

build-packages/magento-scripts/lib/config/docker.js

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ const logger = require('@scandipwa/scandipwa-dev-utils/logger')
1010
const defaultMagentoUser = require('../tasks/database/default-magento-user')
1111

1212
/**
13-
*
1413
* @param {import('../../typings/context').ListrContext} ctx
1514
* @param {import('../../typings/context').ListrContext['config']['overridenConfiguration']} overridenConfiguration
1615
* @param {import('../../typings/context').ListrContext['config']['baseConfig']} baseConfig
1716
*/
1817
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 } =
2124
configuration
2225

2326
const php = getPhpConfig(overridenConfiguration, baseConfig)
@@ -120,6 +123,16 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
120123
* @param {Record<string, number>} ports
121124
*/
122125
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+
123136
/**
124137
* @type {Record<string, import('../tasks/docker/containers/container-api').ContainerRunOptions & { _?: string, forwardedPorts?: string[], debugImage?: string, remoteImages?: string[], connectCommand?: string[], description?: string }>}
125138
*/
@@ -153,15 +166,7 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
153166
]
154167
: []
155168
),
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 || {}),
165170
restart: 'on-failure:5',
166171
image: `local-cma-project:${prefix}`,
167172
debugImage: `local-cma-project:${prefix}.debug`,
@@ -397,6 +402,8 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
397402
}
398403

399404
if (ssl && ssl.enabled && isDockerDesktop) {
405+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
406+
// @ts-ignore
400407
dockerConfig.sslTerminator.ports.push(
401408
`${isIpAddress(host) ? host : '127.0.0.1'}:443:443`
402409
)
@@ -446,6 +453,16 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
446453
}
447454
}
448455

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+
449466
return dockerConfig
450467
}
451468

build-packages/magento-scripts/lib/config/get-magento-version-config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ const longestMagentoName = allVersions
77
.map(({ name }) => name)
88
.reduce((acc, val) => (val.length > acc ? val.length : acc), 0)
99

10+
/**
11+
* @param {{ name: string }} version
12+
* @returns {string}
13+
*/
1014
const getMagentoVersionMessage = (version) => {
1115
const pureMagentoVersion = version.name.replace(/-p[0-9]+$/i, '')
1216
if (scandipwaMagentoVersionMapping[pureMagentoVersion]) {
@@ -25,7 +29,6 @@ const getMagentoVersionMessage = (version) => {
2529
* @returns {import('listr2').ListrTask<import('../../typings/context').ListrContext>}
2630
*/
2731
const getMagentoVersion = () => ({
28-
// title: 'Loading Magento version',
2932
task: async (ctx, task) => {
3033
const {
3134
throwMagentoVersionMissing = false,

build-packages/magento-scripts/lib/config/php-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ module.exports = (overridenConfiguration, baseConfig) => {
1818
debugTemplatePath: php.debugTemplate,
1919
fpmTemplatePath: php.fpmConfigTemplate,
2020
fpmConfPath: path.join(cacheDir, 'php-fpm.conf'),
21-
extensions: php.extensions
21+
extensions: php.extensions,
22+
env: php.env
2223
}
2324

2425
return phpConfiguration

build-packages/magento-scripts/lib/config/services/composer/versions/composer-1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @returns {import('../../../../../typings/index').ComposerConfiguration}
33
*/
44
const composer1 = () => ({
5-
version: '1',
5+
version: 'latest-1.x',
66
plugins: {
77
'hirak/prestissimo': {
88
enabled: true
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

build-packages/magento-scripts/lib/config/services/composer/versions/composer-2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @returns {import('../../../../../typings/index').ComposerConfiguration}
33
*/
44
const composer2 = () => ({
5-
version: '2'
5+
version: 'latest-2.x'
66
})
77

88
module.exports = composer2
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
22
composer1: require('./composer-1'),
3-
composer2: require('./composer-2')
3+
composer2: require('./composer-2'),
4+
composer22: require('./composer-2.2')
45
}

0 commit comments

Comments
 (0)