8
8
*/
9
9
10
10
import { fileURLToPath } from 'node:url'
11
- import { basename , dirname , join , relative } from 'node:path'
12
11
import string from '@poppinss/utils/string'
13
12
import { isScriptFile } from '@poppinss/utils'
14
13
import { fsReadAll } from '@poppinss/utils/fs'
15
14
import { mkdir , writeFile } from 'node:fs/promises'
16
15
import { type OneOrMore } from '@poppinss/utils/types'
17
16
import StringBuilder from '@poppinss/utils/string_builder'
17
+ import { basename , dirname , join , relative } from 'node:path'
18
18
import { installPackage , detectPackageManager } from '@antfu/install-pkg'
19
19
import {
20
20
Node ,
@@ -26,13 +26,13 @@ import {
26
26
type FormatCodeSettings ,
27
27
} from 'ts-morph'
28
28
29
+ import debug from '../debug.ts'
29
30
import { RcFileTransformer } from './rc_file_transformer.ts'
30
31
import type {
31
32
MiddlewareNode ,
32
33
EnvValidationNode ,
33
34
BouncerPolicyNode ,
34
35
} from '../types/code_transformer.ts'
35
- import debug from '../debug.ts'
36
36
37
37
/**
38
38
* This class is responsible for updating
@@ -511,14 +511,14 @@ export class CodeTransformer {
511
511
} )
512
512
513
513
return filesList . map ( ( filePath ) => {
514
- const name = new StringBuilder ( relative ( sourcePath , filePath ) )
514
+ const name = new StringBuilder ( string . toUnixSlash ( relative ( sourcePath , filePath ) ) )
515
515
. removeExtension ( )
516
516
. pascalCase ( )
517
517
. toString ( )
518
518
519
519
const importPath = importAlias
520
- ? `${ importAlias } /${ new StringBuilder ( relative ( sourcePath , filePath ) ) . removeExtension ( ) . toString ( ) } `
521
- : relative ( outputDir , filePath )
520
+ ? `${ importAlias } /${ new StringBuilder ( string . toUnixSlash ( relative ( sourcePath , filePath ) ) ) . removeExtension ( ) . toString ( ) } `
521
+ : string . toUnixSlash ( relative ( outputDir , filePath ) )
522
522
523
523
return {
524
524
name : output . transformName ?.( name ) ?? name ,
0 commit comments