cloudcommerce 2.6.0 → 2.6.2
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/.vscode/settings.json +4 -1
- package/CHANGELOG.md +18 -0
- package/ecomplus-stores/barradoce/.devcontainer/devcontainer.json +10 -4
- package/ecomplus-stores/barradoce/.vscode/settings.json +3 -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/components/CartSidebar.vue +11 -11
- package/ecomplus-stores/barradoce/functions/ssr/src/components/ProductDetails.vue +23 -13
- package/ecomplus-stores/barradoce/functions/ssr/src/components/SearchModal.vue +9 -6
- package/ecomplus-stores/barradoce/functions/ssr/src/components/SearchShowcase.vue +19 -17
- package/ecomplus-stores/barradoce/functions/ssr/src/components/ShippingCalculator.vue +10 -10
- package/ecomplus-stores/barradoce/functions/ssr/src/main/content/Sections.astro +3 -0
- package/ecomplus-stores/barradoce/functions/ssr/src/state/midd-search-engine.ts +19 -0
- package/ecomplus-stores/barradoce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barradoce/package.json +2 -2
- package/ecomplus-stores/barradoce/tailwind.config.cjs +5 -3
- package/package.json +2 -2
- package/packages/api/package.json +1 -1
- package/packages/apps/affiliate-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 +1 -1
- 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/mandae/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/pagarme-v5/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 +1 -1
- 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/lib/lib/cron-ssr-save-views.js +21 -16
- package/packages/ssr/lib/lib/cron-ssr-save-views.js.map +1 -1
- package/packages/ssr/package.json +1 -1
- package/packages/ssr/src/lib/cron-ssr-save-views.ts +27 -20
- package/packages/storefront/package.json +1 -1
- package/packages/storefront/src/lib/composables/use-search-modal.ts +3 -1
- package/packages/storefront/src/lib/composables/use-search-showcase.ts +2 -1
- package/packages/storefront/src/lib/layouts/BaseHead.astro +2 -1
- package/packages/storefront/src/lib/layouts/use-page-main.ts +9 -5
- package/packages/storefront/src/lib/state/search-engine.ts +21 -11
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/storefront/src/lib/scripts/experimental-web-ide.ts +0 -29
- package/packages/storefront/src/web-ide/webcontainer.ts +0 -104
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { initVM } from '../../web-ide/webcontainer';
|
|
2
|
-
|
|
3
|
-
const cliTextareaId = 'IDEcli';
|
|
4
|
-
const serverIframeId = 'IDEserver';
|
|
5
|
-
|
|
6
|
-
if (!import.meta.env.SSR) {
|
|
7
|
-
const cliTextarea = document.createElement('textarea');
|
|
8
|
-
cliTextarea.id = cliTextareaId;
|
|
9
|
-
document.body.appendChild(cliTextarea);
|
|
10
|
-
const serverIframe = document.createElement('iframe');
|
|
11
|
-
serverIframe.id = serverIframeId;
|
|
12
|
-
serverIframe.width = '100%';
|
|
13
|
-
serverIframe.height = '100%';
|
|
14
|
-
serverIframe.style.cssText = 'border: 1px solid #EEE; height: calc(100vh - 30px)';
|
|
15
|
-
document.body.appendChild(serverIframe);
|
|
16
|
-
|
|
17
|
-
const initIDE = async () => {
|
|
18
|
-
const repo = 'ecomplus/store';
|
|
19
|
-
const { vm, startDevServer } = await initVM({ repo, cliTextarea });
|
|
20
|
-
vm.on('server-ready', (port, href) => {
|
|
21
|
-
console.log({ port, href });
|
|
22
|
-
const url = new URL(href);
|
|
23
|
-
url.searchParams.set('webcontainer', 'dev');
|
|
24
|
-
serverIframe.src = `${url}`;
|
|
25
|
-
});
|
|
26
|
-
startDevServer();
|
|
27
|
-
};
|
|
28
|
-
initIDE();
|
|
29
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { WebContainer } from '@webcontainer/api';
|
|
2
|
-
|
|
3
|
-
export const genContainerFiles = ({ repo, ghToken, repoDir }: {
|
|
4
|
-
repo: string,
|
|
5
|
-
ghToken?: string,
|
|
6
|
-
repoDir: string,
|
|
7
|
-
}) => ({
|
|
8
|
-
'git.js': {
|
|
9
|
-
file: {
|
|
10
|
-
contents: `
|
|
11
|
-
import fs from 'node:fs';
|
|
12
|
-
import { join as joinPath } from 'node:path';
|
|
13
|
-
import { clone, pull } from 'isomorphic-git';
|
|
14
|
-
import * as http from 'isomorphic-git/http/node/index.cjs';
|
|
15
|
-
const dir = joinPath(process.cwd(), '${repoDir}');
|
|
16
|
-
const isClone = process.argv.find((val) => val === '--clone');
|
|
17
|
-
const options = {
|
|
18
|
-
fs,
|
|
19
|
-
http,
|
|
20
|
-
dir,
|
|
21
|
-
singleBranch: true,
|
|
22
|
-
ref: 'c59d5884ab86899da1c7fd154bf4009cac0a60e9',
|
|
23
|
-
};
|
|
24
|
-
${(ghToken
|
|
25
|
-
? `
|
|
26
|
-
options.oauth2format = 'github';
|
|
27
|
-
options.token = '${ghToken}';`
|
|
28
|
-
: '')}
|
|
29
|
-
if (isClone) {
|
|
30
|
-
options.url = 'https://github.com/${repo}.git';
|
|
31
|
-
options.depth = 1;
|
|
32
|
-
clone(options);
|
|
33
|
-
} else {
|
|
34
|
-
pull(options);
|
|
35
|
-
}
|
|
36
|
-
`,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
'package.json': {
|
|
40
|
-
file: {
|
|
41
|
-
contents: `
|
|
42
|
-
{
|
|
43
|
-
"name": "git-app",
|
|
44
|
-
"version": "1.0.0",
|
|
45
|
-
"type": "module",
|
|
46
|
-
"private": true,
|
|
47
|
-
"description": "",
|
|
48
|
-
"author": "",
|
|
49
|
-
"license": "ISC",
|
|
50
|
-
"scripts": {
|
|
51
|
-
"git:clone": "node git.js --clone",
|
|
52
|
-
"git:pull": "node git.js --pull"
|
|
53
|
-
},
|
|
54
|
-
"dependencies": {
|
|
55
|
-
"isomorphic-git": "^1.25.3"
|
|
56
|
-
}
|
|
57
|
-
}`,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
export const initVM = async ({ repo, ghToken, cliTextarea }: {
|
|
63
|
-
repo: string,
|
|
64
|
-
ghToken?: string,
|
|
65
|
-
cliTextarea: HTMLTextAreaElement,
|
|
66
|
-
}) => {
|
|
67
|
-
const vm = await WebContainer.boot();
|
|
68
|
-
const repoDir = 'store';
|
|
69
|
-
const files = genContainerFiles({ repo, ghToken, repoDir });
|
|
70
|
-
await vm.mount(files);
|
|
71
|
-
const exec = async (command: string, args: string[]) => {
|
|
72
|
-
const cliArgs = args.reduce((acc, opt) => `${acc} ${opt}`, '');
|
|
73
|
-
const cli = `$ ${command}${cliArgs}\n`;
|
|
74
|
-
cliTextarea.value += cli;
|
|
75
|
-
const proc = await vm.spawn(command, args);
|
|
76
|
-
if (import.meta.env.DEV || (window as any).DEBUG) {
|
|
77
|
-
proc.output.pipeTo(new WritableStream({
|
|
78
|
-
write(stdout) {
|
|
79
|
-
console.debug?.('webcontainer', { stdout });
|
|
80
|
-
},
|
|
81
|
-
}));
|
|
82
|
-
}
|
|
83
|
-
if (await proc.exit !== 0) {
|
|
84
|
-
throw new Error(`${command} failed`);
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
await exec('npm', ['install']);
|
|
88
|
-
await exec('npm', ['run', 'git:clone']);
|
|
89
|
-
await exec('npm', ['--prefix', repoDir, 'ci', '--omit=dev', '--ignore-scripts']);
|
|
90
|
-
const ssrDir = `${repoDir}/functions/ssr`;
|
|
91
|
-
await exec('npm', ['--prefix', ssrDir, 'ci']);
|
|
92
|
-
await vm.fs.writeFile(
|
|
93
|
-
`${ssrDir}/.env`,
|
|
94
|
-
`ECOM_STORE_ID=${window.ECOM_STORE_ID}\n`,
|
|
95
|
-
);
|
|
96
|
-
const startDevServer = async () => {
|
|
97
|
-
await exec('npm', ['--prefix', repoDir, 'run', 'dev']);
|
|
98
|
-
};
|
|
99
|
-
return {
|
|
100
|
-
vm,
|
|
101
|
-
vmExec: exec,
|
|
102
|
-
startDevServer,
|
|
103
|
-
};
|
|
104
|
-
};
|