From d5ecb9b7fe94c8c1bb1a7f9129da5e6bd1c3d991 Mon Sep 17 00:00:00 2001 From: Benny Date: Sun, 26 Nov 2023 12:36:04 +0100 Subject: [PATCH] remove sentry, update deps --- .env.example | 4 +- README.md | 4 +- package.json | 10 ++--- scripts/sentry.js | 44 ---------------------- src/index.tsx | 7 ---- yarn.lock | 95 +++++++++++++---------------------------------- 6 files changed, 32 insertions(+), 132 deletions(-) delete mode 100644 scripts/sentry.js diff --git a/.env.example b/.env.example index 8c5e595..0d9a627 100644 --- a/.env.example +++ b/.env.example @@ -2,9 +2,7 @@ REACT_APP_DOMAIN=xxx # google analytic 追踪 ID REACT_APP_GA=xxx -# Sentry DSN -REACT_APP_SENTRY_DSN=xxx # 是否生成 sourcemap GENERATE_SOURCEMAP=true # adsense pub id,如果不想显示广告请注释这一行 -REACT_APP_ADSENSE=xxx \ No newline at end of file +REACT_APP_ADSENSE=xxx diff --git a/README.md b/README.md index 352b125..f52fa3a 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,6 @@ yarn REACT_APP_DOMAIN=xxx # google analytic 追踪 ID REACT_APP_GA=xxx - # Sentry DSN - REACT_APP_SENTRY_DSN=xxx # 是否生成 sourcemap GENERATE_SOURCEMAP=true # adsense @@ -37,4 +35,4 @@ yarn ## TODO -- [ ] 升级到MUI v5 \ No newline at end of file +- [ ] 升级到MUI v5 diff --git a/package.json b/package.json index 2de625b..dc42e8e 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,11 @@ "@material-ui/icons": "^4.11.3", "@material-ui/lab": "^4.0.0-alpha.61", "@reduxjs/toolkit": "^1.8.5", - "@sentry/browser": "^7.49.0", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^12.1.5", - "@testing-library/user-event": "^12.1.10", + "@testing-library/user-event": "^14.5.1", "@types/jest": "^29.5.1", - "@types/node": "^20.4.9", + "@types/node": "^20.10.0", "@types/pangu": "^4.0.0", "@types/react": "^17.0.0", "@types/react-dom": "^17.0.0", @@ -24,7 +23,7 @@ "bowser": "^2.11.0", "clsx": "^1.2.1", "compressorjs": "^1.2.0", - "dayjs": "^1.11.7", + "dayjs": "^1.11.10", "formik": "^2.2.9", "http-proxy-middleware": "^2.0.0", "js-cookie": "^3.0.1", @@ -59,7 +58,7 @@ "@types/webpack-env": "^1.18.0", "cz-conventional-changelog": "3.3.0", "eslint-config-airbnb-typescript": "^12.3.1", - "eslint-config-prettier": "^8.3.0", + "eslint-config-prettier": "^9.0.0", "fs-extra": "^10.1.0", "prettier": "^2.3.1" }, @@ -67,7 +66,6 @@ "analyze": "source-map-explorer 'build/static/js/*.js'", "start": "react-scripts start", "build": "react-scripts build", - "releaseSentry": "(export REACT_APP_SENTRY_RELEASE=$(git rev-parse --short HEAD); react-scripts build && node scripts/sentry.js)", "release": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" diff --git a/scripts/sentry.js b/scripts/sentry.js deleted file mode 100644 index 0868d94..0000000 --- a/scripts/sentry.js +++ /dev/null @@ -1,44 +0,0 @@ -const SentryCli = require("@sentry/cli"); -const path = require("path"); -const fs = require("fs"); -const fse = require("fs-extra"); - -async function createReleaseAndUpload() { - const release = process.env.REACT_APP_SENTRY_RELEASE; - if (!release) { - console.warn("REACT_APP_SENTRY_RELEASE is not set"); - - return; - } - - const cli = new SentryCli(); - - try { - console.log("Creating sentry release " + release); - await cli.releases.new(release); - - console.log("Uploading source maps"); - await cli.releases.uploadSourceMaps(release, { - include: ["build/static/js"], - urlPrefix: "~/static/js", - rewrite: false, - }); - - console.log("Set commit integration"); - await cli.releases.setCommits(release, { auto: true }); - - console.log("Finalizing release"); - await cli.releases.finalize(release); - - console.log("Remove source map"); - const sourcemapPath = path.resolve("./build/static/js"); - const mapList = fs.readdirSync(sourcemapPath).filter((file) => /js.map$/.test(file)); - mapList.forEach((file) => { - fse.removeSync(path.resolve(sourcemapPath, file)); - }); - } catch (e) { - console.error("Source maps uploading failed:", e); - } -} - -createReleaseAndUpload(); diff --git a/src/index.tsx b/src/index.tsx index dec7f14..eed6395 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,16 +1,9 @@ import * as React from "react"; import ReactDOM from "react-dom"; -import * as Sentry from "@sentry/browser"; import App from "./app/App"; import { SplashScreenProvider } from "./layout"; -if (process.env.NODE_ENV !== "development" && process.env.REACT_APP_SENTRY_RELEASE) { - Sentry.init({ - dsn: process.env.REACT_APP_SENTRY_DSN, - }); -} - ReactDOM.render( diff --git a/yarn.lock b/yarn.lock index ee28261..3c36fba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2246,59 +2246,6 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@sentry-internal/tracing@7.49.0": - version "7.49.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.49.0.tgz#f589de565370884b9a13f82c98463de9b2d25dcd" - integrity sha512-ESh3+ZneQk/3HESTUmIPNrW5GVPu/HrRJU+eAJJto74vm+6vP7zDn2YV2gJ1w18O/37nc7W/bVCgZJlhZ3cwew== - dependencies: - "@sentry/core" "7.49.0" - "@sentry/types" "7.49.0" - "@sentry/utils" "7.49.0" - tslib "^1.9.3" - -"@sentry/browser@^7.49.0": - version "7.49.0" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.49.0.tgz#5ce1cdb8d883c129d9a4e313c08a54c5ada4661b" - integrity sha512-x2DekKkQoY7/dhBzE4J25mdQ978NtPBTVQb+uZqlF/t5mp4K44TAszmPqy8lC/CmVHkp7qcpRGSCIzeboUL4KA== - dependencies: - "@sentry-internal/tracing" "7.49.0" - "@sentry/core" "7.49.0" - "@sentry/replay" "7.49.0" - "@sentry/types" "7.49.0" - "@sentry/utils" "7.49.0" - tslib "^1.9.3" - -"@sentry/core@7.49.0": - version "7.49.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.49.0.tgz#340d059f5efeff1a3359fef66d0c8e34e79ac992" - integrity sha512-AlSnCYgfEbvK8pkNluUkmdW/cD9UpvOVCa+ERQswXNRkAv5aDGCL6Ihv6fnIajE++BYuwZh0+HwZUBVKTFzoZg== - dependencies: - "@sentry/types" "7.49.0" - "@sentry/utils" "7.49.0" - tslib "^1.9.3" - -"@sentry/replay@7.49.0": - version "7.49.0" - resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.49.0.tgz#c7f16bc3ca0c5911f641738f8894eb596c5da00d" - integrity sha512-UY3bHoBDPOu4Dpq3m3oxNjLrq09NiFVYUfrTN4QOq1Am2SA04XbuCj/YZ+jNVy/NrFtoz9cTovK6oQbNw53jog== - dependencies: - "@sentry/core" "7.49.0" - "@sentry/types" "7.49.0" - "@sentry/utils" "7.49.0" - -"@sentry/types@7.49.0": - version "7.49.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.49.0.tgz#2c217091e13dc373682f5be2e9b5baed9d2ae695" - integrity sha512-9yXXh7iv76+O6h2ONUVx0wsL1auqJFWez62mTjWk4350SgMmWp/zUkBxnVXhmcYqscz/CepC+Loz9vITLXtgxg== - -"@sentry/utils@7.49.0": - version "7.49.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.49.0.tgz#b1b3a2af52067dd27e660c7c3062a31cdf4b94f9" - integrity sha512-JdC9yGnOgev4ISJVwmIoFsk8Zx0psDZJAj2DV7x4wMZsO6QK+YjC7G3mUED/S5D5lsrkBZ/3uvQQhr8DQI4UcQ== - dependencies: - "@sentry/types" "7.49.0" - tslib "^1.9.3" - "@sinclair/typebox@^0.24.1": version "0.24.31" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.31.tgz#3f3752bc830a9daa4a0185573f0bf870089c3222" @@ -2527,12 +2474,10 @@ "@testing-library/dom" "^8.0.0" "@types/react-dom" "<18.0.0" -"@testing-library/user-event@^12.1.10": - version "12.8.3" - resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-12.8.3.tgz#1aa3ed4b9f79340a1e1836bc7f57c501e838704a" - integrity sha512-IR0iWbFkgd56Bu5ZI/ej8yQwrkCv8Qydx6RzwbKz9faXazR/+5tvYKsZQgyXJiwgpcva127YO6JcWy7YlCfofQ== - dependencies: - "@babel/runtime" "^7.12.5" +"@testing-library/user-event@^14.5.1": + version "14.5.1" + resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.5.1.tgz#27337d72046d5236b32fd977edee3f74c71d332f" + integrity sha512-UCcUKrUYGj7ClomOo2SpNVvx4/fkd/2BbIHDCle8A0ax+P3bU7yJwDBDrS6ZwdTMARWTGODX1hEsCcO+7beJjg== "@tootallnate/once@1": version "1.1.2" @@ -2695,11 +2640,18 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== -"@types/node@*", "@types/node@^20.4.9": +"@types/node@*": version "20.4.9" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.9.tgz#c7164e0f8d3f12dfae336af0b1f7fdec8c6b204f" integrity sha512-8e2HYcg7ohnTUbHk8focoklEQYvemQmu9M/f43DZVx43kHn0tE3BY/6gSDxS7k0SprtS0NHvj+L80cGLnoOUcQ== +"@types/node@^20.10.0": + version "20.10.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.0.tgz#16ddf9c0a72b832ec4fcce35b8249cf149214617" + integrity sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ== + dependencies: + undici-types "~5.26.4" + "@types/normalize-package-data@^2.4.0": version "2.4.1" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" @@ -5255,10 +5207,10 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -dayjs@^1.11.7: - version "1.11.7" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2" - integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ== +dayjs@^1.11.10: + version "1.11.10" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.10.tgz#68acea85317a6e164457d6d6947564029a6a16a0" + integrity sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ== debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.9: version "2.6.9" @@ -5900,10 +5852,10 @@ eslint-config-airbnb@^18.2.0: object.assign "^4.1.2" object.entries "^1.1.2" -eslint-config-prettier@^8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" - integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== +eslint-config-prettier@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz#eb25485946dd0c66cd216a46232dc05451518d1f" + integrity sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw== eslint-config-react-app@^6.0.0: version "6.0.0" @@ -13103,7 +13055,7 @@ tslib@2.0.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e" integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ== -tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: +tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== @@ -13234,6 +13186,11 @@ unbox-primitive@^1.0.1: has-symbols "^1.0.2" which-boxed-primitive "^1.0.2" +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + unicode-canonical-property-names-ecmascript@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818"