@flowscripter/dynamic-cli-framework 5.2.1 → 5.2.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/dist/src/service/printer/DefaultPrinterService.d.ts.map +1 -1
- package/dist/src/service/printer/DefaultPrinterService.js +9 -1
- package/dist/src/service/printer/terminal/Quote.d.ts.map +1 -1
- package/dist/src/service/printer/terminal/Quote.js +11 -2
- package/package.json +1 -1
- package/src/service/printer/DefaultPrinterService.ts +9 -1
- package/src/service/printer/terminal/Quote.ts +11 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultPrinterService.d.ts","sourceRoot":"","sources":["../../../../src/service/printer/DefaultPrinterService.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EACL,KAAK,IAAI,EACT,KAAK,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,QAAQ,MAAM,4BAA4B,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,qBAAsB,YAAW,cAAc;;IAClE,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultPrinterService.d.ts","sourceRoot":"","sources":["../../../../src/service/printer/DefaultPrinterService.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EACL,KAAK,IAAI,EACT,KAAK,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,QAAQ,MAAM,4BAA4B,CAAC;AAGvD,OAAO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italicText() etc. wrap the *entire*
|
|
27
|
+
// passed-in text (including a trailing "\n", when the caller's message already ends with
|
|
28
|
+
// one) with a reset sequence appended *after* that newline, e.g. "foo\n" -> "<color>foo\n
|
|
29
|
+
// <reset>". Checking endsWith("\n") on the styled text is then always false, so the
|
|
30
|
+
// subtraction below never fires and every such line is over-counted by one - which, summed
|
|
31
|
+
// across every write in a marked region, causes clearMarked() to erase far more physical
|
|
32
|
+
// rows than were actually written (see #150).
|
|
33
|
+
const stripped = Bun.stripANSI(message);
|
|
34
|
+
return stripped.split("\n").length - (stripped.endsWith("\n") ? 1 : 0);
|
|
27
35
|
}
|
|
28
36
|
#recordMarkedWrite(message) {
|
|
29
37
|
if (this.#markedLineCount === undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Quote.d.ts","sourceRoot":"","sources":["../../../../../src/service/printer/terminal/Quote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAWtD,MAAM,CAAC,OAAO,OAAO,KAAK;;gBAIL,MAAM,EAAE,MAAM;IAIjC,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAEM,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzB,GAAG,IAAI,IAAI;IA6BX,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"Quote.d.ts","sourceRoot":"","sources":["../../../../../src/service/printer/terminal/Quote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAWtD,MAAM,CAAC,OAAO,OAAO,KAAK;;gBAIL,MAAM,EAAE,MAAM;IAIjC,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAEM,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzB,GAAG,IAAI,IAAI;IA6BX,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;CAqB5C"}
|
|
@@ -42,8 +42,17 @@ export default class Quote {
|
|
|
42
42
|
if (!this.isActive) {
|
|
43
43
|
return message;
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
// colorText()/italicText() etc. wrap an entire passed-in string - including a trailing
|
|
46
|
+
// "\n", when the caller's message already ends with one - with a reset sequence appended
|
|
47
|
+
// *after* that newline (e.g. "foo\n" -> "<color>foo\n<reset>"). Naively checking
|
|
48
|
+
// endsWith("\n") on such styled text is always false, and splitting on "\n" then treats the
|
|
49
|
+
// trailing reset sequence as a spurious extra line, which gets its own quote prefix -
|
|
50
|
+
// rendering as if two quote levels were active for a single actual line (see #150). Every
|
|
51
|
+
// line gets re-colored below regardless, so strip all existing ANSI upfront rather than
|
|
52
|
+
// trying to preserve and restore it.
|
|
53
|
+
const body = Bun.stripANSI(message);
|
|
54
|
+
const endsWithNewline = body.endsWith("\n");
|
|
55
|
+
const raw = endsWithNewline ? body.slice(0, -1) : body;
|
|
47
56
|
const color = this.#levels[this.#levels.length - 1].color;
|
|
48
57
|
const lines = raw
|
|
49
58
|
.split("\n")
|
package/package.json
CHANGED
|
@@ -33,7 +33,15 @@ export default class DefaultPrinterService implements PrinterService {
|
|
|
33
33
|
#markEndedAt: number | undefined;
|
|
34
34
|
|
|
35
35
|
#countLines(message: string): number {
|
|
36
|
-
|
|
36
|
+
// Strip ANSI escape sequences first: colorText()/italicText() etc. wrap the *entire*
|
|
37
|
+
// passed-in text (including a trailing "\n", when the caller's message already ends with
|
|
38
|
+
// one) with a reset sequence appended *after* that newline, e.g. "foo\n" -> "<color>foo\n
|
|
39
|
+
// <reset>". Checking endsWith("\n") on the styled text is then always false, so the
|
|
40
|
+
// subtraction below never fires and every such line is over-counted by one - which, summed
|
|
41
|
+
// across every write in a marked region, causes clearMarked() to erase far more physical
|
|
42
|
+
// rows than were actually written (see #150).
|
|
43
|
+
const stripped = Bun.stripANSI(message);
|
|
44
|
+
return stripped.split("\n").length - (stripped.endsWith("\n") ? 1 : 0);
|
|
37
45
|
}
|
|
38
46
|
|
|
39
47
|
#recordMarkedWrite(message: string): void {
|
|
@@ -58,8 +58,17 @@ export default class Quote {
|
|
|
58
58
|
if (!this.isActive) {
|
|
59
59
|
return message;
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
// colorText()/italicText() etc. wrap an entire passed-in string - including a trailing
|
|
62
|
+
// "\n", when the caller's message already ends with one - with a reset sequence appended
|
|
63
|
+
// *after* that newline (e.g. "foo\n" -> "<color>foo\n<reset>"). Naively checking
|
|
64
|
+
// endsWith("\n") on such styled text is always false, and splitting on "\n" then treats the
|
|
65
|
+
// trailing reset sequence as a spurious extra line, which gets its own quote prefix -
|
|
66
|
+
// rendering as if two quote levels were active for a single actual line (see #150). Every
|
|
67
|
+
// line gets re-colored below regardless, so strip all existing ANSI upfront rather than
|
|
68
|
+
// trying to preserve and restore it.
|
|
69
|
+
const body = Bun.stripANSI(message);
|
|
70
|
+
const endsWithNewline = body.endsWith("\n");
|
|
71
|
+
const raw = endsWithNewline ? body.slice(0, -1) : body;
|
|
63
72
|
const color = this.#levels[this.#levels.length - 1]!.color;
|
|
64
73
|
const lines = raw
|
|
65
74
|
.split("\n")
|