cloudcommerce 2.0.0 → 2.0.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.
- package/CHANGELOG.md +17 -0
- package/ecomplus-stores/barra-doce/conf/firebase.json +7 -0
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/astro.config.mjs +18 -3
- package/ecomplus-stores/barra-doce/functions/ssr/content/blog/3.md +24 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/blog/4.md +24 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/blog/5.md +24 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/blog/dos.md +24 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/blog/uno.md +24 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/contato.md +9 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/terms.md +20 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/trocas.md +9 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/pages/brands.json +16 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/pages/categories.json +16 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/pages/collections.json +16 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/pages/home.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/content/pages/search.json +7 -0
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +10 -9
- package/ecomplus-stores/barra-doce/functions/ssr/src/assets/style.css +24 -10
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/BannersGrid.astro +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/BlogPosts.vue +88 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/Breadcrumbs.vue +49 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartSidebar.vue +2 -2
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/CheckoutPage.vue +14 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/Collapse.vue +4 -4
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ContentEntry.vue +23 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/DocBanners.vue +26 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/FooterStamps.vue +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/HeroSlider.vue +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ImagesGallery.vue +5 -4
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/LoginForm.vue +2 -2
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/PageTitle.vue +43 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/Pagination.vue +67 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/Prices.vue +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductCard.vue +3 -4
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductDetails.vue +4 -3
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductShelf.vue +34 -18
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductSpecifications.vue +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchFilters.vue +122 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchModal.vue +97 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchShowcase.vue +169 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopFooter.vue +10 -6
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +64 -64
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeaderSubmenu.vue +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopSidenav.vue +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/SkuSelector.vue +7 -7
- package/ecomplus-stores/barra-doce/functions/ssr/src/env.d.ts +4 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/Base.astro +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageFooter.astro +4 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageHeader.astro +2 -2
- package/ecomplus-stores/barra-doce/functions/ssr/src/main/Fallback.astro +28 -5
- package/ecomplus-stores/barra-doce/functions/ssr/src/main/Main.astro +26 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/main/content/Hero.astro +33 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/main/{Sections.astro → content/Sections.astro} +29 -6
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/[...slug].astro +35 -8
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/account.astro +6 -2
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/index.astro +24 -4
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/blog/[page].astro +71 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/blog/_blog-pages.ts +9 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/~fallback.astro +9 -2
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/package.json +9 -9
- package/packages/api/package.json +1 -1
- package/packages/apps/affiliate-program/package.json +1 -1
- package/packages/apps/correios/package.json +2 -2
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +2 -2
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +1 -1
- package/packages/apps/flash-courier/package.json +3 -3
- package/packages/apps/frenet/package.json +2 -2
- package/packages/apps/galaxpay/package.json +2 -2
- package/packages/apps/google-analytics/package.json +2 -2
- package/packages/apps/jadlog/package.json +2 -2
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/mandae/package.json +3 -3
- package/packages/apps/melhor-envio/package.json +2 -2
- package/packages/apps/mercadopago/package.json +2 -2
- package/packages/apps/pagarme/package.json +2 -2
- package/packages/apps/pagarme-v5/package.json +2 -2
- package/packages/apps/paghiper/package.json +2 -2
- package/packages/apps/pix/package.json +2 -2
- package/packages/apps/tiny-erp/package.json +2 -2
- package/packages/apps/webhooks/package.json +2 -2
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +2 -2
- package/packages/eslint/package.json +3 -3
- package/packages/events/package.json +1 -1
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +2 -2
- package/packages/passport/package.json +1 -1
- package/packages/ssr/package.json +3 -3
- package/packages/storefront/config/astro/context-directive.mjs +16 -2
- package/packages/storefront/config/astro/index.d.ts +3 -1
- package/packages/storefront/package.json +6 -6
- package/packages/storefront/src/lib/components/SharedData.astro +1 -1
- package/packages/storefront/src/lib/composables/use-shared-data.ts +2 -1
- package/packages/storefront/src/lib/composables/use-sku-selector.ts +11 -7
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/content/blog/.gitkeep +0 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/contato.json +0 -11
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/terms.json +0 -11
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/trocas.json +0 -11
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/Breadcrumbs.astro +0 -44
- package/ecomplus-stores/barra-doce/functions/ssr/src/main/Home.astro +0 -37
- package/ecomplus-stores/barra-doce/functions/ssr/src/main/Wildcard.astro +0 -18
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/index.astro +0 -32
package/ecomplus-stores/barra-doce/functions/ssr/src/main/{Sections.astro → content/Sections.astro}
RENAMED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { usePageSections } from '@@sf/layouts/use-page-main';
|
|
3
|
+
import ContentClearfix from '@@sf/components/ContentClearfix.vue';
|
|
3
4
|
import BannersGrid from '~/components/BannersGrid.astro';
|
|
5
|
+
import Breadcrumbs from '~/components/Breadcrumbs.vue';
|
|
4
6
|
import ProductShelf from '~/components/ProductShelf.vue';
|
|
5
|
-
import Breadcrumbs from '~/components/Breadcrumbs.astro';
|
|
6
7
|
import DocDescription from '~/components/DocDescription.vue';
|
|
8
|
+
import DocBanners from '~/components/DocBanners.vue';
|
|
7
9
|
import ProductDetails from '~/components/ProductDetails.vue';
|
|
8
10
|
import ProductSpecifications from '~/components/ProductSpecifications.vue';
|
|
11
|
+
import SearchShowcase from '~/components/SearchShowcase.vue';
|
|
12
|
+
import PageTitle from '~/components/PageTitle.vue';
|
|
13
|
+
import ContentEntry from '~/components/ContentEntry.vue';
|
|
9
14
|
|
|
10
15
|
const { routeContext } = Astro.locals;
|
|
11
16
|
const { sections } = await usePageSections({
|
|
@@ -15,24 +20,29 @@ const { sections } = await usePageSections({
|
|
|
15
20
|
return { props: content };
|
|
16
21
|
},
|
|
17
22
|
});
|
|
18
|
-
const {
|
|
19
|
-
/* `apiContext` is surelly set here (from
|
|
23
|
+
const { cmsContent } = routeContext;
|
|
24
|
+
/* `apiContext` is surelly set here (from Main.astro)
|
|
20
25
|
cause route resource is required to define sections from content. */
|
|
21
26
|
---
|
|
22
27
|
|
|
23
|
-
<article class="
|
|
24
|
-
{sections.map(async ({ type, props }) => {
|
|
28
|
+
<article class="mb-9 mt-6 md:mb-12 md:mt-8">
|
|
29
|
+
{sections.map(async ({ type, props }, index) => {
|
|
25
30
|
switch (type) {
|
|
26
31
|
case 'product-shelf':
|
|
27
|
-
return
|
|
32
|
+
return index === 0 || (index < 2 && !cmsContent?.hero?.slides.length)
|
|
28
33
|
? <ProductShelf {...props} client:idle />
|
|
29
34
|
: <ProductShelf {...props} client:visible />
|
|
35
|
+
case 'related-products':
|
|
36
|
+
props.isRelatedProducts = true;
|
|
37
|
+
return <ProductShelf {...props} client:visible />
|
|
30
38
|
case 'banners-grid':
|
|
31
39
|
return <BannersGrid {...props} />
|
|
32
40
|
case 'breadcrumbs':
|
|
33
41
|
return <Breadcrumbs />
|
|
34
42
|
case 'doc-description':
|
|
35
43
|
return <DocDescription />
|
|
44
|
+
case 'doc-banners':
|
|
45
|
+
return <DocBanners />
|
|
36
46
|
case 'product-details':
|
|
37
47
|
const { hasDescription, hasSpecifications, ...detailsProps } = props;
|
|
38
48
|
return <>
|
|
@@ -43,6 +53,19 @@ cause route resource is required to define sections from content. */
|
|
|
43
53
|
</Fragment>
|
|
44
54
|
</ProductDetails>
|
|
45
55
|
</>
|
|
56
|
+
case 'search-showcase':
|
|
57
|
+
case 'context-showcase':
|
|
58
|
+
return <>
|
|
59
|
+
<article class="min-h-[500px]">
|
|
60
|
+
<SearchShowcase {...props} client:context />
|
|
61
|
+
</article>
|
|
62
|
+
</>
|
|
63
|
+
case 'page-title':
|
|
64
|
+
return <PageTitle {...props} />
|
|
65
|
+
case 'content-entry':
|
|
66
|
+
return <ContentEntry {...props} />
|
|
67
|
+
case 'custom-html':
|
|
68
|
+
return <ContentClearfix html={props.html} />
|
|
46
69
|
case 'c:foo':
|
|
47
70
|
return <div data-foo={props.foo}></div>
|
|
48
71
|
default:
|
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
---
|
|
2
2
|
import api from '@cloudcommerce/api';
|
|
3
|
-
import
|
|
3
|
+
import {
|
|
4
|
+
type RouteContext,
|
|
5
|
+
loadRouteContext,
|
|
6
|
+
getConfig,
|
|
7
|
+
} from '@@sf/ssr-context';
|
|
4
8
|
import BaseHead from '@@sf/layouts/BaseHead.astro';
|
|
5
9
|
import Base from '~/layouts/Base.astro';
|
|
6
10
|
import PageHeader from '~/layouts/PageHeader.astro';
|
|
7
11
|
import PageFooter from '~/layouts/PageFooter.astro';
|
|
8
|
-
import
|
|
12
|
+
import Main from '~/main/Main.astro';
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
let slug = Astro.params.slug || '';
|
|
15
|
+
if (slug.endsWith('.map')) {
|
|
11
16
|
return new Response(null, { status: 404 });
|
|
12
17
|
}
|
|
13
|
-
|
|
18
|
+
let contentCollection: string | undefined;
|
|
19
|
+
if (slug.startsWith('p/')) {
|
|
20
|
+
contentCollection = 'extra-pages';
|
|
21
|
+
Astro.params.slug = slug.replace(/^p\//, '');
|
|
22
|
+
} else if (slug.startsWith('posts/')) {
|
|
23
|
+
contentCollection = 'blog';
|
|
24
|
+
Astro.params.slug = slug.replace(/^posts\//, '');
|
|
25
|
+
}
|
|
14
26
|
let routeContext: RouteContext | undefined;
|
|
15
27
|
let loadError: any;
|
|
16
28
|
try {
|
|
17
|
-
routeContext = await loadRouteContext(Astro);
|
|
29
|
+
routeContext = await loadRouteContext(Astro, { contentCollection });
|
|
18
30
|
} catch (err: any) {
|
|
19
31
|
if (err.astroResponse) {
|
|
20
32
|
return err.astroResponse;
|
|
@@ -23,8 +35,23 @@ try {
|
|
|
23
35
|
}
|
|
24
36
|
|
|
25
37
|
export async function getStaticPaths() {
|
|
26
|
-
|
|
27
|
-
|
|
38
|
+
const paths: Array<{ params: { slug?: string } }> = [{
|
|
39
|
+
params: { slug: undefined },
|
|
40
|
+
}];
|
|
41
|
+
if (!import.meta.env.BUILD_MINIMAL) {
|
|
42
|
+
const { data } = await api.get('products?sort=-sales&fields=slug&limit=2')
|
|
43
|
+
data.result.forEach(({ slug }) => {
|
|
44
|
+
if (slug) paths.push({ params: { slug } });
|
|
45
|
+
});
|
|
46
|
+
const pageSlugs = await getConfig().getContent('extra-pages/');
|
|
47
|
+
const postSlugs = await getConfig().getContent('blog/');
|
|
48
|
+
pageSlugs.slice(0, 2).map((slug) => `p/${slug}`)
|
|
49
|
+
.concat(postSlugs.slice(0, 2).map((slug) => `posts/${slug}`))
|
|
50
|
+
.forEach((slug) => {
|
|
51
|
+
paths.push({ params: { slug } });
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return paths;
|
|
28
55
|
}
|
|
29
56
|
---
|
|
30
57
|
|
|
@@ -34,7 +61,7 @@ export async function getStaticPaths() {
|
|
|
34
61
|
<Base>
|
|
35
62
|
<BaseHead slot="base-head" />
|
|
36
63
|
<PageHeader />
|
|
37
|
-
<
|
|
64
|
+
<Main />
|
|
38
65
|
<PageFooter />
|
|
39
66
|
</Base>
|
|
40
67
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import { i19myAccount } from '@@i18n';
|
|
3
|
+
import { type RouteContext, loadRouteContext } from '@@sf/ssr-context';
|
|
3
4
|
import Picture from '@@sf/components/Picture.astro';
|
|
4
5
|
import BaseHead from '@@sf/layouts/BaseHead.astro';
|
|
5
6
|
import Base from '~/layouts/Base.astro';
|
|
@@ -17,7 +18,10 @@ const { settings } = routeContext;
|
|
|
17
18
|
<!DOCTYPE html>
|
|
18
19
|
<html lang={routeContext.lang.replace('_', '-')}>
|
|
19
20
|
<Base>
|
|
20
|
-
<
|
|
21
|
+
<Fragment slot="base-head">
|
|
22
|
+
<BaseHead />
|
|
23
|
+
<title>{`${i19myAccount} | ${settings.name}`}</title>
|
|
24
|
+
</Fragment>
|
|
21
25
|
<main>
|
|
22
26
|
<AccountPage client:only>
|
|
23
27
|
<Picture
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import { i19shoppingCart } from '@@i18n';
|
|
3
|
+
import { type RouteContext, loadRouteContext } from '@@sf/ssr-context';
|
|
4
|
+
import Picture from '@@sf/components/Picture.astro';
|
|
3
5
|
import BaseHead from '@@sf/layouts/BaseHead.astro';
|
|
4
6
|
import Base from '~/layouts/Base.astro';
|
|
5
7
|
import CheckoutPage from '~/components/CheckoutPage.vue';
|
|
@@ -10,7 +12,8 @@ try {
|
|
|
10
12
|
} catch (err: any) {
|
|
11
13
|
return err.astroResponse;
|
|
12
14
|
}
|
|
13
|
-
const
|
|
15
|
+
const { settings, getContent } = routeContext;
|
|
16
|
+
const layoutContent = await getContent('layout');
|
|
14
17
|
const { footer: { stamps } } = layoutContent;
|
|
15
18
|
---
|
|
16
19
|
|
|
@@ -19,6 +22,7 @@ const { footer: { stamps } } = layoutContent;
|
|
|
19
22
|
<Base>
|
|
20
23
|
<Fragment slot="base-head">
|
|
21
24
|
<BaseHead />
|
|
25
|
+
<title>{`${i19shoppingCart} | ${settings.name}`}</title>
|
|
22
26
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ecomplus/storefront-twbs@7/dist/cdn/storefront-twbs.min.css">
|
|
23
27
|
<style is:inline>
|
|
24
28
|
body {
|
|
@@ -51,12 +55,28 @@ const { footer: { stamps } } = layoutContent;
|
|
|
51
55
|
--primary-lightest-yiq: var(--c-on-light);
|
|
52
56
|
--primary-lightest-rgb: var(--rgb-primary-200);
|
|
53
57
|
}
|
|
54
|
-
.lead {
|
|
58
|
+
#storefront-app .lead {
|
|
55
59
|
margin-bottom: 1.25rem;
|
|
56
60
|
}
|
|
61
|
+
#storefront-app hr {
|
|
62
|
+
margin-top: 1rem;
|
|
63
|
+
margin-bottom: 1rem;
|
|
64
|
+
}
|
|
65
|
+
#storefront-app p {
|
|
66
|
+
margin-bottom: 1rem;
|
|
67
|
+
}
|
|
57
68
|
</style>
|
|
58
69
|
</Fragment>
|
|
59
|
-
<CheckoutPage footerStamps={stamps}
|
|
70
|
+
<CheckoutPage footerStamps={stamps}>
|
|
71
|
+
<Picture
|
|
72
|
+
slot="logo"
|
|
73
|
+
src={settings.logo}
|
|
74
|
+
alt={settings.name}
|
|
75
|
+
widths={[300]}
|
|
76
|
+
loading="lazy"
|
|
77
|
+
class="max-w-[150px]"
|
|
78
|
+
/>
|
|
79
|
+
</CheckoutPage>
|
|
60
80
|
<script src="@@sf/scripts/vbeta-app"></script>
|
|
61
81
|
</Base>
|
|
62
82
|
</html>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { type RouteContext, loadRouteContext } 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 PageFooter from '~/layouts/PageFooter.astro';
|
|
7
|
+
import BlogPosts, { type Props as BlogPostsProps } from '~/components/BlogPosts.vue';
|
|
8
|
+
import { POSTS_PER_PAGE, countBlogPages } from './_blog-pages';
|
|
9
|
+
|
|
10
|
+
let routeContext: RouteContext | undefined;
|
|
11
|
+
let loadError: any;
|
|
12
|
+
try {
|
|
13
|
+
routeContext = await loadRouteContext(Astro);
|
|
14
|
+
} catch (err: any) {
|
|
15
|
+
if (err.astroResponse) {
|
|
16
|
+
return err.astroResponse;
|
|
17
|
+
}
|
|
18
|
+
loadError = err;
|
|
19
|
+
}
|
|
20
|
+
if (!routeContext) {
|
|
21
|
+
return Astro.redirect(`/~fallback?url=${Astro.url.pathname}`);
|
|
22
|
+
}
|
|
23
|
+
const { getContent, settings } = routeContext;
|
|
24
|
+
const { postSlugs, totalPages } = await countBlogPages();
|
|
25
|
+
const page = Number(Astro.params.page);
|
|
26
|
+
if (!page || page > totalPages) {
|
|
27
|
+
return Astro.redirect('/blog/1');
|
|
28
|
+
}
|
|
29
|
+
const posts: BlogPostsProps['posts'] = [];
|
|
30
|
+
const pageOffset = (page - 1) * POSTS_PER_PAGE;
|
|
31
|
+
await Promise.all(
|
|
32
|
+
postSlugs.slice(pageOffset, pageOffset + POSTS_PER_PAGE).map((slug) => {
|
|
33
|
+
return new Promise((resolve) => {
|
|
34
|
+
getContent(`blog/${slug}`).then((content) => {
|
|
35
|
+
if (content) {
|
|
36
|
+
const { markdown, ...post } = content;
|
|
37
|
+
posts.push({ ...post, slug });
|
|
38
|
+
}
|
|
39
|
+
resolve(null);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}),
|
|
43
|
+
);
|
|
44
|
+
const metaTitle = `Blog | ${settings.name}`;
|
|
45
|
+
|
|
46
|
+
export async function getStaticPaths() {
|
|
47
|
+
if (import.meta.env.BUILD_MINIMAL) return [];
|
|
48
|
+
return [{
|
|
49
|
+
params: { page: 1 },
|
|
50
|
+
}];
|
|
51
|
+
}
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
<!DOCTYPE html>
|
|
55
|
+
<html lang={routeContext.lang.replace('_', '-')}>
|
|
56
|
+
{routeContext &&
|
|
57
|
+
<Base {metaTitle}>
|
|
58
|
+
<Fragment slot="base-head">
|
|
59
|
+
<BaseHead />
|
|
60
|
+
<title>{`Blog | ${settings.name}`}</title>
|
|
61
|
+
<meta name="description" content={settings.description}>
|
|
62
|
+
</Fragment>
|
|
63
|
+
<PageHeader />
|
|
64
|
+
<main>
|
|
65
|
+
<BlogPosts {page} {totalPages} {posts} />
|
|
66
|
+
</main>
|
|
67
|
+
<PageFooter />
|
|
68
|
+
</Base>
|
|
69
|
+
}
|
|
70
|
+
{loadError && <Fragment set:html={loadError.responseHTML} />}
|
|
71
|
+
</html>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getConfig } from '@@sf/ssr-context';
|
|
2
|
+
|
|
3
|
+
export const POSTS_PER_PAGE = 13;
|
|
4
|
+
|
|
5
|
+
export const countBlogPages = async () => {
|
|
6
|
+
const postSlugs = await getConfig().getContent('blog/');
|
|
7
|
+
const totalPages = Math.ceil(postSlugs.length / POSTS_PER_PAGE) || 1;
|
|
8
|
+
return { postSlugs, totalPages };
|
|
9
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import { i19error } from '@@i18n';
|
|
3
|
+
import { type RouteContext, loadRouteContext } from '@@sf/ssr-context';
|
|
3
4
|
import BaseHead from '@@sf/layouts/BaseHead.astro';
|
|
4
5
|
import Base from '~/layouts/Base.astro';
|
|
5
6
|
import PageHeader from '~/layouts/PageHeader.astro';
|
|
6
7
|
import FallbackMain from '~/main/Fallback.astro';
|
|
8
|
+
import PageFooter from '~/layouts/PageFooter.astro';
|
|
7
9
|
|
|
8
10
|
let routeContext: RouteContext;
|
|
9
11
|
try {
|
|
@@ -11,13 +13,18 @@ try {
|
|
|
11
13
|
} catch (err: any) {
|
|
12
14
|
return err.astroResponse;
|
|
13
15
|
}
|
|
16
|
+
const { settings } = routeContext;
|
|
14
17
|
---
|
|
15
18
|
|
|
16
19
|
<!DOCTYPE html>
|
|
17
20
|
<html lang={routeContext?.lang.replace('_', '-')}>
|
|
18
21
|
<Base>
|
|
19
|
-
<
|
|
22
|
+
<Fragment slot="base-head">
|
|
23
|
+
<BaseHead />
|
|
24
|
+
<title>{`${i19error} | ${settings.name}`}</title>
|
|
25
|
+
</Fragment>
|
|
20
26
|
<PageHeader />
|
|
21
27
|
<FallbackMain />
|
|
28
|
+
<PageFooter />
|
|
22
29
|
</Base>
|
|
23
30
|
</html>
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/events": "^0.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.
|
|
20
|
-
"@cloudcommerce/modules": "^0.
|
|
18
|
+
"@cloudcommerce/events": "^2.0.1",
|
|
19
|
+
"@cloudcommerce/firebase": "^2.0.1",
|
|
20
|
+
"@cloudcommerce/modules": "^2.0.1"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"url": "https://github.com/ecomplus/cloud-commerce/issues"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@cloudcommerce/cli": "^0.
|
|
26
|
+
"@cloudcommerce/cli": "^2.0.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@cloudcommerce/eslint": "^0.
|
|
29
|
+
"@cloudcommerce/eslint": "^2.0.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcommerce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"description": "Open fair-code headless commerce platform: API-first, microservices based, event driven and cloud native",
|
|
6
6
|
"main": "packages/api/lib/index.js",
|
|
7
7
|
"author": "E-Com Club Softwares para E-commerce <ti@e-com.club>",
|
|
@@ -16,21 +16,21 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@commitlint/cli": "^18.4.
|
|
20
|
-
"@commitlint/config-conventional": "^18.4.
|
|
21
|
-
"@commitlint/rules": "^18.4.
|
|
22
|
-
"@types/node": "^18.19.
|
|
19
|
+
"@commitlint/cli": "^18.4.4",
|
|
20
|
+
"@commitlint/config-conventional": "^18.4.4",
|
|
21
|
+
"@commitlint/rules": "^18.4.4",
|
|
22
|
+
"@types/node": "^18.19.5",
|
|
23
23
|
"eslint": "^8.56.0",
|
|
24
24
|
"husky": "^8.0.3",
|
|
25
25
|
"standard-version": "^9.5.0",
|
|
26
26
|
"ts-node": "^10.9.2",
|
|
27
|
-
"turbo": "^1.11.
|
|
27
|
+
"turbo": "^1.11.3",
|
|
28
28
|
"typescript": "~5.2.2",
|
|
29
29
|
"uglify-js": "^3.17.4",
|
|
30
|
-
"vite": "^5.0.
|
|
31
|
-
"vitest": "^1.1.
|
|
30
|
+
"vite": "^5.0.11",
|
|
31
|
+
"vitest": "^1.1.3",
|
|
32
32
|
"zx": "^7.2.3",
|
|
33
|
-
"@cloudcommerce/eslint": "2.0.
|
|
33
|
+
"@cloudcommerce/eslint": "2.0.2"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"fix-install": "bash scripts/pre-install.sh && pnpm i",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-correios",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app for Correios shipping calculation",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@cloudcommerce/api": "workspace:*",
|
|
28
28
|
"@cloudcommerce/firebase": "workspace:*",
|
|
29
29
|
"@google-cloud/pubsub": "^4.1.0",
|
|
30
|
-
"axios": "^1.6.
|
|
30
|
+
"axios": "^1.6.5",
|
|
31
31
|
"firebase-admin": "^12.0.0",
|
|
32
32
|
"firebase-functions": "^4.6.0"
|
|
33
33
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-datafrete",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app to integrate Datafrete shipping gateway ",
|
|
6
6
|
"main": "lib/datafrete.js",
|
|
7
7
|
"exports": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@cloudcommerce/api": "workspace:*",
|
|
27
27
|
"@cloudcommerce/firebase": "workspace:*",
|
|
28
28
|
"@ecomplus/utils": "1.5.0-rc.6",
|
|
29
|
-
"axios": "^1.6.
|
|
29
|
+
"axios": "^1.6.5",
|
|
30
30
|
"firebase-admin": "^12.0.0",
|
|
31
31
|
"firebase-functions": "^4.6.0"
|
|
32
32
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-flash-courier",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app to integrate Flash Courier",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@cloudcommerce/api": "workspace:*",
|
|
27
27
|
"@cloudcommerce/firebase": "workspace:*",
|
|
28
|
-
"axios": "^1.6.
|
|
29
|
-
"firebase-functions": "^4.
|
|
28
|
+
"axios": "^1.6.5",
|
|
29
|
+
"firebase-functions": "^4.6.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@cloudcommerce/types": "workspace:*"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-frenet",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app for Frenet shipping calculation",
|
|
6
6
|
"main": "lib/frenet.js",
|
|
7
7
|
"exports": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@cloudcommerce/api": "workspace:*",
|
|
28
28
|
"@cloudcommerce/firebase": "workspace:*",
|
|
29
|
-
"axios": "^1.6.
|
|
29
|
+
"axios": "^1.6.5",
|
|
30
30
|
"firebase-admin": "^12.0.0",
|
|
31
31
|
"firebase-functions": "^4.6.0"
|
|
32
32
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-galaxpay",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app to integrate Galax Pay for recurring payments",
|
|
6
6
|
"main": "lib/galaxpay.js",
|
|
7
7
|
"exports": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@cloudcommerce/api": "workspace:*",
|
|
27
27
|
"@cloudcommerce/firebase": "workspace:*",
|
|
28
|
-
"axios": "^1.6.
|
|
28
|
+
"axios": "^1.6.5",
|
|
29
29
|
"firebase-admin": "^12.0.0",
|
|
30
30
|
"firebase-functions": "^4.6.0"
|
|
31
31
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-google-analytics",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app to send carts/orders events to GA Measurement Protocol",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@cloudcommerce/api": "workspace:*",
|
|
23
23
|
"@cloudcommerce/firebase": "workspace:*",
|
|
24
|
-
"axios": "^1.6.
|
|
24
|
+
"axios": "^1.6.5",
|
|
25
25
|
"firebase-admin": "^12.0.0",
|
|
26
26
|
"firebase-functions": "^4.6.0"
|
|
27
27
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-jadlog",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app for Jadlog shipping calculation",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"repository": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@cloudcommerce/api": "workspace:*",
|
|
23
|
-
"axios": "^1.6.
|
|
23
|
+
"axios": "^1.6.5"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@cloudcommerce/types": "workspace:*"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-mandae",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app to integrate Mandaê shipping intermediator",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"repository": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@cloudcommerce/api": "workspace:*",
|
|
23
23
|
"@ecomplus/utils": "1.5.0-rc.6",
|
|
24
|
-
"axios": "^1.6.
|
|
25
|
-
"firebase-functions": "^4.
|
|
24
|
+
"axios": "^1.6.5",
|
|
25
|
+
"firebase-functions": "^4.6.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@cloudcommerce/test-base": "workspace:*",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-melhor-envio",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app to integrate Melhor Envio",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@cloudcommerce/api": "workspace:*",
|
|
27
27
|
"@cloudcommerce/firebase": "workspace:*",
|
|
28
|
-
"axios": "^1.6.
|
|
28
|
+
"axios": "^1.6.5",
|
|
29
29
|
"firebase-admin": "^12.0.0",
|
|
30
30
|
"firebase-functions": "^4.6.0"
|
|
31
31
|
},
|