cloudcommerce 0.28.1 → 0.28.3
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/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/ecomplus-stores/monocard/functions/many/package.json +3 -3
- package/ecomplus-stores/monocard/functions/ssr/package.json +6 -6
- package/ecomplus-stores/monocard/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/monocard/package.json +2 -2
- package/package.json +5 -5
- package/packages/api/package.json +1 -1
- package/packages/apps/affilate-program/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +2 -2
- package/packages/apps/flash-courier/package.json +1 -1
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/galaxpay/package.json +1 -1
- package/packages/apps/google-analytics/package.json +1 -1
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/package.json +1 -1
- package/packages/apps/paghiper/package.json +1 -1
- package/packages/apps/pix/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/apps/webhooks/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/eslint/package.json +3 -3
- package/packages/events/package.json +1 -1
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/package.json +2 -2
- package/packages/storefront/astro.config.mjs +1 -8
- package/packages/storefront/config/storefront.config.mjs +4 -0
- package/packages/storefront/package.json +2 -2
- package/packages/storefront/server.d.ts +1 -0
- package/packages/storefront/src/images/Picture.runtime.astro +1 -0
- package/packages/storefront/src/images/use-ssr-picture.ts +8 -0
- package/packages/storefront/src/lib/components/Picture.astro +1 -0
- package/packages/storefront/src/lib/layouts/use-page-main.ts +2 -1
- package/packages/storefront/src/lib/ssr-context.ts +5 -3
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
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.28.3](https://github.com/ecomplus/cloud-commerce/compare/v0.28.2...v0.28.3) (2023-10-16)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **storefront:** Set `Astro.locals.assetsPrefix` globally available on Astro components ([0548fbb](https://github.com/ecomplus/cloud-commerce/commit/0548fbb9c864a300e215a3f2c8c722f34fb07279))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **deps:** Update non-major dependencies ([#253](https://github.com/ecomplus/cloud-commerce/issues/253)) ([9a29d76](https://github.com/ecomplus/cloud-commerce/commit/9a29d76459541b20f1816b1e572281294f19d4c3))
|
|
16
|
+
* **storefront:** Must set cache control stale-while-revalidate even without s-maxage ([3d27496](https://github.com/ecomplus/cloud-commerce/commit/3d274961e0f10f1afae22da1e6cdeb70e17811e8))
|
|
17
|
+
* **storefront:** Properly set optimized pictures src with assets prefix (CDN) if configured ([68a8b6e](https://github.com/ecomplus/cloud-commerce/commit/68a8b6e3fb2f1837dfb40dbe996fb46832c4b0b5))
|
|
18
|
+
|
|
19
|
+
### [0.28.2](https://github.com/ecomplus/cloud-commerce/compare/v0.28.1...v0.28.2) (2023-10-15)
|
|
20
|
+
|
|
5
21
|
### [0.28.1](https://github.com/ecomplus/cloud-commerce/compare/v0.28.0...v0.28.1) (2023-10-15)
|
|
6
22
|
|
|
7
23
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/feeds": "^0.28.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.28.
|
|
20
|
-
"@cloudcommerce/passport": "^0.28.
|
|
18
|
+
"@cloudcommerce/feeds": "^0.28.2",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.28.2",
|
|
20
|
+
"@cloudcommerce/passport": "^0.28.2"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
},
|
|
18
18
|
"main": "index.js",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@cloudcommerce/api": "^0.28.
|
|
21
|
-
"@cloudcommerce/firebase": "^0.28.
|
|
22
|
-
"@cloudcommerce/ssr": "^0.28.
|
|
20
|
+
"@cloudcommerce/api": "^0.28.2",
|
|
21
|
+
"@cloudcommerce/firebase": "^0.28.2",
|
|
22
|
+
"@cloudcommerce/ssr": "^0.28.2"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@cloudcommerce/i18n": "^0.28.
|
|
26
|
-
"@cloudcommerce/storefront": "^0.28.
|
|
27
|
-
"@cloudcommerce/types": "^0.28.
|
|
25
|
+
"@cloudcommerce/i18n": "^0.28.2",
|
|
26
|
+
"@cloudcommerce/storefront": "^0.28.2",
|
|
27
|
+
"@cloudcommerce/types": "^0.28.2",
|
|
28
28
|
"@fontsource/croissant-one": "^5.0.9",
|
|
29
29
|
"@iconify-json/mingcute": "^1.1.9"
|
|
30
30
|
}
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/events": "^0.28.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.28.
|
|
20
|
-
"@cloudcommerce/modules": "^0.28.
|
|
18
|
+
"@cloudcommerce/events": "^0.28.2",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.28.2",
|
|
20
|
+
"@cloudcommerce/modules": "^0.28.2"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"url": "https://github.com/ecomplus/cloud-commerce/issues"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@cloudcommerce/cli": "^0.28.
|
|
26
|
+
"@cloudcommerce/cli": "^0.28.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@cloudcommerce/eslint": "^0.28.
|
|
29
|
+
"@cloudcommerce/eslint": "^0.28.2"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/feeds": "^0.28.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.28.
|
|
20
|
-
"@cloudcommerce/passport": "^0.28.
|
|
18
|
+
"@cloudcommerce/feeds": "^0.28.2",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.28.2",
|
|
20
|
+
"@cloudcommerce/passport": "^0.28.2"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
},
|
|
18
18
|
"main": "index.js",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@cloudcommerce/api": "^0.28.
|
|
21
|
-
"@cloudcommerce/firebase": "^0.28.
|
|
22
|
-
"@cloudcommerce/ssr": "^0.28.
|
|
20
|
+
"@cloudcommerce/api": "^0.28.2",
|
|
21
|
+
"@cloudcommerce/firebase": "^0.28.2",
|
|
22
|
+
"@cloudcommerce/ssr": "^0.28.2",
|
|
23
23
|
"@vueuse/motion": "2.0.0-beta.22"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@cloudcommerce/i18n": "^0.28.
|
|
27
|
-
"@cloudcommerce/storefront": "^0.28.
|
|
28
|
-
"@cloudcommerce/types": "^0.28.
|
|
26
|
+
"@cloudcommerce/i18n": "^0.28.2",
|
|
27
|
+
"@cloudcommerce/storefront": "^0.28.2",
|
|
28
|
+
"@cloudcommerce/types": "^0.28.2",
|
|
29
29
|
"@fontsource-variable/inter": "^5.0.8",
|
|
30
30
|
"@iconify-json/ri": "^1.1.8",
|
|
31
31
|
"@iconify-json/wpf": "^1.1.4",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/events": "^0.28.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.28.
|
|
20
|
-
"@cloudcommerce/modules": "^0.28.
|
|
18
|
+
"@cloudcommerce/events": "^0.28.2",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.28.2",
|
|
20
|
+
"@cloudcommerce/modules": "^0.28.2"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"url": "https://github.com/ecomplus/cloud-commerce/issues"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@cloudcommerce/cli": "^0.28.
|
|
26
|
+
"@cloudcommerce/cli": "^0.28.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@cloudcommerce/eslint": "^0.28.
|
|
29
|
+
"@cloudcommerce/eslint": "^0.28.2"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcommerce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.28.
|
|
4
|
+
"version": "0.28.3",
|
|
5
5
|
"description": "Open fair-code headless commerce platform: API-first, microservices based, event driven and cloud native",
|
|
6
6
|
"main": "packages/api/lib/index.js",
|
|
7
7
|
"author": "E-Com Club Softwares para E-commerce <ti@e-com.club>",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@commitlint/cli": "^17.
|
|
20
|
-
"@commitlint/config-conventional": "^17.
|
|
19
|
+
"@commitlint/cli": "^17.8.0",
|
|
20
|
+
"@commitlint/config-conventional": "^17.8.0",
|
|
21
21
|
"@commitlint/rules": "^17.7.0",
|
|
22
|
-
"@types/node": "^18.18.
|
|
22
|
+
"@types/node": "^18.18.5",
|
|
23
23
|
"eslint": "^8.51.0",
|
|
24
24
|
"husky": "^8.0.3",
|
|
25
25
|
"standard-version": "^9.5.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"vite": "^4.4.11",
|
|
31
31
|
"vitest": "^0.34.6",
|
|
32
32
|
"zx": "^7.2.3",
|
|
33
|
-
"@cloudcommerce/eslint": "0.28.
|
|
33
|
+
"@cloudcommerce/eslint": "0.28.3"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"fix-install": "bash scripts/pre-install.sh && pnpm i",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-fb-conversions",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.28.
|
|
4
|
+
"version": "0.28.3",
|
|
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": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@cloudcommerce/api": "workspace:*",
|
|
23
23
|
"@cloudcommerce/firebase": "workspace:*",
|
|
24
|
-
"facebook-nodejs-business-sdk": "^18.0.
|
|
24
|
+
"facebook-nodejs-business-sdk": "^18.0.2",
|
|
25
25
|
"firebase-admin": "^11.11.0",
|
|
26
26
|
"firebase-functions": "^4.4.1"
|
|
27
27
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/eslint",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.28.
|
|
4
|
+
"version": "0.28.3",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce ESLint config",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"repository": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"build": "echo '@ecomplus/eslint'"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@typescript-eslint/eslint-plugin": "^6.7.
|
|
23
|
-
"@typescript-eslint/parser": "^6.7.
|
|
22
|
+
"@typescript-eslint/eslint-plugin": "^6.7.5",
|
|
23
|
+
"@typescript-eslint/parser": "^6.7.5",
|
|
24
24
|
"eslint": "^8.51.0",
|
|
25
25
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
26
26
|
"eslint-plugin-import": "^2.28.1",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/ssr",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.28.
|
|
4
|
+
"version": "0.28.3",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront SSR",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@cloudcommerce/types": "workspace:*",
|
|
42
|
-
"@cloudflare/workers-types": "^4.
|
|
42
|
+
"@cloudflare/workers-types": "^4.20231010.0",
|
|
43
43
|
"@firebase/app-types": "^0.9.0"
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -22,7 +22,6 @@ const deployRand = process.env.DEPLOY_RAND || '_';
|
|
|
22
22
|
const isLibDev = !(relativePath(__dirname, process.cwd()));
|
|
23
23
|
|
|
24
24
|
const {
|
|
25
|
-
storeId,
|
|
26
25
|
lang,
|
|
27
26
|
domain,
|
|
28
27
|
primaryColor,
|
|
@@ -217,12 +216,6 @@ const genAstroConfig = ({
|
|
|
217
216
|
serviceEntryPoint: '@astrojs/image/sharp',
|
|
218
217
|
}));
|
|
219
218
|
}
|
|
220
|
-
let assetsPrefix;
|
|
221
|
-
if (!isSSG) {
|
|
222
|
-
assetsPrefix = storeId === 1011 && domain === 'demo.ecomplus.app'
|
|
223
|
-
? 'https://s2-demo.b-cdn.net'
|
|
224
|
-
: settings.assetsPrefix;
|
|
225
|
-
}
|
|
226
219
|
return {
|
|
227
220
|
experimental: {
|
|
228
221
|
viewTransitions: true,
|
|
@@ -236,7 +229,7 @@ const genAstroConfig = ({
|
|
|
236
229
|
site,
|
|
237
230
|
compressHTML: isToServerless,
|
|
238
231
|
build: {
|
|
239
|
-
assetsPrefix,
|
|
232
|
+
assetsPrefix: !isSSG ? settings.assetsPrefix : undefined,
|
|
240
233
|
inlineStylesheets: 'never',
|
|
241
234
|
...settings.build,
|
|
242
235
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.28.
|
|
4
|
+
"version": "0.28.3",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront with Astro",
|
|
6
6
|
"bin": {
|
|
7
7
|
"storefront": "./scripts/build-prod.sh"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"astro-capo": "^0.0.1",
|
|
48
48
|
"chroma-js": "^2.4.2",
|
|
49
49
|
"dotenv": "^16.3.1",
|
|
50
|
-
"firebase": "^10.
|
|
50
|
+
"firebase": "^10.5.0",
|
|
51
51
|
"image-size": "^1.0.2",
|
|
52
52
|
"mime": "^3.0.0",
|
|
53
53
|
"semver": "^7.5.4",
|
|
@@ -32,6 +32,7 @@ export type UsePictureParams = PictureProps & {
|
|
|
32
32
|
tryImageSize: TryImageSize;
|
|
33
33
|
getPicture: ((params: GetPictureParams) => Promise<GetPictureResult>)
|
|
34
34
|
| ((params: GetBuiltPictureParams) => Promise<GetBuiltPictureResult>);
|
|
35
|
+
assetsPrefix?: string;
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
const useSSRPicture = async (params: UsePictureParams) => {
|
|
@@ -50,6 +51,7 @@ const useSSRPicture = async (params: UsePictureParams) => {
|
|
|
50
51
|
hasImg = true,
|
|
51
52
|
tryImageSize,
|
|
52
53
|
getPicture,
|
|
54
|
+
assetsPrefix,
|
|
53
55
|
...attrs
|
|
54
56
|
} = params;
|
|
55
57
|
|
|
@@ -150,6 +152,12 @@ const useSSRPicture = async (params: UsePictureParams) => {
|
|
|
150
152
|
});
|
|
151
153
|
delete image.width;
|
|
152
154
|
delete image.height;
|
|
155
|
+
if (import.meta.env.PROD && assetsPrefix && image.src?.charAt(0) === '/') {
|
|
156
|
+
image.src = `${assetsPrefix}${image.src}`;
|
|
157
|
+
sources.forEach((source) => {
|
|
158
|
+
source.srcset = `${assetsPrefix}${source.srcset}`;
|
|
159
|
+
});
|
|
160
|
+
}
|
|
153
161
|
|
|
154
162
|
const pictureAttrs: Partial<typeof attrs & { alt: string }> = {};
|
|
155
163
|
if (!hasImg) {
|
|
@@ -42,6 +42,7 @@ export const usePageHero = async ({ routeContext }: Props) => {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
type CustomSection = { type: `${string}:${string}`, props: any };
|
|
45
|
+
type ProductDetailsProps = { hasDescription?: boolean, hasSpecifications?: boolean };
|
|
45
46
|
|
|
46
47
|
export const usePageSections = async <T extends CustomSection = CustomSection>
|
|
47
48
|
({ routeContext, handleCustomSection }: Props) => {
|
|
@@ -50,7 +51,7 @@ export const usePageSections = async <T extends CustomSection = CustomSection>
|
|
|
50
51
|
T
|
|
51
52
|
| { type: 'product-shelf', props: UseProductShelfProps }
|
|
52
53
|
| { type: 'banners-grid', props: { banners: UseBannerProps[] } }
|
|
53
|
-
| { type: 'product-details', props:
|
|
54
|
+
| { type: 'product-details', props: ProductDetailsProps }
|
|
54
55
|
| { type: 'breadcrumbs', props: {} }
|
|
55
56
|
| { type: 'related-products', props: {} }
|
|
56
57
|
| { type: 'doc-description', props: {} }
|
|
@@ -45,9 +45,8 @@ if (!globalThis.$storefront) {
|
|
|
45
45
|
const setResponseCache = (Astro: AstroGlobal, maxAge: number, sMaxAge?: number) => {
|
|
46
46
|
const headerName = import.meta.env.PROD ? 'Cache-Control' : 'X-Cache-Control';
|
|
47
47
|
let cacheControl = `public, max-age=${maxAge}, must-revalidate`;
|
|
48
|
-
if (sMaxAge) {
|
|
49
|
-
|
|
50
|
-
}
|
|
48
|
+
if (sMaxAge) cacheControl += `, s-maxage=${sMaxAge}`;
|
|
49
|
+
if (sMaxAge || maxAge >= 60) cacheControl += `, stale-while-revalidate=604800`;
|
|
51
50
|
Astro.response.headers.set(headerName, cacheControl);
|
|
52
51
|
};
|
|
53
52
|
|
|
@@ -185,6 +184,9 @@ const loadRouteContext = async (Astro: Readonly<AstroGlobal>, {
|
|
|
185
184
|
const cdnURL = assetsPrefix.replace(/(https:\/\/[^/]+).*/, '$1');
|
|
186
185
|
Astro.response.headers.set('Link', `<${cdnURL}/>; rel=preconnect`);
|
|
187
186
|
}
|
|
187
|
+
Astro.locals.assetsPrefix = assetsPrefix || '';
|
|
188
|
+
} else {
|
|
189
|
+
Astro.locals.assetsPrefix = '';
|
|
188
190
|
}
|
|
189
191
|
if (urlPath === '/~fallback') {
|
|
190
192
|
setResponseCache(Astro, 3600, 86400);
|