cloudcommerce 0.8.1 → 0.8.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 (47) hide show
  1. package/.github/workflows/create-release.yml +1 -1
  2. package/CHANGELOG.md +7 -0
  3. package/ecomplus-stores/monocard/functions/core/package.json +1 -1
  4. package/ecomplus-stores/monocard/functions/events/package.json +2 -2
  5. package/ecomplus-stores/monocard/functions/modules/package.json +2 -2
  6. package/ecomplus-stores/monocard/functions/passport/package.json +2 -2
  7. package/ecomplus-stores/monocard/functions/ssr/package.json +7 -7
  8. package/ecomplus-stores/monocard/package.json +1 -1
  9. package/package.json +1 -1
  10. package/packages/api/package.json +1 -1
  11. package/packages/apps/correios/package.json +1 -1
  12. package/packages/apps/custom-payment/package.json +1 -1
  13. package/packages/apps/custom-shipping/package.json +1 -1
  14. package/packages/apps/datafrete/package.json +1 -1
  15. package/packages/apps/discounts/package.json +1 -1
  16. package/packages/apps/emails/package.json +1 -1
  17. package/packages/apps/fb-conversions/package.json +1 -1
  18. package/packages/apps/frenet/package.json +1 -1
  19. package/packages/apps/galaxpay/package.json +1 -1
  20. package/packages/apps/google-analytics/package.json +1 -1
  21. package/packages/apps/infinitepay/package.json +1 -1
  22. package/packages/apps/jadlog/package.json +1 -1
  23. package/packages/apps/loyalty-points/package.json +1 -1
  24. package/packages/apps/melhor-envio/package.json +1 -1
  25. package/packages/apps/mercadopago/package.json +1 -1
  26. package/packages/apps/pagarme/package.json +1 -1
  27. package/packages/apps/paghiper/package.json +1 -1
  28. package/packages/apps/pix/package.json +1 -1
  29. package/packages/apps/tiny-erp/package.json +1 -1
  30. package/packages/apps/webhooks/package.json +1 -1
  31. package/packages/cli/config/firebase.json +16 -1
  32. package/packages/cli/package.json +1 -1
  33. package/packages/config/package.json +1 -1
  34. package/packages/emails/package.json +1 -1
  35. package/packages/events/package.json +1 -1
  36. package/packages/firebase/package.json +1 -1
  37. package/packages/i18n/package.json +1 -1
  38. package/packages/modules/package.json +1 -1
  39. package/packages/passport/package.json +1 -1
  40. package/packages/ssr/lib/firebase/serve-storefront.js +8 -0
  41. package/packages/ssr/lib/firebase/serve-storefront.js.map +1 -1
  42. package/packages/ssr/package.json +1 -1
  43. package/packages/ssr/src/firebase/serve-storefront.ts +8 -0
  44. package/packages/storefront/dist/server/entry.mjs +1 -1
  45. package/packages/storefront/package.json +1 -1
  46. package/packages/storefront/scripts/build-prod.sh +5 -5
  47. package/packages/types/package.json +1 -1
@@ -13,7 +13,7 @@ jobs:
13
13
  with:
14
14
  fetch-depth: 0
15
15
 
16
- - uses: Akryum/release-tag@v3
16
+ - uses: Akryum/release-tag@8eeb62bcf949a368763f4057c34e7eb834467122
17
17
  id: release_tag
18
18
  env:
19
19
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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.8.2](https://github.com/ecomplus/cloud-commerce/compare/v0.8.1...v0.8.2) (2023-03-17)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **ssr:** Prevent fatal `ERR_HTTP_HEADERS_SENT` on SSR error ([2e9c137](https://github.com/ecomplus/cloud-commerce/commit/2e9c137cf004c70050222721e3059be83be576c9))
11
+
5
12
  ### [0.8.1](https://github.com/ecomplus/cloud-commerce/compare/v0.8.0...v0.8.1) (2023-03-17)
6
13
 
7
14
  ## [0.8.0](https://github.com/ecomplus/cloud-commerce/compare/v0.7.1...v0.8.0) (2023-03-17)
@@ -15,6 +15,6 @@
15
15
  },
16
16
  "main": "index.js",
