cloudcommerce 0.0.68 → 0.0.69

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 CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.0.69](https://github.com/ecomplus/cloud-commerce/compare/v0.0.68...v0.0.69) (2022-09-07)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **storefront:** Use `getConfig` function to properly handle env vars on `storefront.config.mjs` ([5bfdaea](https://github.com/ecomplus/cloud-commerce/commit/5bfdaea8454d8e2bdbd64bfbc49d6fbf798c2d9d))
11
+
5
12
  ### [0.0.68](https://github.com/ecomplus/cloud-commerce/compare/v0.0.67...v0.0.68) (2022-09-07)
6
13
 
7
14
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloudcommerce",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
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>",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/api",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
5
5
  "description": "E-Com Plus Cloud Commerce APIs client/adapter",
6
6
  "main": "lib/api.js",
7
7
  "types": "lib/api.d.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-correios",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
5
5
  "description": "E-Com Plus Cloud Commerce app for Correios shipping calculation",
6
6
  "main": "lib/correios.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-custom-shipping",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
5
5
  "description": "E-Com Plus Cloud Commerce app for custom shipping methods",
6
6
  "main": "lib/custom-shipping.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-discounts",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
5
5
  "description": "E-Com Plus Cloud Commerce app for complex discount rules",
6
6
  "main": "lib/discounts.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-tiny-erp",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
5
5
  "description": "E-Com Plus Cloud Commerce app for Tiny ERP",
6
6
  "main": "lib/tiny-erp.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/cli",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
5
5
  "description": "E-Com Plus Cloud Commerce CLI tools",
6
6
  "bin": {
7
7
  "cloudcommerce": "./bin/run.mjs"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/config",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
5
5
  "description": "E-Com Plus Cloud Commerce base config",
6
6
  "main": "lib/config.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/events",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
5
5
  "description": "E-Com Plus Cloud Commerce app events",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/firebase",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
5
5
  "description": "E-Com Plus Cloud Commerce on Firebase",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/modules",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
5
5
  "description": "E-Com Plus Cloud Commerce modules API",
6
6
  "main": "lib/index.cjs",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/passport",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
5
5
  "description": "E-Com Plus Cloud Commerce customers authentication (passport) API",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/ssr",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
5
5
  "description": "E-Com Plus Cloud Commerce storefront SSR",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,3 +1,4 @@
1
+ import * as dotenv from 'dotenv';
1
2
  // https://github.com/import-js/eslint-plugin-import/issues/1810
2
3
  /* eslint-disable import/no-unresolved */
3
4
  import { defineConfig } from 'astro/config';
@@ -6,6 +7,9 @@ import vue from '@astrojs/vue';
6
7
  import partytown from '@astrojs/partytown';
7
8
  import prefetch from '@astrojs/prefetch';
8
9
  import sitemap from '@astrojs/sitemap';
10
+ import getConfig from './storefront.config.mjs';
11
+
12
+ dotenv.config();
9
13
 
10
14
  // https://astro.build/config
11
15
  export default defineConfig({
@@ -17,4 +21,5 @@ export default defineConfig({
17
21
  prefetch(),
18
22
  sitemap(),
19
23
  ],
24
+ site: `https://${getConfig().domain}`,
20
25
  });
@@ -1 +1 @@
1
- :root{--astro-gradient: linear-gradient(0deg,#4F39FA, #DA62C4)}h1:where(.astro-NJCM7BMR){margin:2rem 0}main:where(.astro-NJCM7BMR){margin:auto;padding:1em;max-width:60ch}.text-gradient:where(.astro-NJCM7BMR){font-weight:900;background-image:var(--astro-gradient);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-size:100% 200%;background-position-y:100%;border-radius:.4rem;animation:pulse 4s ease-in-out infinite}@keyframes pulse{0%,to{background-position-y:0%}50%{background-position-y:80%}}.instructions:where(.astro-NJCM7BMR){line-height:1.6;margin:1rem 0;background:#4F39FA;padding:1rem;border-radius:.4rem;color:var(--color-bg)}.instructions:where(.astro-NJCM7BMR) code:where(.astro-NJCM7BMR){font-size:.875em;border:.1em solid var(--color-border);border-radius:4px;padding:.15em .25em}.link-card-grid:where(.astro-NJCM7BMR){display:grid;grid-template-columns:repeat(auto-fit,minmax(24ch,1fr));gap:1rem;padding:0}
1
+ :root{--astro-gradient: linear-gradient(0deg,#4F39FA, #DA62C4)}h1:where(.astro-WWHJ5KDF){margin:2rem 0}main:where(.astro-WWHJ5KDF){margin:auto;padding:1em;max-width:60ch}.text-gradient:where(.astro-WWHJ5KDF){font-weight:900;background-image:var(--astro-gradient);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-size:100% 200%;background-position-y:100%;border-radius:.4rem;animation:pulse 4s ease-in-out infinite}@keyframes pulse{0%,to{background-position-y:0%}50%{background-position-y:80%}}.instructions:where(.astro-WWHJ5KDF){line-height:1.6;margin:1rem 0;background:#4F39FA;padding:1rem;border-radius:.4rem;color:var(--color-bg)}.instructions:where(.astro-WWHJ5KDF) code:where(.astro-WWHJ5KDF){font-size:.875em;border:.1em solid var(--color-border);border-radius:4px;padding:.15em .25em}.link-card-grid:where(.astro-WWHJ5KDF){display:grid;grid-template-columns:repeat(auto-fit,minmax(24ch,1fr));gap:1rem;padding:0}
@@ -2,11 +2,11 @@ import * as adapter from '@astrojs/node/server.js';
2
2
  import { defineComponent, h, createSSRApp } from 'vue';
3
3
  import { renderToString as renderToString$1 } from 'vue/server-renderer';
4
4
  import { escape } from 'html-escaper';
5
- /* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import { fileURLToPath } from 'url';
5
+ /* empty css *//* empty css */import { fileURLToPath } from 'url';
6
6
  import { readFileSync } from 'fs';
7
7
  import { resolve } from 'path';
8
8
  import Deepmerge from '@fastify/deepmerge';
9
- import 'mime';
9
+ /* empty css *//* empty css *//* empty css */import 'mime';
10
10
  import 'kleur/colors';
11
11
  import 'string-width';
12
12
  import 'path-browserify';
@@ -1267,7 +1267,7 @@ var server_default = {
1267
1267
  };
1268
1268
 
1269
1269
  // @ts-ignore
1270
- const _env$1 = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true},{LANG:process.env.LANG,ECOM_STORE_ID:"1011",BASE_URL:'/',}))
1270
+ const _env$1 = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true},{LANG:process.env.LANG,ECOM_STORE_ID:process.env.ECOM_STORE_ID,BASE_URL:'/',}))
1271
1271
  || (typeof process === 'object' && process?.env)
1272
1272
  || globalThis;
1273
1273
  class ApiError extends Error {
@@ -1442,26 +1442,103 @@ const $$module1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
1442
1442
  ApiError
1443
1443
  }, Symbol.toStringTag, { value: 'Module' }));
