@@ -22,7 +22,7 @@ globalThis.Underline = {
2222 console . info ( `[BİLGİ] "${ rltPath } " konumundaki plugin yükleniyor..` )
2323 /** @type {import("../types/Plugin") } */
2424 let plugin = require ( pluginFile ) ;
25- console . info ( "Plugin:" , plugin . _type , plugin . namespace , plugin ) ;
25+ console . info ( "Plugin:" , plugin . _type , plugin . namespace , plugin ) ;
2626 // console.log(plugin)
2727
2828 if ( plugin . _type != "plugin" )
@@ -32,10 +32,10 @@ globalThis.Underline = {
3232 return console . warn ( `[UYARI] ${ plugin . name } plugini zaten yüklenmiş. Atlanıyor..` ) ;
3333
3434 loadedNamespaces . push ( plugin . namespace ) ;
35-
35+
3636 let parsedPluginPath = path . parse ( pluginFile ) ;
3737 // console.log(parsedPluginPath)
38-
38+
3939 let dtsPath = "" ;
4040
4141 switch ( parsedPluginPath . dir . split ( path . sep ) . pop ( ) ) {
@@ -50,7 +50,7 @@ globalThis.Underline = {
5050 }
5151 console . log ( dtsPath ) ;
5252 let isDTS = fs . existsSync ( dtsPath ) ;
53-
53+
5454 if ( isDTS ) {
5555 pluginTypes . push ( `["${ plugin . namespace } "]: import("${ path . relative ( process . cwd ( ) , dtsPath ) . replace ( ".d.ts" , "" ) . replaceAll ( path . sep , "/" ) } ").Plugin` ) ;
5656 } else {
@@ -75,12 +75,12 @@ globalThis.Underline = {
7575
7676 }
7777 }
78-
78+
7979 console . info ( `[BİLGİ] "${ plugin . name } " plugini tipi çıkartıldı.` ) ;
8080 } ) ;
8181
8282 await makeSureFolderExists ( path . resolve ( __dirname , "../generated" ) ) ;
83- let result = `export class Types {\n${ pluginTypes . map ( i => ` ${ i } ;` ) . join ( "\n" ) } \n};\n${ `export type TEventNames = ${ TEventNames . join ( " | " ) . trim ( ) || "any" } ;` } \n${ `export type TEvents = ${ TEvents . join ( " | " ) . trim ( ) || "any " } ;` } \n${ TInterfaces . join ( "\n" ) } \n` . trim ( ) ;
83+ let result = `export class Types {\n${ pluginTypes . map ( i => ` ${ i } ;` ) . join ( "\n" ) } \n};\n${ `export type TEventNames = ${ TEventNames . join ( " | " ) . trim ( ) || '""' } ;` } \n${ `export type TEvents = ${ TEvents . join ( " | " ) . trim ( ) || "[] " } ;` } \n${ TInterfaces . join ( "\n" ) } \n` . trim ( ) ;
8484 console . info ( result ) ;
8585 await fs . promises . writeFile ( path . resolve ( __dirname , "../generated/pluginTypes.d.ts" ) , result ) ;
8686
@@ -126,7 +126,7 @@ async function getPluginFilePaths() {
126126 let folderPath = path . resolve ( pluginsPath , folderOrZip . name . replace ( ".up.zip" , ".up" ) ) ;
127127 let zipPath = path . resolve ( pluginsPath , folderOrZip . name ) ;
128128
129- await fs . promises . rm ( folderPath , { recursive : true } ) . catch ( ( ) => { } ) ;
129+ await fs . promises . rm ( folderPath , { recursive : true } ) . catch ( ( ) => { } ) ;
130130 await makeSureFolderExists ( folderPath ) ;
131131 await extractZip ( zipPath , { dir : folderPath } ) ;
132132 fs . promises . unlink ( zipPath ) . catch ( ( ) => null ) ;
0 commit comments