@scandipwa/magento-scripts 2.0.3-alpha.0 → 2.0.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.
@@ -24,8 +24,7 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
24
24
  elasticsearch,
25
25
  mariadb,
26
26
  varnish,
27
- maildev,
28
- newRelic
27
+ maildev
29
28
  } = configuration;
30
29
 
31
30
  const php = getPhpConfig(overridenConfiguration, baseConfig);
@@ -348,22 +347,6 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
348
347
  };
349
348
  }
350
349
 
351
- if (newRelic.enabled) {
352
- dockerConfig.newRelicPHPDaemon = {
353
- _: 'New Relic PHP daemon',
354
- ports: [],
355
- name: `${ prefix }_newrelic-php-daemon`,
356
- network: isDockerDesktop ? network.name : 'host',
357
- image: 'newrelic/php-daemon',
358
- mountVolumes: [
359
- '/var/run/docker.sock:/var/run/docker.sock',
360
- '/:/host:ro',
361
- `${path.join(process.cwd(), 'newrelic-infra.yml')}:/etc/newrelic-infra.yml`
362
- ],
363
- capAdd: 'SYS_PTRACE'
364
- };
365
- }
366
-
367
350
  return dockerConfig;
368
351
  };
369
352
 
@@ -4,13 +4,7 @@ const semver = require('semver');
4
4
  const { deepmerge } = require('../../util/deepmerge');
5
5
 
6
6
  const defaultCMAConfig = {
7
- prefix: true,
8
- configuration: {
9
- newRelic: {
10
- enabled: false,
11
- agentVersion: '10.2.0.314'
12
- }
13
- }
7
+ prefix: true
14
8
  };
15
9
 
16
10
  const magentoVersions = fs.readdirSync(__dirname, {
@@ -128,23 +128,6 @@ const buildDockerFileInstructions = async (ctx, { image, tag }) => {
128
128
  PATH: `${ imagePathEnv.split('=').pop() }:${ magentoBinDir }:${vendorBinDir }`
129
129
  });
130
130
 
131
- if (ctx.config.overridenConfiguration.configuration.newRelic.enabled) {
132
- const { agentVersion, licenseKey } = ctx.config.overridenConfiguration.configuration.newRelic;
133
-
134
- dockerFileInstructions
135
- .run('apk add --no-cache gcompat')
136
- // eslint-disable-next-line max-len
137
- .run(`curl -L https://download.newrelic.com/php_agent/archive/${agentVersion}/newrelic-php5-${agentVersion}-linux.tar.gz | tar -C /tmp -zx \
138
- && export NR_INSTALL_USE_CP_NOT_LN=1 \
139
- && export NR_INSTALL_SILENT=1 \
140
- && /tmp/newrelic-php5-${agentVersion}-linux/newrelic-install install \
141
- && rm -rf /tmp/newrelic-php5-* /tmp/nrinstall*`)
142
- .run(`sed -i -e "s/REPLACE_WITH_REAL_KEY/${licenseKey}/" \
143
- -e "s/newrelic.appname[[:space:]]=[[:space:]].*/newrelic.appname=\\"${ctx.config.baseConfig.prefix}\\"/" \
144
- -e '\\$anewrelic.daemon.address="${ ctx.isDockerDesktop ? 'host.docker.internal' : 'localhost' }:31339"' \
145
- \\$PHP_INI_DIR/conf.d/newrelic.ini`);
146
- }
147
-
148
131
  return dockerFileInstructions;
149
132
  };
150
133
 
@@ -1,6 +1,5 @@
1
1
  const path = require('path');
2
2
  const os = require('os');
3
- const envPhpToJson = require('../../util/env-php-json');
4
3
  const getJsonfileData = require('../../util/get-jsonfile-data');
5
4
  const pathExists = require('../../util/path-exists');
6
5
  const { containerApi } = require('../docker/containers');
