Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit 29e0165

Browse files
axe312gerrakannimer
authored andcommitted
feat(docz-core): allow custom pattern for globbing components with docgenConfig.searchPatterns (#1316)
1 parent 9d5b129 commit 29e0165

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

core/docz-core/src/config/argv.ts

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export interface DocgenConfig {
2828
resolver?: (ast: any, recast: any) => any
2929
propFilter?: (prop: any) => boolean
3030
searchPath: string
31+
searchPatterns: string[]
3132
}
3233

3334
export interface Menu {

core/docz-core/src/states/props.ts

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ export const getPattern = (config: Config) => {
1717
docgenConfig: docgenConfig,
1818
} = config
1919

20+
if (docgenConfig.searchPatterns) {
21+
return docgenConfig.searchPatterns
22+
}
23+
2024
const searchPath = docgenConfig.searchPath ? docgenConfig.searchPath : source
2125
const root = paths.getRootDir(config)
2226
const srcDir = path.resolve(root, searchPath)

0 commit comments

Comments
 (0)