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

View File

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