forked from extern/bruno
feat: skipping telemetry in dev env
This commit is contained in:
parent
037013005f
commit
fa40685a6a
@ -2,7 +2,8 @@ module.exports = {
|
|||||||
reactStrictMode: false,
|
reactStrictMode: false,
|
||||||
publicRuntimeConfig: {
|
publicRuntimeConfig: {
|
||||||
CI: process.env.CI,
|
CI: process.env.CI,
|
||||||
PLAYWRIGHT: process.env.PLAYWRIGHT
|
PLAYWRIGHT: process.env.PLAYWRIGHT,
|
||||||
|
ENV: process.env.ENV
|
||||||
},
|
},
|
||||||
webpack: (config, { isServer }) => {
|
webpack: (config, { isServer }) => {
|
||||||
// Fixes npm packages that depend on `fs` module
|
// Fixes npm packages that depend on `fs` module
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"version": "0.3.0",
|
"version": "0.3.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "cross-env ENV=dev next dev",
|
||||||
"build": "next build && next export",
|
"build": "next build && next export",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
@ -61,6 +61,7 @@
|
|||||||
"@babel/preset-react": "^7.16.0",
|
"@babel/preset-react": "^7.16.0",
|
||||||
"@babel/runtime": "^7.16.3",
|
"@babel/runtime": "^7.16.3",
|
||||||
"babel-loader": "^8.2.3",
|
"babel-loader": "^8.2.3",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"css-loader": "^6.5.1",
|
"css-loader": "^6.5.1",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"html-loader": "^3.0.1",
|
"html-loader": "^3.0.1",
|
||||||
|
@ -23,7 +23,6 @@ const useCollectionTreeSync = () => {
|
|||||||
const { ipcRenderer } = window;
|
const { ipcRenderer } = window;
|
||||||
|
|
||||||
const _openCollection = (pathname, uid, name) => {
|
const _openCollection = (pathname, uid, name) => {
|
||||||
console.log(`collection uid: ${uid}, pathname: ${pathname}, name: ${name}`);
|
|
||||||
dispatch(openCollectionEvent(uid, pathname, name));
|
dispatch(openCollectionEvent(uid, pathname, name));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,6 +13,10 @@ const isPlaywrightTestRunning = () => {
|
|||||||
return publicRuntimeConfig.PLAYWRIGHT ? true : false;
|
return publicRuntimeConfig.PLAYWRIGHT ? true : false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isDevEnv = () => {
|
||||||
|
return publicRuntimeConfig.ENV === 'dev';
|
||||||
|
};
|
||||||
|
|
||||||
// Todo support chrome and firefox extension
|
// Todo support chrome and firefox extension
|
||||||
const getPlatform = () => {
|
const getPlatform = () => {
|
||||||
return isElectron() ? 'electron' : 'web';
|
return isElectron() ? 'electron' : 'web';
|
||||||
@ -43,6 +47,10 @@ const trackStart = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isDevEnv()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const trackingId = getAnonymousTrackingId();
|
const trackingId = getAnonymousTrackingId();
|
||||||
const platform = getPlatform();
|
const platform = getPlatform();
|
||||||
const client = getPosthogClient();
|
const client = getPosthogClient();
|
||||||
|
Loading…
Reference in New Issue
Block a user