mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-11-04 05:53:21 +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 {JsonDB} from "node-json-db";
 | 
				
			||||||
import {DataError} from "node-json-db/dist/lib/Errors";
 | 
					import {DataError} from "node-json-db/dist/lib/Errors";
 | 
				
			||||||
import type * as z from "zod";
 | 
					import type * as z from "zod";
 | 
				
			||||||
 | 
					import {app, dialog} from "zulip:remote";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import {configSchemata} from "./config-schemata.js";
 | 
					import {configSchemata} from "./config-schemata.js";
 | 
				
			||||||
import * as EnterpriseUtil from "./enterprise-util.js";
 | 
					import * as EnterpriseUtil from "./enterprise-util.js";
 | 
				
			||||||
import Logger from "./logger-util.js";
 | 
					import Logger from "./logger-util.js";
 | 
				
			||||||
import {app, dialog} from "./remote.js";
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
export type Config = {
 | 
					export type Config = {
 | 
				
			||||||
  [Key in keyof typeof configSchemata]: z.output<typeof configSchemata[Key]>;
 | 
					  [Key in keyof typeof configSchemata]: z.output<typeof configSchemata[Key]>;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
import fs from "node:fs";
 | 
					import fs from "node:fs";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import {app} from "./remote.js";
 | 
					import {app} from "zulip:remote";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
let setupCompleted = false;
 | 
					let setupCompleted = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,8 +3,9 @@ import fs from "node:fs";
 | 
				
			|||||||
import os from "node:os";
 | 
					import os from "node:os";
 | 
				
			||||||
import process from "node:process";
 | 
					import process from "node:process";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import {app} from "zulip:remote";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import {initSetUp} from "./default-util.js";
 | 
					import {initSetUp} from "./default-util.js";
 | 
				
			||||||
import {app} from "./remote.js";
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
type LoggerOptions = {
 | 
					type LoggerOptions = {
 | 
				
			||||||
  file?: string;
 | 
					  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",
 | 
					    "Desktop app",
 | 
				
			||||||
    "InstantMessaging"
 | 
					    "InstantMessaging"
 | 
				
			||||||
  ],
 | 
					  ],
 | 
				
			||||||
  "dependencies": {
 | 
					 | 
				
			||||||
    "@electron/remote": "^2.0.8"
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  "optionalDependencies": {
 | 
					  "optionalDependencies": {
 | 
				
			||||||
    "fs-xattr": "^0.3.1"
 | 
					    "fs-xattr": "^0.3.1"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "devDependencies": {
 | 
					  "devDependencies": {
 | 
				
			||||||
 | 
					    "@electron/remote": "^2.0.8",
 | 
				
			||||||
    "@sentry/electron": "^4.1.2",
 | 
					    "@sentry/electron": "^4.1.2",
 | 
				
			||||||
    "@types/adm-zip": "^0.5.0",
 | 
					    "@types/adm-zip": "^0.5.0",
 | 
				
			||||||
    "@types/auto-launch": "^5.0.2",
 | 
					    "@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
 | 
					  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
 | 
				
			||||||
  interface IncomingMessage extends NodeJS.ReadableStream {}
 | 
					  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 * as path from "node:path";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import {defineConfig} from "vite";
 | 
					import {defineConfig} from "vite";
 | 
				
			||||||
@@ -37,6 +39,11 @@ export default defineConfig({
 | 
				
			|||||||
            },
 | 
					            },
 | 
				
			||||||
            ssr: true,
 | 
					            ssr: true,
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
 | 
					          resolve: {
 | 
				
			||||||
 | 
					            alias: {
 | 
				
			||||||
 | 
					              "zulip:remote": "electron/main",
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
@@ -82,6 +89,11 @@ export default defineConfig({
 | 
				
			|||||||
              external: ["electron", /^electron\//, "@yaireo/tagify"],
 | 
					              external: ["electron", /^electron\//, "@yaireo/tagify"],
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
 | 
					          resolve: {
 | 
				
			||||||
 | 
					            alias: {
 | 
				
			||||||
 | 
					              "zulip:remote": "@electron/remote",
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
    ]),
 | 
					    ]),
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user