File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env -S deno run --allow-read --allow-write
22
33import { expandGlob } from "@std/fs" ;
4+ import { fromFileUrl } from "@std/path" ;
45
56interface DenoConfig {
67 name ?: string ;
78 exports ?: string | Record < string , string > ;
89 imports ?: Record < string , string > ;
910}
1011
11- const rootDir = new URL ( ".." , import . meta. url ) . pathname ;
12+ const rootDir = fromFileUrl ( new URL ( ".." , import . meta. url ) ) ;
1213const imports = new Map < string , string > ( ) ;
1314const workspacePackages = new Map < string , string > ( ) ;
1415
@@ -33,8 +34,12 @@ for await (
3334 }
3435
3536 // Get package directory relative to root
36- const packageDir = file . path . replace ( rootDir , "" ) . replace ( "/deno.json" , "" ) ;
37- const fullExportPath = `./${ packageDir } /${ exportPath . replace ( "./" , "" ) } ` ;
37+ const packageDir = file . path . replace ( rootDir , "" ) . replace (
38+ / [ \/ \\ ] d e n o \. j s o n $ / ,
39+ "" ,
40+ ) ;
41+ const fullExportPath = `./${ packageDir } /${ exportPath . replace ( "./" , "" ) } `
42+ . replace ( / \\ / g, "/" ) ;
3843
3944 workspacePackages . set ( config . name , fullExportPath ) ;
4045 }
You can’t perform that action at this time.
0 commit comments