@gem-sdk/pages 1.63.16 → 1.63.19
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.
|
@@ -10,6 +10,7 @@ var getFallback = require('../helpers/get-fallback.js');
|
|
|
10
10
|
var normalize = require('../helpers/normalize.js');
|
|
11
11
|
var parseJson = require('../helpers/parse-json.js');
|
|
12
12
|
var customFonts = require('../custom-fonts.js');
|
|
13
|
+
var sentry = require('../helpers/sentry.js');
|
|
13
14
|
|
|
14
15
|
const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
15
16
|
try {
|
|
@@ -31,6 +32,10 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
31
32
|
])
|
|
32
33
|
]);
|
|
33
34
|
if (theme.status === 'rejected') {
|
|
35
|
+
sentry.sentryCaptureException('PreviewThemePageDocument', JSON.stringify(theme), {
|
|
36
|
+
variables,
|
|
37
|
+
theme
|
|
38
|
+
});
|
|
34
39
|
throw new Error(theme.reason?.[0]);
|
|
35
40
|
}
|
|
36
41
|
const dataBuilder = theme.value.previewThemePage;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var nextjs = require('@sentry/nextjs');
|
|
4
|
+
|
|
5
|
+
const sentryCaptureException = (funcName, message, data, options)=>{
|
|
6
|
+
nextjs.withScope((scope)=>{
|
|
7
|
+
scope.setLevel(options?.level ?? 'log');
|
|
8
|
+
if (options?.tag) {
|
|
9
|
+
scope.setTag(options?.tag.key, options?.tag.value);
|
|
10
|
+
}
|
|
11
|
+
scope.setExtra('function', funcName);
|
|
12
|
+
scope.setExtra('data', JSON.stringify(data));
|
|
13
|
+
nextjs.captureMessage(`${funcName}: ${message}`);
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.sentryCaptureException = sentryCaptureException;
|
|
@@ -8,6 +8,7 @@ import { getFallbackV2 } from '../helpers/get-fallback.js';
|
|
|
8
8
|
import { parseBuilderTemplateV2 } from '../helpers/normalize.js';
|
|
9
9
|
import { parseJson, serializableJson } from '../helpers/parse-json.js';
|
|
10
10
|
import { getCustomFonts } from '../custom-fonts.js';
|
|
11
|
+
import { sentryCaptureException } from '../helpers/sentry.js';
|
|
11
12
|
|
|
12
13
|
const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
13
14
|
try {
|
|
@@ -29,6 +30,10 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
29
30
|
])
|
|
30
31
|
]);
|
|
31
32
|
if (theme.status === 'rejected') {
|
|
33
|
+
sentryCaptureException('PreviewThemePageDocument', JSON.stringify(theme), {
|
|
34
|
+
variables,
|
|
35
|
+
theme
|
|
36
|
+
});
|
|
32
37
|
throw new Error(theme.reason?.[0]);
|
|
33
38
|
}
|
|
34
39
|
const dataBuilder = theme.value.previewThemePage;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { withScope, captureMessage } from '@sentry/nextjs';
|
|
2
|
+
|
|
3
|
+
const sentryCaptureException = (funcName, message, data, options)=>{
|
|
4
|
+
withScope((scope)=>{
|
|
5
|
+
scope.setLevel(options?.level ?? 'log');
|
|
6
|
+
if (options?.tag) {
|
|
7
|
+
scope.setTag(options?.tag.key, options?.tag.value);
|
|
8
|
+
}
|
|
9
|
+
scope.setExtra('function', funcName);
|
|
10
|
+
scope.setExtra('data', JSON.stringify(data));
|
|
11
|
+
captureMessage(`${funcName}: ${message}`);
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { sentryCaptureException };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "1.63.
|
|
3
|
+
"version": "1.63.19",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"next": "latest"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@gem-sdk/core": "1.63.
|
|
29
|
+
"@gem-sdk/core": "1.63.17",
|
|
30
30
|
"@gem-sdk/plugin-cookie-bar": "1.58.0",
|
|
31
31
|
"@gem-sdk/plugin-quick-view": "1.58.0",
|
|
32
32
|
"@gem-sdk/plugin-sticky-add-to-cart": "1.58.0"
|