Websockets for plugin runtime communication (#156)

This commit is contained in:
Gregory Schier
2025-01-20 10:55:53 -08:00
committed by GitHub
parent 095aaa5e92
commit b698a56549
54 changed files with 841 additions and 1185 deletions

View File

@@ -20,10 +20,20 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
// src/index.ts
var src_exports = {};
__export(src_exports, {
pluginHookImport: () => pluginHookImport
migrateImport: () => migrateImport,
plugin: () => plugin
});
module.exports = __toCommonJS(src_exports);
function pluginHookImport(_ctx, contents) {
var plugin = {
importer: {
name: "Yaak",
description: "Yaak official format",
onImport(_ctx, args) {
return migrateImport(args.text);
}
}
};
function migrateImport(contents) {
let parsed;
try {
parsed = JSON.parse(contents);
@@ -66,5 +76,6 @@ function isJSObject(obj) {
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
pluginHookImport
migrateImport,
plugin
});