@pi-r/chrome 0.5.0 → 0.5.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/LICENSE +1 -1
- package/README.md +4 -2
- package/index.d.ts +6 -6
- package/index.js +83 -78
- package/package.json +6 -6
- package/types/index.d.ts +6 -6
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright 2023
|
|
1
|
+
Copyright 2023 Wit Studio
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
package/README.md
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { IFileManager } from '@e-mc/types/lib';
|
|
2
|
-
|
|
3
|
-
import type { ChromeDocumentConstructor, DocumentAsset } from './types';
|
|
4
|
-
|
|
5
|
-
declare const Chrome: ChromeDocumentConstructor<IFileManager<DocumentAsset>>;
|
|
6
|
-
|
|
1
|
+
import type { IFileManager } from '@e-mc/types/lib';
|
|
2
|
+
|
|
3
|
+
import type { ChromeDocumentConstructor, DocumentAsset } from './types';
|
|
4
|
+
|
|
5
|
+
declare const Chrome: ChromeDocumentConstructor<IFileManager<DocumentAsset>>;
|
|
6
|
+
|
|
7
7
|
export = Chrome;
|
package/index.js
CHANGED
|
@@ -17,31 +17,32 @@ const CACHE_SELECTOR = new Map();
|
|
|
17
17
|
const CACHE_DATASET = {};
|
|
18
18
|
const CACHE_ATRULES = {};
|
|
19
19
|
let CACHE_TOTAL = 0;
|
|
20
|
-
const REGEXP_SRCSETSIZE = /~\s*([\d.]+)\s*([wx])/i;
|
|
21
|
-
const REGEXP_TEMPLATECONDITIONAL = /(\n\s+)?\{\{if\s+((?:[^}]|}(?!}))+?)\}\}(\s*)([\S\s]*?)(?:\s*\{\{else(?:\s+if\s+((?:[^}]|}(?!}))+?))?\}\}(\s*)([\S\s]*?)\s*)?\s*\{\{end\}\}/g;
|
|
22
|
-
const REGEXP_TEMPLATECOMPARISON = /\s*\(\s*(?:(eq|ne|lt|le|gt|ge)\s+)?("[^"]+"|'[^']+'|[^\s)]+)(?:\s+("[^"]+"|'[^']+'|[^\s)]+))?\s*\)/g;
|
|
23
|
-
const REGEXP_TEMPLATEMATCH = new RegExp(`^(?:(and|or|not)\\s+)?((?:${REGEXP_TEMPLATECOMPARISON.source})+)|(!|not\\s+)?([^\\s][\\S\\s]*)$`);
|
|
24
|
-
const REGEXP_IMPORTMODULE = /(?:(?:^|[\n;]+)\s*import\s+(?:("(?:[^"]|(?<=\\)")+"|'(?:[^']|(?<=\\)')+')|.+?from\s+("(?:[^"]|(?<=\\)")+"|'(?:[^']|(?<=\\)')+')(?:[ \t]+assert[ \t]+\{((?:"(?:[^"]|(?<=\\)")+"|'(?:[^']|(?<=\\)')+'|`(?:[^`]|(?<=\\)`)+`|{[^{]*{|{[^}]*}|}[^}]*}|(?![{}])[^"'`])+)\})?)|\bimport\(\s*("(?:[^"]|(?<=\\)")+"|'(?:[^']|(?<=\\)')+')\s*(?:,\s*\{((?:"(?:[^"]|(?<=\\)")+"|'(?:[^']|(?<=\\)')+'|`(?:[^`]|(?<=\\)`)+`|{[^{]*{|{[^}]*}|}[^}]*}|(?![{}])[^"'`])+)\}\s*)?\))/g;
|
|
25
|
-
const REGEXP_BLOCKEXCLUDE = new RegExp(`(\\s*)<!--\\s*exclude\\s*:\\s*(?:start|end)\\s*-->` + dom_1.DomWriter.PATTERN_TRAILINGSPACE, 'gi');
|
|
26
20
|
const [PATTERN_STRING_SOME, PATTERN_STRING_MANY] = (function () {
|
|
27
21
|
const grouping = '(?:\\s|' + dom_1.DomWriter.PATTERN_COMMENT + '|`[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}`)';
|
|
28
22
|
return [grouping + '*', grouping + '+'];
|
|
29
23
|
})();
|
|
24
|
+
const PATTERN_PARENINLINE = '(?:[^()]|\\([^()]+\\(|\\([^)]+\\)|\\)[^()]+\\)|\\)*?)+';
|
|
25
|
+
const REGEXP_SRCSETSIZE = /~\s*([\d.]+)\s*([wx])/i;
|
|
26
|
+
const REGEXP_TEMPLATECONDITIONAL = /(\n\s+)?\{\{if\s+((?:[^}]|}(?!}))+?)\}\}(\s*)([\S\s]*?)(?:\s*\{\{else(?:\s+if\s+((?:[^}]|}(?!}))+?))?\}\}(\s*)([\S\s]*?)\s*)?\s*\{\{end\}\}/g;
|
|
27
|
+
const REGEXP_TEMPLATECOMPARISON = /\s*\(\s*(?:\b(eq|ne|lt|le|gt|ge)\s+)?("[^"]+"|'[^']+'|[^\s)]+)(?:\s+("[^"]+"|'[^']+'|[^\s)]+))?\s*\)/g;
|
|
28
|
+
const REGEXP_TEMPLATEMATCH = new RegExp(`^(?:\\b(and|or|not)\\s+)?((?:${REGEXP_TEMPLATECOMPARISON.source})+)|(!|not\\s+)?([^\\s][\\S\\s]*)$`);
|
|
29
|
+
const REGEXP_IMPORTMODULE = /(?:(?:^|[\n;]+)\s*import\s+(?:("(?:[^"]|(?<=\\)")+"|'(?:[^']|(?<=\\)')+')|.+?from\s+("(?:[^"]|(?<=\\)")+"|'(?:[^']|(?<=\\)')+')(?:[ \t]+assert[ \t]+\{((?:"(?:[^"]|(?<=\\)")+"|'(?:[^']|(?<=\\)')+'|`(?:[^`]|(?<=\\)`)+`|{[^{]*{|{[^}]*}|}[^}]*}|[^"'`]+)+)\})?)|\bimport\(\s*("(?:[^"]|(?<=\\)")+"|'(?:[^']|(?<=\\)')+')\s*(?:,\s*\{((?:"(?:[^"]|(?<=\\)")+"|'(?:[^']|(?<=\\)')+'|`(?:[^`]|(?<=\\)`)+`|{[^{]*{|{[^}]*}|}[^}]*}|[^"'`]+)+)\}\s*)?\))/g;
|
|
30
|
+
const REGEXP_BLOCKEXCLUDE = new RegExp(`(\\s*)<!--\\s*exclude\\s*:\\s*(?:start|end)\\s*-->` + dom_1.DomWriter.PATTERN_TRAILINGSPACE, 'gi');
|
|
30
31
|
const REGEXP_COMMENT = new RegExp(dom_1.DomWriter.PATTERN_COMMENT, 'g');
|
|
31
|
-
const
|
|
32
|
+
const REGEXP_QUOTEDVALUE = new RegExp(`\\b(?:@import${PATTERN_STRING_MANY}|content${PATTERN_STRING_SOME}:${PATTERN_STRING_SOME})(?:"[^"]*"|'[^']*')`, 'gi');
|
|
32
33
|
const REGEXP_STYLE = new RegExp(`(<style${dom_1.DomWriter.PATTERN_TAGOPEN}*>)([\\S\\s]*?)(<\\/style\\s*>)`, 'gi');
|
|
33
34
|
const REGEXP_VARIABLES = new RegExp(`(\\s*)(--[^\\s:]*)${PATTERN_STRING_SOME}:[^;}]*([;}])` + dom_1.DomWriter.PATTERN_TRAILINGSPACE, 'g');
|
|
34
35
|
const REGEXP_FONTFACE = new RegExp(`(\\s*)@font-face${PATTERN_STRING_SOME}{([^}]+)}` + dom_1.DomWriter.PATTERN_TRAILINGSPACE, 'gi');
|
|
35
|
-
const REGEXP_FONTFAMILY = new RegExp(
|
|
36
|
+
const REGEXP_FONTFAMILY = new RegExp(`\\bfont-family${PATTERN_STRING_SOME}:([^;}]+)`, 'i');
|
|
36
37
|
const REGEXP_KEYFRAMES = new RegExp(`(\\s*)@keyframes${PATTERN_STRING_MANY}([^{]+){`, 'gi');
|
|
37
38
|
const REGEXP_PROPERTY = new RegExp(`(\\s*)@property${PATTERN_STRING_MANY}(--[^\\s]+)${PATTERN_STRING_SOME}{`, 'gi');
|
|
38
|
-
const REGEXP_NTHCHILD = new RegExp(`\\(${PATTERN_STRING_SOME}([+-])?(?:(\\d*)[nN]|(0))
|
|
39
|
+
const REGEXP_NTHCHILD = new RegExp(`\\(${PATTERN_STRING_SOME}([+-])?(?:(\\d*)[nN]|(0))?${PATTERN_STRING_SOME}([+-])?${PATTERN_STRING_SOME}(\\d*)(?:${PATTERN_STRING_MANY}[oO][fF]${PATTERN_STRING_MANY}(${PATTERN_PARENINLINE})${PATTERN_STRING_SOME}\\)|${PATTERN_STRING_SOME}\\))`, 'g');
|
|
39
40
|
const REGEXP_VARIABLES_UNSAFE = new RegExp(`(\\s*)(--[^\\s:]*)\\s*:[^;}]*([;}])` + dom_1.DomWriter.PATTERN_TRAILINGSPACE, 'g');
|
|
40
41
|
const REGEXP_FONTFACE_UNSAFE = new RegExp(`(\\s*)@font-face\\s*{([^}]+)}` + dom_1.DomWriter.PATTERN_TRAILINGSPACE, 'gi');
|
|
41
|
-
const REGEXP_FONTFAMILY_UNSAFE =
|
|
42
|
+
const REGEXP_FONTFAMILY_UNSAFE = /\bfont-family\s*:([^;}]+)/i;
|
|
42
43
|
const REGEXP_KEYFRAMES_UNSAFE = /(\s*)@keyframes\s+([^{]+){/gi;
|
|
43
44
|
const REGEXP_PROPERTY_UNSAFE = /(\s*)@property\s+(--[^\s]+)\s*{/gi;
|
|
44
|
-
const REGEXP_NTHCHILD_UNSAFE =
|
|
45
|
+
const REGEXP_NTHCHILD_UNSAFE = new RegExp(`\\(\\s*([+-])?(?:(\\d*)[nN]|(0))?\\s*([+-])?\\s*(\\d*)(?:\\s+[oO][fF]\\s+(${PATTERN_PARENINLINE})\\s*\\)|\\s*\\))`, 'g');
|
|
45
46
|
const REGEXP_OBJECT_NAME = /([^[.\s]+)((?:\s*\[[^\]]+\]\s*)+)?\s*\.?\s*/g;
|
|
46
47
|
const REGEXP_OBJECT_SUBSCRIPT = /\[\s*(["'])?(.+?)\1\s*\]/g;
|
|
47
48
|
const REGEXP_TEMPLATE_LEADING = /\s*\{\{- \s*((?:[^}]|}(?!}))+?)\}\}/g;
|
|
@@ -49,7 +50,7 @@ const REGEXP_TEMPLATE_TRAILING = /\{\{((?:[^}]|}(?!}))+?)\s*? -\}\}\s*/g;
|
|
|
49
50
|
const REGEXP_URL = /(?:\b[Uu][Rr][Ll]\(|@import\s+(["'])|\b([Hh][Rr][Ee][Ff])\s*=)/g;
|
|
50
51
|
const REGEXP_URL_JS = /\bimport\(/g;
|
|
51
52
|
const REGEXP_URL_SVG = /(?:\b[Uu][Rr][Ll]\(|@import\s+(["'])|\b([Hh][Rr][Ee][Ff])\s*=)/g;
|
|
52
|
-
const REGEXP_IMAGESET =
|
|
53
|
+
const REGEXP_IMAGESET = /\b(?:-webkit-)?image-set\(/gi;
|
|
53
54
|
const REGEXP_IMAGESET_URL = /(?:^|[^(])\s*("(\s*[^)][^"]*)"|'(\s*[^)][^"]*)')\s*(?:,|$|[^)][^,]*,?)/g;
|
|
54
55
|
const REGEXP_REPLACECSS = /^@import\s+(?:url\((?:[^)]|(?<=\\)\))+\)|"(?:[^"]|(?<=\\)")+"|'(?:[^']|(?<=\\)')+')(\s*layer(?:\(([^)]*)\)|\b))?(?:\s*supports\(((?:\([^(]+\(|\([^)]+\)|\)[^)]+\)|(?:(?!\))[^(])+|(?:(?!\()[^)])+)+)\))?(.*?);?$/;
|
|
55
56
|
function removeNamespace(name, source, newline, comments) {
|
|
@@ -161,7 +162,7 @@ function addCacheItem(map, key, data, timeout) {
|
|
|
161
162
|
map.set(key, [
|
|
162
163
|
Date.now(),
|
|
163
164
|
data,
|
|
164
|
-
setTimeout(() => deleteCacheItem(map, key), timeout * 1000
|
|
165
|
+
setTimeout(() => deleteCacheItem(map, key), timeout * 1000)
|
|
165
166
|
]);
|
|
166
167
|
}
|
|
167
168
|
function deleteCacheItem(map, key) {
|
|
@@ -219,10 +220,10 @@ function hasCondition(data, condition) {
|
|
|
219
220
|
if (arg2) {
|
|
220
221
|
switch (item[0]) {
|
|
221
222
|
case 'eq':
|
|
222
|
-
valid = parseArg(arg1) == parseArg(arg2);
|
|
223
|
+
valid = parseArg(arg1) == parseArg(arg2);
|
|
223
224
|
break;
|
|
224
225
|
case 'ne':
|
|
225
|
-
valid = parseArg(arg1) != parseArg(arg2);
|
|
226
|
+
valid = parseArg(arg1) != parseArg(arg2);
|
|
226
227
|
break;
|
|
227
228
|
case 'lt':
|
|
228
229
|
valid = parseArg(arg1) < parseArg(arg2);
|
|
@@ -346,7 +347,7 @@ function createHash(host, file, hash, bufferMap) {
|
|
|
346
347
|
throw (0, types_1.errorMessage)('hash', 'Source not found', filename);
|
|
347
348
|
}
|
|
348
349
|
catch (err) {
|
|
349
|
-
host.writeFail(["Unable to read file"
|
|
350
|
+
host.writeFail(["Unable to read file", filename], err, 32);
|
|
350
351
|
}
|
|
351
352
|
}
|
|
352
353
|
function getSrcURL(parent, file) {
|
|
@@ -508,7 +509,7 @@ function transformURL(host, parent, type, source, importFile) {
|
|
|
508
509
|
}
|
|
509
510
|
}
|
|
510
511
|
if (asset.initialValue && !asset.initialValue.cacheable) {
|
|
511
|
-
parent.flags |= 16
|
|
512
|
+
parent.flags |= 16;
|
|
512
513
|
}
|
|
513
514
|
related.push(asset);
|
|
514
515
|
}
|
|
@@ -604,7 +605,7 @@ function transformURL(host, parent, type, source, importFile) {
|
|
|
604
605
|
else {
|
|
605
606
|
related.push(asset);
|
|
606
607
|
if (!(0, types_1.existsFlag)(asset.flags)) {
|
|
607
|
-
asset.flags |= 8
|
|
608
|
+
asset.flags |= 8;
|
|
608
609
|
}
|
|
609
610
|
}
|
|
610
611
|
modified = true;
|
|
@@ -764,12 +765,12 @@ function transformJs(host, file, output) {
|
|
|
764
765
|
});
|
|
765
766
|
}
|
|
766
767
|
else {
|
|
767
|
-
this.writeFail(['Unable to create script entry point', path.basename(chunkUri)], (0, types_1.errorMessage)('js', 'Element not found', chunkUri), 4
|
|
768
|
+
this.writeFail(['Unable to create script entry point', path.basename(chunkUri)], (0, types_1.errorMessage)('js', 'Element not found', chunkUri), 4);
|
|
768
769
|
}
|
|
769
770
|
}
|
|
770
771
|
}
|
|
771
772
|
catch (err) {
|
|
772
|
-
this.writeFail(["Unable to write file"
|
|
773
|
+
this.writeFail(["Unable to write file", path.basename(chunkUri)], err, 32);
|
|
773
774
|
}
|
|
774
775
|
}
|
|
775
776
|
appending?.forEach(item => item.order += order);
|
|
@@ -857,19 +858,18 @@ async function checkData(item, name, result, validate) {
|
|
|
857
858
|
if (typeof callback === 'function') {
|
|
858
859
|
try {
|
|
859
860
|
let output;
|
|
860
|
-
|
|
861
|
-
if (callback["__cjs__" /* INTERNAL.CJS */]) {
|
|
861
|
+
if (callback["__cjs__"]) {
|
|
862
862
|
output = await callback(result, item);
|
|
863
863
|
}
|
|
864
864
|
else {
|
|
865
|
-
output = await callback.apply(Document.enabled("node.process.inline"
|
|
865
|
+
output = await callback.apply(Document.enabled("node.process.inline") ? process : null, Document.enabled("node.require.inline") ? [result, item, require] : [result, item]);
|
|
866
866
|
}
|
|
867
867
|
if (validate(output)) {
|
|
868
868
|
return output;
|
|
869
869
|
}
|
|
870
870
|
}
|
|
871
871
|
catch (err) {
|
|
872
|
-
this.writeFail(["Unable to parse inline method"
|
|
872
|
+
this.writeFail(["Unable to parse inline method", name], err);
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
875
|
}
|
|
@@ -897,7 +897,6 @@ const getEndIndex = (match) => match.index + match[0].length;
|
|
|
897
897
|
const getRelativeURL = (file) => joinPath(file.moveTo, file.pathname, file.inlineFilename || file.filename) + (!file.static ? restoreSearchParams(file.url?.search) : '');
|
|
898
898
|
const errorHtml = ({ tagName, tagIndex = -1 }) => (0, types_1.errorMessage)('html', 'Location did not resolve', tagName.toLowerCase() + (tagIndex >= 0 ? ': ' + tagIndex : ''));
|
|
899
899
|
const errorDataSource = (value, hint) => (0, types_1.errorMessage)('data-source', value, hint);
|
|
900
|
-
// @ts-ignore
|
|
901
900
|
class ChromeDocument extends Document {
|
|
902
901
|
constructor() {
|
|
903
902
|
super(...arguments);
|
|
@@ -981,7 +980,7 @@ class ChromeDocument extends Document {
|
|
|
981
980
|
const { Db: db, htmlFile, assets } = instance;
|
|
982
981
|
const outHtml = htmlFile && !isIgnored(htmlFile, true);
|
|
983
982
|
if (db && await db.commit()) {
|
|
984
|
-
db.writeTimeElapsed('DB', ["Transactions were committed"
|
|
983
|
+
db.writeTimeElapsed('DB', ["Transactions were committed", db.moduleName], processing.startTime, { ...Document.LOG_STYLE_SUCCESS, type: 65536 });
|
|
985
984
|
}
|
|
986
985
|
if (instance.dataSource.length === 0 && outHtml) {
|
|
987
986
|
const incremental = htmlFile.incremental ?? this.incremental;
|
|
@@ -1024,7 +1023,7 @@ class ChromeDocument extends Document {
|
|
|
1024
1023
|
}
|
|
1025
1024
|
case 'exists':
|
|
1026
1025
|
if (hint || isHtmlOnly()) {
|
|
1027
|
-
this.formatMessage(4
|
|
1026
|
+
this.formatMessage(4, 'HTML', ['No changes detected', 'incremental: ' + incremental], hint, { ...Document.LOG_STYLE_NOTICE, messageBgColor: 'bgWhite', messageColor: 'black' });
|
|
1028
1027
|
return super.finalize.call(this, instance);
|
|
1029
1028
|
}
|
|
1030
1029
|
break;
|
|
@@ -1064,7 +1063,7 @@ class ChromeDocument extends Document {
|
|
|
1064
1063
|
for (const item of children) {
|
|
1065
1064
|
if (!items.has(item)) {
|
|
1066
1065
|
if (isWatched.call(instance, item)) {
|
|
1067
|
-
item.flags |= 8
|
|
1066
|
+
item.flags |= 8;
|
|
1068
1067
|
}
|
|
1069
1068
|
items.add(item);
|
|
1070
1069
|
const next = related.get(item);
|
|
@@ -1095,18 +1094,18 @@ class ChromeDocument extends Document {
|
|
|
1095
1094
|
this.delete(value);
|
|
1096
1095
|
}
|
|
1097
1096
|
else {
|
|
1098
|
-
instance.writeFail(["Unable to move file"
|
|
1097
|
+
instance.writeFail(["Unable to move file", instance.moduleName], (0, types_1.errorMessage)('production', path.join(this.baseDirectory, value)), { fatal: true });
|
|
1099
1098
|
}
|
|
1100
1099
|
}
|
|
1101
1100
|
}
|
|
1102
1101
|
}
|
|
1103
1102
|
}
|
|
1104
1103
|
else {
|
|
1105
|
-
instance.writeFail(["Unable to write directory"
|
|
1104
|
+
instance.writeFail(["Unable to write directory", instance.moduleName], (0, types_1.errorMessage)('production', 'Access denied', productionRelease));
|
|
1106
1105
|
}
|
|
1107
1106
|
}
|
|
1108
1107
|
else {
|
|
1109
|
-
instance.writeFail(["Unable to read directory"
|
|
1108
|
+
instance.writeFail(["Unable to read directory", instance.moduleName], (0, types_1.errorMessage)('production', 'Invalid directory', productionRelease), 32);
|
|
1110
1109
|
}
|
|
1111
1110
|
}
|
|
1112
1111
|
static sanitizeAssets(assets, exclusions = []) {
|
|
@@ -1426,7 +1425,7 @@ class ChromeDocument extends Document {
|
|
|
1426
1425
|
await instance.tryFile(buffer, { format: to, filename: file.filename, etag: file.etag }, (err, result, ext) => {
|
|
1427
1426
|
if (err) {
|
|
1428
1427
|
setFormat();
|
|
1429
|
-
this.writeFail("Unable to compress file"
|
|
1428
|
+
this.writeFail("Unable to compress file", err, 8);
|
|
1430
1429
|
}
|
|
1431
1430
|
else if (result) {
|
|
1432
1431
|
if (ext) {
|
|
@@ -1440,7 +1439,7 @@ class ChromeDocument extends Document {
|
|
|
1440
1439
|
host.replace(file, output);
|
|
1441
1440
|
}
|
|
1442
1441
|
else {
|
|
1443
|
-
this.writeFail("Unable to write file"
|
|
1442
|
+
this.writeFail("Unable to write file", error, 32);
|
|
1444
1443
|
}
|
|
1445
1444
|
});
|
|
1446
1445
|
}
|
|
@@ -1598,12 +1597,14 @@ class ChromeDocument extends Document {
|
|
|
1598
1597
|
}
|
|
1599
1598
|
for (const placeholder in importMap) {
|
|
1600
1599
|
const items = importMap[placeholder];
|
|
1600
|
+
let found;
|
|
1601
1601
|
for (let i = 0, length = items.length; i < length; ++i) {
|
|
1602
1602
|
const index = code.indexOf(placeholder);
|
|
1603
1603
|
if (index !== -1) {
|
|
1604
1604
|
const { uri, original, type, dynamic } = items[i];
|
|
1605
|
+
const hosted = type === 'css';
|
|
1605
1606
|
let value;
|
|
1606
|
-
if (
|
|
1607
|
+
if (hosted) {
|
|
1607
1608
|
const asset = this.host?.findAsset(uri);
|
|
1608
1609
|
if (asset) {
|
|
1609
1610
|
const [relativeUrl, sameDir] = getSrcURL.call(this, bundleMain || file, asset);
|
|
@@ -1615,11 +1616,12 @@ class ChromeDocument extends Document {
|
|
|
1615
1616
|
else if (!(dynamic && file.imported !== false)) {
|
|
1616
1617
|
value = this.findSourceRoot(uri);
|
|
1617
1618
|
}
|
|
1618
|
-
if (!value) {
|
|
1619
|
+
if (!value || !hosted && !Document.isPath(value)) {
|
|
1619
1620
|
if (i < length - 1) {
|
|
1621
|
+
found || (found = value);
|
|
1620
1622
|
continue;
|
|
1621
1623
|
}
|
|
1622
|
-
value = original;
|
|
1624
|
+
value = found || original;
|
|
1623
1625
|
}
|
|
1624
1626
|
code = spliceString(code, index, index + placeholder.length, value);
|
|
1625
1627
|
modified = true;
|
|
@@ -1750,7 +1752,7 @@ class ChromeDocument extends Document {
|
|
|
1750
1752
|
item.sourceUTF8 = output;
|
|
1751
1753
|
}
|
|
1752
1754
|
catch (err) {
|
|
1753
|
-
host.writeFail(["Unable to write file"
|
|
1755
|
+
host.writeFail(["Unable to write file", path.basename(item.localUri)], err, 32);
|
|
1754
1756
|
}
|
|
1755
1757
|
}
|
|
1756
1758
|
}
|
|
@@ -1952,7 +1954,7 @@ class ChromeDocument extends Document {
|
|
|
1952
1954
|
host.removeAsset(item);
|
|
1953
1955
|
}
|
|
1954
1956
|
catch (err) {
|
|
1955
|
-
this.writeFail(["Unable to read file"
|
|
1957
|
+
this.writeFail(["Unable to read file", item.filename], err, { type: 32, startTime });
|
|
1956
1958
|
return false;
|
|
1957
1959
|
}
|
|
1958
1960
|
}
|
|
@@ -2135,7 +2137,7 @@ class ChromeDocument extends Document {
|
|
|
2135
2137
|
const { moduleName, config } = this;
|
|
2136
2138
|
const htmlFile = this.htmlFile;
|
|
2137
2139
|
const localUri = htmlFile.localUri;
|
|
2138
|
-
this.formatMessage(4
|
|
2140
|
+
this.formatMessage(4, 'HTML', ['Rewriting content...', path.dirname(localUri)]);
|
|
2139
2141
|
let source = host.getUTF8String(htmlFile, localUri), output;
|
|
2140
2142
|
const domBase = new dom_1.DomWriter(moduleName, source, this.elements, { normalize: config.normalizeHtmlOutput, stripComments: config.stripCommentsAndCDATA, ignoreTagGroup: config.ignoreServerCodeBlocks, escapeEntities: config.escapeReservedCharacters });
|
|
2141
2143
|
if (config.useUnsafeHtmlReplace) {
|
|
@@ -2161,7 +2163,7 @@ class ChromeDocument extends Document {
|
|
|
2161
2163
|
const domElement = new dom_1.HtmlElement(moduleName, element, item.attributes);
|
|
2162
2164
|
domElement.remove = true;
|
|
2163
2165
|
if (!domBase.write(domElement)) {
|
|
2164
|
-
this.writeFail('Unable to exclude HTML element', errorHtml(element), 4
|
|
2166
|
+
this.writeFail('Unable to exclude HTML element', errorHtml(element), 4);
|
|
2165
2167
|
}
|
|
2166
2168
|
}
|
|
2167
2169
|
}
|
|
@@ -2201,7 +2203,7 @@ class ChromeDocument extends Document {
|
|
|
2201
2203
|
domBase.errors.forEach(err => this.addLog(types_1.STATUS_TYPE.WARN, 'dom-writer -> ' + err.message, timeStamp));
|
|
2202
2204
|
}
|
|
2203
2205
|
if (domBase.failCount > 0) {
|
|
2204
|
-
this.writeFail(['Unable to update document', moduleName], (0, types_1.errorMessage)('html', 'DOM rewrite failed', domBase.failCount + ' errors'), { type: 4
|
|
2206
|
+
this.writeFail(['Unable to update document', moduleName], (0, types_1.errorMessage)('html', 'DOM rewrite failed', domBase.failCount + ' errors'), { type: 4, startTime });
|
|
2205
2207
|
}
|
|
2206
2208
|
else {
|
|
2207
2209
|
this.writeTimeProcess('html', `dom-writer (${domBase.modifyCount} modified) -> ` + path.basename(localUri), startTime);
|
|
@@ -2212,7 +2214,7 @@ class ChromeDocument extends Document {
|
|
|
2212
2214
|
for (const name in data) {
|
|
2213
2215
|
message.push(name + `(${data[name]})`);
|
|
2214
2216
|
}
|
|
2215
|
-
this.formatMessage(65536
|
|
2217
|
+
this.formatMessage(65536, 'DB', ['Cache statistics', cacheMiss.length + ' missed'], message.join(' - '), { ...Document.LOG_STYLE_NOTICE, hintBold: true });
|
|
2216
2218
|
}
|
|
2217
2219
|
}
|
|
2218
2220
|
htmlFile.modified = true;
|
|
@@ -2328,7 +2330,7 @@ class ChromeDocument extends Document {
|
|
|
2328
2330
|
}
|
|
2329
2331
|
}
|
|
2330
2332
|
if (!domBase.write(domElement)) {
|
|
2331
|
-
this.writeFail(inlineContent ? 'Inline tag replacement' : 'Element attribute replacement', errorHtml(element), { type: 4
|
|
2333
|
+
this.writeFail(inlineContent ? 'Inline tag replacement' : 'Element attribute replacement', errorHtml(element), { type: 4, startTime });
|
|
2332
2334
|
delete item.inlineUrlCloud;
|
|
2333
2335
|
}
|
|
2334
2336
|
else if (inlineContent) {
|
|
@@ -2352,7 +2354,7 @@ class ChromeDocument extends Document {
|
|
|
2352
2354
|
if (item.removeEmpty || item.type === 'display') {
|
|
2353
2355
|
(element || (element = new dom_1.HtmlElement(moduleName, item.element))).remove = true;
|
|
2354
2356
|
if (!domBase.write(element)) {
|
|
2355
|
-
this.writeFail('Unable to remove element', errorHtml(item.element), { type: 4
|
|
2357
|
+
this.writeFail('Unable to remove element', errorHtml(item.element), { type: 4, startTime });
|
|
2356
2358
|
}
|
|
2357
2359
|
}
|
|
2358
2360
|
};
|
|
@@ -2360,7 +2362,7 @@ class ChromeDocument extends Document {
|
|
|
2360
2362
|
removeElement(item);
|
|
2361
2363
|
const pkg = getPackageName(err);
|
|
2362
2364
|
if (!(pkg && this.checkPackage(err, pkg))) {
|
|
2363
|
-
this.writeFail(["Invalid credentials"
|
|
2365
|
+
this.writeFail(["Invalid credentials", item.source], err);
|
|
2364
2366
|
}
|
|
2365
2367
|
};
|
|
2366
2368
|
const checkObject = (item, data) => {
|
|
@@ -2390,7 +2392,7 @@ class ChromeDocument extends Document {
|
|
|
2390
2392
|
}
|
|
2391
2393
|
catch (err) {
|
|
2392
2394
|
this.abort(item.source);
|
|
2393
|
-
this.checkPackage(err, pkg, ["Unable to filter results"
|
|
2395
|
+
this.checkPackage(err, pkg, ["Unable to filter results", item.source]);
|
|
2394
2396
|
}
|
|
2395
2397
|
}
|
|
2396
2398
|
}
|
|
@@ -2413,7 +2415,7 @@ class ChromeDocument extends Document {
|
|
|
2413
2415
|
(batchMap[key] || (batchMap[key] = [])).push(item);
|
|
2414
2416
|
}
|
|
2415
2417
|
else {
|
|
2416
|
-
errorCredential(item, (0, types_1.errorValue)("Cloud module not installed"
|
|
2418
|
+
errorCredential(item, (0, types_1.errorValue)("Cloud module not installed", service));
|
|
2417
2419
|
}
|
|
2418
2420
|
break;
|
|
2419
2421
|
}
|
|
@@ -2446,7 +2448,7 @@ class ChromeDocument extends Document {
|
|
|
2446
2448
|
}
|
|
2447
2449
|
}
|
|
2448
2450
|
else {
|
|
2449
|
-
errorCredential(item, (0, types_1.errorValue)(db ? "Database provider not found"
|
|
2451
|
+
errorCredential(item, (0, types_1.errorValue)(db ? "Database provider not found" : "Db module not installed", type));
|
|
2450
2452
|
}
|
|
2451
2453
|
break;
|
|
2452
2454
|
}
|
|
@@ -2463,7 +2465,7 @@ class ChromeDocument extends Document {
|
|
|
2463
2465
|
const errorClient = (item, reason) => {
|
|
2464
2466
|
removeElement(item);
|
|
2465
2467
|
if (reason) {
|
|
2466
|
-
this.writeFail(["Unable to configure client"
|
|
2468
|
+
this.writeFail(["Unable to configure client", item.source], reason);
|
|
2467
2469
|
}
|
|
2468
2470
|
reject();
|
|
2469
2471
|
};
|
|
@@ -2505,7 +2507,7 @@ class ChromeDocument extends Document {
|
|
|
2505
2507
|
}
|
|
2506
2508
|
catch (err) {
|
|
2507
2509
|
this.abort(type);
|
|
2508
|
-
this.writeFail(["Unable to read file"
|
|
2510
|
+
this.writeFail(["Unable to read file", path.basename(location)], err, { type: 32, startTime });
|
|
2509
2511
|
errorRemove(current);
|
|
2510
2512
|
return;
|
|
2511
2513
|
}
|
|
@@ -2541,7 +2543,7 @@ class ChromeDocument extends Document {
|
|
|
2541
2543
|
}
|
|
2542
2544
|
catch (err) {
|
|
2543
2545
|
this.abort(type);
|
|
2544
|
-
this.writeFail(["Unable to download file"
|
|
2546
|
+
this.writeFail(["Unable to download file", target], err, { type: 1024, startTime });
|
|
2545
2547
|
errorRemove(current);
|
|
2546
2548
|
return;
|
|
2547
2549
|
}
|
|
@@ -2570,7 +2572,7 @@ class ChromeDocument extends Document {
|
|
|
2570
2572
|
}
|
|
2571
2573
|
catch (err) {
|
|
2572
2574
|
this.abort(type);
|
|
2573
|
-
this.writeFail(["Unable to read file"
|
|
2575
|
+
this.writeFail(["Unable to read file", path.basename(pathname)], err, { type: 32, startTime });
|
|
2574
2576
|
errorRemove(current);
|
|
2575
2577
|
return;
|
|
2576
2578
|
}
|
|
@@ -2584,7 +2586,7 @@ class ChromeDocument extends Document {
|
|
|
2584
2586
|
}
|
|
2585
2587
|
catch (err) {
|
|
2586
2588
|
this.abort(type);
|
|
2587
|
-
this.writeFail(['Unable to parse data source', format], err, { type: 4
|
|
2589
|
+
this.writeFail(['Unable to parse data source', format], err, { type: 4, startTime });
|
|
2588
2590
|
errorRemove(current);
|
|
2589
2591
|
return;
|
|
2590
2592
|
}
|
|
@@ -2660,13 +2662,12 @@ class ChromeDocument extends Document {
|
|
|
2660
2662
|
if (params && this.settingsOf(type, 'coerce') === true) {
|
|
2661
2663
|
(0, types_1.coerceObject)(params);
|
|
2662
2664
|
}
|
|
2663
|
-
|
|
2664
|
-
if (getData["__cjs__" /* INTERNAL.CJS */]) {
|
|
2665
|
+
if (getData["__cjs__"]) {
|
|
2665
2666
|
data = await getData(params);
|
|
2666
2667
|
}
|
|
2667
2668
|
else {
|
|
2668
|
-
const thisArg = Document.enabled("node.process.inline"
|
|
2669
|
-
const inline = Document.enabled("node.require.inline"
|
|
2669
|
+
const thisArg = Document.enabled("node.process.inline") ? process : null;
|
|
2670
|
+
const inline = Document.enabled("node.require.inline");
|
|
2670
2671
|
const args = [params];
|
|
2671
2672
|
if (getData.toString().startsWith('async')) {
|
|
2672
2673
|
if (inline) {
|
|
@@ -2688,7 +2689,7 @@ class ChromeDocument extends Document {
|
|
|
2688
2689
|
}
|
|
2689
2690
|
catch (err) {
|
|
2690
2691
|
this.abort(type);
|
|
2691
|
-
this.writeFail(['Unable to retrieve data source', hint], err, { type: 4
|
|
2692
|
+
this.writeFail(['Unable to retrieve data source', hint], err, { type: 4, startTime });
|
|
2692
2693
|
errorRemove(current);
|
|
2693
2694
|
return;
|
|
2694
2695
|
}
|
|
@@ -2774,12 +2775,12 @@ class ChromeDocument extends Document {
|
|
|
2774
2775
|
}
|
|
2775
2776
|
}
|
|
2776
2777
|
else {
|
|
2777
|
-
throw (0, types_1.errorMessage)(type, "File not found"
|
|
2778
|
+
throw (0, types_1.errorMessage)(type, "File not found", query);
|
|
2778
2779
|
}
|
|
2779
2780
|
}
|
|
2780
2781
|
catch (err) {
|
|
2781
2782
|
this.abort(type);
|
|
2782
|
-
this.writeFail(["Unable to read file"
|
|
2783
|
+
this.writeFail(["Unable to read file", pathname ? path.basename(pathname) : query], err, { startTime });
|
|
2783
2784
|
errorRemove(current);
|
|
2784
2785
|
return;
|
|
2785
2786
|
}
|
|
@@ -2816,7 +2817,7 @@ class ChromeDocument extends Document {
|
|
|
2816
2817
|
this.abort(type);
|
|
2817
2818
|
}
|
|
2818
2819
|
if (err) {
|
|
2819
|
-
this.writeFail(["Unable to execute query"
|
|
2820
|
+
this.writeFail(["Unable to execute query", message || "Unknown"], err instanceof Error ? errors = err : err, { type: 65536, startTime });
|
|
2820
2821
|
}
|
|
2821
2822
|
return this.aborted;
|
|
2822
2823
|
};
|
|
@@ -2830,7 +2831,7 @@ class ChromeDocument extends Document {
|
|
|
2830
2831
|
}
|
|
2831
2832
|
break;
|
|
2832
2833
|
}
|
|
2833
|
-
errorRemove(current, errorDataSource('Not found', type || "Unknown"
|
|
2834
|
+
errorRemove(current, errorDataSource('Not found', type || "Unknown"));
|
|
2834
2835
|
return;
|
|
2835
2836
|
}
|
|
2836
2837
|
if (this.aborted) {
|
|
@@ -2894,7 +2895,7 @@ class ChromeDocument extends Document {
|
|
|
2894
2895
|
setCacheData.call(this, item, item.value, pathname, cacheData, true);
|
|
2895
2896
|
}
|
|
2896
2897
|
catch (err) {
|
|
2897
|
-
this.writeFail(["Unable to read file"
|
|
2898
|
+
this.writeFail(["Unable to read file", path.basename(pathname)], err, { type: 32, startTime });
|
|
2898
2899
|
errors = true;
|
|
2899
2900
|
}
|
|
2900
2901
|
}
|
|
@@ -2937,7 +2938,7 @@ class ChromeDocument extends Document {
|
|
|
2937
2938
|
const literal = segment.trim();
|
|
2938
2939
|
if (literal[0] === '`' && literal[literal.length - 1] === '`') {
|
|
2939
2940
|
if (!this.hasEval('function')) {
|
|
2940
|
-
errors = (0, types_1.errorMessage)('eval', "Unsupported access"
|
|
2941
|
+
errors = (0, types_1.errorMessage)('eval', "Unsupported access", 'function');
|
|
2941
2942
|
continue;
|
|
2942
2943
|
}
|
|
2943
2944
|
try {
|
|
@@ -2958,7 +2959,7 @@ class ChromeDocument extends Document {
|
|
|
2958
2959
|
else {
|
|
2959
2960
|
const pattern = /\$\{\s*([^\s}]+)\s*\}/g;
|
|
2960
2961
|
while (match = pattern.exec(segment)) {
|
|
2961
|
-
segment = replaceMatch(match, segment, match[1] === "__index__"
|
|
2962
|
+
segment = replaceMatch(match, segment, match[1] === "__index__" && !(0, types_1.isObject)(row) ? (j + 1).toString() : valueAsString(getObjectValue(row, match[1]), ', '), pattern);
|
|
2962
2963
|
}
|
|
2963
2964
|
}
|
|
2964
2965
|
value += trimTemplate(segment);
|
|
@@ -3153,37 +3154,37 @@ class ChromeDocument extends Document {
|
|
|
3153
3154
|
default:
|
|
3154
3155
|
removeElement(item, domElement);
|
|
3155
3156
|
if (length === 1) {
|
|
3156
|
-
reject(errorDataSource('Invalid action', item.type || "Unknown"
|
|
3157
|
+
reject(errorDataSource('Invalid action', item.type || "Unknown"));
|
|
3157
3158
|
return;
|
|
3158
3159
|
}
|
|
3159
3160
|
break invalid;
|
|
3160
3161
|
}
|
|
3161
3162
|
if (!domBase.write(domElement) || errors) {
|
|
3162
|
-
this.writeFail(item.type === 'display' ? domElement.remove ? errors ? 'Element was removed with errors' : 'Unable to remove element' : 'Unable to determine display conditional' : 'Unable to replace ' + item.type, errors instanceof Error ? errors : errorHtml(element), { type: 4
|
|
3163
|
+
this.writeFail(item.type === 'display' ? domElement.remove ? errors ? 'Element was removed with errors' : 'Unable to remove element' : 'Unable to determine display conditional' : 'Unable to replace ' + item.type, errors instanceof Error ? errors : errorHtml(element), { type: 4, startTime });
|
|
3163
3164
|
}
|
|
3164
3165
|
}
|
|
3165
3166
|
}
|
|
3166
3167
|
else {
|
|
3167
3168
|
if (!empty && item.type !== 'display' || item.transactionFail) {
|
|
3168
3169
|
const emptyResponse = (value, service = item.source) => {
|
|
3169
|
-
value || (value = "Unknown"
|
|
3170
|
+
value || (value = "Unknown");
|
|
3170
3171
|
return errors instanceof Error ? (0, types_1.errorMessage)(service, value, errors.message) : errorDataSource(service + ' -> Empty', value);
|
|
3171
3172
|
};
|
|
3172
3173
|
switch (item.source) {
|
|
3173
3174
|
case 'cloud': {
|
|
3174
3175
|
const { service, table, id, query } = item;
|
|
3175
3176
|
const queryString = (table ? 'table=' + table : '') + (id || query ? (table ? ';' : '') + (id ? 'id=' + id : 'query=' + asString(query)) : '');
|
|
3176
|
-
(cloud || this).formatFail(64
|
|
3177
|
+
(cloud || this).formatFail(64, service, ["Unable to execute query", queryString], emptyResponse(queryString, service), { ...Cloud.LOG_CLOUD_FAIL, startTime });
|
|
3177
3178
|
break;
|
|
3178
3179
|
}
|
|
3179
3180
|
case 'uri': {
|
|
3180
3181
|
const { uri, format = uri && path.extname(uri).substring(1) } = item;
|
|
3181
|
-
this.formatFail(4
|
|
3182
|
+
this.formatFail(4, format || 'URI', ['No records were found', uri], emptyResponse(uri), { startTime });
|
|
3182
3183
|
break;
|
|
3183
3184
|
}
|
|
3184
3185
|
case 'local': {
|
|
3185
3186
|
const { pathname, format = pathname && path.extname(pathname).substring(1) } = item;
|
|
3186
|
-
this.formatFail(4
|
|
3187
|
+
this.formatFail(4, format || 'LOCAL', ['No records were found', pathname], emptyResponse(pathname), { startTime });
|
|
3187
3188
|
break;
|
|
3188
3189
|
}
|
|
3189
3190
|
case 'export': {
|
|
@@ -3192,7 +3193,7 @@ class ChromeDocument extends Document {
|
|
|
3192
3193
|
if (typeof target === 'function') {
|
|
3193
3194
|
target = target.name;
|
|
3194
3195
|
}
|
|
3195
|
-
this.formatFail(4
|
|
3196
|
+
this.formatFail(4, 'EXPORT', ['No records were retrieved', target], emptyResponse(target), { startTime });
|
|
3196
3197
|
break;
|
|
3197
3198
|
}
|
|
3198
3199
|
}
|
|
@@ -3244,7 +3245,7 @@ class ChromeDocument extends Document {
|
|
|
3244
3245
|
throw (0, types_1.errorMessage)('hash', 'Source not found', item.filename);
|
|
3245
3246
|
}
|
|
3246
3247
|
catch (err) {
|
|
3247
|
-
this.writeFail(["Unable to read file"
|
|
3248
|
+
this.writeFail(["Unable to read file", item.filename], err, { type: 32, startTime });
|
|
3248
3249
|
}
|
|
3249
3250
|
default:
|
|
3250
3251
|
if (algorithm) {
|
|
@@ -3272,7 +3273,7 @@ class ChromeDocument extends Document {
|
|
|
3272
3273
|
const parseSelector = (value) => {
|
|
3273
3274
|
const items = [];
|
|
3274
3275
|
const revised = value.replace(useUnsafeCssReplace ? REGEXP_NTHCHILD_UNSAFE : REGEXP_NTHCHILD, (...capture) => {
|
|
3275
|
-
return '`%' + (items.push('\\(' + getStringSome() + (capture[1] === '-' ? '\\x2d' : '\\x2b?') + (capture[2] || '[01]?') + (capture[3] === '0' ? !capture[1] && !capture[2] && !capture[4] && !capture[5] ? '[+-]?0[nN]?' : '0' : '[nN]') + getStringSome() + (capture[5] ? (capture[4] === '-' ? '\\x2d' : '\\x2b') + getStringSome() + capture[5] : `(?:[+-]${getStringSome()}0)?`) + getStringSome() + '\\)') - 1) + '`';
|
|
3276
|
+
return '`%' + (items.push('\\(' + getStringSome() + (capture[1] === '-' ? '\\x2d' : '\\x2b?') + (capture[2] || '[01]?') + (capture[3] === '0' ? !capture[1] && !capture[2] && !capture[4] && !capture[5] ? '[+-]?0[nN]?' : '0' : '[nN]') + getStringSome() + (capture[5] ? (capture[4] === '-' ? '\\x2d' : '\\x2b') + getStringSome() + capture[5] : `(?:[+-]${getStringSome()}0)?`) + (capture[6] ? getStringMany() + '[oO][fF]' + getStringMany() + capture[6].trim() : '') + getStringSome() + '\\)') - 1) + '`';
|
|
3276
3277
|
});
|
|
3277
3278
|
let selector = '';
|
|
3278
3279
|
for (let i = 0, length = revised.length, casing = false, attr = false, quote = false; i < length; i++) {
|
|
@@ -3442,7 +3443,7 @@ class ChromeDocument extends Document {
|
|
|
3442
3443
|
pattern.lastIndex = 0;
|
|
3443
3444
|
};
|
|
3444
3445
|
replaceBracket(REGEXP_COMMENT);
|
|
3445
|
-
replaceBracket(
|
|
3446
|
+
replaceBracket(REGEXP_QUOTEDVALUE);
|
|
3446
3447
|
const values = (0, util_1.splitEnclosing)(current, /\burl/gi);
|
|
3447
3448
|
for (let i = 0, length = values.length; i < length; ++i) {
|
|
3448
3449
|
const seg = values[i];
|
|
@@ -3683,7 +3684,11 @@ class ChromeDocument extends Document {
|
|
|
3683
3684
|
return (_a = this.module).settings || (_a.settings = {});
|
|
3684
3685
|
}
|
|
3685
3686
|
}
|
|
3686
|
-
ChromeDocument.INTERNAL_ASSIGNUUID = "__assign__"
|
|
3687
|
-
ChromeDocument.INTERNAL_SERVERROOT = "__serverroot__"
|
|
3687
|
+
ChromeDocument.INTERNAL_ASSIGNUUID = "__assign__";
|
|
3688
|
+
ChromeDocument.INTERNAL_SERVERROOT = "__serverroot__";
|
|
3689
|
+
exports.default = ChromeDocument;
|
|
3688
3690
|
|
|
3689
|
-
|
|
3691
|
+
if (exports.default) {
|
|
3692
|
+
module.exports = exports.default;
|
|
3693
|
+
module.exports.default = exports.default;
|
|
3694
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/chrome",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Chrome document constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/anpham6/pi-r.git",
|
|
11
|
+
"url": "git+https://github.com/anpham6/pi-r.git",
|
|
12
12
|
"directory": "src/module/chrome"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/cloud": "^0.7.
|
|
24
|
-
"@e-mc/core": "^0.7.
|
|
25
|
-
"@e-mc/document": "^0.7.
|
|
26
|
-
"@e-mc/types": "^0.7.
|
|
23
|
+
"@e-mc/cloud": "^0.7.2",
|
|
24
|
+
"@e-mc/core": "^0.7.2",
|
|
25
|
+
"@e-mc/document": "^0.7.2",
|
|
26
|
+
"@e-mc/types": "^0.7.2"
|
|
27
27
|
}
|
|
28
28
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -98,12 +98,12 @@ export interface IChromeDocument<T extends IFileManager<U>, U extends DocumentAs
|
|
|
98
98
|
formatMap?: ObjectMap<FormatUri>;
|
|
99
99
|
setElementSrc(asset: U, element: IXmlElement, value: string): void;
|
|
100
100
|
findDataValue(name: string): Undef<string>;
|
|
101
|
-
setInlinedAttributes(processing: FinalizeProcessing<T>): void;
|
|
102
|
-
applyTransforms(processing: FinalizeProcessing<T>): Promise<void>;
|
|
103
|
-
rewriteHtml(processing: FinalizeProcessing<T>): Promise<void>;
|
|
104
|
-
setElementAttributes(processing: FinalizeProcessing<T>, domBase: IDomWriter): Promise<void>;
|
|
105
|
-
applyDataSource(processing: FinalizeProcessing<T>, domBase: IDomWriter): Promise<void>;
|
|
106
|
-
setProductionAttributes(processing: FinalizeProcessing<T>): void;
|
|
101
|
+
setInlinedAttributes(processing: FinalizeProcessing<T, U>): void;
|
|
102
|
+
applyTransforms(processing: FinalizeProcessing<T, U>): Promise<void>;
|
|
103
|
+
rewriteHtml(processing: FinalizeProcessing<T, U>): Promise<void>;
|
|
104
|
+
setElementAttributes(processing: FinalizeProcessing<T, U>, domBase: IDomWriter): Promise<void>;
|
|
105
|
+
applyDataSource(processing: FinalizeProcessing<T, U>, domBase: IDomWriter): Promise<void>;
|
|
106
|
+
setProductionAttributes(processing: FinalizeProcessing<T, U>): void;
|
|
107
107
|
removeUnusedStyles(source: string, options?: UserConfig): Undef<string>;
|
|
108
108
|
removeServerRoot(value: string): string;
|
|
109
109
|
replaceContent(source: string, match: RegExpExecArray | string, mimeType?: string): Undef<string>;
|