chore(docs): Generated JS Client Reference (#5421)
* chore(docs): Generated JS Client Reference (automated) * fix js client reference * fix links --------- Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com> Co-authored-by: Shahed nasser <shahednasser@gmail.com>
This commit is contained in:
committed by
GitHub
parent
83f46b9b32
commit
9dcd62c731
@@ -16,10 +16,10 @@ module.exports = {
|
||||
hideInPageTOC: true,
|
||||
hideBreadcrumbs: true,
|
||||
plugin: [
|
||||
...globalTypedocOptions.plugin,
|
||||
"typedoc-plugin-merge-modules",
|
||||
"typedoc-plugin-markdown-medusa",
|
||||
"typedoc-plugin-reference-excluder",
|
||||
"typedoc-plugin-frontmatter",
|
||||
"typedoc-plugin-rename-defaults",
|
||||
"typedoc-plugin-modules",
|
||||
],
|
||||
exclude: [
|
||||
@@ -32,4 +32,20 @@ module.exports = {
|
||||
displayed_sidebar: "jsClientSidebar",
|
||||
},
|
||||
internalModule: "internal",
|
||||
formatting: {
|
||||
"*": {
|
||||
showCommentsAsHeader: true,
|
||||
sections: {
|
||||
member_sources_definedIn: false,
|
||||
reflection_hierarchy: false,
|
||||
},
|
||||
parameterStyle: "component",
|
||||
parameterComponent: "ParameterTypes",
|
||||
mdxImports: [
|
||||
`import ParameterTypes from "@site/src/components/ParameterTypes"`,
|
||||
],
|
||||
},
|
||||
},
|
||||
objectLiteralTypeDeclarationStyle: "component",
|
||||
mdxOutput: true,
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
"typedoc"
|
||||
],
|
||||
"dependencies": {
|
||||
"handlebars": "^4.7.8",
|
||||
"yaml": "^2.3.2"
|
||||
"handlebars": "^4.7.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,11 @@ export default function (theme: MarkdownTheme) {
|
||||
function (tag: CommentTag, commentLevel = 4, parent = null) {
|
||||
const { showCommentsAsHeader, showCommentsAsDetails } =
|
||||
theme.getFormattingOptionsForLocation()
|
||||
if (tag.tag === "@schema") {
|
||||
tag.content.forEach((content, index) => {
|
||||
tag.content[index].text = getDescriptionFromSchema(content.text)
|
||||
})
|
||||
}
|
||||
const tagTitle = camelToTitleCase(tag.tag.substring(1)),
|
||||
tagContent = Handlebars.helpers.comment(tag.content)
|
||||
|
||||
@@ -24,4 +29,12 @@ export default function (theme: MarkdownTheme) {
|
||||
return `**${tagTitle}**\n\n${tagContent}`
|
||||
}
|
||||
)
|
||||
|
||||
function getDescriptionFromSchema(content: string) {
|
||||
const regex = new RegExp(/description: "(?<description>.*)"/)
|
||||
|
||||
const matchDescription = content.match(regex)
|
||||
|
||||
return matchDescription?.groups?.description || content
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ export default function (theme: MarkdownTheme) {
|
||||
case "@label":
|
||||
case "@inheritdoc":
|
||||
break
|
||||
case "@schema":
|
||||
case "@link":
|
||||
case "@linkcode":
|
||||
case "@linkplain": {
|
||||
|
||||
@@ -17,11 +17,10 @@ export default function () {
|
||||
md.push(Handlebars.helpers.comment(comment.summary))
|
||||
}
|
||||
|
||||
const filteredTags = comment.blockTags
|
||||
.filter((tag) => tag.tag !== "@returns")
|
||||
.filter((tag) => tag.tag !== "@example")
|
||||
|
||||
if (showTags && comment.blockTags?.length) {
|
||||
const filteredTags = comment.blockTags
|
||||
.filter((tag) => tag.tag !== "@returns")
|
||||
.filter((tag) => tag.tag !== "@example")
|
||||
const tags = filteredTags.map((tag) => {
|
||||
return Handlebars.helpers.commentTag(
|
||||
tag,
|
||||
|
||||
@@ -256,7 +256,7 @@ export function getTypeChildren(
|
||||
switch (reflectionType.type) {
|
||||
case "reference":
|
||||
// eslint-disable-next-line no-case-declarations
|
||||
const referencedReflection = project.getChildByName(reflectionType.name)
|
||||
const referencedReflection = project?.getChildByName(reflectionType.name)
|
||||
|
||||
if (
|
||||
referencedReflection instanceof DeclarationReflection &&
|
||||
|
||||
@@ -2846,7 +2846,6 @@ __metadata:
|
||||
copyfiles: ^2.4.1
|
||||
handlebars: ^4.7.8
|
||||
typescript: ^4.6
|
||||
yaml: ^2.3.2
|
||||
peerDependencies:
|
||||
typedoc: 0.25.x
|
||||
languageName: unknown
|
||||
|
||||
Reference in New Issue
Block a user