create-magic-storefront 0.3.1 → 0.5.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/README.md +18 -1
- package/dist/index.js +523 -9
- package/package.json +7 -1
- package/template/.claude/skills/theme-section/SKILL.md +157 -0
- package/template/.env.example +12 -1
- package/template/.screenshots/home-1280.png +0 -0
- package/template/.screenshots/home-390.png +0 -0
- package/template/.screenshots/home-filled-1280.png +0 -0
- package/template/.screenshots/home-filled-390.png +0 -0
- package/template/.screenshots/page-1280.png +0 -0
- package/template/AGENTS.md +58 -18
- package/template/PAGES.md +48 -22
- package/template/README.md +6 -0
- package/template/_gitignore +2 -0
- package/template/app/api/magicstore/preview/route.ts +56 -0
- package/template/app/globals.css +108 -0
- package/template/app/layout.tsx +18 -7
- package/template/app/page.tsx +18 -9
- package/template/app/pages/[handle]/page.tsx +26 -11
- package/template/app/providers.tsx +15 -6
- package/template/app/storefront-api/[...path]/route.ts +11 -66
- package/template/components/sections/collections.tsx +2 -1
- package/template/components/sections/product-shelves.tsx +2 -1
- package/template/lib/api.ts +40 -10
- package/template/lib/i18n.ts +6 -0
- package/template/lib/preview.ts +21 -0
- package/template/lib/upstream.ts +21 -0
- package/template/llms.txt +153 -1
- package/template/package.json +6 -3
- package/template/scripts/theme.mjs +53 -0
- package/template/theme/index.ts +53 -0
- package/template/theme/sections/collection-list.tsx +64 -0
- package/template/theme/sections/featured-collection.tsx +56 -0
- package/template/theme/sections/hero.tsx +95 -0
- package/template/theme/sections/image-with-text.tsx +71 -0
- package/template/theme/sections/page-content.tsx +45 -0
- package/template/theme/sections/platform-home.tsx +37 -0
- package/template/theme/sections/product-shelf.tsx +96 -0
- package/template/theme/sections/rich-text.tsx +43 -0
- package/template/theme/sections/testimonials.tsx +84 -0
- package/template/theme/settings.ts +19 -0
- package/template/theme/templates/index.json +9 -0
- package/template/theme/templates/page.json +6 -0
- package/template/theme/text.ts +21 -0
- package/template/tsconfig.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MESSAGES, type Messages } from '@/lib/i18n';
|
|
2
|
+
|
|
3
|
+
/** The languages this storefront speaks; every buyer-facing default has each of them. */
|
|
4
|
+
export const THEME_LOCALES = ['en', 'ru', 'uz'] as const;
|
|
5
|
+
|
|
6
|
+
/** Editor-facing text (section names, labels, hints), shown in the admin's language. */
|
|
7
|
+
export function label(en: string, ru: string, uz: string): { en: string; ru: string; uz: string } {
|
|
8
|
+
return { en, ru, uz };
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type TextKey = {
|
|
12
|
+
[Key in keyof Messages]: Messages[Key] extends string ? Key : never;
|
|
13
|
+
}[keyof Messages];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A buyer-facing default taken from `lib/i18n.ts` in every language, so the storefront's words stay
|
|
17
|
+
* in one place and the merchant can still change them in the admin.
|
|
18
|
+
*/
|
|
19
|
+
export function message(key: TextKey): { en: string; ru: string; uz: string } {
|
|
20
|
+
return { en: MESSAGES.en[key], ru: MESSAGES.ru[key], uz: MESSAGES.uz[key] };
|
|
21
|
+
}
|
package/template/tsconfig.json
CHANGED