Skip to content

Commit 3343609

Browse files
author
Lopes
committed
2 parents 24e46f1 + 23926fb commit 3343609

File tree

4 files changed

+11
-62
lines changed

4 files changed

+11
-62
lines changed

.release-it.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"publish": false
1111
},
1212
"hooks": {
13-
"after:bump": "npm run manifest && npm run build && npm run beforerelease && npm run compress",
13+
"after:bump": "npm run manifest && export REACT_APP_IS_RELEASE=true && npm run build && npm run compress",
1414
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
1515
}
1616
}

scripts/beforeRelease.js

-27
This file was deleted.

scripts/utils.js

-22
This file was deleted.

src/lib/tracker.js

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
import Web from '@sap_oss/automated-usage-tracking-tool'
22

33
const getCredentials = () => {
4-
const REACT_APP_TRACKER_API_KEY_PROD = '4_wjgLxoy9B1oRh3zpBulDhw'
5-
const REACT_APP_TRACKER_DATA_CENTER_PROD = 'eu1'
6-
const REACT_APP_TRACKER_API_KEY_DEV = process.env.REACT_APP_TRACKER_API_KEY_DEV
7-
const REACT_APP_TRACKER_DATA_CENTER_DEV = process.env.REACT_APP_TRACKER_DATA_CENTER_DEV
8-
9-
// This variable is replaced to "false" on "beforeRelease.js" script
10-
const isDev = '{{REPLACED_IN_RELEASE}}'
11-
12-
if (!isDev) {
13-
return { apiKey: REACT_APP_TRACKER_API_KEY_PROD, dataCenter: REACT_APP_TRACKER_DATA_CENTER_PROD }
4+
const IS_RELEASE = process.env.REACT_APP_IS_RELEASE
5+
const TRACKER_API_KEY_PROD = '4_wjgLxoy9B1oRh3zpBulDhw'
6+
const TRACKER_DATA_CENTER_PROD = 'eu1'
7+
const TRACKER_API_KEY_DEV = process.env.REACT_APP_TRACKER_API_KEY_DEV
8+
const TRACKER_DATA_CENTER_DEV = process.env.REACT_APP_TRACKER_DATA_CENTER_DEV
9+
10+
if (IS_RELEASE) {
11+
return { apiKey: TRACKER_API_KEY_PROD, dataCenter: TRACKER_DATA_CENTER_PROD }
1412
}
1513

16-
if (!REACT_APP_TRACKER_API_KEY_DEV || !REACT_APP_TRACKER_DATA_CENTER_DEV) {
14+
if (!TRACKER_API_KEY_DEV || !TRACKER_DATA_CENTER_DEV) {
1715
return null
1816
}
1917

20-
return { apiKey: REACT_APP_TRACKER_API_KEY_DEV, dataCenter: REACT_APP_TRACKER_DATA_CENTER_DEV }
18+
return { apiKey: TRACKER_API_KEY_DEV, dataCenter: TRACKER_DATA_CENTER_DEV }
2119
}
2220

2321
export const initTracker = () => {

0 commit comments

Comments
 (0)