1444
1444
 
1445
- const $$metadata$5 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Layout.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1446
- const $$Astro$5 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Layout.astro", "", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1445
+ const DEFAULT_LANG = 'pt_br';
1446
+
1447
+ const DEFAULT_CURRENCY = 'BRL';
1448
+
1449
+ const DEFAULT_CURRENCY_SYMBOL = 'R$';
1450
+
1451
+ const DEFAULT_COUNTRY_CODE = 'BR';
1452
+ // # sourceMappingURL=defaults.js.map
1453
+
1454
+ // @ts-ignore
1455
+ const _env = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true},{LANG:process.env.LANG,ECOM_STORE_ID:process.env.ECOM_STORE_ID,}))
1456
+ || (typeof process === 'object' && process?.env)
1457
+ || globalThis;
1458
+ const deepmerge = Deepmerge();
1459
+ const self = globalThis.__cloudCommerce || {
1460
+ config: {
1461
+ lang: _env.ECOM_LANG || DEFAULT_LANG,
1462
+ currency: _env.ECOM_CURRENCY || DEFAULT_CURRENCY,
1463
+ currencySymbol: _env.ECOM_CURRENCY_SYMBOL || DEFAULT_CURRENCY_SYMBOL,
1464
+ countryCode: _env.ECOM_COUNTRY_CODE || DEFAULT_COUNTRY_CODE,
1465
+ storeId: Number(_env.ECOM_STORE_ID),
1466
+ },
1467
+ };
1468
+ globalThis.__cloudCommerce = self;
1469
+
1470
+ const config = {
1471
+ get() {
1472
+ return self.config;
1473
+ },
1474
+ set(config) {
1475
+ self.config = deepmerge(self.config, config);
1476
+ if (config.storeId) {
1477
+ _env.ECOM_STORE_ID = config.storeId;
1478
+ }
1479
+ },
1480
+ };
1481
+ // # sourceMappingURL=config.js.map
1482
+
1483
+ const getConfig = () => {
1484
+ const {
1485
+ STOREFRONT_BASE_DIR,
1486
+ VITE_ECOM_STORE_ID,
1487
+ } = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true},{STOREFRONT_BASE_DIR:process.env.STOREFRONT_BASE_DIR,ECOM_STORE_ID:process.env.ECOM_STORE_ID,})) || process.env;
1488
+
1489
+ const { storeId, lang } = config.get();
1490
+
1491
+ let baseDir;
1492
+ if (STOREFRONT_BASE_DIR) {
1493
+ const currentDir = fileURLToPath(new URL('.', import.meta.url));
1494
+ baseDir = resolve(currentDir, STOREFRONT_BASE_DIR);
1495
+ } else {
1496
+ baseDir = process.cwd();
1497
+ }
1498
+ const dirContent = resolve(baseDir, 'content');
1499
+ if (VITE_ECOM_STORE_ID) {
1500
+ config.set({ storeId: Number(VITE_ECOM_STORE_ID) });
1501
+ }
1502
+
1503
+ const settings = JSON.parse(
1504
+ readFileSync(resolve(dirContent, 'settings.json'), 'utf8'),
1505
+ );
1506
+ const { domain } = settings;
1507
+ const primaryColor = settings.primary_color || '#20c997';
1508
+ const secondaryColor = settings.secondary_color || '#343a40';
1509
+
1510
+ return {
1511
+ storeId,
1512
+ lang,
1513
+ domain,
1514
+ primaryColor,
1515
+ secondaryColor,
1516
+ settings,
1517
+ };
1518
+ };
1519
+
1520
+ const $$module2$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1521
+ __proto__: null,
1522
+ default: getConfig
1523
+ }, Symbol.toStringTag, { value: 'Module' }));
1524
+
1525
+ var __freeze = Object.freeze;
1526
+ var __defProp = Object.defineProperty;
1527
+ var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
1528
+ var _a;
1529
+ const $$metadata$5 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Layout.astro", { modules: [{ module: $$module2$1, specifier: "../../storefront.config.mjs", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1530
+ const $$Astro$5 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Layout.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1447
1531
  const $$Layout = createComponent(async ($$result, $$props, $$slots) => {
1448
1532
  const Astro2 = $$result.createAstro($$Astro$5, $$props, $$slots);
1449
1533
  Astro2.self = $$Layout;
1450
1534
  const { title } = Astro2.props;
1535
+ const { lang } = getConfig();
1451
1536
  const STYLES = [];
1452
1537
  for (const STYLE of STYLES)
1453
1538
  $$result.styles.add(STYLE);
1454
- return renderTemplate`<html lang="en" class="astro-ZMK4NUBX">
1455
- <head>
1456
- <meta charset="UTF-8">
1457
- <meta name="viewport" content="width=device-width">
1458
- <link rel="icon" type="image/x-icon" href="/favicon.ico">
1459
- <title>${title}</title>
1460
- ${renderHead($$result)}</head>
1461
- <body class="astro-ZMK4NUBX">
1462
- ${renderSlot($$result, $$slots["default"])}
1463
-
1464
- </body></html>`;
1539
+ return renderTemplate(_a || (_a = __template(['<html lang="en" class="astro-DEZ7DR5X">\n<head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width">\n <link rel="icon" type="image/x-icon" href="/favicon.ico">\n <title>', `</title>
1540
+ <link rel="stylesheet" media="print" onload="this.media='all'" href="https://www.gstatic.com/firebasejs/ui/6.0.1/firebase-ui-auth.css">
1541
+ `, '</head>\n<body class="astro-DEZ7DR5X">\n ', '\n <script async type="text/partytown"', "><\/script>\n</body>\n</html>\n\n"])), title, renderHead($$result), renderSlot($$result, $$slots["default"]), addAttribute(`https://www.gstatic.com/firebasejs/ui/6.0.1/firebase-ui-auth__${lang}.js`, "src"));
1465
1542
  });
