@shopbite-de/storefront 2.3.0 → 2.4.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.
@@ -65,12 +65,12 @@ jobs:
65
65
  - name: Install pnpm
66
66
  uses: pnpm/action-setup@v6
67
67
  with:
68
- version: 12.11.2
68
+ version: 12.21.0
69
69
 
70
70
  - name: Install Node.js
71
71
  uses: actions/setup-node@v7
72
72
  with:
73
- node-version: '24'
73
+ node-version: '26'
74
74
  cache: 'pnpm'
75
75
  registry-url: 'https://registry.npmjs.org'
76
76
 
@@ -25,11 +25,11 @@ jobs:
25
25
 
26
26
  - uses: pnpm/action-setup@v6
27
27
  with:
28
- version: 12.11.2
28
+ version: 12.21.0
29
29
 
30
30
  - uses: actions/setup-node@v7
31
31
  with:
32
- node-version: '24'
32
+ node-version: '26'
33
33
  cache: 'pnpm'
34
34
 
35
35
  - name: Install build dependencies
@@ -69,11 +69,11 @@ jobs:
69
69
 
70
70
  - uses: pnpm/action-setup@v6
71
71
  with:
72
- version: 12.11.2
72
+ version: 12.21.0
73
73
 
74
74
  - uses: actions/setup-node@v7
75
75
  with:
76
- node-version: '24'
76
+ node-version: '26'
77
77
 
78
78
  - name: Restore workspace from cache
79
79
  uses: actions/cache/restore@v6
@@ -105,11 +105,11 @@ jobs:
105
105
 
106
106
  - uses: pnpm/action-setup@v6
107
107
  with:
108
- version: 12.11.2
108
+ version: 12.21.0
109
109
 
110
110
  - uses: actions/setup-node@v7
111
111
  with:
112
- node-version: '24'
112
+ node-version: '26'
113
113
 
114
114
  - name: Restore workspace from cache
115
115
  uses: actions/cache/restore@v6
@@ -134,11 +134,11 @@ jobs:
134
134
 
135
135
  - uses: pnpm/action-setup@v6
136
136
  with:
137
- version: 12.11.2
137
+ version: 12.21.0
138
138
 
139
139
  - uses: actions/setup-node@v7
140
140
  with:
141
- node-version: '24'
141
+ node-version: '26'
142
142
 
143
143
  - name: Restore workspace from cache
144
144
  uses: actions/cache/restore@v6
@@ -172,11 +172,11 @@ jobs:
172
172
 
173
173
  - uses: pnpm/action-setup@v6
174
174
  with:
175
- version: 12.11.2
175
+ version: 12.21.0
176
176
 
177
177
  - uses: actions/setup-node@v7
178
178
  with:
179
- node-version: '24'
179
+ node-version: '26'
180
180
 
181
181
  - name: Restore workspace from cache
182
182
  uses: actions/cache/restore@v6
@@ -226,7 +226,7 @@ jobs:
226
226
  #
227
227
  # - uses: actions/setup-node@v6
228
228
  # with:
229
- # node-version: '24'
229
+ # node-version: '26'
230
230
  #
231
231
  # - name: Restore workspace from cache
232
232
  # uses: actions/cache/restore@v5
package/.nuxtrc CHANGED
@@ -1 +1 @@
1
- setups.@nuxt/test-utils="4.3.3"
1
+ setups.@nuxt/test-utils="4.4.0"
package/CLAUDE.md CHANGED
@@ -51,11 +51,12 @@ pnpm playwright test test/e2e/checkout.spec.ts
51
51
 
52
52
  Always run `nuxt typecheck` via the `pnpm typecheck` script, not via `npx vue-tsc`. The global npx-cached `vue-tsc` version may not be compatible with the project's installed `vue-router`. If `.nuxt/tsconfig.json` has stale pnpm paths after a dependency update (or after adding/renaming a composable), run `pnpm nuxt prepare` to regenerate it.
