mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-01 20:43:33 +00:00
Replace remote wrapper module with Vite alias.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Anders Kaseorg
parent
d42b752ac1
commit
9a200dc40c
@@ -5,11 +5,11 @@ import * as Sentry from "@sentry/electron";
|
||||
import {JsonDB} from "node-json-db";
|
||||
import {DataError} from "node-json-db/dist/lib/Errors";
|
||||
import type * as z from "zod";
|
||||
import {app, dialog} from "zulip:remote";
|
||||
|
||||
import {configSchemata} from "./config-schemata.js";
|
||||
import * as EnterpriseUtil from "./enterprise-util.js";
|
||||
import Logger from "./logger-util.js";
|
||||
import {app, dialog} from "./remote.js";
|
||||
|
||||
export type Config = {
|
||||
[Key in keyof typeof configSchemata]: z.output<typeof configSchemata[Key]>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import fs from "node:fs";
|
||||
|
||||
import {app} from "./remote.js";
|
||||
import {app} from "zulip:remote";
|
||||
|
||||
let setupCompleted = false;
|
||||
|
||||
|
||||
@@ -3,8 +3,9 @@ import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import process from "node:process";
|
||||
|
||||
import {app} from "zulip:remote";
|
||||
|
||||
import {initSetUp} from "./default-util.js";
|
||||
import {app} from "./remote.js";
|
||||
|
||||
type LoggerOptions = {
|
||||
file?: string;
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import process from "node:process";
|
||||
|
||||
export const {app, dialog} =
|
||||
process.type === "renderer"
|
||||
? // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
||||
(require("@electron/remote") as typeof import("@electron/remote"))
|
||||
: // eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
require("electron/main");
|
||||
238
package-lock.json
generated
238
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -140,13 +140,11 @@
|
||||
"Desktop app",
|
||||
"InstantMessaging"
|
||||
],
|
||||
"dependencies": {
|
||||
"@electron/remote": "^2.0.8"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fs-xattr": "^0.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron/remote": "^2.0.8",
|
||||
"@sentry/electron": "^4.1.2",
|
||||
"@types/adm-zip": "^0.5.0",
|
||||
"@types/auto-launch": "^5.0.2",
|
||||
|
||||
7
typings.d.ts
vendored
7
typings.d.ts
vendored
@@ -3,3 +3,10 @@ declare namespace Electron {
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
||||
interface IncomingMessage extends NodeJS.ReadableStream {}
|
||||
}
|
||||
|
||||
declare module "zulip:remote" {
|
||||
export const {
|
||||
app,
|
||||
dialog,
|
||||
}: typeof import("electron/main") | typeof import("@electron/remote");
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import * as path from "node:path";
|
||||
|
||||
import {defineConfig} from "vite";
|
||||
@@ -37,6 +39,11 @@ export default defineConfig({
|
||||
},
|
||||
ssr: true,
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
"zulip:remote": "electron/main",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -82,6 +89,11 @@ export default defineConfig({
|
||||
external: ["electron", /^electron\//, "@yaireo/tagify"],
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
"zulip:remote": "@electron/remote",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]),
|
||||
|
||||
Reference in New Issue
Block a user