From 77f2b29e60f575013bf4fdd2b55490a15e600fc8 Mon Sep 17 00:00:00 2001 From: Adelina Simion <43963729+addetz@users.noreply.github.com> Date: Thu, 23 May 2024 15:38:31 +0200 Subject: [PATCH] docs: add PartialsComponent to handle Docusaurus Markdown Imports in librarium DOC-1189 (#2887) * docs: add PartialsComponent to handle Docusaurus Markdown Imports in librarium DOC-1189 docs: prototype partials DOC-1159 docs: add comments to component docs: add partial categories docs: add partial categories docs: add frontmatter approach docs: add duplicate key validation docs: add generate-partials script docs: add more error handling docs: add generate-partials to build docs: add partials to npm run docs: adjust build with partials docs: demo docs: demo docs: done docs: done docs: done docs: add VersionedLink docs:add final version of partials importer DOC-1189 docs: fix formatting DOC-1189 docs: fix eslint docs: add kubernetes version downgrade warning and hello-universe pack version DOC-1165 DOC-1174 (#2786) * docs: add kubernetes version downgrade warning and hello-universe pack version DOC-1165 DOC-1174 This patch makes the following changes: - Adds Kubernetes downgrade warning to cluster update and Kubernetes packs - Adds version 1.1.2 to the hello-universe pack * docs: fix formatting * Apply suggestions from code review Co-authored-by: caroldelwing * docs: fix formatting * docs: fix broken table * docs: add warning to microk8s, k3s and rke2 --------- Co-authored-by: caroldelwing docs: 4.3 API Docs (#2807) Co-authored-by: Karl Cardenas docs: update hardware-requirements.md (#2809) Co-authored-by: Karl Cardenas docs: DOC-1150 deprecated packs clarification (#2682) * docs: DOC-1150 * chore: final touches * Apply suggestions from code review Co-authored-by: caroldelwing * chore: prettier --------- Co-authored-by: caroldelwing docs: DOC-1162 DOC-1078 DOC-1136 Rhel pxk fips (#2728) * docs: DOC-1162 * docs: fixed BYOOS issue * chore: updated table * docs: added BYOOS table * docs: FIPS draft-1 * docs: fips steps * docs: added non-fips workflow * Apply suggestions from code review Co-authored-by: Adelina Simion <43963729+addetz@users.noreply.github.com> * Optimised images with calibre/image-actions * Optimised images with calibre/image-actions * Optimised images with calibre/image-actions * docs: feedback * Optimised images with calibre/image-actions * Optimised images with calibre/image-actions * chore: update to URL --------- Co-authored-by: Adelina Simion <43963729+addetz@users.noreply.github.com> Co-authored-by: vault-token-factory-spectrocloud[bot] <133815545+vault-token-factory-spectrocloud[bot]@users.noreply.github.com> chore: fix tf code (#2830) docs: DOC-1166 image update (#2773) * docs: DOC-1166 image update * Optimised images with calibre/image-actions * Optimised images with calibre/image-actions * Optimised images with calibre/image-actions * Optimised images with calibre/image-actions * docs: language touch-up * Update docs/docs-content/architecture/orchestration-spectrocloud.md * Apply suggestions from code review Co-authored-by: caroldelwing * chore: updated language --------- Co-authored-by: vault-token-factory-spectrocloud[bot] <133815545+vault-token-factory-spectrocloud[bot]@users.noreply.github.com> Co-authored-by: caroldelwing docs: update crossplane provider version (#2837) chore: bump eslint-plugin-react from 7.33.2 to 7.34.1 (#2734) Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.33.2 to 7.34.1. - [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases) - [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md) - [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.33.2...v7.34.1) --- updated-dependencies: - dependency-name: eslint-plugin-react dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lenny Chen <55669665+lennessyy@users.noreply.github.com> docs: DOC-1149 airgap Support VM custom SSL Certs (#2846) * docs: DOC-1149 * chore: updated SSL cert message * Apply suggestions from code review Co-authored-by: Yuliia Horbenko <31223054+yuliiiah@users.noreply.github.com> * chore: fix format * chore: fix typo --------- Co-authored-by: Yuliia Horbenko <31223054+yuliiiah@users.noreply.github.com> docs: cluster profile resource usage computation (#2802) * Cluster profile resource usage computation Every version of the profile has a unique identifier and gets counted towards the profile resource usage. * chore: style update * chore: fixed page location --------- Co-authored-by: Karl Cardenas chore: bump @commitlint/cli from 17.8.1 to 19.3.0 (#2733) Bumps [@commitlint/cli](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cli) from 17.8.1 to 19.3.0. - [Release notes](https://github.com/conventional-changelog/commitlint/releases) - [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/cli/CHANGELOG.md) - [Commits](https://github.com/conventional-changelog/commitlint/commits/v19.3.0/@commitlint/cli) --- updated-dependencies: - dependency-name: "@commitlint/cli" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lenny Chen <55669665+lennessyy@users.noreply.github.com> docs: rename local mgmt api (#2845) * docs: rename local mgmt api * docs: incorprate feedback --------- Co-authored-by: Lenny Chen chore: bump @commitlint/config-conventional from 17.8.1 to 19.2.2 (#2735) * chore: bump @commitlint/config-conventional from 17.8.1 to 19.2.2 Bumps [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/config-conventional) from 17.8.1 to 19.2.2. - [Release notes](https://github.com/conventional-changelog/commitlint/releases) - [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/config-conventional/CHANGELOG.md) - [Commits](https://github.com/conventional-changelog/commitlint/commits/v19.2.2/@commitlint/config-conventional) --- updated-dependencies: - dependency-name: "@commitlint/config-conventional" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * resolve conflicts * Resolve conflicts --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lenny Chen <55669665+lennessyy@users.noreply.github.com> Co-authored-by: Lenny Chen docs: PAD-219 chore: update validator URL (#2875) docs: DOC-1188 (#2878) chore: fix path release date (#2880) docs: make minor fixes to local ui docs (#2854) * docs: make minor fixes to local ui docs * Update docs/docs-content/clusters/edge/edge-configuration/installer-reference.md Co-authored-by: Karl Cardenas --------- Co-authored-by: Lenny Chen Co-authored-by: Karl Cardenas docs: change fix build branch (#2884) * docs: change fips build branch * docs: remove main --------- Co-authored-by: Lenny Chen docs: make frontmatter anonymous class DOC-1189 docs: fix formatting docs: fix last lints ci: updated logic to enable Netlify previews for release branch PRs (#2888) docs: add readme instructions and extra tests DOC-1189 * docs: add partial example DOC-1189 (cherry picked from commit 4a330f396db27d217f63005bc92bd483db05bd1c) --- .gitignore | 5 +- Makefile | 6 ++ README.md | 58 ++++++++++++++++++ _partials/_partial_example.mdx | 8 +++ .../getting-started/getting-started.md | 2 +- docusaurus.config.js | 11 ++++ package.json | 3 +- scripts/generate-partials.sh | 26 ++++++++ .../PartialsComponent.test.tsx | 41 +++++++++++++ .../PartialsComponent/PartialsComponent.tsx | 30 ++++++++++ .../PartialsComponent/PartialsImporter.tsx | 51 ++++++++++++++++ src/components/PartialsComponent/index.ts | 3 + src/components/VersionedLink/CheckVersion.tsx | 14 +++++ .../VersionedLink/VersionedLink.test.tsx | 59 +++++++++++++++++++ .../VersionedLink/VersionedLink.tsx | 26 ++++++++ src/components/VersionedLink/index.ts | 3 + src/theme/MDXComponents/MDXComponents.ts | 4 ++ tsconfig.json | 4 +- 18 files changed, 349 insertions(+), 5 deletions(-) create mode 100644 _partials/_partial_example.mdx create mode 100755 scripts/generate-partials.sh create mode 100644 src/components/PartialsComponent/PartialsComponent.test.tsx create mode 100644 src/components/PartialsComponent/PartialsComponent.tsx create mode 100644 src/components/PartialsComponent/PartialsImporter.tsx create mode 100644 src/components/PartialsComponent/index.ts create mode 100644 src/components/VersionedLink/CheckVersion.tsx create mode 100644 src/components/VersionedLink/VersionedLink.test.tsx create mode 100644 src/components/VersionedLink/VersionedLink.tsx create mode 100644 src/components/VersionedLink/index.ts diff --git a/.gitignore b/.gitignore index 963ea4bf1e..ab85ffdb40 100644 --- a/.gitignore +++ b/.gitignore @@ -60,4 +60,7 @@ screenshots/ tests/screenshot.spec.ts-snapshots/ test-results/ playwright-report/ -artifact.zip \ No newline at end of file +artifact.zip + +# Ignore _partials/index.ts +_partials/index.ts diff --git a/Makefile b/Makefile index 98db486774..b4e4958dfd 100644 --- a/Makefile +++ b/Makefile @@ -58,6 +58,7 @@ init: ## Initialize npm dependencies npx husky install start: ## Start a local development server + make generate-partials npm run start build: ## Run npm build @@ -203,6 +204,11 @@ format-images: ## Format images @echo "formatting images in /static/assets/docs/images/ folder" ./scripts/compress-convert-images.sh +###@ Generate _partials/index.ts required to automatic partials usage. + +generate-partials: ## Generate + ./scripts/generate-partials.sh + ###@ Aloglia Indexing update-dev-index: ## Update the Algolia index for the dev environment diff --git a/README.md b/README.md index c0ea9ad096..7391148ee3 100644 --- a/README.md +++ b/README.md @@ -530,6 +530,64 @@ scheme. The rows of cards are dynamically created according to the list of speci /> ``` +## Partials Component + +This is a custom component that allows you to create and use +[Import Markdown](https://docusaurus.io/docs/3.2.1/markdown-features/react#importing-markdown). + +Partials must be created under the `_partials` folder. They must be named using an `_` prefix and the `*.mdx` filetype. +Partials may be organised in any further subfolders as required. For example, you could create +`_partials/public-cloud/_palette_setup.mdx`. + +In order to aid with organisation and categorization, partials must have a `partial_category` and `partial_name` defined +in their frontmatter: + +```mdx +--- +partial_category: public-cloud +partial_name: palette-setup +--- + +This is how you set up Palette in {props.cloud}. +``` + +Partials are customized using properties which can be read using the `{props.field}` syntax. + +Once your partial has been created, run the `make generate-partials` command to make your partial available for use. +This command will also be invoked during the `make start` and `make build` commands. + +Finally, you can reference your partial in any `*.md` file by using the `PartialsComponent`, together with the specified +category and name of the partial: + +```md + +``` + +Note that the `cloud` field corresponds to the `{props.cloud}` reference in the `*.mdx` file. + +### Internal Links + +Due to the complexities of Docusaurus plugin rendering, links do not support versioning in `*.mdx` files. If you want to +add an internal link you will have to use the `VersionedLink` component inside the `*.mdx` file. + +```mdx +--- +partial_category: public-cloud +partial_name: palette-setup +--- + +This is how you set up Palette in {props.cloud}. + +This is an . +``` + +The path of the link should be the path of the destination file from the root directory, without any back operators +`..`. External links can be referenced as usual. + ## Netlify Previews By default Netlify previews are enabled for pull requests. However, some branches do not require Netlify previews. In diff --git a/_partials/_partial_example.mdx b/_partials/_partial_example.mdx new file mode 100644 index 0000000000..6b25571ad6 --- /dev/null +++ b/_partials/_partial_example.mdx @@ -0,0 +1,8 @@ +--- +partial_category: example-cat +partial_name: example-name +--- + +This is an example partial with an example property. {props.message} + +Read more about how to use partials in our [README](https://github.com/spectrocloud/librarium/blob/master/README.md). diff --git a/docs/docs-content/getting-started/getting-started.md b/docs/docs-content/getting-started/getting-started.md index f1d604e9c8..a3383a9a59 100644 --- a/docs/docs-content/getting-started/getting-started.md +++ b/docs/docs-content/getting-started/getting-started.md @@ -33,7 +33,7 @@ The first step towards adopting Palette in your organization is to We have curated the pages in the Getting Started section to give you a gradual introduction to the fundamental concepts and workflows you need to deploy and manage Kubernetes clusters through Palette. -
+
![Overview of the getting started journey rocket](/getting-started/getting-started_getting-started_journey-overview.webp) diff --git a/docusaurus.config.js b/docusaurus.config.js index fa9738dc0b..39a3fb183b 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -7,6 +7,7 @@ const darkCodeTheme = themes.dracula; const redirects = require("./redirects"); const { pluginPacksAndIntegrationsData } = require("./plugins/packs-integrations"); const { pluginImportFontAwesomeIcons } = require("./plugins/font-awesome"); +import path from "path"; /** @type {import('@docusaurus/types').Config} */ const config = { @@ -378,3 +379,13 @@ const config = { }, }; module.exports = config; + +export default function (context, options) { + return { + name: "@docusaurus/plugin-content-docs", + getPathsToWatch() { + const contentPath = path.resolve(context.siteDir, options.path); + return [`${contentPath}/_partials/*/*.{mdx}`]; + }, + }; +} diff --git a/package.json b/package.json index e7ad8b7676..bd2bce2a41 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "docusaurus": "docusaurus", "start": "docusaurus start --host 0.0.0.0 --port 9000", - "build": "npm run generate-api-docs && docusaurus build", + "build": "npm run generate-api-docs && npm run generate-partials && docusaurus build", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", @@ -18,6 +18,7 @@ "generate-api-docs": "npm run run-api-parser && docusaurus gen-api-docs palette", "clean-api-docs": "docusaurus clean-api-docs palette", "run-api-parser": "node utils/api-parser/index.js", + "generate-partials": "./scripts/generate-partials.sh", "lint": "eslint . --ext .js,.ts,.jsx,.tsx", "lint:fix": "npm run lint -- --fix", "format": "prettier --write \"**/*.{js,jsx,json,ts,tsx,md,mdx,css}\"", diff --git a/scripts/generate-partials.sh b/scripts/generate-partials.sh new file mode 100755 index 0000000000..a2e14dc9ee --- /dev/null +++ b/scripts/generate-partials.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Enable error handling +set -e + +echo "Starting generation of _partials/index.ts." + +# # Remove the index.ts file if it exists already. +rm -f _partials/index.ts + +# Make the _partials folder an index.ts file +mkdir -p _partials +touch _partials/index.ts + +# Create the file and add the generated warning. +echo "// This file is generated. DO NOT EDIT!" >> _partials/index.ts + +# Find all the MDX files recursively in the _partials folder. +# Loop through each file. +find _partials -name "*.mdx" -print0 | while read -d $'\0' path +do + module_name=$(basename ${path} .mdx | tr -d '_' | tr -d '-') + echo "export * as ${module_name}${RANDOM} from '@site/${path}';" >> _partials/index.ts +done + +echo "Completed generation of _partials/index.ts." diff --git a/src/components/PartialsComponent/PartialsComponent.test.tsx b/src/components/PartialsComponent/PartialsComponent.test.tsx new file mode 100644 index 0000000000..ca1588ab16 --- /dev/null +++ b/src/components/PartialsComponent/PartialsComponent.test.tsx @@ -0,0 +1,41 @@ +import React, { FunctionComponent } from "react"; +import { render, screen } from "@testing-library/react"; + +let category = "testCat1"; +let name = "nameCat1"; +let propValue = "testValue1"; + +const Partial: React.FunctionComponent<{}> = ({}) => ( +
+

{category}

+

{name}

+

{propValue}

+
+); + +jest.mock("./PartialsImporter", () => { + return jest.fn(() => { + const mapKey = category.concat("#").concat(name); + const pmap: PartialsMap = {}; + pmap[mapKey] = Partial as FunctionComponent; + return pmap; + }); +}); + +import PartialsComponent from "./PartialsComponent"; +import { PartialsMap } from "./PartialsImporter"; + +describe("Partials Component", () => { + it("partial exists", () => { + render(); + expect(screen.getByText(category)).toBeInTheDocument(); + expect(screen.getByText(name)).toBeInTheDocument(); + expect(screen.getByText(propValue)).toBeInTheDocument(); + }); + + it("partial does not exist", () => { + expect(() => render()).toThrow( + "No partial found for name unknownName in category unknownCat." + ); + }); +}); diff --git a/src/components/PartialsComponent/PartialsComponent.tsx b/src/components/PartialsComponent/PartialsComponent.tsx new file mode 100644 index 0000000000..3c5b180109 --- /dev/null +++ b/src/components/PartialsComponent/PartialsComponent.tsx @@ -0,0 +1,30 @@ +import React from "react"; +import ImportPartials from "./PartialsImporter"; + +interface ComponentProperties { + [key: string]: string; +} + +const AllPartials = ImportPartials(); + +export default function PartialsComponent(details: ComponentProperties): React.ReactElement { + const mapKey = details.category.concat("#").concat(details.name); + + if (!AllPartials[mapKey]) { + throw new Error( + "No partial found for name ".concat(details.name).concat(" in category ").concat(details.category).concat(".") + ); + } + + // Map elements to object properties + const propAttribute: { [key: string]: string } = {}; + for (const key in details) { + // Don't send category and name to the partial + if (key == "category" || key == "name") { + continue; + } + propAttribute[key] = details[key]; + } + + return React.createElement(AllPartials[mapKey], propAttribute); +} diff --git a/src/components/PartialsComponent/PartialsImporter.tsx b/src/components/PartialsComponent/PartialsImporter.tsx new file mode 100644 index 0000000000..b9441d67a7 --- /dev/null +++ b/src/components/PartialsComponent/PartialsImporter.tsx @@ -0,0 +1,51 @@ +import { FunctionComponent } from "react"; +// Import all the partials as one module. +import * as PartialModules from "@site/_partials"; + +export interface PartialsMap { + [key: string]: FunctionComponent; +} + +interface Modules { + [key: string]: Module; +} + +interface Module { + frontMatter: { + partial_category: string; + partial_name: string; + }; + default: FunctionComponent; +} + +export default function ImportPartials(): PartialsMap { + const pmap: PartialsMap = {}; + const allPartialModules: Modules = PartialModules; + + // The keys are the names of each exported module in _partials/index.ts + const partialKeys: string[] = Object.keys(allPartialModules); + partialKeys.map(function (pkey) { + const currentPartial: Module = allPartialModules[pkey]; + const catFrontMatter = currentPartial.frontMatter.partial_category; + const nameFrontMatter = currentPartial.frontMatter.partial_name; + + if (!catFrontMatter || !nameFrontMatter) { + throw new Error("Please specify partial_category and partial_name for ".concat(pkey).concat(".")); + } + + const mapKey = catFrontMatter.concat("#").concat(nameFrontMatter); + if (pmap[mapKey]) { + throw new Error( + "Duplicate partial defined for name " + .concat(nameFrontMatter) + .concat(" in category ") + .concat(catFrontMatter) + .concat(".") + ); + } + + pmap[mapKey] = currentPartial.default; + }); + + return pmap; +} diff --git a/src/components/PartialsComponent/index.ts b/src/components/PartialsComponent/index.ts new file mode 100644 index 0000000000..2726299b81 --- /dev/null +++ b/src/components/PartialsComponent/index.ts @@ -0,0 +1,3 @@ +import PartialsComponent from "./PartialsComponent"; + +export default PartialsComponent; diff --git a/src/components/VersionedLink/CheckVersion.tsx b/src/components/VersionedLink/CheckVersion.tsx new file mode 100644 index 0000000000..0f98918398 --- /dev/null +++ b/src/components/VersionedLink/CheckVersion.tsx @@ -0,0 +1,14 @@ +import { useActivePluginAndVersion } from "@docusaurus/plugin-content-docs/client"; + +export default function GetVersionPath() { + const activePlugin = useActivePluginAndVersion(); + if ( + activePlugin != undefined && + activePlugin.activeVersion != undefined && + activePlugin.activeVersion.name != "current" + ) { + return activePlugin.activeVersion.path; + } + + return ""; +} diff --git a/src/components/VersionedLink/VersionedLink.test.tsx b/src/components/VersionedLink/VersionedLink.test.tsx new file mode 100644 index 0000000000..61b824cd5b --- /dev/null +++ b/src/components/VersionedLink/VersionedLink.test.tsx @@ -0,0 +1,59 @@ +import React from "react"; +import { render, screen } from "@testing-library/react"; +import VersionedLink from "./VersionedLink"; + +let prevVersionPath = ""; +jest.mock("./CheckVersion", () => { + return jest.fn(() => { + return prevVersionPath; + }); +}); + +describe("Versioned link", () => { + it("latest version", () => { + prevVersionPath = ""; + const text = "Test link"; + const url = "/path/url"; + render(); + const link = screen.getByText(text).getAttribute("href"); + expect(link).not.toBeNull(); + expect(link).toBe(url); + }); + + it("previous version", () => { + prevVersionPath = "/v4.3.1"; + const text = "Test link"; + const url = "/path/url"; + render(); + const link = screen.getByText(text).getAttribute("href"); + expect(link).not.toBeNull(); + expect(link).toBe(prevVersionPath.concat(url)); + }); + + it("url with back dots", () => { + prevVersionPath = ""; + const text = "Test link"; + const url = "../path/url"; + expect(() => render()).toThrow( + "Versioned links should provide the path of the destination URL from root, without any `./` or `..` references." + ); + }); + + it("url with back relative reference", () => { + prevVersionPath = ""; + const text = "Test link"; + const url = "./path/url"; + expect(() => render()).toThrow( + "Versioned links should provide the path of the destination URL from root, without any `./` or `..` references." + ); + }); + + it("url with external domain", () => { + prevVersionPath = ""; + const text = "Test link"; + const url = "https://google.com"; + expect(() => render()).toThrow( + "Versioned links should not be used for external URLs. Please use the default markdown syntax instead." + ); + }); +}); diff --git a/src/components/VersionedLink/VersionedLink.tsx b/src/components/VersionedLink/VersionedLink.tsx new file mode 100644 index 0000000000..ee67c639ed --- /dev/null +++ b/src/components/VersionedLink/VersionedLink.tsx @@ -0,0 +1,26 @@ +import React from "react"; +import GetVersionPath from "./CheckVersion"; + +interface ComponentProperties { + [key: string]: string; +} + +export default function VersionedLink(props: ComponentProperties) { + const path = GetVersionPath(); + if (props.url.includes("..") || props.url.includes("./")) { + throw new Error( + "Versioned links should provide the path of the destination URL from root, without any `./` or `..` references." + ); + } + if (props.url.includes("https") || props.url.includes("http")) { + throw new Error( + "Versioned links should not be used for external URLs. Please use the default markdown syntax instead." + ); + } + if (path != "") { + const versionedURL = path.concat(props.url); + return {props.text}; + } + + return {props.text}; +} diff --git a/src/components/VersionedLink/index.ts b/src/components/VersionedLink/index.ts new file mode 100644 index 0000000000..d6c9d7b137 --- /dev/null +++ b/src/components/VersionedLink/index.ts @@ -0,0 +1,3 @@ +import VersionedLink from "./VersionedLink"; + +export default VersionedLink; diff --git a/src/theme/MDXComponents/MDXComponents.ts b/src/theme/MDXComponents/MDXComponents.ts index a8fef8a3af..d4109ec1a2 100644 --- a/src/theme/MDXComponents/MDXComponents.ts +++ b/src/theme/MDXComponents/MDXComponents.ts @@ -11,6 +11,8 @@ import PacksTable from "@site/src/components/PacksTable/PacksTable"; import TOCInline from "@theme/TOCInline"; import SimpleCardGrid from "@site/src/components/SimpleCardGrid/index"; import ReleaseNotesVersions from "@site/src/components/ReleaseNotesVersions/index"; +import PartialsComponent from "@site/src/components/PartialsComponent"; +import VersionedLink from "@site/src/components/VersionedLink"; export default { ...MDXComponents, @@ -26,4 +28,6 @@ export default { TOCInline, SimpleCardGrid, ReleaseNotesVersions, + PartialsComponent, + VersionedLink, }; diff --git a/tsconfig.json b/tsconfig.json index fb40eed842..ca7a77d59b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,10 @@ { // This file is not used in compilation. It is here just for a nice editor experience. "extends": "@tsconfig/docusaurus/tsconfig.json", - "include": ["src", "declarations.d.ts", "utils"], + "include": ["src", "declarations.d.ts", "utils", "**/*.mdx",], "exclude": ["src/deprecated"], "compilerOptions": { - "types": ["node", "jest", "@testing-library/jest-dom"], + "types": ["node", "jest", "@testing-library/jest-dom", "mdx"], "esModuleInterop": true, "target": "es6", "module": "Node16",