@scayle/storefront-product-detail 0.1.1 → 0.2.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/README.md
CHANGED
|
@@ -70,9 +70,3 @@ Learn more about [SCAYLE’s architecture](https://scayle.dev/en/getting-started
|
|
|
70
70
|
[npm-downloads-href]: https://npmjs.com/package/@scayle/storefront-product-detail
|
|
71
71
|
[license-src]: https://img.shields.io/npm/l/@scayle/storefront-product-detail.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
72
72
|
[license-href]: https://npmjs.com/package/@scayle/storefront-product-detail
|
|
73
|
-
|
|
74
|
-
## License
|
|
75
|
-
|
|
76
|
-
Licensed under the [MIT License](https://opensource.org/license/mit/)
|
|
77
|
-
|
|
78
|
-
---
|
|
@@ -2,20 +2,17 @@ import { type ComputedRef } from 'vue';
|
|
|
2
2
|
import type { BreadcrumbItem, Variant } from '@scayle/storefront-nuxt';
|
|
3
3
|
import type { WithContext, Product, BreadcrumbList } from 'schema-dts';
|
|
4
4
|
type CanonicalLink = Record<'rel' | 'key' | 'href', string>;
|
|
5
|
-
|
|
6
|
-
baseUrl: string;
|
|
7
|
-
fullPath: string;
|
|
8
|
-
}
|
|
5
|
+
type UrlParams = Record<'baseUrl' | 'fullPath', string>;
|
|
9
6
|
interface ProductInfo {
|
|
10
7
|
name: string;
|
|
11
8
|
brand: string;
|
|
12
9
|
productDescription: string;
|
|
13
10
|
variants: Variant[];
|
|
14
11
|
}
|
|
15
|
-
interface UseProductSeoDataReturn {
|
|
12
|
+
export interface UseProductSeoDataReturn {
|
|
13
|
+
title: string;
|
|
16
14
|
robots: string;
|
|
17
15
|
canonicalLink: ComputedRef<CanonicalLink[]>;
|
|
18
|
-
title: string;
|
|
19
16
|
productJsonLd: ComputedRef<WithContext<Product>>;
|
|
20
17
|
productBreadcrumbJsonLd: ComputedRef<WithContext<BreadcrumbList>>;
|
|
21
18
|
}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
generateCategoryBreadcrumbSchema,
|
|
4
4
|
sanitizeCanonicalURL
|
|
5
5
|
} from "@scayle/storefront-nuxt";
|
|
6
|
-
import { generateProductSchema } from "
|
|
6
|
+
import { generateProductSchema } from "../utils/seo.js";
|
|
7
7
|
export function useProductSeoData(breadcrumbs, urlParams, images, productInfo) {
|
|
8
8
|
const canonicalUrl = computed(() => {
|
|
9
9
|
const url = `${urlParams.baseUrl}${urlParams.fullPath}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-product-detail",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Collection of essential composables and utilities to work with product detail",
|
|
5
5
|
"author": "SCAYLE Commerce Engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
"@vueuse/core": "11.2.0",
|
|
59
59
|
"dprint": "0.47.5",
|
|
60
60
|
"eslint": "9.14.0",
|
|
61
|
-
"happy-dom": "15.11.
|
|
61
|
+
"happy-dom": "15.11.6",
|
|
62
62
|
"eslint-formatter-gitlab": "5.1.0",
|
|
63
63
|
"nuxt": "3.13.2",
|
|
64
64
|
"publint": "0.2.12",
|
|
65
65
|
"typescript": "5.6.3",
|
|
66
|
-
"vitest": "2.1.
|
|
66
|
+
"vitest": "2.1.5",
|
|
67
67
|
"vue-router": "4.4.5",
|
|
68
68
|
"vue-tsc": "2.1.10"
|
|
69
69
|
}
|