17
17
  "dependencies": {
18
- "@cloudcommerce/firebase": "^0.8.0"
18
+ "@cloudcommerce/firebase": "^0.8.1"
19
19
  }
20
20
  }
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "main": "index.js",
17
17
  "dependencies": {
18
- "@cloudcommerce/events": "^0.8.0",
19
- "@cloudcommerce/firebase": "^0.8.0"
18
+ "@cloudcommerce/events": "^0.8.1",
19
+ "@cloudcommerce/firebase": "^0.8.1"
20
20
  }
21
21
  }
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "main": "index.js",
17
17
  "dependencies": {
18
- "@cloudcommerce/firebase": "^0.8.0",
19
- "@cloudcommerce/modules": "^0.8.0"
18
+ "@cloudcommerce/firebase": "^0.8.1",
19
+ "@cloudcommerce/modules": "^0.8.1"
20
20
  }
21
21
  }
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "main": "index.js",
17
17
  "dependencies": {
18
- "@cloudcommerce/firebase": "^0.8.0",
19
- "@cloudcommerce/passport": "^0.8.0"
18
+ "@cloudcommerce/firebase": "^0.8.1",
19
+ "@cloudcommerce/passport": "^0.8.1"
20
20
  }
21
21
  }
@@ -17,16 +17,16 @@
17
17
  },
18
18
  "main": "index.js",
19
19
  "dependencies": {
20
- "@astrojs/node": "^5.1.0",
21
- "@cloudcommerce/api": "^0.8.0",
22
- "@cloudcommerce/firebase": "^0.8.0",
23
- "@cloudcommerce/ssr": "^0.8.0",
20
+ "@astrojs/node": "5.1.0",
21
+ "@cloudcommerce/api": "^0.8.1",
22
+ "@cloudcommerce/firebase": "^0.8.1",
23
+ "@cloudcommerce/ssr": "^0.8.1",
24
24
  "@vueuse/motion": "2.0.0-beta.22"
25
25
  },
26
26
  "devDependencies": {
27
- "@cloudcommerce/i18n": "^0.8.0",
28
- "@cloudcommerce/storefront": "^0.8.0",
29
- "@cloudcommerce/types": "^0.8.0",
27
+ "@cloudcommerce/i18n": "^0.8.1",
28
+ "@cloudcommerce/storefront": "^0.8.1",
29
+ "@cloudcommerce/types": "^0.8.1",
30
30
  "@fontsource/inter": "^4.5.15",
31
31
  "@iconify-json/ri": "^1.1.5",
32
32
  "@iconify-json/wpf": "^1.1.4",
@@ -23,6 +23,6 @@
23
23
  "url": "https://github.com/ecomplus/cloud-commerce/issues"
24
24
  },
25
25
  "dependencies": {
26
- "@cloudcommerce/cli": "^0.8.0"
26
+ "@cloudcommerce/cli": "^0.8.1"
27
27
  }
28
28
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloudcommerce",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.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>",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/api",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
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.8.1",
4
+ "version": "0.8.2",
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-payment",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce app for simple custom payment methods",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-custom-shipping",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
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-datafrete",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Datafrete shipping gateway ",
6
6
  "main": "lib/datafrete.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-discounts",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
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-emails",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce default transactional email app",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-fb-conversions",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce app to send carts/orders to Facebook Conversions API",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-frenet",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce app for Frenet shipping calculation",
6
6
  "main": "lib/frenet.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-galaxpay",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.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": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-google-analytics",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.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": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-infinitepay",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate InfinitePay",
6
6
  "main": "lib/infinitepay.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-jadlog",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce app for Jadlog shipping calculation",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-loyalty-points",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce app to handle simple loyalty points programs",
6
6
  "main": "lib/loyalty-points.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-melhor-envio",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Melhor Envio",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-mercadopago",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Mercado Pago",
6
6
  "main": "lib/mercadopago.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-pagarme",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Pagar.me",
6
6
  "main": "lib/pagarme.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-paghiper",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate PagHiper",
6
6
  "main": "lib/paghiper.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-pix",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Pix API (Bacen)",
