You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 31, 2025. It is now read-only.
The dgeni TypeScript package sometimes generates docs where doc.fileInfo.relativePath is an absolute path instead of relative. This also affects the doc.id, which I think is resolved from this property.
It seems that if readTypeScriptModules.sourceFiles is configured so that the TypeScript parser parses a file before it parses a second file that is imported by the first, it affects how the parser resolves the second file's fileName property, causing it to be an absolute path instead of relative. Based on this I don't think you can trust fileName to be relative at typescript/services/tsParser/getFileInfo.js#L7.
Example
Assuming basePath is /absolute/path/to/src and sourcePath includes:
If the TypeScript parser parses File A before File B, the doc for File A will have fileInfo.relativePath: "a.ts", but the doc for File B will have fileInfo.relativePath: "/absolute/path/to/src/b.ts"
The dgeni TypeScript package sometimes generates docs where
doc.fileInfo.relativePathis an absolute path instead of relative. This also affects thedoc.id, which I think is resolved from this property.It seems that if
readTypeScriptModules.sourceFilesis configured so that the TypeScript parser parses a file before it parses a second file that is imported by the first, it affects how the parser resolves the second file'sfileNameproperty, causing it to be an absolute path instead of relative. Based on this I don't think you can trustfileNameto be relative at typescript/services/tsParser/getFileInfo.js#L7.Example
Assuming
basePathis/absolute/path/to/srcandsourcePathincludes:/absolute/path/to/src/a.ts(imports./b.ts)/absolute/path/to/src/b.tsIf the TypeScript parser parses File A before File B, the doc for File A will have
fileInfo.relativePath: "a.ts", but the doc for File B will havefileInfo.relativePath: "/absolute/path/to/src/b.ts"