Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions bin/build-tools/build-linux-desktop-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,25 @@ void (async () => {
try {
const config = await buildLinuxConfig();
const desktopConfig = config.builderConfig.deb?.desktop;
desktopConfig.Comment = pkg.description;
desktopConfig.Exec = `${pkg.name} %U`;
desktopConfig.Icon = pkg.name;
desktopConfig.Terminal = false;
desktopConfig.Type = 'Application';
const formattedEntry = Object.entries(desktopConfig)

// Initialize entry if it doesn't exist
if (!desktopConfig?.entry) {
if (desktopConfig) {
desktopConfig.entry = {};
} else {
console.error('desktopConfig is null or undefined');
process.exit(1);
}
}

// Set properties in the entry object
desktopConfig.entry.Comment = pkg.description;
desktopConfig.entry.Exec = `${pkg.name} %U`;
desktopConfig.entry.Icon = pkg.name;
desktopConfig.entry.Terminal = 'false';
desktopConfig.entry.Type = 'Application';

const formattedEntry = Object.entries(desktopConfig.entry)
.map(([key, value]) => `${key}=${value}`)
.sort((entryA, entryB) => entryA.localeCompare(entryB))
.join('\n');
Expand Down
16 changes: 9 additions & 7 deletions bin/build-tools/lib/build-linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ export async function buildLinuxConfig(
};

const linuxDesktopConfig = {
Categories: linuxConfig.categories,
GenericName: linuxConfig.genericName,
Keywords: linuxConfig.keywords,
MimeType: `x-scheme-handler/${commonConfig.customProtocolName}`,
Name: commonConfig.name,
StartupWMClass: commonConfig.name,
Version: '1.1',
entry: {
Categories: linuxConfig.categories,
GenericName: linuxConfig.genericName,
Keywords: linuxConfig.keywords,
MimeType: `x-scheme-handler/${commonConfig.customProtocolName}`,
Name: commonConfig.name,
StartupWMClass: commonConfig.name,
Version: '1.1',
},
};

const platformSpecificConfig = {
Expand Down
5 changes: 3 additions & 2 deletions bin/build-tools/lib/build-macos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
*/

import {flatAsync as buildPkg} from '@electron/osx-sign';
// ES module will be imported dynamically where needed
import electronPackager, {ArchOption} from 'electron-packager';
import fs from 'fs-extra';
import path from 'path';
Expand Down Expand Up @@ -94,7 +94,7 @@ export async function buildMacOSConfig(
},
out: commonConfig.buildDir,
overwrite: true,
platform: 'mas', // Mac App Store
platform: 'mas', // Mac App Store
protocols: [{name: `${commonConfig.name} Core Protocol`, schemes: [commonConfig.customProtocolName]}],
prune: true,
quiet: false,
Expand Down Expand Up @@ -169,6 +169,7 @@ export async function buildMacOSWrapper(
if (signManually) {
await manualMacOSSign(appFile, pkgFile, commonConfig, macOSConfig);
} else {
const {flat: buildPkg} = await import('@electron/osx-sign');
await buildPkg({
app: appFile,
identity: macOSConfig.certNameInstaller,
Expand Down
3 changes: 2 additions & 1 deletion bin/build-tools/lib/commonConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
*/

import {flipFuses, FuseV1Options, FuseVersion} from '@electron/fuses';
// ES module will be imported dynamically where needed
import * as dotenv from 'dotenv';
import * as fs from 'fs-extra';
import * as path from 'path';
Expand Down Expand Up @@ -83,6 +83,7 @@ export async function getCommonConfig(envFile: string, wireJson: string): Promis

export async function flipElectronFuses(pathToElectron: string) {
logger.log(`Flipping fuses in "${pathToElectron}".`);
const {flipFuses, FuseV1Options, FuseVersion} = await import('@electron/fuses');
await flipFuses(pathToElectron, {
// see also https://www.electronjs.org/docs/latest/tutorial/fuses
version: FuseVersion.V1,
Expand Down
3 changes: 1 addition & 2 deletions electron/renderer/src/components/WebView/Webview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@

import {useEffect, useRef, useState} from 'react';

import {SVGIcon} from '@wireapp/react-ui-kit/lib/Icon/SVGIcon';
import {connect} from 'react-redux';

import {ContainerSM, COLOR, H1, Logo, Text, TextLink} from '@wireapp/react-ui-kit';
import {SVGIcon, ContainerSM, COLOR, H1, Logo, Text, TextLink} from '@wireapp/react-ui-kit';

import './Webview.css';

Expand Down
2 changes: 1 addition & 1 deletion electron/renderer/src/configureStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const configureStore = (thunkArguments: Object) => {
};

const createMiddleware = (thunkArguments: Object = {}) => {
const middlewares = [];
const middlewares: any[] = [];
middlewares.push(thunk.withExtraArgument(thunkArguments));
if (process.env.NODE_ENV !== 'production') {
middlewares.push(
Expand Down
35 changes: 19 additions & 16 deletions electron/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
safeStorage,
HandlerDetails,
} from 'electron';
import electronDl from 'electron-dl';
// Using dynamic import for ES module
import windowStateKeeper from 'electron-window-state';
import fs from 'fs-extra';
import {getProxySettings} from 'get-proxy-settings';
Expand Down Expand Up @@ -107,21 +107,24 @@ const customDownloadPath = settings.restore<string | undefined>(SettingsType.DOW
const appHomePath = (path: string) => `${app.getPath('home')}\\${path}`;

if (customDownloadPath) {
electronDl({
directory: appHomePath(customDownloadPath),
saveAs: false,
onCompleted: () => {
dialog.showMessageBox({
type: 'none',
icon: ICON,
title: locale.getText('enforcedDownloadComplete'),
message: locale.getText('enforcedDownloadMessage', {
path: appHomePath(customDownloadPath) ?? app.getPath('downloads'),
}),
buttons: [locale.getText('enforcedDownloadButton')],
});
},
});
(async () => {
const electronDl = await import('electron-dl');
electronDl.default({
directory: appHomePath(customDownloadPath),
saveAs: false,
onCompleted: () => {
dialog.showMessageBox({
type: 'none',
icon: ICON,
title: locale.getText('enforcedDownloadComplete'),
message: locale.getText('enforcedDownloadMessage', {
path: appHomePath(customDownloadPath) ?? app.getPath('downloads'),
}),
buttons: [locale.getText('enforcedDownloadButton')],
});
},
});
})();
}

if (argv[config.ARGUMENT.VERSION]) {
Expand Down
2 changes: 1 addition & 1 deletion electron/src/preload/preload-webview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ window.addEventListener('DOMContentLoaded', async () => {
reportWebappVersion();
reportWebappAVSVersion();
// include context menu
await import('./menu/preload-context');
await import('./menu/preload-context.js');
});

// overwrite window.close() to prevent webapp from closing itself
Expand Down
2 changes: 1 addition & 1 deletion electron/src/settings/ConfigurationPersistence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ConfigurationPersistence {
restore<T>(name: string, defaultValue?: T): T {
this.logger.info(`Restoring "${name}"`);
const value = global._ConfigurationPersistence[name];
return typeof value !== 'undefined' ? value : defaultValue;
return typeof value !== 'undefined' ? value : (defaultValue as T);
}

persistToFile(): void {
Expand Down
80 changes: 40 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
"dependencies": {
"@electron/remote": "2.1.3",
"@hapi/joi": "17.1.1",
"@wireapp/certificate-check": "0.7.19",
"@wireapp/commons": "5.4.9",
"@wireapp/protocol-messaging": "1.55.0",
"@wireapp/react-ui-kit": "9.59.1",
"@wireapp/webapp-events": "0.28.0",
"@wireapp/certificate-check": "0.7.26",
"@wireapp/commons": "5.4.12",
"@wireapp/protocol-messaging": "1.56.0",
"@wireapp/react-ui-kit": "9.73.6",
"@wireapp/webapp-events": "0.29.1",
"auto-launch": "5.0.6",
"axios": "0.21.2",
"axios": "0.21.4",
"content-type": "1.0.5",
"electron-dl": "^3.5.2",
"electron-dl": "^4.0.0",
"electron-window-state": "5.0.3",
"fs-extra": "11.3.2",
"fs-extra": "11.3.3",
"get-proxy-settings": "0.1.13",
"globby": "11.1",
"iconv-lite": "0.7.0",
"globby": "11.1.0",
"iconv-lite": "0.7.2",
"image-type": "4.1.0",
"jszip": "3.10.1",
"lodash": "4.17.21",
Expand All @@ -33,45 +33,45 @@
},
"description": "The most secure collaboration platform.",
"devDependencies": {
"@babel/core": "7.28.5",
"@babel/core": "7.28.6",
"@babel/helper-string-parser": "7.27.1",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-optional-chaining": "7.21.0",
"@babel/preset-env": "7.28.5",
"@babel/preset-env": "7.28.6",
"@babel/preset-react": "7.28.5",
"@babel/preset-typescript": "7.28.5",
"@babel/register": "7.28.3",
"@electron/fuses": "1.8.0",
"@electron/osx-sign": "1.3.3",
"@babel/register": "7.28.6",
"@electron/fuses": "2.0.0",
"@electron/osx-sign": "2.3.0",
"@types/adm-zip": "0.5.7",
"@types/amplify": "1.1.28",
"@types/auto-launch": "5.0.5",
"@types/content-type": "1.1.9",
"@types/eslint": "^8.56.7",
"@types/eslint": "^8.56.12",
"@types/fs-extra": "11.0.4",
"@types/hapi__joi": "^17.1.15",
"@types/is-ci": "3.0.4",
"@types/jest": "^29.5.14",
"@types/lodash": "4.17.21",
"@types/lodash": "4.17.23",
"@types/minimist": "1.2.5",
"@types/mocha": "10.0.10",
"@types/node": "18.19.130",
"@types/open-graph": "0.2.6",
"@types/platform": "1.3.6",
"@types/prettier": "^2.7.3",
"@types/react": "^18.3.13",
"@types/react-dom": "^18.3.1",
"@types/redux-logger": "^3.0.12",
"@types/sinon": "17.0.3",
"@types/react": "^18.3.27",
"@types/react-dom": "^18.3.7",
"@types/redux-logger": "^3.0.13",
"@types/sinon": "17.0.4",
"@types/sort-json": "2.0.3",
"@types/uuid": "9.0.8",
"@typescript-eslint/eslint-plugin": "7.17.0",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"@wireapp/copy-config": "2.3.2",
"@wireapp/eslint-config": "3.1.7",
"@wireapp/prettier-config": "0.6.9",
"@wireapp/copy-config": "2.3.11",
"@wireapp/eslint-config": "3.1.8",
"@wireapp/prettier-config": "0.6.10",
"adm-zip": "0.5.16",
"aws-sdk": "2.1692.0",
"aws-sdk": "2.1693.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.1.0",
"babel-jest": "29.7.0",
Expand All @@ -81,26 +81,26 @@
"core-js": "3.47.0",
"cross-env": "7.0.3",
"css-loader": "7.1.2",
"dotenv": "16.6.0",
"electron": "38.7.2",
"electron-builder": "24.13.3",
"electron-mocha": "12.3.1",
"dotenv": "16.6.1",
"electron": "40.0.0",
"electron-builder": "26.4.0",
"electron-mocha": "13.1.0",
"electron-packager": "17.1.2",
"electron-winstaller": "4.0.2",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"electron-winstaller": "5.4.0",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.2",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-import-resolver-typescript": "^3.8.7",
"eslint-import-resolver-typescript": "^3.10.1",
"eslint-plugin-better-styled-components": "1.1.2",
"eslint-plugin-header": "3.1.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jasmine": "4.2.2",
"eslint-plugin-jest": "28.14.0",
"eslint-plugin-jest-dom": "5.5.0",
"eslint-plugin-jsdoc": "48.11.0",
"eslint-plugin-jsx-a11y": "6.10.2",
"eslint-plugin-no-unsanitized": "4.0.2",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-no-unsanitized": "4.1.4",
"eslint-plugin-prettier": "4.2.5",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-simple-import-sort": "12.1.1",
Expand All @@ -116,13 +116,13 @@
"nock": "13.5.6",
"nyc": "15.1.0",
"prettier": "2.8.8",
"rimraf": "5.0.8",
"rimraf": "5.0.10",
"sinon": "17.0.2",
"sort-json": "2.0.1",
"style-loader": "4.0.0",
"ts-node": "10.9.2",
"typescript": "5.7.3",
"webpack": "5.103.0",
"typescript": "5.9.3",
"webpack": "5.104.1",
"webpack-cli": "5.1.4"
},
"homepage": "https://wire.com",
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"lib": ["esnext", "dom", "dom.iterable"],
"module": "commonjs",
"moduleResolution": "node",
"module": "Node16",
"moduleResolution": "node16",
"isolatedModules": true,
"noEmitOnError": true,
"noImplicitAny": true,
Expand Down
Loading