@pi-r/chrome 0.10.1 → 0.10.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/index.js +10 -10
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -22,7 +22,7 @@ const CACHE_FORMAT = new Map();
|
|
|
22
22
|
const CACHE_DATASET = {};
|
|
23
23
|
const CACHE_ATRULES = {};
|
|
24
24
|
const [PATTERN_STRING_SOME, PATTERN_STRING_MANY] = (function () {
|
|
25
|
-
const grouping = '(?:\\s|' + dom_1.DomWriter.PATTERN_COMMENT + '|`[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}
|
|
25
|
+
const grouping = '(?:\\s|' + dom_1.DomWriter.PATTERN_COMMENT + '|`[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}`)';
|
|
26
26
|
return [grouping + '*', grouping + '+'];
|
|
27
27
|
})();
|
|
28
28
|
const [REGEXP_NTHCHILD, REGEXP_NTHCHILD_UNSAFE, REGEXP_REPLACECSS] = (function () {
|
|
@@ -749,7 +749,7 @@ class ChromeDocument extends Document {
|
|
|
749
749
|
}
|
|
750
750
|
const dest = path.join(destDir, subDir[subDir.length - 1]);
|
|
751
751
|
Document.renameFile(src, dest);
|
|
752
|
-
instance.addLog(
|
|
752
|
+
instance.addLog(4, `production: ${dest} (mapped)`, { source: subDir.join(path.sep) });
|
|
753
753
|
emptyDir.add(path.dirname(src));
|
|
754
754
|
if (i !== start) {
|
|
755
755
|
for (let j = 0; j < i; ++j) {
|
|
@@ -774,7 +774,7 @@ class ChromeDocument extends Document {
|
|
|
774
774
|
}
|
|
775
775
|
for (const item of mapped) {
|
|
776
776
|
if (item[2] === 0) {
|
|
777
|
-
instance.addLog(
|
|
777
|
+
instance.addLog(4, `production: ${item[1]} (mapped: 0)`, { source: item[0] });
|
|
778
778
|
}
|
|
779
779
|
}
|
|
780
780
|
for (const pathname of Array.from(emptyDir).sort((a, b) => b.length - a.length)) {
|
|
@@ -1645,7 +1645,7 @@ class ChromeDocument extends Document {
|
|
|
1645
1645
|
}
|
|
1646
1646
|
}
|
|
1647
1647
|
search ??= restoreSearchParams(asset.url?.search);
|
|
1648
|
-
status &&= status.filter(item => item.type >=
|
|
1648
|
+
status &&= status.filter(item => item.type >= 1 && item.type <= 3);
|
|
1649
1649
|
watch.send(types_1.WATCH_EVENT.MODIFIED, {
|
|
1650
1650
|
action: pathname && watch.hot && !watch.main ? 'hot' : '',
|
|
1651
1651
|
type: asset.mimeType,
|
|
@@ -1979,7 +1979,7 @@ class ChromeDocument extends Document {
|
|
|
1979
1979
|
if (domBase.hasErrors()) {
|
|
1980
1980
|
const timeStamp = Date.now();
|
|
1981
1981
|
for (const err of domBase.errors) {
|
|
1982
|
-
this.addLog(
|
|
1982
|
+
this.addLog(3, err, { timeStamp, source: 'dom-writer' });
|
|
1983
1983
|
}
|
|
1984
1984
|
}
|
|
1985
1985
|
if (domBase.failCount > 0) {
|
|
@@ -2068,7 +2068,7 @@ class ChromeDocument extends Document {
|
|
|
2068
2068
|
if (detectWidth || detectHeight) {
|
|
2069
2069
|
let width = 0, height = 0, buffer = null;
|
|
2070
2070
|
const addLog = (suffix, err) => {
|
|
2071
|
-
this.addLog(
|
|
2071
|
+
this.addLog(3, err instanceof Error ? err : 'Could not detect image ' + suffix, { source: item.localUri ? path.basename(item.localUri) : item.filename });
|
|
2072
2072
|
};
|
|
2073
2073
|
if (isImage(item.mimeType) && (buffer = host.getBuffer(item))) {
|
|
2074
2074
|
try {
|
|
@@ -2170,7 +2170,7 @@ class ChromeDocument extends Document {
|
|
|
2170
2170
|
const batchGroup = [];
|
|
2171
2171
|
for (const item of sourceSet) {
|
|
2172
2172
|
if (!item.element) {
|
|
2173
|
-
this.addLog(
|
|
2173
|
+
this.addLog(3, `No target element {${JSON.stringify(item)}}`, { source: 'dom-writer' });
|
|
2174
2174
|
continue;
|
|
2175
2175
|
}
|
|
2176
2176
|
const type = item.source;
|
|
@@ -2246,7 +2246,7 @@ class ChromeDocument extends Document {
|
|
|
2246
2246
|
result = await cloud.getDatabaseBatchRows(batch, true, this.sessionKey).catch((err) => {
|
|
2247
2247
|
this.abort(type);
|
|
2248
2248
|
if (err instanceof Error) {
|
|
2249
|
-
cloud.addLog(this.aborted ?
|
|
2249
|
+
cloud.addLog(this.aborted ? 2 : 3, errors = err, { source: batch[0].service });
|
|
2250
2250
|
}
|
|
2251
2251
|
return [];
|
|
2252
2252
|
});
|
|
@@ -3249,7 +3249,7 @@ class ChromeDocument extends Document {
|
|
|
3249
3249
|
while (bracket = pattern.exec(current)) {
|
|
3250
3250
|
const segment = bracket[0];
|
|
3251
3251
|
if (/[{}]/.test(segment)) {
|
|
3252
|
-
const placeholder = '`' + (0, node_crypto_1.randomUUID)() + '`';
|
|
3252
|
+
const placeholder = '`' + (0, node_crypto_1.randomUUID)().substring(0, 18) + '`';
|
|
3253
3253
|
replaceMap.push([placeholder, segment]);
|
|
3254
3254
|
current = replaceMatch(bracket, current, placeholder, pattern);
|
|
3255
3255
|
}
|
|
@@ -3262,7 +3262,7 @@ class ChromeDocument extends Document {
|
|
|
3262
3262
|
for (let i = 0, length = values.length; i < length; ++i) {
|
|
3263
3263
|
const seg = values[i];
|
|
3264
3264
|
if (/^url\([^{}]*[{}].*\)$/is.test(seg)) {
|
|
3265
|
-
replaceMap.push([values[i] = (0, node_crypto_1.randomUUID)(), seg]);
|
|
3265
|
+
replaceMap.push([values[i] = (0, node_crypto_1.randomUUID)().substring(0, 18), seg]);
|
|
3266
3266
|
}
|
|
3267
3267
|
}
|
|
3268
3268
|
if (replaceMap.length > 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/chrome",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "Chrome document constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/cloud": "^0.12.
|
|
24
|
-
"@e-mc/core": "^0.12.
|
|
25
|
-
"@e-mc/document": "^0.12.
|
|
26
|
-
"@e-mc/types": "^0.12.
|
|
23
|
+
"@e-mc/cloud": "^0.12.5",
|
|
24
|
+
"@e-mc/core": "^0.12.5",
|
|
25
|
+
"@e-mc/document": "^0.12.5",
|
|
26
|
+
"@e-mc/types": "^0.12.5",
|
|
27
27
|
"image-size": "^2.0.2"
|
|
28
28
|
}
|
|
29
29
|
}
|