diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98704d9ec..2b63a81b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,6 +59,8 @@ jobs: js-build: name: Frontend Build runs-on: ubuntu-latest + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup diff --git a/assets/package-lock.json b/assets/package-lock.json index 15ff9d15e..c7a266300 100644 --- a/assets/package-lock.json +++ b/assets/package-lock.json @@ -35,6 +35,7 @@ "@babel/preset-typescript": "^7.14.5", "@eslint/js": "^9.1.1", "@jest/globals": "^29.7.0", + "@sentry/webpack-plugin": "^2.22.2", "@svgr/webpack": "^5.5.0", "@types/lodash": "^4.17.4", "@types/react": "^17.0.14", @@ -3574,9 +3575,10 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "dev": true, - "license": "MIT" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", @@ -3657,6 +3659,307 @@ "node": ">=10" } }, + "node_modules/@sentry/babel-plugin-component-annotate": { + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.22.2.tgz", + "integrity": "sha512-6kFAHGcs0npIC4HTt4ULs8uOfEucvMI7VW4hoyk17jhRaW8CbxzxfWCfIeRbDkE8pYwnARaq83tu025Hrk2zgA==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@sentry/bundler-plugin-core": { + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.22.2.tgz", + "integrity": "sha512-TwEEW4FeEJ5Mamp4fGnktfVjzN77KAW0xFQsEPuxZtOAPG17zX/PGvdyRX/TE1jkZWhTzqUDIdgzqlNLjyEnUw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.18.5", + "@sentry/babel-plugin-component-annotate": "2.22.2", + "@sentry/cli": "^2.33.1", + "dotenv": "^16.3.1", + "find-up": "^5.0.0", + "glob": "^9.3.2", + "magic-string": "0.30.8", + "unplugin": "1.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@sentry/bundler-plugin-core/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@sentry/bundler-plugin-core/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@sentry/bundler-plugin-core/node_modules/glob": { + "version": "9.3.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", + "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "minimatch": "^8.0.2", + "minipass": "^4.2.4", + "path-scurry": "^1.6.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@sentry/bundler-plugin-core/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@sentry/bundler-plugin-core/node_modules/minimatch": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", + "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@sentry/bundler-plugin-core/node_modules/minipass": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz", + "integrity": "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/bundler-plugin-core/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@sentry/bundler-plugin-core/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@sentry/cli": { + "version": "2.33.1", + "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.33.1.tgz", + "integrity": "sha512-dUlZ4EFh98VFRPJ+f6OW3JEYQ7VvqGNMa0AMcmvk07ePNeK/GicAWmSQE4ZfJTTl80ul6HZw1kY01fGQOQlVRA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.7", + "progress": "^2.0.3", + "proxy-from-env": "^1.1.0", + "which": "^2.0.2" + }, + "bin": { + "sentry-cli": "bin/sentry-cli" + }, + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@sentry/cli-darwin": "2.33.1", + "@sentry/cli-linux-arm": "2.33.1", + "@sentry/cli-linux-arm64": "2.33.1", + "@sentry/cli-linux-i686": "2.33.1", + "@sentry/cli-linux-x64": "2.33.1", + "@sentry/cli-win32-i686": "2.33.1", + "@sentry/cli-win32-x64": "2.33.1" + } + }, + "node_modules/@sentry/cli-darwin": { + "version": "2.33.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.33.1.tgz", + "integrity": "sha512-+4/VIx/E1L2hChj5nGf5MHyEPHUNHJ/HoG5RY+B+vyEutGily1c1+DM2bum7RbD0xs6wKLIyup5F02guzSzG8A==", + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-arm": { + "version": "2.33.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.33.1.tgz", + "integrity": "sha512-zbxEvQju+tgNvzTOt635le4kS/Fbm2XC2RtYbCTs034Vb8xjrAxLnK0z1bQnStUV8BkeBHtsNVrG+NSQDym2wg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-arm64": { + "version": "2.33.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.33.1.tgz", + "integrity": "sha512-DbGV56PRKOLsAZJX27Jt2uZ11QfQEMmWB4cIvxkKcFVE+LJP4MVA+MGGRUL6p+Bs1R9ZUuGbpKGtj0JiG6CoXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-i686": { + "version": "2.33.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.33.1.tgz", + "integrity": "sha512-g2LS4oPXkPWOfKWukKzYp4FnXVRRSwBxhuQ9eSw2peeb58ZIObr4YKGOA/8HJRGkooBJIKGaAR2mH2Pk1TKaiA==", + "cpu": [ + "x86", + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-x64": { + "version": "2.33.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.33.1.tgz", + "integrity": "sha512-IV3dcYV/ZcvO+VGu9U6kuxSdbsV2kzxaBwWUQxtzxJ+cOa7J8Hn1t0koKGtU53JVZNBa06qJWIcqgl4/pCuKIg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-win32-i686": { + "version": "2.33.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.33.1.tgz", + "integrity": "sha512-F7cJySvkpzIu7fnLKNHYwBzZYYwlhoDbAUnaFX0UZCN+5DNp/5LwTp37a5TWOsmCaHMZT4i9IO4SIsnNw16/zQ==", + "cpu": [ + "x86", + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-win32-x64": { + "version": "2.33.1", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.33.1.tgz", + "integrity": "sha512-8VyRoJqtb2uQ8/bFRKNuACYZt7r+Xx0k2wXRGTyH05lCjAiVIXn7DiS2BxHFty7M1QEWUCMNsb/UC/x/Cu2wuA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/webpack-plugin": { + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/@sentry/webpack-plugin/-/webpack-plugin-2.22.2.tgz", + "integrity": "sha512-zVPs3BLClHM8jIjr2FChux16GMLel8OjXBjd4V8/r1Kf2fGiQDXo72GxsrW8AdVlIHgQApLzubuQ2kpcFVK4Sw==", + "dev": true, + "dependencies": { + "@sentry/bundler-plugin-core": "2.22.2", + "unplugin": "1.0.1", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "webpack": ">=4.40.0" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "dev": true, @@ -4681,6 +4984,18 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/aggregate-error": { "version": "3.1.0", "dev": true, @@ -6969,6 +7284,18 @@ "url": "https://github.com/fb55/domutils?sponsor=1" } }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/duplexify": { "version": "3.7.1", "dev": true, @@ -8764,6 +9091,19 @@ "dev": true, "license": "MIT" }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/human-signals": { "version": "2.1.0", "dev": true, @@ -11272,6 +11612,18 @@ "node": ">=10" } }, + "node_modules/magic-string": { + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/make-dir": { "version": "3.1.0", "dev": true, @@ -11714,6 +12066,26 @@ "dev": true, "license": "MIT" }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/node-int64": { "version": "0.4.0", "dev": true, @@ -12205,6 +12577,37 @@ "dev": true, "license": "MIT" }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true + }, + "node_modules/path-scurry/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/path-to-regexp": { "version": "1.8.0", "license": "MIT", @@ -12893,6 +13296,15 @@ "dev": true, "license": "MIT" }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/promise-inflight": { "version": "1.0.1", "dev": true, @@ -12919,6 +13331,12 @@ "react-is": "^16.13.1" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, "node_modules/prr": { "version": "1.0.1", "dev": true, @@ -15101,6 +15519,12 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, "node_modules/tree-kill": { "version": "1.2.2", "dev": true, @@ -15490,6 +15914,27 @@ "imurmurhash": "^0.1.4" } }, + "node_modules/unplugin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.0.1.tgz", + "integrity": "sha512-aqrHaVBWW1JVKBHmGo33T5TxeL0qWzfvjWokObHA9bYmN7eNDkwOxmLjhioHl9878qDFMAaT51XNroRyuz7WxA==", + "dev": true, + "dependencies": { + "acorn": "^8.8.1", + "chokidar": "^3.5.3", + "webpack-sources": "^3.2.3", + "webpack-virtual-modules": "^0.5.0" + } + }, + "node_modules/unplugin/node_modules/webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/unquote": { "version": "1.1.1", "dev": true, @@ -15650,6 +16095,19 @@ "dev": true, "license": "ISC" }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-to-istanbul": { "version": "9.2.0", "dev": true, @@ -15945,6 +16403,12 @@ "version": "1.0.3", "license": "MIT" }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, "node_modules/webpack": { "version": "4.47.0", "dev": true, @@ -16064,6 +16528,12 @@ "node": ">=0.10.0" } }, + "node_modules/webpack-virtual-modules": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.5.0.tgz", + "integrity": "sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==", + "dev": true + }, "node_modules/webpack/node_modules/acorn": { "version": "6.4.2", "dev": true, @@ -16463,6 +16933,16 @@ "dev": true, "license": "MIT" }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "dev": true, diff --git a/assets/package.json b/assets/package.json index 26fd09a9b..6dfb11aa7 100644 --- a/assets/package.json +++ b/assets/package.json @@ -47,6 +47,7 @@ "@babel/preset-typescript": "^7.14.5", "@eslint/js": "^9.1.1", "@jest/globals": "^29.7.0", + "@sentry/webpack-plugin": "^2.22.2", "@svgr/webpack": "^5.5.0", "@types/lodash": "^4.17.4", "@types/react": "^17.0.14", diff --git a/assets/webpack.config.js b/assets/webpack.config.js index 3e6abab8a..3e8c2951c 100644 --- a/assets/webpack.config.js +++ b/assets/webpack.config.js @@ -6,6 +6,7 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const TerserPlugin = require("terser-webpack-plugin"); const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); const CopyWebpackPlugin = require("copy-webpack-plugin"); +const { sentryWebpackPlugin } = require("@sentry/webpack-plugin"); const common_export_body = { resolve: { @@ -26,8 +27,8 @@ const common_export_body = { devtool: "source-map", optimization: { minimizer: [ - new TerserPlugin({ cache: true, parallel: true, sourceMap: false }), - new OptimizeCSSAssetsPlugin({}), + new TerserPlugin(), + new OptimizeCSSAssetsPlugin(), ], }, }; @@ -66,158 +67,174 @@ const common_babel_loader_plugins = [ "@babel/plugin-proposal-do-expressions", ]; -module.exports = () => [ - { - ...common_export_body, - entry: { - polyfills: "./src/polyfills.js", - bus_eink: "./src/apps/bus_eink.tsx", - gl_eink_single: "./src/apps/gl_eink_single.tsx", - gl_eink_double: "./src/apps/gl_eink_double.tsx", - solari: "./src/apps/solari.tsx", - dup: "./src/apps/dup.tsx", - admin: "./src/apps/admin.tsx", - bus_eink_v2: "./src/apps/v2/bus_eink.tsx", - gl_eink_v2: "./src/apps/v2/gl_eink.tsx", - busway_v2: "./src/apps/v2/busway.tsx", - solari_large_v2: "./src/apps/v2/solari_large.tsx", - dup_v2: "./src/apps/v2/dup.tsx", - bus_shelter_v2: "./src/apps/v2/bus_shelter.tsx", - pre_fare_v2: "./src/apps/v2/pre_fare.tsx", - triptych_v2: "./src/apps/v2/triptych.tsx", - }, - module: { - rules: [ - { - test: /\.ts(x?)$/, - exclude: /node_modules/, - use: { - loader: "babel-loader", - options: { - presets: [ - ["@babel/preset-env", { targets: "> 0.25%" }], - "@babel/preset-react", - "@babel/preset-typescript", - ], - plugins: common_babel_loader_plugins, - }, - }, - }, - ...common_rules, - { - test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/, - use: [ - { - loader: "file-loader", +module.exports = (env, argv) => { + // Upload source maps to Sentry for prod builds. Must be the last plugin. + const appendPlugins = + argv.mode == "production" + ? [ + sentryWebpackPlugin({ + authToken: env.SENTRY_AUTH_TOKEN, + org: "mbtace", + project: "screens", + }), + ] + : []; + + return [ + { + ...common_export_body, + entry: { + polyfills: "./src/polyfills.js", + bus_eink: "./src/apps/bus_eink.tsx", + gl_eink_single: "./src/apps/gl_eink_single.tsx", + gl_eink_double: "./src/apps/gl_eink_double.tsx", + solari: "./src/apps/solari.tsx", + dup: "./src/apps/dup.tsx", + admin: "./src/apps/admin.tsx", + bus_eink_v2: "./src/apps/v2/bus_eink.tsx", + gl_eink_v2: "./src/apps/v2/gl_eink.tsx", + busway_v2: "./src/apps/v2/busway.tsx", + solari_large_v2: "./src/apps/v2/solari_large.tsx", + dup_v2: "./src/apps/v2/dup.tsx", + bus_shelter_v2: "./src/apps/v2/bus_shelter.tsx", + pre_fare_v2: "./src/apps/v2/pre_fare.tsx", + triptych_v2: "./src/apps/v2/triptych.tsx", + }, + module: { + rules: [ + { + test: /\.ts(x?)$/, + exclude: /node_modules/, + use: { + loader: "babel-loader", options: { - name: "[name].[ext]", - outputPath: "fonts/", - publicPath: "../fonts/", - useRelativePaths: true, + presets: [ + ["@babel/preset-env", { targets: "> 0.25%" }], + "@babel/preset-react", + "@babel/preset-typescript", + ], + plugins: common_babel_loader_plugins, }, }, - ], - }, - { - test: /\.(png|jpe?g|gif|webp)$/i, - use: [ - { - loader: "file-loader", - options: { - name: "/[folder]/[name].[ext]", - useRelativePaths: true, + }, + ...common_rules, + { + test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/, + use: [ + { + loader: "file-loader", + options: { + name: "[name].[ext]", + outputPath: "fonts/", + publicPath: "../fonts/", + useRelativePaths: true, + }, }, - }, - ], - }, + ], + }, + { + test: /\.(png|jpe?g|gif|webp)$/i, + use: [ + { + loader: "file-loader", + options: { + name: "/[folder]/[name].[ext]", + useRelativePaths: true, + }, + }, + ], + }, + ], + }, + plugins: [ + new MiniCssExtractPlugin({ filename: "../css/[name].css" }), + new CopyWebpackPlugin({ patterns: [{ from: "static/", to: "../" }] }), + ...appendPlugins, ], }, - plugins: [ - new MiniCssExtractPlugin({ filename: "../css/[name].css" }), - new CopyWebpackPlugin({ patterns: [{ from: "static/", to: "../" }] }), - ], - }, - { - ...common_export_body, - entry: { - packaged_triptych_polyfills: "./src/polyfills.js", - packaged_triptych_v2: "./src/apps/v2/triptych.tsx", - }, - module: { - rules: [ - { - test: /\.ts(x?)$/, - exclude: /node_modules/, - use: { - loader: "babel-loader", - options: { - presets: [ - // When no targets are specified: Babel will assume you are targeting the oldest browsers possible. - [ - "@babel/preset-env", - { - corejs: { version: 3, proposals: true }, - useBuiltIns: "usage", - }, + { + ...common_export_body, + entry: { + packaged_triptych_polyfills: "./src/polyfills.js", + packaged_triptych_v2: "./src/apps/v2/triptych.tsx", + }, + module: { + rules: [ + { + test: /\.ts(x?)$/, + exclude: /node_modules/, + use: { + loader: "babel-loader", + options: { + presets: [ + // When no targets are specified: Babel will assume you are targeting the oldest browsers possible. + [ + "@babel/preset-env", + { + corejs: { version: 3, proposals: true }, + useBuiltIns: "usage", + }, + ], + "@babel/preset-react", + "@babel/preset-typescript", ], - "@babel/preset-react", - "@babel/preset-typescript", - ], - plugins: common_babel_loader_plugins, + plugins: common_babel_loader_plugins, + }, }, }, - }, - ...common_rules, - { - test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/, - use: [ - { - loader: "file-loader", - options: { - name: "[name].[ext]", - outputPath: "fonts/", - publicPath: "fonts/", - useRelativePaths: true, + ...common_rules, + { + test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/, + use: [ + { + loader: "file-loader", + options: { + name: "[name].[ext]", + outputPath: "fonts/", + publicPath: "fonts/", + useRelativePaths: true, + }, }, - }, - ], - }, - { - test: /\.(png|jpe?g|gif)$/i, - use: [ - { - loader: "file-loader", + ], + }, + { + test: /\.(png|jpe?g|gif)$/i, + use: [ + { + loader: "file-loader", - options: { - name: "[name].[ext]", - outputPath: "triptych_images/", - publicPath: "triptych_images/", - useRelativePaths: true, + options: { + name: "[name].[ext]", + outputPath: "triptych_images/", + publicPath: "triptych_images/", + useRelativePaths: true, + }, }, - }, - ], - }, - { - test: /\.(webp)$/i, - use: [ - { - loader: "file-loader", - options: { - name: "/[folder]/[name].[ext]", - outputPath: "triptych_images/triptych_psas/", - publicPath: "triptych_images/triptych_psas/", - useRelativePaths: true, + ], + }, + { + test: /\.(webp)$/i, + use: [ + { + loader: "file-loader", + options: { + name: "/[folder]/[name].[ext]", + outputPath: "triptych_images/triptych_psas/", + publicPath: "triptych_images/triptych_psas/", + useRelativePaths: true, + }, }, - }, - ], - }, + ], + }, + ], + }, + plugins: [ + new MiniCssExtractPlugin({ filename: "../css/[name].css" }), + new CopyWebpackPlugin({ + patterns: [{ from: "static/fonts", to: "../fonts" }], + }), + ...appendPlugins, ], }, - plugins: [ - new MiniCssExtractPlugin({ filename: "../css/[name].css" }), - new CopyWebpackPlugin({ - patterns: [{ from: "static/fonts", to: "../fonts" }], - }), - ], - }, -]; + ]; +}; diff --git a/upload_assets.sh b/upload_assets.sh deleted file mode 100755 index 260899713..000000000 --- a/upload_assets.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -e -x - -BUILD_TAG=${1} -TEMP_DIR=$(mktemp -d) -STATIC_DIR=$TEMP_DIR/static - -pushd "$TEMP_DIR" > /dev/null -sh -c "docker run --rm ${BUILD_TAG} tar -c /root/priv/static" | tar -x --strip-components 2 -popd > /dev/null - -# upload source maps to Sentry -SENTRY_RELEASE=$(npx @sentry/cli releases propose-version) -npx @sentry/cli releases files "$SENTRY_RELEASE" upload-sourcemaps "$STATIC_DIR/js"