Skip to content

Commit

Permalink
fix(docs): ship up markdown files that contain components (#4776)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi authored Sep 30, 2024
1 parent 4c72dfd commit 854efd5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions packages/cli/cli/versions.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/docs-resolver/src/DocsDefinitionResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
}
})
Expand Down
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 854efd5

Please sign in to comment.