create-brainerce-store 1.27.3 → 1.27.5

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 CHANGED
@@ -31,7 +31,7 @@ var require_package = __commonJS({
31
31
  "package.json"(exports2, module2) {
32
32
  module2.exports = {
33
33
  name: "create-brainerce-store",
34
- version: "1.27.3",
34
+ version: "1.27.5",
35
35
  description: "Scaffold a production-ready e-commerce storefront connected to Brainerce",
36
36
  bin: {
37
37
  "create-brainerce-store": "dist/index.js"
@@ -351,6 +351,26 @@ async function scaffold(options) {
351
351
  import_path.default.join(targetMessages, `${options.language}.json`)
352
352
  );
353
353
  }
354
+ if (isMultiLocale) {
355
+ const appDir = import_path.default.join(targetDir, "src", "app");
356
+ const localeDir = import_path.default.join(appDir, "[locale]");
357
+ await import_fs_extra.default.ensureDir(localeDir);
358
+ const keepInAppRoot = /* @__PURE__ */ new Set([
359
+ "globals.css",
360
+ "robots.ts",
361
+ "sitemap.ts",
362
+ "api",
363
+ ".well-known"
364
+ ]);
365
+ const appEntries = await import_fs_extra.default.readdir(appDir, { withFileTypes: true });
366
+ for (const entry of appEntries) {
367
+ if (keepInAppRoot.has(entry.name) || entry.name === "[locale]") continue;
368
+ await import_fs_extra.default.move(
369
+ import_path.default.join(appDir, entry.name),
370
+ import_path.default.join(localeDir, entry.name)
371
+ );
372
+ }
373
+ }
354
374
  if (await import_fs_extra.default.pathExists(themeDir)) {
355
375
  const themeCss = import_path.default.join(themeDir, "globals.css");
356
376
  if (await import_fs_extra.default.pathExists(themeCss)) {
package/messages/en.json CHANGED
@@ -65,7 +65,9 @@
65
65
  "sortNameZA": "Name Z-A",
66
66
  "sortPriceLow": "Price: Low to High",
67
67
  "sortPriceHigh": "Price: High to Low",
68
- "selectOptions": "Select Options"
68
+ "selectOptions": "Select Options",
69
+ "allBrands": "All Brands",
70
+ "allTags": "All Tags"
69
71
  },
70
72
  "productDetail": {
71
73
  "notFound": "Product not found.",
package/messages/he.json CHANGED
@@ -65,7 +65,9 @@
65
65
  "sortNameZA": "שם ת-א",
66
66
  "sortPriceLow": "מחיר: מהנמוך לגבוה",
67
67
  "sortPriceHigh": "מחיר: מהגבוה לנמוך",
68
- "selectOptions": "בחר אפשרויות"
68
+ "selectOptions": "בחר אפשרויות",
69
+ "allBrands": "כל המותגים",
70
+ "allTags": "כל התגיות"
69
71
  },
70
72
  "productDetail": {
71
73
  "notFound": "המוצר לא נמצא.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-brainerce-store",
3
- "version": "1.27.3",
3
+ "version": "1.27.5",
4
4
  "description": "Scaffold a production-ready e-commerce storefront connected to Brainerce",
5
5
  "bin": {
6
6
  "create-brainerce-store": "dist/index.js"
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { useEffect, useState } from 'react';
4
- import { useRouter } from 'next/navigation';
4
+ import { useRouter } from '@/lib/navigation';
5
5
  import type { CustomerProfile, Order } from 'brainerce';
6
6
  import { getClient } from '@/lib/brainerce';
7
7
  import { useAuth } from '@/providers/store-provider';
@@ -1,7 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import { Suspense, useEffect, useState, useRef } from 'react';
4
- import { useRouter, useSearchParams } from 'next/navigation';
4
+ import { useSearchParams } from 'next/navigation';
5
+ import { useRouter } from '@/lib/navigation';
5
6
  import { useAuth } from '@/providers/store-provider';
6
7
  import { LoadingSpinner } from '@/components/shared/loading-spinner';
7
8
  import { useTranslations } from '@/lib/translations';
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { useEffect, useState } from 'react';
4
- import Link from 'next/link';
4
+ import { Link } from '@/lib/navigation';
5
5
  import type {
6
6
  CartRecommendationsResponse,
7
7
  CartUpgradesResponse,
@@ -3,7 +3,7 @@
3
3
  import { Suspense, useEffect, useState, useCallback, useRef } from 'react';
4
4
  import { useSearchParams } from 'next/navigation';
5
5
  import Image from 'next/image';
6
- import Link from 'next/link';
6
+ import { Link } from '@/lib/navigation';
7
7
  import type {
8
8
  Checkout,
9
9
  ShippingRate,
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { useState } from 'react';
4
- import Link from 'next/link';
4
+ import { Link } from '@/lib/navigation';
5
5
  import { getClient } from '@/lib/brainerce';
6
6
  import { LoadingSpinner } from '@/components/shared/loading-spinner';
7
7
  import { useTranslations } from '@/lib/translations';
@@ -42,17 +42,18 @@ export function generateStaticParams() {
42
42
  return supportedLocales.map((locale) => ({ locale }));
43
43
  }
44
44
 
45
- export default function RootLayout({
45
+ export default async function RootLayout({
46
46
  children,
47
47
  params,
48
48
  }: {
49
49
  children: React.ReactNode;
50
- params: { locale: string };
50
+ params: Promise<{ locale: string }>;
51
51
  }) {
52
- const dir = getDirection(params.locale);
52
+ const { locale } = await params;
53
+ const dir = getDirection(locale);
53
54
 
54
55
  return (
55
- <html lang={params.locale} dir={dir}>
56
+ <html lang={locale} dir={dir}>
56
57
  <head>
57
58
  <script
58
59
  type="application/ld+json"
@@ -60,7 +61,7 @@ export default function RootLayout({
60
61
  />
61
62
  </head>
62
63
  <body className={font.className}>
63
- <StoreProvider locale={params.locale}>
64
+ <StoreProvider locale={locale}>
64
65
  <div className="min-h-screen flex flex-col">
65
66
  <Header />
66
67
  <main className="flex-1">{children}</main>
@@ -1,8 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { useState } from 'react';
4
- import { useRouter } from 'next/navigation';
5
- import Link from 'next/link';
4
+ import { useRouter, Link } from '@/lib/navigation';
6
5
  import { useAuth } from '@/providers/store-provider';
7
6
  import { proxyLogin } from '@/lib/auth';
8
7
  import { LoginForm } from '@/components/auth/login-form';
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { Suspense, useEffect, useState } from 'react';
4
4
  import { useSearchParams } from 'next/navigation';
5
- import Link from 'next/link';
5
+ import { Link } from '@/lib/navigation';
6
6
  import type { WaitForOrderResult, OrderDownloadLink } from 'brainerce';
7
7
  import { getClient } from '@/lib/brainerce';
8
8
  import { useCart } from '@/providers/store-provider';
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { useEffect, useState } from 'react';
4
- import Link from 'next/link';
4
+ import { Link } from '@/lib/navigation';
5
5
  import type { Product, DiscountBanner } from 'brainerce';
6
6
  import { getClient } from '@/lib/brainerce';
7
7
  import { useStoreInfo } from '@/providers/store-provider';