PenguLoader / PenguLoader

✨ The ultimate JavaScript plugin loader, build your unmatched LoL Client.
https://pengu.lol
Do What The F*ck You Want To Public License
346 stars 56 forks source link

[Core]🎉Introduce PluginFS API and Move to C++17 #75

Closed BakaFT closed 8 months ago

BakaFT commented 8 months ago

Devs now can access filesystem of their own plugin folder. Docs is coming soon!

interface PluginFS {
  read: (path: string) => Promise<string | undefined>
  write: (path: string, content: string, enableAppendMode: boolean) => Promise<boolean>
  mkdir: (path: string) => Promise<boolean>
  stat: (path: string) => Promise<FileStat | undefined>
  readDir: (path: string) => Promise<string[] | undefined>
  rm: (path: string, recursively:boolean) => Promise<number>
}
nomi-san commented 8 months ago

@BakaFT, you should rename readDir to ls There is an issue with wchar_t, it's actually not utf16, so just read files to utf8 bytes array and let CefString converts it.

-wstr content = readFile(path);
+str content = readFile_utf8(path);
return V8Value::string(file_content);

Read here: https://utf8everywhere.org/

BakaFT commented 8 months ago

@nomi-san Pushed some fixes onit and build success on my fork