mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 02:08:57 +00:00
Enforce node: schema for builtins, import extensions
This commit is contained in:
@@ -7,9 +7,9 @@ import * as z from 'zod';
|
||||
import { protocol } from 'electron';
|
||||
import { LRUCache } from 'lru-cache';
|
||||
|
||||
import type { OptionalResourceService } from './OptionalResourceService';
|
||||
import { SignalService as Proto } from '../ts/protobuf';
|
||||
import { parseUnknown } from '../ts/util/schemas';
|
||||
import type { OptionalResourceService } from './OptionalResourceService.js';
|
||||
import { SignalService as Proto } from '../ts/protobuf/index.js';
|
||||
import { parseUnknown } from '../ts/util/schemas.js';
|
||||
|
||||
const MANIFEST_PATH = join(__dirname, '..', 'build', 'jumbomoji.json');
|
||||
|
||||
|
||||
@@ -12,12 +12,12 @@ import PQueue from 'p-queue';
|
||||
import type {
|
||||
OptionalResourceType,
|
||||
OptionalResourcesDictType,
|
||||
} from '../ts/types/OptionalResource';
|
||||
import { OptionalResourcesDictSchema } from '../ts/types/OptionalResource';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import { getGotOptions } from '../ts/updater/got';
|
||||
import { drop } from '../ts/util/drop';
|
||||
import { parseUnknown } from '../ts/util/schemas';
|
||||
} from '../ts/types/OptionalResource.js';
|
||||
import { OptionalResourcesDictSchema } from '../ts/types/OptionalResource.js';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
import { getGotOptions } from '../ts/updater/got.js';
|
||||
import { drop } from '../ts/util/drop.js';
|
||||
import { parseUnknown } from '../ts/util/schemas.js';
|
||||
|
||||
const log = createLogger('OptionalResourceService');
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { PowerSaveBlocker } from 'electron';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
|
||||
const log = createLogger('PreventDisplaySleepService');
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import { Menu, Tray, app, nativeImage, nativeTheme, screen } from 'electron';
|
||||
import os from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import type { LocalizerType } from '../ts/types/I18N';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
import type { LocalizerType } from '../ts/types/I18N.js';
|
||||
|
||||
const log = createLogger('SystemTrayService');
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright 2017 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import OS from '../ts/util/os/osMain';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
import OS from '../ts/util/os/osMain.js';
|
||||
import {
|
||||
parseSystemTraySetting,
|
||||
SystemTraySetting,
|
||||
} from '../ts/types/SystemTraySetting';
|
||||
import { isSystemTraySupported } from '../ts/types/Settings';
|
||||
import type { ConfigType } from './base_config';
|
||||
} from '../ts/types/SystemTraySetting.js';
|
||||
import { isSystemTraySupported } from '../ts/types/Settings.js';
|
||||
import type { ConfigType } from './base_config.js';
|
||||
|
||||
const log = createLogger('SystemTraySettingCache');
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ import {
|
||||
sendDummyKeystroke,
|
||||
} from '@indutny/simple-windows-notifications';
|
||||
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import { AUMID } from './startup_config';
|
||||
import type { WindowsNotificationData } from '../ts/services/notifications';
|
||||
import { renderWindowsToast } from './renderWindowsToast';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
import { AUMID } from './startup_config.js';
|
||||
import type { WindowsNotificationData } from '../ts/services/notifications.js';
|
||||
import { renderWindowsToast } from './renderWindowsToast.js';
|
||||
|
||||
const log = createLogger('WindowsNotifications');
|
||||
|
||||
|
||||
@@ -22,30 +22,30 @@ import { isNumber } from 'lodash';
|
||||
import {
|
||||
type DecryptAttachmentToSinkOptionsType,
|
||||
decryptAttachmentV2ToSink,
|
||||
} from '../ts/AttachmentCrypto';
|
||||
import * as Bytes from '../ts/Bytes';
|
||||
import type { MessageAttachmentsCursorType } from '../ts/sql/Interface';
|
||||
import type { MainSQL } from '../ts/sql/main';
|
||||
} from '../ts/AttachmentCrypto.js';
|
||||
import * as Bytes from '../ts/Bytes.js';
|
||||
import type { MessageAttachmentsCursorType } from '../ts/sql/Interface.js';
|
||||
import type { MainSQL } from '../ts/sql/main.js';
|
||||
import {
|
||||
APPLICATION_OCTET_STREAM,
|
||||
MIMETypeToString,
|
||||
stringToMIMEType,
|
||||
} from '../ts/types/MIME';
|
||||
import * as Errors from '../ts/types/errors';
|
||||
} from '../ts/types/MIME.js';
|
||||
import * as Errors from '../ts/types/errors.js';
|
||||
import {
|
||||
isImageTypeSupported,
|
||||
isVideoTypeSupported,
|
||||
} from '../ts/util/GoogleChrome';
|
||||
import { strictAssert } from '../ts/util/assert';
|
||||
import { drop } from '../ts/util/drop';
|
||||
import { SECOND } from '../ts/util/durations';
|
||||
import { isPathInside } from '../ts/util/isPathInside';
|
||||
import { missingCaseError } from '../ts/util/missingCaseError';
|
||||
import { safeParseInteger } from '../ts/util/numbers';
|
||||
import { parseLoose } from '../ts/util/schemas';
|
||||
import { sleep } from '../ts/util/sleep';
|
||||
import { toWebStream } from '../ts/util/toWebStream';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
} from '../ts/util/GoogleChrome.js';
|
||||
import { strictAssert } from '../ts/util/assert.js';
|
||||
import { drop } from '../ts/util/drop.js';
|
||||
import { SECOND } from '../ts/util/durations/index.js';
|
||||
import { isPathInside } from '../ts/util/isPathInside.js';
|
||||
import { missingCaseError } from '../ts/util/missingCaseError.js';
|
||||
import { safeParseInteger } from '../ts/util/numbers.js';
|
||||
import { parseLoose } from '../ts/util/schemas.js';
|
||||
import { sleep } from '../ts/util/sleep.js';
|
||||
import { toWebStream } from '../ts/util/toWebStream.js';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
import {
|
||||
deleteAll as deleteAllAttachments,
|
||||
deleteAllBadges,
|
||||
@@ -63,7 +63,7 @@ import {
|
||||
getPath,
|
||||
getStickersPath,
|
||||
getTempPath,
|
||||
} from './attachments';
|
||||
} from './attachments.js';
|
||||
|
||||
const log = createLogger('attachment_channel');
|
||||
|
||||
|
||||
@@ -3,24 +3,24 @@
|
||||
|
||||
import { PassThrough } from 'node:stream';
|
||||
import { stat } from 'node:fs/promises';
|
||||
import { join, relative, normalize } from 'path';
|
||||
import { join, relative, normalize } from 'node:path';
|
||||
import pMap from 'p-map';
|
||||
import fastGlob from 'fast-glob';
|
||||
import fse from 'fs-extra';
|
||||
import { map, isString } from 'lodash';
|
||||
import normalizePath from 'normalize-path';
|
||||
import { isPathInside } from '../ts/util/isPathInside';
|
||||
import { DAY } from '../ts/util/durations';
|
||||
import { isOlderThan } from '../ts/util/timestamp';
|
||||
import { isNotNil } from '../ts/util/isNotNil';
|
||||
import { isPathInside } from '../ts/util/isPathInside.js';
|
||||
import { DAY } from '../ts/util/durations/index.js';
|
||||
import { isOlderThan } from '../ts/util/timestamp.js';
|
||||
import { isNotNil } from '../ts/util/isNotNil.js';
|
||||
import {
|
||||
generateKeys,
|
||||
decryptAttachmentV2ToSink,
|
||||
encryptAttachmentV2ToDisk,
|
||||
} from '../ts/AttachmentCrypto';
|
||||
import type { LocalAttachmentV2Type } from '../ts/types/Attachment';
|
||||
import * as Errors from '../ts/types/errors';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
} from '../ts/AttachmentCrypto.js';
|
||||
import type { LocalAttachmentV2Type } from '../ts/types/Attachment.js';
|
||||
import * as Errors from '../ts/types/errors.js';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
|
||||
const log = createLogger('attachments');
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright 2018 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { readFileSync, unlinkSync } from 'fs';
|
||||
import { readFileSync, unlinkSync } from 'node:fs';
|
||||
import { sync as writeFileSync } from 'write-file-atomic';
|
||||
|
||||
import { get } from 'lodash';
|
||||
import { set } from 'lodash/fp';
|
||||
import { strictAssert } from '../ts/util/assert';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import { strictAssert } from '../ts/util/assert.js';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
|
||||
const log = createLogger('base_config');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { join, basename } from 'path';
|
||||
import { join, basename } from 'node:path';
|
||||
import { app } from 'electron';
|
||||
|
||||
import type { IConfig } from 'config';
|
||||
@@ -11,8 +11,8 @@ import {
|
||||
getEnvironment,
|
||||
setEnvironment,
|
||||
parseEnvironment,
|
||||
} from '../ts/environment';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
} from '../ts/environment.js';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
|
||||
const log = createLogger('config');
|
||||
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
|
||||
import { app, crashReporter, ipcMain as ipc } from 'electron';
|
||||
import { realpath, readdir, readFile, unlink, stat } from 'fs-extra';
|
||||
import { basename, join } from 'path';
|
||||
import { basename, join } from 'node:path';
|
||||
import { toJSONString as dumpToJSONString } from '@signalapp/libsignal-client/dist/Minidump';
|
||||
import z from 'zod';
|
||||
|
||||
import type { LoggerType } from '../ts/types/Logging';
|
||||
import * as Errors from '../ts/types/errors';
|
||||
import { isProduction } from '../ts/util/version';
|
||||
import { isNotNil } from '../ts/util/isNotNil';
|
||||
import OS from '../ts/util/os/osMain';
|
||||
import { parseUnknown } from '../ts/util/schemas';
|
||||
import type { LoggerType } from '../ts/types/Logging.js';
|
||||
import * as Errors from '../ts/types/errors.js';
|
||||
import { isProduction } from '../ts/util/version.js';
|
||||
import { isNotNil } from '../ts/util/isNotNil.js';
|
||||
import OS from '../ts/util/os/osMain.js';
|
||||
import { parseUnknown } from '../ts/util/schemas.js';
|
||||
|
||||
// See https://github.com/rust-minidump/rust-minidump/blob/main/minidump-processor/json-schema.md
|
||||
const dumpString = z.string().or(z.null()).optional();
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { join } from 'path';
|
||||
import { readFile } from 'fs/promises';
|
||||
import { DNSFallbackSchema } from '../ts/types/DNSFallback';
|
||||
import type { DNSFallbackType } from '../ts/types/DNSFallback';
|
||||
import { parseUnknown } from '../ts/util/schemas';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import { join } from 'node:path';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import { DNSFallbackSchema } from '../ts/types/DNSFallback.js';
|
||||
import type { DNSFallbackType } from '../ts/types/DNSFallback.js';
|
||||
import { parseUnknown } from '../ts/util/schemas.js';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
|
||||
const log = createLogger('dns-fallback');
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Copyright 2018 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { join } from 'path';
|
||||
import { join } from 'node:path';
|
||||
|
||||
import { app } from 'electron';
|
||||
|
||||
import { start } from './base_config';
|
||||
import { start } from './base_config.js';
|
||||
|
||||
const userDataPath = app.getPath('userData');
|
||||
const targetPath = join(userDataPath, 'ephemeral.json');
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
import { app, dialog, clipboard } from 'electron';
|
||||
import os from 'node:os';
|
||||
|
||||
import * as Errors from '../ts/types/errors';
|
||||
import { redactAll } from '../ts/util/privacy';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import { reallyJsonStringify } from '../ts/util/reallyJsonStringify';
|
||||
import type { LocaleType } from './locale';
|
||||
import * as Errors from '../ts/types/errors.js';
|
||||
import { redactAll } from '../ts/util/privacy.js';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
import { reallyJsonStringify } from '../ts/util/reallyJsonStringify.js';
|
||||
import type { LocaleType } from './locale.js';
|
||||
|
||||
const log = createLogger('global_errors');
|
||||
|
||||
|
||||
@@ -7,14 +7,17 @@ import { app } from 'electron';
|
||||
import { merge } from 'lodash';
|
||||
import * as LocaleMatcher from '@formatjs/intl-localematcher';
|
||||
import { z } from 'zod';
|
||||
import { setupI18n } from '../ts/util/setupI18nMain';
|
||||
import { shouldNeverBeCalled } from '../ts/util/shouldNeverBeCalled';
|
||||
import { setupI18n } from '../ts/util/setupI18nMain.js';
|
||||
import { shouldNeverBeCalled } from '../ts/util/shouldNeverBeCalled.js';
|
||||
|
||||
import type { LoggerType } from '../ts/types/Logging';
|
||||
import type { HourCyclePreference, LocaleMessagesType } from '../ts/types/I18N';
|
||||
import type { LocalizerType } from '../ts/types/Util';
|
||||
import * as Errors from '../ts/types/errors';
|
||||
import { parseUnknown } from '../ts/util/schemas';
|
||||
import type { LoggerType } from '../ts/types/Logging.js';
|
||||
import type {
|
||||
HourCyclePreference,
|
||||
LocaleMessagesType,
|
||||
} from '../ts/types/I18N.js';
|
||||
import type { LocalizerType } from '../ts/types/Util.js';
|
||||
import * as Errors from '../ts/types/errors.js';
|
||||
import { parseUnknown } from '../ts/util/schemas.js';
|
||||
|
||||
type CompactLocaleMessagesType = ReadonlyArray<string | null>;
|
||||
type CompactLocaleKeysType = ReadonlyArray<string>;
|
||||
|
||||
144
app/main.ts
144
app/main.ts
@@ -1,11 +1,11 @@
|
||||
// Copyright 2017 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { join, normalize, extname, dirname, basename } from 'path';
|
||||
import { pathToFileURL } from 'url';
|
||||
import * as os from 'os';
|
||||
import { join, normalize, extname, dirname, basename } from 'node:path';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
import * as os from 'node:os';
|
||||
import { chmod, realpath, writeFile } from 'fs-extra';
|
||||
import { randomBytes } from 'crypto';
|
||||
import { randomBytes } from 'node:crypto';
|
||||
import { createParser } from 'dashdash';
|
||||
|
||||
import fastGlob from 'fast-glob';
|
||||
@@ -33,98 +33,98 @@ import type { MenuItemConstructorOptions, Settings } from 'electron';
|
||||
import { z } from 'zod';
|
||||
|
||||
import packageJson from '../package.json';
|
||||
import * as GlobalErrors from './global_errors';
|
||||
import { setup as setupCrashReports } from './crashReports';
|
||||
import { setup as setupSpellChecker } from './spell_check';
|
||||
import { getDNSFallback } from './dns-fallback';
|
||||
import { redactAll, addSensitivePath } from '../ts/util/privacy';
|
||||
import { createSupportUrl } from '../ts/util/createSupportUrl';
|
||||
import { missingCaseError } from '../ts/util/missingCaseError';
|
||||
import { strictAssert } from '../ts/util/assert';
|
||||
import { drop } from '../ts/util/drop';
|
||||
import type { ThemeSettingType } from '../ts/types/StorageUIKeys';
|
||||
import { ThemeType } from '../ts/types/Util';
|
||||
import * as Errors from '../ts/types/errors';
|
||||
import { resolveCanonicalLocales } from '../ts/util/resolveCanonicalLocales';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import * as debugLog from '../ts/logging/debuglogs';
|
||||
import * as uploadDebugLog from '../ts/logging/uploadDebugLog';
|
||||
import { explodePromise } from '../ts/util/explodePromise';
|
||||
import * as GlobalErrors from './global_errors.js';
|
||||
import { setup as setupCrashReports } from './crashReports.js';
|
||||
import { setup as setupSpellChecker } from './spell_check.js';
|
||||
import { getDNSFallback } from './dns-fallback.js';
|
||||
import { redactAll, addSensitivePath } from '../ts/util/privacy.js';
|
||||
import { createSupportUrl } from '../ts/util/createSupportUrl.js';
|
||||
import { missingCaseError } from '../ts/util/missingCaseError.js';
|
||||
import { strictAssert } from '../ts/util/assert.js';
|
||||
import { drop } from '../ts/util/drop.js';
|
||||
import type { ThemeSettingType } from '../ts/types/StorageUIKeys.js';
|
||||
import { ThemeType } from '../ts/types/Util.js';
|
||||
import * as Errors from '../ts/types/errors.js';
|
||||
import { resolveCanonicalLocales } from '../ts/util/resolveCanonicalLocales.js';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
import * as debugLog from '../ts/logging/debuglogs.js';
|
||||
import * as uploadDebugLog from '../ts/logging/uploadDebugLog.js';
|
||||
import { explodePromise } from '../ts/util/explodePromise.js';
|
||||
|
||||
import './startup_config';
|
||||
import './startup_config.js';
|
||||
|
||||
import type { RendererConfigType } from '../ts/types/RendererConfig';
|
||||
import type { RendererConfigType } from '../ts/types/RendererConfig.js';
|
||||
import {
|
||||
directoryConfigSchema,
|
||||
rendererConfigSchema,
|
||||
} from '../ts/types/RendererConfig';
|
||||
import config from './config';
|
||||
} from '../ts/types/RendererConfig.js';
|
||||
import config from './config.js';
|
||||
import {
|
||||
Environment,
|
||||
getEnvironment,
|
||||
isTestEnvironment,
|
||||
} from '../ts/environment';
|
||||
} from '../ts/environment.js';
|
||||
|
||||
// Very important to put before the single instance check, since it is based on the
|
||||
// userData directory. (see requestSingleInstanceLock below)
|
||||
import * as userConfig from './user_config';
|
||||
import * as userConfig from './user_config.js';
|
||||
|
||||
// We generally want to pull in our own modules after this point, after the user
|
||||
// data directory has been set.
|
||||
import * as attachments from './attachments';
|
||||
import * as attachmentChannel from './attachment_channel';
|
||||
import * as bounce from '../ts/services/bounce';
|
||||
import * as updater from '../ts/updater/index';
|
||||
import { updateDefaultSession } from './updateDefaultSession';
|
||||
import { PreventDisplaySleepService } from './PreventDisplaySleepService';
|
||||
import { SystemTrayService, focusAndForceToTop } from './SystemTrayService';
|
||||
import { SystemTraySettingCache } from './SystemTraySettingCache';
|
||||
import { OptionalResourceService } from './OptionalResourceService';
|
||||
import { EmojiService } from './EmojiService';
|
||||
import * as attachments from './attachments.js';
|
||||
import * as attachmentChannel from './attachment_channel.js';
|
||||
import * as bounce from '../ts/services/bounce.js';
|
||||
import * as updater from '../ts/updater/index.js';
|
||||
import { updateDefaultSession } from './updateDefaultSession.js';
|
||||
import { PreventDisplaySleepService } from './PreventDisplaySleepService.js';
|
||||
import { SystemTrayService, focusAndForceToTop } from './SystemTrayService.js';
|
||||
import { SystemTraySettingCache } from './SystemTraySettingCache.js';
|
||||
import { OptionalResourceService } from './OptionalResourceService.js';
|
||||
import { EmojiService } from './EmojiService.js';
|
||||
import {
|
||||
SystemTraySetting,
|
||||
shouldMinimizeToSystemTray,
|
||||
parseSystemTraySetting,
|
||||
} from '../ts/types/SystemTraySetting';
|
||||
} from '../ts/types/SystemTraySetting.js';
|
||||
import {
|
||||
getDefaultSystemTraySetting,
|
||||
isSystemTraySupported,
|
||||
isContentProtectionEnabledByDefault,
|
||||
} from '../ts/types/Settings';
|
||||
import * as ephemeralConfig from './ephemeral_config';
|
||||
import * as mainProcessLogging from '../ts/logging/main_process_logging';
|
||||
import { MainSQL } from '../ts/sql/main';
|
||||
import * as sqlChannels from './sql_channel';
|
||||
import * as windowState from './window_state';
|
||||
import type { CreateTemplateOptionsType } from './menu';
|
||||
import { createTemplate } from './menu';
|
||||
import { installFileHandler, installWebHandler } from './protocol_filter';
|
||||
import OS from '../ts/util/os/osMain';
|
||||
import { isNightly, isProduction } from '../ts/util/version';
|
||||
import { clearTimeoutIfNecessary } from '../ts/util/clearTimeoutIfNecessary';
|
||||
import { toggleMaximizedBrowserWindow } from '../ts/util/toggleMaximizedBrowserWindow';
|
||||
import { ChallengeMainHandler } from '../ts/main/challengeMain';
|
||||
import { NativeThemeNotifier } from '../ts/main/NativeThemeNotifier';
|
||||
import { PowerChannel } from '../ts/main/powerChannel';
|
||||
import { SettingsChannel } from '../ts/main/settingsChannel';
|
||||
import { maybeParseUrl, setUrlSearchParams } from '../ts/util/url';
|
||||
import { getHeicConverter } from '../ts/workers/heicConverterMain';
|
||||
} from '../ts/types/Settings.js';
|
||||
import * as ephemeralConfig from './ephemeral_config.js';
|
||||
import * as mainProcessLogging from '../ts/logging/main_process_logging.js';
|
||||
import { MainSQL } from '../ts/sql/main.js';
|
||||
import * as sqlChannels from './sql_channel.js';
|
||||
import * as windowState from './window_state.js';
|
||||
import type { CreateTemplateOptionsType } from './menu.js';
|
||||
import { createTemplate } from './menu.js';
|
||||
import { installFileHandler, installWebHandler } from './protocol_filter.js';
|
||||
import OS from '../ts/util/os/osMain.js';
|
||||
import { isNightly, isProduction } from '../ts/util/version.js';
|
||||
import { clearTimeoutIfNecessary } from '../ts/util/clearTimeoutIfNecessary.js';
|
||||
import { toggleMaximizedBrowserWindow } from '../ts/util/toggleMaximizedBrowserWindow.js';
|
||||
import { ChallengeMainHandler } from '../ts/main/challengeMain.js';
|
||||
import { NativeThemeNotifier } from '../ts/main/NativeThemeNotifier.js';
|
||||
import { PowerChannel } from '../ts/main/powerChannel.js';
|
||||
import { SettingsChannel } from '../ts/main/settingsChannel.js';
|
||||
import { maybeParseUrl, setUrlSearchParams } from '../ts/util/url.js';
|
||||
import { getHeicConverter } from '../ts/workers/heicConverterMain.js';
|
||||
|
||||
import type { LocaleDirection, LocaleType } from './locale';
|
||||
import { load as loadLocale } from './locale';
|
||||
import type { LocaleDirection, LocaleType } from './locale.js';
|
||||
import { load as loadLocale } from './locale.js';
|
||||
|
||||
import { HourCyclePreference } from '../ts/types/I18N';
|
||||
import { ScreenShareStatus } from '../ts/types/Calling';
|
||||
import type { ParsedSignalRoute } from '../ts/util/signalRoutes';
|
||||
import { parseSignalRoute } from '../ts/util/signalRoutes';
|
||||
import * as dns from '../ts/util/dns';
|
||||
import { ZoomFactorService } from '../ts/services/ZoomFactorService';
|
||||
import { SafeStorageBackendChangeError } from '../ts/types/SafeStorageBackendChangeError';
|
||||
import { LINUX_PASSWORD_STORE_FLAGS } from '../ts/util/linuxPasswordStoreFlags';
|
||||
import { getOwn } from '../ts/util/getOwn';
|
||||
import { safeParseLoose, safeParseUnknown } from '../ts/util/schemas';
|
||||
import { getAppErrorIcon } from '../ts/util/getAppErrorIcon';
|
||||
import { promptOSAuth } from '../ts/util/os/promptOSAuthMain';
|
||||
import { HourCyclePreference } from '../ts/types/I18N.js';
|
||||
import { ScreenShareStatus } from '../ts/types/Calling.js';
|
||||
import type { ParsedSignalRoute } from '../ts/util/signalRoutes.js';
|
||||
import { parseSignalRoute } from '../ts/util/signalRoutes.js';
|
||||
import * as dns from '../ts/util/dns.js';
|
||||
import { ZoomFactorService } from '../ts/services/ZoomFactorService.js';
|
||||
import { SafeStorageBackendChangeError } from '../ts/types/SafeStorageBackendChangeError.js';
|
||||
import { LINUX_PASSWORD_STORE_FLAGS } from '../ts/util/linuxPasswordStoreFlags.js';
|
||||
import { getOwn } from '../ts/util/getOwn.js';
|
||||
import { safeParseLoose, safeParseUnknown } from '../ts/util/schemas.js';
|
||||
import { getAppErrorIcon } from '../ts/util/getAppErrorIcon.js';
|
||||
import { promptOSAuth } from '../ts/util/os/promptOSAuthMain.js';
|
||||
|
||||
const log = createLogger('app/main');
|
||||
const updaterLog = log.child('updater');
|
||||
@@ -221,7 +221,7 @@ let sendDummyKeystroke: undefined | (() => void);
|
||||
if (OS.isWindows()) {
|
||||
try {
|
||||
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
||||
const windowsNotifications = require('./WindowsNotifications');
|
||||
const windowsNotifications = require('./WindowsNotifications.js');
|
||||
sendDummyKeystroke = windowsNotifications.sendDummyKeystroke;
|
||||
} catch (error) {
|
||||
log.error('Failed to initialize Windows Notifications:', error.stack);
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
|
||||
import { isString } from 'lodash';
|
||||
|
||||
import type { LocalizerType } from '../ts/types/I18N';
|
||||
import type { LocalizerType } from '../ts/types/I18N.js';
|
||||
import type {
|
||||
MenuListType,
|
||||
MenuOptionsType,
|
||||
MenuActionsType,
|
||||
} from '../ts/types/menu';
|
||||
} from '../ts/types/menu.js';
|
||||
|
||||
export type CreateTemplateOptionsType = MenuOptionsType & MenuActionsType;
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
import type { session as ElectronSession, Session } from 'electron';
|
||||
|
||||
import type { ConfigType } from './base_config';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import type { ConfigType } from './base_config.js';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
|
||||
const log = createLogger('permissions');
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
import type { ProtocolRequest, ProtocolResponse, Session } from 'electron';
|
||||
|
||||
import { isAbsolute, normalize } from 'path';
|
||||
import { existsSync, realpathSync } from 'fs';
|
||||
import { isAbsolute, normalize } from 'node:path';
|
||||
import { existsSync, realpathSync } from 'node:fs';
|
||||
import {
|
||||
getAvatarsPath,
|
||||
getBadgesPath,
|
||||
@@ -14,8 +14,8 @@ import {
|
||||
getStickersPath,
|
||||
getTempPath,
|
||||
getUpdateCachePath,
|
||||
} from './attachments';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
} from './attachments.js';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
|
||||
const log = createLogger('protocol_filter');
|
||||
|
||||
|
||||
@@ -5,14 +5,14 @@ import type { BrowserWindow } from 'electron';
|
||||
import { Menu, clipboard, nativeImage } from 'electron';
|
||||
import * as LocaleMatcher from '@formatjs/intl-localematcher';
|
||||
|
||||
import { maybeParseUrl } from '../ts/util/url';
|
||||
import { maybeParseUrl } from '../ts/util/url.js';
|
||||
|
||||
import type { MenuListType } from '../ts/types/menu';
|
||||
import type { LocalizerType } from '../ts/types/Util';
|
||||
import { strictAssert } from '../ts/util/assert';
|
||||
import type { LoggerType } from '../ts/types/Logging';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import { handleAttachmentRequest } from './attachment_channel';
|
||||
import type { MenuListType } from '../ts/types/menu.js';
|
||||
import type { LocalizerType } from '../ts/types/Util.js';
|
||||
import { strictAssert } from '../ts/util/assert.js';
|
||||
import type { LoggerType } from '../ts/types/Logging.js';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
import { handleAttachmentRequest } from './attachment_channel.js';
|
||||
|
||||
const log = createLogger('spell_check');
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
import { ipcMain } from 'electron';
|
||||
|
||||
import type { MainSQL } from '../ts/sql/main';
|
||||
import { remove as removeUserConfig } from './user_config';
|
||||
import { remove as removeEphemeralConfig } from './ephemeral_config';
|
||||
import type { MainSQL } from '../ts/sql/main.js';
|
||||
import { remove as removeUserConfig } from './user_config.js';
|
||||
import { remove as removeEphemeralConfig } from './ephemeral_config.js';
|
||||
|
||||
let sql:
|
||||
| Pick<
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { app } from 'electron';
|
||||
|
||||
import packageJson from '../package.json';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import * as GlobalErrors from './global_errors';
|
||||
import { createLogger } from '../ts/logging/log.js';
|
||||
import * as GlobalErrors from './global_errors.js';
|
||||
|
||||
const log = createLogger('startup_config');
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ import type { Session, DesktopCapturerSource, IpcMainEvent } from 'electron';
|
||||
import { desktopCapturer, ipcMain, systemPreferences } from 'electron';
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
|
||||
import OS from '../ts/util/os/osMain';
|
||||
import type { LoggerType } from '../ts/types/Logging';
|
||||
import { strictAssert } from '../ts/util/assert';
|
||||
import { type IpcResponseType } from '../ts/util/desktopCapturer';
|
||||
import OS from '../ts/util/os/osMain.js';
|
||||
import type { LoggerType } from '../ts/types/Logging.js';
|
||||
import { strictAssert } from '../ts/util/assert.js';
|
||||
import { type IpcResponseType } from '../ts/util/desktopCapturer.js';
|
||||
|
||||
const SPELL_CHECKER_DICTIONARY_DOWNLOAD_URL = `https://updates.signal.org/desktop/hunspell_dictionaries/${process.versions.electron}/`;
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright 2017 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { join } from 'path';
|
||||
import { mkdirSync } from 'fs';
|
||||
import { join } from 'node:path';
|
||||
import { mkdirSync } from 'node:fs';
|
||||
import { app } from 'electron';
|
||||
|
||||
import { start } from './base_config';
|
||||
import config from './config';
|
||||
import * as Errors from '../ts/types/errors';
|
||||
import { start } from './base_config.js';
|
||||
import config from './config.js';
|
||||
import * as Errors from '../ts/types/errors.js';
|
||||
|
||||
let userData: string | undefined;
|
||||
// Use separate data directory for benchmarks & development
|
||||
|
||||
Reference in New Issue
Block a user