@shopbite-de/storefront 1.26.1 → 1.27.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.
Files changed (38) hide show
  1. package/.github/workflows/build.yaml +1 -1
  2. package/.github/workflows/ci.yaml +3 -3
  3. package/.gitignore +40 -0
  4. package/CLAUDE.md +9 -2
  5. package/app/app.vue +4 -1
  6. package/app/components/Hero.vue +17 -7
  7. package/app/components/User/RegistrationForm.vue +73 -29
  8. package/app/composables/useStoreStatus.ts +12 -7
  9. package/app/composables/useSyncWishlist.ts +119 -0
  10. package/app/pages/[...all].vue +9 -3
  11. package/app/pages/index.vue +1 -5
  12. package/app/pages/kontakt.vue +1 -5
  13. package/app/pages/registrierung/bestaetigen.vue +100 -27
  14. package/app/pages/registrierung/index.vue +20 -1
  15. package/app/utils/notFound.ts +14 -0
  16. package/content/index.yml +9 -9
  17. package/docs/notes/2026-09-21-dependency-update.md +89 -0
  18. package/docs/notes/2026-09-21-issue-273-cache-and-demo-video.md +49 -0
  19. package/docs/notes/2026-09-21-issue-363-non-fatal-404.md +43 -0
  20. package/docs/notes/2026-09-21-issue-365-home-hydration-mismatch.md +47 -0
  21. package/docs/notes/2026-09-21-issue-366-wishlist-404.md +41 -0
  22. package/docs/notes/2026-09-21-issue-369-register-confirm.md +35 -0
  23. package/modules/public-cache.ts +44 -0
  24. package/node.dockerfile +3 -3
  25. package/nuxt.config.ts +6 -0
  26. package/package.json +26 -26
  27. package/patches/@shopware__nuxt-module@1.5.2.patch +13 -0
  28. package/pnpm-workspace.yaml +3 -1
  29. package/shopware.d.ts +1 -1
  30. package/test/nuxt/Hero.test.ts +60 -2
  31. package/test/nuxt/RegisterConfirmPage.test.ts +117 -0
  32. package/test/nuxt/RegistrationForm.test.ts +132 -2
  33. package/test/nuxt/notFound.test.ts +13 -0
  34. package/test/nuxt/useSearchTracking.test.ts +3 -0
  35. package/test/nuxt/useStoreStatus.test.ts +40 -10
  36. package/test/nuxt/useSyncWishlist.test.ts +85 -0
  37. package/test/unit/publicCache.spec.ts +64 -0
  38. package/patches/@shopware__nuxt-module@1.5.1.patch +0 -32
@@ -0,0 +1,64 @@
1
+ import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
2
+ import { tmpdir } from "node:os";
3
+ import { join } from "node:path";
4
+ import { describe, it, expect } from "vitest";
5
+ import type { Nuxt } from "nuxt/schema";
6
+ import publicCache, { PUBLIC_CACHE_CONTROL } from "../../modules/public-cache";
7
+
8
+ function layer(files: string[]) {
9
+ const root = mkdtempSync(join(tmpdir(), "public-cache-"));
10
+ for (const file of files) {
11
+ const path = join(root, "public", file);
12
+ mkdirSync(join(path, ".."), { recursive: true });
13
+ writeFileSync(path, "x");
14
+ }
15
+ return { cwd: root, config: { srcDir: root, rootDir: root } };
16
+ }
17
+
18
+ function run(layers: ReturnType<typeof layer>[], routeRules = {}) {
19
+ const nuxt = { options: { _layers: layers, routeRules } } as unknown as Nuxt;
20
+ publicCache(undefined, nuxt);
21
+ return nuxt.options.routeRules as Record<
22
+ string,
23
+ { headers?: Record<string, string> }
24
+ >;
25
+ }
26
+
27
+ describe("public-cache module", () => {
28
+ it("adds Cache-Control for the public files of every layer", () => {
29
+ const rules = run([
30
+ layer(["brand/logo.png"]),
31
+ layer(["hero-poster.webp", "light/Logo.png"]),
32
+ ]);
33
+
34
+ for (const path of [
35
+ "/brand/logo.png",
36
+ "/hero-poster.webp",
37
+ "/light/Logo.png",
38
+ ]) {
39
+ expect(rules[path]?.headers?.["cache-control"]).toBe(
40
+ PUBLIC_CACHE_CONTROL,
41
+ );
42
+ }
43
+ expect(rules["/"]).toBeUndefined();
44
+ });
45
+
46
+ it("keeps headers a shop configured itself", () => {
47
+ const rules = run([layer(["favicon.ico"])], {
48
+ "/favicon.ico": { headers: { "cache-control": "no-cache", "x-a": "1" } },
49
+ });
50
+
51
+ expect(rules["/favicon.ico"]?.headers).toEqual({
52
+ "cache-control": "no-cache",
53
+ "x-a": "1",
54
+ });
55
+ });
56
+
57
+ it("skips layers without a public directory", () => {
58
+ const root = mkdtempSync(join(tmpdir(), "public-cache-"));
59
+
60
+ expect(
61
+ run([{ cwd: root, config: { srcDir: root, rootDir: root } }]),
62
+ ).toEqual({});
63
+ });
64
+ });
@@ -1,32 +0,0 @@
1
- diff --git a/plugin.ts b/plugin.ts
2
- index 5b9cdef440df1eb477ffea4d66180bc65b33835a..c23d08a8af61875b55e192d108d009bc5ddd7b07 100644
3
- --- a/plugin.ts
4
- +++ b/plugin.ts
5
- @@ -14,7 +14,8 @@ 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
- +import type { Plugin } from "#app";
12
-
13
- declare module "#app" {
14
- interface NuxtApp {
15
- @@ -28,7 +29,10 @@ declare module "vue" {
16
- }
17
- }
18
-
19
- -export default defineNuxtPlugin((NuxtApp) => {
20
- +// Explicit type keeps Nuxt's generated NuxtApp augmentation from
21
- +// recursively depending on this plugin's inferred return type.
22
- +const shopwarePlugin: Plugin<{ shopwareApiClient: ApiClient }> =
23
- + defineNuxtPlugin((NuxtApp) => {
24
- const runtimeConfig = useRuntimeConfig();
25
-
26
- const shopwareRuntimeConfigPublic = runtimeConfig.public
27
- @@ -143,3 +147,5 @@ export default defineNuxtPlugin((NuxtApp) => {
28
- },
29
- };
30
- });
31
- +
32
- +export default shopwarePlugin;