cloudcommerce 0.0.95 → 0.0.96

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,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.96](https://github.com/ecomplus/cloud-commerce/compare/v0.0.95...v0.0.96) (2022-09-24)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **storefront:** Image size input with full image path using `STOREFRONT_BASE_DIR` ([59bb3f6](https://github.com/ecomplus/cloud-commerce/commit/59bb3f67fb074536fa280326ae8c268187b065f7))
11
+ * **storefront:** Must always set `process.env.STOREFRONT_BASE_DIR` instead of `import.meta.env` ([d4b0812](https://github.com/ecomplus/cloud-commerce/commit/d4b0812e4119119c4ac6489bbee7116b4927ac74))
12
+
5
13
  ### [0.0.95](https://github.com/ecomplus/cloud-commerce/compare/v0.0.94...v0.0.95) (2022-09-24)
6
14
 
7
15
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloudcommerce",
3
3
  "type": "module",
4
- "version": "0.0.95",
4
+ "version": "0.0.96",
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.95",
4
+ "version": "0.0.96",
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.95",
4
+ "version": "0.0.96",
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.95",
4
+ "version": "0.0.96",
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.95",
4
+ "version": "0.0.96",
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.95",
4
+ "version": "0.0.96",
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.95",
4
+ "version": "0.0.96",
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.95",
4
+ "version": "0.0.96",
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.95",
4
+ "version": "0.0.96",
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.95",
4
+ "version": "0.0.96",
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.95",
4
+ "version": "0.0.96",
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.95",
4
+ "version": "0.0.96",
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.95",
4
+ "version": "0.0.96",
5
5
  "description": "E-Com Plus Cloud Commerce customers authentication (passport) API",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -12,7 +12,7 @@ const { httpsFunctionOptions } = config.get();
12
12
  export const ssr = onRequest({
13
13
  timeoutSeconds: 15,
14
14
  memory: '256MiB',
15
- // minInstances: 1,
15
+ minInstances: 1,
16
16
  ...httpsFunctionOptions,
17
17
  }, (req, res) => {
18
18
  serveStorefront(req, res);
@@ -1 +1 @@
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,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;AAE9C,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC;IAC3B,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,QAAQ;IAChB,mBAAmB;IACnB,GAAG,oBAAoB;CACxB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACd,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC,CAAC,CAAC"}
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,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;AAE9C,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC;IAC3B,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,CAAC;IACf,GAAG,oBAAoB;CACxB,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.95",
4
+ "version": "0.0.96",
5
5
  "description": "E-Com Plus Cloud Commerce storefront SSR",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -13,7 +13,7 @@ const { httpsFunctionOptions } = config.get();
13
13
  export const ssr = onRequest({
14
14
  timeoutSeconds: 15,
15
15
  memory: '256MiB',
16
- // minInstances: 1,
16
+ minInstances: 1,
17
17
  ...httpsFunctionOptions,
18
18
  }, (req, res) => {
19
19
  serveStorefront(req, res);
@@ -2,8 +2,7 @@ import * as adapter from '@astrojs/node/server.js';
2
2
  import { defineComponent, h, createSSRApp, mergeProps, createVNode as createVNode$1, resolveDynamicComponent, withCtx, createTextVNode, toDisplayString, useSSRContext } from 'vue';
3
3
  import { renderToString as renderToString$1, ssrRenderAttrs, ssrRenderSlot, ssrRenderVNode, ssrInterpolate, ssrRenderClass, ssrRenderList, ssrRenderAttr } from 'vue/server-renderer';
4
4
  import { escape } from 'html-escaper';
5
- /* empty css */import { fileURLToPath } from 'url';
6
- import fs from 'fs';
5
+ /* empty css */import fs from 'fs';
7
6
  import { resolve } from 'path';
8
7
  import Deepmerge from '@fastify/deepmerge';
9
8
  import * as $$module1$5 from '@ecomplus/utils';
@@ -1648,15 +1647,15 @@ const _getConfig = () => {
1648
1647
  const {
1649
1648
  STOREFRONT_BASE_DIR,
1650
1649
  VITE_ECOM_STORE_ID,
1651
- } = (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;
1650
+ } = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true},{ECOM_STORE_ID:process.env.ECOM_STORE_ID,STOREFRONT_BASE_DIR:process.env.STOREFRONT_BASE_DIR,})) || process.env;
1652
1651
 
1653
1652
  let baseDir;
1654
1653
  if (STOREFRONT_BASE_DIR) {
1655
- const currentDir = fileURLToPath(new URL('.', import.meta.url));
1656
- baseDir = resolve(currentDir, STOREFRONT_BASE_DIR);
1654
+ baseDir = resolve(process.cwd(), STOREFRONT_BASE_DIR);
1657
1655
  } else {
1658
1656
  baseDir = process.cwd();
1659
1657
  }
1658
+ process.env.STOREFRONT_BASE_DIR = baseDir;
1660
1659
  const dirContent = resolve(baseDir, 'content');
1661
1660
  if (VITE_ECOM_STORE_ID) {
1662
1661
  config.set({ storeId: Number(VITE_ECOM_STORE_ID) });
@@ -2097,8 +2096,9 @@ const $$module1$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.definePropert
2097
2096
  const tryImageSize = (src) => {
2098
2097
  let dimensions = {};
2099
2098
  if (typeof src === "string" && src.startsWith("/")) {
2099
+ const { STOREFRONT_BASE_DIR } = Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true}, { STOREFRONT_BASE_DIR: process.env.STOREFRONT_BASE_DIR });
2100
2100
  try {
2101
- dimensions = imageSize(`public${src}`);
2101
+ dimensions = imageSize(resolve(STOREFRONT_BASE_DIR, `public${src}`));
2102
2102
  } catch (e) {
2103
2103
  dimensions = {};
2104
2104
  }
@@ -1,2 +1,2 @@
1
- STOREFRONT_BASE_DIR=../../store/functions/ssr/
1
+ STOREFRONT_BASE_DIR=.
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.95",
4
+ "version": "0.0.96",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "main": "src/index.js",
7
7
  "repository": {
@@ -1,10 +1,12 @@
1
+ import { resolve as resolvePath } from 'path';
1
2
  import imageSize from 'image-size';
2
3
 
3
4
  const tryImageSize = (src: string) => {
4
5
  let dimensions: { width?: number, height?: number } = {};
5
6
  if (typeof src === 'string' && src.startsWith('/')) {
7
+ const { STOREFRONT_BASE_DIR } = import.meta.env;
6
8
  try {
7
- dimensions = imageSize(`public${src}`);
9
+ dimensions = imageSize(resolvePath(STOREFRONT_BASE_DIR, `public${src}`));
8
10
  } catch (e) {
9
11
  dimensions = {};
10
12
  }
@@ -2,13 +2,11 @@ import fs from 'fs';
2
2
  import { resolve as resolvePath } from 'path';
3
3
  import config from '@cloudcommerce/config';
4
4
 
5
- const getEnvVar = (name) => {
6
- return import.meta.env?.[name] || process.env[name];
7
- };
8
-
9
5
  export default () => {
10
- const STOREFRONT_BASE_DIR = getEnvVar('STOREFRONT_BASE_DIR');
11
- const VITE_ECOM_STORE_ID = getEnvVar('VITE_ECOM_STORE_ID');
6
+ const {
7
+ STOREFRONT_BASE_DIR,
8
+ VITE_ECOM_STORE_ID,
9
+ } = import.meta.env || process.env;
12
10
 
13
11
  let baseDir;
14
12
  if (STOREFRONT_BASE_DIR) {
@@ -16,6 +14,7 @@ export default () => {
16
14
  } else {
17
15
  baseDir = process.cwd();
18
16
  }
17
+ process.env.STOREFRONT_BASE_DIR = baseDir;
19
18
  const dirContent = resolvePath(baseDir, 'content');
20
19
  if (VITE_ECOM_STORE_ID) {
21
20
  config.set({ storeId: Number(VITE_ECOM_STORE_ID) });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/types",
3
3
  "type": "module",
4
- "version": "0.0.95",
4
+ "version": "0.0.96",
5
5
  "description": "E-Com Plus Cloud Commerce reusable type definitions",
6
6
  "main": "index.ts",
7
7
  "repository": {
@@ -0,0 +1,55 @@
1
+ {
2
+ "extends": [
3
+ "config:base"
4
+ ],
5
+ "schedule": [
6
+ "after 6am and before 10am on monday"
7
+ ],
8
+ "labels": [
9
+ "dependencies"
10
+ ],
11
+ "rangeStrategy": "bump",
12
+ "packageRules": [
13
+ {
14
+ "excludePackagePrefixes": [
15
+ "@ecomplus",
16
+ "@cloudcommerce"
17
+ ],
18
+ "matchUpdateTypes": [
19
+ "minor",
20
+ "patch",
21
+ "lockFileMaintenance"
22
+ ],
23
+ "groupName": "Many non-major"
24
+ },
25
+ {
26
+ "matchPackagePrefixes": [
27
+ "@cloudcommerce"
28
+ ],
29
+ "matchUpdateTypes": [
30
+ "minor",
31
+ "patch"
32
+ ],
33
+ "schedule": [
34
+ "after 11am and before 4pm every weekday"
35
+ ],
36
+ "semanticCommitType": "fix",
37
+ "automerge": true,
38
+ "groupName": "Cloud Commerce bump non-major"
39
+ },
40
+ {
41
+ "matchPackagePrefixes": [
42
+ "@ecomplus"
43
+ ],
44
+ "matchUpdateTypes": [
45
+ "minor",
46
+ "patch"
47
+ ],
48
+ "schedule": [
49
+ "after 11am and before 4pm every weekday"
50
+ ],
51
+ "semanticCommitType": "fix",
52
+ "groupName": "@ecomplus non-major"
53
+ }
54
+ ]
55
+ }