cloudcommerce 0.22.0 → 0.22.2

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 (182) hide show
  1. package/.editorconfig +13 -0
  2. package/.gitmodules +3 -0
  3. package/.vscode/settings.json +2 -1
  4. package/CHANGELOG.md +28 -0
  5. package/ecomplus-stores/barra-doce/.devcontainer/devcontainer.json +30 -0
  6. package/ecomplus-stores/barra-doce/.editorconfig +13 -0
  7. package/ecomplus-stores/barra-doce/.eslintrc.cjs +3 -0
  8. package/ecomplus-stores/barra-doce/.firebaserc +5 -0
  9. package/ecomplus-stores/barra-doce/.github/build-and-deploy +1 -0
  10. package/ecomplus-stores/barra-doce/.github/renovate.json +5 -0
  11. package/ecomplus-stores/barra-doce/.github/workflows/build-and-deploy.yml +36 -0
  12. package/ecomplus-stores/barra-doce/.github/workflows/calibreapp-image-actions.yml +23 -0
  13. package/ecomplus-stores/barra-doce/.gitpod.yml +12 -0
  14. package/ecomplus-stores/barra-doce/.nvmrc +1 -0
  15. package/ecomplus-stores/barra-doce/.vscode/extensions.json +8 -0
  16. package/ecomplus-stores/barra-doce/.vscode/launch.json +11 -0
  17. package/ecomplus-stores/barra-doce/.vscode/settings.json +10 -0
  18. package/ecomplus-stores/barra-doce/LICENSE.md +230 -0
  19. package/ecomplus-stores/barra-doce/README.md +31 -0
  20. package/ecomplus-stores/barra-doce/SETUP.md +117 -0
  21. package/ecomplus-stores/{iluminim/README.pt-BR.md → barra-doce/SETUP.pt-BR.md} +5 -1
  22. package/ecomplus-stores/barra-doce/functions/config.json +3 -0
  23. package/ecomplus-stores/barra-doce/functions/example.env +10 -0
  24. package/ecomplus-stores/barra-doce/functions/many/index.js +14 -0
  25. package/ecomplus-stores/barra-doce/functions/many/package.json +22 -0
  26. package/ecomplus-stores/barra-doce/functions/ssr/.eslintrc.cjs +6 -0
  27. package/ecomplus-stores/barra-doce/functions/ssr/astro.config.mjs +4 -0
  28. package/ecomplus-stores/barra-doce/functions/ssr/content/blog/.gitkeep +0 -0
  29. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/.gitkeep +0 -0
  30. package/ecomplus-stores/barra-doce/functions/ssr/content/layout.json +37 -0
  31. package/ecomplus-stores/barra-doce/functions/ssr/content/pages/home.json +33 -0
  32. package/ecomplus-stores/barra-doce/functions/ssr/content/settings.json +48 -0
  33. package/ecomplus-stores/barra-doce/functions/ssr/index.js +18 -0
  34. package/ecomplus-stores/barra-doce/functions/ssr/package.json +31 -0
  35. package/ecomplus-stores/barra-doce/functions/ssr/public/admin/.gitkeep +2 -0
  36. package/ecomplus-stores/barra-doce/functions/ssr/public/assets/.gitkeep +2 -0
  37. package/ecomplus-stores/barra-doce/functions/ssr/public/img/icon.png +0 -0
  38. package/ecomplus-stores/barra-doce/functions/ssr/public/img/large-icon.png +0 -0
  39. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/banner-forma-decora.jpg +0 -0
  40. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/banner2.webp +0 -0
  41. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/ecom-icon.png +0 -0
  42. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/headphone.webp +0 -0
  43. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/logo-barradoce.webp +0 -0
  44. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/logo.png +0 -0
  45. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/og-image.png +0 -0
  46. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/passion.webp +0 -0
  47. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/rect8589.png +0 -0
  48. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/rect859.png +0 -0
  49. package/ecomplus-stores/barra-doce/functions/ssr/public/img/uploads/rect89.webp +0 -0
  50. package/ecomplus-stores/barra-doce/functions/ssr/public/robots.txt +8 -0
  51. package/ecomplus-stores/barra-doce/functions/ssr/scripts/build.sh +14 -0
  52. package/ecomplus-stores/barra-doce/functions/ssr/src/assets/style.css +65 -0
  53. package/ecomplus-stores/barra-doce/functions/ssr/src/components/AccountMenu.vue +104 -0
  54. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Banner.vue +64 -0
  55. package/ecomplus-stores/barra-doce/functions/ssr/src/components/BannersGrid.astro +25 -0
  56. package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartSidebar.vue +35 -0
  57. package/ecomplus-stores/barra-doce/functions/ssr/src/components/HeroSlider.vue +51 -0
  58. package/ecomplus-stores/barra-doce/functions/ssr/src/components/PitchBar.vue +53 -0
  59. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Prices.vue +96 -0
  60. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductCard.vue +117 -0
  61. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductShelf.vue +60 -0
  62. package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchModal.vue +6 -0
  63. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +136 -0
  64. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeaderMenu.vue +58 -0
  65. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeaderSubmenu.vue +88 -0
  66. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopSidenav.vue +61 -0
  67. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopSidenavCategory.vue +80 -0
  68. package/ecomplus-stores/barra-doce/functions/ssr/src/env.d.ts +13 -0
  69. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/Base.astro +15 -0
  70. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/Checkout.astro +0 -0
  71. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageHeader.astro +38 -0
  72. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Fallback.astro +10 -0
  73. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Home.astro +29 -0
  74. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Sections.astro +29 -0
  75. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Wildcard.astro +18 -0
  76. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/[...slug].astro +40 -0
  77. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/_vue.ts +3 -0
  78. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/account.astro +0 -0
  79. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/index.astro +0 -0
  80. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/fallback.astro +25 -0
  81. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/index.astro +35 -0
  82. package/ecomplus-stores/barra-doce/functions/ssr/src/scripts/InlineScripts.astro +10 -0
  83. package/ecomplus-stores/barra-doce/functions/ssr/tailwind.config.cjs +19 -0
  84. package/ecomplus-stores/barra-doce/functions/ssr/tsconfig.json +12 -0
  85. package/ecomplus-stores/barra-doce/functions/ssr/uno.config.cjs +5 -0
  86. package/ecomplus-stores/barra-doce/functions/with-apps/index.js +12 -0
  87. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +22 -0
  88. package/ecomplus-stores/barra-doce/package.json +28 -0
  89. package/ecomplus-stores/barra-doce/scripts/install.sh +14 -0
  90. package/ecomplus-stores/iluminim/.editorconfig +13 -0
  91. package/ecomplus-stores/iluminim/README.md +11 -93
  92. package/ecomplus-stores/iluminim/SETUP.md +117 -0
  93. package/ecomplus-stores/iluminim/SETUP.pt-BR.md +117 -0
  94. package/ecomplus-stores/iluminim/functions/many/package.json +3 -3
  95. package/ecomplus-stores/iluminim/functions/ssr/package.json +6 -6
  96. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeaderSubmenu.vue +1 -1
  97. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopSidenav.vue +2 -2
  98. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopSidenavCategory.vue +4 -2
  99. package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageHeader.astro +6 -1
  100. package/ecomplus-stores/iluminim/functions/with-apps/package.json +3 -3
  101. package/ecomplus-stores/iluminim/package.json +1 -1
  102. package/package.json +6 -6
  103. package/packages/api/package.json +1 -1
  104. package/packages/apps/affilate-program/package.json +1 -1
  105. package/packages/apps/correios/package.json +1 -1
  106. package/packages/apps/custom-payment/package.json +1 -1
  107. package/packages/apps/custom-shipping/package.json +1 -1
  108. package/packages/apps/datafrete/package.json +1 -1
  109. package/packages/apps/discounts/package.json +1 -1
  110. package/packages/apps/emails/package.json +1 -1
  111. package/packages/apps/fb-conversions/package.json +2 -2
  112. package/packages/apps/flash-courier/package.json +1 -1
  113. package/packages/apps/frenet/package.json +1 -1
  114. package/packages/apps/galaxpay/package.json +1 -1
  115. package/packages/apps/google-analytics/package.json +1 -1
  116. package/packages/apps/jadlog/package.json +1 -1
  117. package/packages/apps/loyalty-points/package.json +1 -1
  118. package/packages/apps/melhor-envio/package.json +1 -1
  119. package/packages/apps/mercadopago/package.json +1 -1
  120. package/packages/apps/pagarme/package.json +1 -1
  121. package/packages/apps/paghiper/package.json +1 -1
  122. package/packages/apps/pix/package.json +1 -1
  123. package/packages/apps/tiny-erp/package.json +1 -1
  124. package/packages/apps/webhooks/package.json +1 -1
  125. package/packages/cli/lib/build.js +15 -4
  126. package/packages/cli/lib/cli.js +3 -3
  127. package/packages/cli/package.json +1 -1
  128. package/packages/cli/src/build.ts +17 -4
  129. package/packages/cli/src/cli.ts +3 -3
  130. package/packages/config/package.json +1 -1
  131. package/packages/emails/package.json +1 -1
  132. package/packages/events/package.json +1 -1
  133. package/packages/feeds/package.json +1 -1
  134. package/packages/firebase/package.json +1 -1
  135. package/packages/i18n/lib/dirname.js +3 -1
  136. package/packages/i18n/lib/dirname.js.map +1 -1
  137. package/packages/i18n/package.json +1 -1
  138. package/packages/i18n/scripts/build-txt.mjs +2 -1
  139. package/packages/i18n/src/dirname.ts +3 -1
  140. package/packages/modules/package.json +1 -1
  141. package/packages/passport/package.json +1 -1
  142. package/packages/ssr/package.json +2 -2
  143. package/packages/storefront/astro.config.mjs +2 -1
  144. package/packages/storefront/dist/client/_astro/HeroSlider.cea1f361.js +1 -0
  145. package/packages/storefront/dist/client/_astro/{ProductShelf.9e290480.js → ProductShelf.35614736.js} +1 -1
  146. package/packages/storefront/dist/client/_astro/ShopHeader.dbe9c1f1.js +4 -0
  147. package/packages/storefront/dist/client/_astro/{_...slug_.c85b8978.css → _...slug_.c13e0486.css} +1 -1
  148. package/packages/storefront/dist/client/assets/.gitkeep +2 -0
  149. package/packages/storefront/dist/client/sw.js +1 -1
  150. package/packages/storefront/dist/server/chunks/{_...7e1df40a.mjs → _...fac94758.mjs} +3 -3
  151. package/packages/storefront/dist/server/chunks/{account@_@astro.5f1dba7a.mjs → account@_@astro.460623ee.mjs} +3 -3
  152. package/packages/storefront/dist/server/chunks/{astro.2d3ebf0f.mjs → astro.e0968ba7.mjs} +201 -156
  153. package/packages/storefront/dist/server/chunks/{endpoint@_@js.80de0568.mjs → endpoint@_@js.35380ea5.mjs} +3 -3
  154. package/packages/storefront/dist/server/chunks/{fallback@_@astro.02a45b47.mjs → fallback@_@astro.dbc26d2d.mjs} +3 -3
  155. package/packages/storefront/dist/server/chunks/{index@_@astro.7cb07e52.mjs → index@_@astro.c91e679e.mjs} +3 -3
  156. package/packages/storefront/dist/server/chunks/{index@_@astro.23b50301.mjs → index@_@astro.fec107b9.mjs} +3 -3
  157. package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.4358f614.mjs → _...slug_.astro.2e2d4770.mjs} +81 -39
  158. package/packages/storefront/dist/server/chunks/pages/{account.astro.afae5a12.mjs → account.astro.0003ca94.mjs} +1 -1
  159. package/packages/storefront/dist/server/chunks/pages/{endpoint.js.60fd21aa.mjs → endpoint.js.6f0f4ede.mjs} +1 -1
  160. package/packages/storefront/dist/server/chunks/pages/{fallback.astro.e5566925.mjs → fallback.astro.fc8bc7e7.mjs} +2 -2
  161. package/packages/storefront/dist/server/chunks/pages/{index.astro.5bc6b9d8.mjs → index.astro.03adcc55.mjs} +6 -6
  162. package/packages/storefront/dist/server/entry.mjs +9 -9
  163. package/packages/storefront/dist/server/renderers.mjs +2 -2
  164. package/packages/storefront/package.json +5 -5
  165. package/packages/storefront/src/lib/$storefront.d.ts +1 -0
  166. package/packages/storefront/src/lib/components/SharedData.astro +13 -0
  167. package/packages/storefront/src/lib/composables/use-prices.ts +1 -1
  168. package/packages/storefront/src/lib/composables/use-shop-header-submenu.ts +10 -1
  169. package/packages/storefront/src/lib/composables/use-shop-header.ts +13 -13
  170. package/packages/storefront/src/lib/layouts/BaseHead.astro +1 -1
  171. package/packages/storefront/src/lib/layouts/use-page-header.ts +14 -2
  172. package/packages/storefront/src/lib/ssr-context.ts +1 -0
  173. package/packages/types/package.json +1 -1
  174. package/pnpm-workspace.yaml +2 -0
  175. package/packages/storefront/dist/client/_astro/HeroSlider.0890631f.js +0 -1
  176. package/packages/storefront/dist/client/_astro/ShopHeader.82ae97a5.js +0 -4
  177. package/packages/storefront/dist/client/assets/cms-preview.css +0 -274
  178. package/packages/storefront/dist/client/assets/cms.css +0 -114
  179. package/packages/storefront/dist/client/assets/cvv.png +0 -0
  180. package/packages/storefront/dist/client/assets/img-placeholder.png +0 -0
  181. package/packages/storefront/dist/client/assets/payments.png +0 -0
  182. package/packages/storefront/dist/client/assets/ssl-safe.png +0 -0