53
53
 
54
- `pnpm typecheck` must stay at zero errors; CI runs it in the lint job. The sources of `@shopware/composables` and the `@shopware/nuxt-module` plugin are part of the checked program, so three things keep them green (see `docs/notes/2026-09-08-issue-277-typecheck.md`):
54
+ `pnpm typecheck` must stay at zero errors; CI runs it in the lint job. The sources of `@shopware/composables` and the `@shopware/nuxt-module` plugin are part of the checked program, so two things keep them green (see `docs/notes/2026-09-08-issue-277-typecheck.md`):
55
55
 
56
56
  - `shopware.d.ts` falls back to the api-client's default types for operations/schemas our instance does not expose, and keeps `LineItem.payload` optional.
57
57
  - `api-gen.config.json` applies the upstream schema patches plus `api-types/storeApiSchema.shopbite.overrides.json` when generating types.
58
- - `patches/@shopware__nuxt-module@1.5.2.patch` (pnpm patch) points the plugin's `ShopwareNuxtOptions` import at `./dist/index` (the package ships no `src/`). Since 1.5.2 the plugin carries its explicit type upstream, so this one line is all that is left. When Renovate bumps `@shopware/nuxt-module`, the patch must be re-applied to the new version (`pnpm patch @shopware/nuxt-module@<version>`), or dropped once upstream fixes the import.
58
+
59
+ Until 1.5.2 a pnpm patch fixed the plugin's `ShopwareNuxtOptions` import (`./src`, not shipped). `@shopware/nuxt-module` 1.6 imports `ShopwareNuxtOptions` from its package name, so the patch is gone (`docs/notes/2026-11-18-dependency-update.md`). If a future version breaks the plugin's types again, patch it with `pnpm patch @shopware/nuxt-module@<version>` and add `patches/` to `node.dockerfile`'s `COPY`.
59
60
 
60
61
  Do not name a project composable like one from the `@shopware/composables` layer (e.g. `useCategory`): the project version shadows the layer's inside the layer's own code as well.
61
62
 
