@@ -9,7 +9,7 @@ import { tryFlatten } from 'try-flatten';
9
9
import { ExitError } from './ExitError' ;
10
10
import { MiddleWare , type MiddleWareInterceptor } from './MiddleWare' ;
11
11
import { TypedEvents } from './TypedEvents' ;
12
- import { BUILTIN_DATA_KEY , DOT_FILE_PREFIX , EJS_FILE_REGEX , EJS_FILE_SUFFIX , UNDERSCORE_FILE_PREFIX } from './const' ;
12
+ import { BUILTIN_DATA_KEY , EJS_FILE_REGEX , EJS_FILE_SUFFIX } from './const' ;
13
13
import { colors , prompts , selectTemplate , selectWriteMode } from './prompts' ;
14
14
import type { CreatorContext , CreatorData , CreatorOptions , FileMeta , OverrideWrite } from './types' ;
15
15
import { isDirectory } from './utils' ;
@@ -109,7 +109,7 @@ export class Creator<T extends Record<string, unknown>> extends TypedEvents<{
109
109
const paths = await glob ( '**/*' , {
110
110
nodir : true ,
111
111
cwd : context . templateRoot ,
112
- dot : false ,
112
+ dot : true ,
113
113
} ) ;
114
114
115
115
// Verify selected template contains files
@@ -149,32 +149,14 @@ export class Creator<T extends Record<string, unknown>> extends TypedEvents<{
149
149
const sourceFile = path . join ( context . templateRoot , sourcePath ) ;
150
150
151
151
const isEjsFile = EJS_FILE_REGEX . test ( sourceFileName ) ;
152
- const isUnderscoreFile = sourceFileName . startsWith ( UNDERSCORE_FILE_PREFIX ) ;
153
- const isDotFile = ! isUnderscoreFile && sourceFileName . startsWith ( DOT_FILE_PREFIX ) ;
154
-
155
- let start = 0 ;
156
- let end = undefined ;
157
- let prefix = '' ;
158
-
159
- if ( isEjsFile ) {
160
- end = - EJS_FILE_SUFFIX . length ;
161
- }
162
-
163
- if ( isUnderscoreFile ) {
164
- start = UNDERSCORE_FILE_PREFIX . length ;
165
- prefix = '_' ;
166
- } else if ( isDotFile ) {
167
- start = DOT_FILE_PREFIX . length ;
168
- prefix = '.' ;
169
- }
170
-
171
- const targetPath = path . join ( sourceFolder , prefix + sourceFileName . slice ( start , end ) ) ;
152
+ const targetPath = path . join (
153
+ sourceFolder ,
154
+ sourceFileName . slice ( 0 , isEjsFile ? - EJS_FILE_SUFFIX . length : undefined ) ,
155
+ ) ;
172
156
const targetFile = path . join ( context . projectRoot , targetPath ) ;
173
157
174
158
const fileMeta : FileMeta = {
175
- isDotFile,
176
159
isEjsFile : isEjsFile ,
177
- isUnderscoreFile,
178
160
sourcePath,
179
161
sourceFile,
180
162
sourceRoot : context . templateRoot ,
0 commit comments