Skip to content

Commit e6996f0

Browse files
fix: enhance plugin display mode validation to support additional formats
1 parent df73d52 commit e6996f0

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ node_modules
22
.pnpm-debug.log
33
.pnpm-store
44
.DS_Store
5-
.npmrc
5+
.npmrc
6+
.idea
7+
.claude

packages/skott/src/rendering/terminal/static-file.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export async function renderStaticFile(
1414
try {
1515
const require = createRequire(import.meta.url);
1616
const pluginPath = require.resolve("@skottorg/static-file-plugin");
17+
1718
const { generateStaticFile, supportedStaticFileTypes } = await import(
1819
pluginPath
1920
);

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,22 @@ export const defaultTerminalConfig: TerminalConfig = {
2121

2222
const terminalSchema = D.struct({
2323
watch: D.boolean,
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,
24+
displayMode: D.union(
25+
D.literal("raw"),
26+
D.literal("file-tree"),
27+
D.literal("graph"),
28+
D.literal("webapp"),
29+
/**
30+
* Those could be coming from `@skottorg/static-file-plugin`.
31+
* We want to allow them since there is no way to register additional display
32+
* modes using plugins. This is a workaround to reduce friction but should be
33+
* addressed in the future by allowing plugins to register additional display modes.
34+
*/
35+
D.literal("md"),
36+
D.literal("json"),
37+
D.literal("svg"),
38+
D.literal("png")
39+
),
2840
showCircularDependencies: D.boolean,
2941
showUnusedDependencies: D.boolean,
3042
exitCodeOnCircularDependencies: D.number

0 commit comments

Comments
 (0)