@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
15 lines • 820 B
text/typescript
/**
* Converts a Turbopack-style glob (e.g. `./app/**\/demos/*\/index.ts`) to a
* RegExp that matches absolute filesystem paths. Mirrors the logic used by
* `withDocsInfra` for webpack rule generation. Pass-through when the input is
* already a RegExp (webpack-rule `test` regexes).
*/
export declare function patternToRegExp(pattern: string | RegExp): RegExp;
/**
* Walks the workspace once per fixed glob prefix and returns a map from each
* matched demo `index.ts` absolute path to the first pattern that matched it.
*
* Shared by `ensureDemoClients` and `ensureDemoPages` so demo discovery stays
* consistent between the `requireClient` and `requirePage` validate passes.
*/
export declare function findDemoIndexFiles(baseDir: string, patterns: (string | RegExp)[]): Promise<Map<string, string | RegExp>>;