Drop Rollup in favor of esbuild

This commit is contained in:
Zaid Humaimidi committed 2023-12-12 22:27:58 -08:00
1 parent 342210faf1
commit 4f2dfb4f48
13 files changed
+735 -3805

No files matched your search

+1 -1
View File
@@ -103,4 +103,4 @@ export function asIntN(a: number, b: bigint): bigint {
const _BigInt = BigInt;
type _bigint = bigint;
export { _BigInt as BigInt, _bigint as bigint };
export { _BigInt as BigInt, type _bigint as bigint };
+2 -4
View File
@@ -30,8 +30,6 @@ function flattenObject<T extends Record<keyof T, unknown>>(
prefix = "",
dst = {} as T
): T {
const t: Record<string, string> = {};
t["hi"] = "hi";
for (const k of Object.keys(src)) {
const v = src[k];
if (typeof v === "object" && !Array.isArray(v))
@@ -201,7 +199,7 @@ async function fetchProvisions(): Promise<[string, Provisions]> {
.digest("hex");
provisions[r._id].script = new vm.Script(
`"use strict";(function(){\n${r.script}\n})();`,
{ filename: r._id, lineOffset: -1, timeout: 50 }
{ filename: r._id, lineOffset: -1 }
);
}
@@ -222,7 +220,7 @@ async function fetchVirtualParameters(): Promise<[string, VirtualParameters]> {
.digest("hex");
virtualParameters[r._id].script = new vm.Script(
`"use strict";(function(){\n${r.script}\n})();`,
{ filename: r._id, lineOffset: -1, timeout: 50 }
{ filename: r._id, lineOffset: -1 }
);
}
+2 -2
View File
@@ -34,7 +34,7 @@ const EXT = Symbol();
const UNDEFINED = undefined;
const context = vm.createContext();
const context = vm.createContext(undefined, { microtaskMode: "afterEvaluate" });
let state;
@@ -391,7 +391,7 @@ export async function run(
let ret, status;
try {
ret = script.runInContext(context, { displayErrors: false });
ret = script.runInContext(context, { displayErrors: false, timeout: 50 });
status = 0;
} catch (err) {
if (err === COMMIT) {
+4 -3
View File
@@ -35,6 +35,7 @@ import { authLocal } from "./api-functions";
import * as init from "./init";
import { version as VERSION } from "../package.json";
import memoize from "./common/memoize";
import { APP_JS, APP_CSS, FAVICON_PNG } from "../build/assets";
declare module "koa" {
interface Request {
@@ -232,8 +233,8 @@ router.get("/", async (ctx) => {
<html>
<head>
<title>GenieACS</title>
<link rel="shortcut icon" type="image/png" href="favicon.png" />
<link rel="stylesheet" href="app.css">
<link rel="shortcut icon" type="image/png" href="${FAVICON_PNG}" />
<link rel="stylesheet" href="${APP_CSS}">
</head>
<body>
<noscript>GenieACS UI requires JavaScript to work. Please enable JavaScript in your browser.</noscript>
@@ -248,7 +249,7 @@ router.get("/", async (ctx) => {
)};
window.permissionSets = ${JSON.stringify(permissionSets)};
</script>
<script type="module" src="app.js"></script>${wizard}
<script type="module" src="${APP_JS}"></script>${wizard}
</body>
</html>
`;