1466
1543
 
1467
1544
  const $$file$5 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Layout.astro";
@@ -1476,7 +1553,7 @@ const $$module3 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
1476
1553
  }, Symbol.toStringTag, { value: 'Module' }));
1477
1554
 
1478
1555
  const $$metadata$4 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Card.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1479
- const $$Astro$4 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Card.astro", "", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1556
+ const $$Astro$4 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Card.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1480
1557
  const $$Card = createComponent(async ($$result, $$props, $$slots) => {
1481
1558
  const Astro2 = $$result.createAstro($$Astro$4, $$props, $$slots);
1482
1559
  Astro2.self = $$Card;
@@ -1501,7 +1578,7 @@ const $$Card = createComponent(async ($$result, $$props, $$slots) => {
1501
1578
  const $$file$4 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Card.astro";
1502
1579
  const $$url$4 = undefined;
1503
1580
 
1504
- const $$module2$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1581
+ const $$module2 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1505
1582
  __proto__: null,
1506
1583
  $$metadata: $$metadata$4,
1507
1584
  default: $$Card,
@@ -1509,8 +1586,8 @@ const $$module2$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.definePropert
1509
1586
  url: $$url$4
1510
1587
  }, Symbol.toStringTag, { value: 'Module' }));
1511
1588
 
1512
- const $$metadata$3 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro", { modules: [{ module: $$module1, specifier: "@cloudcommerce/api", assert: {} }, { module: $$module3, specifier: "../layouts/Layout.astro", assert: {} }, { module: $$module2$1, specifier: "../components/Card.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1513
- const $$Astro$3 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro", "", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1589
+ const $$metadata$3 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro", { modules: [{ module: $$module1, specifier: "@cloudcommerce/api", assert: {} }, { module: $$module3, specifier: "../layouts/Layout.astro", assert: {} }, { module: $$module2, specifier: "../components/Card.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1590
+ const $$Astro$3 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1514
1591
  const $$Index$1 = createComponent(async ($$result, $$props, $$slots) => {
1515
1592
  const Astro2 = $$result.createAstro($$Astro$3, $$props, $$slots);
1516
1593
  Astro2.self = $$Index$1;
@@ -1551,8 +1628,8 @@ const _page0 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1551
1628
  url: $$url$3
1552
1629
  }, Symbol.toStringTag, { value: 'Module' }));
