-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: TSDoc + reference of fulfillment service (#5761)
- Loading branch information
1 parent
8f25ed8
commit f802e24
Showing
1,479 changed files
with
30,259 additions
and
16,135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const path = require("path") | ||
const globalTypedocOptions = require("./_base") | ||
|
||
const pathPrefix = path.join(__dirname, "..", "..", "..") | ||
|
||
module.exports = { | ||
...globalTypedocOptions, | ||
entryPoints: [ | ||
path.join( | ||
pathPrefix, | ||
"packages/medusa/src/interfaces/fulfillment-service.ts" | ||
), | ||
], | ||
out: [path.join(pathPrefix, "www/apps/docs/content/references/fulfillment")], | ||
tsconfig: path.join(__dirname, "extended-tsconfig", "medusa.json"), | ||
name: "Fulfillment Provider Reference", | ||
indexTitle: "Fulfillment Provider Reference", | ||
entryDocument: "_index.mdx", | ||
hideInPageTOC: true, | ||
hideBreadcrumbs: true, | ||
formatting: { | ||
"*": { | ||
showCommentsAsHeader: true, | ||
sections: { | ||
member_sources_definedIn: false, | ||
reflection_hierarchy: false, | ||
member_sources_inheritedFrom: false, | ||
member_sources_implementationOf: false, | ||
reflection_implementedBy: false, | ||
member_signature_sources: false, | ||
reflection_callable: false, | ||
reflection_indexable: false, | ||
reflection_implements: false, | ||
member_signature_title: false, | ||
member_signature_returns: false, | ||
}, | ||
parameterStyle: "component", | ||
parameterComponent: "ParameterTypes", | ||
mdxImports: [ | ||
`import ParameterTypes from "@site/src/components/ParameterTypes"`, | ||
], | ||
reflectionGroups: { | ||
Properties: false, | ||
}, | ||
frontmatterData: { | ||
displayed_sidebar: "modules", | ||
}, | ||
}, | ||
AbstractFulfillmentService: { | ||
reflectionDescription: `In this document, you’ll learn how to create a fulfillment provider to a Medusa backend and the methods you must implement in it. If you’re unfamiliar with the Shipping architecture in Medusa, make sure to [check out the overview first](https://docs.medusajs.com/modules/carts-and-checkout/shipping).`, | ||
frontmatterData: { | ||
displayed_sidebar: "modules", | ||
slug: "/modules/carts-and-checkout/backend/add-fulfillment-provider", | ||
}, | ||
reflectionTitle: { | ||
fullReplacement: "How to Create a Fulfillment Provider", | ||
}, | ||
}, | ||
}, | ||
objectLiteralTypeDeclarationStyle: "component", | ||
mdxOutput: true, | ||
maxLevel: 2, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ges/typedoc-plugin-markdown-medusa/src/resources/helpers/decrement-current-title-level.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { MarkdownTheme } from "../../theme" | ||
import * as Handlebars from "handlebars" | ||
|
||
export default function (theme: MarkdownTheme) { | ||
Handlebars.registerHelper("decrementCurrentTitleLevel", function () { | ||
const { currentTitleLevel } = theme | ||
theme.setCurrentTitleLevel(currentTitleLevel - 1) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...kages/typedoc-plugin-markdown-medusa/src/resources/helpers/has-more-than-one-signature.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { DeclarationReflection } from "typedoc" | ||
import * as Handlebars from "handlebars" | ||
|
||
export default function () { | ||
Handlebars.registerHelper( | ||
"hasMoreThanOneSignature", | ||
function (model: DeclarationReflection) { | ||
return (model.signatures?.length || 0) > 1 | ||
} | ||
) | ||
} |
14 changes: 14 additions & 0 deletions
14
...es/typedoc-plugin-markdown-medusa/src/resources/helpers/if-can-show-constructors-title.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as Handlebars from "handlebars" | ||
import { ReflectionGroup } from "typedoc" | ||
|
||
export default function () { | ||
Handlebars.registerHelper( | ||
"ifCanShowConstructorTitle", | ||
function (this: ReflectionGroup, options: Handlebars.HelperOptions) { | ||
return this.title.toLowerCase() !== "constructors" || | ||
this.children.length > 1 | ||
? options.fn(this) | ||
: options.inverse(this) | ||
} | ||
) | ||
} |
9 changes: 9 additions & 0 deletions
9
...ges/typedoc-plugin-markdown-medusa/src/resources/helpers/increment-current-title-level.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { MarkdownTheme } from "../../theme" | ||
import * as Handlebars from "handlebars" | ||
|
||
export default function (theme: MarkdownTheme) { | ||
Handlebars.registerHelper("incrementCurrentTitleLevel", function () { | ||
const { currentTitleLevel } = theme | ||
theme.setCurrentTitleLevel(currentTitleLevel + 1) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 10 additions & 36 deletions
46
docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/title-level.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,18 @@ | ||
import { MarkdownTheme } from "../../theme" | ||
import * as Handlebars from "handlebars" | ||
import { SignatureReflection, Reflection } from "typedoc" | ||
import { Reflection } from "typedoc" | ||
|
||
export default function (theme: MarkdownTheme) { | ||
Handlebars.registerHelper( | ||
"titleLevel", | ||
function (this: Reflection, originalLevel = 3): string { | ||
const { expandMembers, sections } = | ||
theme.getFormattingOptionsForLocation() | ||
Handlebars.registerHelper("titleLevel", function (this: Reflection): string { | ||
const { currentTitleLevel } = theme | ||
|
||
if (!expandMembers) { | ||
return Array(originalLevel).fill("#").join("") | ||
} | ||
// let titleLevel = currentTitleLevel | ||
|
||
const { allReflectionsHaveOwnDocument } = theme | ||
// if (isChild) { | ||
// titleLevel++ | ||
// theme.setCurrentTitleLevel(titleLevel + 1) | ||
// } | ||
|
||
let isSignatureChild = false | ||
if ( | ||
sections && | ||
sections.member_signature_title === false && | ||
(this instanceof SignatureReflection || this.variant === "signature") | ||
) { | ||
// only show title if there are more than one signatures | ||
isSignatureChild = | ||
this.parent !== undefined && | ||
"signatures" in this.parent && | ||
(this.parent.signatures as SignatureReflection[]).length > 1 | ||
} | ||
|
||
const numberToSubtract = allReflectionsHaveOwnDocument | ||
? isSignatureChild | ||
? 1 | ||
: 2 | ||
: isSignatureChild | ||
? 0 | ||
: 1 | ||
|
||
const level = originalLevel - numberToSubtract | ||
|
||
return Array(level).fill("#").join("") | ||
} | ||
) | ||
return Array(currentTitleLevel).fill("#").join("") | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
f802e24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs-ui – ./www/apps/ui
docs-ui-git-develop-medusajs.vercel.app
docs-ui-medusajs.vercel.app
docs-ui.vercel.app
f802e24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
api-reference – ./www/apps/api-reference
api-reference-git-develop-medusajs.vercel.app
api-reference-medusajs.vercel.app
api-reference-delta.vercel.app
docs.medusajs.com
f802e24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
medusa-docs – ./www/apps/docs
medusa-docs-git-develop-medusajs.vercel.app
medusa-docs-medusajs.vercel.app
medusa-docs.vercel.app