feat(userscript): GM_xmlhttpRequest transport, GM storage, metadata banner and build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
17ecebc4a4
commit
162ab4afb0
5 files changed
+195
No files matched your search
@@ -0,0 +1,14 @@
|
||||
// bun run build:userscript → dist/web/mbseed.user.js (served by our server at /mbseed.user.js).
|
||||
// Set MBSEED_PUBLIC_URL to add our server to @connect.
|
||||
import pkg from "../package.json";
|
||||
import { userscriptBanner } from "./userscript-banner";
|
||||
|
||||
const result = await Bun.build({ entrypoints: ["src/userscript/main.ts"], target: "browser", format: "iife" });
|
||||
if (!result.success) {
|
||||
for (const log of result.logs) console.error(log);
|
||||
process.exit(1);
|
||||
}
|
||||
const code = await result.outputs[0]!.text();
|
||||
const out = userscriptBanner(pkg.version, process.env.MBSEED_PUBLIC_URL || undefined) + code;
|
||||
await Bun.write("dist/web/mbseed.user.js", out);
|
||||
console.log(`wrote dist/web/mbseed.user.js (${Math.round(out.length / 1024)} KB)`);
|
||||
Reference in new issue
Block a user