hot-updater 0.16.3 → 0.16.4
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/dist/config.cjs +5 -3
- package/dist/index.cjs +207 -285
- package/dist/index.js +192 -277
- package/dist/plugins/babel.cjs +109 -127
- package/dist/plugins/babel.js +102 -124
- package/package.json +4 -4
package/dist/plugins/babel.cjs
CHANGED
|
@@ -118,15 +118,14 @@ var __webpack_modules__ = {
|
|
|
118
118
|
++pos;
|
|
119
119
|
++curLine;
|
|
120
120
|
lineStart = pos;
|
|
121
|
-
} else if (10 === ch || 13 === ch) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
} else ++pos;
|
|
121
|
+
} else if (10 === ch || 13 === ch) if ("template" === type) {
|
|
122
|
+
out += input.slice(chunkStart, pos) + "\n";
|
|
123
|
+
++pos;
|
|
124
|
+
if (13 === ch && 10 === input.charCodeAt(pos)) ++pos;
|
|
125
|
+
++curLine;
|
|
126
|
+
chunkStart = lineStart = pos;
|
|
127
|
+
} else errors.unterminated(initialPos, initialLineStart, initialCurLine);
|
|
128
|
+
else ++pos;
|
|
130
129
|
}
|
|
131
130
|
return {
|
|
132
131
|
pos,
|
|
@@ -200,10 +199,8 @@ var __webpack_modules__ = {
|
|
|
200
199
|
}
|
|
201
200
|
pos += octalStr.length - 1;
|
|
202
201
|
const next = input.charCodeAt(pos);
|
|
203
|
-
if ("0" !== octalStr || 56 === next || 57 === next)
|
|
204
|
-
|
|
205
|
-
errors.strictNumericEscape(startPos, lineStart, curLine);
|
|
206
|
-
}
|
|
202
|
+
if ("0" !== octalStr || 56 === next || 57 === next) if (inTemplate) return res(null);
|
|
203
|
+
else errors.strictNumericEscape(startPos, lineStart, curLine);
|
|
207
204
|
return res(String.fromCharCode(octal));
|
|
208
205
|
}
|
|
209
206
|
return res(String.fromCharCode(ch));
|
|
@@ -213,10 +210,8 @@ var __webpack_modules__ = {
|
|
|
213
210
|
const initialPos = pos;
|
|
214
211
|
let n;
|
|
215
212
|
({ n, pos } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));
|
|
216
|
-
if (null === n)
|
|
217
|
-
|
|
218
|
-
else pos = initialPos - 1;
|
|
219
|
-
}
|
|
213
|
+
if (null === n) if (throwOnInvalid) errors.invalidEscapeSequence(initialPos, lineStart, curLine);
|
|
214
|
+
else pos = initialPos - 1;
|
|
220
215
|
return {
|
|
221
216
|
code: n,
|
|
222
217
|
pos
|
|
@@ -253,17 +248,15 @@ var __webpack_modules__ = {
|
|
|
253
248
|
continue;
|
|
254
249
|
}
|
|
255
250
|
val = code >= 97 ? code - 97 + 10 : code >= 65 ? code - 65 + 10 : _isDigit(code) ? code - 48 : 1 / 0;
|
|
256
|
-
if (val >= radix) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
} else break;
|
|
266
|
-
}
|
|
251
|
+
if (val >= radix) if (val <= 9 && bailOnError) return {
|
|
252
|
+
n: null,
|
|
253
|
+
pos
|
|
254
|
+
};
|
|
255
|
+
else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) val = 0;
|
|
256
|
+
else if (forceLen) {
|
|
257
|
+
val = 0;
|
|
258
|
+
invalid = true;
|
|
259
|
+
} else break;
|
|
267
260
|
++pos;
|
|
268
261
|
total = total * radix + val;
|
|
269
262
|
}
|
|
@@ -283,13 +276,11 @@ var __webpack_modules__ = {
|
|
|
283
276
|
++pos;
|
|
284
277
|
({ code, pos } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
|
|
285
278
|
++pos;
|
|
286
|
-
if (null !== code && code > 0x10ffff) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
errors.invalidCodePoint(pos, lineStart, curLine);
|
|
292
|
-
}
|
|
279
|
+
if (null !== code && code > 0x10ffff) if (!throwOnInvalid) return {
|
|
280
|
+
code: null,
|
|
281
|
+
pos
|
|
282
|
+
};
|
|
283
|
+
else errors.invalidCodePoint(pos, lineStart, curLine);
|
|
293
284
|
} else ({ code, pos } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
|
|
294
285
|
return {
|
|
295
286
|
code,
|
|
@@ -7211,15 +7202,11 @@ var __webpack_modules__ = {
|
|
|
7211
7202
|
if (hasOwn(node, "typeAnnotation")) newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc, commentsCache) : node.typeAnnotation;
|
|
7212
7203
|
if (hasOwn(node, "decorators")) newNode.decorators = deep ? cloneIfNodeOrArray(node.decorators, true, withoutLoc, commentsCache) : node.decorators;
|
|
7213
7204
|
} else if (hasOwn(_index.NODE_FIELDS, type)) {
|
|
7214
|
-
for (const field of Object.keys(_index.NODE_FIELDS[type]))if (hasOwn(node, field))
|
|
7215
|
-
|
|
7216
|
-
else newNode[field] = node[field];
|
|
7217
|
-
}
|
|
7205
|
+
for (const field of Object.keys(_index.NODE_FIELDS[type]))if (hasOwn(node, field)) if (deep) newNode[field] = (0, _index2.isFile)(node) && "comments" === field ? maybeCloneComments(node.comments, deep, withoutLoc, commentsCache) : cloneIfNodeOrArray(node[field], true, withoutLoc, commentsCache);
|
|
7206
|
+
else newNode[field] = node[field];
|
|
7218
7207
|
} else throw new Error(`Unknown node type: "${type}"`);
|
|
7219
|
-
if (hasOwn(node, "loc"))
|
|
7220
|
-
|
|
7221
|
-
else newNode.loc = node.loc;
|
|
7222
|
-
}
|
|
7208
|
+
if (hasOwn(node, "loc")) if (withoutLoc) newNode.loc = null;
|
|
7209
|
+
else newNode.loc = node.loc;
|
|
7223
7210
|
if (hasOwn(node, "leadingComments")) newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc, commentsCache);
|
|
7224
7211
|
if (hasOwn(node, "innerComments")) newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc, commentsCache);
|
|
7225
7212
|
if (hasOwn(node, "trailingComments")) newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc, commentsCache);
|
|
@@ -7279,10 +7266,9 @@ var __webpack_modules__ = {
|
|
|
7279
7266
|
function addComments(node, type, comments) {
|
|
7280
7267
|
if (!comments || !node) return node;
|
|
7281
7268
|
const key = `${type}Comments`;
|
|
7282
|
-
if (node[key])
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
} else node[key] = comments;
|
|
7269
|
+
if (node[key]) if ("leading" === type) node[key] = comments.concat(node[key]);
|
|
7270
|
+
else node[key].push(...comments);
|
|
7271
|
+
else node[key] = comments;
|
|
7286
7272
|
return node;
|
|
7287
7273
|
}
|
|
7288
7274
|
},
|
|
@@ -7724,10 +7710,8 @@ var __webpack_modules__ = {
|
|
|
7724
7710
|
newType = "FunctionDeclaration";
|
|
7725
7711
|
} else if ((0, _index.isAssignmentExpression)(node)) return (0, _index2.expressionStatement)(node);
|
|
7726
7712
|
if (mustHaveId && !node.id) newType = false;
|
|
7727
|
-
if (!newType)
|
|
7728
|
-
|
|
7729
|
-
throw new Error(`cannot turn ${node.type} to a statement`);
|
|
7730
|
-
}
|
|
7713
|
+
if (!newType) if (ignore) return false;
|
|
7714
|
+
else throw new Error(`cannot turn ${node.type} to a statement`);
|
|
7731
7715
|
node.type = newType;
|
|
7732
7716
|
return node;
|
|
7733
7717
|
}
|
|
@@ -12364,10 +12348,7 @@ var __webpack_modules__ = {
|
|
|
12364
12348
|
}
|
|
12365
12349
|
function assertNodeType(...types) {
|
|
12366
12350
|
function validate(node, key, val) {
|
|
12367
|
-
for (const type of types)if ((0, _is.default)(type, val))
|
|
12368
|
-
(0, _validate.validateChild)(node, key, val);
|
|
12369
|
-
return;
|
|
12370
|
-
}
|
|
12351
|
+
for (const type of types)if ((0, _is.default)(type, val)) return void (0, _validate.validateChild)(node, key, val);
|
|
12371
12352
|
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(null == val ? void 0 : val.type)}`);
|
|
12372
12353
|
}
|
|
12373
12354
|
validate.oneOfNodeTypes = types;
|
|
@@ -12375,10 +12356,7 @@ var __webpack_modules__ = {
|
|
|
12375
12356
|
}
|
|
12376
12357
|
function assertNodeOrValueType(...types) {
|
|
12377
12358
|
function validate(node, key, val) {
|
|
12378
|
-
for (const type of types)if (getType(val) === type || (0, _is.default)(type, val))
|
|
12379
|
-
(0, _validate.validateChild)(node, key, val);
|
|
12380
|
-
return;
|
|
12381
|
-
}
|
|
12359
|
+
for (const type of types)if (getType(val) === type || (0, _is.default)(type, val)) return void (0, _validate.validateChild)(node, key, val);
|
|
12382
12360
|
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(null == val ? void 0 : val.type)}`);
|
|
12383
12361
|
}
|
|
12384
12362
|
validate.oneOfNodeOrValueTypes = types;
|
|
@@ -13136,36 +13114,37 @@ var __webpack_modules__ = {
|
|
|
13136
13114
|
const types = [];
|
|
13137
13115
|
for(let i = 0; i < nodes.length; i++){
|
|
13138
13116
|
const node = nodes[i];
|
|
13139
|
-
if (
|
|
13140
|
-
if (types.includes(node))
|
|
13141
|
-
|
|
13142
|
-
|
|
13143
|
-
|
|
13144
|
-
|
|
13145
|
-
|
|
13146
|
-
|
|
13147
|
-
}
|
|
13148
|
-
if ((0, _index.isUnionTypeAnnotation)(node)) {
|
|
13149
|
-
if (!typeGroups.has(node.types)) {
|
|
13150
|
-
nodes.push(...node.types);
|
|
13151
|
-
typeGroups.add(node.types);
|
|
13117
|
+
if (node) {
|
|
13118
|
+
if (!types.includes(node)) {
|
|
13119
|
+
if ((0, _index.isAnyTypeAnnotation)(node)) return [
|
|
13120
|
+
node
|
|
13121
|
+
];
|
|
13122
|
+
if ((0, _index.isFlowBaseAnnotation)(node)) {
|
|
13123
|
+
bases.set(node.type, node);
|
|
13124
|
+
continue;
|
|
13152
13125
|
}
|
|
13153
|
-
|
|
13154
|
-
|
|
13155
|
-
|
|
13156
|
-
|
|
13157
|
-
|
|
13158
|
-
|
|
13159
|
-
|
|
13160
|
-
|
|
13161
|
-
|
|
13162
|
-
|
|
13163
|
-
|
|
13164
|
-
|
|
13165
|
-
|
|
13166
|
-
|
|
13126
|
+
if ((0, _index.isUnionTypeAnnotation)(node)) {
|
|
13127
|
+
if (!typeGroups.has(node.types)) {
|
|
13128
|
+
nodes.push(...node.types);
|
|
13129
|
+
typeGroups.add(node.types);
|
|
13130
|
+
}
|
|
13131
|
+
continue;
|
|
13132
|
+
}
|
|
13133
|
+
if ((0, _index.isGenericTypeAnnotation)(node)) {
|
|
13134
|
+
const name = getQualifiedName(node.id);
|
|
13135
|
+
if (generics.has(name)) {
|
|
13136
|
+
let existing = generics.get(name);
|
|
13137
|
+
if (existing.typeParameters) {
|
|
13138
|
+
if (node.typeParameters) {
|
|
13139
|
+
existing.typeParameters.params.push(...node.typeParameters.params);
|
|
13140
|
+
existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params);
|
|
13141
|
+
}
|
|
13142
|
+
} else existing = node.typeParameters;
|
|
13143
|
+
} else generics.set(name, node);
|
|
13144
|
+
continue;
|
|
13145
|
+
}
|
|
13146
|
+
types.push(node);
|
|
13167
13147
|
}
|
|
13168
|
-
types.push(node);
|
|
13169
13148
|
}
|
|
13170
13149
|
}
|
|
13171
13150
|
for (const [, baseType] of bases)types.push(baseType);
|
|
@@ -13263,36 +13242,37 @@ var __webpack_modules__ = {
|
|
|
13263
13242
|
const types = [];
|
|
13264
13243
|
for(let i = 0; i < nodes.length; i++){
|
|
13265
13244
|
const node = nodes[i];
|
|
13266
|
-
if (
|
|
13267
|
-
if (types.includes(node))
|
|
13268
|
-
|
|
13269
|
-
|
|
13270
|
-
|
|
13271
|
-
|
|
13272
|
-
|
|
13273
|
-
|
|
13274
|
-
}
|
|
13275
|
-
if ((0, _index.isTSUnionType)(node)) {
|
|
13276
|
-
if (!typeGroups.has(node.types)) {
|
|
13277
|
-
nodes.push(...node.types);
|
|
13278
|
-
typeGroups.add(node.types);
|
|
13245
|
+
if (node) {
|
|
13246
|
+
if (!types.includes(node)) {
|
|
13247
|
+
if ((0, _index.isTSAnyKeyword)(node)) return [
|
|
13248
|
+
node
|
|
13249
|
+
];
|
|
13250
|
+
if ((0, _index.isTSBaseType)(node)) {
|
|
13251
|
+
bases.set(node.type, node);
|
|
13252
|
+
continue;
|
|
13279
13253
|
}
|
|
13280
|
-
|
|
13281
|
-
|
|
13282
|
-
|
|
13283
|
-
|
|
13284
|
-
|
|
13285
|
-
|
|
13286
|
-
|
|
13287
|
-
|
|
13288
|
-
|
|
13289
|
-
|
|
13290
|
-
|
|
13291
|
-
|
|
13292
|
-
|
|
13293
|
-
|
|
13254
|
+
if ((0, _index.isTSUnionType)(node)) {
|
|
13255
|
+
if (!typeGroups.has(node.types)) {
|
|
13256
|
+
nodes.push(...node.types);
|
|
13257
|
+
typeGroups.add(node.types);
|
|
13258
|
+
}
|
|
13259
|
+
continue;
|
|
13260
|
+
}
|
|
13261
|
+
if ((0, _index.isTSTypeReference)(node) && node.typeParameters) {
|
|
13262
|
+
const name = getQualifiedName(node.typeName);
|
|
13263
|
+
if (generics.has(name)) {
|
|
13264
|
+
let existing = generics.get(name);
|
|
13265
|
+
if (existing.typeParameters) {
|
|
13266
|
+
if (node.typeParameters) {
|
|
13267
|
+
existing.typeParameters.params.push(...node.typeParameters.params);
|
|
13268
|
+
existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params);
|
|
13269
|
+
}
|
|
13270
|
+
} else existing = node.typeParameters;
|
|
13271
|
+
} else generics.set(name, node);
|
|
13272
|
+
continue;
|
|
13273
|
+
}
|
|
13274
|
+
types.push(node);
|
|
13294
13275
|
}
|
|
13295
|
-
types.push(node);
|
|
13296
13276
|
}
|
|
13297
13277
|
}
|
|
13298
13278
|
for (const [, baseType] of bases)types.push(baseType);
|
|
@@ -13381,10 +13361,8 @@ var __webpack_modules__ = {
|
|
|
13381
13361
|
if (keys) for(let i = 0; i < keys.length; i++){
|
|
13382
13362
|
const key = keys[i];
|
|
13383
13363
|
const nodes = id[key];
|
|
13384
|
-
if (nodes)
|
|
13385
|
-
|
|
13386
|
-
else search.push(nodes);
|
|
13387
|
-
}
|
|
13364
|
+
if (nodes) if (Array.isArray(nodes)) search.push(...nodes);
|
|
13365
|
+
else search.push(nodes);
|
|
13388
13366
|
}
|
|
13389
13367
|
}
|
|
13390
13368
|
return ids;
|
|
@@ -13593,7 +13571,7 @@ var __webpack_modules__ = {
|
|
|
13593
13571
|
const subNode = node[key];
|
|
13594
13572
|
if (Array.isArray(subNode)) for(let i = 0; i < subNode.length; i++){
|
|
13595
13573
|
const child = subNode[i];
|
|
13596
|
-
if (
|
|
13574
|
+
if (child) {
|
|
13597
13575
|
ancestors.push({
|
|
13598
13576
|
node,
|
|
13599
13577
|
key,
|
|
@@ -17010,16 +16988,16 @@ var __webpack_exports__ = {};
|
|
|
17010
16988
|
let hex;
|
|
17011
16989
|
switch(uuid.length){
|
|
17012
16990
|
case 32:
|
|
17013
|
-
hex = null
|
|
16991
|
+
hex = null == (_a = /^[0-9a-f]{32}$/i.exec(uuid)) ? void 0 : _a[0];
|
|
17014
16992
|
break;
|
|
17015
16993
|
case 36:
|
|
17016
|
-
hex = null
|
|
16994
|
+
hex = null == (_b = /^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(uuid)) ? void 0 : _b.slice(1, 6).join("");
|
|
17017
16995
|
break;
|
|
17018
16996
|
case 38:
|
|
17019
|
-
hex = null
|
|
16997
|
+
hex = null == (_c = /^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(uuid)) ? void 0 : _c.slice(1, 6).join("");
|
|
17020
16998
|
break;
|
|
17021
16999
|
case 45:
|
|
17022
|
-
hex = null
|
|
17000
|
+
hex = null == (_d = /^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(uuid)) ? void 0 : _d.slice(1, 6).join("");
|
|
17023
17001
|
break;
|
|
17024
17002
|
default:
|
|
17025
17003
|
break;
|
|
@@ -17196,8 +17174,12 @@ var __webpack_exports__ = {};
|
|
|
17196
17174
|
};
|
|
17197
17175
|
}
|
|
17198
17176
|
})();
|
|
17199
|
-
|
|
17200
|
-
|
|
17201
|
-
|
|
17177
|
+
exports["default"] = __webpack_exports__["default"];
|
|
17178
|
+
exports.getChannel = __webpack_exports__.getChannel;
|
|
17179
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
17180
|
+
"default",
|
|
17181
|
+
"getChannel"
|
|
17182
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
17183
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17202
17184
|
value: true
|
|
17203
17185
|
});
|