cloudcommerce 0.0.85 → 0.0.86

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.
@@ -1,8 +1,5 @@
1
1
  {
2
2
  "editor.quickSuggestions": {
3
3
  "strings": true
4
- },
5
- "files.associations": {
6
- "*.css": "tailwindcss"
7
4
  }
8
5
  }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
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.86](https://github.com/ecomplus/cloud-commerce/compare/v0.0.85...v0.0.86) (2022-09-23)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **storefront:** Add `DEPLOY_RAND` to transformed images URL for cache control ([6fdce8d](https://github.com/ecomplus/cloud-commerce/commit/6fdce8db91a2bede01ae40b1042175067a0ba9a6))
11
+ * **storefront:** Cannot use tailwind syntax (`theme` function) on Astro styles (yet) ([92109c9](https://github.com/ecomplus/cloud-commerce/commit/92109c9736384ce2158ed6bd0f5e5510934a5c16))
12
+
5
13
  ### [0.0.85](https://github.com/ecomplus/cloud-commerce/compare/v0.0.84...v0.0.85) (2022-09-23)
6
14
 
7
15
 
package/action.yml CHANGED
@@ -64,6 +64,7 @@ runs:
64
64
  ECOM_STORE_ID=$ECOM_STORE_ID
65
65
  GITHUB_TOKEN=$GITHUB_TOKEN
66
66
  TINY_ERP_TOKEN=$TINY_ERP_TOKEN
67
+ DEPLOY_RAND="$RANDOM.$RANDOM"
67
68
  " > functions/.env
68
69
  GOOGLE_APPLICATION_CREDENTIALS=$GAC_FILENAME npm run deploy
69
70
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloudcommerce",
3
3
  "type": "module",
4
- "version": "0.0.85",
4
+ "version": "0.0.86",
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.85",
4
+ "version": "0.0.86",
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.85",
4
+ "version": "0.0.86",
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.85",
4
+ "version": "0.0.86",
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.85",
4
+ "version": "0.0.86",
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-frenet",
3
3
  "type": "module",
4
- "version": "0.0.85",
4
+ "version": "0.0.86",
5
5
  "description": "E-Com Plus Cloud Commerce app for Frenet shipping calculation",
6
6
  "main": "lib/frenet.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.85",
4
+ "version": "0.0.86",
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.85",
4
+ "version": "0.0.86",
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.85",
4
+ "version": "0.0.86",
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.85",
4
+ "version": "0.0.86",
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.85",
4
+ "version": "0.0.86",
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.85",
4
+ "version": "0.0.86",
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.85",
4
+ "version": "0.0.86",
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.85",
4
+ "version": "0.0.86",
5
5
  "description": "E-Com Plus Cloud Commerce storefront SSR",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -2219,11 +2219,11 @@ const $$Base = createComponent(async ($$result, $$props, $$slots) => {
2219
2219
  { props: { "is:global": true, "define:vars": colorCSSVars }, children: `:root {
2220
2220
  --content-max-width: 80rem;
2221
2221
  --white: #fff;
2222
- --gray-50: theme('colors.gray.50');
2223
- --gray-200: theme('colors.gray.200');
2224
- --gray-700: theme('colors.gray.700');
2225
- --gray-800: theme('colors.gray.800');
2226
- --gray-900: theme('colors.gray.900');
2222
+ --gray-50: #f9fafb;
2223
+ --gray-200: #e5e7eb;
2224
+ --gray-700: #374151;
2225
+ --gray-800: #1f2937;
2226
+ --gray-900: #111827;
2227
2227
  --surface-color: var(--gray-50);
2228
2228
  --surface-border-color: var(--gray-200);
2229
2229
  --yiq-text-light: var(--white);
@@ -2404,17 +2404,22 @@ const tryImageSize = (src) => {
2404
2404
  }
2405
2405
  return dimensions;
2406
2406
  };
2407
- const getImage = (options) => {
2407
+ const getImage = async (options) => {
2408
2408
  const { src } = options;
2409
+ let imgAttrs;
2409
2410
  if (typeof src === "string" && !options.aspectRatio && (!options.width || !options.height)) {
2410
2411
  const { width, height } = tryImageSize(src);
2411
- return getImage$1({
2412
+ imgAttrs = await getImage$1({
2412
2413
  width,
2413
2414
  ...options,
2414
2415
  aspectRatio: width && height ? width / height : 1
2415
2416
  });
2417
+ } else {
2418
+ imgAttrs = await getImage$1(options);
2416
2419
  }
2417
- return getImage$1(options);
2420
+ imgAttrs.src += imgAttrs.src.includes("?") ? "&" : "?";
2421
+ imgAttrs.src += `V=${{"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true}.DEPLOY_RAND || "_"}`;
2422
+ return imgAttrs;
2418
2423
  };
2419
2424
 
2420
2425
  const $$module1$3 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "0.0.85",
4
+ "version": "0.0.86",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "main": "src/index.js",
7
7
  "repository": {
@@ -14,21 +14,26 @@ const tryImageSize = (src: string) => {
14
14
  return dimensions;
15
15
  };
16
16
 
17
- const getImage = (options: Parameters<typeof _getImage>[0]) => {
17
+ const getImage = async (options: Parameters<typeof _getImage>[0]) => {
18
18
  const { src } = options;
19
+ let imgAttrs: Awaited<ReturnType<typeof _getImage>>;
19
20
  if (
20
21
  typeof src === 'string'
21
22
  && !options.aspectRatio
22
23
  && (!options.width || !options.height)
23
24
  ) {
24
25
  const { width, height } = tryImageSize(src);
25
- return _getImage({
26
+ imgAttrs = await _getImage({
26
27
  width,
27
28
  ...options,
28
29
  aspectRatio: width && height ? width / height : 1,
29
30
  });
31
+ } else {
32
+ imgAttrs = await _getImage(options);
30
33
  }
31
- return _getImage(options);
34
+ imgAttrs.src += imgAttrs.src.includes('?') ? '&' : '?';
35
+ imgAttrs.src += `V=${import.meta.env.DEPLOY_RAND || '_'}`;
36
+ return imgAttrs;
32
37
  };
33
38
 
34
39
  export default getImage;
@@ -92,11 +92,11 @@ Object.keys(brandColors).forEach((colorName) => {
92
92
  :root {
93
93
  --content-max-width: 80rem;
94
94
  --white: #fff;
95
- --gray-50: theme('colors.gray.50');
96
- --gray-200: theme('colors.gray.200');
97
- --gray-700: theme('colors.gray.700');
98
- --gray-800: theme('colors.gray.800');
99
- --gray-900: theme('colors.gray.900');
95
+ --gray-50: #f9fafb;
96
+ --gray-200: #e5e7eb;
97
+ --gray-700: #374151;
98
+ --gray-800: #1f2937;
99
+ --gray-900: #111827;
100
100
  --surface-color: var(--gray-50);
101
101
  --surface-border-color: var(--gray-200);
102
102
  --yiq-text-light: var(--white);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/types",
3
3
  "type": "module",
4
- "version": "0.0.85",
4
+ "version": "0.0.86",
5
5
  "description": "E-Com Plus Cloud Commerce reusable type definitions",
6
6
  "main": "index.ts",
7
7
  "repository": {