@@ -22,7 +22,7 @@ globalThis.Underline = {
22
22
console . info ( `[BİLGİ] "${ rltPath } " konumundaki plugin yükleniyor..` )
23
23
/** @type {import("../types/Plugin") } */
24
24
let plugin = require ( pluginFile ) ;
25
- console . info ( "Plugin:" , plugin . _type , plugin . namespace , plugin ) ;
25
+ console . info ( "Plugin:" , plugin . _type , plugin . namespace , plugin ) ;
26
26
// console.log(plugin)
27
27
28
28
if ( plugin . _type != "plugin" )
@@ -32,10 +32,10 @@ globalThis.Underline = {
32
32
return console . warn ( `[UYARI] ${ plugin . name } plugini zaten yüklenmiş. Atlanıyor..` ) ;
33
33
34
34
loadedNamespaces . push ( plugin . namespace ) ;
35
-
35
+
36
36
let parsedPluginPath = path . parse ( pluginFile ) ;
37
37
// console.log(parsedPluginPath)
38
-
38
+
39
39
let dtsPath = "" ;
40
40
41
41
switch ( parsedPluginPath . dir . split ( path . sep ) . pop ( ) ) {
@@ -50,7 +50,7 @@ globalThis.Underline = {
50
50
}
51
51
console . log ( dtsPath ) ;
52
52
let isDTS = fs . existsSync ( dtsPath ) ;
53
-
53
+
54
54
if ( isDTS ) {
55
55
pluginTypes . push ( `["${ plugin . namespace } "]: import("${ path . relative ( process . cwd ( ) , dtsPath ) . replace ( ".d.ts" , "" ) . replaceAll ( path . sep , "/" ) } ").Plugin` ) ;
56
56
} else {
@@ -75,12 +75,12 @@ globalThis.Underline = {
75
75
76
76
}
77
77
}
78
-
78
+
79
79
console . info ( `[BİLGİ] "${ plugin . name } " plugini tipi çıkartıldı.` ) ;
80
80
} ) ;
81
81
82
82
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 ( ) ;
84
84
console . info ( result ) ;
85
85
await fs . promises . writeFile ( path . resolve ( __dirname , "../generated/pluginTypes.d.ts" ) , result ) ;
86
86
@@ -126,7 +126,7 @@ async function getPluginFilePaths() {
126
126
let folderPath = path . resolve ( pluginsPath , folderOrZip . name . replace ( ".up.zip" , ".up" ) ) ;
127
127
let zipPath = path . resolve ( pluginsPath , folderOrZip . name ) ;
128
128
129
- await fs . promises . rm ( folderPath , { recursive : true } ) . catch ( ( ) => { } ) ;
129
+ await fs . promises . rm ( folderPath , { recursive : true } ) . catch ( ( ) => { } ) ;
130
130
await makeSureFolderExists ( folderPath ) ;
131
131
await extractZip ( zipPath , { dir : folderPath } ) ;
132
132
fs . promises . unlink ( zipPath ) . catch ( ( ) => null ) ;
0 commit comments