diff --git a/www/apps/api-reference/components/Tags/Operation/DescriptionSection/Events/index.tsx b/www/apps/api-reference/components/Tags/Operation/DescriptionSection/Events/index.tsx index 2d2169fe06..2520de067d 100644 --- a/www/apps/api-reference/components/Tags/Operation/DescriptionSection/Events/index.tsx +++ b/www/apps/api-reference/components/Tags/Operation/DescriptionSection/Events/index.tsx @@ -108,9 +108,9 @@ const TagsOperationDescriptionSectionEvent = ({ ) : ( Deprecated ))} - {event.version && ( - - v{event.version} + {event.since && ( + + v{event.since} )} diff --git a/www/apps/api-reference/components/Tags/Operation/DescriptionSection/index.tsx b/www/apps/api-reference/components/Tags/Operation/DescriptionSection/index.tsx index 7715a766b0..9fb48e734c 100644 --- a/www/apps/api-reference/components/Tags/Operation/DescriptionSection/index.tsx +++ b/www/apps/api-reference/components/Tags/Operation/DescriptionSection/index.tsx @@ -78,12 +78,12 @@ const TagsOperationDescriptionSection = ({ badgeClassName="ml-0.5" /> )} - {operation["x-version"] && ( + {operation["x-since"] && ( - v{operation["x-version"]} + v{operation["x-since"]} )} diff --git a/www/apps/api-reference/specs/admin/openapi.full.yaml b/www/apps/api-reference/specs/admin/openapi.full.yaml index 0fe3712c6a..f26ec2a2de 100644 --- a/www/apps/api-reference/specs/admin/openapi.full.yaml +++ b/www/apps/api-reference/specs/admin/openapi.full.yaml @@ -15024,7 +15024,7 @@ paths: $ref: '#/components/responses/500_error' x-workflow: deleteDraftOrdersWorkflow x-events: [] - x-version: 2.8.4 + x-since: 2.8.4 /admin/draft-orders/{id}/convert-to-order: post: operationId: PostDraftOrdersIdConvertToOrder @@ -22738,7 +22738,7 @@ paths: ``` description: Emitted when an order edit request is canceled. deprecated: false - version: 2.8.0 + since: 2.8.0 /admin/order-edits/{id}/confirm: post: operationId: PostOrderEditsIdConfirm @@ -22812,7 +22812,7 @@ paths: ``` description: Emitted when an order edit request is confirmed. deprecated: false - version: 2.8.0 + since: 2.8.0 /admin/order-edits/{id}/items: post: operationId: PostOrderEditsIdItems @@ -23208,7 +23208,7 @@ paths: ``` description: Emitted when an order edit is requested. deprecated: false - version: 2.8.0 + since: 2.8.0 /admin/order-edits/{id}/shipping-method: post: operationId: PostOrderEditsIdShippingMethod @@ -33277,7 +33277,7 @@ paths: $ref: '#/components/responses/500_error' x-workflow: importProductsAsChunksWorkflow x-events: [] - x-version: 2.8.5 + x-since: 2.8.5 /admin/products/imports/{transaction_id}/confirm: post: operationId: PostProductsImportsTransaction_idConfirm @@ -33335,7 +33335,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - x-version: 2.8.5 + x-since: 2.8.5 /admin/products/{id}: get: operationId: GetProductsId @@ -48956,7 +48956,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - x-version: 2.8.0 + x-since: 2.8.0 /admin/tax-rates: get: operationId: GetTaxRates diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}.yaml index 4ebfa8884d..54a4c6573c 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}.yaml @@ -199,4 +199,4 @@ delete: $ref: ../components/responses/500_error.yaml x-workflow: deleteDraftOrdersWorkflow x-events: [] - x-version: 2.8.4 + x-since: 2.8.4 diff --git a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}.yaml index 15b2c1bbec..c87f143eaf 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}.yaml @@ -75,4 +75,4 @@ delete: ``` description: Emitted when an order edit request is canceled. deprecated: false - version: 2.8.0 + since: 2.8.0 diff --git a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_confirm.yaml b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_confirm.yaml index ab4354f3f1..9e3fbf4eed 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_confirm.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_confirm.yaml @@ -56,4 +56,4 @@ post: ``` description: Emitted when an order edit request is confirmed. deprecated: false - version: 2.8.0 + since: 2.8.0 diff --git a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_request.yaml b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_request.yaml index 3cd6900e90..4bd840e642 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_request.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_request.yaml @@ -56,4 +56,4 @@ post: ``` description: Emitted when an order edit is requested. deprecated: false - version: 2.8.0 + since: 2.8.0 diff --git a/www/apps/api-reference/specs/admin/paths/admin_products_imports.yaml b/www/apps/api-reference/specs/admin/paths/admin_products_imports.yaml index 334d557533..df513bcd92 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_products_imports.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_products_imports.yaml @@ -47,4 +47,4 @@ post: $ref: ../components/responses/500_error.yaml x-workflow: importProductsAsChunksWorkflow x-events: [] - x-version: 2.8.5 + x-since: 2.8.5 diff --git a/www/apps/api-reference/specs/admin/paths/admin_products_imports_{transaction_id}_confirm.yaml b/www/apps/api-reference/specs/admin/paths/admin_products_imports_{transaction_id}_confirm.yaml index 31519e0b05..41c936e236 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_products_imports_{transaction_id}_confirm.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_products_imports_{transaction_id}_confirm.yaml @@ -44,4 +44,4 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml - x-version: 2.8.5 + x-since: 2.8.5 diff --git a/www/apps/api-reference/specs/admin/paths/admin_tax-providers.yaml b/www/apps/api-reference/specs/admin/paths/admin_tax-providers.yaml index afd261f02e..67263a9bf6 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_tax-providers.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_tax-providers.yaml @@ -192,4 +192,4 @@ get: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml - x-version: 2.8.0 + x-since: 2.8.0 diff --git a/www/apps/api-reference/specs/store/openapi.full.yaml b/www/apps/api-reference/specs/store/openapi.full.yaml index f4209e7860..5f19f1748c 100644 --- a/www/apps/api-reference/specs/store/openapi.full.yaml +++ b/www/apps/api-reference/specs/store/openapi.full.yaml @@ -1360,7 +1360,7 @@ paths: ``` description: Emitted when the customer in the cart is transferred. deprecated: false - version: 2.8.0 + since: 2.8.0 /store/carts/{id}/gift-cards: post: operationId: PostCartsIdGiftCards @@ -8845,7 +8845,7 @@ paths: ``` description: Emitted when a return is marked as received. deprecated: false - x-version: 2.8.0 + x-since: 2.8.0 /store/shipping-options: get: operationId: GetShippingOptions diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml index a084f14ad2..7978b04485 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml @@ -87,4 +87,4 @@ post: ``` description: Emitted when the customer in the cart is transferred. deprecated: false - version: 2.8.0 + since: 2.8.0 diff --git a/www/apps/api-reference/specs/store/paths/store_returns.yaml b/www/apps/api-reference/specs/store/paths/store_returns.yaml index b793d2cc0a..8f37d060d9 100644 --- a/www/apps/api-reference/specs/store/paths/store_returns.yaml +++ b/www/apps/api-reference/specs/store/paths/store_returns.yaml @@ -67,4 +67,4 @@ post: ``` description: Emitted when a return is marked as received. deprecated: false - x-version: 2.8.0 + x-since: 2.8.0 diff --git a/www/apps/book/app/learn/update/page.mdx b/www/apps/book/app/learn/update/page.mdx index 4c3135fefd..75232d1987 100644 --- a/www/apps/book/app/learn/update/page.mdx +++ b/www/apps/book/app/learn/update/page.mdx @@ -107,7 +107,7 @@ npx medusa db:migrate In the Medusa codebase, our team uses the following [TSDoc](https://tsdoc.org/) tags to indicate changes made in the latest version for a specific piece of code: - `@deprecated`: Indicates that a piece of code is deprecated and will be removed in a future version. The tag's message will include details on what to use instead. However, our updates are always backward-compatible, allowing you to update your codebase at your own pace. -- `@version`: Indicates the version when a piece of code was available from. A piece of code that has this tag will only be available starting from the specified version. +- `@since`: Indicates the version when a piece of code was available from. A piece of code that has this tag will only be available starting from the specified version. --- diff --git a/www/apps/book/public/llms-full.txt b/www/apps/book/public/llms-full.txt index 29e232fbde..93fd31b6e2 100644 --- a/www/apps/book/public/llms-full.txt +++ b/www/apps/book/public/llms-full.txt @@ -23247,7 +23247,7 @@ npx medusa db:migrate In the Medusa codebase, our team uses the following [TSDoc](https://tsdoc.org/) tags to indicate changes made in the latest version for a specific piece of code: - `@deprecated`: Indicates that a piece of code is deprecated and will be removed in a future version. The tag's message will include details on what to use instead. However, our updates are always backward-compatible, allowing you to update your codebase at your own pace. -- `@version`: Indicates the version when a piece of code was available from. A piece of code that has this tag will only be available starting from the specified version. +- `@since`: Indicates the version when a piece of code was available from. A piece of code that has this tag will only be available starting from the specified version. *** diff --git a/www/packages/types/src/openapi.ts b/www/packages/types/src/openapi.ts index 0721516c89..db95793bd0 100644 --- a/www/packages/types/src/openapi.ts +++ b/www/packages/types/src/openapi.ts @@ -23,7 +23,7 @@ export type Operation = OpenAPIV3.OperationObject<{ "x-workflow"?: string "x-sidebar-summary"?: string "x-events"?: OasEvents[] - "x-version"?: string + "x-since"?: string "x-deprecated_message"?: string "x-badges"?: { text: string @@ -149,5 +149,5 @@ export type OasEvents = { description?: string deprecated?: boolean deprecated_message?: string - version?: string + since?: string } diff --git a/www/utils/generated/events-output.json b/www/utils/generated/events-output.json index fd6839dc9c..54aeefb31b 100644 --- a/www/utils/generated/events-output.json +++ b/www/utils/generated/events-output.json @@ -44,7 +44,7 @@ "workflows": [ "transferCartCustomerWorkflow" ], - "version": "2.8.0", + "since": "2.8.0", "deprecated": false }, { @@ -227,7 +227,7 @@ "workflows": [ "requestOrderEditRequestWorkflow" ], - "version": "2.8.0", + "since": "2.8.0", "deprecated": false }, { @@ -239,7 +239,7 @@ "workflows": [ "confirmOrderEditRequestWorkflow" ], - "version": "2.8.0", + "since": "2.8.0", "deprecated": false }, { @@ -251,7 +251,7 @@ "workflows": [ "cancelBeginOrderEditWorkflow" ], - "version": "2.8.0", + "since": "2.8.0", "deprecated": false }, { diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id].ts index b9248dc11b..56c31a1cf5 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id].ts @@ -57,7 +57,7 @@ * $ref: "#/components/responses/500_error" * x-workflow: deleteDraftOrdersWorkflow * x-events: [] - * x-version: 2.8.4 + * x-since: 2.8.4 * */ diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_order-edits_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_order-edits_[id].ts index 1e41ba92ae..26439eb4c5 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_order-edits_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_order-edits_[id].ts @@ -90,7 +90,7 @@ * ``` * description: Emitted when an order edit request is canceled. * deprecated: false - * version: 2.8.0 + * since: 2.8.0 * */ diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_tax-providers.ts b/www/utils/generated/oas-output/operations/admin/get_admin_tax-providers.ts index 54e8e9b962..a4a65ace50 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_tax-providers.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_tax-providers.ts @@ -182,7 +182,7 @@ * $ref: "#/components/responses/invalid_request_error" * "500": * $ref: "#/components/responses/500_error" - * x-version: 2.8.0 + * x-since: 2.8.0 * */ diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_confirm.ts b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_confirm.ts index 851bebfc92..44459dbb78 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_confirm.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_confirm.ts @@ -71,7 +71,7 @@ * ``` * description: Emitted when an order edit request is confirmed. * deprecated: false - * version: 2.8.0 + * since: 2.8.0 * */ diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_request.ts b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_request.ts index 85fed990b1..b059ccd82c 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_request.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_request.ts @@ -71,7 +71,7 @@ * ``` * description: Emitted when an order edit is requested. * deprecated: false - * version: 2.8.0 + * since: 2.8.0 * */ diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_products_imports.ts b/www/utils/generated/oas-output/operations/admin/post_admin_products_imports.ts index bcc9d348aa..cf2109e066 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_products_imports.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_products_imports.ts @@ -69,7 +69,7 @@ * $ref: "#/components/responses/500_error" * x-workflow: importProductsAsChunksWorkflow * x-events: [] - * x-version: 2.8.5 + * x-since: 2.8.5 * */ diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_products_imports_[transaction_id]_confirm.ts b/www/utils/generated/oas-output/operations/admin/post_admin_products_imports_[transaction_id]_confirm.ts index b4d8c098ce..e7f0f2a1e2 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_products_imports_[transaction_id]_confirm.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_products_imports_[transaction_id]_confirm.ts @@ -55,7 +55,7 @@ * $ref: "#/components/responses/invalid_request_error" * "500": * $ref: "#/components/responses/500_error" - * x-version: 2.8.5 + * x-since: 2.8.5 * */ diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts index fba9bbc38e..abdd93ce2f 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts @@ -97,7 +97,7 @@ * ``` * description: Emitted when the customer in the cart is transferred. * deprecated: false - * version: 2.8.0 + * since: 2.8.0 * */ diff --git a/www/utils/generated/oas-output/operations/store/post_store_returns.ts b/www/utils/generated/oas-output/operations/store/post_store_returns.ts index 125f7acba0..9d601c28ad 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_returns.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_returns.ts @@ -85,7 +85,7 @@ * ``` * description: Emitted when a return is marked as received. * deprecated: false - * x-version: 2.8.0 + * x-since: 2.8.0 * */ diff --git a/www/utils/packages/docs-generator/src/classes/kinds/default.ts b/www/utils/packages/docs-generator/src/classes/kinds/default.ts index c25c443b97..fd234bfdfb 100644 --- a/www/utils/packages/docs-generator/src/classes/kinds/default.ts +++ b/www/utils/packages/docs-generator/src/classes/kinds/default.ts @@ -600,16 +600,16 @@ class DefaultKindGenerator { * Retrieve information from the tags of a node. * * @param node - The node to retrieve the information from. - * @returns An object containing the deprecated and version tags, if available. + * @returns An object containing the deprecated and since tags, if available. */ getInformationFromTags(node: ts.Node): { deprecatedTag: ts.JSDocTag | undefined - versionTag: ts.JSDocTag | undefined + sinceTag: ts.JSDocTag | undefined featureFlagTag: ts.JSDocTag | undefined } { const nodeComments = ts.getJSDocCommentsAndTags(node) let deprecatedTag: ts.JSDocTag | undefined - let versionTag: ts.JSDocTag | undefined + let sinceTag: ts.JSDocTag | undefined let featureFlagTag: ts.JSDocTag | undefined nodeComments.forEach((comment) => { @@ -622,8 +622,8 @@ class DefaultKindGenerator { deprecatedTag = tag } - if (tag.tagName.getText() === "version") { - versionTag = tag + if (tag.tagName.getText() === "since") { + sinceTag = tag } if (tag.tagName.getText() === "featureFlag") { @@ -634,7 +634,7 @@ class DefaultKindGenerator { return { deprecatedTag, - versionTag, + sinceTag, featureFlagTag, } } diff --git a/www/utils/packages/docs-generator/src/classes/kinds/events.ts b/www/utils/packages/docs-generator/src/classes/kinds/events.ts index 0a66ce6563..40049f1026 100644 --- a/www/utils/packages/docs-generator/src/classes/kinds/events.ts +++ b/www/utils/packages/docs-generator/src/classes/kinds/events.ts @@ -50,7 +50,7 @@ class EventsKindGenerator extends DefaultKindGenerator { const commentsAndTags = ts.getJSDocCommentsAndTags(propertyAssignment) let payloadTag: ts.JSDocTag | undefined - let versionTag: ts.JSDocTag | undefined + let sinceTag: ts.JSDocTag | undefined let deprecatedTag: ts.JSDocTag | undefined let description: string | undefined commentsAndTags.forEach((comment) => { @@ -67,8 +67,8 @@ class EventsKindGenerator extends DefaultKindGenerator { payloadTag = tag } - if (tag.tagName.getText() === "version") { - versionTag = tag + if (tag.tagName.getText() === "since") { + sinceTag = tag } if (tag.tagName.getText() === "deprecated") { @@ -84,7 +84,7 @@ class EventsKindGenerator extends DefaultKindGenerator { payload: (payloadTag?.comment as string) ?? "", description, workflows, - version: versionTag?.comment as string, + since: sinceTag?.comment as string, deprecated: deprecatedTag !== undefined, deprecated_message: deprecatedTag?.comment as string, } diff --git a/www/utils/packages/docs-generator/src/classes/kinds/oas.ts b/www/utils/packages/docs-generator/src/classes/kinds/oas.ts index 5b7795164d..d8a6c6a79d 100644 --- a/www/utils/packages/docs-generator/src/classes/kinds/oas.ts +++ b/www/utils/packages/docs-generator/src/classes/kinds/oas.ts @@ -448,7 +448,7 @@ class OasKindGenerator extends FunctionKindGenerator { } // check deprecation and version in tags - const { deprecatedTag, versionTag, featureFlagTag } = + const { deprecatedTag, sinceTag, featureFlagTag } = this.getInformationFromTags(node) if (deprecatedTag) { @@ -458,9 +458,9 @@ class OasKindGenerator extends FunctionKindGenerator { : undefined } - if (versionTag) { - oas["x-version"] = versionTag.comment - ? (versionTag.comment as string) + if (sinceTag) { + oas["x-since"] = sinceTag.comment + ? (sinceTag.comment as string) : undefined } @@ -804,7 +804,7 @@ class OasKindGenerator extends FunctionKindGenerator { } // check deprecation and version in tags - const { deprecatedTag, versionTag, featureFlagTag } = + const { deprecatedTag, sinceTag, featureFlagTag } = this.getInformationFromTags(node) if (deprecatedTag) { @@ -817,12 +817,12 @@ class OasKindGenerator extends FunctionKindGenerator { delete oas["x-deprecated_message"] } - if (versionTag) { - oas["x-version"] = versionTag.comment - ? (versionTag.comment as string) + if (sinceTag) { + oas["x-since"] = sinceTag.comment + ? (sinceTag.comment as string) : undefined } else { - delete oas["x-version"] + delete oas["x-since"] } if (featureFlagTag) { @@ -2807,7 +2807,7 @@ class OasKindGenerator extends FunctionKindGenerator { description: event.description, deprecated: event.deprecated, deprecated_message: event.deprecated_message, - version: event.version, + since: event.since, })) ) } diff --git a/www/utils/packages/docs-generator/src/types/index.d.ts b/www/utils/packages/docs-generator/src/types/index.d.ts index 207309b289..28d17a7c8b 100644 --- a/www/utils/packages/docs-generator/src/types/index.d.ts +++ b/www/utils/packages/docs-generator/src/types/index.d.ts @@ -12,7 +12,7 @@ export declare type OpenApiOperation = Partial & { "x-workflow"?: string "x-events"?: OasEvent[] "x-deprecated_message"?: string - "x-version"?: string + "x-since"?: string "x-featureFlag"?: string "x-ignoreCleanup"?: boolean } @@ -51,5 +51,5 @@ export declare type OasEvent = { description?: string deprecated?: boolean deprecated_message?: string - version?: string + since?: string } diff --git a/www/utils/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/comments.ts b/www/utils/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/comments.ts index 61aa789ec9..62384bb197 100644 --- a/www/utils/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/comments.ts +++ b/www/utils/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/comments.ts @@ -7,7 +7,7 @@ const EXCLUDED_TAGS = [ "@featureFlag", "@category", "@typeParamDefinition", - "@version", + "@since", "@tags", "@summary", "@workflowEvent", diff --git a/www/utils/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/events-listing.ts b/www/utils/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/events-listing.ts index 9b00ec5690..27c66b3a6c 100644 --- a/www/utils/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/events-listing.ts +++ b/www/utils/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/events-listing.ts @@ -119,18 +119,18 @@ function formatEventsType( } } - const versionTag = event.comment?.blockTags.find( - (tag) => tag.tag === "@version" + const sinceTag = event.comment?.blockTags.find( + (tag) => tag.tag === "@since" ) - if (versionTag) { + if (sinceTag) { eventName += `\n` - const versionText = versionTag.content + const sinceText = sinceTag.content .map((content) => content.text) .join("") .trim() - eventName += `` - eventName += `v${versionText}` + eventName += `` + eventName += `v${sinceText}` eventName += `` } @@ -166,8 +166,8 @@ function formatEventsType( .join("") .trim() - const versionTag = event.comment?.blockTags.find( - (tag) => tag.tag === "@version" + const sinceTag = event.comment?.blockTags.find( + (tag) => tag.tag === "@since" ) content.push( @@ -177,8 +177,8 @@ function formatEventsType( payload: eventPayload || "", deprecated: !!deprecatedTag, deprecatedMessage, - version: versionTag - ? versionTag.content + since: sinceTag + ? sinceTag.content .map((content) => content.text) .join("") .trim() @@ -215,14 +215,14 @@ function getEventHeading({ payload, deprecated = false, deprecatedMessage, - version, + since, }: { titleLevel: number eventName: string payload: string deprecated?: boolean deprecatedMessage?: string - version?: string + since?: string }) { const heading = [eventName] if (deprecated) { @@ -236,12 +236,12 @@ function getEventHeading({ heading.push(``) } } - if (version) { + if (since) { if (deprecated) { heading.push(`\n`) } - heading.push(``) - heading.push(`v${version}`) + heading.push(``) + heading.push(`v${since}`) heading.push(``) } return ` tag.tag === "@version" + const sinceTag = reflection.comment?.blockTags.find( + (tag) => tag.tag === "@since" ) - if (!versionTag) { + if (!sinceTag) { return "" } - const tagContent = versionTag.content - .map((content) => content.text) - .join("") + const tagContent = sinceTag.content.map((content) => content.text).join("") return `:::note\n\nThis is only available after Medusa \`v${tagContent}\`.\n\n:::` }) diff --git a/www/utils/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/workflow-events.ts b/www/utils/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/workflow-events.ts index 140d906dac..cac8ddb99b 100644 --- a/www/utils/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/workflow-events.ts +++ b/www/utils/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/workflow-events.ts @@ -41,22 +41,18 @@ export default function () { const eventPayloadFormatted = eventPayload .replace("```ts\n", "") .replace("\n```", "") - const isDeprecatedOrHasVersion = commentContent.length >= 4 - const deprecatedIndex = isDeprecatedOrHasVersion + const isDeprecatedOrHasSince = commentContent.length >= 4 + const deprecatedIndex = isDeprecatedOrHasSince ? commentContent.slice(3).findIndex((c) => c.trim() === "deprecated") : -1 const isDeprecated = deprecatedIndex !== -1 const deprecatedText = ( isDeprecated ? commentContent[3 + deprecatedIndex] || "" : "" ).trim() - const version = isDeprecatedOrHasVersion - ? commentContent - .slice(3) - .find((c) => c.trim().startsWith("version: ")) + const since = isDeprecatedOrHasSince + ? commentContent.slice(3).find((c) => c.trim().startsWith("since: ")) : undefined - const versionText = ( - version ? version.replace("version: ", "") : "" - ).trim() + const sinceText = (since ? since.replace("since: ", "") : "").trim() if (isDeprecated) { eventNameFormatted += `\n` @@ -69,10 +65,10 @@ export default function () { } } - if (versionText) { + if (sinceText) { eventNameFormatted += `\n\n` - eventNameFormatted += `` - eventNameFormatted += `v${versionText}` + eventNameFormatted += `` + eventNameFormatted += `v${sinceText}` eventNameFormatted += `\n` } diff --git a/www/utils/packages/typedoc-plugin-workflows/src/plugin.ts b/www/utils/packages/typedoc-plugin-workflows/src/plugin.ts index 32fd64334e..7a93030377 100644 --- a/www/utils/packages/typedoc-plugin-workflows/src/plugin.ts +++ b/www/utils/packages/typedoc-plugin-workflows/src/plugin.ts @@ -928,8 +928,8 @@ class WorkflowsPlugin { commentText += ` -- ${event.deprecated_message}` } } - if (event.version) { - commentText += ` -- version: ${event.version}` + if (event.since) { + commentText += ` -- since: ${event.since}` } return new CommentTag(`@workflowEvent`, [ { diff --git a/www/utils/packages/types/lib/index.d.ts b/www/utils/packages/types/lib/index.d.ts index 30c9faf473..1db1a511fd 100644 --- a/www/utils/packages/types/lib/index.d.ts +++ b/www/utils/packages/types/lib/index.d.ts @@ -344,8 +344,7 @@ export declare type MedusaEvent = { payload: string description?: string workflows: string[] - version?: string + since?: string deprecated?: boolean deprecated_message?: string - version?: string }