-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid double docgen on docsite startup
- Loading branch information
1 parent
ae94fb4
commit 4520319
Showing
3 changed files
with
18 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import fg from "fast-glob" | ||
import { projectRoot, writeDocgenResults } from "./docgen" | ||
import path from "node:path" | ||
|
||
import * as docgen from "react-docgen-typescript" | ||
|
||
const tsConfigPath = path.join(projectRoot, "tsconfig.json") | ||
const parse = docgen.withCustomConfig(tsConfigPath, { | ||
shouldRemoveUndefinedFromOptional: true, | ||
}).parseWithProgramProvider | ||
|
||
const paths = fg.sync("src/**/*.tsx", { ignore: ["src/index.tsx"] }) | ||
const docgenInfo = parse(paths) | ||
writeDocgenResults(docgenInfo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters