@scandipwa/magento-scripts 2.0.0-alpha.0 → 2.0.0-alpha.3

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 (79) hide show
  1. package/lib/commands/cli.js +2 -2
  2. package/lib/commands/execute.js +1 -1
  3. package/lib/commands/import-db.js +1 -1
  4. package/lib/commands/logs.js +1 -1
  5. package/lib/commands/start.js +1 -5
  6. package/lib/config/docker.js +41 -46
  7. package/lib/config/index.js +1 -1
  8. package/lib/config/port-config.js +1 -1
  9. package/lib/config/services/elasticsearch/base-repo.js +3 -0
  10. package/lib/config/services/elasticsearch/default-es-env.js +6 -0
  11. package/lib/config/services/elasticsearch/versions/elasticsearch-6.8.js +19 -0
  12. package/lib/config/services/elasticsearch/versions/index.js +5 -0
  13. package/lib/config/templates/magentorc.template +2 -2
  14. package/lib/config/templates/mariadb.template.cnf +191 -0
  15. package/lib/config/versions/magento-2.3.0.js +2 -3
  16. package/lib/config/versions/magento-2.3.1.js +2 -3
  17. package/lib/config/versions/magento-2.3.2-p1.js +2 -3
  18. package/lib/config/versions/magento-2.3.2-p2.js +2 -3
  19. package/lib/config/versions/magento-2.3.2.js +2 -3
  20. package/lib/config/versions/magento-2.3.3-p1.js +2 -3
  21. package/lib/config/versions/magento-2.3.3.js +2 -3
  22. package/lib/config/versions/magento-2.3.4-p1.js +2 -3
  23. package/lib/config/versions/magento-2.3.4-p2.js +2 -3
  24. package/lib/config/versions/magento-2.3.4.js +2 -3
  25. package/lib/tasks/cleanup.js +1 -1
  26. package/lib/tasks/database/connect-to-database.js +117 -0
  27. package/lib/tasks/database/create-magento-database.js +18 -0
  28. package/lib/tasks/{mysql → database}/dump-theme-config.js +3 -3
  29. package/lib/tasks/{mysql → database}/fix-db.js +2 -2
  30. package/lib/tasks/{mysql/import-dump-to-mysql.js → database/import-dump-to-database.js} +20 -20
  31. package/lib/tasks/{mysql → database}/import-remote-db/index.js +0 -0
  32. package/lib/tasks/{mysql/import-remote-db/ssh/mysqldump-command.js → database/import-remote-db/ssh/database-dump-command.js} +2 -2
  33. package/lib/tasks/{mysql → database}/import-remote-db/ssh/index.js +0 -0
  34. package/lib/tasks/{mysql → database}/import-remote-db/ssh/readymage.js +4 -4
  35. package/lib/tasks/{mysql → database}/import-remote-db/ssh/regular-server.js +2 -2
  36. package/lib/tasks/{mysql → database}/index.js +2 -2
  37. package/lib/tasks/{mysql → database}/magento-tables.js +0 -0
  38. package/lib/tasks/{mysql → database}/restore-theme-config.js +4 -4
  39. package/lib/tasks/docker/convert-legacy-volumes.js +8 -7
  40. package/lib/tasks/docker/convert-mysql-to-mariadb.js +284 -0
  41. package/lib/tasks/docker/network/network-api.d.ts +1 -1
  42. package/lib/tasks/docker/project-image-builder.js +1 -1
  43. package/lib/tasks/docker/volume/index.js +8 -0
  44. package/lib/tasks/docker/{volumes.js → volume/tasks.js} +5 -19
  45. package/lib/tasks/docker/volume/volume-api.d.ts +39 -0
  46. package/lib/tasks/docker/volume/volume-api.js +66 -0
  47. package/lib/tasks/execute/index.js +5 -2
  48. package/lib/tasks/file-system/create-mariadb-config.js +23 -0
  49. package/lib/tasks/file-system/create-phpstorm-config/workspace-config/php-workspace-project-configuration-config.js +1 -1
  50. package/lib/tasks/file-system/index.js +3 -1
  51. package/lib/tasks/import-dump.js +6 -6
  52. package/lib/tasks/link.js +4 -2
  53. package/lib/tasks/magento/install-magento-project.js +1 -1
  54. package/lib/tasks/magento/setup-magento/configure-elasticsearch.js +2 -2
  55. package/lib/tasks/magento/setup-magento/create-admin.js +1 -1
  56. package/lib/tasks/magento/setup-magento/delete-admin-users.js +2 -2
  57. package/lib/tasks/magento/setup-magento/delete-customers.js +4 -4
  58. package/lib/tasks/magento/setup-magento/delete-orders.js +4 -4
  59. package/lib/tasks/magento/setup-magento/increase-admin-session-lifetime.js +2 -2
  60. package/lib/tasks/magento/setup-magento/index.js +2 -0
  61. package/lib/tasks/magento/setup-magento/install-magento.js +12 -12
  62. package/lib/tasks/magento/setup-magento/migrate-database.js +5 -11
  63. package/lib/tasks/magento/setup-magento/set-base-url.js +2 -2
  64. package/lib/tasks/magento/setup-magento/set-url-rewrite.js +2 -2
  65. package/lib/tasks/magento/setup-magento/varnish-config.js +4 -4
  66. package/lib/tasks/php/update-env-php.js +5 -3
  67. package/lib/tasks/php/update-env.php +12 -12
  68. package/lib/tasks/start.js +5 -25
  69. package/lib/tasks/status/index.js +4 -2
  70. package/lib/tasks/theme/link-theme.js +2 -2
  71. package/lib/util/config-file-validator.js +27 -13
  72. package/lib/util/database.js +7 -7
  73. package/lib/util/prefix.js +1 -1
  74. package/package.json +2 -2
  75. package/typings/context.d.ts +5 -5
  76. package/typings/index.d.ts +31 -30
  77. package/yarn-error.log +9660 -0
  78. package/lib/tasks/mysql/connect-to-mysql.js +0 -127
  79. package/lib/tasks/mysql/create-magento-database.js +0 -18
