create-brainerce-store 1.66.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.
Files changed (46) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
  3. package/templates/nextjs/base/.env.local.ejs +45 -24
  4. package/templates/nextjs/base/.eslintrc.json +51 -57
  5. package/templates/nextjs/base/AGENTS.md.ejs +107 -81
  6. package/templates/nextjs/base/CLAUDE.md.ejs +118 -92
  7. package/templates/nextjs/base/next.config.ts +103 -86
  8. package/templates/nextjs/base/scripts/fetch-store-info.mjs +104 -97
  9. package/templates/nextjs/base/src/app/agents.md/route.ts +4 -3
  10. package/templates/nextjs/base/src/app/api/auth/me/route.ts +65 -59
  11. package/templates/nextjs/base/src/app/api/store/[...path]/route.ts +255 -242
  12. package/templates/nextjs/base/src/app/blog/[slug]/page.tsx.ejs +311 -308
  13. package/templates/nextjs/base/src/app/blog/page.tsx.ejs +277 -276
  14. package/templates/nextjs/base/src/app/blog/rss.xml/route.ts +4 -3
  15. package/templates/nextjs/base/src/app/category/[slug]/page.tsx +6 -5
  16. package/templates/nextjs/base/src/app/faq/page.tsx.ejs +46 -46
  17. package/templates/nextjs/base/src/app/indexnow-key.txt/route.ts +25 -26
  18. package/templates/nextjs/base/src/app/layout.tsx.ejs +273 -257
  19. package/templates/nextjs/base/src/app/llms.txt/route.ts +4 -3
  20. package/templates/nextjs/base/src/app/opengraph-image.tsx +1 -1
  21. package/templates/nextjs/base/src/app/page.tsx +65 -64
  22. package/templates/nextjs/base/src/app/pages/[slug]/page.tsx.ejs +92 -92
  23. package/templates/nextjs/base/src/app/products/[slug]/page.tsx +6 -5
  24. package/templates/nextjs/base/src/app/robots.ts +3 -2
  25. package/templates/nextjs/base/src/app/sitemap.ts +4 -3
  26. package/templates/nextjs/base/src/components/checkout/custom-fields-step.tsx +294 -292
  27. package/templates/nextjs/base/src/components/seo/article-json-ld.tsx +60 -59
  28. package/templates/nextjs/base/src/components/seo/category-json-ld.tsx +60 -61
  29. package/templates/nextjs/base/src/components/seo/product-json-ld.tsx +2 -1
  30. package/templates/nextjs/base/src/core/lib/brainerce.server.ts +81 -0
  31. package/templates/nextjs/base/src/core/lib/brainerce.ts.ejs +60 -110
  32. package/templates/nextjs/base/src/core/lib/site-url.ts +197 -0
  33. package/templates/nextjs/base/src/ui/product/review-form.tsx +294 -294
  34. package/templates/nextjs/base/src/ui/product/reviews-section.tsx.ejs +108 -108
  35. package/templates/nextjs/designs/atelier/app-overlay/layout.tsx.ejs +301 -285
  36. package/templates/nextjs/designs/atelier/ui/layout/faq-section.tsx +97 -96
  37. package/templates/nextjs/designs/atelier/ui/layout/site-footer.tsx.ejs +142 -141
  38. package/templates/nextjs/designs/atelier/ui/layout/site-header.tsx.ejs +139 -138
  39. package/templates/nextjs/designs/atelier/ui/product/review-form.tsx +295 -267
  40. package/templates/nextjs/designs/atelier/ui/product/reviews-section.tsx.ejs +148 -148
  41. package/templates/nextjs/ui-canvas/layout/faq-section.tsx.ejs +72 -71
  42. package/templates/nextjs/ui-canvas/layout/site-footer.tsx.ejs +83 -82
  43. package/templates/nextjs/ui-canvas/layout/site-header.tsx.ejs +120 -119
  44. package/templates/nextjs/ui-canvas/product/faq-section.tsx.ejs +54 -0
  45. package/templates/nextjs/ui-canvas/product/review-form.tsx +267 -266
  46. 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 info = await getServerClient()
19
- .getStoreInfo()
20
- .catch(() => null);
21
- const key = info?.seo?.indexNowKey;
22
- if (!key) return new Response(null, { status: 404 });
23
- return new Response(key, {
24
- headers: { 'Content-Type': 'text/plain; charset=utf-8' },
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
+ }