File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
doxdox-renderer-github-wiki/src Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 11import { join , resolve } from 'path' ;
22
3+ import { pathToFileURL } from 'url' ;
4+
35import { getProjectPackage , isDirectory , isFile } from './utils.js' ;
46
57/**
@@ -46,7 +48,7 @@ export const loadPluginFromFile = async <T>(
4648 path : string
4749) : Promise < T | null > => {
4850 try {
49- return ( await import ( resolve ( path ) ) ) . default ;
51+ return ( await import ( pathToFileURL ( resolve ( path ) ) . href ) ) . default ;
5052 } catch ( err : any ) {
5153 if ( process . env . DEBUG ) {
5254 console . error ( err ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { EOL } from 'os';
22
33import { promises as fs } from 'fs' ;
44
5- import { resolve , join , dirname } from 'path' ;
5+ import { resolve , dirname } from 'path' ;
66
77import { fileURLToPath } from 'url' ;
88
@@ -30,7 +30,7 @@ export const findFileInPath = async (
3030 ? dirname ( input )
3131 : input ;
3232
33- const filePath = resolve ( join ( inputDirectory , fileName ) ) ;
33+ const filePath = resolve ( inputDirectory , fileName ) ;
3434
3535 const fileStat = await fs . stat ( filePath ) ;
3636
@@ -61,13 +61,13 @@ export const findParentNodeModules = async (
6161) : Promise < string | null > => {
6262 if ( maxDepth > 0 ) {
6363 try {
64- const nodeModulesPath = resolve ( currentDirectory , './ node_modules' ) ;
64+ const nodeModulesPath = resolve ( currentDirectory , 'node_modules' ) ;
6565
6666 if ( await fs . stat ( nodeModulesPath ) ) {
6767 return nodeModulesPath ;
6868 }
6969 } catch ( _ ) {
70- const parentDirectory = resolve ( currentDirectory , '../ ' ) ;
70+ const parentDirectory = resolve ( currentDirectory , '..' ) ;
7171
7272 return await findParentNodeModules ( parentDirectory , -- maxDepth ) ;
7373 }
Original file line number Diff line number Diff line change 1+ import { join } from 'path' ;
2+
13import admzip from 'adm-zip' ;
24
35import { markdownTable } from 'markdown-table' ;
@@ -39,7 +41,7 @@ export default async (doc: Doc): Promise<string | Buffer> => {
3941 Promise . all (
4042 file . methods . map ( async method =>
4143 zip . addFile (
42- ` ${ file . path } / ${ method . name } .md`,
44+ join ( file . path , ` ${ method . name } .md`) ,
4345 Buffer . from ( renderMethod ( method ) , 'utf-8' )
4446 )
4547 )
You can’t perform that action at this time.
0 commit comments