@@ -0,0 +1,80 @@
1
+ <template>
2
+ <li class="text-lg text-base-800">
3
+ <details
4
+ v-if="categoryTree.subcategories.length"
5
+ class="bg-white overflow-y-auto overflow-x-hidden z-10
6
+ open:absolute open:top-0 open:left-0 open:w-full open:h-full"
7
+ @toggle="isOpen = !isOpen"
8
+ >
9
+ <summary
10
+ class="cursor-pointer list-none px-6 py-3 active:bg-base-100 transition-colors"
11
+ :class="isOpen ? 'bg-base-100' : null"
12
+ >
13
+ <i :class="!isOpen
14
+ ? 'i-arrow-right-line float-right mb-0 mt-1 text-xl text-base-500'
15
+ : 'i-arrow-left-line text-lg'"></i>
16
+ <AImg
17
+ v-if="!isOpen && categoryTree.icon"
18
+ :picture="categoryTree.icon"
19
+ :alt="categoryTree.name"
20
+ class="w-auto h-5 inline mr-3"
21
+ />
22
+ <h3 class="inline" :class="isOpen ? 'ml-4 text-base' : null">
23
+ {{ categoryTree.name }}
24
+ </h3>
25
+ </summary>
26
+ <ul
27
+ class="mt-2 transition-opacity"
28
+ :class="isFaded ? 'opacity-20' : 'opacity-100'"
29
+ tabindex="-1"
30
+ >
31
+ <ShopSidenavCategory
32
+ v-for="(subcategoryTree, i) in categoryTree.subcategories"
33
+ :key="i"
34
+ :category-tree="subcategoryTree"
35
+ />
36
+ <li>
37
+ <a
38
+ :href="`/${categoryTree.slug}`"
39
+ class="block px-6 py-3 text-base underline active:bg-base-200"
40
+ >
41
+ {{ $t.i19seeAll$1Category.replace('$1', categoryTree.name) }}
42
+ </a>
43
+ </li>
44
+ </ul>
45
+ </details>
46
+ <a
47
+ v-else
48
+ :href="`/${categoryTree.slug}`"
49
+ class="block px-6 py-3 active:bg-base-200"
50
+ >
51
+ <AImg
52
+ v-if="!isOpen && categoryTree.icon"
53
+ :picture="categoryTree.icon"
54
+ :alt="categoryTree.name"
55
+ class="w-auto h-5 inline mr-3"
56
+ />
57
+ <h3 class="inline">{{ categoryTree.name }}</h3>
58
+ </a>
59
+ </li>
60
+ </template>
61
+
62
+ <script setup lang="ts">
63
+ import type { CategoryTree, SubcategoryTree } from '@@sf/composables/use-shop-header';
64
+ import { ref, watch } from 'vue';
65
+
66
+ export interface Props {
67
+ categoryTree: CategoryTree | SubcategoryTree;
68
+ }
69
+
70
+ defineProps<Props>();
71
+ const isOpen = ref(false);
72
+ const isFaded = ref(true);
73
+ watch(isOpen, (_isOpen) => {
74
+ if (_isOpen) {
75
+ setTimeout(() => { isFaded.value = false; }, 25);
76
+ } else {
77
+ isFaded.value = true;
78
+ }
79
+ });
80
+ </script>
@@ -0,0 +1,13 @@
1
+ /// <reference types="@astrojs/image/client" />
2
+ /// <reference types="vite-plugin-pwa/client" />
3
+ /// <reference types="vue/ref-macros" />
4
+ /// <reference types="@cloudcommerce/storefront/client" />
5
+ /// <reference types="@cloudcommerce/storefront/server" />
6
+
7
+ /* eslint-disable import/newline-after-import */
8
+
9
+ declare module '*.vue' {
10
+ import { type DefineComponent } from 'vue';
11
+ const component: DefineComponent<{}, {}, any>;
12
+ export default component;
13
+ }
@@ -0,0 +1,15 @@
1
+ ---
2
+ import SfBase from '@@sf/layouts/Base.astro';
3
+ import InlineScripts from '~/scripts/InlineScripts.astro';
4
+ import '~/assets/style.css';
5
+ import 'uno.css';
6
+ import '@fontsource/croissant-one/index.css';
7
+ ---
8
+
9
+ <SfBase>
10
+ <Fragment slot="base-head">
11
+ <slot name="base-head" />
12
+ </Fragment>
13
+ <InlineScripts slot="before-head-end" />
14
+ <slot />
15
+ </SfBase>
@@ -0,0 +1,38 @@
1
+ ---
2
+ import usePageHeader from '@@sf/layouts/use-page-header';
3
+ import SharedData from '@@sf/components/SharedData.astro';
4
+ import Picture from '@@sf/components/Picture.astro';
5
+ import PitchBar from '~/components/PitchBar.vue';
6
+ import ShopHeader from '~/components/ShopHeader.vue';
7
+
8
+ const { routeContext } = Astro.locals;
9
+ const { settings, isHomepage } = routeContext;
10
+ const LogoHeading = isHomepage ? 'h1' : 'h2';
11
+ const {
12
+ pitchBar,
13
+ shopHeader: { categories, ...shopHeader },
14
+ } = await usePageHeader({ routeContext });
15
+ ---
16
+
17
+ <slot name="pitch-bar">
18
+ {pitchBar.slides.length > 1 && <PitchBar {...pitchBar} client:idle />}
19
+ {pitchBar.slides.length === 1 && <PitchBar {...pitchBar} />}
20
+ </slot>
21
+ <SharedData field="categories" value={categories?.map(({ _id, ...c }) => c)} />
22
+ <ShopHeader {...shopHeader} client:load>
23
+ <Fragment slot="logo">
24
+ <a href="/">
25
+ <LogoHeading>
26
+ <Picture
27
+ slot="logo-picture"
28
+ src={settings.logo}
29
+ alt={settings.name}
30
+ widths={[300]}
31
+ fetchpriority="high"
32
+ loading="eager"
33
+ class="hover:drop-shadow-sm max-w-[150px] mx-auto"
34
+ />
35
+ </LogoHeading>
36
+ </a>
37
+ </Fragment>
38
+ </ShopHeader>
@@ -0,0 +1,10 @@
1
+ ---
2
+ ---
3
+
4
+ <main>
5
+ <h1>Error :/</h1>
6
+ <p class="instructions">
7
+ Check out the <code>src/pages</code> directory to get started.<br/>
8
+ <strong>Code Challenge:</strong> Tweak the "Welcome to Astro" message above.
9
+ </p>
10
+ </main>
@@ -0,0 +1,29 @@
1
+ ---
2
+ import { usePageHero } from '@@sf/layouts/use-page-main';
3
+ import BannerPictures from '@@sf/components/BannerPictures.astro';
4
+ import HeroSlider from '~/components/HeroSlider.vue';
5
+ import Sections from '~/main/Sections.astro';
6
+
7
+ const { routeContext } = Astro.locals;
8
+ const { heroSlider } = await usePageHero({ routeContext });
9
+ const heroSlides = heroSlider.slides;
10
+ ---
11
+
12
+ <main>
13
+ {heroSlider.slides.length &&
14
+ <HeroSlider {...heroSlider} client:load>
15
+ {heroSlides[0] && <BannerPictures slot="picture-0" {...heroSlides[0]} index={0} />}
16
+ {heroSlides[1] && <BannerPictures slot="picture-1" {...heroSlides[1]} index={1} />}
17
+ {heroSlides[2] && <BannerPictures slot="picture-2" {...heroSlides[2]} index={2} />}
18
+ {heroSlides[3] && <BannerPictures slot="picture-3" {...heroSlides[3]} index={3} />}
19
+ {heroSlides[4] && <BannerPictures slot="picture-4" {...heroSlides[4]} index={4} />}
20
+ {heroSlides[5] && <BannerPictures slot="picture-5" {...heroSlides[5]} index={5} />}
21
+ {heroSlides[6] && <BannerPictures slot="picture-6" {...heroSlides[6]} index={6} />}
22
+ {heroSlides[7] && <BannerPictures slot="picture-7" {...heroSlides[7]} index={7} />}
23
+ {heroSlides[8] && <BannerPictures slot="picture-8" {...heroSlides[8]} index={8} />}
24
+ {heroSlides[9] && <BannerPictures slot="picture-9" {...heroSlides[9]} index={9} />}
25
+ <!-- https://github.com/withastro/astro/issues/5066#issuecomment-1277998365 -->
26
+ </HeroSlider>
27
+ }
28
+ <Sections />
29
+ </main>
@@ -0,0 +1,29 @@
1
+ ---
2
+ import { usePageSections } from '@@sf/layouts/use-page-main';
3
+ import BannersGrid from '~/components/BannersGrid.astro';
4
+ import ProductShelf from '~/components/ProductShelf.vue';
5
+
6
+ const { routeContext } = Astro.locals;
7
+ const { sections } = await usePageSections({
8
+ routeContext,
9
+ handleCustomSection: async (type, content) => {
10
+ if (type === 'c:foo') return { props: { ...content, foo: 'bar' } };
11
+ return { props: content };
12
+ },
13
+ });
14
+ ---
15
+
16
+ <article class="my-9 md:my-12">
17
+ {sections.map(({ type, props }) => {
18
+ switch (type) {
19
+ case 'product-shelf':
20
+ return <ProductShelf {...props} client:visible />
21
+ case 'banners-grid':
22
+ return <BannersGrid {...props} />
23
+ case 'c:foo':
24
+ return <div data-foo={props.foo}></div>
25
+ default:
26
+ return <div data-section={type}></div>
27
+ }
28
+ })}
29
+ </article>
@@ -0,0 +1,18 @@
1
+ ---
2
+ const { fetchingApiContext, apiContext } = Astro.locals.routeContext;
3
+
4
+ await fetchingApiContext;
5
+ const apiDoc = apiContext.doc;
6
+ ---
7
+
8
+ <main>
9
+ {apiDoc &&
10
+ <h1>Hello <span class="text-gradient">{apiDoc.name}</span></h1>
11
+ <hr>
12
+ <div class="mt-3">
13
+ <mark>{apiDoc._id}</mark> from <i>{apiContext.resource}</i>
14
+ <p>{Math.random()}</p>
15
+ <em>Lorem ipsum dolor sit amet</em>
16
+ </div>
17
+ }
18
+ </main>
@@ -0,0 +1,40 @@
1
+ ---
2
+ import api from '@cloudcommerce/api';
3
+ import loadRouteContext, { RouteContext } from '@@sf/ssr-context';
4
+ import BaseHead from '@@sf/layouts/BaseHead.astro';
5
+ import Base from '~/layouts/Base.astro';
6
+ import PageHeader from '~/layouts/PageHeader.astro';
7
+ import WildcardMain from '~/main/Wildcard.astro';
8
+
9
+ if (String(Astro.params.slug).endsWith('.css.map')) {
10
+ return new Response(null, { status: 404 });
11
+ }
12
+
13
+ let routeContext: RouteContext | undefined;
14
+ let loadError: any;
15
+ try {
16
+ routeContext = await loadRouteContext(Astro);
17
+ } catch (err: any) {
18
+ if (err.astroResponse) {
19
+ return err.astroResponse;
20
+ }
21
+ loadError = err;
22
+ }
23
+
24
+ export async function getStaticPaths() {
25
+ return (await api.get('products?sort=-sales&limit=4&fields=slug'))
26
+ .data.result.map(({ slug }) => ({ params: { slug } }));
27
+ }
28
+ ---
29
+
30
+ <!DOCTYPE html>
31
+ <html lang={routeContext?.lang.replace('_', '-')}>
32
+ {routeContext &&
33
+ <Base>
34
+ <BaseHead slot="base-head" />
35
+ <PageHeader />
36
+ <WildcardMain />
37
+ </Base>
38
+ }
39
+ {loadError && <Fragment set:html={loadError.responseHTML} />}
40
+ </html>
@@ -0,0 +1,3 @@
1
+ import createApp from '@@sf/pages/_vue';
2
+
3
+ export default createApp;
@@ -0,0 +1,25 @@
1
+ ---
2
+ import loadRouteContext, { RouteContext } from '@@sf/ssr-context';
3
+ import BaseHead from '@@sf/layouts/BaseHead.astro';
4
+ import Base from '~/layouts/Base.astro';
5
+ import PageHeader from '~/layouts/PageHeader.astro';
6
+ import FallbackMain from '~/main/Fallback.astro';
7
+
8
+ let routeContext: RouteContext;
9
+ try {
10
+ routeContext = await loadRouteContext(Astro);
11
+ } catch (err: any) {
12
+ return err.astroResponse;
13
+ }
14
+
15
+ // export const prerender = true;
16
+ ---
17
+
18
+ <!DOCTYPE html>
19
+ <html lang={routeContext?.lang.replace('_', '-')}>
20
+ <Base>
21
+ <BaseHead slot="base-head" />
22
+ <PageHeader />
23
+ <FallbackMain />
24
+ </Base>
25
+ </html>
@@ -0,0 +1,35 @@
1
+ ---
2
+ import loadRouteContext, { RouteContext } from '@@sf/ssr-context';
3
+ import BaseHead from '@@sf/layouts/BaseHead.astro';
4
+ import Base from '~/layouts/Base.astro';
5
+ import PageHeader from '~/layouts/PageHeader.astro';
6
+ import HomeMain from '~/main/Home.astro';
7
+
8
+ let routeContext: RouteContext | undefined;
9
+ let loadError: any;
10
+ try {
11
+ routeContext = await loadRouteContext(Astro);
12
+ /* Faster SSR without store categories (default) prefetch:
13
+ routeContext = await loadRouteContext(Astro, {
14
+ apiPrefetchEndpoints: [],
15
+ });
16
+ */
17
+ } catch (err: any) {
18
+ if (err.astroResponse) {
19
+ return err.astroResponse;
20
+ }
21
+ loadError = err;
22
+ }
23
+ ---
24
+
25
+ <!DOCTYPE html>
26
+ <html lang={routeContext?.lang.replace('_', '-')}>
27
+ {routeContext &&
28
+ <Base>
29
+ <BaseHead slot="base-head" />
30
+ <PageHeader />
31
+ <HomeMain />
32
+ </Base>
33
+ }
34
+ {loadError && <Fragment set:html={loadError.responseHTML} />}
35
+ </html>
@@ -0,0 +1,10 @@
1
+ <script is:inline>
2
+ window.$firebaseConfig = {
3
+ apiKey: "AIzaSyBznCepiYPsZgkKaSckxaFKq1H0iHJjC4o",
4
+ authDomain: "ecom2barradoce.firebaseapp.com",
5
+ projectId: "ecom2barradoce",
6
+ storageBucket: "ecom2barradoce.appspot.com",
7
+ messagingSenderId: "29309694331",
8
+ appId: "1:29309694331:web:9d7760b1b4f493e1348dde"
9
+ };
10
+ </script>
@@ -0,0 +1,19 @@
1
+ process.env.STOREFRONT_BASE_DIR = __dirname;
2
+
3
+ // eslint-disable-next-line import/no-extraneous-dependencies
4
+ const { genTailwindConfig } = require('@cloudcommerce/storefront/config/storefront.tailwind.cjs');
5
+
6
+ const themeOptions = {
7
+ generalIcons: 'mingcute',
8
+ baseColor: 'zinc',
9
+ iconAliases: {
10
+ close: 'close-line',
11
+ 'chevron-right': 'right-fill',
12
+ 'chevron-left': 'left-fill',
13
+ },
14
+ };
15
+
16
+ module.exports = {
17
+ ...genTailwindConfig(themeOptions),
18
+ themeOptions,
19
+ };
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "@cloudcommerce/storefront/tsconfig.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "paths": {
6
+ "@@i18n": ["./node_modules/@cloudcommerce/i18n/src/pt_br.ts"],
7
+ "@@sf/*": ["./node_modules/@cloudcommerce/storefront/src/lib/*"],
8
+ "~/*": ["./src/*"],
9
+ "content/*": ["./content/*"],
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,5 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies
2
+ const { genUnoCSSConfig } = require('@cloudcommerce/storefront/config/storefront.unocss.cjs');
3
+ const tailwindConfig = require('./tailwind.config.cjs');
4
+
5
+ export default genUnoCSSConfig(tailwindConfig);
@@ -0,0 +1,12 @@
1
+ import '@cloudcommerce/firebase/lib/init';
2
+ import config from '@cloudcommerce/firebase/config';
3
+ import mergeConfig from './config.json' assert { type: 'json' };
4
+
5
+ config.set({
6
+ ...mergeConfig,
7
+ hello: 'from store',
8
+ });
9
+
10
+ export * from '@cloudcommerce/modules/firebase';
11
+
12
+ export * from '@cloudcommerce/events/firebase';
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "barra-doce-with-apps",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "build": "echo '>> Run build from repository root'",
7
+ "serve": "firebase emulators:start --only functions",
8
+ "shell": "firebase functions:shell",
9
+ "start": "npm run shell",
10
+ "deploy": "firebase deploy --only functions",
11
+ "logs": "firebase functions:log"
12
+ },
13
+ "engines": {
14
+ "node": "18"
15
+ },
16
+ "main": "index.js",
17
+ "dependencies": {
18
+ "@cloudcommerce/events": "^0.22.1",
19
+ "@cloudcommerce/firebase": "^0.22.1",
20
+ "@cloudcommerce/modules": "^0.22.1"
21
+ }
22
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@ecomplus-stores/barra-doce",
3
+ "private": true,
4
+ "type": "module",
5
+ "description": "E-Com Plus Cloud Commerce starter store",
6
+ "scripts": {
7
+ "dev": "cloudcommerce",
8
+ "logs": "cloudcommerce logs",
9
+ "serve": "cloudcommerce serve",
10
+ "shell": "cloudcommerce shell",
11
+ "start": "cloudcommerce start",
12
+ "build": "cloudcommerce build",
13
+ "predeploy": "cloudcommerce predeploy",
14
+ "deploy": "cloudcommerce deploy",
15
+ "login": "cloudcommerce login",
16
+ "setup": "bash scripts/install.sh && cloudcommerce setup",
17
+ "setup:quiet": "cloudcommerce setup --no-deploy --no-commit"
18
+ },
19
+ "main": "functions/index.js",
20
+ "author": "E-Com Club Softwares para E-commerce <ti@e-com.club>",
21
+ "license": "Apache 2.0 with Commons Clause",
22
+ "bugs": {
23
+ "url": "https://github.com/ecomplus/cloud-commerce/issues"
24
+ },
25
+ "dependencies": {
26
+ "@cloudcommerce/cli": "^0.22.1"
27
+ }
28
+ }
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+
3
+ if [ ! -d "./node_modules" ]; then
4
+ echo '>> Install root dev dependencies:'
5
+ npm ci
6
+ fi
7
+ echo '>> Install each function dependencies:'
8
+ cd functions
9
+ for d in */ ; do
10
+ cd $d
11
+ npm ci
12
+ cd ..
13
+ done
14
+ cd ..
@@ -0,0 +1,13 @@
1
+ # editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
11
+
12
+ [*.md]
13
+ trim_trailing_whitespace = false
@@ -2,112 +2,30 @@
2
2
 
