-
Notifications
You must be signed in to change notification settings - Fork 86
/
environment.ts
24 lines (21 loc) · 804 Bytes
/
environment.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable global-require */
/* eslint-disable import/no-dynamic-require */
import chalk from 'chalk';
import path from 'path';
export const environment = {
WEB_VERSION: require(path.resolve(__dirname, '../../packages/magic-sdk/package.json')).version,
REACT_NATIVE_VERSION: require(path.resolve(__dirname, '../../packages/@magic-sdk/react-native/package.json')).version,
};
export function logEnvironment() {
console.log(
Object.entries(environment)
.map(([key, value]) => {
return chalk`{rgb(0,255,255) ${key}}{gray :} ${value}`;
})
.reduce((prev, next, i) => {
if (i === 0) return chalk`${prev} {gray -} ${next}`;
return chalk`${prev}\n {gray -} ${next}`;
}, ''),
);
}