File tree Expand file tree Collapse file tree 4 files changed +17
-7
lines changed
packages/docusaurus-plugin-openapi-docs/src Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import fs from "fs";
99import path from "path" ;
1010
1111import type { LoadContext , Plugin } from "@docusaurus/types" ;
12- import { Globby } from "@docusaurus/utils" ;
12+ import { Globby , posixPath } from "@docusaurus/utils" ;
1313import chalk from "chalk" ;
1414import { render } from "mustache" ;
1515
@@ -338,7 +338,7 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
338338
339339 async function cleanApiDocs ( options : APIOptions ) {
340340 const { outputDir } = options ;
341- const apiDir = path . join ( siteDir , outputDir ) ;
341+ const apiDir = posixPath ( path . join ( siteDir , outputDir ) ) ;
342342 const apiMdxFiles = await Globby ( [ "*.api.mdx" , "*.info.mdx" , "*.tag.mdx" ] , {
343343 cwd : path . resolve ( apiDir ) ,
344344 deep : 1 ,
Original file line number Diff line number Diff line change 77
88import path from "path" ;
99
10+ import { posixPath } from "@docusaurus/utils" ;
11+
1012import { readOpenapiFiles } from "." ;
1113
1214// npx jest packages/docusaurus-plugin-openapi/src/openapi/openapi.test.ts --watch
@@ -15,7 +17,7 @@ describe("openapi", () => {
1517 describe ( "readOpenapiFiles" , ( ) => {
1618 it ( "readOpenapiFiles" , async ( ) => {
1719 const results = await readOpenapiFiles (
18- path . join ( __dirname , "__fixtures__/examples" ) ,
20+ posixPath ( path . join ( __dirname , "__fixtures__/examples" ) ) ,
1921 { specPath : "./" , outputDir : "./" }
2022 ) ;
2123 const categoryMeta = results . find ( ( x ) =>
Original file line number Diff line number Diff line change 77
88import path from "path" ;
99
10- import { Globby , GlobExcludeDefault } from "@docusaurus/utils" ;
10+ import { Globby , GlobExcludeDefault , posixPath } from "@docusaurus/utils" ;
1111import Converter from "@paloaltonetworks/openapi-to-postmanv2" ;
1212import sdk from "@paloaltonetworks/postman-collection" ;
1313import Collection from "@paloaltonetworks/postman-collection" ;
@@ -320,7 +320,7 @@ export async function readOpenapiFiles(
320320 return Promise . all (
321321 sources . map ( async ( source ) => {
322322 // TODO: make a function for this
323- const fullPath = path . join ( openapiPath , source ) ;
323+ const fullPath = posixPath ( path . join ( openapiPath , source ) ) ;
324324 const data = ( await loadAndResolveSpec (
325325 fullPath
326326 ) ) as unknown as OpenApiObject ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
1313 SidebarItemCategoryLinkConfig ,
1414 SidebarItemDoc ,
1515} from "@docusaurus/plugin-content-docs/src/sidebars/types" ;
16+ import { posixPath } from "@docusaurus/utils" ;
1617import clsx from "clsx" ;
1718import { kebabCase } from "lodash" ;
1819import uniq from "lodash/uniq" ;
@@ -148,8 +149,15 @@ function groupByTags(
148149 type : "generated-index" as "generated-index" ,
149150 title : tag ,
150151 slug : label
151- ? path . join ( "/category" , basePath , kebabCase ( label ) , kebabCase ( tag ) )
152- : path . join ( "/category" , basePath , kebabCase ( tag ) ) ,
152+ ? posixPath (
153+ path . join (
154+ "/category" ,
155+ basePath ,
156+ kebabCase ( label ) ,
157+ kebabCase ( tag )
158+ )
159+ )
160+ : posixPath ( path . join ( "/category" , basePath , kebabCase ( tag ) ) ) ,
153161 } as SidebarItemCategoryLinkConfig ;
154162 }
155163
You can’t perform that action at this time.
0 commit comments