chore: esm import

This commit is contained in:
Louis 2023-11-13 22:04:22 +07:00
parent f3060f290e
commit 7715cd1bd9
2 changed files with 4 additions and 6 deletions

View File

@ -4,7 +4,7 @@ import { ModuleManager } from "../managers/module";
import { join, extname } from "path"; import { join, extname } from "path";
import { PluginManager } from "../managers/plugin"; import { PluginManager } from "../managers/plugin";
import { WindowManager } from "../managers/window"; import { WindowManager } from "../managers/window";
const pacote = require("pacote"); import { manifest, tarball } from "pacote";
export function handlePluginIPCs() { export function handlePluginIPCs() {
/** /**
@ -107,10 +107,9 @@ export function handlePluginIPCs() {
app.getPath("userData"), app.getPath("userData"),
pluginName.replace(/^@.*\//, "") + ".tgz" pluginName.replace(/^@.*\//, "") + ".tgz"
); );
return pacote return manifest(pluginName)
.manifest(pluginName)
.then(async (manifest: any) => { .then(async (manifest: any) => {
await pacote.tarball(manifest._resolved).then((data: Buffer) => { await tarball(manifest._resolved).then((data: Buffer) => {
writeFileSync(destination, data); writeFileSync(destination, data);
}); });
}) })

View File

@ -1,7 +1,6 @@
import { app, dialog } from "electron"; import { app, dialog } from "electron";
import { WindowManager } from "../managers/window"; import { WindowManager } from "../managers/window";
import { autoUpdater } from "electron-updater";
const { autoUpdater } = require("electron-updater");
export function handleAppUpdates() { export function handleAppUpdates() {
/* Should not check for update during development */ /* Should not check for update during development */