@scandipwa/magento-scripts 1.14.1-alpha.1 → 1.14.1-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/index.js +13 -0
- package/lib/commands/cli.js +28 -1
- package/lib/commands/execute.js +2 -1
- package/lib/config/docker.js +85 -12
- package/lib/config/get-port-config.js +7 -2
- package/lib/config/port-config.js +3 -1
- package/lib/config/scandipwa-versions.js +2 -1
- package/lib/config/ssl-terminator/index.js +10 -0
- package/lib/config/templates/magentorc.template +3 -5
- package/lib/config/templates/nginx.template.conf +0 -14
- package/lib/config/templates/php.template.ini +6 -4
- package/lib/config/templates/ssl-terminator.template.conf +27 -0
- package/lib/config/templates/varnish.template.vcl +250 -0
- package/lib/config/varnish/varnish-6-0.js +11 -0
- package/lib/config/varnish/varnish-6-6.js +11 -0
- package/lib/config/varnish/varnish-7-0.js +11 -0
- package/lib/config/versions/magento-2.3.0.js +9 -1
- package/lib/config/versions/magento-2.3.1.js +9 -1
- package/lib/config/versions/magento-2.3.2-p2.js +9 -1
- package/lib/config/versions/magento-2.3.2.js +9 -1
- package/lib/config/versions/magento-2.3.3-p1.js +9 -1
- package/lib/config/versions/magento-2.3.3.js +9 -1
- package/lib/config/versions/magento-2.3.4-p2.js +9 -1
- package/lib/config/versions/magento-2.3.4.js +9 -1
- package/lib/config/versions/magento-2.3.5-p1.js +9 -1
- package/lib/config/versions/magento-2.3.5-p2.js +9 -1
- package/lib/config/versions/magento-2.3.5.js +9 -1
- package/lib/config/versions/magento-2.3.6-p1.js +9 -1
- package/lib/config/versions/magento-2.3.6.js +9 -1
- package/lib/config/versions/magento-2.3.7-p1.js +9 -1
- package/lib/config/versions/magento-2.3.7-p2.js +9 -1
- package/lib/config/versions/magento-2.3.7-p3.js +9 -1
- package/lib/config/versions/magento-2.3.7.js +9 -1
- package/lib/config/versions/magento-2.4.0-p1.js +9 -1
- package/lib/config/versions/magento-2.4.0.js +9 -1
- package/lib/config/versions/magento-2.4.1-p1.js +9 -1
- package/lib/config/versions/magento-2.4.1.js +9 -1
- package/lib/config/versions/magento-2.4.2-p1.js +9 -1
- package/lib/config/versions/magento-2.4.2-p2.js +9 -1
- package/lib/config/versions/magento-2.4.2.js +9 -1
- package/lib/config/versions/magento-2.4.3-p1.js +9 -1
- package/lib/config/versions/magento-2.4.3-p2.js +9 -1
- package/lib/config/versions/magento-2.4.3.js +9 -1
- package/lib/config/versions/magento-2.4.4.js +9 -1
- package/lib/tasks/cli/create-bashrc-config.js +5 -2
- package/lib/tasks/docker/containers.js +13 -8
- package/lib/tasks/docker/volumes.js +4 -4
- package/lib/tasks/file-system/create-nginx-config.js +7 -39
- package/lib/tasks/file-system/create-php-storm-config.js +82 -0
- package/lib/tasks/file-system/create-ssl-terminator-config.js +94 -0
- package/lib/tasks/file-system/create-varnish-config.js +74 -0
- package/lib/tasks/file-system/index.js +6 -2
- package/lib/tasks/magento/setup-magento/configure-elasticsearch.js +1 -1
- package/lib/tasks/magento/setup-magento/disable-2fa.js +4 -12
- package/lib/tasks/magento/setup-magento/disable-full-page-cache.js +20 -0
- package/lib/tasks/magento/setup-magento/increase-admin-session-lifetime.js +14 -16
- package/lib/tasks/magento/setup-magento/migrate-database.js +24 -11
- package/lib/tasks/magento/setup-magento/set-base-url.js +7 -2
- package/lib/tasks/magento/setup-magento/upgrade-magento.js +17 -3
- package/lib/tasks/magento/setup-magento/varnish-config.js +69 -0
- package/lib/tasks/mysql/fix-db.js +2 -2
- package/lib/tasks/php/index.js +1 -1
- package/lib/tasks/php/update-env-php.js +16 -1
- package/lib/tasks/php/update-env.php +56 -12
- package/lib/tasks/requirements/docker/index.js +2 -0
- package/lib/tasks/requirements/docker/install.js +11 -11
- package/lib/tasks/requirements/docker/running-status.js +137 -0
- package/lib/tasks/requirements/docker/version.js +2 -0
- package/lib/tasks/requirements/index.js +5 -5
- package/lib/tasks/requirements/php-version.js +3 -1
- package/lib/tasks/start.js +3 -8
- package/lib/tasks/status/index.js +25 -9
- package/lib/tasks/theme/build-theme.js +26 -8
- package/lib/tasks/theme/install-theme.js +16 -4
- package/lib/tasks/theme/link-theme.js +2 -2
- package/lib/tasks/theme/setup-persisted-query.js +3 -3
- package/lib/tasks/theme/setup-themes.js +3 -2
- package/lib/tasks/theme/symlink-theme.js +18 -3
- package/lib/util/config-file-validator.js +12 -1
- package/lib/util/config-php-json.js +19 -0
- package/lib/util/instance-metadata.js +2 -2
- package/lib/util/is-running-root.js +3 -0
- package/lib/util/match-filesystem.js +2 -1
- package/lib/util/php-task.js +6 -2
- package/lib/util/run-php.js +7 -1
- package/lib/util/systemctl.js +46 -0
- package/package.json +2 -3
- package/typings/context.d.ts +5 -3
- package/typings/index.d.ts +32 -1
- package/lib/config/xml-parser.js +0 -61
- package/lib/tasks/file-system/create-phpstorm-config/database-config.js +0 -248
- package/lib/tasks/file-system/create-phpstorm-config/eslint-config.js +0 -83
- package/lib/tasks/file-system/create-phpstorm-config/exclude-folder-config.js +0 -154
- package/lib/tasks/file-system/create-phpstorm-config/index.js +0 -27
- package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/coding-standard-config.js +0 -29
- package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/config.js +0 -54
- package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/custom-ruleset-path-config.js +0 -31
- package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/default-properties-config.js +0 -42
- package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/eslint-inspection-config.js +0 -37
- package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/index.js +0 -80
- package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/magento-coding-standard-config.js +0 -29
- package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/mess-detector-validation-inspection-config.js +0 -145
- package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/paths.js +0 -20
- package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/php-cs-fixer-validation-inspection-config.js +0 -60
- package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/php-cs-validation-inspection-config.js +0 -119
- package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/stylelint-inspection-config.js +0 -37
- package/lib/tasks/file-system/create-phpstorm-config/keys.js +0 -14
- package/lib/tasks/file-system/create-phpstorm-config/php-config/index.js +0 -67
- package/lib/tasks/file-system/create-phpstorm-config/php-config/mess-detector-config.js +0 -57
- package/lib/tasks/file-system/create-phpstorm-config/php-config/php-code-sniffer-config.js +0 -76
- package/lib/tasks/file-system/create-phpstorm-config/php-config/php-cs-fixer-config.js +0 -63
- package/lib/tasks/file-system/create-phpstorm-config/php-config/php-project-shared-configuration-config.js +0 -69
- package/lib/tasks/file-system/create-phpstorm-config/stylelint-config.js +0 -77
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/composer-settings-config.js +0 -98
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/format-setting-config.js +0 -57
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/index.js +0 -66
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/php-debug-general-config.js +0 -64
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/php-server-config.js +0 -60
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/properties-component-config.js +0 -51
- package/lib/tasks/file-system/create-phpstorm-config/workspace-config/run-manager-config.js +0 -74
- package/lib/tasks/file-system/create-phpstorm-config/xml-utils.js +0 -5
- package/lib/tasks/magento/setup-magento/adjust-magento-configuration.js +0 -27
- package/lib/tasks/magento/setup-magento/disable-page-cache.js +0 -11
- package/typings/phpstorm.d.ts +0 -33
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
const { loadXmlFile, buildXmlFile } = require('../../../../config/xml-parser');
|
|
2
|
-
const pathExists = require('../../../../util/path-exists');
|
|
3
|
-
const setupComposerSettings = require('./composer-settings-config');
|
|
4
|
-
const setupFormatOnSave = require('./format-setting-config');
|
|
5
|
-
const setupPHPDebugGeneral = require('./php-debug-general-config');
|
|
6
|
-
const setupPHPServers = require('./php-server-config');
|
|
7
|
-
const setupPropertiesComponent = require('./properties-component-config');
|
|
8
|
-
const setupRunManager = require('./run-manager-config');
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @type {() => import('listr2').ListrTask<import('../../../../../typings/context').ListrContext>}
|
|
12
|
-
*/
|
|
13
|
-
const setupWorkspaceConfig = () => ({
|
|
14
|
-
title: 'Set up Workspace configuration',
|
|
15
|
-
task: async (ctx, task) => {
|
|
16
|
-
const {
|
|
17
|
-
config: {
|
|
18
|
-
phpStorm
|
|
19
|
-
}
|
|
20
|
-
} = ctx;
|
|
21
|
-
|
|
22
|
-
if (await pathExists(phpStorm.xdebug.path)) {
|
|
23
|
-
const workspaceConfiguration = await loadXmlFile(phpStorm.xdebug.path);
|
|
24
|
-
const workspaceConfigs = workspaceConfiguration.project.component;
|
|
25
|
-
const hasChanges = await Promise.all([
|
|
26
|
-
setupPHPDebugGeneral(workspaceConfigs, phpStorm),
|
|
27
|
-
setupPHPServers(workspaceConfigs, phpStorm),
|
|
28
|
-
setupRunManager(workspaceConfigs, phpStorm),
|
|
29
|
-
setupPropertiesComponent(workspaceConfigs)
|
|
30
|
-
]);
|
|
31
|
-
|
|
32
|
-
if (hasChanges.includes(true)) {
|
|
33
|
-
await buildXmlFile(phpStorm.php.path, workspaceConfiguration);
|
|
34
|
-
} else {
|
|
35
|
-
task.skip();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const workspaceConfiguration = {
|
|
42
|
-
'?xml': {
|
|
43
|
-
'@_version': '1.0',
|
|
44
|
-
'@_encoding': 'UTF-8'
|
|
45
|
-
},
|
|
46
|
-
project: {
|
|
47
|
-
'@_version': '4',
|
|
48
|
-
component: []
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
const workspaceConfigs = workspaceConfiguration.project.component;
|
|
52
|
-
|
|
53
|
-
await Promise.all([
|
|
54
|
-
setupPHPDebugGeneral(workspaceConfigs, phpStorm),
|
|
55
|
-
setupPHPServers(workspaceConfigs, phpStorm),
|
|
56
|
-
setupRunManager(workspaceConfigs, phpStorm),
|
|
57
|
-
setupPropertiesComponent(workspaceConfigs),
|
|
58
|
-
setupComposerSettings(workspaceConfigs),
|
|
59
|
-
setupFormatOnSave(workspaceConfigs)
|
|
60
|
-
]);
|
|
61
|
-
|
|
62
|
-
await buildXmlFile(phpStorm.xdebug.path, workspaceConfiguration);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
module.exports = setupWorkspaceConfig;
|
package/lib/tasks/file-system/create-phpstorm-config/workspace-config/php-debug-general-config.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
nameKey
|
|
3
|
-
} = require('../keys');
|
|
4
|
-
|
|
5
|
-
const PHP_DEBUG_GENERAL_COMPONENT_NAME = 'PhpDebugGeneral';
|
|
6
|
-
|
|
7
|
-
const portKey = '@_port';
|
|
8
|
-
const xdebugDebugPortKey = '@_xdebug_debug_port';
|
|
9
|
-
const ignoreConnectionsThroughUnregisteredServersKey = '@_ignore_connections_through_unregistered_servers';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @param {Array} workspaceConfigs
|
|
13
|
-
* @param {import('../../../../../typings/phpstorm').PHPStormConfig} phpStormConfiguration
|
|
14
|
-
* @returns {Promise<Boolean>}
|
|
15
|
-
*/
|
|
16
|
-
const setupPHPDebugGeneral = async (workspaceConfigs, phpStormConfiguration) => {
|
|
17
|
-
const { xdebug } = phpStormConfiguration;
|
|
18
|
-
let hasChanges = false;
|
|
19
|
-
const phpDebugGeneralComponent = workspaceConfigs.find(
|
|
20
|
-
(workspaceConfig) => workspaceConfig[nameKey] === PHP_DEBUG_GENERAL_COMPONENT_NAME
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
if (phpDebugGeneralComponent) {
|
|
24
|
-
if (phpDebugGeneralComponent.xdebug_debug_ports && !Array.isArray(phpDebugGeneralComponent.xdebug_debug_ports)) {
|
|
25
|
-
hasChanges = true;
|
|
26
|
-
phpDebugGeneralComponent.xdebug_debug_ports = [phpDebugGeneralComponent.xdebug_debug_ports];
|
|
27
|
-
} else if (!phpDebugGeneralComponent.xdebug_debug_ports) {
|
|
28
|
-
hasChanges = true;
|
|
29
|
-
phpDebugGeneralComponent.xdebug_debug_ports = [];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (!(xdebugDebugPortKey in phpDebugGeneralComponent)) {
|
|
33
|
-
hasChanges = true;
|
|
34
|
-
phpDebugGeneralComponent[xdebugDebugPortKey] = xdebug.v3Port;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const missingXDebugPorts = [xdebug.v3Port, xdebug.v2Port].filter(
|
|
38
|
-
(port) => !phpDebugGeneralComponent.xdebug_debug_ports.some((xPort) => xPort[portKey] === port)
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
if (missingXDebugPorts.length > 0) {
|
|
42
|
-
hasChanges = true;
|
|
43
|
-
missingXDebugPorts.forEach((port) => {
|
|
44
|
-
phpDebugGeneralComponent.xdebug_debug_ports.push({
|
|
45
|
-
[portKey]: port
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
} else {
|
|
50
|
-
hasChanges = true;
|
|
51
|
-
workspaceConfigs.push({
|
|
52
|
-
[nameKey]: PHP_DEBUG_GENERAL_COMPONENT_NAME,
|
|
53
|
-
[xdebugDebugPortKey]: xdebug.v3Port,
|
|
54
|
-
[ignoreConnectionsThroughUnregisteredServersKey]: 'true',
|
|
55
|
-
xdebug_debug_ports: [xdebug.v3Port, xdebug.v2Port].map((port) => ({
|
|
56
|
-
[portKey]: port
|
|
57
|
-
}))
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return hasChanges;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
module.exports = setupPHPDebugGeneral;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
const { nameKey } = require('../keys');
|
|
2
|
-
|
|
3
|
-
const PHP_SERVERS_COMPONENT_NAME = 'PhpServers';
|
|
4
|
-
|
|
5
|
-
const hostKey = '@_host';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @param {Array} workspaceConfigs
|
|
9
|
-
* @param {import('../../../../../typings/phpstorm').PHPStormConfig} phpStormConfiguration
|
|
10
|
-
* @returns {Promise<Boolean>}
|
|
11
|
-
*/
|
|
12
|
-
const setupPHPServers = async (workspaceConfigs, phpStormConfiguration) => {
|
|
13
|
-
const { xdebug } = phpStormConfiguration;
|
|
14
|
-
let hasChanges = false;
|
|
15
|
-
const phpServersComponent = workspaceConfigs.find(
|
|
16
|
-
(workspaceConfig) => workspaceConfig[nameKey] === PHP_SERVERS_COMPONENT_NAME
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
const defaultServerConfig = {
|
|
20
|
-
[hostKey]: xdebug.debugServerAddress,
|
|
21
|
-
id: '7e16e907-9ce3-4559-9d26-a30a5650d11f',
|
|
22
|
-
[nameKey]: xdebug.serverName
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
if (phpServersComponent) {
|
|
26
|
-
if (phpServersComponent.servers && !Array.isArray(phpServersComponent.servers)) {
|
|
27
|
-
hasChanges = true;
|
|
28
|
-
phpServersComponent.servers = [phpServersComponent.servers];
|
|
29
|
-
} else if (!phpServersComponent.servers) {
|
|
30
|
-
hasChanges = true;
|
|
31
|
-
phpServersComponent.servers = [];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const serverConfiguration = phpServersComponent.servers.find((server) => server.server[nameKey] === xdebug.serverName);
|
|
35
|
-
|
|
36
|
-
if (serverConfiguration && serverConfiguration.server[hostKey] !== xdebug.debugServerAddress) {
|
|
37
|
-
hasChanges = true;
|
|
38
|
-
serverConfiguration.server[hostKey] = xdebug.debugServerAddress;
|
|
39
|
-
} else if (!serverConfiguration) {
|
|
40
|
-
hasChanges = true;
|
|
41
|
-
phpServersComponent.servers.push({
|
|
42
|
-
server: defaultServerConfig
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
} else {
|
|
46
|
-
hasChanges = true;
|
|
47
|
-
workspaceConfigs.push({
|
|
48
|
-
[nameKey]: PHP_SERVERS_COMPONENT_NAME,
|
|
49
|
-
servers: [
|
|
50
|
-
{
|
|
51
|
-
server: defaultServerConfig
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return hasChanges;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
module.exports = setupPHPServers;
|
package/lib/tasks/file-system/create-phpstorm-config/workspace-config/properties-component-config.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
// const { baseConfig } = require('../../../../config');
|
|
3
|
-
const { getCSAThemes } = require('../../../../util/CSA-theme');
|
|
4
|
-
const pathExists = require('../../../../util/path-exists');
|
|
5
|
-
const { nameKey } = require('../keys');
|
|
6
|
-
// const { formatPathForPHPStormConfig } = require('../xml-utils');
|
|
7
|
-
|
|
8
|
-
const PROPERTIES_COMPONENT_NAME = 'PropertiesComponent';
|
|
9
|
-
|
|
10
|
-
const defaultProperties = {
|
|
11
|
-
keyToString: {
|
|
12
|
-
'RunOnceActivity.OpenProjectViewOnStart': 'true',
|
|
13
|
-
'RunOnceActivity.ShowReadmeOnStart': 'true'
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @param {Array} workspaceConfigs
|
|
19
|
-
* @returns {Promise<Boolean>}
|
|
20
|
-
*/
|
|
21
|
-
const setupPropertiesComponent = async (workspaceConfigs) => {
|
|
22
|
-
let hasChanges = false;
|
|
23
|
-
const propertiesComponent = workspaceConfigs.find(
|
|
24
|
-
(workspaceConfig) => workspaceConfig[nameKey] === PROPERTIES_COMPONENT_NAME
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
if (propertiesComponent) {
|
|
28
|
-
// check later
|
|
29
|
-
} else {
|
|
30
|
-
hasChanges = true;
|
|
31
|
-
const themes = await getCSAThemes();
|
|
32
|
-
if (themes.length > 0) {
|
|
33
|
-
const theme = themes[0];
|
|
34
|
-
const themeESLintPath = path.join(process.cwd(), theme.themePath, 'node_modules', 'eslint');
|
|
35
|
-
if (await pathExists(themeESLintPath)) {
|
|
36
|
-
defaultProperties.keyToString['node.js.selected.package.eslint'] = themeESLintPath;
|
|
37
|
-
defaultProperties.keyToString['js.linters.configure.manually.selectedeslint'] = 'true';
|
|
38
|
-
defaultProperties.keyToString['node.js.detected.package.eslint'] = 'true';
|
|
39
|
-
defaultProperties.keyToString['settings.editor.selected.configurable'] = 'settings.javascript.linters.eslint';
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
workspaceConfigs.push({
|
|
43
|
-
[nameKey]: PROPERTIES_COMPONENT_NAME,
|
|
44
|
-
'#text': JSON.stringify(defaultProperties)
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return hasChanges;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
module.exports = setupPropertiesComponent;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const { nameKey } = require('../keys');
|
|
2
|
-
|
|
3
|
-
const RUN_MANAGER_COMPONENT_NAME = 'RunManager';
|
|
4
|
-
|
|
5
|
-
const PHP_REMOTE_DEBUG_RUN_CONFIGURATION_TYPE = 'PhpRemoteDebugRunConfigurationType';
|
|
6
|
-
|
|
7
|
-
const serverNameKey = '@_server_name';
|
|
8
|
-
const sessionIdKey = '@_session_id';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @param {Array} workspaceConfigs
|
|
12
|
-
* @param {import('../../../../../typings/phpstorm').PHPStormConfig} phpStormConfiguration
|
|
13
|
-
* @returns {Promise<Boolean>}
|
|
14
|
-
*/
|
|
15
|
-
const setupRunManager = async (workspaceConfigs, phpStormConfiguration) => {
|
|
16
|
-
const { xdebug } = phpStormConfiguration;
|
|
17
|
-
let hasChanges = false;
|
|
18
|
-
const runManagerComponent = workspaceConfigs.find(
|
|
19
|
-
(workspaceConfig) => workspaceConfig[nameKey] === RUN_MANAGER_COMPONENT_NAME
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
const defaultRunManagerConfiguration = {
|
|
23
|
-
[nameKey]: xdebug.runManagerName,
|
|
24
|
-
'@_type': PHP_REMOTE_DEBUG_RUN_CONFIGURATION_TYPE,
|
|
25
|
-
'@_factoryName': 'PHP Remote Debug',
|
|
26
|
-
'@_filter_connections': 'FILTER',
|
|
27
|
-
[serverNameKey]: xdebug.serverName,
|
|
28
|
-
[sessionIdKey]: xdebug.sessionId,
|
|
29
|
-
method: {
|
|
30
|
-
'@_v': '2'
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
if (runManagerComponent) {
|
|
35
|
-
if (runManagerComponent.configuration && !Array.isArray(runManagerComponent.configuration)) {
|
|
36
|
-
hasChanges = true;
|
|
37
|
-
runManagerComponent.configuration = [runManagerComponent.configuration];
|
|
38
|
-
} else if (!runManagerComponent.configuration) {
|
|
39
|
-
hasChanges = true;
|
|
40
|
-
runManagerComponent.configuration = [];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const phpRemoteDebugRunConfiguration = runManagerComponent.configuration.find(
|
|
44
|
-
(configuration) => configuration['@_type'] === PHP_REMOTE_DEBUG_RUN_CONFIGURATION_TYPE && configuration[nameKey] === xdebug.runManagerName
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
if (phpRemoteDebugRunConfiguration) {
|
|
48
|
-
if (phpRemoteDebugRunConfiguration[serverNameKey] !== xdebug.serverName) {
|
|
49
|
-
hasChanges = true;
|
|
50
|
-
phpRemoteDebugRunConfiguration[serverNameKey] = xdebug.serverName;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (phpRemoteDebugRunConfiguration[sessionIdKey] !== xdebug.sessionId) {
|
|
54
|
-
hasChanges = true;
|
|
55
|
-
phpRemoteDebugRunConfiguration[sessionIdKey] = xdebug.sessionId;
|
|
56
|
-
}
|
|
57
|
-
} else {
|
|
58
|
-
hasChanges = true;
|
|
59
|
-
runManagerComponent.configuration.push(defaultRunManagerConfiguration);
|
|
60
|
-
}
|
|
61
|
-
} else {
|
|
62
|
-
hasChanges = true;
|
|
63
|
-
workspaceConfigs.push({
|
|
64
|
-
[nameKey]: RUN_MANAGER_COMPONENT_NAME,
|
|
65
|
-
configuration: [
|
|
66
|
-
defaultRunManagerConfiguration
|
|
67
|
-
]
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return hasChanges;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
module.exports = setupRunManager;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const { isTableExists } = require('../../../util/database');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @type {() => import('listr2').ListrTask<import('../../../../typings/context').ListrContext>}
|
|
5
|
-
*/
|
|
6
|
-
const adjustMagentoConfiguration = () => ({
|
|
7
|
-
title: 'Adjusting Magento Database Configuration',
|
|
8
|
-
skip: async (ctx) => !(await isTableExists('magento', 'core_config_data', ctx)),
|
|
9
|
-
task: async (ctx) => {
|
|
10
|
-
const { mysqlConnection } = ctx;
|
|
11
|
-
|
|
12
|
-
// delete varnish configuration if exists
|
|
13
|
-
await mysqlConnection.query(`
|
|
14
|
-
DELETE FROM core_config_data WHERE path LIKE '%varnish%';
|
|
15
|
-
`);
|
|
16
|
-
|
|
17
|
-
// update cache policy to not use varnish
|
|
18
|
-
// 0 - magento cache, 2 - varnish cache
|
|
19
|
-
await mysqlConnection.query(`
|
|
20
|
-
UPDATE core_config_data
|
|
21
|
-
SET value = ?
|
|
22
|
-
WHERE path = ?;
|
|
23
|
-
`, ['0', 'system/full_page_cache/caching_application']);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
module.exports = adjustMagentoConfiguration;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const magentoTask = require('../../../util/magento-task');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @type {() => import('listr2').ListrTask<import('../../../../typings/context').ListrContext>}
|
|
5
|
-
*/
|
|
6
|
-
const disablePageCache = () => ({
|
|
7
|
-
title: 'Disabling full_page cache in Magento',
|
|
8
|
-
task: (ctx, task) => task.newListr(magentoTask('cache:disable full_page'))
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
module.exports = disablePageCache;
|
package/typings/phpstorm.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export interface PHPStormConfig {
|
|
2
|
-
xdebug: {
|
|
3
|
-
v2Port: string;
|
|
4
|
-
v3Port: string;
|
|
5
|
-
debugServerAddress: string;
|
|
6
|
-
serverName: string;
|
|
7
|
-
runManagerName: string;
|
|
8
|
-
sessionId: string;
|
|
9
|
-
path: string;
|
|
10
|
-
templatePath: string;
|
|
11
|
-
}
|
|
12
|
-
php: {
|
|
13
|
-
phpLanguageLevel: string;
|
|
14
|
-
path: string;
|
|
15
|
-
templatePath: string;
|
|
16
|
-
}
|
|
17
|
-
database: {
|
|
18
|
-
driver: string;
|
|
19
|
-
dataSourceManagerName: string;
|
|
20
|
-
dataSourcesLocal: {
|
|
21
|
-
path: string;
|
|
22
|
-
templatePath: string;
|
|
23
|
-
}
|
|
24
|
-
dataSources: {
|
|
25
|
-
path: string;
|
|
26
|
-
templatePath: string;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
inspectionTools: {
|
|
30
|
-
path: string;
|
|
31
|
-
templatePath: string;
|
|
32
|
-
}
|
|
33
|
-
}
|