@scandipwa/magento-scripts 2.3.7 → 2.4.0-alpha.1

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 (70) hide show
  1. package/exec.js +2 -2
  2. package/index.js +1 -0
  3. package/lib/commands/cli.js +17 -19
  4. package/lib/commands/execute.js +8 -4
  5. package/lib/commands/start.js +0 -6
  6. package/lib/config/docker.js +67 -128
  7. package/lib/config/get-project-configuration.js +0 -5
  8. package/lib/config/php-config.js +4 -0
  9. package/lib/config/port-config.js +1 -0
  10. package/lib/config/services/composer/versions/composer-2.8.js +1 -1
  11. package/lib/config/services/elasticsearch/versions/elasticsearch-8.17.js +14 -0
  12. package/lib/config/services/elasticsearch/versions/index.js +3 -1
  13. package/lib/config/services/mariadb/versions/index.js +3 -1
  14. package/lib/config/services/mariadb/versions/mariadb-11.4.js +9 -0
  15. package/lib/config/services/mariadb/versions/mariadb-11.6.js +9 -0
  16. package/lib/config/services/opensearch/versions/index.js +3 -1
  17. package/lib/config/services/opensearch/versions/opensearch-2.19.js +14 -0
  18. package/lib/config/services/php/extensions/ftp.js +7 -0
  19. package/lib/config/services/php/versions/index.js +2 -1
  20. package/lib/config/services/php/versions/php-7.2.js +0 -1
  21. package/lib/config/services/php/versions/php-7.3.js +0 -1
  22. package/lib/config/services/php/versions/php-7.4.js +0 -1
  23. package/lib/config/services/php/versions/php-8.1.js +4 -2
  24. package/lib/config/services/php/versions/php-8.2.js +1 -2
  25. package/lib/config/services/php/versions/php-8.3.js +32 -0
  26. package/lib/config/services/redis/index.js +6 -1
  27. package/lib/config/services/redis/valkey-8.0.js +8 -0
  28. package/lib/config/services/redis/valkey-8.1.js +8 -0
  29. package/lib/config/services/varnish/varnish-6-0.js +1 -1
  30. package/lib/config/services/varnish/varnish-6-6.js +1 -1
  31. package/lib/config/services/varnish/varnish-7-0.js +1 -1
  32. package/lib/config/services/varnish/varnish-7-1.js +1 -1
  33. package/lib/config/services/varnish/varnish-7-3.js +1 -1
  34. package/lib/config/services/varnish/varnish-7-4.js +1 -1
  35. package/lib/config/services/varnish/varnish-7-5.js +1 -1
  36. package/lib/config/services/varnish/varnish-7-6.js +1 -1
  37. package/lib/config/templates/nginx.template.conf +31 -8
  38. package/lib/config/templates/ssl-terminator.template.conf +2 -0
  39. package/lib/config/versions/magento-2.4.4-p13.js +40 -0
  40. package/lib/config/versions/magento-2.4.5-p12.js +40 -0
  41. package/lib/config/versions/magento-2.4.6-p10.js +40 -0
  42. package/lib/config/versions/magento-2.4.7-p4.js +0 -1
  43. package/lib/config/versions/magento-2.4.7-p5.js +41 -0
  44. package/lib/config/versions/magento-2.4.8.js +43 -0
  45. package/lib/tasks/database/create-magento-database.js +5 -4
  46. package/lib/tasks/docker/containers/container-api.d.ts +9 -3
  47. package/lib/tasks/docker/containers/container-api.js +14 -9
  48. package/lib/tasks/docker/containers/tasks.js +18 -12
  49. package/lib/tasks/docker/convert-mysql-to-mariadb.js +14 -22
  50. package/lib/tasks/docker/project-image-builder.js +113 -61
  51. package/lib/tasks/execute.js +9 -9
  52. package/lib/tasks/file-system/create-php-debug-config.js +1 -2
  53. package/lib/tasks/file-system/create-php-fpm-debug-config.js +33 -0
  54. package/lib/tasks/file-system/create-phpstorm-config/php-config/php-interpreters-config.js +5 -5
  55. package/lib/tasks/file-system/create-phpstorm-config/workspace-config/composer-settings-config.js +2 -2
  56. package/lib/tasks/file-system/create-phpstorm-config/workspace-config/php-workspace-project-configuration-config.js +4 -3
  57. package/lib/tasks/file-system/create-ssl-terminator-config.js +27 -1
  58. package/lib/tasks/file-system/index.js +2 -0
  59. package/lib/tasks/magento/setup-magento/waiting-for-varnish.js +0 -1
  60. package/lib/tasks/php/php-container.d.ts +3 -3
  61. package/lib/tasks/php/php-container.js +6 -16
  62. package/lib/tasks/php/update-env-php.js +4 -5
  63. package/lib/tasks/project-config/index.js +0 -3
  64. package/lib/tasks/requirements/elasticsearch-version.js +4 -4
  65. package/lib/tasks/requirements/opensearch-version.js +4 -4
  66. package/lib/tasks/start.js +2 -13
  67. package/lib/util/execute-in-container.js +12 -8
  68. package/package.json +2 -2
  69. package/typings/context.d.ts +9 -3
  70. package/typings/index.d.ts +0 -5
