Skip to content

Commit

Permalink
feat(docz-core): allow custom pattern for globbing components with do…
Browse files Browse the repository at this point in the history
…cgenConfig.searchPatterns (#1316)
  • Loading branch information
axe312ger authored and rakannimer committed Dec 14, 2019
1 parent 9d5b129 commit 29e0165
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/docz-core/src/config/argv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface DocgenConfig {
resolver?: (ast: any, recast: any) => any
propFilter?: (prop: any) => boolean
searchPath: string
searchPatterns: string[]
}

export interface Menu {
Expand Down
4 changes: 4 additions & 0 deletions core/docz-core/src/states/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export const getPattern = (config: Config) => {
docgenConfig: docgenConfig,
} = config

if (docgenConfig.searchPatterns) {
return docgenConfig.searchPatterns
}

const searchPath = docgenConfig.searchPath ? docgenConfig.searchPath : source
const root = paths.getRootDir(config)
const srcDir = path.resolve(root, searchPath)
Expand Down

0 comments on commit 29e0165

Please sign in to comment.