@speedkit/cli 2.53.0 → 2.53.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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [2.53.2](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.53.1...v2.53.2) (2024-08-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **onboarding:** fix unsupported encoding error ([6242b03](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/6242b038a061f309bec70bdc4b7fab02e73b0d64))
|
|
7
|
+
|
|
8
|
+
## [2.53.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.53.0...v2.53.1) (2024-08-22)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **customer-config:** add prevention for having body as main block for pre-rendering ([132eeb3](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/132eeb37493221b3b90fb16fa4649068a560a607))
|
|
14
|
+
|
|
1
15
|
# [2.53.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.52.0...v2.53.0) (2024-08-22)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
{{#if addPreRendering}}
|
|
3
3
|
{{#unless supportShadowDomInPreRendering}}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
4
|
+
const PRERENDER_TIMEOUT = 30_000; // 30s
|
|
5
|
+
const PRERENDER_CHECK_INTERVAL = 300; // 300ms
|
|
6
|
+
const preRenderedRootConfig = [
|
|
7
|
+
// TODO: adjust/replace this exemplary list
|
|
8
|
+
{
|
|
9
|
+
selector: "body > #app, #speed-kit-pre-rendered-app",
|
|
10
|
+
detectChanges: [
|
|
11
|
+
{
|
|
12
|
+
// header area
|
|
13
|
+
find: "#page-root > div > .aem-container > div:nth-of-type(1)",
|
|
14
|
+
detectChanges: [
|
|
15
|
+
// main categories
|
|
16
|
+
{
|
|
17
|
+
find: 'button[id^="menu-button"] p',
|
|
18
|
+
compare: ["text"],
|
|
19
|
+
},
|
|
20
|
+
// logo
|
|
21
|
+
{
|
|
22
|
+
find: "img[src]",
|
|
23
|
+
compare: ["src"],
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
|
|
30
31
|
{{/unless}}
|
|
31
32
|
{{/if}}
|
|
32
33
|
/**
|
|
@@ -46,23 +47,28 @@
|
|
|
46
47
|
{{/if}}
|
|
47
48
|
|
|
48
49
|
blocks: [
|
|
49
|
-
// TODO: adjust/replace this exemplary list
|
|
50
50
|
{{#if addPreRendering}}
|
|
51
51
|
{{#unless supportShadowDomInPreRendering}}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
...preRenderedRootConfig.map((config) => {
|
|
53
|
+
return {
|
|
54
|
+
selector: config.selector,
|
|
55
|
+
merge: (localBlock, remoteBlock) => {
|
|
56
|
+
handlePreRenderBlock(localBlock, remoteBlock);
|
|
57
|
+
},
|
|
58
|
+
detectChanges: false,
|
|
59
|
+
};
|
|
60
|
+
}),
|
|
61
|
+
|
|
61
62
|
{{/unless}}
|
|
62
63
|
{{/if}}
|
|
64
|
+
// TODO: adjust/replace this exemplary list
|
|
63
65
|
|
|
64
66
|
{
|
|
67
|
+
{{#if addPreRendering}}
|
|
68
|
+
selector: '#main',
|
|
69
|
+
{{else}}
|
|
65
70
|
selector: 'body',
|
|
71
|
+
{{/if}}
|
|
66
72
|
detectChanges: [
|
|
67
73
|
// Main Headline:
|
|
68
74
|
{
|
|
@@ -93,19 +99,28 @@
|
|
|
93
99
|
// Shopify specific:
|
|
94
100
|
{
|
|
95
101
|
selector: "#shopify-section-announcement-bar",
|
|
102
|
+
{{#unless addPreRendering}}
|
|
96
103
|
merge: false, // TODO: remove if body is not the main block
|
|
104
|
+
{{/unless}}
|
|
97
105
|
detectChanges: [{
|
|
98
106
|
find: ".announcement-bar--wrapper",
|
|
99
107
|
compare: ["text"],
|
|
100
108
|
}],
|
|
101
109
|
},
|
|
102
110
|
// Cover all the other high-level Shopify sections:
|
|
111
|
+
{{#if addPreRendering}}
|
|
112
|
+
{
|
|
113
|
+
selector: "body > .shopify-section[id]",
|
|
114
|
+
idAttribute: "id",
|
|
115
|
+
},
|
|
116
|
+
{{else}}
|
|
103
117
|
// TODO: activate if body is not the main block
|
|
104
118
|
// {
|
|
105
119
|
// selector: "body > .shopify-section[id]",
|
|
106
120
|
// idAttribute: "id",
|
|
107
121
|
// },
|
|
108
122
|
{{/if}}
|
|
123
|
+
{{/if}}
|
|
109
124
|
{{#if isPlentymarkets}}
|
|
110
125
|
|
|
111
126
|
// Plentymarkets specific:
|
|
@@ -96,13 +96,15 @@ class CustomerDomainDocumentResponse {
|
|
|
96
96
|
const contentType = event.responseHeaders.find((headerRecord) => {
|
|
97
97
|
return headerRecord.name.toLowerCase() === "content-type";
|
|
98
98
|
})?.["value"] || "";
|
|
99
|
-
|
|
99
|
+
let charset = contentType.split("charset=")?.[1] || "utf-8";
|
|
100
100
|
const { body, base64Encoded } = await client.send("Fetch.getResponseBody", {
|
|
101
101
|
requestId: event.requestId,
|
|
102
102
|
});
|
|
103
103
|
if (base64Encoded) {
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
if (charset.includes("ISO-8859")) {
|
|
105
|
+
charset = "latin1";
|
|
106
|
+
}
|
|
107
|
+
return Buffer.from(body, "base64").toString(charset);
|
|
106
108
|
}
|
|
107
109
|
return body;
|
|
108
110
|
}
|
package/oclif.manifest.json
CHANGED