|
|
@@ -87,8 +87,10 @@ export class TypescriptDocsParser {
|
|
|
const description = this.getDeclarationDescription(statement);
|
|
|
const normalizedTitle = this.kebabCase(title);
|
|
|
const fileName = normalizedTitle === category ? '_index' : normalizedTitle;
|
|
|
+ const packageName = this.getPackageName(sourceFile);
|
|
|
|
|
|
const info = {
|
|
|
+ packageName,
|
|
|
sourceFile,
|
|
|
sourceLine,
|
|
|
fullText,
|
|
|
@@ -154,6 +156,15 @@ export class TypescriptDocsParser {
|
|
|
return name + typeParams;
|
|
|
}
|
|
|
|
|
|
+ private getPackageName(sourceFile: string): string {
|
|
|
+ const matches = sourceFile.match(/\/packages\/([^/]+)\//);
|
|
|
+ if (matches) {
|
|
|
+ return `@vendure/${matches[1]}`;
|
|
|
+ } else {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Parses an array of inteface members into a simple object which can be rendered into markdown.
|
|
|
*/
|
|
|
@@ -259,7 +270,7 @@ export class TypescriptDocsParser {
|
|
|
docsCategory: tag => (category = tag.comment || ''),
|
|
|
});
|
|
|
return this.kebabCase(category);
|
|
|
- };
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* Type guard for the types of statement which can ge processed by the doc generator.
|