From 85c4cdf9af53bfb42bcd29794149e849dd71c067 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Mon, 9 Oct 2023 16:43:54 +0300 Subject: [PATCH] chore: fix path prefix of reference generation scripts (#5324) * chore: fix path prefix of reference generation scripts * fix build step --- .github/workflows/generate-references.yml | 12 ++++++++++++ docs-util/packages/typedoc-config/entities.js | 2 +- docs-util/packages/typedoc-config/js-client.js | 2 +- docs-util/packages/typedoc-config/services.js | 2 +- .../src/resources/helpers/section-enabled.ts | 7 ++++++- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/generate-references.yml b/.github/workflows/generate-references.yml index 2f5d848f0d..bca3d0b5a6 100644 --- a/.github/workflows/generate-references.yml +++ b/.github/workflows/generate-references.yml @@ -36,6 +36,10 @@ jobs: run: yarn install working-directory: docs-util + - name: Build Workspace dependencies + run: yarn build + working-directory: docs-util + - name: Generate Services Reference run: yarn generate:reference services working-directory: docs-util/packages/scripts @@ -122,6 +126,10 @@ jobs: run: yarn install working-directory: docs-util + - name: Build Workspace dependencies + run: yarn build + working-directory: docs-util + - name: Generate Entities Reference run: yarn generate:reference entities working-directory: docs-util/packages/scripts @@ -167,6 +175,10 @@ jobs: run: yarn install working-directory: docs-util + - name: Build Workspace dependencies + run: yarn build + working-directory: docs-util + - name: Generate Services Reference run: yarn generate:reference js-client working-directory: docs-util/packages/scripts diff --git a/docs-util/packages/typedoc-config/entities.js b/docs-util/packages/typedoc-config/entities.js index 7b39a7e08f..4a31015bba 100644 --- a/docs-util/packages/typedoc-config/entities.js +++ b/docs-util/packages/typedoc-config/entities.js @@ -2,7 +2,7 @@ const path = require("path") const globalTypedocOptions = require("./base") -const pathPrefix = path.join(__dirname, "..", "..") +const pathPrefix = path.join(__dirname, "..", "..", "..") module.exports = { ...globalTypedocOptions, diff --git a/docs-util/packages/typedoc-config/js-client.js b/docs-util/packages/typedoc-config/js-client.js index ab7af1d552..a797bb020d 100644 --- a/docs-util/packages/typedoc-config/js-client.js +++ b/docs-util/packages/typedoc-config/js-client.js @@ -2,7 +2,7 @@ const path = require("path") const globalTypedocOptions = require("./base") -const pathPrefix = path.join(__dirname, "..", "..") +const pathPrefix = path.join(__dirname, "..", "..", "..") module.exports = { ...globalTypedocOptions, diff --git a/docs-util/packages/typedoc-config/services.js b/docs-util/packages/typedoc-config/services.js index f2b060c059..4d46058d77 100644 --- a/docs-util/packages/typedoc-config/services.js +++ b/docs-util/packages/typedoc-config/services.js @@ -2,7 +2,7 @@ const path = require("path") const globalTypedocOptions = require("./base") -const pathPrefix = path.join(__dirname, "..", "..") +const pathPrefix = path.join(__dirname, "..", "..", "..") module.exports = { ...globalTypedocOptions, diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/section-enabled.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/section-enabled.ts index 807d252137..e94a1c5119 100644 --- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/section-enabled.ts +++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/section-enabled.ts @@ -1,5 +1,6 @@ import { MarkdownTheme } from "../../theme" import * as Handlebars from "handlebars" +import { SectionKey } from "../../types" export default function (theme: MarkdownTheme) { Handlebars.registerHelper( @@ -7,7 +8,11 @@ export default function (theme: MarkdownTheme) { function (sectionName: string): boolean { const { sections } = theme.getFormattingOptionsForLocation() - return !sections || !(sectionName in sections) || sections[sectionName] + return ( + !sections || + !(sectionName in sections) || + sections[sectionName as SectionKey] + ) } ) }