docs: enhance how references are generated (#5805)

* adjusted configurations

* enhancements to tool and configurations

* change reference in docs

* fixed issue in workflows reference

* added project name

* more optimizations

* fix context error

* added a types reference

* resolved missing types

* fix reference reflection types not having children

* add an expand url parameter

* added new option to the README

* added details about new option
This commit is contained in:
Shahed Nasser
2023-12-05 15:29:41 +02:00
committed by GitHub
parent a418e6cebc
commit 892d737c1f
4358 changed files with 947876 additions and 534760 deletions

View File

@@ -19,11 +19,13 @@ import IconFlagMini from "../../../theme/Icon/FlagMini"
type ParameterTypesItemsProps = {
parameters: Parameter[]
level?: number
expandUrl?: string
}
const ParameterTypesItems = ({
parameters,
level = 1,
expandUrl,
}: ParameterTypesItemsProps) => {
function getGroupName() {
switch (level) {
@@ -154,7 +156,7 @@ const ParameterTypesItems = ({
{parameter.expandable && (
<ExpandableNotice
type="method"
link="https://docs.medusajs.com/js-client/overview#expanding-fields"
link={expandUrl || "#"}
badgeClassName="!p-0 leading-none"
badgeContent={<ArrowsPointingOutMini />}
/>
@@ -181,6 +183,7 @@ const ParameterTypesItems = ({
<ParameterTypesItems
parameters={parameter.children}
level={level + 1}
expandUrl={expandUrl}
/>
)}
</Details>

View File

@@ -15,6 +15,7 @@ export type Parameter = {
type ParameterTypesType = {
parameters: Parameter[]
expandUrl?: string
} & React.HTMLAttributes<HTMLDivElement>
const ParameterTypes = ({
@@ -27,7 +28,10 @@ const ParameterTypes = ({
className={clsx("bg-docs-bg-surface shadow-card-rest rounded", className)}
{...props}
>
<ParameterTypesItems parameters={parameters} />
<ParameterTypesItems
parameters={parameters}
expandUrl={props.expandUrl}
/>
</div>
)
}