package/app/app.vue CHANGED
@@ -100,7 +100,7 @@ useSeoMeta({
100
100
  </script>
101
101
 
102
102
  <template>
103
- <VitePwaManifest />
103
+ <NuxtPwaManifest />
104
104
  <NuxtLoadingIndicator />
105
105
 
106
106
  <div>
@@ -164,8 +164,7 @@ const error = (name: string) => props.errors?.[`${props.prefix}.${name}`];
164
164
  class="flex flex-col gap-3 rounded-sb-control bg-sb-primary-tint p-4 font-body text-sb-ink sm:col-span-6 sm:flex-row sm:items-center sm:justify-between"
165
165
  >
166
166
  <span>
167
- Meinten Sie: <strong>{{ correction?.label }}</strong
168
- >?
167
+ Meinten Sie: <strong>{{ correction?.label }}</strong>?
169
168
  </span>
170
169
  <SbButton variant="secondary" @click="applyCorrection"
171
170
  >Übernehmen</SbButton
@@ -217,6 +217,10 @@ function logoutHandler() {
217
217
  <path d="M16 10a4 4 0 0 1-8 0" />
218
218
  </svg>
219
219
  <span class="hidden sm:inline" aria-hidden="true">Warenkorb</span>
220
+ <!-- the space keeps the visible text "Warenkorb 2" (not
221
+ "Warenkorb2") part of the button name (WCAG 2.5.3); a flex
222
+ container does not render it -->
223
+ {{ " " }}
220
224
  <span
221
225
  v-if="cartCount"
222
226
  aria-hidden="true"
@@ -138,8 +138,7 @@ function onLinkClick(event: MouseEvent) {
138
138
  >{{ name }}</a
139
139
  >
140
140
  <template v-else>
141
- <span class="sr-only">{{ numberLabel }}</span
142
- >{{ name }}
141
+ <span class="sr-only">{{ numberLabel }}</span>{{ name }}
143
142
  </template>
144
143
  </h3>
145
144
  <p
@@ -48,8 +48,7 @@ onMounted(async () => {
48
48
  Wir haben sie erhalten und bereiten sie jetzt vor.
49
49
  <template v-if="order?.orderNumber">
50
50
  Ihre Bestellnummer ist
51
- <strong class="tabular-nums">{{ order.orderNumber }}</strong
52
- >.
51
+ <strong class="tabular-nums">{{ order.orderNumber }}</strong>.
53
52
  </template>
54
53
  </p>
55
54
  </header>
@@ -78,8 +78,7 @@ function onVariantSelected(variant: Schemas["Product"]) {
78
78
  <DialogTitle
79
79
  class="font-display text-xl leading-tight hyphens-auto [overflow-wrap:anywhere] sm:text-2xl"
80
80
  >
81
- <span class="sr-only">{{ numberLabel }}</span
82
- >{{ label }}
81
+ <span class="sr-only">{{ numberLabel }}</span>{{ label }}
83
82
  </DialogTitle>
84
83
  <DialogDescription
85
84
  v-if="description || diets.length"
@@ -0,0 +1,118 @@
1
+ # Dependency update — 2026-11-18
2
+
3
+ Branch `deps-2026-11-18`. Previous round:
4
+ `2026-09-21-dependency-update.md`.
5
+
6
+ ## Packages
7
+
8
+ Minor and patch updates of every direct dependency (one commit), then each
9
+ major on its own:
10
+
11
+ | Package | From | To |
12
+ | --- | --- | --- |
13
+ | pnpm | 12.11.2 | 12.21.0 |
14
+ | nuxt | 4.6.2 | 4.6.4 |
15
+ | @nuxt/content | 3.16.2 | 3.17.0 |
16
+ | @shopware/api-client | 1.7.0 | 1.8.0 |
17
+ | @shopware/composables | 1.14.0 | 1.15.0 |
18
+ | @shopware/nuxt-module | 1.5.2 | 1.6.1 |
19
+ | eslint / typescript-eslint / vitest / prettier | | latest minor |
20
+ | happy-dom | 20.14.6 | 21.0.4 (major) |
21
+ | jsdom | 30.1.3 | 31.0.1 (major) |
22
+ | @nuxt/fonts | 0.14.0 | 1.2.0 (major) |
23
+ | @nuxtjs/sitemap | 8.6.2 | 9.1.0 (major) |
24
+ | @nuxtjs/robots | 6.2.4 | 7.0.2 (major) |
25
+ | nuxt-vitalizer | 3.0.0 | 4.0.0 (major) |
26
+ | @vite-pwa/nuxt | 1.1.1 | 2.0.1 (major) |
27
+ | Node (Docker image, CI) | 24 | 26 (LTS since 2026-10-28) |
28
+
29
+ Held back:
30
+
31
+ - **typescript 7**: typescript-eslint 8.73 still declares
32
+ `typescript >=4.8.4 <6.1.0`, and TypeScript 7 (the Go compiler) ships no
33
+ classic compiler API, which vue-tsc needs.
34
+ - **@nuxt/devtools-kit 4**: Nuxt 4.6 depends on `@nuxt/devtools` 3, and
35
+ `@nuxt/eslint`, `@nuxt/hints` and `@nuxt/test-utils` require the kit `^3`.
36
+ The kit is only listed to satisfy those peers.
37
+ - **pnpm 12.22.0, @vite-pwa/nuxt 2.0.2**: younger than `minimumReleaseAge`.
38
+
39
+ ## What needed changes
40
+
41
+ ### @shopware/nuxt-module 1.6: patch gone
42
+
43
+ The plugin imports `ShopwareNuxtOptions` from `@shopware/nuxt-module`
44
+ instead of the unshipped `./src`, so `patches/` and `patchedDependencies`
45
+ are gone, and `node.dockerfile` no longer copies `patches/`.
46
+
47
+ ### Prettier 3.10
48
+
49
+ Inline elements followed by punctuation stay on one line; four templates
50
+ were reformatted, the rendered text is unchanged.
51
+
52
+ ### @nuxt/fonts 1
53
+
54
+ Fonts are Vite build assets under `/_nuxt/fonts/` (was `/_fonts/`), so they
55
+ get the immutable cache of `/_nuxt/`. `throwOnError` now defaults to `true`:
56
+ a production build fails when Google Fonts cannot be reached. The theme
57
+ module pins the weights of every family, so the new `400 700` default
58
+ weight range does not add faces.
59
+
60
+ ### Nuxt SEO v6 (sitemap 9, robots 7, site config 5)
61
+
62
+ The three move together. Server functions and Nitro hooks take the
63
+ portable `RequestEvent` of `nuxt/server` instead of h3's `H3Event`:
64
+
65
+ - `server/routes/llms.txt.ts` uses `defineEventHandler` from
66
+ `nuxt/server`. On Nitro 2 only such handlers get the web-standard event
67
+ (`event.url`, `event.req.headers`) that `getPathRobotConfig()` reads; an
68
+ h3 handler's `event.req` is the Node request and the call would throw.
69
+ - The `robots:config` and `site-config:init` hooks call `useRuntimeConfig()`
70
+ without the event.
71
+ - The module types bring Nitro's typed `$fetch` into the server program;
72
+ `storeApiPost`/`storeApiGet` assert their generic response type.
73
+
74
+ `robots.txt` was compared before and after, for `NUXT_SITE_INDEXABLE=true`
75
+ and `false`: byte-identical. Site Config 5 warns at build time that no site
76
+ URL is set for prerendering; only the Nuxt Content dumps are prerendered and
77
+ the URL comes from `storeUrl` at runtime, so the warning is harmless.
78
+ `pnpm peers check` lists `zod ^4.6.5` (optional peer of sitemap and robots
79
+ for `defineSitemapSchema()`); `content.config.ts` passes the `z` of Nuxt
80
+ Content, so the peer is not used.
81
+
82
+ ### nuxt-vitalizer 4
83
+
84
+ Removes `disableStylesheets` (unused here); the defaults are unchanged.
85
+
86
+ ### @vite-pwa/nuxt 2
87
+
88
+ Built on unplugin-pwa instead of vite-plugin-pwa:
89
+
90
+ - `workbox` is deprecated, the same settings now live under `generateSW`.
91
+ - The `VitePwaManifest` component no longer exists: `app.vue` renders
92
+ `NuxtPwaManifest`. An unknown component only warns at runtime, so
93
+ without the rename the manifest link would silently disappear.
94
+ - The module adds a `**/_payload.json` precache pattern whenever something
95
+ is prerendered (the Nuxt Content dumps). No page payload exists, and an
96
+ empty pattern now fails the build: `globStrict: false` restores the
97
+ warning of 1.x. `cleanupOutdatedCaches` is no longer on by default and
98
+ is set explicitly.
99
+
100
+ The service worker precaches the same files as before, the web manifest is
101
+ byte-identical.
102
+
103
+ ### Node 26
104
+
105
+ Node 26 is LTS since 2026-10-28 and no longer bundles corepack:
106
+ `node.dockerfile` installs pnpm with `npm install -g`. CI sets up pnpm with
107
+ `pnpm/action-setup`, which does not need corepack.
108
+
109
+ ## Checks
110
+
111
+ After every step: eslint, prettier, typecheck, unit tests, `pnpm build` and
112
+ `pnpm nuxt build test/layer`. At the end, the quickstart storefront was
113
+ built against this branch as its layer (Node 26) and ran in the
114
+ quickstart stack: the smoke test passed (start page, menu section, pizza
115
+ with an extra, guest checkout, contact form, both mails), and the manifest
116
+ link, `/sw.js`, `/robots.txt`, `/sitemap.xml` (category URLs keep their
117
+ trailing slash) and `/llms.txt` (`text/markdown`, content pages listed)
118
+ answered as expected.
package/node.dockerfile CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
- FROM node:24-alpine AS build
2
+ FROM node:26-alpine AS build
3
3
 
4
- ARG PNPM_VERSION=12.5.1
4
+ ARG PNPM_VERSION=12.21.0
5
5
  ARG NUXT_PUBLIC_SHOPWARE_ENDPOINT='https://my.shop/store-api'
6
6
  ARG NUXT_PUBLIC_SHOPWARE_ACCESS_TOKEN='TOKEN'
7
7
 
@@ -12,20 +12,20 @@ ENV NODE_OPTIONS="--max-old-space-size=4096"
12
12
 
13
13
  WORKDIR /app
14
14
 
15
- RUN corepack enable && corepack prepare pnpm@${PNPM_VERSION} --activate
15
+ # Node 25+ no longer bundles corepack
16
+ RUN npm install -g pnpm@${PNPM_VERSION}
16
17
 
17
18
  # Copy manifests first so dependency layer is cached independently from source changes.
18
- # pnpm-workspace.yaml (settings, allowBuilds, patchedDependencies) and patches/ are part of the
19
- # lockfile contract; without them `--frozen-lockfile` fails.
19
+ # pnpm-workspace.yaml (settings, allowBuilds) is part of the lockfile contract; without it
20
+ # `--frozen-lockfile` fails. Copy patches/ as well if a pnpm patch is added again.
20
21
  COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
21
- COPY patches ./patches
22
22
  RUN pnpm install --frozen-lockfile --prefer-offline
23
23
 
24
24
  COPY . .
25
25
 
26
26
  RUN pnpm build
27
27
 
28
- FROM node:24-alpine AS production
28
+ FROM node:26-alpine AS production
29
29
 
30
30
  WORKDIR /app
31
31
 
package/nuxt.config.ts CHANGED
@@ -288,9 +288,17 @@ export default defineNuxtConfig({
288
288
  },
289
289
  ],
290
290
  },
291
- workbox: {
291
+ // `workbox` before @vite-pwa/nuxt 2.
292
+ generateSW: {
292
293
  globPatterns: ["**/*.{js,css,html,png,svg,ico}"],
293
294
  globIgnores: ["**/_payload.json"],
295
+ // The module adds a `**/_payload.json` pattern because Nuxt Content
296
+ // prerenders its database dumps; no page payload exists, and since
297
+ // 2.0 an empty pattern fails the build unless globStrict is off (the
298
+ // warning of 1.x).
299
+ globStrict: false,
300
+ // default of 1.x, off by default since 2.0
301
+ cleanupOutdatedCaches: true,
294
302
  navigateFallback: null,
295
303
  runtimeCaching: [
296
304
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopbite-de/storefront",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "main": "nuxt.config.ts",
5
5
  "description": "Shopware storefront for food delivery shops",
6
6
  "keywords": [
@@ -18,55 +18,55 @@
18
18
  "license": "MIT",
19
19
  "type": "module",
20
20
  "dependencies": {
21
- "@nuxt/content": "3.16.2",
22
- "@nuxt/fonts": "^0.14.0",
23
- "@nuxt/image": "^2.1.0",
21
+ "@nuxt/content": "3.17.0",
22
+ "@nuxt/fonts": "^1.2.0",
23
+ "@nuxt/image": "^2.2.1",
24
24
  "@nuxt/scripts": "1.3.12",
25
- "@nuxtjs/robots": "^6.2.3",
26
- "@nuxtjs/sitemap": "^8.5.1",
27
- "@shopware/api-client": "^1.6.0",
28
- "@shopware/api-gen": "^1.5.2",
29
- "@shopware/composables": "^1.13.0",
30
- "@shopware/helpers": "^1.8.0",
31
- "@shopware/nuxt-module": "^1.5.2",
32
- "@tailwindcss/vite": "^4.3.3",
33
- "@unhead/vue": "^3.4.1",
34
- "@vite-pwa/nuxt": "^1.1.1",
25
+ "@nuxtjs/robots": "^7.0.2",
26
+ "@nuxtjs/sitemap": "^9.1.0",
27
+ "@shopware/api-client": "^1.8.0",
28
+ "@shopware/api-gen": "^1.6.0",
29
+ "@shopware/composables": "^1.15.0",
30
+ "@shopware/helpers": "^1.9.0",
31
+ "@shopware/nuxt-module": "^1.6.1",
32
+ "@tailwindcss/vite": "^4.3.5",
33
+ "@unhead/vue": "^3.4.3",
34
+ "@vite-pwa/nuxt": "^2.0.1",
35
35
  "@vueuse/core": "^15.0.0",
36
- "dotenv": "^18.0.3",
36
+ "dotenv": "^18.0.10",
37
37
  "fflate": "^0.8.3",
38
- "nuxt": "^4.5.2",
39
- "nuxt-vitalizer": "3.0.0",
40
- "reka-ui": "^2.10.5",
41
- "uuid": "^14.0.2"
38
+ "nuxt": "^4.6.4",
39
+ "nuxt-vitalizer": "4.0.0",
40
+ "reka-ui": "^2.11.0",
41
+ "uuid": "^14.0.3"
42
42
  },
43
43
  "devDependencies": {
44
- "@axe-core/playwright": "^4.13.0",
45
- "@nuxt/devtools-kit": "^3.4.2",
44
+ "@axe-core/playwright": "^4.14.0",
45
+ "@nuxt/devtools-kit": "^3.4.4",
46
46
  "@nuxt/eslint": "^1.17.0",
47
47
  "@nuxt/hints": "1.1.5",
48
- "@nuxt/test-utils": "^4.3.2",
49
- "@playwright/test": "^1.63.0",
48
+ "@nuxt/test-utils": "^4.4.0",
49
+ "@playwright/test": "^1.65.1",
50
50
  "@types/js-cookie": "^3.0.6",
51
- "@types/node": "^26.6.2",
52
- "@typescript-eslint/eslint-plugin": "^8.70.1",
53
- "@typescript-eslint/parser": "^8.70.1",
54
- "@vitejs/plugin-vue": "^6.0.9",
55
- "@vitest/ui": "5.0.5",
56
- "@vue/compiler-dom": "^3.5.43",
57
- "@vue/server-renderer": "^3.5.43",
58
- "@vue/test-utils": "^2.5.1",
59
- "@vue/typescript-plugin": "^3.3.11",
60
- "eslint": "^10.11.0",
51
+ "@types/node": "^26.6.6",
52
+ "@typescript-eslint/eslint-plugin": "^8.73.0",
53
+ "@typescript-eslint/parser": "^8.73.0",
54
+ "@vitejs/plugin-vue": "^6.0.11",
55
+ "@vitest/ui": "5.1.0",
56
+ "@vue/compiler-dom": "^3.5.45",
57
+ "@vue/server-renderer": "^3.5.45",
58
+ "@vue/test-utils": "^2.6.0",
59
+ "@vue/typescript-plugin": "^3.3.14",
60
+ "eslint": "^10.15.0",
61
61
  "eslint-config-prettier": "^10.1.8",
62
- "happy-dom": "^20.14.5",
63
- "jsdom": "^30.1.1",
64
- "playwright-core": "^1.63.0",
65
- "prettier": "^3.9.9",
66
- "tailwindcss": "^4.3.3",
62
+ "happy-dom": "^21.0.4",
63
+ "jsdom": "^31.0.1",
64
+ "playwright-core": "^1.65.1",
65
+ "prettier": "^3.10.1",
66
+ "tailwindcss": "^4.3.5",
67
67
  "typescript": "^6.0.3",
68
- "vitest": "^5.0.1",
69
- "vue-tsc": "3.3.13"
68
+ "vitest": "^5.1.0",
69
+ "vue-tsc": "3.3.14"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "nuxt build",
@@ -7,5 +7,3 @@ allowBuilds:
7
7
  sharp: true
8
8
  unrs-resolver: true
9
9
  vue-demi: true
10
- patchedDependencies:
11
- '@shopware/nuxt-module@1.5.2': patches/@shopware__nuxt-module@1.5.2.patch
@@ -8,7 +8,7 @@ import { buildAiCrawlerGroups } from "../utils/aiCrawlers";
8
8
  */
9
9
  export default defineNitroPlugin((nitroApp) => {
10
10
  nitroApp.hooks.hook("robots:config", (ctx) => {
11
- const { aiCrawlers } = useRuntimeConfig(ctx.event);
11
+ const { aiCrawlers } = useRuntimeConfig();
12
12
  const wildcard = ctx.groups.find((group) =>
13
13
  [group.userAgent ?? "*"].flat().includes("*"),
14
14
  );
@@ -4,8 +4,8 @@
4
4
  * the request origin (which is internal behind a reverse proxy).
5
5
  */
6
6
  export default defineNitroPlugin((nitroApp) => {
7
- nitroApp.hooks.hook("site-config:init", ({ event, siteConfig }) => {
8
- const { storeUrl } = useRuntimeConfig(event).public;
7
+ nitroApp.hooks.hook("site-config:init", ({ siteConfig }) => {
8
+ const { storeUrl } = useRuntimeConfig().public;
9
9
  if (storeUrl) {
10
10
  siteConfig.push({ _context: "storeUrl", url: storeUrl });
11
11
  }
@@ -1,4 +1,5 @@
1
1
  import { queryCollection } from "@nuxt/content/server";
2
+ import { defineEventHandler } from "nuxt/server";
2
3
  import type { components } from "~~/api-types/storeApiTypes";
3
4
  import { getDiets, getMainIngredients } from "../../app/utils/product";
4
5
  import { productDeepLink } from "../../app/utils/productUrl";
@@ -50,9 +51,12 @@ const PRODUCT_CRITERIA = {
50
51
  * `/llms.txt` (#402): the shop, its hours, ordering and the menu as Markdown
51
52
  * for language models. Every source is optional; a failing request leaves
52
53
  * its section out instead of failing the file.
54
+ *
55
+ * A `nuxt/server` handler: its event has the web-standard shape that
56
+ * `getPathRobotConfig()` of @nuxtjs/robots 7 reads.
53
57
  */
54
58
  export default defineEventHandler(async (event) => {
55
- const { shopware, site } = useRuntimeConfig(event).public;
59
+ const { shopware, site } = useRuntimeConfig().public;
56
60
  const siteUrl = getSiteConfig(event).url;
57
61
  const headers = { "sw-access-key": shopware.accessToken };
58
62
  const menuRoot = await menuRootId();
@@ -155,7 +159,7 @@ export default defineEventHandler(async (event) => {
155
159
  now: new Date(),
156
160
  });
157
161
 
158
- setResponseHeader(event, "Content-Type", "text/markdown; charset=utf-8");
162
+ event.res.headers.set("Content-Type", "text/markdown; charset=utf-8");
159
163
  return body;
160
164
  });
161
165
 
@@ -26,6 +26,8 @@ export function storeApiPost<T>(
26
26
  ): Promise<T> {
27
27
  const { endpoint, accessToken } = useRuntimeConfig().public.shopware;
28
28
 
29
+ // Nitro's typed $fetch resolves the response type per internal route; for
30
+ // a generic T on an external URL it cannot, so the type is asserted.
29
31
  return $fetch<T>(`${endpoint}${path}`, {
30
32
  method: "POST",
31
33
  headers: { "sw-access-key": accessToken, ...options.headers },
@@ -33,7 +35,7 @@ export function storeApiPost<T>(
33
35
  // a failing request reaches Shopware once (the cached routes back off
34
36
  // instead)
35
37
  retry: 0,
36
- });
38
+ }) as Promise<T>;
37
39
  }
38
40
 
39
41
  /**
@@ -52,5 +54,5 @@ export function storeApiGet<T>(
52
54
  // ofetch retries a GET once by default; during an outage that doubles
53
55
  // every request
54
56
  retry: 0,
55
- });
57
+ }) as Promise<T>;
56
58
  }
@@ -141,7 +141,9 @@ const sampleOrder = {
141
141
  };
142
142
 
143
143
  async function mockOrder(page: Page) {
144
- await page.route("**/store-api/order", (route) =>
144
+ // @shopware/composables 1.15 sends checkPromotion as a query parameter
145
+ // (/store-api/order?checkPromotion=true), which a glob would not match.
146
+ await page.route(/\/store-api\/order(\?|$)/, (route) =>
145
147
  route.fulfill({
146
148
  json: {
147
149
  orders: { elements: [sampleOrder], total: 1 },
@@ -36,7 +36,9 @@ mockNuxtImport("useUser", () => () => ({
36
36
  }));
37
37
  mockNuxtImport("useShopBiteConfig", () => () => ({
38
38
  isCheckoutEnabled: ref(true),
39
+ deliveryTime: ref(30),
39
40
  refresh: vi.fn(),
41
+ checkCheckoutEnabled: vi.fn().mockResolvedValue(true),
40
42
  }));
41
43
  mockNuxtImport("useTrackEvent", () => () => ({ trackOrder: vi.fn() }));
42
44
  mockNuxtImport("useCheckoutMethodGuard", () => () => ({
@@ -46,10 +46,19 @@ mockNuxtImport("useWishlist", () => () => ({
46
46
  mockNuxtImport("useShopBiteConfig", () => () => ({
47
47
  isCheckoutEnabled: ref(true),
48
48
  }));
49
- mockNuxtImport("useUser", () => () => ({
50
- isLoggedIn: computed(() => state.loggedIn),
51
- isGuestSession: computed(() => false),
52
- logout: mocks.logout,
49
+ function userApi() {
50
+ return {
51
+ isLoggedIn: computed(() => state.loggedIn),
52
+ isGuestSession: computed(() => false),
53
+ logout: mocks.logout,
54
+ };
55
+ }
56
+ mockNuxtImport("useUser", () => () => userApi());
57
+ // Header.vue imports useUser from the package; since @shopware/composables
58
+ // 1.15 the auto-import mock above no longer reaches that import.
59
+ vi.mock("@shopware/composables", async (importOriginal) => ({
60
+ ...(await importOriginal<typeof import("@shopware/composables")>()),
61
+ useUser: () => userApi(),
53
62
  }));
54
63
  mockNuxtImport("useStoreStatus", () => () => ({ status: ref(null) }));
55
64
  mockNuxtImport("useBusinessHours", () => () => ({
@@ -1,13 +0,0 @@
1
- diff --git a/plugin.ts b/plugin.ts
2
- index 2b843eaa6d89f38ef4bd1bce3a0090aa41034572..3a59bd45ac795e80d668fa195f5f311bb92c8a4b 100644
3
- --- a/plugin.ts
4
- +++ b/plugin.ts
5
- @@ -16,7 +16,7 @@ import {
6
- } from "#imports";
7
- import type { ApiClient } from "#shopware";
8
-
9
- -import type { ShopwareNuxtOptions } from "./src";
10
- +import type { ShopwareNuxtOptions } from "./dist/index";
11
-
12
- type ShopwarePluginInjections = {
13
- shopwareApiClient: ApiClient;