From 86a85c5ad5816160cead2c0067591837ecc25e37 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 27 Jan 2023 10:56:18 +0100 Subject: [PATCH] fix swizzle test failures related to https://github.com/facebook/docusaurus/pull/7945 not being backported in practice --- .../src/getSwizzleConfig.ts | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-theme-classic/src/getSwizzleConfig.ts b/packages/docusaurus-theme-classic/src/getSwizzleConfig.ts index 833c28465c..1d5f811cbc 100644 --- a/packages/docusaurus-theme-classic/src/getSwizzleConfig.ts +++ b/packages/docusaurus-theme-classic/src/getSwizzleConfig.ts @@ -20,6 +20,14 @@ export default function getSwizzleConfig(): SwizzleConfig { description: 'The component used to render multi-line code blocks, generally used in Markdown files.', }, + 'CodeBlock/Content': { + actions: { + eject: 'unsafe', + wrap: 'forbidden', + }, + description: + 'The folder containing components responsible for rendering different types of CodeBlock content.', + }, ColorModeToggle: { actions: { eject: 'safe', @@ -44,6 +52,17 @@ export default function getSwizzleConfig(): SwizzleConfig { description: 'The component responsible for rendering a list of sidebar items cards.\nNotable used on the category generated-index pages.', }, + 'DocItem/TOC': { + actions: { + // Forbidden because it's a parent folder, makes the CLI crash atm + // TODO the CLI should rather support --eject + // Subfolders can be swizzled + eject: 'forbidden', + wrap: 'forbidden', + }, + description: + 'The DocItem TOC is not directly swizzle-able, but you can swizzle its sub-components.', + }, DocSidebar: { actions: { eject: 'unsafe', // Too much technical code in sidebar, not very safe atm @@ -109,6 +128,17 @@ export default function getSwizzleConfig(): SwizzleConfig { }, description: 'The footer logo', }, + Icon: { + actions: { + // Forbidden because it's a parent folder, makes the CLI crash atm + // TODO the CLI should rather support --eject + // Subfolders can be swizzled + eject: 'forbidden', + wrap: 'forbidden', + }, + description: + 'The Icon folder is not directly swizzle-able, but you can swizzle its sub-components.', + }, 'Icon/Arrow': { actions: { eject: 'safe', @@ -228,7 +258,7 @@ export default function getSwizzleConfig(): SwizzleConfig { wrap: 'forbidden', }, description: - 'The Navbar item components mapping. Can be ejected to add custom navbar item types. See https://github.com/facebook/docusaurus/issues/7227.', + 'The Navbar item components mapping. Can be ejected to add custom navbar item types.\nSee https://github.com/facebook/docusaurus/issues/7227.', }, NotFound: { actions: {