Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
Use @aliucord/rollup-plugin and new aliuhermes
Browse files Browse the repository at this point in the history
  • Loading branch information
js6pak committed May 7, 2022
1 parent 057cb7e commit e4672f7
Show file tree
Hide file tree
Showing 42 changed files with 954 additions and 1,204 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
dist
.idea
lib
.idea
5 changes: 0 additions & 5 deletions babel.config.json

This file was deleted.

10 changes: 10 additions & 0 deletions bootstrap/index.d.ts
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";
19 changes: 19 additions & 0 deletions bootstrap/index.ts
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);
}
})();
35 changes: 23 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
"name": "aliucord",
"version": "0.1.0",
"license": "OSL-3.0",
"publishConfig": {
"directory": "lib",
"typings": "index.d.ts"
},
"scripts": {
"build": "rollup -c --configPlugin esbuild",
"dev": "pnpm run build -- -w",
"deploy": "adb shell am start -S -n com.discordrn/.MainActivity",
"serve": "node serve.mjs"
"build": "rollup -c --configPlugin @rollup/plugin-typescript",
"dev": "pnpm run build -w",
"deploy": "adb shell am start -S -n com.discord/.MainActivity",
"prepublishOnly": "rm lib -r && tsc && cp package.json lib && cp LICENSE lib && cp README.md lib"
},
"repository": {
"type": "git",
Expand All @@ -17,24 +21,31 @@
},
"homepage": "https://aliucord.com",
"devDependencies": {
"@babel/core": "^7.17.9",
"@babel/plugin-transform-classes": "^7.16.7",
"@rollup/plugin-babel": "^5.3.1",
"@aliucord/rollup-plugin": "0.1.0",
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-typescript": "^8.3.2",
"@types/node": "^17.0.24",
"@types/react": "^17.0.39",
"@types/react-native": "^0.67.4",
"@typescript-eslint/eslint-plugin": "^5.19.0",
"@typescript-eslint/parser": "^5.19.0",
"esbuild": "^0.14.36",
"eslint": "^8.13.0",
"eslint-plugin-react": "^7.29.4",
"hermes-engine": "0.11.0",
"rollup": "^2.70.2",
"rollup-plugin-esbuild": "^4.9.1",
"rollup-plugin-hermes": "^0.11.1",
"typescript": "^4.6.3"
},
"dependencies": {
"react-devtools-core": "^4.24.4"
"@aliucord/react-devtools-core": "^4.24.4-aliucord.1",
"@swc/helpers": "^0.3.9"
},
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
"tslib"
]
}
},
"packageManager": "pnpm@6.32.9"
"packageManager": "pnpm@7.0.0"
}
Loading

0 comments on commit e4672f7

Please sign in to comment.