cloudcommerce 0.0.68 → 0.0.71
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 +16 -0
- package/package.json +1 -1
- package/packages/api/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/events/package.json +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/modules/package.json +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/package.json +1 -1
- package/packages/storefront/astro.config.mjs +5 -0
- package/packages/storefront/content/blog.json +18 -0
- package/packages/storefront/content/brands.json +24 -0
- package/packages/storefront/content/categories.json +24 -0
- package/packages/storefront/content/code.json +5 -0
- package/packages/storefront/content/collections.json +24 -0
- package/packages/storefront/content/contacts.json +13 -0
- package/packages/storefront/content/footer.json +46 -0
- package/packages/storefront/content/header.json +27 -0
- package/packages/storefront/content/home.json +45 -0
- package/packages/storefront/content/info.json +18 -0
- package/packages/storefront/content/maintenance.json +6 -0
- package/packages/storefront/content/menu.json +6 -0
- package/packages/storefront/content/pages/contato.json +6 -0
- package/packages/storefront/content/pages/entrega.json +6 -0
- package/packages/storefront/content/pages/faq.json +6 -0
- package/packages/storefront/content/pages/pagamentos.json +6 -0
- package/packages/storefront/content/pages/privacidade.json +6 -0
- package/packages/storefront/content/pages/sobre-nos.json +6 -0
- package/packages/storefront/content/pages/termos.json +6 -0
- package/packages/storefront/content/pages/trocas.json +6 -0
- package/packages/storefront/content/posts/esta-loja-e-um-pwa.json +9 -0
- package/packages/storefront/content/products.json +32 -0
- package/packages/storefront/content/search.json +8 -0
- package/packages/storefront/content/settings.json +21 -0
- package/packages/storefront/content/social.json +5 -0
- package/packages/storefront/content/widgets/analytics.json +11 -0
- package/packages/storefront/content/widgets/compre-confie.json +11 -0
- package/packages/storefront/content/widgets/ebit.json +11 -0
- package/packages/storefront/content/widgets/fb-pixel.json +12 -0
- package/packages/storefront/content/widgets/gmc-ratings.json +12 -0
- package/packages/storefront/content/widgets/minicart.json +6 -0
- package/packages/storefront/content/widgets/offers-notification.json +11 -0
- package/packages/storefront/content/widgets/opinioes-verificadas.json +18 -0
- package/packages/storefront/content/widgets/product-card.json +10 -0
- package/packages/storefront/content/widgets/product.json +13 -0
- package/packages/storefront/content/widgets/search-engine.json +8 -0
- package/packages/storefront/content/widgets/search.json +6 -0
- package/packages/storefront/content/widgets/tag-manager.json +12 -0
- package/packages/storefront/content/widgets/tawkto.json +12 -0
- package/packages/storefront/content/widgets/trustvox.json +15 -0
- package/packages/storefront/content/widgets/user.json +5 -0
- package/packages/storefront/dist/client/assets/{_...fae19676.css → _...98510c96.css} +1 -1
- package/packages/storefront/dist/server/entry.mjs +110 -107
- package/packages/storefront/example.env +1 -1
- package/packages/storefront/package.json +5 -2
- package/packages/storefront/src/layouts/Layout.astro +7 -0
- package/packages/storefront/src/pages/[...slug].astro +1 -1
- package/packages/storefront/src/types.ts +18 -0
- package/packages/storefront/storefront.config.mjs +41 -0
- package/packages/types/package.json +1 -1
- package/packages/storefront/src/storefront-config.ts +0 -39
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { fileURLToPath } from 'url';
|
|
2
|
+
import { readFileSync } from 'fs';
|
|
3
|
+
import { resolve as resolvePath } from 'path';
|
|
4
|
+
import config from '@cloudcommerce/config';
|
|
5
|
+
|
|
6
|
+
export default () => {
|
|
7
|
+
const {
|
|
8
|
+
STOREFRONT_BASE_DIR,
|
|
9
|
+
VITE_ECOM_STORE_ID,
|
|
10
|
+
} = import.meta.env || process.env;
|
|
11
|
+
|
|
12
|
+
const { storeId, lang } = config.get();
|
|
13
|
+
|
|
14
|
+
let baseDir;
|
|
15
|
+
if (STOREFRONT_BASE_DIR) {
|
|
16
|
+
const currentDir = fileURLToPath(new URL('.', import.meta.url));
|
|
17
|
+
baseDir = resolvePath(currentDir, STOREFRONT_BASE_DIR);
|
|
18
|
+
} else {
|
|
19
|
+
baseDir = process.cwd();
|
|
20
|
+
}
|
|
21
|
+
const dirContent = resolvePath(baseDir, 'content');
|
|
22
|
+
if (VITE_ECOM_STORE_ID) {
|
|
23
|
+
config.set({ storeId: Number(VITE_ECOM_STORE_ID) });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const settings = JSON.parse(
|
|
27
|
+
readFileSync(resolvePath(dirContent, 'settings.json'), 'utf8'),
|
|
28
|
+
);
|
|
29
|
+
const { domain } = settings;
|
|
30
|
+
const primaryColor = settings.primary_color || '#20c997';
|
|
31
|
+
const secondaryColor = settings.secondary_color || '#343a40';
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
storeId,
|
|
35
|
+
lang,
|
|
36
|
+
domain,
|
|
37
|
+
primaryColor,
|
|
38
|
+
secondaryColor,
|
|
39
|
+
settings,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from 'url';
|
|
2
|
-
import { readFileSync } from 'fs';
|
|
3
|
-
import { resolve as resolvePath } from 'path';
|
|
4
|
-
import config from '@cloudcommerce/config';
|
|
5
|
-
|
|
6
|
-
const {
|
|
7
|
-
STOREFRONT_BASE_DIR,
|
|
8
|
-
VITE_ECOM_STORE_ID,
|
|
9
|
-
// @ts-ignore
|
|
10
|
-
}: Record<string, string | undefined> = import.meta.env;
|
|
11
|
-
|
|
12
|
-
let baseDir: string;
|
|
13
|
-
if (STOREFRONT_BASE_DIR) {
|
|
14
|
-
const currentDir = fileURLToPath(new URL('.', import.meta.url));
|
|
15
|
-
baseDir = resolvePath(currentDir, STOREFRONT_BASE_DIR);
|
|
16
|
-
} else {
|
|
17
|
-
baseDir = process.cwd();
|
|
18
|
-
}
|
|
19
|
-
const dirContent = resolvePath(baseDir, 'content');
|
|
20
|
-
if (VITE_ECOM_STORE_ID) {
|
|
21
|
-
config.set({ storeId: Number(VITE_ECOM_STORE_ID) });
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const settings: typeof import('../../../store/functions/ssr/content/settings.json') = JSON.parse(
|
|
25
|
-
readFileSync(resolvePath(dirContent, 'settings.json'), 'utf8'),
|
|
26
|
-
);
|
|
27
|
-
const primaryColor = settings.primary_color || '#20c997';
|
|
28
|
-
const secondaryColor = settings.secondary_color || '#343a40';
|
|
29
|
-
|
|
30
|
-
export default () => {
|
|
31
|
-
const { storeId, lang } = config.get();
|
|
32
|
-
return {
|
|
33
|
-
settings,
|
|
34
|
-
lang,
|
|
35
|
-
storeId,
|
|
36
|
-
primaryColor,
|
|
37
|
-
secondaryColor,
|
|
38
|
-
};
|
|
39
|
-
};
|