1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-05 23:53:21 +00:00

Upgrade electron & friends (v18.3.15 ⮕ v28.2.0) (#418)

* Update versions in package.json

* Rebuild package-lock.json

fix

* Update electron-log usage

* Change necessary logic to get the newest version of the package
  working
* Wrap up `init()` logic in a way that has parity with Bitwarden Desktop

Updates for electron-log

fix

* Update notarize script to match the latest @electron/notarize version

Update notarize step to look more like clients
This commit is contained in:
Addison Beck
2024-02-01 10:07:55 -06:00
committed by GitHub
parent 8a661fbc5e
commit 1fb4378046
5 changed files with 475 additions and 1221 deletions

View File

@@ -10,17 +10,22 @@ import { isDev } from "../utils";
export class ElectronLogService extends BaseLogService { export class ElectronLogService extends BaseLogService {
constructor( constructor(
protected filter: (level: LogLevelType) => boolean = null, protected filter: (level: LogLevelType) => boolean = null,
logDir: string = null, private logDir: string = null,
) { ) {
super(isDev(), filter); super(isDev(), filter);
}
init () {
if (log.transports == null) { if (log.transports == null) {
return; return;
} }
log.transports.file.level = "info"; log.transports.file.level = "info";
if (logDir != null) { if (this.logDir != null) {
log.transports.file.file = path.join(logDir, "app.log"); log.transports.file.resolvePathFn = () => path.join(this.logDir, "app.log");
} }
log.initialize();
} }
write(level: LogLevelType, message: string) { write(level: LogLevelType, message: string) {

1668
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -98,14 +98,14 @@
"cross-env": "7.0.3", "cross-env": "7.0.3",
"css-loader": "6.9.0", "css-loader": "6.9.0",
"dotenv": "16.4.1", "dotenv": "16.4.1",
"electron": "18.3.15", "electron": "28.2.0",
"electron-builder": "24.9.1", "electron-builder": "24.9.1",
"electron-log": "4.4.8", "electron-log": "5.0.1",
"electron-notarize": "1.2.2", "@electron/notarize": "2.2.1",
"electron-rebuild": "3.2.9", "@electron/rebuild": "3.6.0",
"electron-reload": "1.5.0", "electron-reload": "2.0.0-alpha.1",
"electron-store": "8.1.0", "electron-store": "8.1.0",
"electron-updater": "5.3.0", "electron-updater": "6.1.7",
"eslint": "8.56.0", "eslint": "8.56.0",
"eslint-config-prettier": "8.10.0", "eslint-config-prettier": "8.10.0",
"eslint-import-resolver-typescript": "2.7.1", "eslint-import-resolver-typescript": "2.7.1",

View File

@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable @typescript-eslint/no-var-requires */
require("dotenv").config(); require("dotenv").config();
const { notarize } = require("electron-notarize"); const { notarize } = require("@electron/notarize");
exports.default = async function notarizing(context) { exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context; const { electronPlatformName, appOutDir } = context;
@@ -11,8 +11,10 @@ exports.default = async function notarizing(context) {
const appleIdPassword = process.env.APPLE_ID_PASSWORD || `@keychain:AC_PASSWORD`; const appleIdPassword = process.env.APPLE_ID_PASSWORD || `@keychain:AC_PASSWORD`;
const appName = context.packager.appInfo.productFilename; const appName = context.packager.appInfo.productFilename;
return await notarize({ return await notarize({
tool: "notarytool",
appBundleId: "com.bitwarden.directory-connector", appBundleId: "com.bitwarden.directory-connector",
appPath: `${appOutDir}/${appName}.app`, appPath: `${appOutDir}/${appName}.app`,
teamId: "LTZ2PFU5D6",
appleId: appleId, appleId: appleId,
appleIdPassword: appleIdPassword, appleIdPassword: appleIdPassword,
}); });

View File

@@ -55,6 +55,7 @@ export class Main {
} }
this.logService = new ElectronLogService(null, app.getPath("userData")); this.logService = new ElectronLogService(null, app.getPath("userData"));
this.logService.init();
this.i18nService = new I18nService("en", "./locales/"); this.i18nService = new I18nService("en", "./locales/");
this.storageService = new ElectronStorageService(app.getPath("userData")); this.storageService = new ElectronStorageService(app.getPath("userData"));
this.stateService = new StateService( this.stateService = new StateService(