@scandipwa/magento-scripts 1.14.1-alpha.9 → 1.15.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 (143) hide show
  1. package/lib/commands/cli.js +9 -4
  2. package/lib/commands/logs.js +1 -0
  3. package/lib/commands/start.js +18 -5
  4. package/lib/config/cma-config.js +16 -0
  5. package/lib/config/dependencies-for-platforms.js +15 -3
  6. package/lib/config/docker.js +4 -3
  7. package/lib/config/get-port-config.js +2 -1
  8. package/lib/config/index.js +2 -1
  9. package/lib/config/php/extensions/libsodium.js +2 -1
  10. package/lib/config/scandipwa-versions.js +2 -1
  11. package/lib/config/system-config.js +34 -5
  12. package/lib/config/templates/magentorc.template +2 -0
  13. package/lib/config/templates/varnish.template.vcl +9 -4
  14. package/lib/config/xml-parser.js +63 -0
  15. package/lib/errors/known-error.js +15 -0
  16. package/lib/errors/unknown-error.js +15 -0
  17. package/lib/tasks/cli/create-bashrc-config.js +2 -1
  18. package/lib/tasks/composer/index.js +5 -3
  19. package/lib/tasks/composer/local-auth-json.js +8 -4
  20. package/lib/tasks/docker/network.js +2 -1
  21. package/lib/tasks/execute/index.js +2 -3
  22. package/lib/tasks/file-system/create-nginx-config.js +2 -1
  23. package/lib/tasks/file-system/create-php-config.js +2 -1
  24. package/lib/tasks/file-system/create-php-fpm-config.js +2 -1
  25. package/lib/tasks/file-system/create-phpstorm-config/database-config.js +249 -0
  26. package/lib/tasks/file-system/create-phpstorm-config/eslint-config.js +85 -0
  27. package/lib/tasks/file-system/create-phpstorm-config/exclude-folder-config.js +154 -0
  28. package/lib/tasks/file-system/create-phpstorm-config/index.js +27 -0
  29. package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/coding-standard-config.js +26 -0
  30. package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/config.js +54 -0
  31. package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/custom-ruleset-path-config.js +28 -0
  32. package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/default-properties-config.js +42 -0
  33. package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/eslint-inspection-config.js +37 -0
  34. package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/index.js +80 -0
  35. package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/magento-coding-standard-config.js +26 -0
  36. package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/mess-detector-validation-inspection-config.js +142 -0
  37. package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/paths.js +20 -0
  38. package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/php-cs-fixer-validation-inspection-config.js +60 -0
  39. package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/php-cs-validation-inspection-config.js +116 -0
  40. package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/stylelint-inspection-config.js +37 -0
  41. package/lib/tasks/file-system/create-phpstorm-config/keys.js +14 -0
  42. package/lib/tasks/file-system/create-phpstorm-config/php-config/index.js +67 -0
  43. package/lib/tasks/file-system/create-phpstorm-config/php-config/mess-detector-config.js +54 -0
  44. package/lib/tasks/file-system/create-phpstorm-config/php-config/php-code-sniffer-config.js +66 -0
  45. package/lib/tasks/file-system/create-phpstorm-config/php-config/php-cs-fixer-config.js +58 -0
  46. package/lib/tasks/file-system/create-phpstorm-config/php-config/php-project-shared-configuration-config.js +59 -0
  47. package/lib/tasks/file-system/create-phpstorm-config/stylelint-config.js +77 -0
  48. package/lib/tasks/file-system/create-phpstorm-config/workspace-config/composer-settings-config.js +97 -0
  49. package/lib/tasks/file-system/create-phpstorm-config/workspace-config/format-setting-config.js +57 -0
  50. package/lib/tasks/file-system/create-phpstorm-config/workspace-config/index.js +66 -0
  51. package/lib/tasks/file-system/create-phpstorm-config/workspace-config/php-debug-general-config.js +64 -0
  52. package/lib/tasks/file-system/create-phpstorm-config/workspace-config/php-server-config.js +57 -0
  53. package/lib/tasks/file-system/create-phpstorm-config/workspace-config/properties-component-config.js +49 -0
  54. package/lib/tasks/file-system/create-phpstorm-config/workspace-config/run-manager-config.js +64 -0
  55. package/lib/tasks/file-system/create-phpstorm-config/xml-utils.js +5 -0
  56. package/lib/tasks/file-system/create-ssl-terminator-config.js +5 -3
  57. package/lib/tasks/file-system/create-varnish-config.js +2 -23
  58. package/lib/tasks/file-system/create-vscode-config.js +3 -2
  59. package/lib/tasks/file-system/index.js +1 -1
  60. package/lib/tasks/magento/enable-magento-composer-plugins.js +3 -2
  61. package/lib/tasks/magento/install-magento.js +7 -5
  62. package/lib/tasks/magento/setup-magento/adjust-full-page-cache.js +26 -0
  63. package/lib/tasks/magento/setup-magento/delete-admin-users.js +1 -1
  64. package/lib/tasks/magento/setup-magento/delete-customers.js +7 -4
  65. package/lib/tasks/magento/setup-magento/delete-orders.js +6 -4
  66. package/lib/tasks/magento/setup-magento/flush-redis-config.js +2 -1
  67. package/lib/tasks/magento/setup-magento/index.js +3 -1
  68. package/lib/tasks/magento/setup-magento/install-magento.js +2 -1
  69. package/lib/tasks/magento/setup-magento/set-base-url.js +7 -2
  70. package/lib/tasks/magento/setup-magento/upgrade-magento.js +11 -1
  71. package/lib/tasks/magento/setup-magento/waiting-for-varnish.js +41 -0
  72. package/lib/tasks/mysql/connect-to-mysql.js +2 -1
  73. package/lib/tasks/mysql/import-dump-to-mysql.js +13 -2
  74. package/lib/tasks/mysql/import-remote-db/index.js +2 -1
  75. package/lib/tasks/mysql/import-remote-db/ssh/index.js +2 -1
  76. package/lib/tasks/mysql/import-remote-db/ssh/regular-server.js +2 -1
  77. package/lib/tasks/php/bundled-extensions.js +28 -0
  78. package/lib/tasks/php/compile-options.js +27 -54
  79. package/lib/tasks/php/compile.js +6 -4
  80. package/lib/tasks/php/configure.js +7 -66
  81. package/lib/tasks/php/extensions/disable.js +2 -1
  82. package/lib/tasks/php/extensions/enable.js +2 -1
  83. package/lib/tasks/php/extensions/index.js +74 -0
  84. package/lib/tasks/php/extensions/install.js +3 -3
  85. package/lib/tasks/php/index.js +7 -6
  86. package/lib/tasks/php/install-sodium.js +93 -0
  87. package/lib/tasks/php/update-phpbrew.js +7 -3
  88. package/lib/tasks/php/validate-php.js +67 -0
  89. package/lib/tasks/php-fpm/start-php-fpm.js +4 -2
  90. package/lib/tasks/requirements/composer.js +59 -5
  91. package/lib/tasks/requirements/dependency/arch.js +2 -1
  92. package/lib/tasks/requirements/dependency/centos.js +2 -1
  93. package/lib/tasks/requirements/dependency/fedora.js +2 -1
  94. package/lib/tasks/requirements/dependency/mac.js +18 -3
  95. package/lib/tasks/requirements/docker/index.js +94 -40
  96. package/lib/tasks/requirements/docker/install-on-mac.js +29 -0
  97. package/lib/tasks/requirements/docker/install.js +2 -1
  98. package/lib/tasks/requirements/docker/running-status.js +32 -31
  99. package/lib/tasks/requirements/docker/version.js +2 -1
  100. package/lib/tasks/requirements/index.js +3 -0
  101. package/lib/tasks/requirements/node-version.js +2 -1
  102. package/lib/tasks/requirements/php-version.js +26 -24
  103. package/lib/tasks/requirements/phpbrew/index.js +2 -1
  104. package/lib/tasks/requirements/phpbrew/install.js +14 -2
  105. package/lib/tasks/requirements/phpbrew/version.js +2 -1
  106. package/lib/tasks/requirements/platform.js +5 -3
  107. package/lib/tasks/requirements/rosetta.js +32 -0
  108. package/lib/tasks/start.js +10 -2
  109. package/lib/tasks/theme/build-theme.js +2 -1
  110. package/lib/tasks/theme/install-theme.js +2 -1
  111. package/lib/tasks/theme/link-theme.js +2 -2
  112. package/lib/tasks/theme/retrieve-theme-data.js +2 -1
  113. package/lib/tasks/theme/setup-persisted-query.js +2 -1
  114. package/lib/tasks/theme/setup-themes.js +10 -3
  115. package/lib/tasks/theme/symlink-theme.js +8 -1
  116. package/lib/util/CSA-theme.js +4 -0
  117. package/lib/util/analytics.js +317 -0
  118. package/lib/util/arch.js +1 -1
  119. package/lib/util/config-file-validator.js +2 -1
  120. package/lib/util/config-php-json.js +3 -2
  121. package/lib/util/env-php-json.js +3 -2
  122. package/lib/util/exec-async-command.d.ts +2 -0
  123. package/lib/util/exec-async-command.js +31 -15
  124. package/lib/util/exec-async.js +9 -0
  125. package/lib/util/get-brew-bin-path.js +64 -0
  126. package/lib/util/get-installed-magento-version.js +3 -2
  127. package/lib/util/get-jsonfile-data.js +2 -1
  128. package/lib/util/install-dependencies-task.js +15 -5
  129. package/lib/util/instance-metadata.js +9 -2
  130. package/lib/util/ip.js +47 -1
  131. package/lib/util/magento-task.js +20 -9
  132. package/lib/util/php-task.js +7 -7
  133. package/lib/util/request.js +0 -0
  134. package/lib/util/resolve-configuration-with-overrides.js +2 -1
  135. package/lib/util/run-composer.js +5 -3
  136. package/lib/util/run-magento.js +3 -2
  137. package/lib/util/run-php.js +7 -2
  138. package/lib/util/wait-for-it.js +3 -2
  139. package/package.json +5 -3
  140. package/typings/context.d.ts +4 -0
  141. package/typings/phpstorm.d.ts +33 -0
  142. package/lib/tasks/file-system/create-php-storm-config.js +0 -82
  143. package/lib/tasks/magento/setup-magento/disable-full-page-cache.js +0 -20
