This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use @aliucord/rollup-plugin and new aliuhermes
- Loading branch information
Showing
42 changed files
with
954 additions
and
1,204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
dist | ||
.idea | ||
lib | ||
.idea |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
declare global { | ||
const nativeModuleProxy: { | ||
AliucordNative: { | ||
externalStorageDirectory: string, | ||
download: (url: string, path: string) => Promise<void>; | ||
}; | ||
}; | ||
} | ||
|
||
export * from "../src/aliuhermes"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
(async () => { | ||
try { | ||
const { externalStorageDirectory, download } = nativeModuleProxy.AliucordNative; | ||
const bundlePath = externalStorageDirectory + "/AliucordRN/Aliucord.js.bundle"; | ||
if (!AliuFS.exists(bundlePath)) { | ||
try { | ||
await download("https://raw.githubusercontent.com/Aliucord/AliucordRN/builds/Aliucord.js.bundle", bundlePath); | ||
} catch (error) { | ||
alert("Failed to download Aliucord.js.bundle"); | ||
throw error; | ||
} | ||
} | ||
|
||
(globalThis._globals ??= {}).aliucord = AliuHermes.run(bundlePath); | ||
} catch (error) { | ||
alert("Something went wrong :(\nCheck logs"); | ||
console.error((error as Error).stack); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.