From 3c858289a5826c9fceddfb380a4e35d48b44a099 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Mon, 23 Sep 2024 14:09:33 +0200 Subject: [PATCH] Other (docs): Support for passing an array of files to ignore when preparing API. --- packages/ckeditor5-dev-docs/lib/build.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/ckeditor5-dev-docs/lib/build.js b/packages/ckeditor5-dev-docs/lib/build.js index 0254464f9..22312aa54 100644 --- a/packages/ckeditor5-dev-docs/lib/build.js +++ b/packages/ckeditor5-dev-docs/lib/build.js @@ -20,9 +20,12 @@ export default async function build( config ) { const sourceFilePatterns = config.sourceFiles.filter( Boolean ); const strictMode = config.strict || false; const extraPlugins = config.extraPlugins || []; + const ignoreFiles = config.ignoreFiles || []; const validatorOptions = config.validatorOptions || {}; - const files = await glob( sourceFilePatterns ); + const files = await glob( sourceFilePatterns, { + ignore: ignoreFiles + } ); const typeDoc = new TypeDoc.Application(); typeDoc.options.addReader( new TypeDoc.TSConfigReader() ); @@ -101,6 +104,8 @@ export default async function build( config ) { * * @property {Array.} sourceFiles Glob pattern with source files. * + * @property {Array.} [ignoreFiles=[]] Glob pattern with files to ignore. + * * @property {Boolean} [strict=false] If `true`, errors found during the validation will finish the process * and exit code will be changed to `1`. * @property {String} [outputPath] A path to the place where extracted doclets will be saved. Is an optional value due to tests.