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 1
1
import { join , resolve } from 'path' ;
2
2
3
+ import { pathToFileURL } from 'url' ;
4
+
3
5
import { getProjectPackage , isDirectory , isFile } from './utils.js' ;
4
6
5
7
/**
@@ -46,7 +48,7 @@ export const loadPluginFromFile = async <T>(
46
48
path : string
47
49
) : Promise < T | null > => {
48
50
try {
49
- return ( await import ( resolve ( path ) ) ) . default ;
51
+ return ( await import ( pathToFileURL ( resolve ( path ) ) . href ) ) . default ;
50
52
} catch ( err : any ) {
51
53
if ( process . env . DEBUG ) {
52
54
console . error ( err ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { EOL } from 'os';
2
2
3
3
import { promises as fs } from 'fs' ;
4
4
5
- import { resolve , join , dirname } from 'path' ;
5
+ import { resolve , dirname } from 'path' ;
6
6
7
7
import { fileURLToPath } from 'url' ;
8
8
@@ -30,7 +30,7 @@ export const findFileInPath = async (
30
30
? dirname ( input )
31
31
: input ;
32
32
33
- const filePath = resolve ( join ( inputDirectory , fileName ) ) ;
33
+ const filePath = resolve ( inputDirectory , fileName ) ;
34
34
35
35
const fileStat = await fs . stat ( filePath ) ;
36
36
@@ -61,13 +61,13 @@ export const findParentNodeModules = async (
61
61
) : Promise < string | null > => {
62
62
if ( maxDepth > 0 ) {
63
63
try {
64
- const nodeModulesPath = resolve ( currentDirectory , './ node_modules' ) ;
64
+ const nodeModulesPath = resolve ( currentDirectory , 'node_modules' ) ;
65
65
66
66
if ( await fs . stat ( nodeModulesPath ) ) {
67
67
return nodeModulesPath ;
68
68
}
69
69
} catch ( _ ) {
70
- const parentDirectory = resolve ( currentDirectory , '../ ' ) ;
70
+ const parentDirectory = resolve ( currentDirectory , '..' ) ;
71
71
72
72
return await findParentNodeModules ( parentDirectory , -- maxDepth ) ;
73
73
}
Original file line number Diff line number Diff line change
1
+ import { join } from 'path' ;
2
+
1
3
import admzip from 'adm-zip' ;
2
4
3
5
import { markdownTable } from 'markdown-table' ;
@@ -39,7 +41,7 @@ export default async (doc: Doc): Promise<string | Buffer> => {
39
41
Promise . all (
40
42
file . methods . map ( async method =>
41
43
zip . addFile (
42
- ` ${ file . path } / ${ method . name } .md`,
44
+ join ( file . path , ` ${ method . name } .md`) ,
43
45
Buffer . from ( renderMethod ( method ) , 'utf-8' )
44
46
)
45
47
)
You can’t perform that action at this time.
0 commit comments