1553
1630
 
1554
- const $$metadata$2 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/404.astro", { modules: [{ module: $$module3, specifier: "../layouts/Layout.astro", assert: {} }, { module: $$module2$1, specifier: "../components/Card.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1555
- const $$Astro$2 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/404.astro", "", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1631
+ const $$metadata$2 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/404.astro", { modules: [{ module: $$module3, specifier: "../layouts/Layout.astro", assert: {} }, { module: $$module2, specifier: "../components/Card.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1632
+ const $$Astro$2 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/404.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1556
1633
  const $$404 = createComponent(async ($$result, $$props, $$slots) => {
1557
1634
  const Astro2 = $$result.createAstro($$Astro$2, $$props, $$slots);
1558
1635
  Astro2.self = $$404;
@@ -1588,7 +1665,7 @@ const _page1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1588
1665
  }, Symbol.toStringTag, { value: 'Module' }));
1589
1666
 
1590
1667
  const $$metadata$1 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1591
- const $$Astro$1 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro", "", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1668
+ const $$Astro$1 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1592
1669
  const $$Index = createComponent(async ($$result, $$props, $$slots) => {
1593
1670
  const Astro2 = $$result.createAstro($$Astro$1, $$props, $$slots);
1594
1671
  Astro2.self = $$Index;
@@ -1606,82 +1683,8 @@ const _page2 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1606
1683
  url: $$url$1
1607
1684
  }, Symbol.toStringTag, { value: 'Module' }));
1608
1685
 
