From 0bfc28d43b420e11aa056783905f274bf4a19765 Mon Sep 17 00:00:00 2001 From: Hossein Mehrabi Date: Fri, 24 Nov 2023 17:28:29 +0330 Subject: [PATCH] fix(docusaurus-remote-content): more plugin option names more explicit --- .../docusaurus-remote-content/src/index.ts | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/docusaurus-remote-content/src/index.ts b/packages/docusaurus-remote-content/src/index.ts index bbf46d7..dea39bd 100644 --- a/packages/docusaurus-remote-content/src/index.ts +++ b/packages/docusaurus-remote-content/src/index.ts @@ -81,16 +81,16 @@ type PluginOptions = { } // The directory in the remote repository containing the content to be copied - contentDir: string + sourceDir: string // The directory in the local site to copy the content to outDir: string // Exclude files matching these glob patterns - exclude?: string[] + excludeRemote?: string[] // Keep local files matching these glob patterns - keep?: string[] + keepLocal?: string[] // Keep local static files matching these glob patterns keepStatic?: string[] @@ -105,7 +105,7 @@ export default async function remoteContentPlugin( const zipDir = path.join(tempDir.name, 'zip') const downloadRemoteContent = async () => { - const { remote, contentDir, outDir, exclude = [], keep = [] } = options + const { remote, sourceDir, outDir } = options if (remote.type === 'zip') { const zip = await axios @@ -127,14 +127,20 @@ export default async function remoteContentPlugin( } const copyRemoteContent = async () => { - const { remote, contentDir, outDir, exclude = [], keep = [] } = options + const { + remote, + sourceDir, + outDir, + excludeRemote = [], + keepLocal = [], + } = options await copyContent( - path.join(repoDir, contentDir), + path.join(repoDir, sourceDir), path.join(context.siteDir, outDir), { - exclude, - keep, + exclude: excludeRemote, + keep: keepLocal, }, )