@@ -1,22 +1,26 @@
1
1
  const { spawn } = require('child_process')
2
- const { runCommand } = require('../tasks/docker/containers/container-api')
2
+ const {
3
+ runCommand,
4
+ execCommand
5
+ } = require('../tasks/docker/containers/container-api')
3
6
 
4
7
  /**
5
- * @param {{ containerName: string, commands: string[], user?: string }} param0
8
+ * @param {{ containerName: string, command: string, user?: string }} param0
6
9
  * @returns {Promise<never>}
7
10
  */
8
- const executeInContainer = ({ containerName, commands, user }) => {
11
+ const executeInContainer = ({ containerName, command, user }) => {
9
12
  if (!process.stdin.isTTY) {
10
13
  process.stderr.write('This app works only in TTY mode')
11
14
  process.exit(1)
12
15
  }
13
16
 
14
- const userArg = (user && `--user=${user}`) || ''
15
- const args = ['exec', '-it', userArg, containerName]
16
- .filter(Boolean)
17
- .concat(...commands.map((command) => command.split(' ')).flat())
17
+ const execArgs = execCommand({
18
+ container: containerName,
19
+ command,
20
+ user
21
+ })
18
22
 
19
- spawn('docker', args, {
23
+ spawn('bash', ['-c', execArgs.join(' ')], {
20
24
  stdio: [0, 1, 2]
21
25
  })
22
26
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Scripts and configuration used by CMA.",
4
4
  "homepage": "https://docs.create-magento-app.com/",
5
5
  "repository": "github:scandipwa/create-magento-app",
6
- "version": "2.3.7",
6
+ "version": "2.4.0-alpha.1",
7
7
  "main": "./index.js",
8
8
  "types": "./typings/index.d.ts",
9
9
  "license": "OSL-3.0",
@@ -59,5 +59,5 @@
59
59
  "@types/node": "^20.10.4",
60
60
  "@types/yargs": "^17.0.13"
61
61
  },
62
- "gitHead": "0c65c7b45ec7a4028e9cdf07ccf2195e94a531a3"
62
+ "gitHead": "93c885dd9506109a56c5363a22c1eb9a0a234ef4"
63
63
  }
@@ -18,7 +18,6 @@ export interface ListrContext {
18
18
  throwMagentoVersionMissing: boolean
19
19
  projectPath: string
20
20
  systemDFData?: systemApi.SystemDFResult
21
- debug: boolean
22
21
  verbose: boolean
23
22
  magentoVersion: string
24
23
  composerVersion: string
@@ -29,6 +28,7 @@ export interface ListrContext {
29
28
  ports: {
30
29
  app: number
31
30
  fpm: number
31
+ fpmXdebug: number
32
32
  xdebug: number
33
33
  mariadb: number
34
34
  redis: number
@@ -42,6 +42,7 @@ export interface ListrContext {
42
42
  cachedPorts?: {
43
43
  app: number
44
44
  fpm: number
45
+ fpmXdebug: number
45
46
  xdebug: number
46
47
  mariadb: number
47
48
  redis: number
@@ -67,6 +68,11 @@ export interface ListrContext {
67
68
  php: {
68
69
  iniTemplatePath: string
69
70
  fpmConfPath: string
71
+ fpmTemplatePath: string
72
+ debugIniPath: string
73
+ debugTemplatePath: string
74
+ debugFpmConfPath: string
75
+ debugFpmTemplatePath: string
70
76
  extensions: PHPExtensions
71
77
  version: string
72
78
  }
@@ -91,7 +97,7 @@ export interface ListrContext {
91
97
  }
92
98
  }
93
99
  >
94
- getContainers(ports?: ListrContext['ports']): Record<'php' | 'sslTerminator' | 'nginx' | 'redis' | 'mariadb' | 'elasticsearch' | 'maildev' | 'varnish',
100
+ getContainers(ports?: ListrContext['ports']): Record<'php' | 'phpWithXdebug' | 'sslTerminator' | 'nginx' | 'redis' | 'mariadb' | 'elasticsearch' | 'maildev' | 'varnish',
95
101
  {
96
102
  _: string
97
103
  ports: string[]
@@ -100,12 +106,12 @@ export interface ListrContext {
100
106
  }
101
107
  env: Record<string, string>
102
108
  mountVolumes: string[]
109
+ pullImage?: boolean
103
110
  mounts: string[]
104
111
  restart: string
105
112
  securityOptions: string[]
106
113
  network: string
107
114
  image: string
108
- debugImage?: string
109
115
  remoteImages?: string[]
110
116
  name: string
111
117
  command: string
@@ -189,11 +189,6 @@ export interface PHPConfiguration {
189
189
  */
190
190
  baseImage: string
191
191
 
192
- /**
193
- * Image with XDebug enabled
194
- */
195
- debugImage: string
196
-
197
192
  /**
198
193
  * Configuration file template location
199
194
  *