From 1e4ffe5d1dca6ac7cd7d476fdcfbc08c6ca779b8 Mon Sep 17 00:00:00 2001 From: Kumar Anirudha Date: Sat, 19 Aug 2023 16:09:00 +0530 Subject: [PATCH] updated nodejs version requirement --- plugins/docs/dist/index.d.ts | 5 --- plugins/docs/dist/index.js | 77 ------------------------------------ 2 files changed, 82 deletions(-) delete mode 100644 plugins/docs/dist/index.d.ts delete mode 100644 plugins/docs/dist/index.js diff --git a/plugins/docs/dist/index.d.ts b/plugins/docs/dist/index.d.ts deleted file mode 100644 index c5290b5768f..00000000000 --- a/plugins/docs/dist/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { LoadContext, Plugin } from '@docusaurus/types'; -import { OptionValidationContext, PluginOptions } from './types'; -import { LoadedContent as DocsContentLoaded } from '@docusaurus/plugin-content-docs'; -export default function pluginDocs(context: LoadContext, options: PluginOptions): Promise>; -export declare function validateOptions({ validate, options, }: OptionValidationContext): PluginOptions; diff --git a/plugins/docs/dist/index.js b/plugins/docs/dist/index.js deleted file mode 100644 index fe1b820236f..00000000000 --- a/plugins/docs/dist/index.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateOptions = void 0; -const plugin_content_docs_1 = __importStar(require("@docusaurus/plugin-content-docs")); -async function pluginDocs(context, options) { - // Destructure to separate the Docusaurus docs plugin options - // and initialize the Docusaurus docs plugin to wrap. - const { globalSidebars, ...docsOptions } = options; - const plugin = await (0, plugin_content_docs_1.default)(context, docsOptions); - return { - ...plugin, - // Override the `contentLoaded` function to add sidebars to the - // global data exposed by the Docusaurus docs plugin. - contentLoaded: async ({ actions, content, ...args }) => { - const globalSidebarEntries = []; - const createData = async (name, data) => { - // Hook into the `createData` call to extract the sidebars we need. - const versionMetadata = JSON.parse(data); - if (versionMetadata.docsSidebars) { - // We can do this, because all `createData` calls are assured - // to resolve before `setGlobalData` is called. - Object.entries(versionMetadata.docsSidebars) - .filter(([sidebarId]) => globalSidebars.includes(sidebarId)) - .forEach((entry) => globalSidebarEntries.push(entry)); - } - return await actions.createData(name, data); - }; - const setGlobalData = (data) => { - actions.setGlobalData({ - ...data, - globalSidebars: Object.fromEntries(globalSidebarEntries), - }); - }; - await plugin.contentLoaded({ - ...args, - content, - actions: { - ...actions, - createData, - setGlobalData, - }, - }); - }, - }; -} -exports.default = pluginDocs; -function validateOptions({ validate, options, }) { - const { globalSidebars = [], ...docsOptions } = options; - return { - ...(0, plugin_content_docs_1.validateOptions)({ validate, options: docsOptions }), - globalSidebars, - }; -} -exports.validateOptions = validateOptions;