@shopify/hydrogen 2023.1.0-alpha.1 → 2023.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.
- package/dist/development/{chunk-5MQMAYYE.js → chunk-ZH7BOJHC.js} +1 -1
- package/dist/development/chunk-ZH7BOJHC.js.map +1 -0
- package/dist/development/index.cjs +156 -75
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +139 -58
- package/dist/development/index.js.map +1 -1
- package/dist/development/log-seo-tags-EH7EHJZ4.js +3 -0
- package/dist/development/{log-seo-tags-7SUOHHPI.js.map → log-seo-tags-EH7EHJZ4.js.map} +0 -0
- package/dist/production/chunk-JXANKGQN.js +5 -0
- package/dist/production/chunk-JXANKGQN.js.map +1 -0
- package/dist/production/index.cjs +36 -36
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.d.ts +70 -172
- package/dist/production/index.js +8 -8
- package/dist/production/index.js.map +1 -1
- package/dist/production/log-seo-tags-GYSQ3BE2.js +3 -0
- package/dist/production/{log-seo-tags-3MQL2PTY.js.map → log-seo-tags-GYSQ3BE2.js.map} +0 -0
- package/dist/storefront-api-types.d.ts +121 -2
- package/dist/storefront.schema.json +1 -1
- package/package.json +6 -12
- package/dist/development/chunk-5MQMAYYE.js.map +0 -1
- package/dist/development/log-seo-tags-7SUOHHPI.js +0 -3
- package/dist/production/chunk-2226DACX.js +0 -5
- package/dist/production/chunk-2226DACX.js.map +0 -1
- package/dist/production/log-seo-tags-3MQL2PTY.js +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/seo/log-seo-tags.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEe,SAAR,OAAwB,EAAC,SAAQ,GAAsC;AAC5E,aAAW,QAAQ;AAEnB,SAAO;AACT;AAEO,SAAS,WAAW,UAAiC;AAC1D,QAAM,QAAQ;AACd,QAAM,SACJ;AAEF,UAAQ,IAAI,GAAG;AACf,UAAQ,IAAI,mBAAmB,GAAG,QAAQ;AAC1C,UAAQ,IAAI,GAAG;AAEf,WAAS,QAAQ,CAAC,QAAQ;AACxB,QAAI,IAAI,QAAQ,UAAU;AACxB,cAAQ,IAAI,qBAAgB,KAAK;AAEjC,UAAI,IAAI,UAAU;AAChB,YAAI;AACF,kBAAQ,MAAM,KAAK,MAAM,IAAI,QAAQ,GAAG,CAAC,QAAQ,SAAS,CAAC;AAAA,QAC7D,QAAE;AACA,kBAAQ,IAAI,IAAI,QAAQ;AAAA,QAC1B;AAAA,MACF;AAAA,IACF,OAAO;AACL,cAAQ,IAAI,YAAO,IAAI,QAAQ,KAAK;AAEpC,UAAI,IAAI,UAAU;AAChB,YAAI,OAAO,IAAI,aAAa,UAAU;AACpC,kBAAQ,IAAI,UAAK,IAAI,UAAU;AAAA,QACjC,OAAO;AACL,cAAI;AACF,mBAAO,QAAQ,KAAK,MAAM,IAAI,QAAQ,CAAC,EAAE;AAAA,cAAI,CAAC,CAAC,KAAK,GAAG,MACrD,QAAQ,IAAI,UAAK,KAAK;AAAA,YACxB;AAAA,UACF,QAAE;AACA,oBAAQ,IAAI,IAAI,QAAQ;AAAA,UAC1B;AAAA,QACF;AAAA,MACF;AAEA,aAAO,QAAQ,IAAI,KAAK,EAAE;AAAA,QAAI,CAAC,CAAC,KAAK,GAAG,MACtC,QAAQ,IAAI,UAAK,cAAS,KAAK;AAAA,MACjC;AAAA,IACF;AACA,YAAQ,IAAI,GAAG;AAAA,EACjB,CAAC;AACH","sourcesContent":["import {CustomHeadTagObject} from './generate-seo-tags';\n\nexport default function Logger({headTags}: {headTags: CustomHeadTagObject[]}) {\n logSeoTags(headTags);\n\n return null;\n}\n\nexport function logSeoTags(headTags: CustomHeadTagObject[]) {\n const style = 'text-transform: uppercase;';\n const style2 =\n 'text-transform: uppercase; font-weight: bold; text-transform: uppercase;font-weight: bold';\n\n console.log(' ');\n console.log('%cSEO Meta Tags', `${style2}`);\n console.log(' ');\n\n headTags.forEach((tag) => {\n if (tag.tag === 'script') {\n console.log(`%c• JSON LD `, style);\n\n if (tag.children) {\n try {\n console.table(JSON.parse(tag.children), ['name', 'content']);\n } catch {\n console.log(tag.children);\n }\n }\n } else {\n console.log(`%c• ${tag.tag} `, style);\n\n if (tag.children) {\n if (typeof tag.children === 'string') {\n console.log(`↳ ${tag.children}`);\n } else {\n try {\n Object.entries(JSON.parse(tag.children)).map(([key, val]) =>\n console.log(`↳ ${val}`),\n );\n } catch {\n console.log(tag.children);\n }\n }\n }\n\n Object.entries(tag.props).map(([key, val]) =>\n console.log(`↳ ${key} → ${val}`),\n );\n }\n console.log(' ');\n });\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var hydrogenReact = require('@shopify/hydrogen-react');
|
|
4
4
|
var serverRuntime = require('@remix-run/server-runtime');
|
|
5
5
|
var react = require('@remix-run/react');
|
|
6
6
|
|
|
@@ -2162,6 +2162,7 @@ async function fetchWithServerCache(url, requestInit, {
|
|
|
2162
2162
|
// src/constants.ts
|
|
2163
2163
|
var STOREFRONT_REQUEST_GROUP_ID_HEADER = "Custom-Storefront-Request-Group-ID";
|
|
2164
2164
|
var STOREFRONT_API_BUYER_IP_HEADER = "Shopify-Storefront-Buyer-IP";
|
|
2165
|
+
var STOREFRONT_ID_HEADER = "Shopify-Storefront-Id";
|
|
2165
2166
|
|
|
2166
2167
|
// src/utils/uuid.ts
|
|
2167
2168
|
function generateUUID() {
|
|
@@ -2201,12 +2202,14 @@ var isMutationRE = /(^|}\s)mutation[\s({]/im;
|
|
|
2201
2202
|
function minifyQuery(string) {
|
|
2202
2203
|
return string.replace(/\s*#.*$/gm, "").replace(/\s+/gm, " ").trim();
|
|
2203
2204
|
}
|
|
2205
|
+
var defaultI18n = { language: "EN", country: "US" };
|
|
2204
2206
|
function createStorefrontClient({
|
|
2205
2207
|
cache,
|
|
2206
2208
|
waitUntil,
|
|
2207
2209
|
buyerIp,
|
|
2208
|
-
i18n
|
|
2209
|
-
requestGroupId
|
|
2210
|
+
i18n,
|
|
2211
|
+
requestGroupId,
|
|
2212
|
+
storefrontId,
|
|
2210
2213
|
...clientOptions
|
|
2211
2214
|
}) {
|
|
2212
2215
|
if (!cache) {
|
|
@@ -2219,12 +2222,14 @@ function createStorefrontClient({
|
|
|
2219
2222
|
getPrivateTokenHeaders,
|
|
2220
2223
|
getStorefrontApiUrl,
|
|
2221
2224
|
getShopifyDomain
|
|
2222
|
-
} =
|
|
2225
|
+
} = hydrogenReact.createStorefrontClient(clientOptions);
|
|
2223
2226
|
const getHeaders = clientOptions.privateStorefrontToken ? getPrivateTokenHeaders : getPublicTokenHeaders;
|
|
2224
2227
|
const defaultHeaders = getHeaders({ contentType: "json" });
|
|
2225
|
-
defaultHeaders[STOREFRONT_REQUEST_GROUP_ID_HEADER] = requestGroupId;
|
|
2228
|
+
defaultHeaders[STOREFRONT_REQUEST_GROUP_ID_HEADER] = requestGroupId || generateUUID();
|
|
2226
2229
|
if (buyerIp)
|
|
2227
2230
|
defaultHeaders[STOREFRONT_API_BUYER_IP_HEADER] = buyerIp;
|
|
2231
|
+
if (storefrontId)
|
|
2232
|
+
defaultHeaders[STOREFRONT_ID_HEADER] = storefrontId;
|
|
2228
2233
|
async function fetchStorefrontApi({
|
|
2229
2234
|
query,
|
|
2230
2235
|
mutation,
|
|
@@ -2298,7 +2303,7 @@ function createStorefrontClient({
|
|
|
2298
2303
|
getShopifyDomain,
|
|
2299
2304
|
getApiUrl: getStorefrontApiUrl,
|
|
2300
2305
|
isApiError: isStorefrontApiError,
|
|
2301
|
-
i18n:
|
|
2306
|
+
i18n: i18n ?? defaultI18n
|
|
2302
2307
|
}
|
|
2303
2308
|
};
|
|
2304
2309
|
}
|
|
@@ -2525,81 +2530,143 @@ function graphiqlLoader({ context } = {}) {
|
|
|
2525
2530
|
var import_react = __toESM(require_react(), 1);
|
|
2526
2531
|
|
|
2527
2532
|
// src/seo/generate-seo-tags.ts
|
|
2528
|
-
|
|
2533
|
+
var ERROR_PREFIX = "Error in SEO input: ";
|
|
2534
|
+
var schema = {
|
|
2535
|
+
title: {
|
|
2536
|
+
validate: (value) => {
|
|
2537
|
+
if (typeof value === "string" && value.length > 120) {
|
|
2538
|
+
throw new Error(
|
|
2539
|
+
ERROR_PREFIX.concat(
|
|
2540
|
+
"`title` should not be longer than 120 characters"
|
|
2541
|
+
)
|
|
2542
|
+
);
|
|
2543
|
+
}
|
|
2544
|
+
return value;
|
|
2545
|
+
}
|
|
2546
|
+
},
|
|
2547
|
+
description: {
|
|
2548
|
+
validate: (value) => {
|
|
2549
|
+
if (typeof value === "string" && value.length > 155) {
|
|
2550
|
+
throw new Error(
|
|
2551
|
+
ERROR_PREFIX.concat(
|
|
2552
|
+
"`description` should not be longer than 155 characters"
|
|
2553
|
+
)
|
|
2554
|
+
);
|
|
2555
|
+
}
|
|
2556
|
+
return value;
|
|
2557
|
+
}
|
|
2558
|
+
},
|
|
2559
|
+
url: {
|
|
2560
|
+
validate: (value) => {
|
|
2561
|
+
if (typeof value === "string" && !value.startsWith("http")) {
|
|
2562
|
+
throw new Error(ERROR_PREFIX.concat("`url` should be a valid URL"));
|
|
2563
|
+
}
|
|
2564
|
+
return value;
|
|
2565
|
+
}
|
|
2566
|
+
},
|
|
2567
|
+
handle: {
|
|
2568
|
+
validate: (value) => {
|
|
2569
|
+
if (typeof value === "string" && !value.startsWith("@")) {
|
|
2570
|
+
throw new Error(ERROR_PREFIX.concat("`handle` should start with `@`"));
|
|
2571
|
+
}
|
|
2572
|
+
return value;
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
};
|
|
2576
|
+
function generateSeoTags(seoInput) {
|
|
2529
2577
|
const output = [];
|
|
2530
|
-
let
|
|
2578
|
+
let jsonLd = {
|
|
2531
2579
|
"@context": "https://schema.org",
|
|
2532
2580
|
"@type": "Thing"
|
|
2533
2581
|
};
|
|
2534
|
-
for (const
|
|
2535
|
-
const values =
|
|
2582
|
+
for (const seoKey of Object.keys(seoInput)) {
|
|
2583
|
+
const values = ensureArray(seoInput[seoKey]);
|
|
2584
|
+
let content;
|
|
2585
|
+
if (!values) {
|
|
2586
|
+
return [];
|
|
2587
|
+
}
|
|
2536
2588
|
const tags = values.map((value) => {
|
|
2537
2589
|
const tagResults = [];
|
|
2538
2590
|
if (!value) {
|
|
2539
2591
|
return tagResults;
|
|
2540
2592
|
}
|
|
2541
|
-
switch (
|
|
2542
|
-
case "title":
|
|
2543
|
-
|
|
2593
|
+
switch (seoKey) {
|
|
2594
|
+
case "title": {
|
|
2595
|
+
content = validate(schema.title, value);
|
|
2596
|
+
const title = renderTitle(seoInput?.titleTemplate, content);
|
|
2544
2597
|
tagResults.push(
|
|
2545
|
-
generateTag("title", title),
|
|
2598
|
+
generateTag("title", { title }),
|
|
2546
2599
|
generateTag("meta", { property: "og:title", content: title }),
|
|
2547
2600
|
generateTag("meta", { name: "twitter:title", content: title })
|
|
2548
2601
|
);
|
|
2549
|
-
|
|
2602
|
+
jsonLd.name = content;
|
|
2550
2603
|
break;
|
|
2604
|
+
}
|
|
2551
2605
|
case "description":
|
|
2606
|
+
content = validate(schema.description, value);
|
|
2552
2607
|
tagResults.push(
|
|
2553
|
-
generateTag("meta", {
|
|
2554
|
-
|
|
2555
|
-
|
|
2608
|
+
generateTag("meta", {
|
|
2609
|
+
name: "description",
|
|
2610
|
+
content
|
|
2611
|
+
}),
|
|
2612
|
+
generateTag("meta", {
|
|
2613
|
+
property: "og:description",
|
|
2614
|
+
content
|
|
2615
|
+
}),
|
|
2616
|
+
generateTag("meta", {
|
|
2617
|
+
name: "twitter:description",
|
|
2618
|
+
content
|
|
2619
|
+
})
|
|
2556
2620
|
);
|
|
2557
|
-
|
|
2621
|
+
jsonLd.description = content;
|
|
2558
2622
|
break;
|
|
2559
2623
|
case "url":
|
|
2624
|
+
content = validate(schema.url, value);
|
|
2560
2625
|
tagResults.push(
|
|
2561
|
-
generateTag("meta", { property: "og:url", content
|
|
2562
|
-
generateTag("link", { rel: "canonical", href:
|
|
2626
|
+
generateTag("meta", { property: "og:url", content }),
|
|
2627
|
+
generateTag("link", { rel: "canonical", href: content })
|
|
2563
2628
|
);
|
|
2564
|
-
|
|
2565
|
-
|
|
2629
|
+
jsonLd.url = content;
|
|
2630
|
+
jsonLd["@type"] = inferSchemaType(content);
|
|
2566
2631
|
break;
|
|
2567
2632
|
case "handle":
|
|
2633
|
+
content = validate(schema.handle, value);
|
|
2568
2634
|
tagResults.push(
|
|
2569
|
-
generateTag("meta", { name: "twitter:site", content
|
|
2570
|
-
generateTag("meta", { name: "twitter:creator", content
|
|
2635
|
+
generateTag("meta", { name: "twitter:site", content }),
|
|
2636
|
+
generateTag("meta", { name: "twitter:creator", content })
|
|
2571
2637
|
);
|
|
2572
2638
|
break;
|
|
2573
|
-
case "
|
|
2574
|
-
|
|
2639
|
+
case "jsonLd":
|
|
2640
|
+
jsonLd = { ...jsonLd, ...value };
|
|
2575
2641
|
break;
|
|
2576
|
-
case "media":
|
|
2577
|
-
const values2 =
|
|
2642
|
+
case "media": {
|
|
2643
|
+
const values2 = ensureArray(value);
|
|
2578
2644
|
for (const media of values2) {
|
|
2579
2645
|
if (typeof media === "string") {
|
|
2580
2646
|
tagResults.push(
|
|
2581
|
-
generateTag("meta", { name: "og:image", content:
|
|
2647
|
+
generateTag("meta", { name: "og:image", content: media })
|
|
2582
2648
|
);
|
|
2583
|
-
|
|
2649
|
+
jsonLd.image = media;
|
|
2584
2650
|
}
|
|
2585
2651
|
if (media && typeof media === "object") {
|
|
2586
2652
|
const type = media.type || "image";
|
|
2587
2653
|
const normalizedMedia = media ? {
|
|
2588
2654
|
url: media?.url,
|
|
2589
2655
|
secure_url: media?.url,
|
|
2590
|
-
type: inferMimeType(media
|
|
2656
|
+
type: inferMimeType(media.url),
|
|
2591
2657
|
width: media?.width,
|
|
2592
2658
|
height: media?.height,
|
|
2593
2659
|
alt: media?.altText
|
|
2594
2660
|
} : {};
|
|
2595
2661
|
for (const key of Object.keys(normalizedMedia)) {
|
|
2596
2662
|
if (normalizedMedia[key]) {
|
|
2663
|
+
content = normalizedMedia[key];
|
|
2597
2664
|
tagResults.push(
|
|
2598
2665
|
generateTag(
|
|
2599
2666
|
"meta",
|
|
2600
2667
|
{
|
|
2601
2668
|
property: `og:${type}:${key}`,
|
|
2602
|
-
content
|
|
2669
|
+
content
|
|
2603
2670
|
},
|
|
2604
2671
|
normalizedMedia.url
|
|
2605
2672
|
)
|
|
@@ -2609,26 +2676,25 @@ function generateSeoTags(input) {
|
|
|
2609
2676
|
}
|
|
2610
2677
|
}
|
|
2611
2678
|
break;
|
|
2612
|
-
|
|
2613
|
-
|
|
2679
|
+
}
|
|
2680
|
+
case "alternates": {
|
|
2681
|
+
const alternates = ensureArray(value);
|
|
2614
2682
|
for (const alternate of alternates) {
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
} = alternate;
|
|
2621
|
-
const hreflang = language ? `${language}${defaultLang ? "-default" : ""}` : void 0;
|
|
2683
|
+
if (!alternate) {
|
|
2684
|
+
continue;
|
|
2685
|
+
}
|
|
2686
|
+
const { language, url, default: defaultLang } = alternate;
|
|
2687
|
+
const hrefLang = language ? `${language}${defaultLang ? "-default" : ""}` : void 0;
|
|
2622
2688
|
tagResults.push(
|
|
2623
2689
|
generateTag("link", {
|
|
2624
2690
|
rel: "alternate",
|
|
2625
|
-
|
|
2626
|
-
media,
|
|
2691
|
+
hrefLang,
|
|
2627
2692
|
href: url
|
|
2628
2693
|
})
|
|
2629
2694
|
);
|
|
2630
2695
|
}
|
|
2631
2696
|
break;
|
|
2697
|
+
}
|
|
2632
2698
|
}
|
|
2633
2699
|
return tagResults;
|
|
2634
2700
|
});
|
|
@@ -2647,19 +2713,19 @@ function generateSeoTags(input) {
|
|
|
2647
2713
|
return [...output, ...additionalTags].flat().sort((a, b) => a.key.localeCompare(b.key)).concat(
|
|
2648
2714
|
generateTag("script", {
|
|
2649
2715
|
type: "application/ld+json",
|
|
2650
|
-
children:
|
|
2716
|
+
children: jsonLd
|
|
2651
2717
|
})
|
|
2652
2718
|
).flat();
|
|
2653
2719
|
}
|
|
2654
2720
|
function generateTag(tagName, input, group) {
|
|
2655
|
-
const tag = { tag: tagName, props: {} };
|
|
2721
|
+
const tag = { tag: tagName, props: {}, key: "" };
|
|
2656
2722
|
if (tagName === "title") {
|
|
2657
|
-
tag.children = input;
|
|
2723
|
+
tag.children = input.title;
|
|
2658
2724
|
tag.key = generateKey(tag);
|
|
2659
2725
|
return tag;
|
|
2660
2726
|
}
|
|
2661
2727
|
if (tagName === "script") {
|
|
2662
|
-
tag.children = input.children;
|
|
2728
|
+
tag.children = JSON.stringify(input.children);
|
|
2663
2729
|
delete input.children;
|
|
2664
2730
|
}
|
|
2665
2731
|
tag.props = input;
|
|
@@ -2675,12 +2741,12 @@ function generateKey(tag, group) {
|
|
|
2675
2741
|
return "0-title";
|
|
2676
2742
|
}
|
|
2677
2743
|
if (tagName === "meta") {
|
|
2678
|
-
const priority = props.content === group && !props.property.endsWith("secure_url") && "0";
|
|
2744
|
+
const priority = props.content === group && typeof props.property === "string" && !props.property.endsWith("secure_url") && "0";
|
|
2679
2745
|
const groupName = [group, priority];
|
|
2680
2746
|
return [tagName, ...groupName, props.property || props.name].filter((x) => x).join("-");
|
|
2681
2747
|
}
|
|
2682
2748
|
if (tagName === "link") {
|
|
2683
|
-
const key = [tagName, props.rel, props.
|
|
2749
|
+
const key = [tagName, props.rel, props.hrefLang || props.media].filter((x) => x).join("-");
|
|
2684
2750
|
return key.replace(/\s+/g, "-");
|
|
2685
2751
|
}
|
|
2686
2752
|
return `${tagName}-${props.type}`;
|
|
@@ -2695,7 +2761,7 @@ function renderTitle(template, title) {
|
|
|
2695
2761
|
return template.replace("%s", title ?? "");
|
|
2696
2762
|
}
|
|
2697
2763
|
function inferMimeType(url) {
|
|
2698
|
-
const ext = url.split(".").pop();
|
|
2764
|
+
const ext = url && url.split(".").pop();
|
|
2699
2765
|
if (ext === "svg") {
|
|
2700
2766
|
return "image/svg+xml";
|
|
2701
2767
|
}
|
|
@@ -2718,6 +2784,9 @@ function inferMimeType(url) {
|
|
|
2718
2784
|
}
|
|
2719
2785
|
function inferSchemaType(url) {
|
|
2720
2786
|
const defaultType = "Thing";
|
|
2787
|
+
if (!url) {
|
|
2788
|
+
return defaultType;
|
|
2789
|
+
}
|
|
2721
2790
|
const routes = [
|
|
2722
2791
|
{
|
|
2723
2792
|
type: "WebSite",
|
|
@@ -2733,19 +2802,19 @@ function inferSchemaType(url) {
|
|
|
2733
2802
|
},
|
|
2734
2803
|
{
|
|
2735
2804
|
type: "ItemList",
|
|
2736
|
-
pattern: /\/collections\/([
|
|
2805
|
+
pattern: /\/collections\/([^/]+)/
|
|
2737
2806
|
},
|
|
2738
2807
|
{
|
|
2739
2808
|
type: "WebPage",
|
|
2740
|
-
pattern: /\/pages\/([
|
|
2809
|
+
pattern: /\/pages\/([^/]+)/
|
|
2741
2810
|
},
|
|
2742
2811
|
{
|
|
2743
2812
|
type: "WebSite",
|
|
2744
|
-
pattern: /\/blogs\/([
|
|
2813
|
+
pattern: /\/blogs\/([^/]+)/
|
|
2745
2814
|
},
|
|
2746
2815
|
{
|
|
2747
2816
|
type: "BlogPosting",
|
|
2748
|
-
pattern: /\/blogs\/([
|
|
2817
|
+
pattern: /\/blogs\/([^/]+)\/([^/]+)/
|
|
2749
2818
|
},
|
|
2750
2819
|
{
|
|
2751
2820
|
type: "Organization",
|
|
@@ -2753,7 +2822,7 @@ function inferSchemaType(url) {
|
|
|
2753
2822
|
},
|
|
2754
2823
|
{
|
|
2755
2824
|
type: "Organization",
|
|
2756
|
-
pattern: /\/policies\/([
|
|
2825
|
+
pattern: /\/policies\/([^/]+)/
|
|
2757
2826
|
}
|
|
2758
2827
|
];
|
|
2759
2828
|
const typeMatches = routes.filter((route) => {
|
|
@@ -2763,6 +2832,18 @@ function inferSchemaType(url) {
|
|
|
2763
2832
|
});
|
|
2764
2833
|
return typeMatches.length > 0 ? typeMatches[typeMatches.length - 1].type : defaultType;
|
|
2765
2834
|
}
|
|
2835
|
+
function ensureArray(value) {
|
|
2836
|
+
return Array.isArray(value) ? value : [value];
|
|
2837
|
+
}
|
|
2838
|
+
function validate(schema2, data) {
|
|
2839
|
+
try {
|
|
2840
|
+
return schema2.validate(data);
|
|
2841
|
+
} catch (error) {
|
|
2842
|
+
const message = error.message;
|
|
2843
|
+
console.warn(message);
|
|
2844
|
+
return data;
|
|
2845
|
+
}
|
|
2846
|
+
}
|
|
2766
2847
|
|
|
2767
2848
|
// src/seo/seo.ts
|
|
2768
2849
|
init_log_seo_tags();
|
|
@@ -2839,75 +2920,75 @@ function recursivelyInvokeOrReturn(value, ...rest) {
|
|
|
2839
2920
|
|
|
2840
2921
|
Object.defineProperty(exports, 'AnalyticsEventName', {
|
|
2841
2922
|
enumerable: true,
|
|
2842
|
-
get: function () { return
|
|
2923
|
+
get: function () { return hydrogenReact.AnalyticsEventName; }
|
|
2843
2924
|
});
|
|
2844
2925
|
Object.defineProperty(exports, 'AnalyticsPageType', {
|
|
2845
2926
|
enumerable: true,
|
|
2846
|
-
get: function () { return
|
|
2927
|
+
get: function () { return hydrogenReact.AnalyticsPageType; }
|
|
2847
2928
|
});
|
|
2848
2929
|
Object.defineProperty(exports, 'ExternalVideo', {
|
|
2849
2930
|
enumerable: true,
|
|
2850
|
-
get: function () { return
|
|
2931
|
+
get: function () { return hydrogenReact.ExternalVideo; }
|
|
2851
2932
|
});
|
|
2852
2933
|
Object.defineProperty(exports, 'Image', {
|
|
2853
2934
|
enumerable: true,
|
|
2854
|
-
get: function () { return
|
|
2935
|
+
get: function () { return hydrogenReact.Image; }
|
|
2855
2936
|
});
|
|
2856
2937
|
Object.defineProperty(exports, 'MediaFile', {
|
|
2857
2938
|
enumerable: true,
|
|
2858
|
-
get: function () { return
|
|
2939
|
+
get: function () { return hydrogenReact.MediaFile; }
|
|
2859
2940
|
});
|
|
2860
2941
|
Object.defineProperty(exports, 'ModelViewer', {
|
|
2861
2942
|
enumerable: true,
|
|
2862
|
-
get: function () { return
|
|
2943
|
+
get: function () { return hydrogenReact.ModelViewer; }
|
|
2863
2944
|
});
|
|
2864
2945
|
Object.defineProperty(exports, 'Money', {
|
|
2865
2946
|
enumerable: true,
|
|
2866
|
-
get: function () { return
|
|
2947
|
+
get: function () { return hydrogenReact.Money; }
|
|
2867
2948
|
});
|
|
2868
2949
|
Object.defineProperty(exports, 'ShopPayButton', {
|
|
2869
2950
|
enumerable: true,
|
|
2870
|
-
get: function () { return
|
|
2951
|
+
get: function () { return hydrogenReact.ShopPayButton; }
|
|
2871
2952
|
});
|
|
2872
|
-
Object.defineProperty(exports, '
|
|
2953
|
+
Object.defineProperty(exports, 'ShopifySalesChannel', {
|
|
2873
2954
|
enumerable: true,
|
|
2874
|
-
get: function () { return
|
|
2955
|
+
get: function () { return hydrogenReact.ShopifySalesChannel; }
|
|
2875
2956
|
});
|
|
2876
2957
|
Object.defineProperty(exports, 'Video', {
|
|
2877
2958
|
enumerable: true,
|
|
2878
|
-
get: function () { return
|
|
2959
|
+
get: function () { return hydrogenReact.Video; }
|
|
2879
2960
|
});
|
|
2880
2961
|
Object.defineProperty(exports, 'flattenConnection', {
|
|
2881
2962
|
enumerable: true,
|
|
2882
|
-
get: function () { return
|
|
2963
|
+
get: function () { return hydrogenReact.flattenConnection; }
|
|
2883
2964
|
});
|
|
2884
2965
|
Object.defineProperty(exports, 'getClientBrowserParameters', {
|
|
2885
2966
|
enumerable: true,
|
|
2886
|
-
get: function () { return
|
|
2967
|
+
get: function () { return hydrogenReact.getClientBrowserParameters; }
|
|
2887
2968
|
});
|
|
2888
2969
|
Object.defineProperty(exports, 'getShopifyCookies', {
|
|
2889
2970
|
enumerable: true,
|
|
2890
|
-
get: function () { return
|
|
2971
|
+
get: function () { return hydrogenReact.getShopifyCookies; }
|
|
2891
2972
|
});
|
|
2892
2973
|
Object.defineProperty(exports, 'parseMetafield', {
|
|
2893
2974
|
enumerable: true,
|
|
2894
|
-
get: function () { return
|
|
2975
|
+
get: function () { return hydrogenReact.parseMetafield; }
|
|
2895
2976
|
});
|
|
2896
2977
|
Object.defineProperty(exports, 'sendShopifyAnalytics', {
|
|
2897
2978
|
enumerable: true,
|
|
2898
|
-
get: function () { return
|
|
2979
|
+
get: function () { return hydrogenReact.sendShopifyAnalytics; }
|
|
2899
2980
|
});
|
|
2900
2981
|
Object.defineProperty(exports, 'storefrontApiCustomScalars', {
|
|
2901
2982
|
enumerable: true,
|
|
2902
|
-
get: function () { return
|
|
2983
|
+
get: function () { return hydrogenReact.storefrontApiCustomScalars; }
|
|
2903
2984
|
});
|
|
2904
2985
|
Object.defineProperty(exports, 'useMoney', {
|
|
2905
2986
|
enumerable: true,
|
|
2906
|
-
get: function () { return
|
|
2987
|
+
get: function () { return hydrogenReact.useMoney; }
|
|
2907
2988
|
});
|
|
2908
2989
|
Object.defineProperty(exports, 'useShopifyCookies', {
|
|
2909
2990
|
enumerable: true,
|
|
2910
|
-
get: function () { return
|
|
2991
|
+
get: function () { return hydrogenReact.useShopifyCookies; }
|
|
2911
2992
|
});
|
|
2912
2993
|
exports.CacheCustom = CacheCustom;
|
|
2913
2994
|
exports.CacheLong = CacheLong;
|