6
6
  "main": "lib/pix.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-tiny-erp",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
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/app-webhooks",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce app for general order webhooks",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -23,7 +23,22 @@
23
23
  {
24
24
  "predeploy": "npm run build -- --codebase ssr",
25
25
  "source": "functions/ssr",
26
- "codebase": "ssr"
26
+ "codebase": "ssr",
27
+ "ignore": [
28
+ ".git",
29
+ ".runtimeconfig.json",
30
+ "firebase-debug.log",
31
+ "firebase-debug.*.log",
32
+ "node_modules",
33
+ ".turbo",
34
+ "_astro",
35
+ "dist/client",
36
+ "functions/ssr/dist/client",
37
+ "/public",
38
+ "functions/ssr/public",
39
+ "/src",
40
+ "functions/ssr/src"
41
+ ]
27
42
  }
28
43
  ],
29
44
  "hosting": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/cli",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
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.8.1",
4
+ "version": "0.8.2",
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/emails",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/events",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
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.8.1",
4
+ "version": "0.8.2",
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/i18n",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce i18n",
6
6
  "main": "lib/all.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/modules",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
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.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce customers authentication (passport) API",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,5 +1,6 @@
1
1
  import { join as joinPath } from 'path';
2
2
  import { readFile } from 'fs/promises';
3
+ import logger from 'firebase-functions/logger';
3
4
 
4
5
  const { STOREFRONT_BASE_DIR } = process.env;
5
6
  const baseDir = STOREFRONT_BASE_DIR || process.cwd();
