Skip to content

Commit df73d52

Browse files
fix: widen displayMode constraint to a string as plugins can't dynamically register for their own display modes yet
1 parent 06356f2 commit df73d52

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

packages/skott/src/rendering/terminal/terminal-config.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as D from "io-ts/lib/Decoder.js";
33

44
export interface TerminalConfig {
55
watch: boolean;
6-
displayMode: "raw" | "file-tree" | "graph" | "webapp";
6+
displayMode: "raw" | "file-tree" | "graph" | "webapp" | (string & {});
77
showCircularDependencies: boolean;
88
showUnusedDependencies: boolean;
99
showUnusedFiles: boolean;
@@ -21,12 +21,10 @@ export const defaultTerminalConfig: TerminalConfig = {
2121

2222
const terminalSchema = D.struct({
2323
watch: D.boolean,
24-
displayMode: D.union(
25-
D.literal("raw"),
26-
D.literal("file-tree"),
27-
D.literal("graph"),
28-
D.literal("webapp")
29-
),
24+
// Allow any string so that plugin-provided display modes (e.g. "json") are
25+
// not rejected at validation time. Unknown modes are forwarded to the
26+
// static-file plugin at runtime.
27+
displayMode: D.string,
3028
showCircularDependencies: D.boolean,
3129
showUnusedDependencies: D.boolean,
3230
exitCodeOnCircularDependencies: D.number

0 commit comments

Comments
 (0)