@@ -36,23 +35,8 @@ const updateEnvPHP = () => ({
36
35
  if (await pathExists(composerLockPath)) {
37
36
  const composerLockData = await getJsonfileData(composerLockPath);
38
37
 
39
- if (composerLockData.packages.some(({ name }) => name === 'scandipwa/persisted-query')) {
40
- if (typeof ctx.CSAThemeInstalled !== 'boolean') {
41
- ctx.CSAThemeInstalled = true;
42
- }
43
-
44
- const envPhp = await envPhpToJson(ctx);
45
-
46
- const persistedQueryConfig = envPhp.cache && envPhp.cache['persisted-query'];
47
-
48
- if (
49
- persistedQueryConfig
50
- && persistedQueryConfig.redis
51
- && (persistedQueryConfig.redis.port !== `${ ctx.ports.redis }`
52
- || persistedQueryConfig.redis.host === hostMachine)
53
- ) {
54
- SETUP_PQ = '';
55
- }
38
+ if (!composerLockData.packages.some(({ name }) => name === 'scandipwa/persisted-query')) {
39
+ SETUP_PQ = '';
56
40
  }
57
41
  }
58
42
 
@@ -111,12 +111,12 @@ const elasticsearchConfigurationSchema = Joi.object({
111
111
  * @type {Joi.ObjectSchema<import('../../typings').ComposerConfiguration>}
112
112
  */
113
113
  const composerConfigurationSchema = Joi.object({
114
- version: Joi.string().optional().custom((value, helpers) => {
114
+ version: Joi.string().optional().custom((value) => {
115
115
  if (['1', '2'].includes(value)) {
116
116
  return undefined;
117
117
  }
118
118
 
119
- return versionValidator(value, helpers);
119
+ return versionValidator(value);
120
120
  }),
121
121
  plugins: Joi.object()
122
122
  .pattern(
@@ -130,21 +130,6 @@ const composerConfigurationSchema = Joi.object({
130
130
  )
131
131
  });
132
132
 
133
- /**
134
- * @type {Joi.ObjectSchema<import('../../typings').NewRelicConfiguration>}
135
- */
136
- const newRelicConfigurationSchema = Joi.object({
137
- enabled: Joi.boolean().optional(),
138
- agentVersion: Joi.string().optional(),
139
- licenseKey: Joi.string().optional()
140
- }).custom((d, helpers) => {
141
- if (d.enabled && !d.licenseKey) {
142
- return helpers.message('when newRelic is enabled license key is required!');
143
- }
144
-
145
- return true;
146
- });
147
-
148
133
  /**
149
134
  * @type {Joi.ObjectSchema<import('../../typings').CMAConfiguration['configuration']>}
150
135
  */
@@ -157,8 +142,7 @@ const configurationSchema = Joi.object({
157
142
  composer: composerConfigurationSchema.optional(),
158
143
  varnish: varnishConfigurationSchema.optional(),
159
144
  sslTerminator: nginxConfigurationSchema.optional(),
160
- maildev: serviceConfigurationSchema.optional(),
161
- newRelic: newRelicConfigurationSchema.optional()
145
+ maildev: serviceConfigurationSchema.optional()
162
146
  });
163
147
 
164
148
  /**
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.0.3-alpha.0",
6
+ "version": "2.0.3",
7
7
  "main": "./index.js",
8
8
  "types": "./typings/index.d.ts",
9
9
  "license": "OSL-3.0",
@@ -54,5 +54,5 @@
54
54
  "mysql",
55
55
  "scandipwa"
56
56
  ],
57
- "gitHead": "c9e600b48c4f6d2dd612d234aaf839f8cbcf1734"
57
+ "gitHead": "21913f16c2eb9b18f7e35d0e19df0c30373044fc"
58
58
  }
@@ -199,23 +199,6 @@ export interface SSLConfiguration {
199
199
  ssl_certificate_key: string
200
200
  }
201
201
 
202
- export interface NewRelicConfiguration {
203
- /**
204
- * Enables or disables New Relic in application
205
- */
206
- enabled: boolean
207
-
208
- /**
209
- * New Relic Agent version
210
- */
211
- agentVersion?: string
212
-
213
- /**
214
- * New Relic license key
215
- */
216
- licenseKey?: string
217
- }
218
-
219
202
  export interface CMAConfiguration {
220
203
  /**
221
204
  * Services configuration
@@ -260,11 +243,6 @@ export interface CMAConfiguration {
260
243
  * SSL Terminator configuration
261
244
  */
262
245
  sslTerminator: SSLTerminatorConfiguration
263
-
264
- /**
265
- * New Relic configuration
266
- */
267
- newRelic: NewRelicConfiguration
268
246
  }
269
247
  /**
270
248
  * Magento configuration