Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve/dependency #340

Merged
merged 6 commits into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,34 @@
"postpackage": "node scripts/CreateDistribution.js"
},
"devDependencies": {
"@types/chrome": "^0.0.122",
"@types/chrome": "^0.0.159",
"@types/clipboard": "^2.0.1",
"@types/firefox-webext-browser": "^78.0.1",
"@types/firefox-webext-browser": "^82.0.1",
"@types/fs-extra": "^9.0.1",
"@types/node": "^14.0.5",
"@types/react": "^16.9.46",
"@types/react-dom": "^16.9.8",
"@types/react": "^17.0.27",
"@types/react-dom": "^17.0.9",
"@types/styled-components": "^5.1.2",
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.9.1",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"archiver": "^5.0.0",
"chalk": "^4.1.0",
"cross-env": "^7.0.2",
"eslint": "^6.6.0",
"eslint-config-react-app": "^5.2.1",
"eslint": "7",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-react": "^7.20.6",
"fs-extra": "^9.0.1",
"fs-extra": "^10.0.0",
"typescript": "^3.9.5"
},
"dependencies": {
"@ant-design/icons": "^4.1.0",
"@sentry/react": "^5.27.3",
"@sentry/react": "^6.13.3",
"antd": "^4.4.1",
"axios": "^0.19.2",
"copy-to-clipboard": "^3.3.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "^3.4.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"styled-components": "^5.1.1"
},
"browserslist": {
Expand Down
5 changes: 2 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const merge = (target: any, source: any) => {
};

type Runtime = "other" | "page" | "extension" | "unknown";
type Environment = "development" | "production" | "text";

export const getEnv = () => {
return window.__ENV__.NODE_ENV;
Expand All @@ -27,9 +26,9 @@ export const isDevelopment = () => getEnv() === "development";

export const getRuntime = (): Runtime => {
try {
if (typeof chrome == "undefined" && typeof browser == "undefined") {
if (typeof chrome === "undefined" && typeof browser === "undefined") {
return "other";
} else if (chrome.runtime.id || browser.runtime.id ) {
} else if (chrome?.runtime?.id || browser?.runtime?.id) {
return "extension";
} else {
return "page";
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"module": "esnext",
"jsx": "preserve",
"jsx": "react",
"lib": [
"DOM",
"DOM.Iterable",
Expand All @@ -17,7 +17,8 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
"noEmit": true,
"noFallthroughCasesInSwitch": true
},
"include": [
"src/**/*"
Expand Down
Loading