@scandipwa/magento-scripts 1.16.1 → 2.0.0-alpha.10
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/exec.js +71 -0
- package/index.js +1 -1
- package/lib/commands/cli.js +4 -6
- package/lib/commands/execute.js +3 -33
- package/lib/commands/import-db.js +1 -1
- package/lib/commands/logs.js +1 -1
- package/lib/commands/start.js +38 -20
- package/lib/commands/status.js +2 -0
- package/lib/config/docker.js +103 -85
- package/lib/config/get-project-configuration.js +3 -1
- package/lib/config/index.js +10 -7
- package/lib/config/magento/required-php-extensions/index.js +29 -0
- package/lib/config/magento/required-php-extensions/magento-2.3.js +19 -0
- package/lib/config/magento/required-php-extensions/magento-2.4.js +29 -0
- package/lib/config/php/base-repo.js +3 -0
- package/lib/config/php/extensions/apcu.js +12 -0
- package/lib/config/php/extensions/bcmath.js +7 -0
- package/lib/config/php/extensions/curl.js +11 -0
- package/lib/config/php/extensions/gd.js +14 -0
- package/lib/config/php/extensions/index.js +18 -2
- package/lib/config/php/extensions/intl.js +10 -0
- package/lib/config/php/extensions/opcache.js +10 -0
- package/lib/config/php/extensions/pdo_mysql.js +7 -0
- package/lib/config/php/extensions/soap.js +10 -0
- package/lib/config/php/extensions/sodium.js +10 -0
- package/lib/config/php/extensions/xdebug.js +8 -5
- package/lib/config/php/extensions/xsl.js +10 -0
- package/lib/config/php/extensions/zip.js +10 -0
- package/lib/config/php/{releases → versions}/index.js +0 -0
- package/lib/config/php/versions/php-7.2.js +23 -0
- package/lib/config/php/versions/php-7.3.js +23 -0
- package/lib/config/php/versions/php-7.4.js +23 -0
- package/lib/config/php/versions/php-8.1.js +23 -0
- package/lib/config/php-config.js +8 -12
- package/lib/config/port-config.js +2 -6
- package/lib/config/services/elasticsearch/base-repo.js +3 -0
- package/lib/config/services/elasticsearch/default-es-env.js +6 -0
- package/lib/config/services/elasticsearch/versions/elasticsearch-6.8.js +19 -0
- package/lib/config/services/elasticsearch/versions/index.js +5 -0
- package/lib/config/templates/magentorc.template +6 -6
- package/lib/config/templates/mariadb.template.cnf +191 -0
- package/lib/config/templates/php-fpm.template.conf +3 -3
- package/lib/config/templates/php.template.ini +12 -6
- package/lib/config/templates/ssl-terminator.template.conf +9 -4
- package/lib/config/templates/vscode-launch.template.json +3 -1
- package/lib/config/versions/magento-2.3.0.js +10 -5
- package/lib/config/versions/magento-2.3.1.js +10 -5
- package/lib/config/versions/magento-2.3.2-p1.js +43 -0
- package/lib/config/versions/magento-2.3.2-p2.js +10 -5
- package/lib/config/versions/magento-2.3.2.js +10 -5
- package/lib/config/versions/magento-2.3.3-p1.js +10 -5
- package/lib/config/versions/magento-2.3.3.js +10 -5
- package/lib/config/versions/magento-2.3.4-p1.js +43 -0
- package/lib/config/versions/magento-2.3.4-p2.js +10 -5
- package/lib/config/versions/magento-2.3.4.js +10 -5
- package/lib/config/versions/magento-2.3.5-p1.js +8 -2
- package/lib/config/versions/magento-2.3.5-p2.js +8 -2
- package/lib/config/versions/magento-2.3.5.js +8 -2
- package/lib/config/versions/magento-2.3.6-p1.js +8 -2
- package/lib/config/versions/magento-2.3.6.js +8 -2
- package/lib/config/versions/magento-2.3.7-p1.js +8 -2
- package/lib/config/versions/magento-2.3.7-p2.js +8 -2
- package/lib/config/versions/magento-2.3.7-p3.js +8 -2
- package/lib/config/versions/magento-2.3.7-p4.js +44 -0
- package/lib/config/versions/magento-2.3.7.js +8 -2
- package/lib/config/versions/magento-2.4.0-p1.js +9 -3
- package/lib/config/versions/magento-2.4.0.js +9 -3
- package/lib/config/versions/magento-2.4.1-p1.js +6 -5
- package/lib/config/versions/magento-2.4.1.js +9 -2
- package/lib/config/versions/magento-2.4.2-p1.js +6 -5
- package/lib/config/versions/magento-2.4.2-p2.js +6 -6
- package/lib/config/versions/magento-2.4.2.js +6 -6
- package/lib/config/versions/magento-2.4.3-p1.js +7 -7
- package/lib/config/versions/magento-2.4.3-p2.js +7 -7
- package/lib/config/versions/magento-2.4.3-p3.js +46 -0
- package/lib/config/versions/magento-2.4.3.js +7 -7
- package/lib/config/versions/magento-2.4.4-p1.js +46 -0
- package/lib/config/versions/magento-2.4.4.js +9 -2
- package/lib/config/versions/magento-2.4.5.js +46 -0
- package/lib/tasks/cleanup.js +3 -3
- package/lib/tasks/composer/index.js +14 -104
- package/lib/tasks/database/connect-to-database.js +117 -0
- package/lib/tasks/database/create-magento-database.js +18 -0
- package/lib/tasks/{mysql → database}/dump-theme-config.js +3 -3
- package/lib/tasks/{mysql → database}/fix-db.js +2 -2
- package/lib/tasks/{mysql/import-dump-to-mysql.js → database/import-dump-to-database.js} +65 -22
- package/lib/tasks/{mysql → database}/import-remote-db/index.js +0 -0
- package/lib/tasks/{mysql/import-remote-db/ssh/mysqldump-command.js → database/import-remote-db/ssh/database-dump-command.js} +2 -2
- package/lib/tasks/{mysql → database}/import-remote-db/ssh/index.js +0 -0
- package/lib/tasks/{mysql → database}/import-remote-db/ssh/readymage.js +4 -4
- package/lib/tasks/{mysql → database}/import-remote-db/ssh/regular-server.js +2 -2
- package/lib/tasks/{mysql → database}/index.js +2 -2
- package/lib/tasks/{mysql → database}/magento-tables.js +0 -0
- package/lib/tasks/{mysql → database}/restore-theme-config.js +4 -4
- package/lib/tasks/docker/api.d.ts +71 -0
- package/lib/tasks/docker/api.js +30 -0
- package/lib/tasks/docker/containers/container-api.d.ts +132 -0
- package/lib/tasks/docker/containers/container-api.js +163 -0
- package/lib/tasks/docker/containers/index.js +19 -0
- package/lib/tasks/docker/containers/tasks.js +215 -0
- package/lib/tasks/docker/convert-legacy-volumes.js +15 -10
- package/lib/tasks/docker/convert-mysql-to-mariadb.js +284 -0
- package/lib/tasks/docker/image/image-api.d.ts +34 -0
- package/lib/tasks/docker/image/image-api.js +49 -0
- package/lib/tasks/docker/image/index.js +5 -0
- package/lib/tasks/docker/index.js +1 -13
- package/lib/tasks/docker/network/index.js +7 -0
- package/lib/tasks/docker/network/network-api.d.ts +103 -0
- package/lib/tasks/docker/network/network-api.js +99 -0
- package/lib/tasks/docker/{network.js → network/tasks.js} +17 -10
- package/lib/tasks/docker/project-image-builder.js +167 -0
- package/lib/tasks/docker/volume/index.js +8 -0
- package/lib/tasks/docker/{volumes.js → volume/tasks.js} +5 -19
- package/lib/tasks/docker/volume/volume-api.d.ts +39 -0
- package/lib/tasks/docker/volume/volume-api.js +66 -0
- package/lib/tasks/execute.js +97 -0
- package/lib/tasks/file-system/create-mariadb-config.js +23 -0
- package/lib/tasks/file-system/create-nginx-config.js +2 -3
- package/lib/tasks/file-system/create-php-config.js +20 -5
- package/lib/tasks/file-system/create-php-fpm-config.js +8 -4
- package/lib/tasks/file-system/create-phpstorm-config/exclude-folder-config.js +41 -29
- package/lib/tasks/file-system/create-phpstorm-config/index.js +2 -0
- package/lib/tasks/file-system/create-phpstorm-config/keys.js +15 -1
- package/lib/tasks/file-system/create-phpstorm-config/php-config/index.js +4 -1
- package/lib/tasks/file-system/create-phpstorm-config/php-config/php-config.js +3 -3
- package/lib/tasks/file-system/create-phpstorm-config/php-config/php-interpreters-config.js +81 -0
- package/lib/tasks/file-system/create-phpstorm-config/php-docker-settings-config/index.js +42 -0
- package/lib/tasks/file-system/create-phpstorm-config/php-docker-settings-config/php-docker-settings-config.js +9 -0
- package/lib/tasks/file-system/create-phpstorm-config/php-docker-settings-config/setup-php-docker-container-settings-config.js +66 -0
- package/lib/tasks/file-system/create-phpstorm-config/setup-xml-structure.js +11 -9
- package/lib/tasks/file-system/create-phpstorm-config/stylelint-config.js +2 -1
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/composer-settings-config.js +15 -30
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/index.js +24 -5
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/mess-detector-project-configuration-config.js +50 -0
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/php-code-sniffer-project-configuration-config.js +50 -0
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/php-cs-fixer-project-configuration-config.js +50 -0
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/php-debug-general-config.js +15 -15
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/php-server-config.js +29 -3
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/php-stan-project-configuration-config.js.js +50 -0
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/php-workspace-project-configuration-config.js +42 -0
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/psalm-project-configuration-config.js.js +50 -0
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/workspace-config.js +0 -2
- package/lib/tasks/file-system/create-ssl-terminator-config.js +4 -2
- package/lib/tasks/file-system/create-vscode-config.js +57 -42
- package/lib/tasks/file-system/index.js +5 -2
- package/lib/tasks/import-dump.js +6 -6
- package/lib/tasks/link.js +5 -4
- package/lib/tasks/magento/enable-magento-composer-plugins.js +85 -30
- package/lib/tasks/magento/install-magento-project.js +32 -63
- package/lib/tasks/magento/setup-magento/adjust-full-page-cache.js +4 -4
- package/lib/tasks/magento/setup-magento/configure-elasticsearch.js +7 -3
- package/lib/tasks/magento/setup-magento/create-admin.js +5 -6
- package/lib/tasks/magento/setup-magento/delete-admin-users.js +2 -2
- package/lib/tasks/magento/setup-magento/delete-customers.js +4 -4
- package/lib/tasks/magento/setup-magento/delete-orders.js +4 -4
- package/lib/tasks/magento/setup-magento/disable-2fa.js +3 -5
- package/lib/tasks/magento/setup-magento/disable-maintenance-mode.js +3 -4
- package/lib/tasks/magento/setup-magento/increase-admin-session-lifetime.js +2 -2
- package/lib/tasks/magento/setup-magento/index.js +2 -0
- package/lib/tasks/magento/setup-magento/install-magento.js +21 -20
- package/lib/tasks/magento/setup-magento/migrate-database.js +7 -14
- package/lib/tasks/magento/setup-magento/set-base-url.js +3 -3
- package/lib/tasks/magento/setup-magento/set-deployment-mode.js +4 -4
- package/lib/tasks/magento/setup-magento/set-url-rewrite.js +2 -2
- package/lib/tasks/magento/setup-magento/varnish-config.js +10 -8
- package/lib/tasks/magento/setup-magento/waiting-for-varnish.js +130 -3
- package/lib/tasks/php/php-container.js +112 -0
- package/lib/tasks/php/update-env-php.js +39 -21
- package/lib/tasks/php/update-env.php +66 -61
- package/lib/tasks/php/working_health_check.php +85 -0
- package/lib/tasks/requirements/{composer.js → composer-credentials.js} +3 -1
- package/lib/tasks/requirements/docker/index.js +18 -13
- package/lib/tasks/requirements/docker/performance.js +54 -0
- package/lib/tasks/requirements/docker/version.js +8 -8
- package/lib/tasks/requirements/index.js +5 -8
- package/lib/tasks/requirements/php-version.js +8 -116
- package/lib/tasks/requirements/platform.js +12 -25
- package/lib/tasks/start.js +21 -50
- package/lib/tasks/status/index.js +8 -12
- package/lib/tasks/stop.js +0 -2
- package/lib/tasks/theme/install-theme.js +1 -1
- package/lib/tasks/theme/link-theme.js +2 -2
- package/lib/tasks/theme/symlink-theme.js +2 -3
- package/lib/util/config-file-validator.js +27 -13
- package/lib/util/config-php-json.js +13 -4
- package/lib/util/database.js +7 -7
- package/lib/util/dockerfile-builder/build-instructions.js +197 -0
- package/lib/util/dockerfile-builder/index.js +276 -0
- package/lib/util/dockerfile-builder/types.d.ts +123 -0
- package/lib/util/env-php-json.js +10 -6
- package/lib/util/exec-async-command.js +3 -9
- package/lib/util/execute-in-container.js +63 -0
- package/lib/util/macos-version.js +20 -0
- package/lib/util/magento-task.js +3 -4
- package/lib/util/nginx-logs-parser.js +122 -0
- package/lib/util/php-task.js +3 -6
- package/lib/util/run-composer.js +6 -14
- package/lib/util/run-container-image.js +17 -0
- package/lib/util/run-magento.js +6 -14
- package/lib/util/run-php.js +6 -17
- package/package.json +11 -10
- package/typings/context.d.ts +7 -13
- package/typings/index.d.ts +67 -85
- package/lib/config/composer.js +0 -11
- package/lib/config/php/extensions/libsodium.js +0 -36
- package/lib/config/php/releases/php-7.2.js +0 -25
- package/lib/config/php/releases/php-7.3.js +0 -25
- package/lib/config/php/releases/php-7.4.js +0 -23
- package/lib/config/php/releases/php-8.1.js +0 -25
- package/lib/config/phpbrew.js +0 -12
- package/lib/tasks/composer/install-prestissimo.js +0 -103
- package/lib/tasks/docker/containers.js +0 -231
- package/lib/tasks/execute/index.js +0 -23
- package/lib/tasks/mysql/connect-to-mysql.js +0 -114
- package/lib/tasks/mysql/create-magento-database.js +0 -18
- package/lib/tasks/php/bundled-extensions.js +0 -27
- package/lib/tasks/php/compile-options.js +0 -56
- package/lib/tasks/php/compile.js +0 -55
- package/lib/tasks/php/configure.js +0 -89
- package/lib/tasks/php/extensions/disable.js +0 -49
- package/lib/tasks/php/extensions/enable.js +0 -52
- package/lib/tasks/php/extensions/index.js +0 -80
- package/lib/tasks/php/extensions/install.js +0 -54
- package/lib/tasks/php/index.js +0 -79
- package/lib/tasks/php/install-sodium.js +0 -93
- package/lib/tasks/php/update-phpbrew.js +0 -45
- package/lib/tasks/php/validate-php.js +0 -67
- package/lib/tasks/php-fpm/get-process-id.js +0 -14
- package/lib/tasks/php-fpm/index.js +0 -4
- package/lib/tasks/php-fpm/start-php-fpm.js +0 -49
- package/lib/tasks/php-fpm/stop-php-fpm.js +0 -48
- package/lib/tasks/requirements/phpbrew/index.js +0 -61
- package/lib/tasks/requirements/phpbrew/install.js +0 -159
- package/lib/tasks/requirements/phpbrew/version.js +0 -28
package/lib/config/index.js
CHANGED
|
@@ -5,7 +5,6 @@ const {
|
|
|
5
5
|
defaultConfiguration
|
|
6
6
|
} = require('./versions');
|
|
7
7
|
const getPhpConfig = require('./php-config');
|
|
8
|
-
const getComposerConfig = require('./composer');
|
|
9
8
|
const { getMagentoConfig } = require('./magento-config');
|
|
10
9
|
const resolveConfigurationWithOverrides = require('../util/resolve-configuration-with-overrides');
|
|
11
10
|
const { getPrefix, folderName } = require('../util/prefix');
|
|
@@ -15,11 +14,12 @@ const platforms = ['linux', 'darwin'];
|
|
|
15
14
|
const darwinMinimalVersion = '10.5';
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
|
-
* @returns {
|
|
17
|
+
* @returns {import('../../typings/context').ListrContext['config']['baseConfig']}
|
|
19
18
|
*/
|
|
20
19
|
const getBaseConfig = (projectPath = process.cwd(), prefix = folderName) => ({
|
|
21
20
|
prefix: getPrefix(prefix),
|
|
22
21
|
magentoDir: projectPath,
|
|
22
|
+
containerMagentoDir: projectPath,
|
|
23
23
|
templateDir: path.join(__dirname, 'templates'),
|
|
24
24
|
cacheDir: path.join(projectPath, 'node_modules', '.create-magento-app-cache')
|
|
25
25
|
});
|
|
@@ -27,14 +27,19 @@ const getBaseConfig = (projectPath = process.cwd(), prefix = folderName) => ({
|
|
|
27
27
|
const baseConfig = getBaseConfig();
|
|
28
28
|
|
|
29
29
|
const magento = {
|
|
30
|
-
binPath: path.join(baseConfig.magentoDir, 'bin', 'magento')
|
|
30
|
+
binPath: path.join(baseConfig.magentoDir, 'bin', 'magento'),
|
|
31
|
+
containerBinPath: path.join(baseConfig.containerMagentoDir, 'bin', 'magento')
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
module.exports = {
|
|
34
35
|
/**
|
|
35
36
|
* @param {string} magentoVersion
|
|
36
37
|
*/
|
|
37
|
-
async getConfigFromMagentoVersion(
|
|
38
|
+
async getConfigFromMagentoVersion(ctx, {
|
|
39
|
+
magentoVersion,
|
|
40
|
+
projectPath = process.cwd(),
|
|
41
|
+
prefix = folderName
|
|
42
|
+
}) {
|
|
38
43
|
const newBaseConfig = getBaseConfig(projectPath, prefix);
|
|
39
44
|
const configurations = getConfigurations(newBaseConfig);
|
|
40
45
|
if (!configurations[magentoVersion]) {
|
|
@@ -52,8 +57,7 @@ module.exports = {
|
|
|
52
57
|
|
|
53
58
|
return {
|
|
54
59
|
php: getPhpConfig(overridenConfiguration.configuration, newBaseConfig),
|
|
55
|
-
docker: await getDockerConfig(overridenConfiguration, newBaseConfig),
|
|
56
|
-
composer: getComposerConfig(overridenConfiguration.configuration, newBaseConfig),
|
|
60
|
+
docker: await getDockerConfig(ctx, overridenConfiguration, newBaseConfig),
|
|
57
61
|
magentoConfiguration: getMagentoConfig(overridenConfiguration.magento),
|
|
58
62
|
baseConfig: newBaseConfig,
|
|
59
63
|
overridenConfiguration,
|
|
@@ -65,7 +69,6 @@ module.exports = {
|
|
|
65
69
|
getBaseConfig,
|
|
66
70
|
magento,
|
|
67
71
|
platforms,
|
|
68
|
-
docker: getDockerConfig(defaultConfiguration, baseConfig),
|
|
69
72
|
darwinMinimalVersion,
|
|
70
73
|
defaultConfiguration
|
|
71
74
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const magento23RequiredPHPExtensions = require('./magento-2.3');
|
|
2
|
+
const magento24RequiredPHPExtensions = require('./magento-2.4');
|
|
3
|
+
|
|
4
|
+
const { phpExtensionInstallationInstructions } = require('../../php/extensions');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @param {string[]} requiredPHPExtensions
|
|
8
|
+
* @returns {Record<string, import('../../../../typings/index').PHPExtensionInstallationInstruction>}
|
|
9
|
+
*/
|
|
10
|
+
const mapMagentoRequiredExtensionsToInstructions = (requiredPHPExtensions) => requiredPHPExtensions.map((extensionName) => {
|
|
11
|
+
if (phpExtensionInstallationInstructions[extensionName]) {
|
|
12
|
+
return phpExtensionInstallationInstructions[extensionName];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
for (const [extensionName, extensionData] of Object.entries(phpExtensionInstallationInstructions)) {
|
|
16
|
+
if (extensionData.alternativeName && extensionData.alternativeName.includes(extensionName)) {
|
|
17
|
+
return extensionData;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
name: extensionName
|
|
23
|
+
};
|
|
24
|
+
}).reduce((acc, val) => ({ ...acc, [val.name]: val }), {});
|
|
25
|
+
|
|
26
|
+
module.exports = {
|
|
27
|
+
magento23PHPExtensionList: mapMagentoRequiredExtensionsToInstructions(magento23RequiredPHPExtensions),
|
|
28
|
+
magento24PHPExtensionList: mapMagentoRequiredExtensionsToInstructions(magento24RequiredPHPExtensions)
|
|
29
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const magento23RequiredPHPExtensions = [
|
|
2
|
+
'bcmath',
|
|
3
|
+
'ctype',
|
|
4
|
+
'curl',
|
|
5
|
+
'dom',
|
|
6
|
+
'gd',
|
|
7
|
+
'hash',
|
|
8
|
+
'iconv',
|
|
9
|
+
'intl',
|
|
10
|
+
'mbstring',
|
|
11
|
+
'openssl',
|
|
12
|
+
'pdo_mysql',
|
|
13
|
+
'simplexml',
|
|
14
|
+
'soap',
|
|
15
|
+
'xsl',
|
|
16
|
+
'zip'
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
module.exports = magento23RequiredPHPExtensions;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const magento24RequiredPHPExtensions = [
|
|
2
|
+
'bcmath',
|
|
3
|
+
'ctype',
|
|
4
|
+
'curl',
|
|
5
|
+
'dom',
|
|
6
|
+
'fileinfo',
|
|
7
|
+
'gd',
|
|
8
|
+
'hash',
|
|
9
|
+
'iconv',
|
|
10
|
+
'intl',
|
|
11
|
+
'json',
|
|
12
|
+
'libxml',
|
|
13
|
+
'mbstring',
|
|
14
|
+
'openssl',
|
|
15
|
+
'pcre',
|
|
16
|
+
'pdo_mysql',
|
|
17
|
+
'simplexml',
|
|
18
|
+
'soap',
|
|
19
|
+
'sockets',
|
|
20
|
+
'sodium',
|
|
21
|
+
'tokenizer',
|
|
22
|
+
'xmlwriter',
|
|
23
|
+
'xsl',
|
|
24
|
+
'zip',
|
|
25
|
+
'libxml',
|
|
26
|
+
'openssl'
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
module.exports = magento24RequiredPHPExtensions;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
2
|
+
/**
|
|
3
|
+
* @type {import('../../../../typings/index').PHPExtensionInstallationInstruction}
|
|
4
|
+
*/
|
|
5
|
+
module.exports = {
|
|
6
|
+
name: 'apcu',
|
|
7
|
+
// eslint-disable-next-line quotes
|
|
8
|
+
command: `apk add --no-cache --virtual .build-deps \\$PHPIZE_DEPS \
|
|
9
|
+
&& pecl install apcu \
|
|
10
|
+
&& docker-php-ext-enable apcu \
|
|
11
|
+
&& apk del -f .build-deps`
|
|
12
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {import('../../../../typings/index').PHPExtensionInstallationInstruction}
|
|
3
|
+
*/
|
|
4
|
+
module.exports = {
|
|
5
|
+
name: 'gd',
|
|
6
|
+
command: 'docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp && docker-php-ext-install gd',
|
|
7
|
+
dependencies: [
|
|
8
|
+
'freetype-dev',
|
|
9
|
+
'libjpeg-turbo-dev',
|
|
10
|
+
'libpng-dev',
|
|
11
|
+
'zlib-dev',
|
|
12
|
+
'libwebp-dev'
|
|
13
|
+
]
|
|
14
|
+
};
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @type {Record<string, import('../../../../typings/index').PHPExtensionInstallationInstruction>}
|
|
6
|
+
*/
|
|
7
|
+
const phpExtensionInstallationInstructions = fs.readdirSync(__dirname, {
|
|
8
|
+
withFileTypes: true
|
|
9
|
+
})
|
|
10
|
+
.filter((f) => f.isFile())
|
|
11
|
+
.filter((f) => f.name !== 'index.js')
|
|
12
|
+
.map((f) => ({
|
|
13
|
+
name: path.parse(f.name).name,
|
|
14
|
+
extension: require(path.join(__dirname, f.name))
|
|
15
|
+
}))
|
|
16
|
+
.reduce((acc, val) => ({ ...acc, [val.name]: val.extension }), {});
|
|
17
|
+
|
|
1
18
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
xdebug: require('./xdebug')
|
|
19
|
+
phpExtensionInstallationInstructions
|
|
4
20
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
1
2
|
/**
|
|
2
|
-
* @type {import('../../../../typings/index').
|
|
3
|
+
* @type {import('../../../../typings/index').PHPExtensionInstallationInstruction}
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
module.exports = {
|
|
6
|
+
name: 'xdebug',
|
|
7
|
+
command: ({ version = '' } = {}) => `apk add --no-cache --virtual .build-deps \\$PHPIZE_DEPS \
|
|
8
|
+
&& pecl install xdebug${version ? `-${version}` : ''} \
|
|
9
|
+
&& docker-php-ext-enable xdebug \
|
|
10
|
+
&& apk del -f .build-deps`,
|
|
6
11
|
version: '3.1.5'
|
|
7
12
|
};
|
|
8
|
-
|
|
9
|
-
module.exports = xdebugExtension;
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { repo } = require('../base-repo');
|
|
3
|
+
const xdebug = require('../extensions/xdebug');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @returns {import('../../../../typings/index').PHPConfiguration}
|
|
7
|
+
*/
|
|
8
|
+
const php72 = ({
|
|
9
|
+
templateDir,
|
|
10
|
+
extensions = {},
|
|
11
|
+
baseImage = `${ repo }:php-7.2`
|
|
12
|
+
} = {}) => ({
|
|
13
|
+
baseImage,
|
|
14
|
+
debugImage: `${ baseImage }-debug`,
|
|
15
|
+
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
16
|
+
fpmConfigTemplate: path.join(templateDir || '', 'php-fpm.template.conf'),
|
|
17
|
+
extensions: {
|
|
18
|
+
xdebug,
|
|
19
|
+
...extensions
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
module.exports = php72;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { repo } = require('../base-repo');
|
|
3
|
+
const xdebug = require('../extensions/xdebug');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @returns {import('../../../../typings/index').PHPConfiguration}
|
|
7
|
+
*/
|
|
8
|
+
const php73 = ({
|
|
9
|
+
templateDir,
|
|
10
|
+
extensions = {},
|
|
11
|
+
baseImage = `${ repo }:php-7.3`
|
|
12
|
+
} = {}) => ({
|
|
13
|
+
baseImage,
|
|
14
|
+
debugImage: `${ baseImage }-debug`,
|
|
15
|
+
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
16
|
+
fpmConfigTemplate: path.join(templateDir || '', 'php-fpm.template.conf'),
|
|
17
|
+
extensions: {
|
|
18
|
+
xdebug,
|
|
19
|
+
...extensions
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
module.exports = php73;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { repo } = require('../base-repo');
|
|
3
|
+
const xdebug = require('../extensions/xdebug');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @returns {import('../../../../typings/index').PHPConfiguration}
|
|
7
|
+
*/
|
|
8
|
+
const php74 = ({
|
|
9
|
+
templateDir,
|
|
10
|
+
extensions = {},
|
|
11
|
+
baseImage = `${ repo }:php-7.4`
|
|
12
|
+
} = {}) => ({
|
|
13
|
+
baseImage,
|
|
14
|
+
debugImage: `${ baseImage }-debug`,
|
|
15
|
+
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
16
|
+
fpmConfigTemplate: path.join(templateDir || '', 'php-fpm.template.conf'),
|
|
17
|
+
extensions: {
|
|
18
|
+
xdebug,
|
|
19
|
+
...extensions
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
module.exports = php74;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { repo } = require('../base-repo');
|
|
3
|
+
const xdebug = require('../extensions/xdebug');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @returns {import('../../../../typings/index').PHPConfiguration}
|
|
7
|
+
*/
|
|
8
|
+
const php81 = ({
|
|
9
|
+
templateDir,
|
|
10
|
+
extensions = {},
|
|
11
|
+
baseImage = `${ repo }:php-8.1`
|
|
12
|
+
} = {}) => ({
|
|
13
|
+
baseImage,
|
|
14
|
+
debugImage: `${ baseImage }-debug`,
|
|
15
|
+
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
16
|
+
fpmConfigTemplate: path.join(templateDir || '', 'php-fpm.template.conf'),
|
|
17
|
+
extensions: {
|
|
18
|
+
xdebug,
|
|
19
|
+
...extensions
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
module.exports = php81;
|
package/lib/config/php-config.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const phpbrewConfig = require('./phpbrew');
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @param {import('../../typings/context').ListrContext['config']['overridenConfiguration']} overridenConfiguration
|
|
5
|
+
* @param {import('../../typings/context').ListrContext['config']['baseConfig']} baseConfig
|
|
6
|
+
*/
|
|
7
|
+
module.exports = (overridenConfiguration, baseConfig) => {
|
|
8
|
+
const { php } = overridenConfiguration;
|
|
6
9
|
|
|
7
|
-
const { cacheDir } =
|
|
8
|
-
|
|
9
|
-
const phpVersionDir = path.join(
|
|
10
|
-
phpbrewConfig.phpPath,
|
|
11
|
-
`php-${ php.version }`
|
|
12
|
-
);
|
|
10
|
+
const { cacheDir } = baseConfig;
|
|
13
11
|
|
|
14
12
|
const phpConfiguration = {
|
|
15
|
-
binPath: path.join(phpVersionDir, 'bin', 'php'),
|
|
16
13
|
iniPath: path.join(cacheDir, 'php.ini'),
|
|
17
14
|
iniTemplatePath: php.configTemplate,
|
|
18
|
-
|
|
15
|
+
fpmTemplatePath: php.fpmConfigTemplate,
|
|
19
16
|
fpmConfPath: path.join(cacheDir, 'php-fpm.conf'),
|
|
20
|
-
fpmPidFilePath: path.join(cacheDir, 'php-fpm.pid'),
|
|
21
17
|
extensions: php.extensions,
|
|
22
18
|
version: php.version
|
|
23
19
|
};
|
|
@@ -58,8 +58,7 @@ const defaultPorts = {
|
|
|
58
58
|
varnish: 8080,
|
|
59
59
|
sslTerminator: 80,
|
|
60
60
|
fpm: 9000,
|
|
61
|
-
|
|
62
|
-
mysql: 3306,
|
|
61
|
+
mariadb: 3306,
|
|
63
62
|
redis: 6379,
|
|
64
63
|
elasticsearch: 9200
|
|
65
64
|
};
|
|
@@ -74,10 +73,7 @@ const defaultPorts = {
|
|
|
74
73
|
const getPortsConfig = async (ports, options = {}) => {
|
|
75
74
|
const { useNonOverlappingPorts } = options;
|
|
76
75
|
const mergedPorts = deepmerge(defaultPorts, ports || {});
|
|
77
|
-
let p = [
|
|
78
|
-
9003,
|
|
79
|
-
9111
|
|
80
|
-
];
|
|
76
|
+
let p = [];
|
|
81
77
|
|
|
82
78
|
if (useNonOverlappingPorts) {
|
|
83
79
|
p = p.concat(await getUsedByOtherCMAProjectsPorts());
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const os = require('os');
|
|
2
|
+
const { getArchSync } = require('../../../../util/arch');
|
|
3
|
+
const { deepmerge } = require('../../../../util/deepmerge');
|
|
4
|
+
const { repo } = require('../base-repo');
|
|
5
|
+
const defaultEnv = require('../default-es-env');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @returns {import('../../../../../typings/index').ServiceWithImage}
|
|
9
|
+
*/
|
|
10
|
+
const elasticsearch68 = ({
|
|
11
|
+
image = `${ repo }:elasticsearch-6.8`
|
|
12
|
+
} = {}) => ({
|
|
13
|
+
image,
|
|
14
|
+
env: deepmerge(defaultEnv, os.platform() === 'darwin' && getArchSync() === 'arm64' ? {
|
|
15
|
+
'xpack.ml.enabled': false
|
|
16
|
+
} : {})
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
module.exports = elasticsearch68;
|
|
@@ -2,16 +2,16 @@ RED='\033[0;31m'
|
|
|
2
2
|
GREEN='\033[0;32m'
|
|
3
3
|
NC='\033[0m' # No Color
|
|
4
4
|
|
|
5
|
-
alias php="
|
|
6
|
-
alias magento="php
|
|
5
|
+
alias php="node ./node_modules/.bin/magento-scripts-exec php php"
|
|
6
|
+
alias magento="php bin/magento"
|
|
7
7
|
alias magneto="echo -e 'Not ${RED}magneto${NC} but ${GREEN}magento${NC} please! or at least ${GREEN}m${NC}!' && magento"
|
|
8
8
|
alias m="magento"
|
|
9
|
-
alias composer="
|
|
9
|
+
alias composer="node ./node_modules/.bin/magento-scripts-exec php composer"
|
|
10
10
|
alias c="composer"
|
|
11
11
|
<% if (it.varnishEnabled) { %>
|
|
12
|
-
alias cvc="
|
|
12
|
+
alias cvc="node ./node_modules/.bin/magento-scripts-exec varnish varnishadm ban req.url '~ /' && echo 'Varnish cache cleared!'"
|
|
13
13
|
<% } %>
|
|
14
|
-
alias
|
|
15
|
-
alias
|
|
14
|
+
alias mariadb="node ./node_modules/.bin/magento-scripts-exec mariadb 'mysql -umagento -pmagento'"
|
|
15
|
+
alias mariadbroot="node ./node_modules/.bin/magento-scripts-exec mariadb 'mysql -uroot -pscandipwa'"
|
|
16
16
|
|
|
17
17
|
export BASH_SILENCE_DEPRECATION_WARNING=1
|