From b20a7ed127135d3d5c6111c201d8609f3fa6bd2a Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Sat, 1 Jun 2019 19:17:30 -0700 Subject: [PATCH] Track JS errors on gatsbyjs.org with Sentry (#14492) /cc @Moocar --- docs/starters.yml | 2 -- www/gatsby-config.js | 12 ++++++++++++ www/package.json | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/starters.yml b/docs/starters.yml index 9d2e0c04e59d6..e7f71207d85c6 100644 --- a/docs/starters.yml +++ b/docs/starters.yml @@ -2718,8 +2718,6 @@ - Styling with SCSS - Offline support - Web App Manifest -- url: https://gatsby-starter-material-business-markdown.netlify.com/ - repo: https://github.com/ANOUN/gatsby-starter-material-business-markdown/ - url: https://gatsby-starter-anoun-1-markdown.netlify.com/ repo: https://github.com/ANOUN/gatsby-starter-anoun-1-markdown description: A clean, modern starter for businesses using Material Design Components diff --git a/www/gatsby-config.js b/www/gatsby-config.js index b3dc5f059296b..e92d2acc18974 100644 --- a/www/gatsby-config.js +++ b/www/gatsby-config.js @@ -1,4 +1,5 @@ const path = require(`path`) +const git = require(`git-rev-sync`) require(`dotenv`).config({ path: `.env.${process.env.NODE_ENV}`, }) @@ -214,6 +215,7 @@ module.exports = { { allMdx( sort: { order: DESC, fields: [frontmatter___date] } + limit: 10, filter: { frontmatter: { draft: { ne: true } } fileAbsolutePath: { regex: "/docs.blog/" } @@ -282,6 +284,16 @@ module.exports = { nodeTypes: [`StartersYaml`], }, }, + { + resolve: `gatsby-plugin-sentry`, + options: { + dsn: `https://2904ad31b1744c688ae19b627f51a5de@sentry.io/1471074`, + release: git.long(), + environment: process.env.NODE_ENV, + enabled: (() => + [`production`, `stage`].indexOf(process.env.NODE_ENV) !== -1)(), + }, + }, // `gatsby-plugin-subfont`, ].concat(dynamicPlugins), } diff --git a/www/package.json b/www/package.json index 74cc8bee64fe1..31de89a2cca07 100644 --- a/www/package.json +++ b/www/package.json @@ -34,6 +34,7 @@ "gatsby-plugin-nprogress": "^2.0.5", "gatsby-plugin-offline": "^2.0.22", "gatsby-plugin-react-helmet": "^3.0.0", + "gatsby-plugin-sentry": "^1.0.1", "gatsby-plugin-sharp": "^2.0.5", "gatsby-plugin-sitemap": "^2.0.1", "gatsby-plugin-twitter": "^2.0.5", @@ -57,6 +58,7 @@ "gatsby-transformer-screenshot": "^2.0.4", "gatsby-transformer-sharp": "^2.1.1", "gatsby-transformer-yaml": "^2.1.1", + "git-rev-sync": "^1.12.0", "graphql-request": "1.6.0", "gray-percentage": "^2.0.0", "hex2rgba": "^0.0.1",