Skip to content

Commit

Permalink
docs-util: add exception for workflow examples modification + show su…
Browse files Browse the repository at this point in the history
…mmary instead of comment (medusajs#10963)

* docs-util: add exception for workflow examples modification + show summary instead of comment

* add currency and country code in example

* add common IDs
  • Loading branch information
shahednasser authored Jan 14, 2025
1 parent cf62a0a commit 044af3f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,11 @@ function getStep({
return {
type,
name: document.name,
description: associatedReflection?.comment
? Handlebars.helpers.comments(associatedReflection.comment, true)
: "",
description: associatedReflection?.comment?.summary
? Handlebars.helpers.comment(associatedReflection.comment.summary)
: associatedReflection?.comment
? Handlebars.helpers.comments(associatedReflection.comment, true)
: "",
link:
type === "hook" || !associatedReflection?.url
? `#${document.name}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export default function () {
} else {
exampleTags.forEach((exampleTag) => {
exampleTag.content.forEach((part) => {
if (part.kind !== "code") {
if (
part.kind !== "code" ||
part.text.startsWith("```ts workflow={false}")
) {
exampleStr.push(part.text)
return
}
Expand Down
7 changes: 6 additions & 1 deletion www/utils/packages/utils/src/examples-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,15 @@ export function getFakeStrValue({
`id_${faker.string.alphanumeric({
length: { min: 10, max: 20 },
})}`,
region_id: "reg_123",
product_id: "prod_123",
cart_id: "cart_123",
order_id: "order_123",
name: () => faker.person.firstName(),
email: () => faker.internet.email(),
password: () => faker.internet.password({ length: 8 }),
currency: () => faker.finance.currencyCode(),
currency_code: () => faker.finance.currencyCode().toLowerCase(),
country_code: () => faker.location.countryCode().toLowerCase(),
title: () => faker.lorem.word(),
description: () => faker.lorem.sentence(),
url: () => faker.internet.url(),
Expand Down

0 comments on commit 044af3f

Please sign in to comment.