create-brainerce-store 1.53.0 → 1.55.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/dist/index.js +9 -2
- package/package.json +1 -1
- package/templates/nextjs/base/src/app/blog/[slug]/page.tsx.ejs +17 -31
- package/templates/nextjs/base/src/app/category/[slug]/page.tsx +106 -0
- package/templates/nextjs/base/src/app/indexnow-key.txt/route.ts +26 -0
- package/templates/nextjs/base/src/app/llms.txt/route.ts +44 -0
- package/templates/nextjs/base/src/app/products/[slug]/page.tsx +175 -157
- package/templates/nextjs/base/src/app/sitemap.ts +18 -1
- package/templates/nextjs/base/src/components/brainerce-bot.tsx +7 -0
- package/templates/nextjs/base/src/components/checkout/checkout-form.tsx +564 -551
- package/templates/nextjs/base/src/components/seo/article-json-ld.tsx +59 -0
- package/templates/nextjs/base/src/components/seo/breadcrumbs.tsx +37 -0
- package/templates/nextjs/base/src/components/seo/category-json-ld.tsx +61 -0
- package/templates/nextjs/base/src/components/seo/organization-json-ld.tsx +4 -1
- package/templates/nextjs/base/src/components/seo/product-json-ld.tsx +56 -2
- package/templates/nextjs/base/src/core/lib/store-info.ts +3 -0
- package/templates/nextjs/designs/atelier/globals.css +1 -1
- package/templates/nextjs/designs/atelier/messages-patch/en.json +13 -13
- package/templates/nextjs/designs/atelier/messages-patch/he.json +15 -15
- package/templates/nextjs/designs/atelier/ui/home/category-tiles.tsx +16 -13
- package/templates/nextjs/designs/atelier/ui/shared/icons.tsx +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MetadataRoute } from 'next';
|
|
2
|
+
import { getBlogSitemapEntries, getCategorySitemapEntries } from 'brainerce';
|
|
2
3
|
import { getServerClient } from '@/core/lib/brainerce';
|
|
3
4
|
|
|
4
5
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
@@ -42,7 +43,23 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
|
42
43
|
});
|
|
43
44
|
});
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
// Category (collection) pages — the highest-value organic-SEO surface;
|
|
47
|
+
// must be crawlable so they can rank for broad research-intent queries.
|
|
48
|
+
const categoryPages: MetadataRoute.Sitemap = await getCategorySitemapEntries(client, {
|
|
49
|
+
siteUrl: baseUrl,
|
|
50
|
+
locales: isMultiLocale ? supportedLocales : undefined,
|
|
51
|
+
defaultLocale: defaultLoc,
|
|
52
|
+
}).catch(() => []);
|
|
53
|
+
|
|
54
|
+
// Blog posts — the SEO Autopilot (and manual publishes) must be
|
|
55
|
+
// discoverable; missing blog entries = articles never get crawled.
|
|
56
|
+
const blogPages: MetadataRoute.Sitemap = await getBlogSitemapEntries(client, {
|
|
57
|
+
siteUrl: baseUrl,
|
|
58
|
+
locales: isMultiLocale ? supportedLocales : undefined,
|
|
59
|
+
defaultLocale: defaultLoc,
|
|
60
|
+
}).catch(() => []);
|
|
61
|
+
|
|
62
|
+
return [...staticPages, ...productPages, ...categoryPages, ...blogPages];
|
|
46
63
|
} catch {
|
|
47
64
|
return staticPages;
|
|
48
65
|
}
|
|
@@ -34,6 +34,13 @@ export function BrainerceBotWidget() {
|
|
|
34
34
|
BrainerceBot.mount({
|
|
35
35
|
connectionId,
|
|
36
36
|
baseUrl: process.env.NEXT_PUBLIC_BRAINERCE_API_URL || undefined,
|
|
37
|
+
// Order-lookup login gating: this template's own same-origin BFF proxy
|
|
38
|
+
// (see src/app/api/store/[...path]/route.ts) already forwards the
|
|
39
|
+
// shopper's httpOnly session cookie as a Bearer header — the same
|
|
40
|
+
// mechanism @/core/lib/brainerce's own client uses. Opting the bot in
|
|
41
|
+
// here lets it detect login state without the widget ever touching the
|
|
42
|
+
// cookie itself.
|
|
43
|
+
customerSessionProxyPath: '/api/store',
|
|
37
44
|
onAddToCart: async ({ productId, variantId, quantity }) => {
|
|
38
45
|
try {
|
|
39
46
|
const { getClient } = await import('@/core/lib/brainerce');
|