@@ -13,7 +13,7 @@ export const run = Effect.gen(function*() {
1313
1414 const process = Effect . fnUntraced ( function * ( template : string ) {
1515 const directory = path . dirname ( template )
16- const content = ( yield * fs . readFileString ( path . join ( template ) ) ) . trim ( ) +
16+ const content = ( yield * fs . readFileString ( template ) ) . trim ( ) +
1717 "\n\n"
1818 const modules = ( yield * fs . readDirectory ( directory ) ) . map ( ( _ ) =>
1919 path . basename ( _ )
@@ -26,11 +26,9 @@ export const run = Effect.gen(function*() {
2626 { concurrency : "inherit" }
2727 )
2828 yield * fs . writeFileString (
29- path . join ( directory , "index.ts " ) ,
29+ template . replace ( / \. t p l $ / , "" ) ,
3030 `${ content } ${ moduleContents . join ( "\n\n" ) } \n`
31- ) . pipe (
32- Effect . uninterruptible
33- )
31+ ) . pipe ( Effect . uninterruptible )
3432 } , Effect . ignore )
3533
3634 const processModule = Effect . fnUntraced ( function * (
@@ -42,14 +40,11 @@ export const run = Effect.gen(function*() {
4240 const moduleName = file
4341 . slice ( file . lastIndexOf ( "/" ) + 1 )
4442 . slice ( 0 , - path . extname ( file ) . length )
45- const srcFile = file
46- . replace ( / \. t s $ / , ".js" )
47- . replace ( / \. t s x $ / , ".jsx" )
4843
49- return `${ topComment } \nexport * as ${ moduleName } from "./${ srcFile } "`
44+ return `${ topComment } \nexport * as ${ moduleName } from "./${ file } "`
5045 } )
5146
52- const templates = yield * fsUtils . glob ( "src/**/.index.ts " )
47+ const templates = yield * fsUtils . glob ( "src/**/*.tpl " )
5348
5449 yield * Effect . forEach (
5550 templates ,
0 commit comments