@strapi/plugin-sentry 4.0.0-beta.2 → 4.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,14 @@
1
1
  import { prefixPluginTranslations } from '@strapi/helper-plugin';
2
2
  import pluginPkg from '../../package.json';
3
3
  import pluginId from './pluginId';
4
- import pluginLogo from './assets/images/logo.svg';
5
4
 
6
- const pluginDescription = pluginPkg.strapi.description || pluginPkg.description;
7
- const icon = pluginPkg.strapi.icon;
8
5
  const name = pluginPkg.strapi.name;
9
6
 
10
7
  export default {
11
8
  register(app) {
12
9
  app.registerPlugin({
13
- description: pluginDescription,
14
- icon,
15
10
  id: pluginId,
16
- isReady: true,
17
- isRequired: pluginPkg.strapi.required || false,
18
11
  name,
19
- pluginLogo,
20
12
  });
21
13
  },
22
14
  bootstrap() {},
package/package.json CHANGED
@@ -1,33 +1,32 @@
1
1
  {
2
2
  "name": "@strapi/plugin-sentry",
3
- "version": "4.0.0-beta.2",
3
+ "version": "4.0.0-beta.20",
4
4
  "description": "Send Strapi error events to Sentry",
5
- "strapi": {
6
- "name": "sentry",
7
- "displayName": "Sentry",
8
- "icon": "plug",
9
- "description": "sentry.plugin.description",
10
- "kind": "plugin"
11
- },
12
- "dependencies": {
13
- "@sentry/node": "6.7.1"
14
- },
5
+ "license": "SEE LICENSE IN LICENSE",
15
6
  "author": {
16
- "name": "Strapi team",
7
+ "name": "Strapi Solutions SAS",
17
8
  "email": "hi@strapi.io",
18
9
  "url": "https://strapi.io"
19
10
  },
20
11
  "maintainers": [
21
12
  {
22
- "name": "Strapi team",
13
+ "name": "Strapi Solutions SAS",
23
14
  "email": "hi@strapi.io",
24
15
  "url": "https://strapi.io"
25
16
  }
26
17
  ],
18
+ "dependencies": {
19
+ "@sentry/node": "6.7.1"
20
+ },
27
21
  "engines": {
28
22
  "node": ">=12.x.x <=16.x.x",
29
23
  "npm": ">=6.0.0"
30
24
  },
31
- "license": "SEE LICENSE IN LICENSE",
32
- "gitHead": "020680cbb38b6281b3e16df264b9388a087b2b49"
25
+ "strapi": {
26
+ "name": "sentry",
27
+ "displayName": "Sentry",
28
+ "description": "Send Strapi error events to Sentry.",
29
+ "kind": "plugin"
30
+ },
31
+ "gitHead": "b4993dab9f6dbc583709167f459b6f00e0b4baa6"
33
32
  }
@@ -1,9 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ const initSentryMiddleware = require('./middlewares/sentry');
4
+
3
5
  module.exports = async ({ strapi }) => {
4
6
  // Initialize the Sentry service exposed by this plugin
5
- strapi
6
- .plugin('sentry')
7
- .service('sentry')
8
- .init();
7
+ initSentryMiddleware({ strapi });
9
8
  };
package/server/index.js CHANGED
@@ -1,12 +1,10 @@
1
1
  'use strict';
2
2
 
3
- const register = require('./register');
4
3
  const bootstrap = require('./bootstrap');
5
4
  const services = require('./services');
6
5
  const config = require('./config');
7
6
 
8
7
  module.exports = () => ({
9
- register,
10
8
  bootstrap,
11
9
  config,
12
10
  services,
@@ -5,8 +5,14 @@
5
5
  * @param {{ strapi: import('@strapi/strapi').Strapi }}
6
6
  */
7
7
  module.exports = ({ strapi }) => {
8
- const sentry = strapi.plugin('sentry').service('sentry');
9
- sentry.init();
8
+ const sentryService = strapi.plugin('sentry').service('sentry');
9
+ sentryService.init();
10
+ const sentry = sentryService.getInstance();
11
+
12
+ if (!sentry) {
13
+ // initialization failed
14
+ return;
15
+ }
10
16
 
11
17
  strapi.server.use(async (ctx, next) => {
12
18
  try {
@@ -1 +0,0 @@
1
- <svg class="css-15xgryy e10nushx5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72 66" width="400" height="367"><path d="M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z" fill="#362d59" transform="translate(11, 11)"></path></svg>
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- const registerSentryMiddleware = require('./middlewares/sentry');
4
-
5
- /**
6
- * Register sentry plugin
7
- * @param {{ strapi: import('@strapi/strapi').Strapi }}
8
- */
9
- module.exports = ({ strapi }) => {
10
- registerSentryMiddleware({ strapi });
11
- };