@shopbite-de/storefront 2.4.0 → 2.6.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/.env.example +13 -1
- package/CLAUDE.md +7 -4
- package/api-types/storeApiSchema.json +62 -6
- package/api-types/storeApiTypes.d.ts +23 -4
- package/app/components/Checkout/DeliveryTimeSelect.vue +39 -18
- package/app/components/Checkout/Summary.vue +5 -1
- package/app/components/Home/Categories.vue +2 -2
- package/app/components/Home/Facts.vue +9 -4
- package/app/components/Home/Hero.vue +8 -2
- package/app/components/Navigation/MobileTop.vue +1 -1
- package/app/components/Order/Detail.vue +3 -4
- package/app/composables/useAddressAutocomplete.ts +3 -11
- package/app/composables/useCheckoutMethodGuard.ts +1 -1
- package/app/composables/useDeliveryTime.ts +8 -5
- package/app/composables/useShippingLeadTime.ts +17 -0
- package/app/composables/useShippingMethodChoice.ts +2 -2
- package/app/composables/useShopBiteConfig.ts +10 -1
- package/app/composables/useTrackEvent.ts +4 -3
- package/app/pages/account/recover/password/index.vue +10 -0
- package/app/pages/registrierung/bestaetigen.vue +4 -0
- package/app/utils/leadTime.ts +97 -0
- package/app/utils/openingHours.ts +1 -1
- package/app/utils/schema.ts +2 -2
- package/app/utils/trackingUrl.ts +39 -0
- package/content/index.yml +16 -16
- package/content/zahlung-und-versand.md +3 -3
- package/content.config.ts +2 -2
- package/docs/notes/2026-07-04-issue-239-hydration-mismatches.md +1 -1
- package/docs/notes/2026-09-08-issue-244-category-url-trailing-slash.md +2 -2
- package/docs/notes/2026-09-10-issue-251-shop-data-in-base-layer.md +4 -4
- package/docs/notes/2026-09-10-issue-272-restaurant-schema.md +3 -3
- package/docs/notes/2026-09-10-issue-273-performance-media.md +4 -4
- package/docs/notes/2026-09-10-issue-274-seo-basics.md +6 -6
- package/docs/notes/2026-09-10-issue-275-accessibility.md +3 -3
- package/docs/notes/2026-09-10-issue-290-footer-nap.md +5 -5
- package/docs/notes/2026-09-10-issue-294-matomo-without-config.md +1 -1
- package/docs/notes/2026-09-10-issue-296-track-direct-search.md +1 -1
- package/docs/notes/2026-09-10-issue-312-store-api-criteria-post.md +3 -3
- package/docs/notes/2026-09-10-issue-313-wishlist-scoped-tailwind.md +1 -1
- package/docs/notes/2026-09-10-issue-314-mobile-js-cost.md +1 -1
- package/docs/notes/2026-09-12-issue-319-stylesheet-cost.md +1 -1
- package/docs/notes/2026-09-12-issue-325-product-card.md +2 -2
- package/docs/notes/2026-09-12-issue-327-home-hero.md +2 -2
- package/docs/notes/2026-09-13-issue-332-home-info-cards.md +1 -1
- package/docs/notes/2026-09-13-quick-view-flicker.md +1 -1
- package/docs/notes/2026-09-14-demo-noindex.md +2 -2
- package/docs/notes/2026-09-17-quick-view-compact-options.md +1 -1
- package/docs/notes/2026-09-21-issue-273-cache-and-demo-video.md +1 -1
- package/docs/notes/2026-09-21-issue-363-non-fatal-404.md +2 -2
- package/docs/notes/2026-09-21-issue-366-wishlist-404.md +1 -1
- package/docs/notes/2026-09-21-issue-378-dev-modules.md +1 -1
- package/docs/notes/2026-10-05-issue-289-product-deep-links.md +1 -1
- package/docs/notes/2026-10-05-issue-400-menu-item-ingredients-diet.md +1 -1
- package/docs/notes/2026-10-05-issue-401-restaurant-schema-ordering.md +1 -1
- package/docs/notes/2026-10-05-issue-402-llms-txt.md +1 -1
- package/docs/notes/2026-10-05-issue-403-ai-crawlers.md +1 -1
- package/docs/notes/2026-10-05-issue-404-faq.md +1 -1
- package/docs/notes/2026-10-06-old-seo-url-redirect.md +5 -5
- package/docs/notes/2026-10-07-issue-434-property-group-projection.md +1 -1
- package/nuxt.config.ts +56 -8
- package/package.json +3 -2
- package/server/api/address/autocomplete.get.ts +79 -14
- package/server/api/listing/[categoryId].get.ts +5 -28
- package/server/api/search.get.ts +4 -18
- package/server/api/shopbite/config.get.ts +1 -1
- package/server/plugins/bounded-cache.ts +28 -0
- package/server/plugins/security-headers.ts +54 -0
- package/server/routes/llms.txt.ts +6 -5
- package/server/utils/addressAutocomplete.ts +181 -0
- package/server/utils/listingParams.ts +117 -0
- package/server/utils/llmsTxt.ts +7 -3
- package/server/utils/securityHeaders.ts +165 -0
- package/server/utils/shopBiteConfig.ts +1 -1
- package/test/layer/nuxt.config.ts +2 -2
- package/test/nuxt/AccountPagesPreset.test.ts +10 -10
- package/test/nuxt/AuthPagesPreset.test.ts +3 -0
- package/test/nuxt/CheckoutFormsPreset.test.ts +5 -5
- package/test/nuxt/CheckoutOnePage.test.ts +4 -1
- package/test/nuxt/CheckoutSummary.test.ts +42 -3
- package/test/nuxt/DeliveryTimeSelect.test.ts +181 -0
- package/test/nuxt/HeaderFooterPreset.test.ts +10 -10
- package/test/nuxt/HomeFaq.test.ts +1 -1
- package/test/nuxt/HomeLeadTimes.test.ts +78 -0
- package/test/nuxt/NavigationMobileTop.test.ts +1 -1
- package/test/nuxt/OrderPagesPreset.test.ts +22 -2
- package/test/nuxt/RegisterConfirmPage.test.ts +12 -0
- package/test/nuxt/useAddressAutocomplete.test.ts +7 -22
- package/test/nuxt/useCheckoutMethodGuard.test.ts +1 -1
- package/test/nuxt/useDeliveryTime.test.ts +30 -6
- package/test/nuxt/useShippingLeadTime.test.ts +66 -0
- package/test/nuxt/useShippingMethodChoice.test.ts +1 -1
- package/test/nuxt/useShopBiteConfig.test.ts +57 -3
- package/test/nuxt/useTrackEvent.test.ts +16 -0
- package/test/unit/addressAutocomplete.spec.ts +247 -0
- package/test/unit/boundedCache.spec.ts +231 -0
- package/test/unit/highlight.spec.ts +2 -2
- package/test/unit/leadTime.spec.ts +86 -0
- package/test/unit/llmsTxt.spec.ts +30 -29
- package/test/unit/openingHours.spec.ts +3 -3
- package/test/unit/schema.spec.ts +29 -32
- package/test/unit/securityHeaders.spec.ts +254 -0
- package/test/unit/seo.spec.ts +23 -29
- package/test/unit/sitemap.spec.ts +1 -1
- package/test/unit/trackingUrl.spec.ts +48 -0
package/test/unit/seo.spec.ts
CHANGED
|
@@ -11,23 +11,19 @@ const TEMPLATE = "%s | %siteName – Online bestellen";
|
|
|
11
11
|
|
|
12
12
|
describe("formatPageTitle", () => {
|
|
13
13
|
it("applies the title template", () => {
|
|
14
|
-
expect(formatPageTitle("Pizza", "
|
|
15
|
-
"Pizza |
|
|
14
|
+
expect(formatPageTitle("Pizza", "Esempio", TEMPLATE)).toBe(
|
|
15
|
+
"Pizza | Esempio – Online bestellen",
|
|
16
16
|
);
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
it("renders the bare site name for a missing or site-name title", () => {
|
|
20
|
-
expect(formatPageTitle(undefined, "
|
|
21
|
-
|
|
22
|
-
);
|
|
23
|
-
expect(formatPageTitle("", "La Fattoria", TEMPLATE)).toBe("La Fattoria");
|
|
24
|
-
expect(formatPageTitle("La Fattoria", "La Fattoria", TEMPLATE)).toBe(
|
|
25
|
-
"La Fattoria",
|
|
26
|
-
);
|
|
20
|
+
expect(formatPageTitle(undefined, "Esempio", TEMPLATE)).toBe("Esempio");
|
|
21
|
+
expect(formatPageTitle("", "Esempio", TEMPLATE)).toBe("Esempio");
|
|
22
|
+
expect(formatPageTitle("Esempio", "Esempio", TEMPLATE)).toBe("Esempio");
|
|
27
23
|
});
|
|
28
24
|
|
|
29
25
|
it("renders the title as is without a template", () => {
|
|
30
|
-
expect(formatPageTitle("Pizza", "
|
|
26
|
+
expect(formatPageTitle("Pizza", "Esempio", "")).toBe("Pizza");
|
|
31
27
|
});
|
|
32
28
|
});
|
|
33
29
|
|
|
@@ -56,20 +52,20 @@ describe("toAbsoluteUrl", () => {
|
|
|
56
52
|
|
|
57
53
|
describe("buildHomeTitle", () => {
|
|
58
54
|
it("adds the city to the shop name", () => {
|
|
59
|
-
expect(buildHomeTitle({ name: "
|
|
60
|
-
"
|
|
55
|
+
expect(buildHomeTitle({ name: "Esempio", city: "Musterstadt" })).toBe(
|
|
56
|
+
"Esempio Musterstadt | Online bestellen & liefern lassen",
|
|
61
57
|
);
|
|
62
58
|
});
|
|
63
59
|
|
|
64
60
|
it("does not repeat a city that is already part of the name", () => {
|
|
65
61
|
expect(
|
|
66
|
-
buildHomeTitle({ name: "Pizzeria
|
|
67
|
-
).toBe("Pizzeria
|
|
62
|
+
buildHomeTitle({ name: "Pizzeria Musterstadt", city: "Musterstadt" }),
|
|
63
|
+
).toBe("Pizzeria Musterstadt | Online bestellen & liefern lassen");
|
|
68
64
|
});
|
|
69
65
|
|
|
70
66
|
it("works without a city", () => {
|
|
71
|
-
expect(buildHomeTitle({ name: "
|
|
72
|
-
"
|
|
67
|
+
expect(buildHomeTitle({ name: "Esempio", city: "" })).toBe(
|
|
68
|
+
"Esempio | Online bestellen & liefern lassen",
|
|
73
69
|
);
|
|
74
70
|
});
|
|
75
71
|
});
|
|
@@ -78,40 +74,38 @@ describe("buildHomeDescription", () => {
|
|
|
78
74
|
it("combines cuisine, city and name", () => {
|
|
79
75
|
expect(
|
|
80
76
|
buildHomeDescription({
|
|
81
|
-
name: "
|
|
82
|
-
city: "
|
|
77
|
+
name: "Esempio",
|
|
78
|
+
city: "Musterstadt",
|
|
83
79
|
cuisine: "Italienische Küche",
|
|
84
80
|
}),
|
|
85
81
|
).toBe(
|
|
86
|
-
"Italienische Küche in
|
|
82
|
+
"Italienische Küche in Musterstadt: Bei Esempio online bestellen und liefern lassen oder abholen.",
|
|
87
83
|
);
|
|
88
84
|
});
|
|
89
85
|
|
|
90
86
|
it("uses city or cuisine alone", () => {
|
|
91
|
-
expect(
|
|
92
|
-
|
|
93
|
-
).toBe(
|
|
94
|
-
"La Fattoria in Obertshausen: Online bestellen und liefern lassen oder abholen.",
|
|
87
|
+
expect(buildHomeDescription({ name: "Esempio", city: "Musterstadt" })).toBe(
|
|
88
|
+
"Esempio in Musterstadt: Online bestellen und liefern lassen oder abholen.",
|
|
95
89
|
);
|
|
96
90
|
expect(
|
|
97
|
-
buildHomeDescription({ name: "
|
|
91
|
+
buildHomeDescription({ name: "Esempio", cuisine: "Pizza & Pasta" }),
|
|
98
92
|
).toBe(
|
|
99
|
-
"Pizza & Pasta: Bei
|
|
93
|
+
"Pizza & Pasta: Bei Esempio online bestellen und liefern lassen oder abholen.",
|
|
100
94
|
);
|
|
101
95
|
});
|
|
102
96
|
|
|
103
97
|
it("returns undefined without city and cuisine", () => {
|
|
104
98
|
expect(
|
|
105
|
-
buildHomeDescription({ name: "
|
|
99
|
+
buildHomeDescription({ name: "Esempio", city: "", cuisine: "" }),
|
|
106
100
|
).toBeUndefined();
|
|
107
101
|
});
|
|
108
102
|
});
|
|
109
103
|
|
|
110
104
|
describe("splitList", () => {
|
|
111
105
|
it("splits a comma-separated value and keeps arrays", () => {
|
|
112
|
-
expect(splitList("
|
|
113
|
-
"
|
|
114
|
-
"
|
|
106
|
+
expect(splitList("12345 Musterstadt, 12346 Beispieldorf,")).toEqual([
|
|
107
|
+
"12345 Musterstadt",
|
|
108
|
+
"12346 Beispieldorf",
|
|
115
109
|
]);
|
|
116
110
|
expect(splitList(["A", "B"])).toEqual(["A", "B"]);
|
|
117
111
|
expect(splitList("")).toEqual([]);
|
|
@@ -50,7 +50,7 @@ describe("categoriesToSitemapUrls", () => {
|
|
|
50
50
|
seoUrl: "/navigation/018d9f1649c9709580aab97a16368d8d",
|
|
51
51
|
},
|
|
52
52
|
{ type: "link", seoUrl: "/agb" },
|
|
53
|
-
{ type: "link", seoUrl: "tel:+
|
|
53
|
+
{ type: "link", seoUrl: "tel:+49123456780" },
|
|
54
54
|
{ type: "folder", seoUrl: null },
|
|
55
55
|
{ type: "page", seoUrl: "//evil.example.com/" },
|
|
56
56
|
{ type: "page" },
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { trackingUrl } from "../../app/utils/trackingUrl";
|
|
3
|
+
|
|
4
|
+
describe("trackingUrl", () => {
|
|
5
|
+
it("keeps a plain path", () => {
|
|
6
|
+
expect(trackingUrl("/Speisekarte/Pizza/")).toBe("/Speisekarte/Pizza/");
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it("drops query parameters that may carry secrets", () => {
|
|
10
|
+
expect(trackingUrl("/account/recover/password?hash=abc123")).toBe(
|
|
11
|
+
"/account/recover/password",
|
|
12
|
+
);
|
|
13
|
+
expect(trackingUrl("/registrierung/bestaetigen?em=e1&hash=h1")).toBe(
|
|
14
|
+
"/registrierung/bestaetigen",
|
|
15
|
+
);
|
|
16
|
+
expect(
|
|
17
|
+
trackingUrl("/bestellung/1?token=t&deepLinkCode=d&email=a@b.c"),
|
|
18
|
+
).toBe("/bestellung/1");
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("drops the fragment", () => {
|
|
22
|
+
expect(trackingUrl("/konto#access_token=x")).toBe("/konto");
|
|
23
|
+
expect(trackingUrl("/?produkt=P1#x")).toBe("/?produkt=P1");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("keeps campaign parameters and the quick view configuration", () => {
|
|
27
|
+
expect(
|
|
28
|
+
trackingUrl(
|
|
29
|
+
"/Speisekarte/Pizza/?produkt=P1&ohne=Zwiebeln&extras=E1&hash=x",
|
|
30
|
+
),
|
|
31
|
+
).toBe("/Speisekarte/Pizza/?produkt=P1&ohne=Zwiebeln&extras=E1");
|
|
32
|
+
expect(
|
|
33
|
+
trackingUrl(
|
|
34
|
+
"/?utm_source=flyer&utm_medium=print&mtm_campaign=a&pk_kwd=b&em=x",
|
|
35
|
+
),
|
|
36
|
+
).toBe("/?utm_source=flyer&utm_medium=print&mtm_campaign=a&pk_kwd=b");
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("matches parameter names exactly, not by prefix", () => {
|
|
40
|
+
expect(trackingUrl("/?produkt_hash=x&extrasToken=y&utm=z")).toBe("/");
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("keeps encoded values as they are", () => {
|
|
44
|
+
expect(trackingUrl("/?ohne=K%C3%A4se&extras=E1%2CE2")).toBe(
|
|
45
|
+
"/?ohne=K%C3%A4se&extras=E1%2CE2",
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
});
|