From 67742305135882700f3af303cd500da972e946c8 Mon Sep 17 00:00:00 2001 From: amsyarasyiq <82711525+amsyarasyiq@users.noreply.github.com> Date: Wed, 5 Apr 2023 16:35:45 +0800 Subject: [PATCH] change author to pylix & fix stupit --- base_manifest.json | 2 +- build.mjs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/base_manifest.json b/base_manifest.json index 64fc0eb..e947e4a 100644 --- a/base_manifest.json +++ b/base_manifest.json @@ -1,7 +1,7 @@ { "authors": [ { - "name": "amsyarasyiq", + "name": "pylix", "id": "492949202121261067" } ], diff --git a/build.mjs b/build.mjs index 65a2471..fe19c58 100644 --- a/build.mjs +++ b/build.mjs @@ -60,7 +60,7 @@ async function buildPlugin(plugin) { const map = { "react": "window.React", - "react-native": "globalThis.vendetta.metro.common.ReactNative" + "react-native": "vendetta.metro.common.ReactNative" }; return map[id] || null; @@ -107,7 +107,7 @@ async function buildPlugin(plugin) { ] }; - Object.assign(manifest, { + const applyHash = async () => Object.assign(manifest, { hash: createHash("sha256").update(await readFile(outPath)).digest("hex"), main: entry }); @@ -117,6 +117,7 @@ async function buildPlugin(plugin) { await bundle.write(options.output); await bundle.close(); + await applyHash(); await writeFile(`./dist/${plugin}/manifest.json`, JSON.stringify(manifest)); console.log(`${plugin}: ` + "\x1b[32m" + "Build succeed!" + "\x1b[0m"); @@ -131,6 +132,7 @@ async function buildPlugin(plugin) { case "BUNDLE_END": { event.result.close(); + await applyHash(); await writeFile(`./dist/${plugin}/manifest.json`, JSON.stringify(manifest)); console.log(`${plugin}: ` + "\x1b[32m" + `Build succeed! (${event.duration}ms)` + "\x1b[0m");