@gem-sdk/pages 2.0.0 → 2.1.0
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.
|
@@ -5,16 +5,20 @@ var adapterShopify = require('@gem-sdk/adapter-shopify');
|
|
|
5
5
|
var parseJson = require('../helpers/parse-json.js');
|
|
6
6
|
|
|
7
7
|
const getBuilderProps = async (fetcher, shopifyFetcher)=>{
|
|
8
|
-
const [storeProperty, shopifyMeta] = await Promise.allSettled([
|
|
8
|
+
const [storeProperty, shopifyMeta, shopifyInfo] = await Promise.allSettled([
|
|
9
9
|
fetcher([
|
|
10
10
|
core.StorePropertyDocument
|
|
11
11
|
]),
|
|
12
12
|
shopifyFetcher([
|
|
13
13
|
adapterShopify.ShopMetaDocument
|
|
14
|
+
]),
|
|
15
|
+
fetcher([
|
|
16
|
+
core.ShopShopifyDocument
|
|
14
17
|
])
|
|
15
18
|
]);
|
|
16
19
|
const shopMeta = shopifyMeta.status === 'fulfilled' ? shopifyMeta.value : undefined;
|
|
17
20
|
const shopData = storeProperty.status === 'fulfilled' ? storeProperty.value : undefined;
|
|
21
|
+
const shopInfo = shopifyInfo.status === 'fulfilled' ? shopifyInfo.value : undefined;
|
|
18
22
|
const seo = shopMeta ? {
|
|
19
23
|
titleTemplate: `%s | ${shopMeta.shop.name}`,
|
|
20
24
|
defaultTitle: shopMeta?.shop.name,
|
|
@@ -34,7 +38,8 @@ const getBuilderProps = async (fetcher, shopifyFetcher)=>{
|
|
|
34
38
|
swr: {
|
|
35
39
|
revalidateOnMount: true
|
|
36
40
|
},
|
|
37
|
-
seo
|
|
41
|
+
seo,
|
|
42
|
+
timezone: shopInfo?.shopShopify?.timezone
|
|
38
43
|
});
|
|
39
44
|
};
|
|
40
45
|
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { StorePropertyDocument } from '@gem-sdk/core';
|
|
1
|
+
import { StorePropertyDocument, ShopShopifyDocument } from '@gem-sdk/core';
|
|
2
2
|
import { ShopMetaDocument } from '@gem-sdk/adapter-shopify';
|
|
3
3
|
import { serializableJson, parseJson } from '../helpers/parse-json.js';
|
|
4
4
|
|
|
5
5
|
const getBuilderProps = async (fetcher, shopifyFetcher)=>{
|
|
6
|
-
const [storeProperty, shopifyMeta] = await Promise.allSettled([
|
|
6
|
+
const [storeProperty, shopifyMeta, shopifyInfo] = await Promise.allSettled([
|
|
7
7
|
fetcher([
|
|
8
8
|
StorePropertyDocument
|
|
9
9
|
]),
|
|
10
10
|
shopifyFetcher([
|
|
11
11
|
ShopMetaDocument
|
|
12
|
+
]),
|
|
13
|
+
fetcher([
|
|
14
|
+
ShopShopifyDocument
|
|
12
15
|
])
|
|
13
16
|
]);
|
|
14
17
|
const shopMeta = shopifyMeta.status === 'fulfilled' ? shopifyMeta.value : undefined;
|
|
15
18
|
const shopData = storeProperty.status === 'fulfilled' ? storeProperty.value : undefined;
|
|
19
|
+
const shopInfo = shopifyInfo.status === 'fulfilled' ? shopifyInfo.value : undefined;
|
|
16
20
|
const seo = shopMeta ? {
|
|
17
21
|
titleTemplate: `%s | ${shopMeta.shop.name}`,
|
|
18
22
|
defaultTitle: shopMeta?.shop.name,
|
|
@@ -32,7 +36,8 @@ const getBuilderProps = async (fetcher, shopifyFetcher)=>{
|
|
|
32
36
|
swr: {
|
|
33
37
|
revalidateOnMount: true
|
|
34
38
|
},
|
|
35
|
-
seo
|
|
39
|
+
seo,
|
|
40
|
+
timezone: shopInfo?.shopShopify?.timezone
|
|
36
41
|
});
|
|
37
42
|
};
|
|
38
43
|
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"next": "latest"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@gem-sdk/core": "2.
|
|
30
|
-
"@gem-sdk/plugin-cookie-bar": "1.
|
|
31
|
-
"@gem-sdk/plugin-quick-view": "1.
|
|
32
|
-
"@gem-sdk/plugin-sticky-add-to-cart": "1.
|
|
29
|
+
"@gem-sdk/core": "2.1.0",
|
|
30
|
+
"@gem-sdk/plugin-cookie-bar": "2.1.0",
|
|
31
|
+
"@gem-sdk/plugin-quick-view": "2.1.0",
|
|
32
|
+
"@gem-sdk/plugin-sticky-add-to-cart": "2.1.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"next": ">=13"
|