@shopbite-de/storefront 2.4.0 → 2.5.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 +5 -3
- package/app/components/Home/Categories.vue +2 -2
- package/app/components/Navigation/MobileTop.vue +1 -1
- package/app/composables/useAddressAutocomplete.ts +3 -11
- package/app/composables/useCheckoutMethodGuard.ts +1 -1
- package/app/composables/useShippingMethodChoice.ts +2 -2
- 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/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/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 +2 -1
- 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/plugins/bounded-cache.ts +28 -0
- package/server/plugins/security-headers.ts +54 -0
- package/server/routes/llms.txt.ts +1 -1
- package/server/utils/addressAutocomplete.ts +181 -0
- package/server/utils/listingParams.ts +117 -0
- package/server/utils/securityHeaders.ts +165 -0
- 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/CheckoutSummary.test.ts +1 -1
- package/test/nuxt/HeaderFooterPreset.test.ts +10 -10
- package/test/nuxt/HomeFaq.test.ts +1 -1
- package/test/nuxt/NavigationMobileTop.test.ts +1 -1
- package/test/nuxt/OrderPagesPreset.test.ts +2 -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/useShippingMethodChoice.test.ts +1 -1
- 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/llmsTxt.spec.ts +28 -28
- 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
|
@@ -23,7 +23,7 @@ As of 2026-09-10, branch `fix/294-matomo-without-config`.
|
|
|
23
23
|
|
|
24
24
|
## Verification
|
|
25
25
|
|
|
26
|
-
Production build locally against the
|
|
26
|
+
Production build locally against the customer Store API, three scenarios, Playwright records every request containing `matomo`:
|
|
27
27
|
|
|
28
28
|
- Without Matomo env and with `MATOMO_URL` only: no `matomo.js` reference in the SSR HTML, no request (neither `cdn.matomo.cloud` nor anything else).
|
|
29
29
|
- With URL + site ID: preload and request to `<matomoUrl>/matomo.js`, `_paq` contains `setTrackerUrl`, `setSiteId`, `trackPageView`. A client-side search from `/c/Pizza/` to `/suche?q=salat` pushes `trackSiteSearch` through the same instance (only one script request).
|
|
@@ -16,4 +16,4 @@ As of 2026-09-10, branch `fix/296-track-direct-search`.
|
|
|
16
16
|
|
|
17
17
|
## Verification
|
|
18
18
|
|
|
19
|
-
Production build against the
|
|
19
|
+
Production build against the customer Store API with Matomo configured: direct load of `/suche?q=pizza` pushes exactly one `trackSiteSearch`; a client-side search from `/c/Pizza/` to `/suche?q=salat` still pushes one.
|
|
@@ -9,7 +9,7 @@ criteria as `_criteria` query parameters (`encodeForQuery` from
|
|
|
9
9
|
`@shopware/api-client/helpers`), and `useNavigation` used the
|
|
10
10
|
`readNavigationGet` operation the same way. Shopware applies `associations`
|
|
11
11
|
and `limit` from the query string, but not the `includes` projection: every
|
|
12
|
-
entity came back with all of its fields. Measured on the
|
|
12
|
+
entity came back with all of its fields. Measured on the customer shop Store
|
|
13
13
|
API (category "Pizza", 100 products): the listing route returned 285 KB with
|
|
14
14
|
92 fields per product; the same criteria as a POST body returns 147 KB with
|
|
15
15
|
the 11 requested fields. `/api/category/<id>` returned 40 fields incl.
|
|
@@ -36,7 +36,7 @@ The category page shipped 546 KB of HTML (393 KB Nuxt payload).
|
|
|
36
36
|
|
|
37
37
|
## Verification
|
|
38
38
|
|
|
39
|
-
Production build against the
|
|
39
|
+
Production build against the customer Store API (category "Pizza", 100
|
|
40
40
|
products), uncompressed sizes:
|
|
41
41
|
|
|
42
42
|
| Response | Before | After |
|
|
@@ -52,7 +52,7 @@ back) shows the same product counts and no hydration warnings. Lighthouse
|
|
|
52
52
|
mobile on `/c/Pizza/` is unchanged on the CPU side (TBT 600 ms, main
|
|
53
53
|
thread 3.9 s): the gain is transfer size only; script cost is #314.
|
|
54
54
|
|
|
55
|
-
The product cover projection could not be checked on
|
|
55
|
+
The product cover projection could not be checked on the customer shop: 39 of
|
|
56
56
|
100 products carry a `coverId`, but none of them resolves to a `cover`,
|
|
57
57
|
with or without `includes` (the media rows are gone; a data problem of that
|
|
58
58
|
instance, unrelated to this change). Verified against Shopware's public
|
|
@@ -23,7 +23,7 @@ instead of `@import`; it resolves utilities without re-emitting the base.
|
|
|
23
23
|
|
|
24
24
|
- Production build: the `merkliste.*.css` chunk is gone; the remaining
|
|
25
25
|
chunks are `entry.css` (253 KB) and `kontakt.css` (117 B).
|
|
26
|
-
- `/merkliste` on the production build against the
|
|
26
|
+
- `/merkliste` on the production build against the customer Store API
|
|
27
27
|
loads only `entry.css` (25 KB gzipped), renders the empty-wishlist state
|
|
28
28
|
as before, no console errors.
|
|
29
29
|
- Prettier and ESLint pass.
|
|
@@ -4,7 +4,7 @@ As of 2026-09-10, branch `fix/314-mobile-js-cost`.
|
|
|
4
4
|
|
|
5
5
|
## Measurement setup
|
|
6
6
|
|
|
7
|
-
Production build,
|
|
7
|
+
Production build, customer Store API, Lighthouse 12.8.2 mobile
|
|
8
8
|
(simulated throttling, 4× CPU) behind the h2/gzip proxy from
|
|
9
9
|
`docs/notes/2026-09-10-issue-273-performance-media.md`; two runs per page,
|
|
10
10
|
same machine. Chunk attribution comes from the client manifest that Nuxt
|
|
@@ -4,7 +4,7 @@ As of 2026-09-12, branch `fix/319-stylesheet-cost`.
|
|
|
4
4
|
|
|
5
5
|
## Measurement setup
|
|
6
6
|
|
|
7
|
-
Production build,
|
|
7
|
+
Production build, customer Store API, Lighthouse 12.8.2 mobile
|
|
8
8
|
(simulated throttling, 4× CPU) behind the h2/gzip proxy of the #273 and
|
|
9
9
|
#314 notes, two runs per page. In addition, Chrome DevTools Protocol
|
|
10
10
|
traces through Playwright (4× CPU throttling, mobile viewport):
|
|
@@ -10,7 +10,7 @@ three directions (A compact with thumbnail, B dense menu list, C visual
|
|
|
10
10
|
with a large image), then three derivatives of C for shops without
|
|
11
11
|
product photos, then five levels of button emphasis. Chosen: **C1** (the
|
|
12
12
|
anatomy of C, the image block only when the product has a cover) with
|
|
13
|
-
button level **B1** (`variant="subtle"`).
|
|
13
|
+
button level **B1** (`variant="subtle"`). The customer shop has no product
|
|
14
14
|
covers at all, the ShopBite demo a few, so the card must look finished
|
|
15
15
|
without any image.
|
|
16
16
|
|
|
@@ -78,7 +78,7 @@ loads cross-sellings.
|
|
|
78
78
|
|
|
79
79
|
## Verification
|
|
80
80
|
|
|
81
|
-
- Production build with the
|
|
81
|
+
- Production build with the customer API: tapping a pizza card sets
|
|
82
82
|
`?produkt=22` and opens the sheet with 34 extras chips and the "Ohne"
|
|
83
83
|
chip; one extra plus quantity 2 puts 17,00 € into the cart and the card
|
|
84
84
|
shows "2× im Warenkorb"; the back button closes the sheet;
|
|
@@ -37,7 +37,7 @@ top sellers as a horizontal scroller.
|
|
|
37
37
|
`useAsyncData`.
|
|
38
38
|
- `useTopSellers`: limit 8, includes for cover, properties and
|
|
39
39
|
availability, and the `sw-inheritance` header so variants marked as top
|
|
40
|
-
sellers carry the parent's name and cover (
|
|
40
|
+
sellers carry the parent's name and cover (the customer shop marks both the
|
|
41
41
|
parent "Cordon Bleu" and its three variants; the header type of the
|
|
42
42
|
generated operation lacks `sw-inheritance`, hence the `@ts-expect-error`).
|
|
43
43
|
- Docs (https://shopbite.de/docs/storefront/content, DE/EN)
|
|
@@ -46,7 +46,7 @@ top sellers as a horizontal scroller.
|
|
|
46
46
|
|
|
47
47
|
## Verification
|
|
48
48
|
|
|
49
|
-
- Production build with the
|
|
49
|
+
- Production build with the customer API: status "Geöffnet bis 23:00",
|
|
50
50
|
eight top sellers, a tap opens the quick view (`?produkt=18V`), video
|
|
51
51
|
only at 1280 px; screenshots mobile light/dark and desktop reviewed, no
|
|
52
52
|
page errors.
|
|
@@ -35,7 +35,7 @@ A (three cards with a bold lead, detail text and one action) vs. B
|
|
|
35
35
|
|
|
36
36
|
## Verification
|
|
37
37
|
|
|
38
|
-
- Production build with the
|
|
38
|
+
- Production build with the customer API: leads "Heute 11:30–14:30
|
|
39
39
|
und 17:30–23:00", "In ca. 30 Minuten bei dir", "Tisch nur telefonisch";
|
|
40
40
|
status "Geöffnet bis 14:30"; the hours link scrolls to
|
|
41
41
|
`#oeffnungszeiten`; no page errors and no hydration warnings on 390 px
|
|
@@ -23,7 +23,7 @@ variant id, `pending` went back to `true` and the extras collapsed into
|
|
|
23
23
|
the skeleton until the (identical) extras came back.
|
|
24
24
|
|
|
25
25
|
Measured with `scripts/perf/quick-view-layout.mjs`, which logs the drawer body per animation
|
|
26
|
-
frame against the production build with the
|
|
26
|
+
frame against the production build with the customer data (product
|
|
27
27
|
18V "Insalata di Pollo", two variants, 12 extras):
|
|
28
28
|
|
|
29
29
|
| Viewport | Open: body height steps | Variant switch: steps |
|
|
@@ -15,7 +15,7 @@ The demo deployment (Dokploy) sets `NUXT_SITE_INDEXABLE=false`. Nothing in
|
|
|
15
15
|
`nuxt.config.ts`:
|
|
16
16
|
|
|
17
17
|
- An unconditional `site: { indexable: false }` would be merged into every shop
|
|
18
|
-
project.
|
|
18
|
+
project. The customer shop does not set `site.indexable`, so it would drop
|
|
19
19
|
out of search engines with the next release.
|
|
20
20
|
- A config flag limited to this repository as the root project (comparing
|
|
21
21
|
`process.cwd()` with the config directory) worked, but was rejected as too
|
|
@@ -37,7 +37,7 @@ module's `max-image-preview:large` rule. The composable now only sets
|
|
|
37
37
|
|
|
38
38
|
## Verified
|
|
39
39
|
|
|
40
|
-
Production build with
|
|
40
|
+
Production build with the customer shop's Store API, `node .output/server/index.mjs`:
|
|
41
41
|
|
|
42
42
|
- `NUXT_SITE_INDEXABLE=false`: robots.txt `Disallow: /`; `/`, `/c/Pizza/` and
|
|
43
43
|
`/bestellung/warenkorb` send `X-Robots-Tag: noindex, nofollow` and render
|
|
@@ -44,7 +44,7 @@ changes the content height while choosing makes it jump:
|
|
|
44
44
|
and could wrap the row. Both states now carry an icon of the same size (X to
|
|
45
45
|
remove, plus to add back).
|
|
46
46
|
|
|
47
|
-
Checked on the production menu of
|
|
47
|
+
Checked on the production menu of the customer shop (12 pizzas with up to 34 extras, 360
|
|
48
48
|
and 390 px wide): toggling every ingredient and ticking an extra keeps the
|
|
49
49
|
drawer height constant.
|
|
50
50
|
|
|
@@ -4,7 +4,7 @@ Follow-up to `2026-09-10-issue-273-performance-media.md` (PR #308).
|
|
|
4
4
|
|
|
5
5
|
## State on 2026-09-21
|
|
6
6
|
|
|
7
|
-
- Object storage media (demo and
|
|
7
|
+
- Object storage media (demo and the customer shop) send
|
|
8
8
|
`public, max-age=31536000, immutable`: done on the buckets.
|
|
9
9
|
- The docs on shopbite.de cover poster, video size, thumbnails and the bucket header.
|
|
10
10
|
- Remaining requests without a useful cache lifetime on demo.shopbite.de:
|
|
@@ -12,7 +12,7 @@ Container logs in OpenObserve (`docker_logs`, 2026-09-19 to 2026-09-21):
|
|
|
12
12
|
|
|
13
13
|
| Container | `[fatal]` blocks (3 days) |
|
|
14
14
|
| ----------------------- | ------------------------- |
|
|
15
|
-
| `
|
|
15
|
+
| `customer-storefront` | ~2,500 |
|
|
16
16
|
| `shopbite-storefront` | 565 |
|
|
17
17
|
| shopbite.de website | 423 (same pattern) |
|
|
18
18
|
|
|
@@ -37,7 +37,7 @@ navigation to an unknown path still shows the error page.
|
|
|
37
37
|
|
|
38
38
|
## Other findings
|
|
39
39
|
|
|
40
|
-
- 117 `[unhandled]` errors on `/api/category|listing|product/*` at
|
|
40
|
+
- 117 `[unhandled]` errors on `/api/category|listing|product/*` at the customer shop,
|
|
41
41
|
all on 2026-09-19 18:00 UTC: the Shopware backend answered with
|
|
42
42
|
`404 page not found` (backend unreachable). Logged correctly; the URL shows a
|
|
43
43
|
double slash (`/store-api//category/…`) because the endpoint env ends in `/`.
|
|
@@ -36,6 +36,6 @@ wishlist request on `/` and one on `/merkliste`, no
|
|
|
36
36
|
still prints its own "Failed to load resource" line for the 403/404 response;
|
|
37
37
|
that is not a JavaScript error and cannot be suppressed from the page.
|
|
38
38
|
|
|
39
|
-
`storefront/.env` currently points at the
|
|
39
|
+
`storefront/.env` currently points at the customer production backend; to test
|
|
40
40
|
against the demo, set `NUXT_PUBLIC_SHOPWARE_ENDPOINT`/`_ACCESS_TOKEN` in the
|
|
41
41
|
environment (they take precedence over `.env`).
|
|
@@ -9,7 +9,7 @@ layer from npm does not get them, but inherits the module list.
|
|
|
9
9
|
|
|
10
10
|
Reproduced with the packed storefront installed into an empty app
|
|
11
11
|
(`extends: ["@shopbite-de/storefront"]`, pnpm 10.26.2, `node-linker=hoisted`
|
|
12
|
-
like
|
|
12
|
+
like the customer shop), no dev tooling installed:
|
|
13
13
|
|
|
14
14
|
- 1.27.0: `pnpm install` fails in the storefront's own `postinstall`
|
|
15
15
|
(`nuxt prepare`, which runs inside `node_modules/@shopbite-de/storefront`
|
|
@@ -10,7 +10,7 @@ Lirim's template, verified on the demo (preview API and after indexing):
|
|
|
10
10
|
{% set main = product.mainCategories|first %}{% set cat = main ? main.category : product.categories|first %}{% for p in (cat.translated.breadcrumb ?? [])|slice(1) %}{{ p }}/{% endfor %}?produkt={{ product.productNumber|url_encode|raw }}
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
- `slice(1)` matches the demo's category template (`category.seoBreadcrumb` → `Speisekarte/Pizza/`, incl. slugs such as `Getraenke`); `slice(2)` gives `Pizza/…`, which does not exist. Shops with a prefixed category template (
|
|
13
|
+
- `slice(1)` matches the demo's category template (`category.seoBreadcrumb` → `Speisekarte/Pizza/`, incl. slugs such as `Getraenke`); `slice(2)` gives `Pizza/…`, which does not exist. Shops with a prefixed category template (the customer shop `c/…`) need the prefix: the plugin derives it.
|
|
14
14
|
- The product number must be `|url_encode|raw`: the SEO escaper slugifies variables, `LF-21-groß` became `LF-21-gross`, which the quick view cannot find. Encoded it is `LF-21-gro%C3%9F`, which the router decodes.
|
|
15
15
|
- `seoBreadcrumb`/`seoCategory` are not available in the product template; the preview API renders main products only, so variants are only visible after indexing.
|
|
16
16
|
- **The demo backend now runs this template** (set via Admin API for verification, both `frontend.detail.page` and `store-api.product.detail`, reindexed).
|
|
@@ -4,7 +4,7 @@ As of 2026-10-05, branch `feature/400-menu-item-ingredients-diet`. Part of the A
|
|
|
4
4
|
|
|
5
5
|
## Finding
|
|
6
6
|
|
|
7
|
-
On
|
|
7
|
+
On the customer shop, `/c/Pizza/` carried 29 `MenuItem`s, but only 4 had a `description`: the ingredients live in the `Hauptzutaten` property group, not in the product description. No item said whether it is vegetarian or vegan. AI assistants answering "what is on it / is it vegetarian" had nothing to go on.
|
|
8
8
|
|
|
9
9
|
## Implementation
|
|
10
10
|
|
|
@@ -18,4 +18,4 @@ As of 2026-10-05, branch `feature/401-restaurant-schema-ordering`. Part of the A
|
|
|
18
18
|
|
|
19
19
|
Production build against the demo backend with the new env variables: the home page `Restaurant` node carries `geo`, both delivery areas, `acceptsReservations: true`, `paymentAccepted: "Nachnahme"`, `currenciesAccepted: "EUR"` and the `OrderAction` with pickup and own delivery. Without the new variables only `paymentAccepted`, `currenciesAccepted` and `potentialAction` (without `deliveryMethod`) are added. Unit + nuxt tests, typecheck, ESLint green.
|
|
20
20
|
|
|
21
|
-
Docs: https://shopbite.de/docs/storefront/configuration (DE/EN), including the note that `NUXT_PUBLIC_SITE_CUISINE` is a cuisine name:
|
|
21
|
+
Docs: https://shopbite.de/docs/storefront/configuration (DE/EN), including the note that `NUXT_PUBLIC_SITE_CUISINE` is a cuisine name: The customer shop sets `italienische`, which produces "italienische in Musterstadt" in its meta description.
|
|
@@ -8,7 +8,7 @@ As of 2026-10-05, branch `feature/402-llms-txt`. Part of the AI visibility issue
|
|
|
8
8
|
- Sources: `runtimeConfig.public.site` (name, description, address, phone, cuisine, delivery areas from #401), the ShopBite plugin routes (business hours, holidays, config: checkout enabled, delivery time), `/context` (currency), the menu navigation (`menuCategoryId`, with SEO URLs) and all main products via `/product` (100 per page, at most 10 pages, `includes` in the POST body, #312). Each source is optional: `Promise.allSettled`, a failed request drops its section.
|
|
9
9
|
- Products are grouped by their directly assigned `categoryIds` (extras without category are not listed). Products with variants show "ab <cheapest price>". Ingredients and diets reuse `getMainIngredients`/`getDiets` (#400).
|
|
10
10
|
- Sorting: the `/product` route ignored `sort` by name, so items are sorted in code (German locale, numeric).
|
|
11
|
-
- Content pages come from the `landingpages` collection; pages that `robots.txt` blocks (
|
|
11
|
+
- Content pages come from the `landingpages` collection; pages that `robots.txt` blocks (the customer shop's legal pages) are filtered with `getPathRobotConfig`.
|
|
12
12
|
- `swr: 3600` route rule. On non-indexable sites the robots module already sends `X-Robots-Tag: noindex, nofollow` for this route, so no own header is needed.
|
|
13
13
|
- `splitList` moved to `app/utils/seo.ts` (shared with `useRestaurantSchema`).
|
|
14
14
|
|
|
@@ -6,7 +6,7 @@ As of 2026-10-05, branch `feature/403-ai-crawler-robots`. Part of the AI visibil
|
|
|
6
6
|
|
|
7
7
|
- `runtimeConfig.aiCrawlers` (server-only): `search` and `training`, both `true` by default (the previous behaviour, now explicit). Env: `NUXT_AI_CRAWLERS_SEARCH`, `NUXT_AI_CRAWLERS_TRAINING`.
|
|
8
8
|
- `server/plugins/ai-crawlers.ts` hooks `robots:config` of `@nuxtjs/robots` (6.2), which runs at runtime for robots.txt and for the per-request `X-Robots-Tag`. A build-time `robots.groups` entry could not read the env. The hook gets a fresh copy of the configured groups on every call, so pushing groups does not accumulate.
|
|
9
|
-
- `server/utils/aiCrawlers.ts` (pure, unit-tested) builds one group per kind. A crawler matching a named group ignores the `*` group, so an allowed group repeats the `*` disallow paths (
|
|
9
|
+
- `server/utils/aiCrawlers.ts` (pure, unit-tested) builds one group per kind. A crawler matching a named group ignores the `*` group, so an allowed group repeats the `*` disallow paths (the customer shop's legal pages stay blocked for AI bots too).
|
|
10
10
|
- User agents verified on the operators' pages on 2026-10-05 (sources in the file header). `Google-Extended` and `Applebot-Extended` are control tokens, not crawlers; Google AI Overviews follow Googlebot, not `Google-Extended`.
|
|
11
11
|
- Non-indexable sites (demo) never reach the hook: the module answers with `Disallow: /` before resolving groups.
|
|
12
12
|
|
|
@@ -4,7 +4,7 @@ As of 2026-10-05, branch `feature/404-faq`. Last of the AI visibility issues #40
|
|
|
4
4
|
|
|
5
5
|
## Decisions
|
|
6
6
|
|
|
7
|
-
- **Data:** optional `faq` (headline, title, description, `items` of question/answer) in the `home` collection (`content/index.yml`), next to the other home sections. Shops without `faq` render nothing;
|
|
7
|
+
- **Data:** optional `faq` (headline, title, description, `items` of question/answer) in the `home` collection (`content/index.yml`), next to the other home sections. Shops without `faq` render nothing; the customer shop has its own `index.yml`, so nothing changes there until it adds questions.
|
|
8
8
|
- **Place:** home page, above the closing CTA. `/zahlung-und-versand` stays a Markdown page.
|
|
9
9
|
- **Markup:** native `<details>`/`<summary>` instead of `UAccordion`. Reka's accordion unmounts closed panels by default, so the answers would be missing from the SSR HTML that crawlers read; `<details>` keeps them in the markup, is keyboard accessible and adds no JavaScript or Nuxt UI theme (#314, #319).
|
|
10
10
|
- **Answers are plain text** (no Markdown/links), so the same strings work in the HTML, the JSON-LD and `/llms.txt`.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Old category SEO URLs redirect to the current ones
|
|
2
2
|
|
|
3
|
-
As of 2026-10-06, branch `feature/redirect-non-canonical-seo-urls`. Prompted by
|
|
3
|
+
As of 2026-10-06, branch `feature/redirect-non-canonical-seo-urls`. Prompted by the customer shop moving its category URLs from `/c/Pizza/` to `/speisekarte/pizza/` via the Shopware SEO URL template.
|
|
4
4
|
|
|
5
|
-
## Findings (
|
|
5
|
+
## Findings (customer Store API)
|
|
6
6
|
|
|
7
|
-
- Shopware keeps the old SEO URL of an entity when the template or the entity name changes: same `foreignKey`, `isCanonical: null`.
|
|
7
|
+
- Shopware keeps the old SEO URL of an entity when the template or the entity name changes: same `foreignKey`, `isCanonical: null`. The customer shop has 262 of them for products already (e.g. `Schnitzel-Wiener-Art/103V` next to the canonical `Schnitzel-Wiener-Art/103`).
|
|
8
8
|
- The Store API `/seo-url` route adds `isCanonical = true` to the criteria unless they contain an `equals` filter on `isCanonical` at top level (a nested `multi` filter does not count). A lookup by `seoPathInfo` alone therefore never finds an old URL: before this change, every old category URL returned 404 after a template change.
|
|
9
9
|
|
|
10
10
|
## Change
|
|
@@ -23,8 +23,8 @@ The category pages `pages/c/[...all].vue` and `pages/speisekarte/[...all].vue` w
|
|
|
23
23
|
|
|
24
24
|
The category bar of the `listing` layout is rendered by the page itself (same markup) instead of switching layouts per result, which would need `setPageLayout` during SSR (hydration warning in Nuxt). A category page now costs one extra request to `/api/content/page`.
|
|
25
25
|
|
|
26
|
-
Checked against the
|
|
26
|
+
Checked against the customer backend (dev server): `/c/Pizza/` 200 with 29 products, `/c/pizza` and `/navigation/<pizza id>` 301 to `/c/Pizza/`, `/agb` 200, `/c/Unbekannt/`, `/Schnitzel-Wiener-Art/103`, `/wp-login.php`, `/.env` 404. Client-side navigation content → category → category → alias → content → back renders the right page each time. The hydration warnings on a category page (`NavigationDesktopLeft`, `CategoryListing`) are the same with the old pages.
|
|
27
27
|
|
|
28
28
|
## Verification
|
|
29
29
|
|
|
30
|
-
Unit tests (`seoPath.spec.ts`, `useSeoUrlRoute.test.ts`), typecheck, ESLint, Prettier. Both queries checked against the
|
|
30
|
+
Unit tests (`seoPath.spec.ts`, `useSeoUrlRoute.test.ts`), typecheck, ESLint, Prettier. Both queries checked against the customer Store API with existing old product URLs: the `seoPathInfo` lookup without an `isCanonical` filter returns nothing, with `isCanonical: null` it returns the old record, and the canonical lookup returns `Schnitzel-Wiener-Art/103`.
|
|
@@ -8,7 +8,7 @@ All Store API projections used the key `property` for property groups. The entit
|
|
|
8
8
|
|
|
9
9
|
- `server/api/product/[productId].get.ts` and `server/api/product/variant.get.ts`: `property_group: ["id", "name", "translated", "options"]`. Options keep `group`: the configurator reads `option.group.id`, the ingredient selection `option.group.name`.
|
|
10
10
|
- `server/api/search.get.ts`: same projection as the listing (#435), because the search page renders the same cards: `property_group` with `displayType`, options without `group`, no `properties`/`propertyIds`.
|
|
11
|
-
- `app/components/Product/Category.vue` deleted: it was rendered nowhere (only recursively by itself), neither in the storefront nor in
|
|
11
|
+
- `app/components/Product/Category.vue` deleted: it was rendered nowhere (only recursively by itself), neither in the storefront nor in the customer shop or the quickstart repo.
|
|
12
12
|
|
|
13
13
|
## Verification (demo backend, `main` build against branch build)
|
|
14
14
|
|
package/nuxt.config.ts
CHANGED
|
@@ -60,12 +60,63 @@ export default defineNuxtConfig({
|
|
|
60
60
|
// Store API caches after menu changes. Empty = route off.
|
|
61
61
|
cachePurgeSecret: "",
|
|
62
62
|
geoapifyApiKey: "",
|
|
63
|
+
// Per-IP token bucket of /api/address/autocomplete: `capacity` lookups at
|
|
64
|
+
// once, refilled by `refillPerMinute`; only lookups that reach Geoapify
|
|
65
|
+
// count. In memory per server process; capacity 0 turns it off (e.g. when
|
|
66
|
+
// the reverse proxy limits the route).
|
|
67
|
+
addressAutocomplete: {
|
|
68
|
+
rateLimit: {
|
|
69
|
+
capacity: 20,
|
|
70
|
+
refillPerMinute: 20,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
// Bound of the Nitro cache (server/plugins/bounded-cache.ts): an LRU in
|
|
74
|
+
// memory with at most `maxEntries` entries and `maxSizeMb` of data;
|
|
75
|
+
// NUXT_CACHE_STORAGE_*, maxEntries 0 = unbounded. A cache storage the
|
|
76
|
+
// shop mounts itself (nitro.storage.cache) is kept.
|
|
77
|
+
cacheStorage: {
|
|
78
|
+
maxEntries: 5000,
|
|
79
|
+
maxSizeMb: 128,
|
|
80
|
+
},
|
|
81
|
+
// Sortings the listing and search routes accept (`order`), comma-
|
|
82
|
+
// separated; empty = Shopware's standard sortings. Add the keys of
|
|
83
|
+
// custom sortings created in the Shopware Administration.
|
|
84
|
+
listingSortings: "",
|
|
63
85
|
// AI crawlers named in robots.txt (#403, server/plugins/ai-crawlers.ts):
|
|
64
86
|
// search = AI search and assistant fetches, training = model training.
|
|
65
87
|
aiCrawlers: {
|
|
66
88
|
search: true,
|
|
67
89
|
training: true,
|
|
68
90
|
},
|
|
91
|
+
// Headers of every response (server/plugins/security-headers.ts),
|
|
92
|
+
// NUXT_SECURITY_HEADERS_*; an empty value leaves the header out.
|
|
93
|
+
securityHeaders: {
|
|
94
|
+
// Only sent when public.storeUrl is https.
|
|
95
|
+
strictTransportSecurity: "max-age=31536000; includeSubDomains",
|
|
96
|
+
contentTypeOptions: "nosniff",
|
|
97
|
+
// A shop embedded in another site sets frameOptions "" and lists the
|
|
98
|
+
// embedding origin in frameAncestors (CSP `frame-ancestors`).
|
|
99
|
+
frameOptions: "DENY",
|
|
100
|
+
frameAncestors: "'none'",
|
|
101
|
+
referrerPolicy: "strict-origin-when-cross-origin",
|
|
102
|
+
// No feature of the storefront uses these (address suggestions are
|
|
103
|
+
// typed, not located); Web Share and the clipboard stay allowed.
|
|
104
|
+
permissionsPolicy:
|
|
105
|
+
"camera=(), microphone=(), geolocation=(), usb=(), browsing-topics=()",
|
|
106
|
+
// Server-rendered HTML may contain the visitor's cart or login
|
|
107
|
+
// (useUserContextInSSR), so no shared or browser cache keeps it.
|
|
108
|
+
htmlCacheControl: "private, no-store",
|
|
109
|
+
// Report-only policy for pages: self, the Shopware endpoint, Matomo
|
|
110
|
+
// and inline scripts by hash. Extra hosts (e.g. a RUM collector) are
|
|
111
|
+
// space-separated lists.
|
|
112
|
+
contentSecurityPolicyReportOnly: {
|
|
113
|
+
enabled: true,
|
|
114
|
+
scriptSrc: "",
|
|
115
|
+
connectSrc: "",
|
|
116
|
+
imgSrc: "",
|
|
117
|
+
reportUri: "",
|
|
118
|
+
},
|
|
119
|
+
},
|
|
69
120
|
public: {
|
|
70
121
|
shopBite: {
|
|
71
122
|
cacheTtl: {
|
|
@@ -92,6 +143,7 @@ export default defineNuxtConfig({
|
|
|
92
143
|
searchFallbackCategoryId: "",
|
|
93
144
|
// Optional Geoapify bounding box "lon1,lat1,lon2,lat2" that narrows
|
|
94
145
|
// the address suggestions in the checkout (empty = no filter, #251).
|
|
146
|
+
// Applied by the server route, never taken from the request.
|
|
95
147
|
addressAutocomplete: {
|
|
96
148
|
boundingBox: "",
|
|
97
149
|
},
|
|
@@ -126,14 +178,14 @@ export default defineNuxtConfig({
|
|
|
126
178
|
telephone: "",
|
|
127
179
|
googleBusinessProfileUrl: "",
|
|
128
180
|
// Other names the shop is known by on maps and directories, comma-
|
|
129
|
-
// separated ("
|
|
181
|
+
// separated ("Esempio / Alter Hof, Alter Hof"), so search
|
|
130
182
|
// engines and AI assistants match them to this shop. Restaurant
|
|
131
183
|
// schema `alternateName` and /llms.txt.
|
|
132
184
|
alternateNames: "",
|
|
133
185
|
// Restaurant schema only, e.g. "€€" (#272).
|
|
134
186
|
priceRange: "",
|
|
135
187
|
// Restaurant schema only (#401): comma-separated delivery areas
|
|
136
|
-
// ("
|
|
188
|
+
// ("12345 Musterstadt, 12346 Beispieldorf"), coordinates and
|
|
137
189
|
// "true"/"false" or a text for table reservations.
|
|
138
190
|
deliveryAreas: "",
|
|
139
191
|
geo: {
|
|
@@ -299,13 +351,9 @@ export default defineNuxtConfig({
|
|
|
299
351
|
globStrict: false,
|
|
300
352
|
// default of 1.x, off by default since 2.0
|
|
301
353
|
cleanupOutdatedCaches: true,
|
|
354
|
+
// No runtime caching of pages: server-rendered HTML may contain the
|
|
355
|
+
// visitor's cart or login and must not be kept in CacheStorage.
|
|
302
356
|
navigateFallback: null,
|
|
303
|
-
runtimeCaching: [
|
|
304
|
-
{
|
|
305
|
-
urlPattern: "/",
|
|
306
|
-
handler: "NetworkFirst",
|
|
307
|
-
},
|
|
308
|
-
],
|
|
309
357
|
},
|
|
310
358
|
devOptions: {
|
|
311
359
|
enabled: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopbite-de/storefront",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"main": "nuxt.config.ts",
|
|
5
5
|
"description": "Shopware storefront for food delivery shops",
|
|
6
6
|
"keywords": [
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"nuxt": "^4.6.4",
|
|
39
39
|
"nuxt-vitalizer": "4.0.0",
|
|
40
40
|
"reka-ui": "^2.11.0",
|
|
41
|
+
"unstorage": "^1.17.6",
|
|
41
42
|
"uuid": "^14.0.3"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
@@ -1,34 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geoapify address autocomplete proxy: keeps the API key on the server.
|
|
3
|
+
* Only `text` (3–200 characters), `lang` (two letters) and `limit` (1–10) are
|
|
4
|
+
* passed on; the area filter comes from the runtime config
|
|
5
|
+
* (`public.shopBite.addressAutocomplete.boundingBox`). Identical lookups are
|
|
6
|
+
* answered from a small in-memory cache for 5 minutes, and lookups that reach
|
|
7
|
+
* Geoapify are rate limited per client IP (`addressAutocomplete.rateLimit`,
|
|
8
|
+
* capacity 0 = off). Upstream errors are logged with the key redacted and
|
|
9
|
+
* answered with a generic 502.
|
|
10
|
+
*/
|
|
11
|
+
import type { AutocompleteParams } from "../../utils/addressAutocomplete";
|
|
12
|
+
|
|
13
|
+
const GEOAPIFY_URL = "https://api.geoapify.com/v1/geocode/autocomplete";
|
|
14
|
+
const CACHE_TTL_MS = 5 * 60 * 1000;
|
|
15
|
+
const CACHE_MAX_ENTRIES = 500;
|
|
16
|
+
|
|
17
|
+
type Suggestions = ReturnType<typeof pickAddressFields>;
|
|
18
|
+
|
|
19
|
+
const cache = createTtlCache<Suggestions>({
|
|
20
|
+
ttlMs: CACHE_TTL_MS,
|
|
21
|
+
maxEntries: CACHE_MAX_ENTRIES,
|
|
22
|
+
});
|
|
23
|
+
let limiter: ReturnType<typeof createTokenBucketLimiter> | null | undefined;
|
|
24
|
+
|
|
25
|
+
function rateLimiter() {
|
|
26
|
+
if (limiter !== undefined) return limiter;
|
|
27
|
+
const { capacity = 20, refillPerMinute = 20 } =
|
|
28
|
+
useRuntimeConfig().addressAutocomplete?.rateLimit ?? {};
|
|
29
|
+
limiter =
|
|
30
|
+
Number(capacity) > 0
|
|
31
|
+
? createTokenBucketLimiter({
|
|
32
|
+
capacity: Number(capacity),
|
|
33
|
+
refillPerMinute: Number(refillPerMinute),
|
|
34
|
+
})
|
|
35
|
+
: null;
|
|
36
|
+
return limiter;
|
|
37
|
+
}
|
|
38
|
+
|
|
1
39
|
export default defineEventHandler(async (event) => {
|
|
2
40
|
const config = useRuntimeConfig();
|
|
3
41
|
const apiKey = config.geoapifyApiKey;
|
|
4
|
-
const query = getQuery(event);
|
|
5
42
|
|
|
6
43
|
if (!apiKey) {
|
|
7
44
|
return { features: [] };
|
|
8
45
|
}
|
|
9
46
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
47
|
+
let params: AutocompleteParams | null;
|
|
48
|
+
try {
|
|
49
|
+
params = parseAutocompleteQuery(getQuery(event));
|
|
50
|
+
} catch {
|
|
51
|
+
throw createError({ statusCode: 400, statusMessage: "Bad Request" });
|
|
52
|
+
}
|
|
53
|
+
if (!params) {
|
|
13
54
|
return { features: [] };
|
|
14
55
|
}
|
|
15
56
|
|
|
16
|
-
const
|
|
17
|
-
|
|
57
|
+
const filter = boundingBoxFilter(
|
|
58
|
+
config.public.shopBite.addressAutocomplete?.boundingBox,
|
|
18
59
|
);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
60
|
+
const key = JSON.stringify([params.text, params.lang, params.limit, filter]);
|
|
61
|
+
const cached = cache.get(key);
|
|
62
|
+
if (cached) return cached;
|
|
63
|
+
|
|
64
|
+
const limit = rateLimiter();
|
|
65
|
+
if (
|
|
66
|
+
limit &&
|
|
67
|
+
!limit.take(getRequestIP(event, { xForwardedFor: true }) ?? "")
|
|
68
|
+
) {
|
|
69
|
+
setResponseHeader(event, "Retry-After", 10);
|
|
70
|
+
throw createError({
|
|
71
|
+
statusCode: 429,
|
|
72
|
+
statusMessage: "Too Many Requests",
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const url = new URL(GEOAPIFY_URL);
|
|
77
|
+
url.searchParams.set("apiKey", apiKey);
|
|
78
|
+
url.searchParams.set("text", params.text);
|
|
79
|
+
url.searchParams.set("lang", params.lang);
|
|
80
|
+
url.searchParams.set("limit", String(params.limit));
|
|
81
|
+
if (filter) url.searchParams.set("filter", filter);
|
|
24
82
|
|
|
25
83
|
try {
|
|
26
|
-
|
|
84
|
+
const suggestions = pickAddressFields(await $fetch(url.toString()));
|
|
85
|
+
cache.set(key, suggestions);
|
|
86
|
+
return suggestions;
|
|
27
87
|
} catch (error) {
|
|
28
88
|
const err = error as { response?: { status?: number }; message?: string };
|
|
89
|
+
console.error("Address autocomplete request failed", {
|
|
90
|
+
status: err.response?.status,
|
|
91
|
+
url: redactApiKey(url.toString()),
|
|
92
|
+
message: redactApiKey(String(err.message ?? "")),
|
|
93
|
+
});
|
|
29
94
|
throw createError({
|
|
30
|
-
statusCode:
|
|
31
|
-
statusMessage:
|
|
95
|
+
statusCode: 502,
|
|
96
|
+
statusMessage: "Address suggestions unavailable",
|
|
32
97
|
});
|
|
33
98
|
}
|
|
34
99
|
});
|
|
@@ -60,34 +60,11 @@ const BASE_CRITERIA = {
|
|
|
60
60
|
limit: 100,
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
/** Validates and returns a non-empty string up to maxLength, or undefined. */
|
|
64
|
-
function sanitizeString(value: unknown, maxLength: number): string | undefined {
|
|
65
|
-
if (typeof value !== "string" || value === "") return undefined;
|
|
66
|
-
const trimmed = value.trim();
|
|
67
|
-
return trimmed.length <= maxLength ? trimmed : undefined;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** Validates page number: positive integer in [1, 1000]. */
|
|
71
|
-
function sanitizePage(value: unknown): number | undefined {
|
|
72
|
-
const n = Number(value);
|
|
73
|
-
return Number.isInteger(n) && n >= 1 && n <= 1000 ? n : undefined;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function resolveAllowedParams(query: Record<string, unknown>) {
|
|
77
|
-
return {
|
|
78
|
-
order: sanitizeString(query.order, 64),
|
|
79
|
-
properties: sanitizeString(query.properties, 2048),
|
|
80
|
-
manufacturer: sanitizeString(query.manufacturer, 2048),
|
|
81
|
-
query: sanitizeString(query.query, 256),
|
|
82
|
-
p: sanitizePage(query.p),
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
63
|
export default defineCachedEventHandler(
|
|
87
64
|
async (event) => {
|
|
88
|
-
const categoryId = getRouterParam(event, "categoryId")
|
|
65
|
+
const categoryId = categoryIdParam(getRouterParam(event, "categoryId"));
|
|
89
66
|
|
|
90
|
-
const { order, properties, manufacturer, query, p } =
|
|
67
|
+
const { order, properties, manufacturer, query, p } = listingParams(
|
|
91
68
|
getQuery(event) as Record<string, unknown>,
|
|
92
69
|
);
|
|
93
70
|
|
|
@@ -108,10 +85,10 @@ export default defineCachedEventHandler(
|
|
|
108
85
|
maxAge: useRuntimeConfig().public.shopBite.cacheTtl.listing,
|
|
109
86
|
name: "listing",
|
|
110
87
|
getKey: (event) => {
|
|
111
|
-
const categoryId = getRouterParam(event, "categoryId")
|
|
88
|
+
const categoryId = categoryIdParam(getRouterParam(event, "categoryId"));
|
|
112
89
|
const q = getQuery(event) as Record<string, unknown>;
|
|
113
|
-
|
|
114
|
-
|
|
90
|
+
// Validated before it becomes a key (400 otherwise).
|
|
91
|
+
const { order, properties, manufacturer, query, p } = listingParams(q);
|
|
115
92
|
return [
|
|
116
93
|
categoryId,
|
|
117
94
|
order ?? "",
|