@commercetools-frontend/application-cli 1.0.1 → 1.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/application-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Internal CLI to manage Merchant Center application deployments across various environments.",
5
5
  "keywords": [
6
6
  "commercetools",
@@ -20,18 +20,18 @@
20
20
  "README.md"
21
21
  ],
22
22
  "dependencies": {
23
- "@commercetools-frontend/application-config": "21.3.4",
23
+ "@commercetools-frontend/application-config": "21.20.4",
24
24
  "@manypkg/find-root": "1.1.0",
25
25
  "@manypkg/get-packages": "1.1.3",
26
- "cosmiconfig": "7.0.1",
27
- "dotenv": "16.0.0",
26
+ "cosmiconfig": "8.0.0",
27
+ "dotenv": "16.0.3",
28
28
  "execa": "6.1.0",
29
29
  "listr": "0.14.3",
30
30
  "listr-verbose-renderer": "0.6.0",
31
31
  "lodash.lowerfirst": "4.3.1",
32
32
  "mri": "1.2.0",
33
33
  "node-fetch": "2.6.7",
34
- "prettier": "2.6.2",
34
+ "prettier": "2.8.0",
35
35
  "prompts": "2.4.2",
36
36
  "rcfile": "1.0.3"
37
37
  },
@@ -124,32 +124,42 @@ async function compileEnvironmentApplicationIndexes({
124
124
  applicationName: cliFlags['application-name'],
125
125
  });
126
126
 
127
+ const environmentVariablesForCompilation = {
128
+ ...loadDotenvFiles({
129
+ dotenvPath: paths.dotenvPath,
130
+ cloudEnvironment,
131
+ }),
132
+ // The trailing slash is important to indicate to the CSP directive that all the resources
133
+ // under that path should be allowed.
134
+ MC_CDN_URL: `${cdnUrl}/`,
135
+ ...(cliFlags['mc-url']
136
+ ? {
137
+ MC_URL: cliFlags['mc-url'],
138
+ }
139
+ : {}),
140
+ ...(cliFlags['mc-api-url']
141
+ ? {
142
+ MC_API_URL: cliFlags['mc-api-url'],
143
+ }
144
+ : {}),
145
+ // Will be used by the Application Kit for Sentry and exposed on `window.app.revision`.
146
+ REVISION: cliFlags['build-revision'],
147
+ };
148
+
149
+ /// Sentry and GTM is disabled on branch deployments
150
+ if (cliFlags['pr-number']) {
151
+ process.env.TRACKING_SENTRY = null;
152
+ process.env.TRACKING_GTM = null;
153
+ environmentVariablesForCompilation.TRACKING_SENTRY = null;
154
+ environmentVariablesForCompilation.TRACKING_GTM = null;
155
+ }
156
+
127
157
  // Compile the application using the loaded environment values
128
158
  const compileResult = await execa('mc-scripts', ['compile-html'], {
129
159
  encoding: 'utf8',
130
160
  preferLocal: true,
131
161
  extendEnv: true,
132
- env: {
133
- ...loadDotenvFiles({
134
- dotenvPath: paths.dotenvPath,
135
- cloudEnvironment,
136
- }),
137
- // The trailing slash is important to indicate to the CSP directive that all the resources
138
- // under that path should be allowed.
139
- MC_CDN_URL: `${cdnUrl}/`,
140
- ...(cliFlags['mc-url']
141
- ? {
142
- MC_URL: cliFlags['mc-url'],
143
- }
144
- : {}),
145
- ...(cliFlags['mc-api-url']
146
- ? {
147
- MC_API_URL: cliFlags['mc-api-url'],
148
- }
149
- : {}),
150
- // Will be used by the Application Kit for Sentry and exposed on `window.app.revision`.
151
- REVISION: cliFlags['build-revision'],
152
- },
162
+ env: environmentVariablesForCompilation,
153
163
  });
154
164
 
155
165
  if (compileResult.failed) {
@@ -45,16 +45,6 @@ gsutil \\
45
45
  cp -z json \\
46
46
  ${assetsPath}/menu.json \\
47
47
  ${bucketUrl}
48
-
49
- if [[ -f "${assetsPath}/public/licenses.csv" ]]; then
50
- echo "Uploading licenses.csv to bucket ${bucketUrl}"
51
- gsutil \\
52
- -h "Content-Type: text/csv" \\
53
- -h "Cache-Control: private, max-age=0, no-transform" \\
54
- cp -z csv \\
55
- ${assetsPath}/public/licenses.csv \\
56
- ${bucketUrl}
57
- fi
58
48
  `;
59
49
 
60
50
  return uploadScriptContent;