File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import yargs from "yargs"
4
4
import { hideBin } from "yargs/helpers"
5
5
import * as fs from "fs/promises"
6
6
import mkdirp from "mkdirp"
7
- import path from "path"
7
+ import path from "path/posix "
8
8
9
9
const argv = yargs ( hideBin ( process . argv ) )
10
10
. option ( "dir" , {
Original file line number Diff line number Diff line change 1
1
import glob from "glob-promise"
2
2
import mkdirp from "mkdirp"
3
- import path from "path"
3
+ import path from "path/posix "
4
4
import prettier from "prettier"
5
5
import { existsSync } from "fs"
6
6
import fs from "fs/promises"
@@ -85,7 +85,9 @@ export const getVirtualFilesystemModuleFromDirPath = async (
85
85
Object . entries ( vfs )
86
86
. map ( ( [ path , content ] ) =>
87
87
cf === "buffer"
88
- ? ` "${ path } ": Buffer.from("${ content . toString ( "base64" ) } ", "base64")`
88
+ ? ` "${ path } ": Buffer.from("${ content . toString (
89
+ "base64"
90
+ ) } ", "base64")`
89
91
: ` "${ path } ": decodeURIComponent("${ replaceSafeEncodedChars (
90
92
encodeURIComponent ( content . toString ( ) )
91
93
) } ")`
@@ -148,11 +150,15 @@ export const getVirtualFilesystemModuleFromDirPath = async (
148
150
let fps = Object . keys ( vfs )
149
151
return (
150
152
`${ fps
151
- . map ( ( fp ) =>
152
- `import ${ idsafe ( fp ) } from "./${ path . join ( basePath , fp ) } " with { type: "file" };`
153
+ . map (
154
+ ( fp ) =>
155
+ `import ${ idsafe ( fp ) } from "./${ path . join (
156
+ basePath ,
157
+ fp
158
+ ) } " with { type: "file" };`
153
159
)
154
160
. join ( "\n" ) } \n\n` +
155
- 'import { file } from "bun";\n\n' +
161
+ 'import { file } from "bun";\n\n' +
156
162
`export default {\n` +
157
163
fps . map ( ( fp ) => ` "${ fp } ": file(${ idsafe ( fp ) } )` ) . join ( ",\n" ) +
158
164
`\n}`
You can’t perform that action at this time.
0 commit comments