From 854efd5190d0a5876fd880ba00d002630da011ee Mon Sep 17 00:00:00 2001 From: Deep Singhvi Date: Mon, 30 Sep 2024 15:01:05 -0400 Subject: [PATCH] fix(docs): ship up markdown files that contain components (#4776) --- packages/cli/cli/versions.yml | 8 ++++++++ packages/cli/docs-resolver/src/DocsDefinitionResolver.ts | 6 +++--- pnpm-lock.yaml | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/cli/cli/versions.yml b/packages/cli/cli/versions.yml index 9a6d65a86c1..5ee5c3d9f47 100644 --- a/packages/cli/cli/versions.yml +++ b/packages/cli/cli/versions.yml @@ -1,3 +1,11 @@ +- changelogEntry: + - summary: | + Any markdown files that have custom components are also pushed up to the Fern Docs + platform. + type: fix + irVersion: 53 + version: 0.43.8 + - changelogEntry: - summary: | The `valid-markdown` rule has been updated to try and parse the markdown file into a diff --git a/packages/cli/docs-resolver/src/DocsDefinitionResolver.ts b/packages/cli/docs-resolver/src/DocsDefinitionResolver.ts index b1535a0bff4..d2e92cde965 100644 --- a/packages/cli/docs-resolver/src/DocsDefinitionResolver.ts +++ b/packages/cli/docs-resolver/src/DocsDefinitionResolver.ts @@ -7,7 +7,7 @@ import { replaceReferencedMarkdown } from "@fern-api/docs-markdown-utils"; import { APIV1Write, DocsV1Write, FernNavigation } from "@fern-api/fdr-sdk"; -import { AbsoluteFilePath, listFiles, relative, RelativeFilePath, resolve } from "@fern-api/fs-utils"; +import { AbsoluteFilePath, listFiles, relative, RelativeFilePath, relativize, resolve } from "@fern-api/fs-utils"; import { generateIntermediateRepresentation } from "@fern-api/ir-generator"; import { IntermediateRepresentation } from "@fern-api/ir-sdk"; import { TaskContext } from "@fern-api/task-context"; @@ -177,12 +177,12 @@ export class DocsDefinitionResolver { const stats = await stat(absoluteFilePath); if (stats.isDirectory()) { - const files = await listFiles(absoluteFilePath, "{js,ts,jsx,tsx}"); + const files = await listFiles(absoluteFilePath, "{js,ts,jsx,tsx,md,mdx}"); files.forEach((file) => { jsFilePaths.add(file); }); - } else if (absoluteFilePath.match(/\.(js|ts|jsx|tsx)$/) != null) { + } else if (absoluteFilePath.match(/\.(js|ts|jsx|tsx|md|mdx)$/) != null) { jsFilePaths.add(absoluteFilePath); } }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b13cd5181f5..5b02cd8e0f1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3331,6 +3331,8 @@ importers: specifier: ^2.0.5 version: 2.0.5(@types/node@18.7.18)(jsdom@20.0.3)(sass@1.72.0)(terser@5.31.5) + packages/cli/cli/dist/dev: {} + packages/cli/configuration: dependencies: '@fern-api/core-utils':