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.
Files changed (45) hide show
  1. package/README.md +18 -1
  2. package/dist/index.js +523 -9
  3. package/package.json +7 -1
  4. package/template/.claude/skills/theme-section/SKILL.md +157 -0
  5. package/template/.env.example +12 -1
  6. package/template/.screenshots/home-1280.png +0 -0
  7. package/template/.screenshots/home-390.png +0 -0
  8. package/template/.screenshots/home-filled-1280.png +0 -0
  9. package/template/.screenshots/home-filled-390.png +0 -0
  10. package/template/.screenshots/page-1280.png +0 -0
  11. package/template/AGENTS.md +58 -18
  12. package/template/PAGES.md +48 -22
  13. package/template/README.md +6 -0
  14. package/template/_gitignore +2 -0
  15. package/template/app/api/magicstore/preview/route.ts +56 -0
  16. package/template/app/globals.css +108 -0
  17. package/template/app/layout.tsx +18 -7
  18. package/template/app/page.tsx +18 -9
  19. package/template/app/pages/[handle]/page.tsx +26 -11
  20. package/template/app/providers.tsx +15 -6
  21. package/template/app/storefront-api/[...path]/route.ts +11 -66
  22. package/template/components/sections/collections.tsx +2 -1
  23. package/template/components/sections/product-shelves.tsx +2 -1
  24. package/template/lib/api.ts +40 -10
  25. package/template/lib/i18n.ts +6 -0
  26. package/template/lib/preview.ts +21 -0
  27. package/template/lib/upstream.ts +21 -0
  28. package/template/llms.txt +153 -1
  29. package/template/package.json +6 -3
  30. package/template/scripts/theme.mjs +53 -0
  31. package/template/theme/index.ts +53 -0
  32. package/template/theme/sections/collection-list.tsx +64 -0
  33. package/template/theme/sections/featured-collection.tsx +56 -0
  34. package/template/theme/sections/hero.tsx +95 -0
  35. package/template/theme/sections/image-with-text.tsx +71 -0
  36. package/template/theme/sections/page-content.tsx +45 -0
  37. package/template/theme/sections/platform-home.tsx +37 -0
  38. package/template/theme/sections/product-shelf.tsx +96 -0
  39. package/template/theme/sections/rich-text.tsx +43 -0
  40. package/template/theme/sections/testimonials.tsx +84 -0
  41. package/template/theme/settings.ts +19 -0
  42. package/template/theme/templates/index.json +9 -0
  43. package/template/theme/templates/page.json +6 -0
  44. package/template/theme/text.ts +21 -0
  45. package/template/tsconfig.json +1 -1
@@ -0,0 +1,6 @@
1
+ {
2
+ "sections": {
3
+ "content": { "type": "page-content", "settings": {} }
4
+ },
5
+ "order": ["content"]
6
+ }
@@ -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
+ }
@@ -29,5 +29,5 @@
29
29
  ".next/types/**/*.ts",
30
30
  ".next/dev/types/**/*.ts"
31
31
  ],
32
- "exclude": ["node_modules"]
32
+ "exclude": ["node_modules", ".tmp"]
33
33
  }