3
3
  [Cloud Commerce](https://github.com/ecomplus/cloud-commerce): the new Store template
4
4
 
5
- [:brazil: Tradução em português](./README.pt-BR.md)
6
-
7
5
  ## Getting started
8
6
 
9
- 1. Start creating new project on [Firebase console](https://console.firebase.google.com/):
10
- - Set a nice project name (ID) and remember it;
11
- - Disable (recommended) Google Analytics for Firebase, will not be used by default;
12
-
13
- 2. Go to _Creation > Firestore Database_ page (on sidebar) and _Create database_:
14
- - Just bypass with default production mode and rules;
15
- - Select region `us-east4` (recommended, or multi-region `nam5 (us-central)`);
16
-
17
- 3. Go to _Creation > Authentication_ and click _Get started_:
18
- - Click _Native providers > Email/password_ and enable _Email link (login without password)_;
19
- - Optionally, add other provides by _Smartphone_ (SMS, generates additional costs) and/or social media;
20
-
21
- 4. Go to :gear: _> Project configurations_ e edit:
22
- - _Default location for GCP resources_: Same Firestore region (`us-east4`);
23
- - _Public settings > Publicly displayed name_: Your store name;
24
- - _Public settings > Support email_ (optional);
25
-
26
- 5. Firebase free plan doesn't support sending external HTTP requests, so you'll need to upgrade to _Blaze_ (on demand) plan;
27
-
28
- 6. [Use this template](https://github.com/ecomplus/store/generate) to generate a new repository for your store;
7
+ [:us: First deployment and setup](./SETUP.md)
29
8
 
30
- Proceed with:
31
- - [Better way using command line](#first-deploy-on-cli)
32
- - [Only in browser](#browser-only-setup) (may be easier but less safe, not recommended)
9
+ [:brazil: Primeiro deploy e configuração](./SETUP.pt-BR.md)
33
10
 
34
- #### First deploy on CLI
11
+ ## Local development
35
12
 
36
- 7. Setup and first deploy from your terminal with [Firebase CLI](https://firebase.google.com/docs/cli):
37
13
  ```bash
38
- # Install `firebase-tools` and login
39
- npm install -g firebase-tools && firebase login
40
- ```
41
- ```bash
42
- # Clone your new store repository
43
- git clone git@github.com:{gh-user}/{new-store}.git
44
- cd {new-store}
45
14
  npm i
46
15
  ```
47
16
 
48
- <details open>
49
- <summary>With <a href="https://cloud.google.com/sdk/docs/install">gcloud CLI</a> (optional) installed</summary>
50
-
51
- ```bash
52
- # Run project configuration and deploy on GitHub Actions
53
- FIREBASE_PROJECT_ID={project-id} npm run setup
54
- ```
55
-
56
17
  > **Note**
57
- > Account key created automatically with only required permissions using gcloud CLI (skip steps 6 and 7).
58
-
59
- </details>
18
+ > Check VS Code (highly) recommend extensions in _store/.vscode/extensions.json_
60
19
 
61
- <details>
62
- <summary>Without gcloud CLI</summary>
20
+ ### Storefront
63
21
 
64
22
  ```bash
65
- # Run project configuration and first deploy
66
- FIREBASE_PROJECT_ID={project-id} npm run setup -- --no-gcloud
67
- npm run deploy
23
+ npm run dev
68
24
  ```
69
25
 
70
- 7. [Create a service account](https://console.cloud.google.com/iam-admin/serviceaccounts) for your Firebase project directly on Google Cloud Platform:
71
- - Name it _Cloud Commerce GH Actions (YOUR REPOSITORY)_;
72
- - Describe it _A service account with permission to deploy Cloud Commerce from the GitHub repository to Firebase_;
73
- - Continue and select the following roles to the service account:
74
- 1. _Firebase Admin_
75
- 2. _API Keys Viewer_
76
- 3. _Cloud Run Viewer_
77
- 4. _Cloud Functions Admin_
78
- 5. _Artifact Registry Admin_
79
- 6. _App Engine Creator_
80
- 7. _App Engine Admin_
81
- 8. _Cloud Scheduler Admin_
82
- 8. _Service Account User_
83
-
84
- 8. Back in the service accounts list, click the 3 dots (actions) and select _Manage keys_, generate and download a JSON key for the created account;
85
-
86
- </details>
87
-
88
- 9. Set the following secrets to your GitHub repository (_Settings > Secrets > Actions_):
89
- - `FIREBASE_SERVICE_ACCOUNT`: Paste the generated Google Cloud key JSON
90
- - `ECOM_AUTHENTICATION_ID`: Get from CLI setup output
91
- - `ECOM_API_KEY`: Get from CLI setup output
92
-
93
- :checkered_flag: :checkered_flag: :checkered_flag: **All done, congrats!**
94
-
95
- ---
96
-
97
- #### Browser-only setup
98
-
99
- > **Warning**
100
- > This configuration option is less secure, we recommend [first deploy on CLI](#first-deploy-on-cli) instead.
101
-
102
- 7. [Create a service account](https://console.cloud.google.com/iam-admin/serviceaccounts) for your Firebase project directly on Google Cloud Platform:
103
- - Name it _Cloud Commerce GH Actions (YOUR REPOSITORY)_;
104
- - Describe it _A service account with ALL permissions to deploy Cloud Commerce from the GitHub to Firebase_;
105
- - Continue and select the role _Quick access > Basic > Proprietary_;
106
-
107
- 8. Back in the service accounts list, click the 3 dots (actions) and select _Manage keys_, generate and download a JSON key for the created account;
26
+ It starts serving the site at http://localhost:3000/.
108
27
 
109
- 9. Set the following secrets to your GitHub repository (_Settings > Secrets > Actions_):
110
- - `FIREBASE_SERVICE_ACCOUNT`: Paste the generated Google Cloud key JSON
111
- - `ECOM_STORE_ID`: Copy your _Store ID_ on the [E-Com Plus admin](https://ecomplus.app/)
112
- - `ECOM_AUTHENTICATION_ID`: Copy your _Authentication ID_ on the [E-Com Plus admin](https://ecomplus.app/)
113
- - `ECOM_API_KEY`: Copy your _API Key_ on the [E-Com Plus admin](https://ecomplus.app/)
28
+ Edit your store source in _functions/ssr_:
29
+ - _src_: pages, components, styles and scripts sources;
30
+ - _content_: JSON and Markdown content (editable with git-based CMS);
31
+ - _public_: images and not-parsed static assets;