cloudcommerce 2.4.1 → 2.4.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 +18 -0
- package/ecomplus-stores/barradoce/functions/many/package.json +3 -3
- package/ecomplus-stores/barradoce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barradoce/functions/ssr/src/pages/admin/index.astro +23 -0
- package/ecomplus-stores/barradoce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barradoce/package.json +2 -2
- package/package.json +5 -5
- package/packages/api/package.json +1 -1
- package/packages/apps/affiliate-program/package.json +2 -2
- package/packages/apps/correios/package.json +3 -3
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +2 -2
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +2 -2
- package/packages/apps/fb-conversions/package.json +2 -2
- package/packages/apps/flash-courier/package.json +2 -2
- package/packages/apps/frenet/package.json +2 -2
- package/packages/apps/galaxpay/package.json +2 -2
- package/packages/apps/google-analytics/package.json +2 -2
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/mandae/package.json +2 -2
- package/packages/apps/melhor-envio/package.json +2 -2
- package/packages/apps/mercadopago/package.json +2 -2
- package/packages/apps/pagarme/package.json +3 -3
- package/packages/apps/pagarme-v5/package.json +2 -2
- package/packages/apps/paghiper/package.json +2 -2
- package/packages/apps/pix/package.json +2 -2
- package/packages/apps/tiny-erp/package.json +2 -2
- package/packages/apps/webhooks/package.json +2 -2
- package/packages/cli/ci/bunny-config-base.sh +2 -0
- package/packages/cli/package.json +2 -2
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/eslint/package.json +4 -4
- package/packages/events/package.json +2 -2
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +4 -4
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +2 -2
- package/packages/passport/package.json +2 -2
- package/packages/ssr/package.json +4 -4
- package/packages/storefront/package.json +8 -8
- package/packages/storefront/src/decap-cms/gen-preview-container.ts +21 -49
- package/packages/storefront/src/decap-cms/preview/ssr-package.ts +14160 -0
- package/packages/storefront/src/decap-cms/preview/webcontainer.ts +55 -93
- package/packages/storefront/src/lib/layouts/BaseBody.astro +13 -0
- package/packages/storefront/src/lib/pages/admin.astro +0 -0
- package/packages/storefront/src/lib/scripts/decap-cms.ts +4 -16
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/storefront/src/decap-cms/preview/indexeddb.ts +0 -51
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/events",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.3",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app events",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@cloudcommerce/firebase": "workspace:*",
|
|
45
45
|
"@cloudcommerce/ssr": "workspace:*",
|
|
46
46
|
"firebase-admin": "^12.0.0",
|
|
47
|
-
"firebase-functions": "^4.
|
|
47
|
+
"firebase-functions": "^4.7.0",
|
|
48
48
|
"source-map-support": "^0.5.21"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/firebase",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.3",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce on Firebase",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@cloudcommerce/api": "workspace:*",
|
|
34
34
|
"@cloudcommerce/config": "workspace:*",
|
|
35
|
-
"@google-cloud/pubsub": "^4.
|
|
36
|
-
"dotenv": "^16.4.
|
|
35
|
+
"@google-cloud/pubsub": "^4.3.1",
|
|
36
|
+
"dotenv": "^16.4.2",
|
|
37
37
|
"firebase-admin": "^12.0.0",
|
|
38
|
-
"firebase-functions": "^4.
|
|
38
|
+
"firebase-functions": "^4.7.0",
|
|
39
39
|
"source-map-support": "^0.5.21"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/modules",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.3",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce modules API",
|
|
6
6
|
"main": "lib/index.cjs",
|
|
7
7
|
"exports": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"ajv-formats": "^2.1.1",
|
|
50
50
|
"axios": "^1.6.7",
|
|
51
51
|
"firebase-admin": "^12.0.0",
|
|
52
|
-
"firebase-functions": "^4.
|
|
52
|
+
"firebase-functions": "^4.7.0",
|
|
53
53
|
"source-map-support": "^0.5.21"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/passport",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.3",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce customers authentication (passport) API",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@cloudcommerce/api": "workspace:*",
|
|
27
27
|
"@cloudcommerce/firebase": "workspace:*",
|
|
28
28
|
"firebase-admin": "^12.0.0",
|
|
29
|
-
"firebase-functions": "^4.
|
|
29
|
+
"firebase-functions": "^4.7.0",
|
|
30
30
|
"source-map-support": "^0.5.21"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/ssr",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.3",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront SSR",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"astro-capo": "^0.0.1",
|
|
37
37
|
"axios": "^1.6.7",
|
|
38
38
|
"firebase-admin": "^12.0.0",
|
|
39
|
-
"firebase-functions": "^4.
|
|
39
|
+
"firebase-functions": "^4.7.0",
|
|
40
40
|
"mitt": "^3.0.1",
|
|
41
|
-
"vue": "^3.4.
|
|
41
|
+
"vue": "^3.4.18",
|
|
42
42
|
"yaml": "^2.3.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@cloudcommerce/types": "workspace:*",
|
|
46
|
-
"@cloudflare/workers-types": "^4.
|
|
46
|
+
"@cloudflare/workers-types": "^4.20240208.0",
|
|
47
47
|
"@firebase/app-types": "^0.9.0",
|
|
48
48
|
"typescript": "~5.2.2"
|
|
49
49
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.3",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront with Astro",
|
|
6
6
|
"bin": {
|
|
7
7
|
"storefront": "./scripts/build-prod.sh"
|
|
@@ -40,32 +40,32 @@
|
|
|
40
40
|
"@iconify-json/fa6-brands": "^1.1.18",
|
|
41
41
|
"@iconify-json/heroicons": "^1.1.19",
|
|
42
42
|
"@iconify-json/logos": "^1.1.42",
|
|
43
|
-
"@types/gtag.js": "^0.0.
|
|
43
|
+
"@types/gtag.js": "^0.0.19",
|
|
44
44
|
"@vite-pwa/astro": "^0.2.0",
|
|
45
45
|
"@vueuse/core": "10.7.2",
|
|
46
|
+
"@webcontainer/api": "^1.1.9",
|
|
46
47
|
"astro": "4.3.5",
|
|
47
48
|
"astro-capo": "^0.0.1",
|
|
48
49
|
"chroma-js": "^2.4.2",
|
|
49
|
-
"dotenv": "^16.4.
|
|
50
|
+
"dotenv": "^16.4.2",
|
|
50
51
|
"firebase": "^10.8.0",
|
|
51
52
|
"image-size": "^1.1.1",
|
|
52
53
|
"mime": "^3.0.0",
|
|
53
54
|
"mitt": "^3.0.1",
|
|
54
|
-
"semver": "^7.
|
|
55
|
+
"semver": "^7.6.0",
|
|
55
56
|
"sharp": "^0.32.6",
|
|
56
57
|
"tailwindcss": "^3.4.1",
|
|
57
58
|
"unocss": "^0.58.5",
|
|
58
59
|
"unplugin-auto-import": "^0.17.5",
|
|
59
60
|
"vite": "^5.0.11",
|
|
60
|
-
"vite-plugin-pwa": "^0.
|
|
61
|
-
"vue": "^3.4.
|
|
61
|
+
"vite-plugin-pwa": "^0.18.1",
|
|
62
|
+
"vue": "^3.4.18",
|
|
62
63
|
"wade": "0.3.3",
|
|
63
64
|
"yaml": "^2.3.4"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
67
|
"@cloudcommerce/eslint": "workspace:*",
|
|
67
68
|
"@cloudcommerce/types": "workspace:*",
|
|
68
|
-
"@types/react": "^18.2.55"
|
|
69
|
-
"@webcontainer/api": "^1.1.9"
|
|
69
|
+
"@types/react": "^18.2.55"
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -1,77 +1,49 @@
|
|
|
1
1
|
import type NReact from 'react';
|
|
2
|
-
import afetch from '../helpers/afetch';
|
|
3
2
|
import { initWebcontainer } from './preview/webcontainer';
|
|
4
3
|
|
|
5
|
-
const
|
|
6
|
-
const headers: Record<string, string> = {
|
|
7
|
-
Accept: 'application/vnd.github+json',
|
|
8
|
-
'X-GitHub-Api-Version': '2022-11-28',
|
|
9
|
-
};
|
|
10
|
-
if (ghToken) {
|
|
11
|
-
headers.Authorization = `Bearer ${ghToken}`;
|
|
12
|
-
}
|
|
13
|
-
const res = await afetch(`https://api.github.com/repos/${repo}/commits`, {
|
|
14
|
-
headers,
|
|
15
|
-
});
|
|
16
|
-
if (res.ok) {
|
|
17
|
-
return res.json();
|
|
18
|
-
}
|
|
19
|
-
const err: any = new Error('Failed reading repository commits on GitHub API');
|
|
20
|
-
err.res = res;
|
|
21
|
-
err.text = await res.text();
|
|
22
|
-
throw new Error(err);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const genPreviewContainer = ({
|
|
26
|
-
React,
|
|
27
|
-
WebContainer,
|
|
28
|
-
cmsConfig,
|
|
29
|
-
ghToken,
|
|
30
|
-
}: {
|
|
4
|
+
export const genPreviewContainer = ({ React, cmsConfig, ghToken }: {
|
|
31
5
|
React: typeof NReact,
|
|
32
|
-
WebContainer: any,
|
|
33
6
|
cmsConfig: Record<string, any>,
|
|
34
7
|
ghToken?: string,
|
|
35
8
|
}) => {
|
|
36
9
|
const { repo } = cmsConfig.backend;
|
|
37
10
|
const cliTextareaId = 'webcontainerCli';
|
|
11
|
+
const serverIframeId = 'serverPreview';
|
|
38
12
|
// https://github.com/decaporg/decap-cms/issues/2183#issuecomment-997373169
|
|
39
13
|
return class Prevew extends React.Component {
|
|
40
14
|
render() {
|
|
41
15
|
const { entry } = (this as any).props;
|
|
42
16
|
console.log({ entry });
|
|
43
|
-
const { host } = window.location;
|
|
44
17
|
const slug = '';
|
|
45
|
-
const
|
|
46
|
-
const src = `${isLocal ? 'http' : 'https'}://${host}/~preview/${slug}`;
|
|
18
|
+
const urlPath = `/~preview/${slug}`;
|
|
47
19
|
const html = `
|
|
48
20
|
<textarea id="${cliTextareaId}"></textarea>
|
|
49
|
-
<
|
|
21
|
+
<iframe
|
|
22
|
+
id="${serverIframeId}"
|
|
23
|
+
data-url="${urlPath}"
|
|
24
|
+
border="0"
|
|
25
|
+
width="100%"
|
|
26
|
+
height="100%"
|
|
27
|
+
style="border: 1px solid #EEE; height: calc(100vh - 30px)"
|
|
28
|
+
></iframe>`;
|
|
50
29
|
return React.createElement('div', {
|
|
51
30
|
dangerouslySetInnerHTML: { __html: html },
|
|
52
31
|
});
|
|
53
32
|
}
|
|
54
33
|
componentDidMount() {
|
|
55
|
-
let commitSha: string | undefined;
|
|
56
|
-
(async () => {
|
|
57
|
-
try {
|
|
58
|
-
const commits = await getRepoCommits(repo, ghToken);
|
|
59
|
-
commitSha = commits[0]?.sha;
|
|
60
|
-
} catch (err) {
|
|
61
|
-
console.error(err);
|
|
62
|
-
}
|
|
63
|
-
})();
|
|
64
34
|
const iframe = document.getElementById('preview-pane') as HTMLIFrameElement;
|
|
65
35
|
const cliTextarea = iframe.contentWindow!.document
|
|
66
36
|
.getElementById(cliTextareaId) as HTMLTextAreaElement;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
37
|
+
const previewIframe = iframe.contentWindow!.document
|
|
38
|
+
.getElementById(serverIframeId) as HTMLIFrameElement;
|
|
39
|
+
initWebcontainer({ repo, ghToken, cliTextarea })
|
|
40
|
+
.then(({ webcontainerInstance, startDevServer }) => {
|
|
41
|
+
webcontainerInstance.on('server-ready', (port, url) => {
|
|
42
|
+
console.log({ port, url });
|
|
43
|
+
previewIframe.src = url;
|
|
44
|
+
});
|
|
45
|
+
startDevServer();
|
|
46
|
+
});
|
|
75
47
|
}
|
|
76
48
|
};
|
|
77
49
|
};
|