@@ -11,7 +11,7 @@ export interface ListrContext {
11
11
  app: number
12
12
  fpm: number
13
13
  xdebug: number
14
- mysql: number
14
+ mariadb: number
15
15
  redis: number
16
16
  elasticsearch: number
17
17
  varnish: number
@@ -45,15 +45,15 @@ export interface ListrContext {
45
45
  network: {
46
46
  name: string
47
47
  }
48
- volumes: Record<'mysql' | 'redis' | 'elasticsearch' | 'nginx' | 'appPub' | 'appSetup', {
48
+ volumes: Record<'mariadb' | 'redis' | 'elasticsearch' | 'nginx' | 'appPub' | 'appSetup', {
49
49
  name: string
50
- opts?: {
50
+ opt?: {
51
51
  type: string
52
52
  device: string
53
53
  o: string
54
54
  }
55
55
  }>
56
- getContainers(): Record<'php' | 'sslTerminator' | 'nginx' | 'redis' | 'mysql' | 'elasticsearch' | 'varnish', {
56
+ getContainers(): Record<'php' | 'sslTerminator' | 'nginx' | 'redis' | 'mariadb' | 'elasticsearch' | 'varnish', {
57
57
  _: string
58
58
  ports: string[]
59
59
  healthCheck: {
@@ -88,6 +88,6 @@ export interface ListrContext {
88
88
  analytics: boolean
89
89
  useNonOverlappingPorts: boolean
90
90
  }
91
- mysqlConnection: mysql2.Connection
91
+ databaseConnection: mysql2.Connection
92
92
  isSetupUpgradeNeeded?: boolean
93
93
  }
@@ -1,14 +1,21 @@
1
1
  import { ListrContext } from './context';
2
2
 
3
3
  /* eslint-disable no-use-before-define */
4
- export interface ServiceWithVersion {
4
+ export interface ServiceWithImage {
5
5
  /**
6
6
  * Service version
7
+ *
8
+ * @deprecated
7
9
  */
8
10
  version: string
11
+
12
+ /**
13
+ * Service Docker image
14
+ */
15
+ image: string
9
16
  }
10
17
 
11
- export interface SSLTerminatorConfiguration extends ServiceWithVersion {
18
+ export interface SSLTerminatorConfiguration extends ServiceWithImage {
12
19
  /**
13
20
  * Configuration file location
14
21
  *
@@ -17,7 +24,7 @@ export interface SSLTerminatorConfiguration extends ServiceWithVersion {
17
24
  configTemplate: string
18
25
  }
19
26
 
20
- export interface NginxConfiguration extends ServiceWithVersion {
27
+ export interface NginxConfiguration extends ServiceWithImage {
21
28
  /**
22
29
  * Configuration file location
23
30
  *
@@ -26,7 +33,14 @@ export interface NginxConfiguration extends ServiceWithVersion {
26
33
  configTemplate: string
27
34
  }
28
35
 
29
- export interface VarnishConfiguration extends ServiceWithVersion {
36
+ export interface ElasticSearchConfiguration extends ServiceWithImage {
37
+ /**
38
+ * Environmental variables used for Elasticsearch container
39
+ */
40
+ env: Record<string, unknown>
41
+ }
42
+
43
+ export interface VarnishConfiguration extends ServiceWithImage {
30
44
  /**
31
45
  * Enable or disable Varnish in the project
32
46
  */
@@ -40,6 +54,13 @@ export interface VarnishConfiguration extends ServiceWithVersion {
40
54
  configTemplate: string
41
55
  }
42
56
 
57
+ export interface ComposerConfiguration {
58
+ /**
59
+ * Composer version
60
+ */
61
+ version: string
62
+ }
63
+
43
64
  export interface PHPExtensionInstallationInstruction {
44
65
  /**
45
66
  * Alternative name for extension
@@ -109,11 +130,6 @@ export interface PHPConfiguration {
109
130
  * Extensions for PHP
110
131
  */
111
132
  extensions: PHPExtensions
112
-
113
- /**
114
- * Disabled extension list
115
- */
116
- disabledExtensions?: string[]
117
133
  }
118
134
  export interface SSLConfiguration {
119
135
  /**
@@ -153,30 +169,25 @@ export interface CMAConfiguration {
153
169
  */
154
170
  nginx: NginxConfiguration
155
171
 
156
- /**
157
- * MySQL configuration
158
- */
159
- mysql: ServiceWithVersion
160
-
161
172
  /**
162
173
  * MariaDB configuration
163
174
  */
164
- mariadb: ServiceWithVersion
175
+ mariadb: ServiceWithImage
165
176
 
166
177
  /**
167
178
  * ElasticSearch configuration
168
179
  */
169
- elasticsearch: ServiceWithVersion
180
+ elasticsearch: ElasticSearchConfiguration
170
181
 
171
182
  /**
172
183
  * Redis configuration
173
184
  */
174
- redis: ServiceWithVersion
185
+ redis: ServiceWithImage
175
186
 
176
187
  /**
177
188
  * Composer configuration
178
189
  */
179
- composer: ServiceWithVersion
190
+ composer: ComposerConfiguration
180
191
 
181
192
  /**
182
193
  * Varnish configuration
@@ -222,8 +233,8 @@ export interface CMAConfiguration {
222
233
  }
223
234
  /**
224
235
  * Custom host for website base url
225
- * @default 'localhost'
226
- * */
236
+ * @default 'localhost'
237
+ */
227
238
  host: string
228
239
 
229
240
  /**
@@ -242,14 +253,4 @@ export interface CMAConfiguration {
242
253
  * If prefix is set to `false` docker container and volume names will only include folder name **which is not safe and not recommended**.
243
254
  */
244
255
  prefix: boolean
245
-
246
- /**
247
- * Non-overlapping ports config
248
- * @default false
249
- *
250
- * @deprecated Use global configuration file.
251
- * @description If set to `true` CMA will try retrieving others CMA projects port configuration
252
- * and will not use their ports for itself.
253
- */
254
- useNonOverlappingPorts: boolean
255
256
  }