@@ -1,82 +0,0 @@
1
- const setConfigFile = require('../../util/set-config');
2
- const pathExists = require('../../util/path-exists');
3
- const path = require('path');
4
- const fs = require('fs');
5
-
6
- const createPhpStormConfig = () => ({
7
- title: 'Setting PHPStorm config',
8
- task: async ({ config: { phpStorm }, ports }) => {
9
- const { phpLanguageLevel } = phpStorm.php;
10
- const jdbcUrl = `jdbc:mysql://localhost:${ports.mysql}/magento`;
11
-
12
- try {
13
- await setConfigFile({
14
- configPathname: phpStorm.xdebug.path,
15
- template: phpStorm.xdebug.templatePath,
16
- overwrite: true,
17
- templateArgs: {
18
- phpStorm
19
- }
20
- });
21
- } catch (e) {
22
- throw new Error(`Unexpected error accrued during workspace.xml config creation\n\n${e}`);
23
- }
24
-
25
- try {
26
- await setConfigFile({
27
- configPathname: phpStorm.php.path,
28
- template: phpStorm.php.templatePath,
29
- overwrite: true,
30
- templateArgs: {
31
- phpLanguageLevel
32
- }
33
- });
34
- } catch (e) {
35
- throw new Error(`Unexpected error accrued during php.xml config creation\n\n${e}`);
36
- }
37
-
38
- try {
39
- await setConfigFile({
40
- configPathname: phpStorm.database.dataSourcesLocal.path,
41
- template: phpStorm.database.dataSourcesLocal.templatePath,
42
- overwrite: true,
43
- templateArgs: {
44
- phpStorm
45
- }
46
- });
47
- } catch (e) {
48
- throw new Error(`Unexpected error accrued during dataSources.local.xml config creation\n\n${e}`);
49
- }
50
-
51
- try {
52
- await setConfigFile({
53
- configPathname: phpStorm.database.dataSources.path,
54
- template: phpStorm.database.dataSources.templatePath,
55
- overwrite: true,
56
- templateArgs: {
57
- phpStorm,
58
- jdbcUrl
59
- }
60
- });
61
- } catch (e) {
62
- throw new Error(`Unexpected error accrued during dataSources.xml config creation\n\n${e}`);
63
- }
64
-
65
- if (!await pathExists(path.resolve('./.idea/dataSources'))) {
66
- await fs.promises.mkdir(path.resolve('./.idea/dataSources'));
67
- }
68
-
69
- try {
70
- await setConfigFile({
71
- configPathname: phpStorm.inspectionTools.path,
72
- template: phpStorm.inspectionTools.templatePath,
73
- overwrite: true,
74
- templateArgs: {}
75
- });
76
- } catch (e) {
77
- throw new Error(`Unexpected error accrued during Project_Default.xml config creation\n\n${e}`);
78
- }
79
- }
80
- });
81
-
82
- module.exports = createPhpStormConfig;
@@ -1,20 +0,0 @@
1
- const envPhpToJson = require('../../../util/env-php-json');
2
- const magentoTask = require('../../../util/magento-task');
3
-
4
- /**
5
- * @type {() => import('listr2').ListrTask<import('../../../../typings/context').ListrContext>}
6
- */
7
- const disableFullPageCache = () => ({
8
- title: 'Disabling full_page cache in Magento',
9
- task: async ({ magentoVersion }, task) => {
10
- const { cache_types } = await envPhpToJson(process.cwd(), { magentoVersion });
11
-
12
- if (cache_types.full_page !== 0) {
13
- return task.newListr(magentoTask('cache:disable full_page'));
14
- }
15
-
16
- task.skip();
17
- }
18
- });
19
-
20
- module.exports = disableFullPageCache;