cloudcommerce 0.0.103 → 0.0.104
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 +2 -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/frenet/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/cli/config/firebase.json +2 -2
- 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/lib/firebase.js +10 -12
- package/packages/ssr/lib/firebase.js.map +1 -1
- package/packages/ssr/package.json +1 -2
- package/packages/ssr/src/firebase.ts +10 -12
- package/packages/storefront/dist/server/entry.mjs +2 -0
- package/packages/storefront/package.json +1 -1
- package/packages/storefront/scripts/prepare-monorepo.sh +2 -2
- package/packages/storefront/scripts/prerelease.sh +2 -2
- package/packages/storefront/src/lib/ssr-context.ts +2 -0
- package/packages/types/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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.104](https://github.com/ecomplus/cloud-commerce/compare/v0.0.103...v0.0.104) (2022-09-28)
|
|
6
|
+
|
|
5
7
|
### [0.0.103](https://github.com/ecomplus/cloud-commerce/compare/v0.0.102...v0.0.103) (2022-09-27)
|
|
6
8
|
|
|
7
9
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcommerce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.104",
|
|
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>",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"codebase": "passport"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
"predeploy": "npm --prefix \"$RESOURCE_DIR
|
|
28
|
+
"predeploy": "npm --prefix \"$RESOURCE_DIR\" run build && npm run build -- --codebase ssr",
|
|
29
29
|
"source": "functions/ssr",
|
|
30
30
|
"codebase": "ssr"
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
33
|
"hosting": {
|
|
34
|
-
"public": "functions/ssr/
|
|
34
|
+
"public": "functions/ssr/dist/client",
|
|
35
35
|
"ignore": [
|
|
36
36
|
"firebase.json",
|
|
37
37
|
"**/.*",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* eslint-disable import/no-unresolved, import/first */
|
|
1
|
+
/* eslint-disable import/prefer-default-export, import/no-unresolved, import/first */
|
|
2
2
|
import '@cloudcommerce/api/fetch-polyfill';
|
|
3
3
|
import { initializeApp } from 'firebase-admin/app';
|
|
4
4
|
|
|
5
5
|
initializeApp();
|
|
6
|
-
import
|
|
6
|
+
import { onRequest } from 'firebase-functions/v2/https';
|
|
7
7
|
import config from '@cloudcommerce/firebase/lib/config';
|
|
8
8
|
import serveStorefront from './firebase/serve-storefront.js';
|
|
9
9
|
|
|
@@ -13,14 +13,12 @@ const {
|
|
|
13
13
|
},
|
|
14
14
|
} = config.get();
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
serveStorefront(req, res);
|
|
25
|
-
});
|
|
16
|
+
export const ssr = onRequest({
|
|
17
|
+
region,
|
|
18
|
+
timeoutSeconds: timeoutSeconds || 15,
|
|
19
|
+
memory: memory || '256MiB',
|
|
20
|
+
minInstances: minInstances || 1,
|
|
21
|
+
}, (req, res) => {
|
|
22
|
+
serveStorefront(req, res);
|
|
23
|
+
});
|
|
26
24
|
// # sourceMappingURL=firebase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,aAAa,EAAE,CAAC;AAEhB,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,MAAM,MAAM,oCAAoC,CAAC;AACxD,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAE1D,MAAM,EACJ,oBAAoB,EAAE,EACpB,MAAM,EACN,cAAc,EACd,MAAM,EACN,YAAY,GACb,GACF,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;AAEjB,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC;IAC3B,MAAM;IACN,cAAc,EAAE,cAAc,IAAI,EAAE;IACpC,MAAM,EAAE,MAAM,IAAI,QAAQ;IAC1B,YAAY,EAAE,YAAY,IAAI,CAAC;CAChC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACd,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/ssr",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.104",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront SSR",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"firebase-admin": "^11.0.1",
|
|
33
33
|
"firebase-functions": "^3.24.0",
|
|
34
34
|
"image-size": "^1.0.2",
|
|
35
|
-
"path-to-regexp": "^6.2.1",
|
|
36
35
|
"vue": "^3.2.39"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/* eslint-disable import/no-unresolved, import/first */
|
|
1
|
+
/* eslint-disable import/prefer-default-export, import/no-unresolved, import/first */
|
|
2
2
|
import '@cloudcommerce/api/fetch-polyfill';
|
|
3
3
|
import { initializeApp } from 'firebase-admin/app';
|
|
4
4
|
|
|
5
5
|
initializeApp();
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import { onRequest } from 'firebase-functions/v2/https';
|
|
8
8
|
import config from '@cloudcommerce/firebase/lib/config';
|
|
9
9
|
import serveStorefront from './firebase/serve-storefront';
|
|
10
10
|
|
|
@@ -17,13 +17,11 @@ const {
|
|
|
17
17
|
},
|
|
18
18
|
} = config.get();
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
serveStorefront(req, res);
|
|
29
|
-
});
|
|
20
|
+
export const ssr = onRequest({
|
|
21
|
+
region,
|
|
22
|
+
timeoutSeconds: timeoutSeconds || 15,
|
|
23
|
+
memory: memory || '256MiB',
|
|
24
|
+
minInstances: minInstances || 1,
|
|
25
|
+
}, (req, res) => {
|
|
26
|
+
serveStorefront(req, res);
|
|
27
|
+
});
|
|
@@ -1713,6 +1713,7 @@ const loadPageContext = async (Astro, {
|
|
|
1713
1713
|
cmsCollection,
|
|
1714
1714
|
apiPrefetchEndpoints = globalThis.api_prefetch_endpoints
|
|
1715
1715
|
} = {}) => {
|
|
1716
|
+
const startedAt = Date.now();
|
|
1716
1717
|
const urlPath = Astro.url.pathname;
|
|
1717
1718
|
const { slug } = Astro.params;
|
|
1718
1719
|
const config = getConfig();
|
|
@@ -1768,6 +1769,7 @@ const loadPageContext = async (Astro, {
|
|
|
1768
1769
|
<body></body>`;
|
|
1769
1770
|
throw err;
|
|
1770
1771
|
}
|
|
1772
|
+
Astro.response.headers.set("X-Load-Took", Date.now() - startedAt);
|
|
1771
1773
|
if (urlPath === "/fallback") {
|
|
1772
1774
|
setResponseCache(Astro, 3600, 86400);
|
|
1773
1775
|
} else {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
rm -rf content && ln -s ../../store/functions/ssr/
|
|
4
|
-
rm -rf public && ln -s ../../store/functions/ssr/
|
|
3
|
+
rm -rf content && ln -s ../../store/functions/ssr/content content
|
|
4
|
+
rm -rf public && ln -s ../../store/functions/ssr/public public
|
|
@@ -48,6 +48,7 @@ const loadPageContext = async (Astro: AstroGlobal, {
|
|
|
48
48
|
cmsCollection?: string;
|
|
49
49
|
apiPrefetchEndpoints?: ApiPrefetchEndpoints;
|
|
50
50
|
} = {}) => {
|
|
51
|
+
const startedAt = Date.now();
|
|
51
52
|
const urlPath = Astro.url.pathname;
|
|
52
53
|
const { slug } = Astro.params;
|
|
53
54
|
const config = getConfig();
|
|
@@ -103,6 +104,7 @@ const loadPageContext = async (Astro: AstroGlobal, {
|
|
|
103
104
|
<body></body>`;
|
|
104
105
|
throw err;
|
|
105
106
|
}
|
|
107
|
+
Astro.response.headers.set('X-Load-Took', Date.now() - startedAt);
|
|
106
108
|
if (urlPath === '/fallback') {
|
|
107
109
|
setResponseCache(Astro, 3600, 86400);
|
|
108
110
|
} else {
|