@shopbite-de/storefront 1.31.1 → 1.31.2
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/CLAUDE.md +1 -1
- package/app/composables/useRestaurantSchema.ts +1 -0
- package/app/utils/schema.ts +5 -0
- package/nuxt.config.ts +5 -0
- package/package.json +1 -1
- package/server/routes/llms.txt.ts +1 -0
- package/server/utils/llmsTxt.ts +5 -0
- package/test/unit/llmsTxt.spec.ts +23 -2
- package/test/unit/schema.spec.ts +16 -0
package/CLAUDE.md
CHANGED
|
@@ -138,7 +138,7 @@ Pages without content throw `createNotFoundError()` (`app/utils/notFound.ts`): f
|
|
|
138
138
|
- `@nuxtjs/sitemap` must stay before `@nuxt/content` in `modules`; content collections need the `sitemap` schema field to appear in the sitemap.
|
|
139
139
|
- The home page FAQ (`faq` in `content/index.yml`, `Home/Faq.vue`, #404) uses native `<details>`, not `UAccordion`: Reka unmounts closed panels, and the answers must be in the SSR HTML. The same items feed the `FAQPage` JSON-LD and `/llms.txt`.
|
|
140
140
|
- `server/plugins/ai-crawlers.ts` adds two named robots.txt groups via the `robots:config` hook (#403): AI search/assistant bots and AI training bots (lists with sources in `server/utils/aiCrawlers.ts`), toggled by `runtimeConfig.aiCrawlers.search`/`.training`. A crawler matching a named group ignores `*`, so allowed groups repeat the `robots.disallow` paths.
|
|
141
|
-
- Shop contact data (NAP) lives in `runtimeConfig.public.site` (`address.*`, `telephone`, `googleBusinessProfileUrl`) and is rendered by `components/Footer/Contact.vue`. `useBusinessHours`/`useHolidays` use `immediate: false` (app.vue loads them on mount); a component that needs them in the SSR HTML calls `onServerPrefetch(() => refresh())`. In the browser both requests are retried twice (`withRetries`); `useOpeningHoursData` gives components the combined loading/failed state and `retry()`, and reports a failure only after mounting (a failed server prefetch would otherwise break hydration, #355). Anything that depends on the current time (open/closed status, "today") is computed after mounting: `useStoreStatus` starts its clock in `onMounted`, because the home page prefetches the hours on the server and the server's clock and time zone differ from the visitor's (hydration mismatch, #365).
|
|
141
|
+
- Shop contact data (NAP) lives in `runtimeConfig.public.site` (`address.*`, `telephone`, `googleBusinessProfileUrl`; `alternateNames` lists other names the shop is listed under, for the Restaurant schema `alternateName` and `/llms.txt`) and is rendered by `components/Footer/Contact.vue`. `useBusinessHours`/`useHolidays` use `immediate: false` (app.vue loads them on mount); a component that needs them in the SSR HTML calls `onServerPrefetch(() => refresh())`. In the browser both requests are retried twice (`withRetries`); `useOpeningHoursData` gives components the combined loading/failed state and `retry()`, and reports a failure only after mounting (a failed server prefetch would otherwise break hydration, #355). Anything that depends on the current time (open/closed status, "today") is computed after mounting: `useStoreStatus` starts its clock in `onMounted`, because the home page prefetches the hours on the server and the server's clock and time zone differ from the visitor's (hydration mismatch, #365).
|
|
142
142
|
|
|
143
143
|
### Testing setup
|
|
144
144
|
|
package/app/utils/schema.ts
CHANGED
|
@@ -26,6 +26,8 @@ type HolidayLike = {
|
|
|
26
26
|
|
|
27
27
|
export type SiteInfo = {
|
|
28
28
|
name: string;
|
|
29
|
+
/** Other names the shop is listed under, e.g. "Alte Schmiede". */
|
|
30
|
+
alternateNames?: string[];
|
|
29
31
|
url: string;
|
|
30
32
|
description?: string;
|
|
31
33
|
image?: string;
|
|
@@ -199,6 +201,9 @@ export function buildRestaurantSchema(input: {
|
|
|
199
201
|
"@type": "Restaurant",
|
|
200
202
|
"@id": `${site.url}#restaurant`,
|
|
201
203
|
name: site.name,
|
|
204
|
+
alternateName: site.alternateNames?.length
|
|
205
|
+
? site.alternateNames
|
|
206
|
+
: undefined,
|
|
202
207
|
description: site.description,
|
|
203
208
|
url: site.url,
|
|
204
209
|
image: site.image,
|
package/nuxt.config.ts
CHANGED
|
@@ -109,6 +109,11 @@ export default defineNuxtConfig({
|
|
|
109
109
|
},
|
|
110
110
|
telephone: "",
|
|
111
111
|
googleBusinessProfileUrl: "",
|
|
112
|
+
// Other names the shop is known by on maps and directories, comma-
|
|
113
|
+
// separated ("La Fattoria / Alte Schmiede, Alte Schmiede"), so search
|
|
114
|
+
// engines and AI assistants match them to this shop. Restaurant
|
|
115
|
+
// schema `alternateName` and /llms.txt.
|
|
116
|
+
alternateNames: "",
|
|
112
117
|
// Restaurant schema only, e.g. "€€" (#272).
|
|
113
118
|
priceRange: "",
|
|
114
119
|
// Restaurant schema only (#401): comma-separated delivery areas
|
package/package.json
CHANGED
package/server/utils/llmsTxt.ts
CHANGED
|
@@ -24,6 +24,8 @@ export type LlmsMenuSection = {
|
|
|
24
24
|
|
|
25
25
|
export type LlmsTxtInput = {
|
|
26
26
|
name: string;
|
|
27
|
+
/** Other names the shop is listed under on maps and directories. */
|
|
28
|
+
alternateNames?: string[];
|
|
27
29
|
description?: string;
|
|
28
30
|
url: string;
|
|
29
31
|
cuisine?: string;
|
|
@@ -125,6 +127,9 @@ export function buildLlmsTxt(input: LlmsTxtInput): string {
|
|
|
125
127
|
.join(" ");
|
|
126
128
|
|
|
127
129
|
const contact = [
|
|
130
|
+
input.alternateNames?.length
|
|
131
|
+
? `- Auch bekannt als: ${input.alternateNames.join(", ")}`
|
|
132
|
+
: undefined,
|
|
128
133
|
input.address?.street || input.address?.postalCode || city
|
|
129
134
|
? `- Adresse: ${[
|
|
130
135
|
input.address?.street,
|
|
@@ -135,9 +135,30 @@ Nach Obertshausen und Lämmerspiel.
|
|
|
135
135
|
`);
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
+
it("names other names of the shop under Kontakt", () => {
|
|
139
|
+
expect(
|
|
140
|
+
buildLlmsTxt({
|
|
141
|
+
name: "Pizzeria La Fattoria",
|
|
142
|
+
alternateNames: ["La Fattoria / Alte Schmiede", "Alte Schmiede"],
|
|
143
|
+
url: "https://www.pizzeria-lafattoria.de",
|
|
144
|
+
now,
|
|
145
|
+
}),
|
|
146
|
+
).toContain(`## Kontakt
|
|
147
|
+
|
|
148
|
+
- Auch bekannt als: La Fattoria / Alte Schmiede, Alte Schmiede
|
|
149
|
+
- Website: https://www.pizzeria-lafattoria.de
|
|
150
|
+
`);
|
|
151
|
+
});
|
|
152
|
+
|
|
138
153
|
it("leaves out what is not configured", () => {
|
|
139
|
-
expect(
|
|
140
|
-
|
|
154
|
+
expect(
|
|
155
|
+
buildLlmsTxt({
|
|
156
|
+
name: "ShopBite",
|
|
157
|
+
alternateNames: [],
|
|
158
|
+
url: "https://example.com",
|
|
159
|
+
now,
|
|
160
|
+
}),
|
|
161
|
+
).toBe(`# ShopBite
|
|
141
162
|
|
|
142
163
|
> ShopBite.
|
|
143
164
|
|
package/test/unit/schema.spec.ts
CHANGED
|
@@ -243,11 +243,27 @@ describe("buildRestaurantSchema", () => {
|
|
|
243
243
|
});
|
|
244
244
|
});
|
|
245
245
|
|
|
246
|
+
it("lists other names of the shop as alternateName", () => {
|
|
247
|
+
const schema = buildRestaurantSchema({
|
|
248
|
+
site: {
|
|
249
|
+
name: "Pizzeria La Fattoria",
|
|
250
|
+
url: "https://www.pizzeria-lafattoria.de",
|
|
251
|
+
alternateNames: ["La Fattoria / Alte Schmiede", "Alte Schmiede"],
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
expect(schema.alternateName).toEqual([
|
|
256
|
+
"La Fattoria / Alte Schmiede",
|
|
257
|
+
"Alte Schmiede",
|
|
258
|
+
]);
|
|
259
|
+
});
|
|
260
|
+
|
|
246
261
|
it("leaves empty values out", () => {
|
|
247
262
|
const schema = buildRestaurantSchema({
|
|
248
263
|
site: {
|
|
249
264
|
name: "ShopBite",
|
|
250
265
|
url: "https://example.com",
|
|
266
|
+
alternateNames: [],
|
|
251
267
|
telephone: "",
|
|
252
268
|
address: { street: "", postalCode: "", city: "", country: "DE" },
|
|
253
269
|
},
|