@stencil/core 4.18.0 → 4.18.1
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/cli/index.cjs +106 -215
- package/cli/index.js +107 -217
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +1686 -2826
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +117 -227
- package/internal/app-data/index.cjs +1 -0
- package/internal/app-data/index.js +1 -0
- package/internal/app-data/package.json +1 -1
- package/internal/client/index.js +53 -36
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/shadow-css.js +1 -2
- package/internal/hydrate/index.js +53 -36
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +52 -89
- package/internal/package.json +1 -1
- package/internal/stencil-public-compiler.d.ts +12 -1
- package/internal/stencil-public-runtime.d.ts +1 -0
- package/internal/testing/index.js +52 -35
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +378 -493
- package/mock-doc/index.d.ts +1 -1
- package/mock-doc/index.js +378 -493
- package/mock-doc/package.json +1 -1
- package/package.json +5 -6
- package/screenshot/index.js +43 -85
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +14 -27
- package/sys/node/glob.js +1 -1
- package/sys/node/index.js +42 -42
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +148 -268
- package/testing/jest/jest-27-and-under/jest-facade.d.ts +1 -1
- package/testing/jest/jest-28/jest-facade.d.ts +5 -5
- package/testing/jest/jest-29/jest-facade.d.ts +5 -5
- package/testing/package.json +1 -1
package/cli/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil CLI v4.18.
|
|
2
|
+
Stencil CLI v4.18.1 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -10,8 +10,7 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
10
10
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
11
11
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
12
12
|
}) : x)(function(x) {
|
|
13
|
-
if (typeof require !== "undefined")
|
|
14
|
-
return require.apply(this, arguments);
|
|
13
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
15
14
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
16
15
|
});
|
|
17
16
|
var __commonJS = (cb, mod) => function __require2() {
|
|
@@ -140,56 +139,33 @@ var require_action = __commonJS({
|
|
|
140
139
|
"node_modules/prompts/lib/util/action.js"(exports, module) {
|
|
141
140
|
"use strict";
|
|
142
141
|
module.exports = (key, isSelect) => {
|
|
143
|
-
if (key.meta && key.name !== "escape")
|
|
144
|
-
return;
|
|
142
|
+
if (key.meta && key.name !== "escape") return;
|
|
145
143
|
if (key.ctrl) {
|
|
146
|
-
if (key.name === "a")
|
|
147
|
-
|
|
148
|
-
if (key.name === "
|
|
149
|
-
|
|
150
|
-
if (key.name === "
|
|
151
|
-
return "abort";
|
|
152
|
-
if (key.name === "e")
|
|
153
|
-
return "last";
|
|
154
|
-
if (key.name === "g")
|
|
155
|
-
return "reset";
|
|
144
|
+
if (key.name === "a") return "first";
|
|
145
|
+
if (key.name === "c") return "abort";
|
|
146
|
+
if (key.name === "d") return "abort";
|
|
147
|
+
if (key.name === "e") return "last";
|
|
148
|
+
if (key.name === "g") return "reset";
|
|
156
149
|
}
|
|
157
150
|
if (isSelect) {
|
|
158
|
-
if (key.name === "j")
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
if (key.name === "return"
|
|
164
|
-
|
|
165
|
-
if (key.name === "
|
|
166
|
-
|
|
167
|
-
if (key.name === "
|
|
168
|
-
|
|
169
|
-
if (key.name === "
|
|
170
|
-
|
|
171
|
-
if (key.name === "
|
|
172
|
-
|
|
173
|
-
if (key.name === "
|
|
174
|
-
|
|
175
|
-
if (key.name === "
|
|
176
|
-
return "next";
|
|
177
|
-
if (key.name === "pagedown")
|
|
178
|
-
return "nextPage";
|
|
179
|
-
if (key.name === "pageup")
|
|
180
|
-
return "prevPage";
|
|
181
|
-
if (key.name === "home")
|
|
182
|
-
return "home";
|
|
183
|
-
if (key.name === "end")
|
|
184
|
-
return "end";
|
|
185
|
-
if (key.name === "up")
|
|
186
|
-
return "up";
|
|
187
|
-
if (key.name === "down")
|
|
188
|
-
return "down";
|
|
189
|
-
if (key.name === "right")
|
|
190
|
-
return "right";
|
|
191
|
-
if (key.name === "left")
|
|
192
|
-
return "left";
|
|
151
|
+
if (key.name === "j") return "down";
|
|
152
|
+
if (key.name === "k") return "up";
|
|
153
|
+
}
|
|
154
|
+
if (key.name === "return") return "submit";
|
|
155
|
+
if (key.name === "enter") return "submit";
|
|
156
|
+
if (key.name === "backspace") return "delete";
|
|
157
|
+
if (key.name === "delete") return "deleteForward";
|
|
158
|
+
if (key.name === "abort") return "abort";
|
|
159
|
+
if (key.name === "escape") return "exit";
|
|
160
|
+
if (key.name === "tab") return "next";
|
|
161
|
+
if (key.name === "pagedown") return "nextPage";
|
|
162
|
+
if (key.name === "pageup") return "prevPage";
|
|
163
|
+
if (key.name === "home") return "home";
|
|
164
|
+
if (key.name === "end") return "end";
|
|
165
|
+
if (key.name === "up") return "up";
|
|
166
|
+
if (key.name === "down") return "down";
|
|
167
|
+
if (key.name === "right") return "right";
|
|
168
|
+
if (key.name === "left") return "left";
|
|
193
169
|
return false;
|
|
194
170
|
};
|
|
195
171
|
}
|
|
@@ -219,20 +195,15 @@ var require_src = __commonJS({
|
|
|
219
195
|
var beep = "\x07";
|
|
220
196
|
var cursor = {
|
|
221
197
|
to(x, y) {
|
|
222
|
-
if (!y)
|
|
223
|
-
return `${CSI}${x + 1}G`;
|
|
198
|
+
if (!y) return `${CSI}${x + 1}G`;
|
|
224
199
|
return `${CSI}${y + 1};${x + 1}H`;
|
|
225
200
|
},
|
|
226
201
|
move(x, y) {
|
|
227
202
|
let ret = "";
|
|
228
|
-
if (x < 0)
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
if (y < 0)
|
|
233
|
-
ret += `${CSI}${-y}A`;
|
|
234
|
-
else if (y > 0)
|
|
235
|
-
ret += `${CSI}${y}B`;
|
|
203
|
+
if (x < 0) ret += `${CSI}${-x}D`;
|
|
204
|
+
else if (x > 0) ret += `${CSI}${x}C`;
|
|
205
|
+
if (y < 0) ret += `${CSI}${-y}A`;
|
|
206
|
+
else if (y > 0) ret += `${CSI}${y}B`;
|
|
236
207
|
return ret;
|
|
237
208
|
},
|
|
238
209
|
up: (count = 1) => `${CSI}${count}A`,
|
|
@@ -279,8 +250,7 @@ var require_clear = __commonJS({
|
|
|
279
250
|
var { erase, cursor } = require_src();
|
|
280
251
|
var width = (str) => [...strip(str)].length;
|
|
281
252
|
module.exports = function(prompt, perLine) {
|
|
282
|
-
if (!perLine)
|
|
283
|
-
return erase.line + cursor.to(0);
|
|
253
|
+
if (!perLine) return erase.line + cursor.to(0);
|
|
284
254
|
let rows = 0;
|
|
285
255
|
const lines = prompt.split(/\r?\n/);
|
|
286
256
|
for (let line of lines) {
|
|
@@ -368,8 +338,7 @@ var require_lines = __commonJS({
|
|
|
368
338
|
var strip = require_strip();
|
|
369
339
|
module.exports = function(msg, perLine) {
|
|
370
340
|
let lines = String(strip(msg) || "").split(/\r?\n/);
|
|
371
|
-
if (!perLine)
|
|
372
|
-
return lines.length;
|
|
341
|
+
if (!perLine) return lines.length;
|
|
373
342
|
return lines.map((l) => Math.ceil(l.length / perLine)).reduce((a, b) => a + b);
|
|
374
343
|
};
|
|
375
344
|
}
|
|
@@ -385,8 +354,7 @@ var require_wrap = __commonJS({
|
|
|
385
354
|
return (msg || "").split(/\r?\n/g).map((line) => line.split(/\s+/g).reduce((arr, w) => {
|
|
386
355
|
if (w.length + tab.length >= width || arr[arr.length - 1].length + w.length + 1 < width)
|
|
387
356
|
arr[arr.length - 1] += ` ${w}`;
|
|
388
|
-
else
|
|
389
|
-
arr.push(`${tab}${w}`);
|
|
357
|
+
else arr.push(`${tab}${w}`);
|
|
390
358
|
return arr;
|
|
391
359
|
}, [tab]).join("\n")).join("\n");
|
|
392
360
|
};
|
|
@@ -400,8 +368,7 @@ var require_entriesToDisplay = __commonJS({
|
|
|
400
368
|
module.exports = (cursor, total, maxVisible) => {
|
|
401
369
|
maxVisible = maxVisible || total;
|
|
402
370
|
let startIndex = Math.min(total - maxVisible, cursor - Math.floor(maxVisible / 2));
|
|
403
|
-
if (startIndex < 0)
|
|
404
|
-
startIndex = 0;
|
|
371
|
+
if (startIndex < 0) startIndex = 0;
|
|
405
372
|
let endIndex = Math.min(startIndex + maxVisible, total);
|
|
406
373
|
return { startIndex, endIndex };
|
|
407
374
|
};
|
|
@@ -443,8 +410,7 @@ var require_prompt = __commonJS({
|
|
|
443
410
|
this.onRender = (opts.onRender || (() => void 0)).bind(this);
|
|
444
411
|
const rl = readline.createInterface({ input: this.in, escapeCodeTimeout: 50 });
|
|
445
412
|
readline.emitKeypressEvents(this.in, rl);
|
|
446
|
-
if (this.in.isTTY)
|
|
447
|
-
this.in.setRawMode(true);
|
|
413
|
+
if (this.in.isTTY) this.in.setRawMode(true);
|
|
448
414
|
const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1;
|
|
449
415
|
const keypress = (str, key) => {
|
|
450
416
|
let a = action(key, isSelect);
|
|
@@ -459,8 +425,7 @@ var require_prompt = __commonJS({
|
|
|
459
425
|
this.close = () => {
|
|
460
426
|
this.out.write(cursor.show);
|
|
461
427
|
this.in.removeListener("keypress", keypress);
|
|
462
|
-
if (this.in.isTTY)
|
|
463
|
-
this.in.setRawMode(false);
|
|
428
|
+
if (this.in.isTTY) this.in.setRawMode(false);
|
|
464
429
|
rl.close();
|
|
465
430
|
this.emit(this.aborted ? "abort" : this.exited ? "exit" : "submit", this.value);
|
|
466
431
|
this.closed = true;
|
|
@@ -479,8 +444,7 @@ var require_prompt = __commonJS({
|
|
|
479
444
|
}
|
|
480
445
|
render() {
|
|
481
446
|
this.onRender(color);
|
|
482
|
-
if (this.firstRender)
|
|
483
|
-
this.firstRender = false;
|
|
447
|
+
if (this.firstRender) this.firstRender = false;
|
|
484
448
|
}
|
|
485
449
|
};
|
|
486
450
|
module.exports = Prompt;
|
|
@@ -570,16 +534,14 @@ var require_text = __commonJS({
|
|
|
570
534
|
this.close();
|
|
571
535
|
}
|
|
572
536
|
next() {
|
|
573
|
-
if (!this.placeholder)
|
|
574
|
-
return this.bell();
|
|
537
|
+
if (!this.placeholder) return this.bell();
|
|
575
538
|
this.value = this.initial;
|
|
576
539
|
this.cursor = this.rendered.length;
|
|
577
540
|
this.fire();
|
|
578
541
|
this.render();
|
|
579
542
|
}
|
|
580
543
|
moveCursor(n) {
|
|
581
|
-
if (this.placeholder)
|
|
582
|
-
return;
|
|
544
|
+
if (this.placeholder) return;
|
|
583
545
|
this.cursor = this.cursor + n;
|
|
584
546
|
this.cursorOffset += n;
|
|
585
547
|
}
|
|
@@ -592,8 +554,7 @@ var require_text = __commonJS({
|
|
|
592
554
|
this.render();
|
|
593
555
|
}
|
|
594
556
|
delete() {
|
|
595
|
-
if (this.isCursorAtStart())
|
|
596
|
-
return this.bell();
|
|
557
|
+
if (this.isCursorAtStart()) return this.bell();
|
|
597
558
|
let s1 = this.value.slice(0, this.cursor - 1);
|
|
598
559
|
let s2 = this.value.slice(this.cursor);
|
|
599
560
|
this.value = `${s1}${s2}`;
|
|
@@ -607,8 +568,7 @@ var require_text = __commonJS({
|
|
|
607
568
|
this.render();
|
|
608
569
|
}
|
|
609
570
|
deleteForward() {
|
|
610
|
-
if (this.cursor * this.scale >= this.rendered.length || this.placeholder)
|
|
611
|
-
return this.bell();
|
|
571
|
+
if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();
|
|
612
572
|
let s1 = this.value.slice(0, this.cursor);
|
|
613
573
|
let s2 = this.value.slice(this.cursor + 1);
|
|
614
574
|
this.value = `${s1}${s2}`;
|
|
@@ -629,14 +589,12 @@ var require_text = __commonJS({
|
|
|
629
589
|
this.render();
|
|
630
590
|
}
|
|
631
591
|
left() {
|
|
632
|
-
if (this.cursor <= 0 || this.placeholder)
|
|
633
|
-
return this.bell();
|
|
592
|
+
if (this.cursor <= 0 || this.placeholder) return this.bell();
|
|
634
593
|
this.moveCursor(-1);
|
|
635
594
|
this.render();
|
|
636
595
|
}
|
|
637
596
|
right() {
|
|
638
|
-
if (this.cursor * this.scale >= this.rendered.length || this.placeholder)
|
|
639
|
-
return this.bell();
|
|
597
|
+
if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();
|
|
640
598
|
this.moveCursor(1);
|
|
641
599
|
this.render();
|
|
642
600
|
}
|
|
@@ -647,8 +605,7 @@ var require_text = __commonJS({
|
|
|
647
605
|
return this.cursor === this.rendered.length || this.placeholder && this.cursor === this.rendered.length + 1;
|
|
648
606
|
}
|
|
649
607
|
render() {
|
|
650
|
-
if (this.closed)
|
|
651
|
-
return;
|
|
608
|
+
if (this.closed) return;
|
|
652
609
|
if (!this.firstRender) {
|
|
653
610
|
if (this.outputError)
|
|
654
611
|
this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));
|
|
@@ -765,19 +722,15 @@ var require_select = __commonJS({
|
|
|
765
722
|
this.render();
|
|
766
723
|
}
|
|
767
724
|
_(c, key) {
|
|
768
|
-
if (c === " ")
|
|
769
|
-
return this.submit();
|
|
725
|
+
if (c === " ") return this.submit();
|
|
770
726
|
}
|
|
771
727
|
get selection() {
|
|
772
728
|
return this.choices[this.cursor];
|
|
773
729
|
}
|
|
774
730
|
render() {
|
|
775
|
-
if (this.closed)
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
this.out.write(cursor.hide);
|
|
779
|
-
else
|
|
780
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
731
|
+
if (this.closed) return;
|
|
732
|
+
if (this.firstRender) this.out.write(cursor.hide);
|
|
733
|
+
else this.out.write(clear(this.outputText, this.out.columns));
|
|
781
734
|
super.render();
|
|
782
735
|
let { startIndex, endIndex } = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage);
|
|
783
736
|
this.outputText = [
|
|
@@ -862,14 +815,12 @@ var require_toggle = __commonJS({
|
|
|
862
815
|
this.close();
|
|
863
816
|
}
|
|
864
817
|
deactivate() {
|
|
865
|
-
if (this.value === false)
|
|
866
|
-
return this.bell();
|
|
818
|
+
if (this.value === false) return this.bell();
|
|
867
819
|
this.value = false;
|
|
868
820
|
this.render();
|
|
869
821
|
}
|
|
870
822
|
activate() {
|
|
871
|
-
if (this.value === true)
|
|
872
|
-
return this.bell();
|
|
823
|
+
if (this.value === true) return this.bell();
|
|
873
824
|
this.value = true;
|
|
874
825
|
this.render();
|
|
875
826
|
}
|
|
@@ -900,17 +851,13 @@ var require_toggle = __commonJS({
|
|
|
900
851
|
this.value = true;
|
|
901
852
|
} else if (c === "0") {
|
|
902
853
|
this.value = false;
|
|
903
|
-
} else
|
|
904
|
-
return this.bell();
|
|
854
|
+
} else return this.bell();
|
|
905
855
|
this.render();
|
|
906
856
|
}
|
|
907
857
|
render() {
|
|
908
|
-
if (this.closed)
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
this.out.write(cursor.hide);
|
|
912
|
-
else
|
|
913
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
858
|
+
if (this.closed) return;
|
|
859
|
+
if (this.firstRender) this.out.write(cursor.hide);
|
|
860
|
+
else this.out.write(clear(this.outputText, this.out.columns));
|
|
914
861
|
super.render();
|
|
915
862
|
this.outputText = [
|
|
916
863
|
style.symbol(this.done, this.aborted),
|
|
@@ -1256,8 +1203,7 @@ var require_date = __commonJS({
|
|
|
1256
1203
|
return this._date;
|
|
1257
1204
|
}
|
|
1258
1205
|
set date(date) {
|
|
1259
|
-
if (date)
|
|
1260
|
-
this._date.setTime(date.getTime());
|
|
1206
|
+
if (date) this._date.setTime(date.getTime());
|
|
1261
1207
|
}
|
|
1262
1208
|
set mask(mask) {
|
|
1263
1209
|
let result;
|
|
@@ -1270,8 +1216,7 @@ var require_date = __commonJS({
|
|
|
1270
1216
|
let parts = this.parts.reduce((arr, i) => {
|
|
1271
1217
|
if (typeof i === "string" && typeof arr[arr.length - 1] === "string")
|
|
1272
1218
|
arr[arr.length - 1] += i;
|
|
1273
|
-
else
|
|
1274
|
-
arr.push(i);
|
|
1219
|
+
else arr.push(i);
|
|
1275
1220
|
return arr;
|
|
1276
1221
|
}, []);
|
|
1277
1222
|
this.parts.splice(0);
|
|
@@ -1334,15 +1279,13 @@ var require_date = __commonJS({
|
|
|
1334
1279
|
}
|
|
1335
1280
|
left() {
|
|
1336
1281
|
let prev = this.parts[this.cursor].prev();
|
|
1337
|
-
if (prev == null)
|
|
1338
|
-
return this.bell();
|
|
1282
|
+
if (prev == null) return this.bell();
|
|
1339
1283
|
this.moveCursor(this.parts.indexOf(prev));
|
|
1340
1284
|
this.render();
|
|
1341
1285
|
}
|
|
1342
1286
|
right() {
|
|
1343
1287
|
let next = this.parts[this.cursor].next();
|
|
1344
|
-
if (next == null)
|
|
1345
|
-
return this.bell();
|
|
1288
|
+
if (next == null) return this.bell();
|
|
1346
1289
|
this.moveCursor(this.parts.indexOf(next));
|
|
1347
1290
|
this.render();
|
|
1348
1291
|
}
|
|
@@ -1359,12 +1302,9 @@ var require_date = __commonJS({
|
|
|
1359
1302
|
}
|
|
1360
1303
|
}
|
|
1361
1304
|
render() {
|
|
1362
|
-
if (this.closed)
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
this.out.write(cursor.hide);
|
|
1366
|
-
else
|
|
1367
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
1305
|
+
if (this.closed) return;
|
|
1306
|
+
if (this.firstRender) this.out.write(cursor.hide);
|
|
1307
|
+
else this.out.write(clear(this.outputText, this.out.columns));
|
|
1368
1308
|
super.render();
|
|
1369
1309
|
this.outputText = [
|
|
1370
1310
|
style.symbol(this.done, this.aborted),
|
|
@@ -1491,8 +1431,7 @@ var require_number = __commonJS({
|
|
|
1491
1431
|
if (this.value === "") {
|
|
1492
1432
|
this.value = this.min - this.inc;
|
|
1493
1433
|
}
|
|
1494
|
-
if (this.value >= this.max)
|
|
1495
|
-
return this.bell();
|
|
1434
|
+
if (this.value >= this.max) return this.bell();
|
|
1496
1435
|
this.value += this.inc;
|
|
1497
1436
|
this.color = `cyan`;
|
|
1498
1437
|
this.fire();
|
|
@@ -1503,8 +1442,7 @@ var require_number = __commonJS({
|
|
|
1503
1442
|
if (this.value === "") {
|
|
1504
1443
|
this.value = this.min + this.inc;
|
|
1505
1444
|
}
|
|
1506
|
-
if (this.value <= this.min)
|
|
1507
|
-
return this.bell();
|
|
1445
|
+
if (this.value <= this.min) return this.bell();
|
|
1508
1446
|
this.value -= this.inc;
|
|
1509
1447
|
this.color = `cyan`;
|
|
1510
1448
|
this.fire();
|
|
@@ -1512,8 +1450,7 @@ var require_number = __commonJS({
|
|
|
1512
1450
|
}
|
|
1513
1451
|
delete() {
|
|
1514
1452
|
let val = this.value.toString();
|
|
1515
|
-
if (val.length === 0)
|
|
1516
|
-
return this.bell();
|
|
1453
|
+
if (val.length === 0) return this.bell();
|
|
1517
1454
|
this.value = this.parse(val = val.slice(0, -1)) || ``;
|
|
1518
1455
|
if (this.value !== "" && this.value < this.min) {
|
|
1519
1456
|
this.value = this.min;
|
|
@@ -1528,27 +1465,21 @@ var require_number = __commonJS({
|
|
|
1528
1465
|
this.render();
|
|
1529
1466
|
}
|
|
1530
1467
|
_(c, key) {
|
|
1531
|
-
if (!this.valid(c))
|
|
1532
|
-
return this.bell();
|
|
1468
|
+
if (!this.valid(c)) return this.bell();
|
|
1533
1469
|
const now = Date.now();
|
|
1534
|
-
if (now - this.lastHit > 1e3)
|
|
1535
|
-
this.typed = ``;
|
|
1470
|
+
if (now - this.lastHit > 1e3) this.typed = ``;
|
|
1536
1471
|
this.typed += c;
|
|
1537
1472
|
this.lastHit = now;
|
|
1538
1473
|
this.color = `cyan`;
|
|
1539
|
-
if (c === `.`)
|
|
1540
|
-
return this.fire();
|
|
1474
|
+
if (c === `.`) return this.fire();
|
|
1541
1475
|
this.value = Math.min(this.parse(this.typed), this.max);
|
|
1542
|
-
if (this.value > this.max)
|
|
1543
|
-
|
|
1544
|
-
if (this.value < this.min)
|
|
1545
|
-
this.value = this.min;
|
|
1476
|
+
if (this.value > this.max) this.value = this.max;
|
|
1477
|
+
if (this.value < this.min) this.value = this.min;
|
|
1546
1478
|
this.fire();
|
|
1547
1479
|
this.render();
|
|
1548
1480
|
}
|
|
1549
1481
|
render() {
|
|
1550
|
-
if (this.closed)
|
|
1551
|
-
return;
|
|
1482
|
+
if (this.closed) return;
|
|
1552
1483
|
if (!this.firstRender) {
|
|
1553
1484
|
if (this.outputError)
|
|
1554
1485
|
this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));
|
|
@@ -1677,8 +1608,7 @@ var require_multiselect = __commonJS({
|
|
|
1677
1608
|
this.render();
|
|
1678
1609
|
}
|
|
1679
1610
|
right() {
|
|
1680
|
-
if (this.value.filter((e) => e.selected).length >= this.maxChoices)
|
|
1681
|
-
return this.bell();
|
|
1611
|
+
if (this.value.filter((e) => e.selected).length >= this.maxChoices) return this.bell();
|
|
1682
1612
|
this.value[this.cursor].selected = true;
|
|
1683
1613
|
this.render();
|
|
1684
1614
|
}
|
|
@@ -1778,10 +1708,8 @@ Instructions:
|
|
|
1778
1708
|
return output.join(" ");
|
|
1779
1709
|
}
|
|
1780
1710
|
render() {
|
|
1781
|
-
if (this.closed)
|
|
1782
|
-
|
|
1783
|
-
if (this.firstRender)
|
|
1784
|
-
this.out.write(cursor.hide);
|
|
1711
|
+
if (this.closed) return;
|
|
1712
|
+
if (this.firstRender) this.out.write(cursor.hide);
|
|
1785
1713
|
super.render();
|
|
1786
1714
|
let prompt = [
|
|
1787
1715
|
style.symbol(this.done, this.aborted),
|
|
@@ -1854,15 +1782,13 @@ var require_autocomplete = __commonJS({
|
|
|
1854
1782
|
this.select = i;
|
|
1855
1783
|
if (this.suggestions.length > 0)
|
|
1856
1784
|
this.value = getVal(this.suggestions, i);
|
|
1857
|
-
else
|
|
1858
|
-
this.value = this.fallback.value;
|
|
1785
|
+
else this.value = this.fallback.value;
|
|
1859
1786
|
this.fire();
|
|
1860
1787
|
}
|
|
1861
1788
|
async complete(cb) {
|
|
1862
1789
|
const p = this.completing = this.suggest(this.input, this.choices);
|
|
1863
1790
|
const suggestions = await p;
|
|
1864
|
-
if (this.completing !== p)
|
|
1865
|
-
return;
|
|
1791
|
+
if (this.completing !== p) return;
|
|
1866
1792
|
this.suggestions = suggestions.map((s, i, arr) => ({ title: getTitle(arr, i), value: getVal(arr, i), description: s.description }));
|
|
1867
1793
|
this.completing = false;
|
|
1868
1794
|
const l = Math.max(suggestions.length - 1, 0);
|
|
@@ -1914,8 +1840,7 @@ var require_autocomplete = __commonJS({
|
|
|
1914
1840
|
this.render();
|
|
1915
1841
|
}
|
|
1916
1842
|
delete() {
|
|
1917
|
-
if (this.cursor === 0)
|
|
1918
|
-
return this.bell();
|
|
1843
|
+
if (this.cursor === 0) return this.bell();
|
|
1919
1844
|
let s1 = this.input.slice(0, this.cursor - 1);
|
|
1920
1845
|
let s2 = this.input.slice(this.cursor);
|
|
1921
1846
|
this.input = `${s1}${s2}`;
|
|
@@ -1924,8 +1849,7 @@ var require_autocomplete = __commonJS({
|
|
|
1924
1849
|
this.render();
|
|
1925
1850
|
}
|
|
1926
1851
|
deleteForward() {
|
|
1927
|
-
if (this.cursor * this.scale >= this.rendered.length)
|
|
1928
|
-
return this.bell();
|
|
1852
|
+
if (this.cursor * this.scale >= this.rendered.length) return this.bell();
|
|
1929
1853
|
let s1 = this.input.slice(0, this.cursor);
|
|
1930
1854
|
let s2 = this.input.slice(this.cursor + 1);
|
|
1931
1855
|
this.input = `${s1}${s2}`;
|
|
@@ -1959,8 +1883,7 @@ var require_autocomplete = __commonJS({
|
|
|
1959
1883
|
next() {
|
|
1960
1884
|
if (this.select === this.suggestions.length - 1) {
|
|
1961
1885
|
this.moveSelect(0);
|
|
1962
|
-
} else
|
|
1963
|
-
this.moveSelect(this.select + 1);
|
|
1886
|
+
} else this.moveSelect(this.select + 1);
|
|
1964
1887
|
this.render();
|
|
1965
1888
|
}
|
|
1966
1889
|
nextPage() {
|
|
@@ -1972,14 +1895,12 @@ var require_autocomplete = __commonJS({
|
|
|
1972
1895
|
this.render();
|
|
1973
1896
|
}
|
|
1974
1897
|
left() {
|
|
1975
|
-
if (this.cursor <= 0)
|
|
1976
|
-
return this.bell();
|
|
1898
|
+
if (this.cursor <= 0) return this.bell();
|
|
1977
1899
|
this.cursor = this.cursor - 1;
|
|
1978
1900
|
this.render();
|
|
1979
1901
|
}
|
|
1980
1902
|
right() {
|
|
1981
|
-
if (this.cursor * this.scale >= this.rendered.length)
|
|
1982
|
-
return this.bell();
|
|
1903
|
+
if (this.cursor * this.scale >= this.rendered.length) return this.bell();
|
|
1983
1904
|
this.cursor = this.cursor + 1;
|
|
1984
1905
|
this.render();
|
|
1985
1906
|
}
|
|
@@ -1997,12 +1918,9 @@ var require_autocomplete = __commonJS({
|
|
|
1997
1918
|
return prefix + " " + title + color.gray(desc || "");
|
|
1998
1919
|
}
|
|
1999
1920
|
render() {
|
|
2000
|
-
if (this.closed)
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
this.out.write(cursor.hide);
|
|
2004
|
-
else
|
|
2005
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
1921
|
+
if (this.closed) return;
|
|
1922
|
+
if (this.firstRender) this.out.write(cursor.hide);
|
|
1923
|
+
else this.out.write(clear(this.outputText, this.out.columns));
|
|
2006
1924
|
super.render();
|
|
2007
1925
|
let { startIndex, endIndex } = entriesToDisplay(this.select, this.choices.length, this.limit);
|
|
2008
1926
|
this.outputText = [
|
|
@@ -2074,8 +1992,7 @@ var require_autocompleteMultiselect = __commonJS({
|
|
|
2074
1992
|
this.render();
|
|
2075
1993
|
}
|
|
2076
1994
|
right() {
|
|
2077
|
-
if (this.value.filter((e) => e.selected).length >= this.maxChoices)
|
|
2078
|
-
return this.bell();
|
|
1995
|
+
if (this.value.filter((e) => e.selected).length >= this.maxChoices) return this.bell();
|
|
2079
1996
|
this.filteredOptions[this.cursor].selected = true;
|
|
2080
1997
|
this.render();
|
|
2081
1998
|
}
|
|
@@ -2152,10 +2069,8 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
|
|
|
2152
2069
|
}
|
|
2153
2070
|
renderOption(cursor2, v, i) {
|
|
2154
2071
|
let title;
|
|
2155
|
-
if (v.disabled)
|
|
2156
|
-
|
|
2157
|
-
else
|
|
2158
|
-
title = cursor2 === i ? color.cyan().underline(v.title) : v.title;
|
|
2072
|
+
if (v.disabled) title = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
|
|
2073
|
+
else title = cursor2 === i ? color.cyan().underline(v.title) : v.title;
|
|
2159
2074
|
return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + title;
|
|
2160
2075
|
}
|
|
2161
2076
|
renderDoneOrInstructions() {
|
|
@@ -2169,10 +2084,8 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
|
|
|
2169
2084
|
return output.join(" ");
|
|
2170
2085
|
}
|
|
2171
2086
|
render() {
|
|
2172
|
-
if (this.closed)
|
|
2173
|
-
|
|
2174
|
-
if (this.firstRender)
|
|
2175
|
-
this.out.write(cursor.hide);
|
|
2087
|
+
if (this.closed) return;
|
|
2088
|
+
if (this.firstRender) this.out.write(cursor.hide);
|
|
2176
2089
|
super.render();
|
|
2177
2090
|
let prompt = [
|
|
2178
2091
|
style.symbol(this.done, this.aborted),
|
|
@@ -2248,12 +2161,9 @@ var require_confirm = __commonJS({
|
|
|
2248
2161
|
return this.bell();
|
|
2249
2162
|
}
|
|
2250
2163
|
render() {
|
|
2251
|
-
if (this.closed)
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
this.out.write(cursor.hide);
|
|
2255
|
-
else
|
|
2256
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
2164
|
+
if (this.closed) return;
|
|
2165
|
+
if (this.firstRender) this.out.write(cursor.hide);
|
|
2166
|
+
else this.out.write(clear(this.outputText, this.out.columns));
|
|
2257
2167
|
super.render();
|
|
2258
2168
|
this.outputText = [
|
|
2259
2169
|
style.symbol(this.done, this.aborted),
|
|
@@ -2377,11 +2287,9 @@ var require_lib = __commonJS({
|
|
|
2377
2287
|
type = await type(answer, { ...answers }, question);
|
|
2378
2288
|
question["type"] = type;
|
|
2379
2289
|
}
|
|
2380
|
-
if (!type)
|
|
2381
|
-
continue;
|
|
2290
|
+
if (!type) continue;
|
|
2382
2291
|
for (let key in question) {
|
|
2383
|
-
if (passOn.includes(key))
|
|
2384
|
-
continue;
|
|
2292
|
+
if (passOn.includes(key)) continue;
|
|
2385
2293
|
let value = question[key];
|
|
2386
2294
|
question[key] = typeof value === "function" ? await value(answer, { ...answers }, lastPrompt) : value;
|
|
2387
2295
|
}
|
|
@@ -2407,8 +2315,7 @@ var require_lib = __commonJS({
|
|
|
2407
2315
|
} catch (err2) {
|
|
2408
2316
|
quit = !await onCancel(question, answers);
|
|
2409
2317
|
}
|
|
2410
|
-
if (quit)
|
|
2411
|
-
return answers;
|
|
2318
|
+
if (quit) return answers;
|
|
2412
2319
|
}
|
|
2413
2320
|
return answers;
|
|
2414
2321
|
}
|
|
@@ -2720,18 +2627,15 @@ var reducePathComponents = (components) => {
|
|
|
2720
2627
|
const reduced = [components[0]];
|
|
2721
2628
|
for (let i = 1; i < components.length; i++) {
|
|
2722
2629
|
const component = components[i];
|
|
2723
|
-
if (!component)
|
|
2724
|
-
|
|
2725
|
-
if (component === ".")
|
|
2726
|
-
continue;
|
|
2630
|
+
if (!component) continue;
|
|
2631
|
+
if (component === ".") continue;
|
|
2727
2632
|
if (component === "..") {
|
|
2728
2633
|
if (reduced.length > 1) {
|
|
2729
2634
|
if (reduced[reduced.length - 1] !== "..") {
|
|
2730
2635
|
reduced.pop();
|
|
2731
2636
|
continue;
|
|
2732
2637
|
}
|
|
2733
|
-
} else if (reduced[0])
|
|
2734
|
-
continue;
|
|
2638
|
+
} else if (reduced[0]) continue;
|
|
2735
2639
|
}
|
|
2736
2640
|
reduced.push(component);
|
|
2737
2641
|
}
|
|
@@ -2742,23 +2646,18 @@ var getRootLength = (path) => {
|
|
|
2742
2646
|
return rootLength < 0 ? ~rootLength : rootLength;
|
|
2743
2647
|
};
|
|
2744
2648
|
var getEncodedRootLength = (path) => {
|
|
2745
|
-
if (!path)
|
|
2746
|
-
return 0;
|
|
2649
|
+
if (!path) return 0;
|
|
2747
2650
|
const ch0 = path.charCodeAt(0);
|
|
2748
2651
|
if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) {
|
|
2749
|
-
if (path.charCodeAt(1) !== ch0)
|
|
2750
|
-
return 1;
|
|
2652
|
+
if (path.charCodeAt(1) !== ch0) return 1;
|
|
2751
2653
|
const p1 = path.indexOf(ch0 === 47 /* slash */ ? "/" : altDirectorySeparator, 2);
|
|
2752
|
-
if (p1 < 0)
|
|
2753
|
-
return path.length;
|
|
2654
|
+
if (p1 < 0) return path.length;
|
|
2754
2655
|
return p1 + 1;
|
|
2755
2656
|
}
|
|
2756
2657
|
if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) {
|
|
2757
2658
|
const ch2 = path.charCodeAt(2);
|
|
2758
|
-
if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */)
|
|
2759
|
-
|
|
2760
|
-
if (path.length === 2)
|
|
2761
|
-
return 2;
|
|
2659
|
+
if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) return 3;
|
|
2660
|
+
if (path.length === 2) return 2;
|
|
2762
2661
|
}
|
|
2763
2662
|
const schemeEnd = path.indexOf(urlSchemeSeparator);
|
|
2764
2663
|
if (schemeEnd !== -1) {
|
|
@@ -2787,12 +2686,10 @@ var getEncodedRootLength = (path) => {
|
|
|
2787
2686
|
var isVolumeCharacter = (charCode) => charCode >= 97 /* a */ && charCode <= 122 /* z */ || charCode >= 65 /* A */ && charCode <= 90 /* Z */;
|
|
2788
2687
|
var getFileUrlVolumeSeparatorEnd = (url, start) => {
|
|
2789
2688
|
const ch0 = url.charCodeAt(start);
|
|
2790
|
-
if (ch0 === 58 /* colon */)
|
|
2791
|
-
return start + 1;
|
|
2689
|
+
if (ch0 === 58 /* colon */) return start + 1;
|
|
2792
2690
|
if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) {
|
|
2793
2691
|
const ch2 = url.charCodeAt(start + 2);
|
|
2794
|
-
if (ch2 === 97 /* a */ || ch2 === 65 /* A */)
|
|
2795
|
-
return start + 3;
|
|
2692
|
+
if (ch2 === 97 /* a */ || ch2 === 65 /* A */) return start + 3;
|
|
2796
2693
|
}
|
|
2797
2694
|
return -1;
|
|
2798
2695
|
};
|
|
@@ -2930,8 +2827,7 @@ var parseArgs = (flags, args) => {
|
|
|
2930
2827
|
};
|
|
2931
2828
|
var parseCLITerm = (flags, args) => {
|
|
2932
2829
|
const arg = args.shift();
|
|
2933
|
-
if (arg === void 0)
|
|
2934
|
-
return;
|
|
2830
|
+
if (arg === void 0) return;
|
|
2935
2831
|
const isNegatedBoolean = !readOnlyArrayHasStringMember(BOOLEAN_CLI_FLAGS, normalizeFlagName(arg)) && readOnlyArrayHasStringMember(BOOLEAN_CLI_FLAGS, normalizeNegativeFlagName(arg));
|
|
2936
2832
|
const isNegatedBooleanOrString = !readOnlyArrayHasStringMember(BOOLEAN_STRING_CLI_FLAGS, normalizeFlagName(arg)) && readOnlyArrayHasStringMember(BOOLEAN_STRING_CLI_FLAGS, normalizeNegativeFlagName(arg));
|
|
2937
2833
|
if (arg.startsWith("--") && arg.includes("=")) {
|
|
@@ -3136,13 +3032,7 @@ var findConfig = async (opts) => {
|
|
|
3136
3032
|
|
|
3137
3033
|
// src/cli/load-compiler.ts
|
|
3138
3034
|
var loadCoreCompiler = async (sys) => {
|
|
3139
|
-
|
|
3140
|
-
if (globalThis.stencil) {
|
|
3141
|
-
return globalThis.stencil;
|
|
3142
|
-
} else {
|
|
3143
|
-
globalThis.stencil = compilerMod;
|
|
3144
|
-
return compilerMod;
|
|
3145
|
-
}
|
|
3035
|
+
return await sys.dynamicImport(sys.getCompilerExecutingPath());
|
|
3146
3036
|
};
|
|
3147
3037
|
|
|
3148
3038
|
// src/cli/logs.ts
|