@flowscripter/dynamic-cli-framework 1.1.2 → 1.1.3

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/bun.lock CHANGED
@@ -16,7 +16,7 @@
16
16
  "@types/bun": "^1.2.8",
17
17
  },
18
18
  "peerDependencies": {
19
- "typescript": "^5.8.2",
19
+ "typescript": "^5.8.3",
20
20
  },
21
21
  },
22
22
  },
@@ -55,7 +55,7 @@
55
55
 
56
56
  "ts-log": ["ts-log@2.2.7", "", {}, "sha512-320x5Ggei84AxzlXp91QkIGSw5wgaLT6GeAH0KsqDmRZdVWW2OiSeVvElVoatk3f7nicwXlElXsoFkARiGE2yg=="],
57
57
 
58
- "typescript": ["typescript@5.8.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ=="],
58
+ "typescript": ["typescript@5.8.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ=="],
59
59
 
60
60
  "undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="],
61
61
 
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  ],
19
19
  "module": "index.ts",
20
20
  "type": "module",
21
- "version": "1.1.2",
21
+ "version": "1.1.3",
22
22
  "publishConfig": {
23
23
  "access": "public"
24
24
  },
@@ -26,7 +26,7 @@
26
26
  "@types/bun": "^1.2.8"
27
27
  },
28
28
  "peerDependencies": {
29
- "typescript": "^5.8.2"
29
+ "typescript": "^5.8.3"
30
30
  },
31
31
  "dependencies": {
32
32
  "emphasize": "^7.0.0",
@@ -14,6 +14,7 @@ export default class DefaultAsciiBannerGeneratorService
14
14
  constructor() {
15
15
  this.registerFont("standard", standardFont.font);
16
16
  }
17
+
17
18
  getRegisteredFonts(): ReadonlyArray<string> {
18
19
  return this.#registeredFontNames;
19
20
  }
@@ -6,7 +6,11 @@ import json from "highlight.js/lib/languages/json";
6
6
  interface Emphasize {
7
7
  listLanguages(): ReadonlyArray<string>;
8
8
  registered(name: string): boolean;
9
- highlight(name: string, text: string): { value: string };
9
+ highlight(
10
+ name: string,
11
+ text: string,
12
+ sheet: Record<string, (string) => string> | undefined,
13
+ ): { value: string };
10
14
  register(name: string, syntax: HighlightSyntax): void;
11
15
  }
12
16
 
@@ -17,6 +21,7 @@ interface Emphasize {
17
21
  export default class DefaultSyntaxHighlighterService
18
22
  implements SyntaxHighlighterService {
19
23
  colorEnabled = true;
24
+ sheet: Record<string, (text: string) => string> | undefined;
20
25
  emphasize: Emphasize;
21
26
 
22
27
  constructor() {
@@ -39,7 +44,7 @@ export default class DefaultSyntaxHighlighterService
39
44
  return text;
40
45
  }
41
46
 
42
- return this.emphasize.highlight(name, text).value;
47
+ return this.emphasize.highlight(name, text, this.sheet).value;
43
48
  }
44
49
 
45
50
  registerSyntax(syntaxName: string, syntaxDefinition: HighlightSyntax): void {
@@ -46,6 +46,20 @@ export default class SyntaxHighlighterServiceProvider
46
46
  this.#defaultSyntaxHighlighterService.colorEnabled =
47
47
  printerService.colorEnabled;
48
48
 
49
+ if (this.#defaultSyntaxHighlighterService.sheet === undefined) {
50
+ this.#defaultSyntaxHighlighterService.sheet = {
51
+ comment: printerService.secondary,
52
+ keyword: printerService.primary,
53
+ built_in: printerService.primary,
54
+ type: printerService.emphasised,
55
+ operator: printerService.blue,
56
+ punctuation: printerService.green,
57
+ literal: printerService.selected,
58
+ string: printerService.selected,
59
+ number: printerService.selected,
60
+ };
61
+ }
62
+
49
63
  return Promise.resolve(undefined);
50
64
  }
51
65
  }
@@ -6,14 +6,24 @@ import { SHUTDOWN_SERVICE_ID } from "../../../src/api/service/core/ShutdownServi
6
6
  import DefaultShutdownService from "../../../src/service/shutdown/DefaultShutdownService.ts";
7
7
  import TtyTerminal from "../../../src/service/printer/terminal/TtyTerminal.ts";
8
8
  import StreamString from "../../fixtures/StreamString.ts";
9
+ import TtyStyler from "../../../src/service/printer/terminal/TtyStyler.ts";
10
+ import DefaultPrinterService from "../../../src/service/printer/DefaultPrinterService.ts";
9
11
 
10
12
  describe("PrinterServiceProvider tests", () => {
11
13
  test("PrinterServiceProvider provide works", async () => {
12
14
  const streamString = new StreamString();
13
- const printerServiceProvider = new PrinterServiceProvider(
14
- 100,
15
+ const printerService = new DefaultPrinterService(
15
16
  streamString.writableStream,
17
+ streamString.writableStream,
18
+ true,
19
+ true,
16
20
  new TtyTerminal(streamString.writeStream),
21
+ new TtyStyler(3),
22
+ );
23
+
24
+ const printerServiceProvider = new PrinterServiceProvider(
25
+ 100,
26
+ printerService,
17
27
  );
18
28
  const cliConfig = getCLIConfig();
19
29
  const context = new DefaultContext(cliConfig);