diff --git a/.eslintrc b/.eslintrc index 1231b1b..efa2db5 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,6 +5,7 @@ ], "globals": { "mermaid": true, - "$": true + "$": true, + "process": true } } diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 26d295e..56a839f 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -36,6 +36,8 @@ {{ partial "script.html" "js/jquery.js" }} + {{ partial "script.html" "js/sentry.js" }} + {{ if eq .Params.layout "flickr" }} {{ partial "script_async.html" "js/lightgallery.js" }} {{ end }} diff --git a/package-lock.json b/package-lock.json index 84a3d9d..adc2028 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,63 @@ "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.8.2.tgz", "integrity": "sha512-E4fDUF4fbu9AxKpaQQqCN3XBnNzb/5e0Gvd9OaQsYkK574LVI57v/EqqPfIm/mC7jYbxaPNrhvT5AF+Yzwyizg==" }, + "@sentry/browser": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-5.4.0.tgz", + "integrity": "sha512-lsGJqryHXrnWRkdahnep0m+m65zyMJGCmB2T8pGS+SFcSXdx94TaK4PiPaCl6XUCT5ejuQUHoXsEBmK/3S6beA==", + "requires": { + "@sentry/core": "5.4.0", + "@sentry/types": "5.4.0", + "@sentry/utils": "5.4.0", + "tslib": "^1.9.3" + } + }, + "@sentry/core": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.4.0.tgz", + "integrity": "sha512-luIJPftVnrW0ZKqs9W6YCpzKZVbOgQv8Ae7KB0Acsvqeoqjtx4zHHfVfu5VPkfhrOYN3NsM1IpApXtSdMiJCfg==", + "requires": { + "@sentry/hub": "5.4.0", + "@sentry/minimal": "5.4.0", + "@sentry/types": "5.4.0", + "@sentry/utils": "5.4.0", + "tslib": "^1.9.3" + } + }, + "@sentry/hub": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.4.0.tgz", + "integrity": "sha512-X0iLNcouXcLWzuOJz2YjTn1E11b7pzcG98/iFTHW3AKPjnJNt92XRpjsDI2iT8+ODUDiFqaFmACSn2oZK80WGQ==", + "requires": { + "@sentry/types": "5.4.0", + "@sentry/utils": "5.4.0", + "tslib": "^1.9.3" + } + }, + "@sentry/minimal": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.4.0.tgz", + "integrity": "sha512-MuOLavHHTXXWKyfTcwqpjhkdYlJDyOfjfcf+b/d38+8cs064rpNScxTZyYj2KKxNGcCqDgUsY175fNp/D1fyMw==", + "requires": { + "@sentry/hub": "5.4.0", + "@sentry/types": "5.4.0", + "tslib": "^1.9.3" + } + }, + "@sentry/types": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.4.0.tgz", + "integrity": "sha512-R8IFM77rzp0ngR/XQFLsXUK2uE7jLf21MsU9mpUwLtxcJp8rs7I77HgzA5MEerdG9Sbxw5RaLq9wO7noHGfUmQ==" + }, + "@sentry/utils": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.4.0.tgz", + "integrity": "sha512-NlYMAyiI9iIItLDxJ17tLMtuu7261t93tcOGSMdDQZlmryR6ZAMenbCKTf5MrpA2iHfX84gyfmr67lh8uSHkPg==", + "requires": { + "@sentry/types": "5.4.0", + "tslib": "^1.9.3" + } + }, "JSONStream": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", @@ -1165,6 +1222,16 @@ "minimalistic-crypto-utils": "^1.0.0" } }, + "envify": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/envify/-/envify-4.1.0.tgz", + "integrity": "sha512-IKRVVoAYr4pIx4yIWNsz9mOsboxlNXiu7TNBnem/K/uTHdkyzXWDzHCK7UTolqBbgaBz0tQHsD3YNls0uIIjiw==", + "dev": true, + "requires": { + "esprima": "^4.0.0", + "through": "~2.3.4" + } + }, "es-abstract": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", @@ -3428,7 +3495,7 @@ "dependencies": { "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { @@ -3479,6 +3546,11 @@ "dev": true, "optional": true }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" + }, "tty-browserify": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", diff --git a/package.json b/package.json index 42ea600..686ddd5 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "author": "Jake Howard ", "devDependencies": { "browserify": "16.2.3", + "envify": "4.1.0", "eslint-config-dabapps": "4.0.0", "markdown-spellcheck": "1.3.1", "sass-lint": "1.13.1", @@ -15,6 +16,7 @@ }, "dependencies": { "@fortawesome/fontawesome-free": "5.8.2", + "@sentry/browser": "5.4.0", "bootstrap": "4.3.1", "clipboard": "2.0.4", "jquery": "3.4.1", diff --git a/scripts/build.sh b/scripts/build.sh index 8605756..d0b86b2 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -21,6 +21,8 @@ cp $BASEDIR/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js $STATIC_BUILD cp $BASEDIR/node_modules/mermaid/dist/mermaid.min.js $STATIC_BUILD/js/mermaid.js browserify $STATIC_SRC/js/index.js -o $STATIC_BUILD/js/app.js +browserify $STATIC_SRC/js/sentry.js -t envify -o $STATIC_BUILD/js/sentry.js + cp -r $STATIC_SRC/scss $STATIC_BUILD/scss hugo gen chromastyles --style=monokai > $STATIC_BUILD/css/highlight.css diff --git a/static/src/js/sentry.js b/static/src/js/sentry.js new file mode 100644 index 0000000..7810f5e --- /dev/null +++ b/static/src/js/sentry.js @@ -0,0 +1,3 @@ +'use strict'; + +require('@sentry/browser').init({ dsn: process.env.SENTRY_DSN });