From 8e151677b585bfc7b2933bac46588ef6edea9a06 Mon Sep 17 00:00:00 2001 From: r-dh <14875684+r-dh@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:55:17 +0200 Subject: [PATCH 1/2] fix: Allow markdown as valid option in configuration Running `repopack` with `output.style` set to `markdown` generates the following error: ``` Error: Invalid configuration in /Users/rdh/repos/playground/exalata_repopack/repopack.config.json: output.style must be either "plain" or "xml" ``` --- src/config/configValidate.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/configValidate.ts b/src/config/configValidate.ts index 591e2d9e..e6a65aa3 100644 --- a/src/config/configValidate.ts +++ b/src/config/configValidate.ts @@ -32,8 +32,8 @@ export function validateConfig(config: unknown): asserts config is RepopackConfi if (typeof style !== 'string') { throw new RepopackConfigValidationError('output.style must be a string'); } - if (style !== 'plain' && style !== 'xml') { - throw new RepopackConfigValidationError('output.style must be either "plain" or "xml"'); + if (style !== 'plain' && style !== 'xml' && style !== 'markdown') { + throw new RepopackConfigValidationError('output.style must be either "plain", "xml" or "markdown"'); } } } From c7709ad68af56402564bd7e3038df0036d95aaf8 Mon Sep 17 00:00:00 2001 From: r-dh <14875684+r-dh@users.noreply.github.com> Date: Tue, 15 Oct 2024 16:45:00 +0200 Subject: [PATCH 2/2] Fix: Update configValidate.test.ts to reflect new markdown support --- tests/config/configValidate.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/config/configValidate.test.ts b/tests/config/configValidate.test.ts index e6bd7798..08b77b11 100644 --- a/tests/config/configValidate.test.ts +++ b/tests/config/configValidate.test.ts @@ -46,6 +46,6 @@ describe('configValidate', () => { test('should throw for invalid output.style value', () => { const invalidConfig = { output: { style: 'invalid' } }; expect(() => validateConfig(invalidConfig)).toThrow(RepopackConfigValidationError); - expect(() => validateConfig(invalidConfig)).toThrow('output.style must be either "plain" or "xml"'); + expect(() => validateConfig(invalidConfig)).toThrow('output.style must be either "plain", "xml" or "markdown"'); }); });