create-brainerce-store 1.65.0 → 1.67.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 +2 -2
- package/messages/en.json +505 -502
- package/messages/he.json +505 -502
- package/package.json +1 -1
- package/templates/nextjs/base/.env.local.ejs +45 -24
- package/templates/nextjs/base/.eslintrc.json +51 -57
- package/templates/nextjs/base/AGENTS.md.ejs +107 -81
- package/templates/nextjs/base/CLAUDE.md.ejs +118 -92
- package/templates/nextjs/base/next.config.ts +103 -86
- package/templates/nextjs/base/scripts/fetch-store-info.mjs +104 -97
- package/templates/nextjs/base/src/app/agents.md/route.ts +4 -3
- package/templates/nextjs/base/src/app/api/auth/me/route.ts +65 -59
- package/templates/nextjs/base/src/app/api/store/[...path]/route.ts +255 -242
- package/templates/nextjs/base/src/app/blog/[slug]/page.tsx.ejs +311 -308
- package/templates/nextjs/base/src/app/blog/page.tsx.ejs +277 -276
- package/templates/nextjs/base/src/app/blog/rss.xml/route.ts +4 -3
- package/templates/nextjs/base/src/app/category/[slug]/page.tsx +6 -5
- package/templates/nextjs/base/src/app/faq/page.tsx.ejs +46 -46
- package/templates/nextjs/base/src/app/indexnow-key.txt/route.ts +25 -26
- package/templates/nextjs/base/src/app/layout.tsx.ejs +273 -257
- package/templates/nextjs/base/src/app/llms.txt/route.ts +4 -3
- package/templates/nextjs/base/src/app/opengraph-image.tsx +1 -1
- package/templates/nextjs/base/src/app/page.tsx +65 -64
- package/templates/nextjs/base/src/app/pages/[slug]/page.tsx.ejs +92 -92
- package/templates/nextjs/base/src/app/products/[slug]/page.tsx +10 -5
- package/templates/nextjs/base/src/app/robots.ts +3 -2
- package/templates/nextjs/base/src/app/sitemap.ts +4 -3
- package/templates/nextjs/base/src/components/checkout/custom-fields-step.tsx +294 -292
- package/templates/nextjs/base/src/components/seo/article-json-ld.tsx +60 -59
- package/templates/nextjs/base/src/components/seo/category-json-ld.tsx +60 -61
- package/templates/nextjs/base/src/components/seo/product-json-ld.tsx +16 -2
- package/templates/nextjs/base/src/core/lib/brainerce.server.ts +81 -0
- package/templates/nextjs/base/src/core/lib/brainerce.ts.ejs +60 -110
- package/templates/nextjs/base/src/core/lib/site-url.ts +197 -0
- package/templates/nextjs/base/src/ui/product/faq-section.tsx.ejs +46 -0
- package/templates/nextjs/base/src/ui/product/review-form.tsx +294 -294
- package/templates/nextjs/base/src/ui/product/reviews-section.tsx.ejs +108 -108
- package/templates/nextjs/designs/atelier/app-overlay/layout.tsx.ejs +301 -285
- package/templates/nextjs/designs/atelier/ui/layout/faq-section.tsx +97 -96
- package/templates/nextjs/designs/atelier/ui/layout/site-footer.tsx.ejs +142 -141
- package/templates/nextjs/designs/atelier/ui/layout/site-header.tsx.ejs +139 -138
- package/templates/nextjs/designs/atelier/ui/product/review-form.tsx +295 -267
- package/templates/nextjs/designs/atelier/ui/product/reviews-section.tsx.ejs +148 -148
- package/templates/nextjs/ui-canvas/layout/faq-section.tsx.ejs +72 -71
- package/templates/nextjs/ui-canvas/layout/site-footer.tsx.ejs +83 -82
- package/templates/nextjs/ui-canvas/layout/site-header.tsx.ejs +120 -119
- package/templates/nextjs/ui-canvas/product/faq-section.tsx.ejs +54 -0
- package/templates/nextjs/ui-canvas/product/review-form.tsx +267 -266
- package/templates/nextjs/ui-canvas/product/reviews-section.tsx.ejs +96 -96
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FAQ page — fully driven by the merchant's dashboard configuration.
|
|
3
|
-
*
|
|
4
|
-
* The merchant configures FAQs in the Brainerce dashboard under
|
|
5
|
-
* Sell → Content → FAQ
|
|
6
|
-
*
|
|
7
|
-
* This page fetches the merchant's *primary* FAQ (key='main'). For topical
|
|
8
|
-
* FAQs (e.g. /faq/shipping), copy this route to `app/faq/[topic]/page.tsx`
|
|
9
|
-
* and pass `params.topic` to `client.content.faq.get(topic, locale)`.
|
|
10
|
-
*/
|
|
11
|
-
import * as React from 'react';
|
|
12
|
-
import type { Metadata } from 'next';
|
|
13
|
-
|
|
14
|
-
import { getServerClient } from '@/core/lib/brainerce';
|
|
15
|
-
import { FaqSection } from '@/ui/layout/faq-section';
|
|
16
|
-
<% if (i18nEnabled) { %>
|
|
17
|
-
type PageProps = {
|
|
18
|
-
params: Promise<{ locale: string }>;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export async function generateMetadata({ params }: PageProps): Promise<Metadata> {
|
|
22
|
-
const { locale } = await params;
|
|
23
|
-
const faq = await getServerClient(locale).content.faq.get('main', locale).catch(() => null);
|
|
24
|
-
return {
|
|
25
|
-
title: faq?.name ?? 'FAQ',
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export default async function FaqPage({ params }: PageProps) {
|
|
30
|
-
const { locale } = await params;
|
|
31
|
-
const faq = await getServerClient(locale).content.faq.get('main', locale).catch(() => null);
|
|
32
|
-
return <FaqSection faq={faq} />;
|
|
33
|
-
}
|
|
34
|
-
<% } else { %>
|
|
35
|
-
export async function generateMetadata(): Promise<Metadata> {
|
|
36
|
-
const faq = await getServerClient().content.faq.get('main').catch(() => null);
|
|
37
|
-
return {
|
|
38
|
-
title: faq?.name ?? 'FAQ',
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export default async function FaqPage() {
|
|
43
|
-
const faq = await getServerClient().content.faq.get('main').catch(() => null);
|
|
44
|
-
return <FaqSection faq={faq} />;
|
|
45
|
-
}
|
|
46
|
-
<% } %>
|
|
1
|
+
/**
|
|
2
|
+
* FAQ page — fully driven by the merchant's dashboard configuration.
|
|
3
|
+
*
|
|
4
|
+
* The merchant configures FAQs in the Brainerce dashboard under
|
|
5
|
+
* Sell → Content → FAQ
|
|
6
|
+
*
|
|
7
|
+
* This page fetches the merchant's *primary* FAQ (key='main'). For topical
|
|
8
|
+
* FAQs (e.g. /faq/shipping), copy this route to `app/faq/[topic]/page.tsx`
|
|
9
|
+
* and pass `params.topic` to `client.content.faq.get(topic, locale)`.
|
|
10
|
+
*/
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
import type { Metadata } from 'next';
|
|
13
|
+
|
|
14
|
+
import { getServerClient } from '@/core/lib/brainerce.server';
|
|
15
|
+
import { FaqSection } from '@/ui/layout/faq-section';
|
|
16
|
+
<% if (i18nEnabled) { %>
|
|
17
|
+
type PageProps = {
|
|
18
|
+
params: Promise<{ locale: string }>;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export async function generateMetadata({ params }: PageProps): Promise<Metadata> {
|
|
22
|
+
const { locale } = await params;
|
|
23
|
+
const faq = await (await getServerClient(locale)).content.faq.get('main', locale).catch(() => null);
|
|
24
|
+
return {
|
|
25
|
+
title: faq?.name ?? 'FAQ',
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default async function FaqPage({ params }: PageProps) {
|
|
30
|
+
const { locale } = await params;
|
|
31
|
+
const faq = await (await getServerClient(locale)).content.faq.get('main', locale).catch(() => null);
|
|
32
|
+
return <FaqSection faq={faq} />;
|
|
33
|
+
}
|
|
34
|
+
<% } else { %>
|
|
35
|
+
export async function generateMetadata(): Promise<Metadata> {
|
|
36
|
+
const faq = await (await getServerClient()).content.faq.get('main').catch(() => null);
|
|
37
|
+
return {
|
|
38
|
+
title: faq?.name ?? 'FAQ',
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default async function FaqPage() {
|
|
43
|
+
const faq = await (await getServerClient()).content.faq.get('main').catch(() => null);
|
|
44
|
+
return <FaqSection faq={faq} />;
|
|
45
|
+
}
|
|
46
|
+
<% } %>
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IndexNow key file — GET /indexnow-key.txt
|
|
3
|
-
*
|
|
4
|
-
* Brainerce's SEO Autopilot pings IndexNow (instant search-engine indexing)
|
|
5
|
-
* whenever a blog post publishes. The ping includes
|
|
6
|
-
* `keyLocation: https://<your-domain>/indexnow-key.txt`, and search engines
|
|
7
|
-
* verify ownership by fetching this file and matching the key.
|
|
8
|
-
*
|
|
9
|
-
* The key comes from `getStoreInfo().seo.indexNowKey` — it is NOT a secret
|
|
10
|
-
* (the file is public by protocol design). Returns 404 until the platform
|
|
11
|
-
* generates a key for this sales channel, which is harmless.
|
|
12
|
-
*/
|
|
13
|
-
import { getServerClient } from '@/core/lib/brainerce';
|
|
14
|
-
|
|
15
|
-
export const revalidate = 3600;
|
|
16
|
-
|
|
17
|
-
export async function GET() {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* IndexNow key file — GET /indexnow-key.txt
|
|
3
|
+
*
|
|
4
|
+
* Brainerce's SEO Autopilot pings IndexNow (instant search-engine indexing)
|
|
5
|
+
* whenever a blog post publishes. The ping includes
|
|
6
|
+
* `keyLocation: https://<your-domain>/indexnow-key.txt`, and search engines
|
|
7
|
+
* verify ownership by fetching this file and matching the key.
|
|
8
|
+
*
|
|
9
|
+
* The key comes from `getStoreInfo().seo.indexNowKey` — it is NOT a secret
|
|
10
|
+
* (the file is public by protocol design). Returns 404 until the platform
|
|
11
|
+
* generates a key for this sales channel, which is harmless.
|
|
12
|
+
*/
|
|
13
|
+
import { getServerClient } from '@/core/lib/brainerce.server';
|
|
14
|
+
|
|
15
|
+
export const revalidate = 3600;
|
|
16
|
+
|
|
17
|
+
export async function GET() {
|
|
18
|
+
const client = await getServerClient();
|
|
19
|
+
const info = await client.getStoreInfo().catch(() => null);
|
|
20
|
+
const key = info?.seo?.indexNowKey;
|
|
21
|
+
if (!key) return new Response(null, { status: 404 });
|
|
22
|
+
return new Response(key, {
|
|
23
|
+
headers: { 'Content-Type': 'text/plain; charset=utf-8' },
|
|
24
|
+
});
|
|
25
|
+
}
|