1609
- const DEFAULT_LANG = 'pt_br';
1610
-
1611
- const DEFAULT_CURRENCY = 'BRL';
1612
-
1613
- const DEFAULT_CURRENCY_SYMBOL = 'R$';
1614
-
1615
- const DEFAULT_COUNTRY_CODE = 'BR';
1616
- // # sourceMappingURL=defaults.js.map
1617
-
1618
- // @ts-ignore
1619
- const _env = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true},{LANG:process.env.LANG,ECOM_STORE_ID:"1011",}))
1620
- || (typeof process === 'object' && process?.env)
1621
- || globalThis;
1622
- const deepmerge = Deepmerge();
1623
- const self = globalThis.__cloudCommerce || {
1624
- config: {
1625
- lang: _env.ECOM_LANG || DEFAULT_LANG,
1626
- currency: _env.ECOM_CURRENCY || DEFAULT_CURRENCY,
1627
- currencySymbol: _env.ECOM_CURRENCY_SYMBOL || DEFAULT_CURRENCY_SYMBOL,
1628
- countryCode: _env.ECOM_COUNTRY_CODE || DEFAULT_COUNTRY_CODE,
1629
- storeId: Number(_env.ECOM_STORE_ID),
1630
- },
1631
- };
1632
- globalThis.__cloudCommerce = self;
1633
-
1634
- const config = {
1635
- get() {
1636
- return self.config;
1637
- },
1638
- set(config) {
1639
- self.config = deepmerge(self.config, config);
1640
- if (config.storeId) {
1641
- _env.ECOM_STORE_ID = config.storeId;
1642
- }
1643
- },
1644
- };
1645
- // # sourceMappingURL=config.js.map
1646
-
1647
- const {
1648
- STOREFRONT_BASE_DIR,
1649
- VITE_ECOM_STORE_ID
1650
- } = Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true}, { STOREFRONT_BASE_DIR: "../../../store/functions/ssr/", ECOM_STORE_ID: "1011" });
1651
- let baseDir;
1652
- if (STOREFRONT_BASE_DIR) {
1653
- const currentDir = fileURLToPath(new URL(".", import.meta.url));
1654
- baseDir = resolve(currentDir, STOREFRONT_BASE_DIR);
1655
- } else {
1656
- baseDir = process.cwd();
1657
- }
1658
- const dirContent = resolve(baseDir, "content");
1659
- if (VITE_ECOM_STORE_ID) {
1660
- config.set({ storeId: Number(VITE_ECOM_STORE_ID) });
1661
- }
1662
- const settings = JSON.parse(
1663
- readFileSync(resolve(dirContent, "settings.json"), "utf8")
1664
- );
1665
- const primaryColor = settings.primary_color || "#20c997";
1666
- const secondaryColor = settings.secondary_color || "#343a40";
1667
- const storefrontConfig = () => {
1668
- const { storeId, lang } = config.get();
1669
- return {
1670
- settings,
1671
- lang,
1672
- storeId,
1673
- primaryColor,
1674
- secondaryColor
1675
- };
1676
- };
1677
-
1678
- const $$module2 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1679
- __proto__: null,
1680
- default: storefrontConfig
1681
- }, Symbol.toStringTag, { value: 'Module' }));
1682
-
1683
- const $$metadata = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", { modules: [{ module: $$module1, specifier: "@cloudcommerce/api", assert: {} }, { module: $$module2, specifier: "../storefront-config", assert: {} }, { module: $$module3, specifier: "../layouts/Layout.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1684
- const $$Astro = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", "", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1686
+ const $$metadata = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", { modules: [{ module: $$module1, specifier: "@cloudcommerce/api", assert: {} }, { module: $$module2$1, specifier: "../../storefront.config.mjs", assert: {} }, { module: $$module3, specifier: "../layouts/Layout.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1687
+ const $$Astro = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1685
1688
  const $$ = createComponent(async ($$result, $$props, $$slots) => {
1686
1689
  const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
1687
1690
  Astro2.self = $$;
@@ -1698,13 +1701,13 @@ const $$ = createComponent(async ($$result, $$props, $$slots) => {
1698
1701
  const STYLES = [];
1699
1702
  for (const STYLE of STYLES)
1700
1703
  $$result.styles.add(STYLE);
1701
- return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": doc.name, "class": "astro-NJCM7BMR" }, { "default": () => renderTemplate`${maybeRenderHead($$result)}<main class="astro-NJCM7BMR">
1702
- <h1 class="astro-NJCM7BMR">Hello <span class="text-gradient astro-NJCM7BMR">${doc.name}</span></h1>
1703
- <hr class="astro-NJCM7BMR">
1704
- <div class="mt-3 astro-NJCM7BMR">
1705
- <mark class="astro-NJCM7BMR">${doc._id}</mark> from <i class="astro-NJCM7BMR">${resource}</i>
1706
- <p class="astro-NJCM7BMR">${Math.random()}</p>
1707
- <em class="astro-NJCM7BMR">Lorem ipsum dolor sit amet</em>
1704
+ return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": doc.name, "class": "astro-WWHJ5KDF" }, { "default": () => renderTemplate`${maybeRenderHead($$result)}<main class="astro-WWHJ5KDF">
1705
+ <h1 class="astro-WWHJ5KDF">Hello <span class="text-gradient astro-WWHJ5KDF">${doc.name}</span></h1>
1706
+ <hr class="astro-WWHJ5KDF">
1707
+ <div class="mt-3 astro-WWHJ5KDF">
1708
+ <mark class="astro-WWHJ5KDF">${doc._id}</mark> from <i class="astro-WWHJ5KDF">${resource}</i>
1709
+ <p class="astro-WWHJ5KDF">${Math.random()}</p>
1710
+ <em class="astro-WWHJ5KDF">Lorem ipsum dolor sit amet</em>
1708
1711
  </div>
1709
1712
  </main>` })}
1710
1713
 
@@ -1794,7 +1797,7 @@ function deserializeManifest(serializedManifest) {
1794
1797
  };
1795
1798
  }
1796
1799
 
1797
- const _manifest = Object.assign(deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":["assets/404-_...d4aa8aff.css","assets/404-index.d9230d24.css","assets/index.53a3a3e0.css"],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["assets/404-_...d4aa8aff.css","assets/404-index.d9230d24.css","assets/404.530428e5.css"],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/404","type":"page","pattern":"^\\/404\\/?$","segments":[[{"content":"404","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/404.astro","pathname":"/404","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/app","type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["assets/404-_...d4aa8aff.css","assets/_...fae19676.css"],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","_meta":{"trailingSlash":"ignore"}}}],"base":"/","markdown":{"drafts":false,"syntaxHighlight":"shiki","shikiConfig":{"langs":[],"theme":"github-dark","wrap":false},"remarkPlugins":[],"rehypePlugins":[],"remarkRehype":{},"extendDefaultPlugins":false,"isAstroFlavoredMd":false},"pageMap":null,"renderers":[],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"entry.mjs","@astrojs/vue/client.js":"client.6d48c590.js","astro:scripts/page.js":"page.3aa82516.js","astro:scripts/before-hydration.js":"data:text/javascript;charset=utf-8,//[no before-hydration script]"},"assets":["/assets/404.530428e5.css","/assets/404-_...d4aa8aff.css","/assets/404-index.d9230d24.css","/assets/_...fae19676.css","/assets/index.53a3a3e0.css","/client.6d48c590.js","/favicon.ico","/page.3aa82516.js","/page.3aa82516.js","/~partytown/partytown-atomics.js","/~partytown/partytown-media.js","/~partytown/partytown-sw.js","/~partytown/partytown.js"]}), {
1800
+ const _manifest = Object.assign(deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":["assets/404-_...d4aa8aff.css","assets/404-index.d9230d24.css","assets/index.53a3a3e0.css"],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["assets/404-_...d4aa8aff.css","assets/404-index.d9230d24.css","assets/404.530428e5.css"],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/404","type":"page","pattern":"^\\/404\\/?$","segments":[[{"content":"404","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/404.astro","pathname":"/404","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/app","type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["assets/404-_...d4aa8aff.css","assets/_...98510c96.css"],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","_meta":{"trailingSlash":"ignore"}}}],"site":"https://storefront-demo.e-com.plus/","base":"/","markdown":{"drafts":false,"syntaxHighlight":"shiki","shikiConfig":{"langs":[],"theme":"github-dark","wrap":false},"remarkPlugins":[],"rehypePlugins":[],"remarkRehype":{},"extendDefaultPlugins":false,"isAstroFlavoredMd":false},"pageMap":null,"renderers":[],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"entry.mjs","@astrojs/vue/client.js":"client.6d48c590.js","astro:scripts/page.js":"page.3aa82516.js","astro:scripts/before-hydration.js":"data:text/javascript;charset=utf-8,//[no before-hydration script]"},"assets":["/assets/404.530428e5.css","/assets/404-_...d4aa8aff.css","/assets/404-index.d9230d24.css","/assets/_...98510c96.css","/assets/index.53a3a3e0.css","/client.6d48c590.js","/favicon.ico","/page.3aa82516.js","/page.3aa82516.js","/~partytown/partytown-atomics.js","/~partytown/partytown-media.js","/~partytown/partytown-sw.js","/~partytown/partytown.js"]}), {
1798
1801
  pageMap: pageMap,
1799
1802
  renderers: renderers
1800
1803
  });
@@ -1,2 +1,2 @@
1
- STOREFRONT_BASE_DIR=../../../store/functions/ssr/
1
+ STOREFRONT_BASE_DIR=../../store/functions/ssr/
2
2
  ECOM_STORE_ID=1011
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "main": "src/index.js",
7
7
  "repository": {
@@ -20,7 +20,9 @@
20
20
  "start": "astro dev",
21
21
  "build": "astro build",
22
22
  "preview": "astro preview",
23
- "astro": "astro"
23
+ "astro": "astro",
24
+ "prepack": "rm content && cp -r ../../store/functions/ssr/content ./",
25
+ "postpack": "rm -rf content && ln -s ../../store/functions/ssr/content content"
24
26
  },
25
27
  "dependencies": {
26
28
  "@astrojs/node": "^1.0.1",
@@ -33,6 +35,7 @@
33
35
  "@nanostores/vue": "^0.6.0",
34
36
  "@picocss/pico": "^1.5.3",
35
37
  "astro": "^1.1.5",
38
+ "dotenv": "^16.0.2",
36
39
  "nanostores": "^0.6.0",
37
40
  "rollup": "^2.79.0",
38
41
  "unocss": "^0.45.15",
@@ -1,9 +1,12 @@
1
1
  ---
2
+ import getConfig from '../../storefront.config.mjs';
3
+
2
4
  export interface Props {
3
5
  title: string;
4
6
  }
5
7
 
6
8
  const { title } = Astro.props as Props;
9
+ const { lang } = getConfig();
7
10
  ---
8
11
 
9
12
  <!DOCTYPE html>
@@ -13,9 +16,13 @@ const { title } = Astro.props as Props;
13
16
  <meta name="viewport" content="width=device-width">
14
17
  <link rel="icon" type="image/x-icon" href="/favicon.ico" />
15
18
  <title>{title}</title>
19
+ <link rel="stylesheet" media="print" onload="this.media='all'"
20
+ href="https://www.gstatic.com/firebasejs/ui/6.0.1/firebase-ui-auth.css" />
16
21
  </head>
17
22
  <body>
18
23
  <slot />
24
+ <script async type="text/partytown"
25
+ src={`https://www.gstatic.com/firebasejs/ui/6.0.1/firebase-ui-auth__${lang}.js`}></script>
19
26
  </body>
20
27
  </html>
21
28
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  import api from '@cloudcommerce/api';
3
- import '../storefront-config';
3
+ import '../../storefront.config.mjs';
4
4
  import Layout from '../layouts/Layout.astro';
5
5
 
6
6
  const { slug } = Astro.params as { slug: string };
@@ -0,0 +1,18 @@
1
+ import type { BaseConfig } from '@cloudcommerce/config';
2
+ import settings from '../content/settings.json';
3
+
4
+ type CmsSettings = typeof settings;
5
+
6
+ type StorefrontConfig = {
7
+ storeId: BaseConfig['storeId'],
8
+ lang: BaseConfig['lang'],
9
+ domain: CmsSettings['domain'],
10
+ primaryColor: CmsSettings['primary_color'],
11
+ secondaryColor: CmsSettings['secondary_color'],
12
+ settings: CmsSettings,
13
+ };
14
+
15
+ export type {
16
+ StorefrontConfig,
17
+ CmsSettings,
18
+ };
@@ -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,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/types",
3
3
  "type": "module",
4
- "version": "0.0.68",
4
+ "version": "0.0.69",
5
5
  "description": "E-Com Plus Cloud Commerce reusable type definitions",
6
6
  "main": "index.ts",
7
7
  "repository": {
@@ -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
- };