From f6227bf6dd6ff3f9aeb82895db6abd77ea1636d4 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Mon, 23 Jan 2023 04:03:01 -0800 Subject: Upgrade Bun.Transpiler to use new bindings --- src/bun.js/api/transpiler.classes.ts | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/bun.js/api/transpiler.classes.ts (limited to 'src/bun.js/api/transpiler.classes.ts') diff --git a/src/bun.js/api/transpiler.classes.ts b/src/bun.js/api/transpiler.classes.ts new file mode 100644 index 000000000..d10090f35 --- /dev/null +++ b/src/bun.js/api/transpiler.classes.ts @@ -0,0 +1,40 @@ +import { define } from "../scripts/class-definitions"; + +export default [ + define({ + name: "Transpiler", + construct: true, + finalize: true, + hasPendingActivity: false, + klass: {}, + JSType: "0b11101110", + proto: { + scanImports: { + fn: "scanImports", + length: 2, + }, + scan: { + fn: "scan", + length: 2, + }, + transform: { + fn: "transform", + length: 2, + }, + transformSync: { + fn: "transformSync", + length: 2, + }, + }, + custom: { + onLoadPlugins: { + extraHeaderIncludes: ["BunPlugin.h"], + impl: "JSTranspiler+BunPlugin-impl.h", + type: `WTF::Vector>`, + }, + onResolvePlugins: { + type: `WTF::Vector>`, + }, + }, + }), +]; -- cgit v1.2.3