@@ -9,6 +10,7 @@ export default (req, res) => {
9
10
  res.set('X-XSS-Protection', '1; mode=block');
10
11
  const url = req.url.replace(/\?.*$/, '').replace(/\.html$/, '');
11
12
  const setStatusAndCache = (status, defaultCache) => {
13
+ if (res.headersSent) return res;
12
14
  return res.status(status)
13
15
  .set('X-SSR-ID', `v1/${Date.now()}`)
14
16
  .set('Cache-Control', (typeof global.cache_control === 'function' && global.cache_control(status))
@@ -33,6 +35,12 @@ export default (req, res) => {
33
35
  */
34
36
  global.ssr_handler(req, res, async (err) => {
35
37
  if (err) {
38
+ if (res.headersSent) {
39
+ logger.error(err);
40
+ res.end();
41
+ return;
42
+ }
43
+ logger.warn(err);
36
44
  res.set('X-SSR-Error', err.message);
37
45
  res.set('X-SSR-Error-Stack', err.stack);
38
46
  fallback(err);
@@ -1 +1 @@
1
- {"version":3,"file":"serve-storefront.js","sourceRoot":"","sources":["../../src/firebase/serve-storefront.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AAC5C,MAAM,OAAO,GAAG,mBAAmB,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;AACrD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/E,eAAe,CAAC,GAAY,EAAE,GAAa,EAAE,EAAE;IAC7C,GAAG,CAAC,GAAG,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAC;IAC7C,MAAM,GAAG,GAAG,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C,CAAC;YACjB,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;YACpC,GAAG,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;YACxC,QAAQ,CAAC,GAAG,CAAC,CAAC;YACd,OAAO;SACR;QACD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,IAAI,GAAG,EAAE,EAAE,UAAU,CAAC,CAAC;QAC7C,IAAI;YACF,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAC,CAAC;YACnC,iBAAiB,CAAC,GAAG,EAAE,kCAAkC,CAAC;iBACvD,IAAI,CAAC,IAAI,CAAC,CAAC;SACf;QAAC,OAAO,CAAC,EAAE;YACV,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SAClB;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/ssr",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce storefront SSR",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,6 +1,7 @@
1
1
  import type { Request, Response } from 'firebase-functions';
2
2
  import { join as joinPath } from 'path';
3
3
  import { readFile } from 'fs/promises';
4
+ import logger from 'firebase-functions/logger';
4
5
 
5
6
  const { STOREFRONT_BASE_DIR } = process.env;
6
7
  const baseDir = STOREFRONT_BASE_DIR || process.cwd();
@@ -11,6 +12,7 @@ export default (req: Request, res: Response) => {
11
12
  const url = req.url.replace(/\?.*$/, '').replace(/\.html$/, '');
12
13
 
13
14
  const setStatusAndCache = (status: number, defaultCache: string) => {
15
+ if (res.headersSent) return res;
14
16
  return res.status(status)
15
17
  .set('X-SSR-ID', `v1/${Date.now()}`)
16
18
  .set(
@@ -40,6 +42,12 @@ export default (req: Request, res: Response) => {
40
42
  */
41
43
  global.ssr_handler(req, res, async (err: any) => {
42
44
  if (err) {
45
+ if (res.headersSent) {
46
+ logger.error(err);
47
+ res.end();
48
+ return;
49
+ }
50
+ logger.warn(err);
43
51
  res.set('X-SSR-Error', err.message);
44
52
  res.set('X-SSR-Error-Stack', err.stack);
45
53
  fallback(err);
@@ -3062,7 +3062,7 @@ const _renderer1 = {
3062
3062
  const pageMap = new Map([["../../node_modules/.pnpm/@astrojs+image@0.16.0_astro@2.1.2+sharp@0.31.3/node_modules/@astrojs/image/dist/endpoint.js", _page0],["src/pages/index.astro", _page1],["src/pages/fallback.astro", _page2],["src/pages/app/index.astro", _page3],["src/pages/app/account.astro", _page4],["src/pages/[...slug].astro", _page5],]);
3063
3063
  const renderers = [Object.assign({"name":"astro:jsx","serverEntrypoint":"astro/jsx/server.js","jsxImportSource":"astro"}, { ssr: server_default }),Object.assign({"name":"@astrojs/vue","clientEntrypoint":"@astrojs/vue/client.js","serverEntrypoint":"@astrojs/vue/server.js"}, { ssr: _renderer1 }),];
3064
3064
 
3065
- const _manifest = Object.assign(deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[],"routeData":{"type":"endpoint","route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/@astrojs+image@0.16.0_astro@2.1.2+sharp@0.31.3/node_modules/@astrojs/image/dist/endpoint.js","pathname":"/_image","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["_astro/_...slug_.0607a6ef.css","_astro/index.0c833781.css"],"scripts":[{"type":"external","value":"_astro/hoisted.721ad75d.js"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["_astro/_...slug_.0607a6ef.css"],"scripts":[{"type":"external","value":"_astro/hoisted.721ad75d.js"}],"routeData":{"route":"/fallback","type":"page","pattern":"^\\/fallback\\/?$","segments":[[{"content":"fallback","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/fallback.astro","pathname":"/fallback","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"routeData":{"route":"/app","type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"routeData":{"route":"/app/account","type":"page","pattern":"^\\/app\\/account\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}],[{"content":"account","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/account.astro","pathname":"/app/account","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["_astro/_...slug_.0607a6ef.css"],"scripts":[{"type":"external","value":"_astro/hoisted.721ad75d.js"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","prerender":false,"_meta":{"trailingSlash":"ignore"}}}],"site":"https://ecom2-002.web.app","base":"/","markdown":{"drafts":false,"syntaxHighlight":"shiki","shikiConfig":{"langs":[],"theme":"github-dark","wrap":false},"remarkPlugins":[],"rehypePlugins":[],"remarkRehype":{},"gfm":true,"smartypants":true},"pageMap":null,"propagation":[],"renderers":[],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"_@astrojs-ssr-virtual-entry.mjs","@@sf/components/ProductCard.vue":"_astro/ProductCard.7e891c08.js","@astrojs/vue/client.js":"_astro/client.0de2f274.js","~/components/PitchBar.vue":"_astro/PitchBar.db7cd775.js","~/components/Prices.vue":"_astro/Prices.55399c72.js","/astro/hoisted.js?q=0":"_astro/hoisted.721ad75d.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/workbox-window/build/workbox-window.prod.es5.mjs":"_astro/workbox-window.prod.es5.295a6886.js","~/components/ShopHeader.vue":"_astro/ShopHeader.e93c8274.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/scripts/firebase-app.ts":"_astro/firebase-app.72e91a3e.js","astro:scripts/before-hydration.js":""},"assets":["/_astro/index.0c833781.css","/_astro/server.1bc2fa51.css","/_astro/_...slug_.0607a6ef.css","/manifest.webmanifest","/robots.txt","/sw.js","/workbox-e0d788d4.js","/_astro/PitchBar.db7cd775.js","/_astro/Prices.55399c72.js","/_astro/ProductCard.7e891c08.js","/_astro/ShopHeader.e93c8274.js","/_astro/_plugin-vue_export-helper.77ed7c18.js","/_astro/client.0de2f274.js","/_astro/firebase-app.72e91a3e.js","/_astro/format-money.ab6b71eb.js","/_astro/hoisted.721ad75d.js","/_astro/idle-callback.889bf0ea.js","/_astro/index.16f33784.js","/_astro/modules-info.06ac0727.js","/_astro/preload-helper.101896b7.js","/_astro/runtime-dom.esm-bundler.d2f39f33.js","/_astro/session-utm.72684b84.js","/_astro/workbox-window.prod.es5.295a6886.js","/admin/config.json","/assets/cms-preview.css","/assets/cms.css","/assets/cvv.png","/assets/img-placeholder.png","/assets/payments.png","/assets/ssl-safe.png","/img/icon.png","/img/large-icon.png","/img/uploads/banner1.png","/img/uploads/banner2.png","/img/uploads/banner2.webp","/img/uploads/favicon.png","/img/uploads/headless.png","/img/uploads/headphone.png","/img/uploads/headphone.webp","/img/uploads/icon.png","/img/uploads/large-icon.png","/img/uploads/logo.png","/img/uploads/logo.webp","/img/uploads/og-image.png","/img/uploads/passion.png","/img/uploads/passion.webp","/img/uploads/pwa-reliable.png","/img/uploads/rect8589.png","/img/uploads/rect859.png","/img/uploads/rect89.png","/img/uploads/rect89.webp","/img/uploads/ssl-safe.png"]}), {
3065
+ const _manifest = Object.assign(deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[],"routeData":{"type":"endpoint","route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/@astrojs+image@0.16.0_astro@2.1.2+sharp@0.31.3/node_modules/@astrojs/image/dist/endpoint.js","pathname":"/_image","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["_astro/_...slug_.0607a6ef.css","_astro/index.0c833781.css"],"scripts":[{"type":"external","value":"_astro/hoisted.721ad75d.js"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["_astro/_...slug_.0607a6ef.css"],"scripts":[{"type":"external","value":"_astro/hoisted.721ad75d.js"}],"routeData":{"route":"/fallback","type":"page","pattern":"^\\/fallback\\/?$","segments":[[{"content":"fallback","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/fallback.astro","pathname":"/fallback","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"routeData":{"route":"/app","type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"routeData":{"route":"/app/account","type":"page","pattern":"^\\/app\\/account\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}],[{"content":"account","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/account.astro","pathname":"/app/account","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["_astro/_...slug_.0607a6ef.css"],"scripts":[{"type":"external","value":"_astro/hoisted.721ad75d.js"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","prerender":false,"_meta":{"trailingSlash":"ignore"}}}],"site":"https://ecom2-002.web.app","base":"/","markdown":{"drafts":false,"syntaxHighlight":"shiki","shikiConfig":{"langs":[],"theme":"github-dark","wrap":false},"remarkPlugins":[],"rehypePlugins":[],"remarkRehype":{},"gfm":true,"smartypants":true},"pageMap":null,"propagation":[],"renderers":[],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"_@astrojs-ssr-virtual-entry.mjs","~/components/Prices.vue":"_astro/Prices.55399c72.js","@@sf/components/ProductCard.vue":"_astro/ProductCard.7e891c08.js","/astro/hoisted.js?q=0":"_astro/hoisted.721ad75d.js","@astrojs/vue/client.js":"_astro/client.0de2f274.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/workbox-window/build/workbox-window.prod.es5.mjs":"_astro/workbox-window.prod.es5.295a6886.js","~/components/PitchBar.vue":"_astro/PitchBar.db7cd775.js","~/components/ShopHeader.vue":"_astro/ShopHeader.e93c8274.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/scripts/firebase-app.ts":"_astro/firebase-app.72e91a3e.js","astro:scripts/before-hydration.js":""},"assets":["/_astro/index.0c833781.css","/_astro/server.1bc2fa51.css","/_astro/_...slug_.0607a6ef.css","/manifest.webmanifest","/robots.txt","/sw.js","/workbox-e0d788d4.js","/_astro/PitchBar.db7cd775.js","/_astro/Prices.55399c72.js","/_astro/ProductCard.7e891c08.js","/_astro/ShopHeader.e93c8274.js","/_astro/_plugin-vue_export-helper.77ed7c18.js","/_astro/client.0de2f274.js","/_astro/firebase-app.72e91a3e.js","/_astro/format-money.ab6b71eb.js","/_astro/hoisted.721ad75d.js","/_astro/idle-callback.889bf0ea.js","/_astro/index.16f33784.js","/_astro/modules-info.06ac0727.js","/_astro/preload-helper.101896b7.js","/_astro/runtime-dom.esm-bundler.d2f39f33.js","/_astro/session-utm.72684b84.js","/_astro/workbox-window.prod.es5.295a6886.js","/admin/config.json","/assets/cms-preview.css","/assets/cms.css","/assets/cvv.png","/assets/img-placeholder.png","/assets/payments.png","/assets/ssl-safe.png","/img/icon.png","/img/large-icon.png","/img/uploads/banner1.png","/img/uploads/banner2.png","/img/uploads/banner2.webp","/img/uploads/favicon.png","/img/uploads/headless.png","/img/uploads/headphone.png","/img/uploads/headphone.webp","/img/uploads/icon.png","/img/uploads/large-icon.png","/img/uploads/logo.png","/img/uploads/logo.webp","/img/uploads/og-image.png","/img/uploads/passion.png","/img/uploads/passion.webp","/img/uploads/pwa-reliable.png","/img/uploads/rect8589.png","/img/uploads/rect859.png","/img/uploads/rect89.png","/img/uploads/rect89.webp","/img/uploads/ssl-safe.png"]}), {
3066
3066
  pageMap: pageMap,
3067
3067
  renderers: renderers
3068
3068
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "bin": {
7
7
  "storefront": "./scripts/build-prod.sh"
@@ -3,17 +3,17 @@
3
3
  BUILD_OUTPUT=static BUILD_OUT_DIR=./.cloudcommerce/sf-tmp-dist npx astro build
4
4
  DEPLOY_RUNTIME=serverless npx astro build
5
5
 
6
- mv ./.cloudcommerce/sf-tmp-dist/_astro/*.{webp,avif} ./dist/client/_astro/
6
+ mv ./.cloudcommerce/sf-tmp-dist/_astro/*.{png,jpg,jpeg,webp,avif,svg} ./dist/client/_astro/
7
7
  rm -rf ./.cloudcommerce/sf-tmp-dist
8
8
 
9
9
  identify -format "%f,%w,%h\n" \
10
- ./dist/client/_astro/*.{webp,avif} > ./dist/server/images.dist.csv
10
+ ./dist/client/_astro/*.{png,jpg,jpeg,webp,avif,svg} > ./dist/server/images.dist.csv
11
11
 
12
12
  identify -format "assets/%f,%w,%h\n" \
13
- ./public/assets/*.{png,jpg,jpeg,gif,ico,webp,avif} > ./dist/server/images.src.csv 2>/dev/null
13
+ ./public/assets/*.{png,jpg,jpeg,webp,avif,svg} > ./dist/server/images.src.csv 2>/dev/null
14
14
  identify -format "img/%f,%w,%h\n" \
15
- ./public/img/*.{png,jpg,jpeg,gif,ico,webp,avif} >> ./dist/server/images.src.csv 2>/dev/null
15
+ ./public/img/*.{png,jpg,jpeg,webp,avif,svg} >> ./dist/server/images.src.csv 2>/dev/null
16
16
  identify -format "img/uploads/%f,%w,%h\n" \
17
- ./public/img/uploads/*.{png,jpg,jpeg,gif,ico,webp,avif} >> ./dist/server/images.src.csv 2>/dev/null
17
+ ./public/img/uploads/*.{png,jpg,jpeg,webp,avif,svg} >> ./dist/server/images.src.csv 2>/dev/null
18
18
 
19
19
  exit 0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/types",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "description": "E-Com Plus Cloud Commerce reusable type definitions",
6
6
  "main": "index.ts",
7
7
  "repository": {