diff --git a/.eslint/rules/file-suffix.js b/.eslint/rules/file-suffix.js new file mode 100644 index 0000000000..fdfce6515e --- /dev/null +++ b/.eslint/rules/file-suffix.js @@ -0,0 +1,455 @@ +// Copyright 2025 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +const MAIN_MODULES = new Set([ + 'app', + 'autoUpdater', + 'BaseWindow', + 'BrowserView', + 'BrowserWindow', + 'contentTracing', + 'desktopCapturer', + 'dialog', + 'globalShortcut', + 'inAppPurchase', + 'ipcMain', + 'Menu', + 'MenuItem', + 'MessageChannelMain', + 'MessagePortMain', + 'nativeTheme', + 'net', + 'netLog', + 'Notification', + 'powerMonitor', + 'powerSaveBlocker', + 'process', + 'protocol', + 'pushNotifications', + 'safeStorage', + 'screen', + 'session', + 'ShareMenu', + 'shell', + 'systemPreferences', + 'TouchBar', + 'Tray', + 'utilityProcess', + 'webContents', + 'WebContentsView', + 'webFrameMain', + 'View', +]); +const RENDERER_MODULES = new Set([ + 'contextBridge', + 'ipcRenderer', + 'webFrame', + 'webUtils', +]); +const NODE_MODULES = new Set([ + '@electron/asar', + '@indutny/dicer', + '@indutny/mac-screen-share', + '@indutny/range-finder', + '@indutny/simple-windows-notifications', + '@signalapp/libsignal-client', + '@signalapp/ringrtc', + '@signalapp/sqlcipher', + '@signalapp/windows-ucv', + 'cirbuf', + 'config', + 'dashdash', + 'encoding', + 'fast-glob', + 'fs-extra', + 'got', + 'growing-file', + 'node-fetch', + 'proxy-agent', + 'read-last-lines', + 'websocket', + 'write-file-atomic', + + // Dev dependencies + '@electron/fuses', + '@electron/notarize', + '@electron/symbolicate-mac', + '@indutny/parallel-prettier', + '@indutny/rezip-electron', + '@napi-rs/canvas', + '@signalapp/mock-server', + '@tailwindcss/cli', + '@tailwindcss/postcss', + 'chokidar-cli', + 'cross-env', + 'electron-builder', + 'electron-mocha', + 'endanger', + 'enhanced-resolve', + 'enquirer', + 'esbuild', + 'execa', + 'html-webpack-plugin', + 'http-server', + 'json-to-ast', + 'log-symbols', + 'mini-css-extract-plugin', + 'node-gyp', + 'node-gyp-build', + 'npm-run-all', + 'p-limit', + 'pixelmatch', + 'playwright', + 'postcss', + 'postcss-loader', + 'prettier', + 'prettier-plugin-tailwindcss', + 'protobufjs-cli', + 'react-devtools', + 'react-devtools-core', + 'resedit', + 'resolve-url-loader', + 'sass', + 'sass-loader', + 'style-loader', + 'stylelint', + 'stylelint-config-css-modules', + 'stylelint-config-recommended-scss', + 'stylelint-use-logical-spec', + 'svgo', + 'synckit', + 'tailwindcss', + 'terser-webpack-plugin', + 'ts-node', + 'typescript', + 'wait-on', + 'webpack', + 'webpack-cli', + 'webpack-dev-server', +]); +const DOM_MODULES = new Set([ + '@popperjs/core', + '@radix-ui/react-tooltip', + '@react-aria/focus', + '@react-aria/interactions', + '@react-aria/utils', + '@react-spring/web', + '@tanstack/react-virtual', + 'blob-util', + 'blueimp-load-image', + 'copy-text-to-clipboard', + 'fabric', + 'focus-trap-react', + 'radix-ui', + 'react-aria', + 'react-aria-components', + 'react-blurhash', + 'react-contextmenu', + 'react-popper', + 'react-virtualized', + + // Dev dependencies + '@storybook/addon-a11y', + '@storybook/addon-actions', + '@storybook/addon-controls', + '@storybook/addon-interactions', + '@storybook/addon-jest', + '@storybook/addon-measure', + '@storybook/addon-toolbars', + '@storybook/addon-viewport', + '@storybook/addon-webpack5-compiler-swc', + '@storybook/csf', + '@storybook/preview-api', + '@storybook/react', + '@storybook/react-webpack5', + '@storybook/test', + '@storybook/test-runner', + '@storybook/types', + 'storybook', +]); + +/** @type {import("eslint").Rule.RuleModule} */ +module.exports = { + meta: { + type: 'problem', + hasSuggestions: false, + fixable: false, + schema: [], + }, + create(context) { + const { filename, sourceCode } = context; + + let fileSuffix; + + const nodeUses = []; + const domUses = []; + const preloadUses = []; + const mainUses = []; + + const invalidUsesBySuffix = { + std: [nodeUses, domUses, preloadUses, mainUses], + node: [domUses, preloadUses, mainUses], + dom: [nodeUses, preloadUses, mainUses], + preload: [mainUses], + main: [domUses, preloadUses], + }; + + function trackLocalDep(node, source) { + if (!source.endsWith('.js')) { + return; + } + + const match = source.match(/\.([^.\/]+)(?:\.stories)?\.js$/); + if (match == null) { + context.report({ + node, + message: `Missing file suffix in ${source} import`, + }); + return; + } + + const [, depSuffix] = match; + if (depSuffix === 'node') { + nodeUses.push(node); + } else if (depSuffix === 'dom') { + domUses.push(node); + } else if (depSuffix === 'preload') { + preloadUses.push(node); + } else if (depSuffix === 'main') { + mainUses.push(node); + } else if (depSuffix === 'std') { + // Ignore + } else { + context.report({ + node, + message: + `Unrecognized file suffix in ${source}, ` + + `expected: node/preload/main/std, found: ${depSuffix}`, + }); + } + } + + function transformESMReference(node) { + if ( + node.importKind === 'type' || + (node.specifiers?.length && + node.specifiers.every(x => x.importKind === 'type')) + ) { + return; + } + if (!node.source) { + return; + } + if (node.source.type !== 'Literal') { + return; + } + const { + specifiers, + source: { value: source }, + } = node; + + if (source.startsWith('.')) { + trackLocalDep(node, source); + return; + } + + // Node APIs + if (source.startsWith('node:')) { + nodeUses.push(node); + return; + } + + // Electron + if (source === 'electron') { + for (const s of specifiers) { + // We implicitly skip: + // they are used in scripts + if (s.type === 'ImportSpecifier') { + if (MAIN_MODULES.has(s.imported.name)) { + mainUses.push(s); + } else if (RENDERER_MODULES.has(s.imported.name)) { + preloadUses.push(s); + } + } else if (s.type === 'ImportNamespaceSpecifier') { + // import * as electron from 'electron'; + context.report({ + node: s, + message: 'Unsupported namespace import specifier for electron', + }); + nodeUses.push(s); + } else if (s.type === 'ImportDefaultSpecifier') { + // import ELECTRON_CLI from 'electron'; + nodeUses.push(s); + } else { + context.report({ + node: s, + message: 'Unsupported import specifier for electron', + }); + } + } + + return; + } + + const [, moduleName] = source.match(/^([^@\/]+|@[^\/]+\/[^\/]+)/); + if (NODE_MODULES.has(moduleName)) { + nodeUses.push(node); + } else if (DOM_MODULES.has(moduleName) || source === 'react-dom/client') { + domUses.push(node); + } + } + + return { + Program: node => { + if (filename.endsWith('.d.ts')) { + // Skip types + return; + } + + const match = filename.match(/\.([^.\/]+)(?:\.stories)?\.(?:ts|tsx)$/); + if (match == null) { + context.report({ + node: node, + message: + 'Missing file suffix. Has to be one of: node/preload/main/std', + }); + return; + } + + fileSuffix = match[1]; + }, + 'Program:exit': node => { + if (fileSuffix == null) { + return; + } + + let expectedSuffix; + if (mainUses.length > 0) { + expectedSuffix = 'main'; + } else if (preloadUses.length > 0) { + expectedSuffix = 'preload'; + } else if (nodeUses.length > 0) { + if (domUses.length > 0) { + expectedSuffix = 'preload'; + } else { + expectedSuffix = 'node'; + } + } else if (domUses.length > 0) { + expectedSuffix = 'dom'; + } else { + expectedSuffix = 'std'; + } + + // All .std.tsx components should be .dom.tsx for now + if (expectedSuffix === 'std' && filename.endsWith('.tsx')) { + expectedSuffix = 'dom'; + } + + if (fileSuffix !== expectedSuffix) { + context.report({ + node, + message: `Invalid suffix ${fileSuffix}, expected: ${expectedSuffix}`, + }); + } + + const invalid = invalidUsesBySuffix[expectedSuffix].flat(); + for (const use of invalid) { + context.report({ + node: use, + message: `Invalid import/reference for suffix: ${expectedSuffix}`, + }); + } + }, + ImportDeclaration(node) { + transformESMReference(node); + }, + ExportAllDeclaration(node) { + transformESMReference(node); + }, + ExportNamedDeclaration(node) { + transformESMReference(node); + }, + CallExpression(node) { + if ( + node.callee.type !== 'Identifier' || + node.callee.name !== 'require' + ) { + return; + } + + const scope = sourceCode.getScope(node); + const ref = scope.references.find(r => r.identifier === node.callee); + if (ref.resolved.scope.type !== 'global') { + return; + } + const { arguments: args } = node; + if (args.length !== 1) { + context.report({ + node, + message: 'Invalid require() argument count', + }); + return; + } + const [arg] = args; + + let source; + if (arg.type === 'Literal') { + source = arg.value; + } else if ( + arg.type === 'TSAsExpression' && + arg.expression.type === 'Literal' + ) { + source = arg.expression.value; + } else { + // Ignore other expressions + return; + } + + // Keep local imports + if (source.startsWith('.')) { + trackLocalDep(node, source); + return; + } + + // Node APIs + if (source.startsWith('node:')) { + nodeUses.push(node); + return; + } + + // Electron + if (source === 'electron') { + context.report({ + node, + message: 'CJS import of electron is not allowed', + }); + } + + const [, moduleName] = source.match(/^([^@\/]+|@[^\/]+\/[^\/]+)/); + if (NODE_MODULES.has(moduleName)) { + nodeUses.push(node); + } else if ( + DOM_MODULES.has(moduleName) || + source === 'react-dom/client' + ) { + domUses.push(moduleName); + } + }, + Identifier(node) { + if (node.name !== 'window' && node.name !== 'document') { + return; + } + const scope = sourceCode.getScope(node); + const ref = scope.references.find(r => r.identifier === node); + if (ref == null) { + // Not part of expression + return; + } + if (ref.resolved.scope.type !== 'global') { + return; + } + domUses.push(node); + }, + }; + }, +}; diff --git a/.eslint/rules/file-suffix.test.js b/.eslint/rules/file-suffix.test.js new file mode 100644 index 0000000000..c8c5658e3f --- /dev/null +++ b/.eslint/rules/file-suffix.test.js @@ -0,0 +1,134 @@ +// Copyright 2025 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +const rule = require('./file-suffix.js'); +const RuleTester = require('eslint').RuleTester; + +// avoid triggering mocha's global leak detection +require('@typescript-eslint/parser'); + +const ruleTester = new RuleTester({ + parser: require.resolve('@typescript-eslint/parser'), + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module', + }, +}); + +ruleTester.run('file-suffix', rule, { + valid: [ + // Allowed references + ...[ + ['std', '', ['std']], + ['dom', 'window.addEventListener();', ['std', 'dom']], + ['node', 'require("node:fs");', ['std', 'node']], + [ + 'preload', + 'import { ipcRenderer } from "electron";', + ['std', 'node', 'preload'], + ], + [ + 'main', + 'import { autoUpdater } from "electron";', + ['std', 'node', 'main'], + ], + ] + .map(([fileSuffix, requiredLine, depSuffixes]) => { + return depSuffixes.map(depSuffix => { + return { + name: `importing ${depSuffix} from ${fileSuffix}`, + filename: `a.${fileSuffix}.ts`, + code: ` + import { x } from './b.${depSuffix}.js'; + ${requiredLine} + `, + globals: { + window: 'writable', + require: 'readable', + }, + }; + }); + }) + .flat(), + + { + name: 'type import should have no effect', + filename: 'a.std.ts', + code: `import type { ReadonlyDeep } from './b.dom.js'`, + }, + ], + invalid: [ + // Disallowed references + ...[ + ['std', ['dom', 'node', 'preload', 'main']], + ['dom', ['node', 'preload', 'main']], + ['node', ['preload', 'main']], + ['preload', ['main']], + ['main', ['dom', 'preload']], + ] + .map(([fileSuffix, depSuffixes]) => { + return depSuffixes.map(depSuffix => { + return { + name: `importing ${depSuffix} from ${fileSuffix}`, + filename: `a.${fileSuffix}.ts`, + code: `import { x } from './b.${depSuffix}.js'`, + errors: [ + { + message: `Invalid suffix ${fileSuffix}, expected: ${depSuffix}`, + type: 'Program', + }, + ], + }; + }); + }) + .flat(), + + ...['dom', 'node', 'preload', 'main'].map(suffix => { + return { + name: `no ${suffix} imports`, + filename: `a.${suffix}.ts`, + code: '', + errors: [ + { + message: `Invalid suffix ${suffix}, expected: std`, + type: 'Program', + }, + ], + }; + }), + + // Invalid imports + { + name: 'preload in main', + filename: 'a.main.ts', + code: ` + import { autoUpdater } from 'electron'; + import './b.preload.js'; + `, + errors: [ + { + message: 'Invalid import/reference for suffix: main', + type: 'ImportDeclaration', + }, + ], + }, + { + name: 'main in preload', + filename: 'a.preload.ts', + code: ` + import { ipcRenderer } from 'electron'; + import './b.main.js'; + `, + errors: [ + { + message: 'Invalid suffix preload, expected: main', + type: 'Program', + }, + { + message: 'Invalid import/reference for suffix: main', + type: 'ImportSpecifier', + }, + ], + }, + ], +}); diff --git a/.eslintignore b/.eslintignore index 9833089e1e..9e82d28f31 100644 --- a/.eslintignore +++ b/.eslintignore @@ -13,7 +13,7 @@ js/util_worker.js libtextsecure/components.js libtextsecure/test/test.js test/test.js -ts/protobuf/compiled.d.ts +ts/protobuf/compiled.std.d.ts storybook-static/** build/ICUMessageParams.d.ts diff --git a/.eslintrc.js b/.eslintrc.js index 4cc0eb7d98..f0bd23e454 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -193,6 +193,8 @@ const rules = { const typescriptRules = { ...rules, + 'local-rules/file-suffix': 'error', + // Override brace style to enable typescript-specific syntax 'brace-style': 'off', '@typescript-eslint/brace-style': [ @@ -370,7 +372,7 @@ module.exports = { }, }, { - files: ['ts/**/*_test.{ts,tsx}'], + files: ['ts/**/*_test.*.{ts,tsx}'], rules: { 'func-names': 'off', }, diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index c10d5d476c..ee4ffa482f 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -27,17 +27,17 @@ jobs: - backup include: - metric: startup - script: ts/test-mock/benchmarks/startup_bench.js + script: ts/test-mock/benchmarks/startup_bench.node.js runCount: 10 - metric: send - script: ts/test-mock/benchmarks/send_bench.js + script: ts/test-mock/benchmarks/send_bench.node.js runCount: 100 - metric: groupSend - script: ts/test-mock/benchmarks/group_send_bench.js + script: ts/test-mock/benchmarks/group_send_bench.node.js runCount: 100 conversationSize: 500 - metric: largeGroupSendWithBlocks - script: ts/test-mock/benchmarks/group_send_bench.js + script: ts/test-mock/benchmarks/group_send_bench.node.js runCount: 50 conversationSize: 500 groupSize: 500 @@ -45,20 +45,20 @@ jobs: blockedCount: 10 discardCount: 2 - metric: largeGroupSend - script: ts/test-mock/benchmarks/group_send_bench.js + script: ts/test-mock/benchmarks/group_send_bench.node.js runCount: 20 conversationSize: 50 groupSize: 500 contactCount: 500 discardCount: 2 - metric: convoOpen - script: ts/test-mock/benchmarks/convo_open_bench.js + script: ts/test-mock/benchmarks/convo_open_bench.node.js runCount: 100 - metric: callHistorySearch - script: ts/test-mock/benchmarks/call_history_search_bench.js + script: ts/test-mock/benchmarks/call_history_search_bench.node.js runCount: 100 - metric: backup - script: ts/test-mock/benchmarks/backup_bench.js + script: ts/test-mock/benchmarks/backup_bench.node.js runs-on: ubuntu-22.04-8-cores if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' && (!github.event.schedule || github.ref == 'refs/heads/main') }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce8176c1ae..4614729910 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,9 +138,9 @@ jobs: - name: Upload installer size if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' && github.ref == 'refs/heads/main' }} run: | - node ts/scripts/dd-installer-size.js macos-arm64 - node ts/scripts/dd-installer-size.js macos-x64 - node ts/scripts/dd-installer-size.js macos-universal + node ts/scripts/dd-installer-size.node.js macos-arm64 + node ts/scripts/dd-installer-size.node.js macos-x64 + node ts/scripts/dd-installer-size.node.js macos-universal env: DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} - run: pnpm run test-release @@ -224,7 +224,7 @@ jobs: - name: Upload installer size if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' && github.ref == 'refs/heads/main' }} - run: node ts/scripts/dd-installer-size.js linux + run: node ts/scripts/dd-installer-size.node.js linux env: DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} @@ -306,7 +306,7 @@ jobs: - name: Upload installer size if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' && github.ref == 'refs/heads/main' }} - run: node ts/scripts/dd-installer-size.js windows + run: node ts/scripts/dd-installer-size.node.js windows env: DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} @@ -496,4 +496,4 @@ jobs: - run: pnpm generate:phase-0 - name: Run OS version check run: | - node ts/scripts/check-min-os-version.js + node ts/scripts/check-min-os-version.node.js diff --git a/.github/workflows/icu-book.yml b/.github/workflows/icu-book.yml index 0ed0d10336..f38956049c 100644 --- a/.github/workflows/icu-book.yml +++ b/.github/workflows/icu-book.yml @@ -51,7 +51,7 @@ jobs: env: ARTIFACTS_DIR: stories - run: pnpm run build:esbuild - - run: node ts/scripts/compile-stories-icu-lookup.js stories + - run: node ts/scripts/compile-stories-icu-lookup.node.js stories - name: Upload test artifacts if: github.event_name == 'workflow_dispatch' diff --git a/.storybook/StorybookThemeContext.d.ts b/.storybook/StorybookThemeContext.std.d.ts similarity index 75% rename from .storybook/StorybookThemeContext.d.ts rename to .storybook/StorybookThemeContext.std.d.ts index b26b6f44f3..cc29918620 100644 --- a/.storybook/StorybookThemeContext.d.ts +++ b/.storybook/StorybookThemeContext.std.d.ts @@ -2,6 +2,6 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { Context } from 'react'; -import type { ThemeType } from '../ts/types/Util'; +import type { ThemeType } from '../ts/types/Util.std.js'; export const StorybookThemeContext: Context; diff --git a/.storybook/StorybookThemeContext.js b/.storybook/StorybookThemeContext.std.js similarity index 78% rename from .storybook/StorybookThemeContext.js rename to .storybook/StorybookThemeContext.std.js index 4595c74661..48f51e16fc 100644 --- a/.storybook/StorybookThemeContext.js +++ b/.storybook/StorybookThemeContext.std.js @@ -2,6 +2,6 @@ // SPDX-License-Identifier: AGPL-3.0-only import { createContext } from 'react'; -import { ThemeType } from '../ts/types/Util.js'; +import { ThemeType } from '../ts/types/Util.std.js'; export const StorybookThemeContext = createContext(ThemeType.light); diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 2b84c570b8..202a2a3c13 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -14,26 +14,26 @@ import { Provider } from 'react-redux'; import { Store, combineReducers, createStore } from 'redux'; import { Globals } from '@react-spring/web'; -import { StorybookThemeContext } from './StorybookThemeContext.js'; -import { SystemThemeType, ThemeType } from '../ts/types/Util.js'; -import { setupI18n } from '../ts/util/setupI18n.js'; -import { HourCyclePreference } from '../ts/types/I18N.js'; -import { AxoProvider } from '../ts/axo/AxoProvider.js'; -import { StateType } from '../ts/state/reducer.js'; +import { StorybookThemeContext } from './StorybookThemeContext.std.js'; +import { SystemThemeType, ThemeType } from '../ts/types/Util.std.js'; +import { setupI18n } from '../ts/util/setupI18n.dom.js'; +import { HourCyclePreference } from '../ts/types/I18N.std.js'; +import { AxoProvider } from '../ts/axo/AxoProvider.dom.js'; +import type { StateType } from '../ts/state/reducer.preload.js'; import { ScrollerLockContext, createScrollerLock, -} from '../ts/hooks/useScrollLock.js'; -import { Environment, setEnvironment } from '../ts/environment.js'; -import { parseUnknown } from '../ts/util/schemas.js'; -import { LocaleEmojiListSchema } from '../ts/types/emoji.js'; -import { FunProvider } from '../ts/components/fun/FunProvider.js'; -import { EmojiSkinTone } from '../ts/components/fun/data/emojis.js'; -import { MOCK_GIFS_PAGINATED_ONE_PAGE } from '../ts/components/fun/mocks.js'; +} from '../ts/hooks/useScrollLock.dom.js'; +import { Environment, setEnvironment } from '../ts/environment.std.js'; +import { parseUnknown } from '../ts/util/schemas.std.js'; +import { LocaleEmojiListSchema } from '../ts/types/emoji.std.js'; +import { FunProvider } from '../ts/components/fun/FunProvider.dom.js'; +import { EmojiSkinTone } from '../ts/components/fun/data/emojis.std.js'; +import { MOCK_GIFS_PAGINATED_ONE_PAGE } from '../ts/components/fun/mocks.dom.js'; -import type { FunEmojiSelection } from '../ts/components/fun/panels/FunPanelEmojis.js'; -import type { FunGifSelection } from '../ts/components/fun/panels/FunPanelGifs.js'; -import type { FunStickerSelection } from '../ts/components/fun/panels/FunPanelStickers.js'; +import type { FunEmojiSelection } from '../ts/components/fun/panels/FunPanelEmojis.dom.js'; +import type { FunGifSelection } from '../ts/components/fun/panels/FunPanelGifs.dom.js'; +import type { FunStickerSelection } from '../ts/components/fun/panels/FunPanelStickers.dom.js'; setEnvironment(Environment.Development, true); diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e2798bff7b..0f8ed18e99 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -309,7 +309,7 @@ Then, run the tests using `pnpm run test-release`. macOS requires apps to be code signed with an Apple certificate. To test development builds you can ad-hoc sign the packaged app which will let you run it locally. -1. In `package.json` remove the macOS signing script: `"sign": "./ts/scripts/sign-macos.js",` +1. In `package.json` remove the macOS signing script: `"sign": "./ts/scripts/sign-macos.node.js",` 2. Build the app and ad-hoc sign the app bundle: ``` diff --git a/about.html b/about.html index d6ea6b7c6e..6b8e354d41 100644 --- a/about.html +++ b/about.html @@ -20,6 +20,6 @@
- + diff --git a/app/WindowsNotifications.main.ts b/app/WindowsNotifications.main.ts index 7a889ed6f0..d39d82f68e 100644 --- a/app/WindowsNotifications.main.ts +++ b/app/WindowsNotifications.main.ts @@ -12,6 +12,7 @@ import { import { createLogger } from '../ts/logging/log.std.js'; import { AUMID } from './startup_config.main.js'; import type { WindowsNotificationData } from '../ts/services/notifications.preload.js'; +// eslint-disable-next-line local-rules/file-suffix import { renderWindowsToast } from './renderWindowsToast.dom.js'; const log = createLogger('WindowsNotifications'); diff --git a/app/main.main.ts b/app/main.main.ts index 1aaa84ceaa..a5e0a20efd 100644 --- a/app/main.main.ts +++ b/app/main.main.ts @@ -238,7 +238,7 @@ let sendDummyKeystroke: undefined | (() => void); if (OS.isWindows()) { try { // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires - const windowsNotifications = require('./WindowsNotifications.js'); + const windowsNotifications = require('./WindowsNotifications.main.js'); sendDummyKeystroke = windowsNotifications.sendDummyKeystroke; } catch (error) { log.error('Failed to initialize Windows Notifications:', error.stack); @@ -730,7 +730,7 @@ async function createWindow() { __dirname, usePreloadBundle ? '../preload.wrapper.js' - : '../ts/windows/main/preload.js' + : '../ts/windows/main/preload.preload.js' ), spellcheck, }, @@ -1289,7 +1289,7 @@ async function showScreenShareWindow(sourceName: string | undefined) { nodeIntegrationInWorker: false, sandbox: true, contextIsolation: true, - preload: join(__dirname, '../bundles/screenShare/preload.js'), + preload: join(__dirname, '../bundles/screenShare/preload.preload.js'), }, x: Math.floor(display.size.width / 2) - width / 2, y: 24, @@ -1344,7 +1344,7 @@ async function showCallingDevToolsWindow() { sandbox: true, contextIsolation: true, nativeWindowOpen: true, - preload: join(__dirname, '../bundles/calling-tools/preload.js'), + preload: join(__dirname, '../bundles/calling-tools/preload.preload.js'), }, }; @@ -1398,7 +1398,7 @@ async function showAbout() { nodeIntegrationInWorker: false, sandbox: true, contextIsolation: true, - preload: join(__dirname, '../bundles/about/preload.js'), + preload: join(__dirname, '../bundles/about/preload.preload.js'), nativeWindowOpen: true, }, }; @@ -1487,7 +1487,7 @@ async function showDebugLogWindow() { nodeIntegrationInWorker: false, sandbox: true, contextIsolation: true, - preload: join(__dirname, '../bundles/debuglog/preload.js'), + preload: join(__dirname, '../bundles/debuglog/preload.preload.js'), }, parent: mainWindow, }; @@ -1546,7 +1546,7 @@ function showPermissionsPopupWindow(forCalling: boolean, forCamera: boolean) { nodeIntegrationInWorker: false, sandbox: true, contextIsolation: true, - preload: join(__dirname, '../bundles/permissions/preload.js'), + preload: join(__dirname, '../bundles/permissions/preload.preload.js'), nativeWindowOpen: true, }, parent: mainWindow, @@ -2246,7 +2246,7 @@ app.on('ready', async () => { nodeIntegration: false, sandbox: true, contextIsolation: true, - preload: join(__dirname, '../bundles/loading/preload.js'), + preload: join(__dirname, '../bundles/loading/preload.preload.js'), }, icon: windowIcon, }); @@ -3305,7 +3305,10 @@ async function showStickerCreatorWindow() { nodeIntegrationInWorker: false, sandbox: true, contextIsolation: true, - preload: join(__dirname, '../ts/windows/sticker-creator/preload.js'), + preload: join( + __dirname, + '../ts/windows/sticker-creator/preload.preload.js' + ), nativeWindowOpen: true, }, }; diff --git a/app/updateDefaultSession.main.ts b/app/updateDefaultSession.main.ts index 6e8cba245e..1a0ace16ac 100644 --- a/app/updateDefaultSession.main.ts +++ b/app/updateDefaultSession.main.ts @@ -8,7 +8,7 @@ import { v4 as generateUuid } from 'uuid'; import OS from '../ts/util/os/osMain.node.js'; import type { LoggerType } from '../ts/types/Logging.std.js'; import { strictAssert } from '../ts/util/assert.std.js'; -import { type IpcResponseType } from '../ts/util/desktopCapturer.preload.js'; +import type { IpcResponseType } from '../ts/util/desktopCapturer.preload.js'; const SPELL_CHECKER_DICTIONARY_DOWNLOAD_URL = `https://updates.signal.org/desktop/hunspell_dictionaries/${process.versions.electron}/`; diff --git a/calling_tools.html b/calling_tools.html index d0efac5a94..6feca4469d 100644 --- a/calling_tools.html +++ b/calling_tools.html @@ -31,7 +31,7 @@ /> diff --git a/ci.js b/ci.js index 6296eda4fd..e6cf641f2e 100644 --- a/ci.js +++ b/ci.js @@ -3,8 +3,8 @@ const CI_CONFIG = JSON.parse(process.env.SIGNAL_CI_CONFIG || ''); -const config = require('./app/config').default; +const config = require('./app/config.main.js').default; config.util.extendDeep(config, CI_CONFIG); -require('./app/main'); +require('./app/main.main.js'); diff --git a/debug_log.html b/debug_log.html index 111a4bb0a6..80792f6409 100644 --- a/debug_log.html +++ b/debug_log.html @@ -20,6 +20,6 @@
- + diff --git a/eslint-local-rules.js b/eslint-local-rules.js index 11aedcb3fe..ce82e66752 100644 --- a/eslint-local-rules.js +++ b/eslint-local-rules.js @@ -6,4 +6,5 @@ module.exports = { 'license-comments': require('./.eslint/rules/license-comments'), 'type-alias-readonlydeep': require('./.eslint/rules/type-alias-readonlydeep'), 'enforce-tw': require('./.eslint/rules/enforce-tw'), + 'file-suffix': require('./.eslint/rules/file-suffix'), }; diff --git a/js/calling-tools/webrtc_internals.js b/js/calling-tools/webrtc_internals.dom.js similarity index 99% rename from js/calling-tools/webrtc_internals.js rename to js/calling-tools/webrtc_internals.dom.js index bfbf52ecaf..afae289114 100644 --- a/js/calling-tools/webrtc_internals.js +++ b/js/calling-tools/webrtc_internals.dom.js @@ -11,7 +11,7 @@ import {StatsRatesCalculator, StatsReport} from './stats_rates_calculator.js'; import {StatsTable} from './stats_table.js'; import {TabView} from './tab_view.js'; import {UserMediaTable} from './user_media_table.js'; -import '../../ts/windows/sandboxedInit.js'; +import '../../ts/windows/sandboxedInit.dom.js'; let tabView = null; let peerConnectionUpdateTable = null; diff --git a/loading.html b/loading.html index 89743e6470..db98141cfd 100644 --- a/loading.html +++ b/loading.html @@ -31,6 +31,6 @@
- + diff --git a/package.json b/package.json index f89ee6ce3f..d8b9390a87 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "email": "support@signal.org" }, "browserslist": "last 1 chrome versions", - "main": "app/main.js", + "main": "app/main.main.js", "scripts": { "postinstall": "pnpm run build:acknowledgments && pnpm run electron:install-app-deps", "postuninstall": "pnpm run build:acknowledgments", @@ -25,16 +25,16 @@ "build-release": "pnpm run build", "sign-release": "node ts/updater/generateSignature.js", "notarize": "echo 'No longer necessary'", - "get-strings": "ts-node ts/scripts/get-strings.ts && ts-node ts/scripts/gen-nsis-script.ts && ts-node ts/scripts/gen-locales-config.ts && run-p get-strings:locales get-strings:countries get-strings:emoji mark-unusued-strings-deleted && run-p build:compact-locales", - "get-strings:locales": "ts-node ./ts/scripts/build-localized-display-names.ts locales ts/scripts/locale-data/locale-display-names.csv build/locale-display-names.json", - "get-strings:countries": "ts-node ./ts/scripts/build-localized-display-names.ts countries ts/scripts/locale-data/country-display-names.csv build/country-display-names.json", - "get-strings:emoji": "ts-node ./ts/scripts/get-emoji-locales.ts", - "push-strings": "node ts/scripts/remove-strings.js && node ts/scripts/push-strings.js", - "mark-unusued-strings-deleted": "ts-node ./ts/scripts/mark-unused-strings-deleted.ts", - "get-expire-time": "node ts/scripts/get-expire-time.js", - "copy-components": "node ts/scripts/copy.js", - "build-module-protobuf": "pbjs --root='signal-desktop' --target static-module --force-long --no-typeurl --no-verify --no-create --no-convert --wrap commonjs --out ts/protobuf/compiled.js protos/*.proto && pbts --no-comments --out ts/protobuf/compiled.d.ts ts/protobuf/compiled.js", - "clean-module-protobuf": "rm -f ts/protobuf/compiled.d.ts ts/protobuf/compiled.js", + "get-strings": "ts-node ts/scripts/get-strings.node.ts && ts-node ts/scripts/gen-nsis-script.node.ts && ts-node ts/scripts/gen-locales-config.node.ts && run-p get-strings:locales get-strings:countries get-strings:emoji mark-unusued-strings-deleted && run-p build:compact-locales", + "get-strings:locales": "ts-node ./ts/scripts/build-localized-display-names.node.ts locales ts/scripts/locale-data/locale-display-names.csv build/locale-display-names.json", + "get-strings:countries": "ts-node ./ts/scripts/build-localized-display-names.node.ts countries ts/scripts/locale-data/country-display-names.csv build/country-display-names.json", + "get-strings:emoji": "ts-node ./ts/scripts/get-emoji-locales.node.ts", + "push-strings": "node ts/scripts/remove-strings.node.js && node ts/scripts/push-strings.node.js", + "mark-unusued-strings-deleted": "ts-node ./ts/scripts/mark-unused-strings-deleted.node.ts", + "get-expire-time": "node ts/scripts/get-expire-time.node.js", + "copy-components": "node ts/scripts/copy.node.js", + "build-module-protobuf": "pbjs --root='signal-desktop' --target static-module --force-long --no-typeurl --no-verify --no-create --no-convert --wrap commonjs --out ts/protobuf/compiled.std.js protos/*.proto && pbts --no-comments --out ts/protobuf/compiled.std.d.ts ts/protobuf/compiled.std.js", + "clean-module-protobuf": "rm -f ts/protobuf/compiled.std.d.ts ts/protobuf/compiled.std.js", "build-protobuf": "pnpm run build-module-protobuf", "clean-protobuf": "pnpm run clean-module-protobuf", "prepare-beta-build": "node scripts/prepare_beta_build.js", @@ -47,19 +47,19 @@ "prepare-staging-build": "node scripts/prepare_staging_build.js", "prepare-linux-build": "node scripts/prepare_linux_build.js", "test": "run-s test-node test-electron test-lint-intl test-eslint", - "test-electron": "node ts/scripts/test-electron.js", - "test-release": "node ts/scripts/test-release.js", + "test-electron": "node ts/scripts/test-electron.node.js", + "test-release": "node ts/scripts/test-release.node.js", "test-node": "cross-env LANG=en-us electron-mocha --timeout 10000 --file test/setup-test-node.js --recursive ts/test-node", - "test-mock": "node ts/scripts/mocha-separator.js --require ts/test-mock/setup-ci.js -- ts/test-mock/**/*_test.js", - "test-mock-docker": "mocha --require ts/test-mock/setup-ci.js ts/test-mock/**/*_test.docker.js", + "test-mock": "node ts/scripts/mocha-separator.node.js --require ts/test-mock/setup-ci.node.js -- ts/test-mock/**/*_test.node.js", + "test-mock-docker": "mocha --require ts/test-mock/setup-ci.node.js ts/test-mock/**/*_test.docker.node.js", "test-eslint": "mocha .eslint/rules/**/*.test.js --ignore-leaks", - "test-lint-intl": "ts-node ./build/intl-linter/linter.ts --test", + "test-lint-intl": "ts-node ./build/intl-linter/linter.node.ts --test", "eslint": "eslint --cache . --cache-strategy content --max-warnings 0", "lint": "run-p --aggregate-output --print-label lint-prettier lint-css check:types eslint", - "lint-deps": "node ts/util/lint/linter.js", - "lint-license-comments": "ts-node ts/util/lint/license_comments.ts", + "lint-deps": "node ts/util/lint/linter.node.js", + "lint-license-comments": "ts-node ts/util/lint/license_comments.node.ts", "lint-prettier": "pprettier --check '**/*.{ts,tsx,d.ts,js,json,html,scss,md,yml,yaml}' '!node_modules/**'", - "lint-intl": "ts-node ./build/intl-linter/linter.ts", + "lint-intl": "ts-node ./build/intl-linter/linter.node.ts", "lint-css": "stylelint '**/*.scss' --cache", "danger:local": "./danger/danger.sh local --base main", "danger:ci": "./danger/danger.sh ci --base origin/main", @@ -85,10 +85,10 @@ "build-win32-all": "run-s --print-label generate build:esbuild:prod build:release-win32-all", "build-linux": "run-s generate build:esbuild:prod && pnpm run build:release --publish=never", "build:acknowledgments": "node scripts/generate-acknowledgments.js", - "build:dns-fallback": "node ts/scripts/generate-dns-fallback.js", - "build:icu-types": "node ts/scripts/generate-icu-types.js", - "build:compact-locales": "node ts/scripts/generate-compact-locales.js", - "build:tray-icons": "ts-node ts/scripts/generate-tray-icons.ts", + "build:dns-fallback": "node ts/scripts/generate-dns-fallback.node.js", + "build:icu-types": "node ts/scripts/generate-icu-types.node.js", + "build:compact-locales": "node ts/scripts/generate-compact-locales.node.js", + "build:tray-icons": "ts-node ts/scripts/generate-tray-icons.node.ts", "build:dev": "run-s --print-label generate build:esbuild:prod", "build:esbuild": "node scripts/esbuild.js", "build:esbuild:scripts": "node scripts/esbuild.js --no-bundle", @@ -100,14 +100,14 @@ "build:electron": "electron-builder --config.extraMetadata.environment=$SIGNAL_ENV", "build:release": "cross-env SIGNAL_ENV=production pnpm run build:electron --config.directories.output=release", "build:release-win32-all": "pnpm run build:release --arm64 --x64", - "build:preload-cache": "node ts/scripts/generate-preload-cache.js", + "build:preload-cache": "node ts/scripts/generate-preload-cache.node.js", "build:emoji": "run-p build:emoji:32 build:emoji:64", "build:emoji:32": "cwebp -progress -mt -preset icon -alpha_filter best -alpha_q 20 -pass 10 -q 75 ./node_modules/emoji-datasource-apple/img/apple/sheets-clean/32.png -o ./images/emoji-sheet-32.webp", "build:emoji:64": "cwebp -progress -mt -preset icon -alpha_filter best -alpha_q 20 -pass 10 -q 75 ./node_modules/emoji-datasource-apple/img/apple/sheets-clean/64.png -o ./images/emoji-sheet-64.webp", "verify": "run-p --print-label verify:*", "verify:ts": "tsc --noEmit", "electron:install-app-deps": "electron-builder install-app-deps", - "check-upgradeable-deps": "ts-node ts/scripts/check-upgradeable-deps.ts", + "check-upgradeable-deps": "ts-node ts/scripts/check-upgradeable-deps.node.ts", "react-devtools": "react-devtools", "run-with-devtools": "cross-env REACT_DEVTOOLS=1 run-p --print-label react-devtools start" }, @@ -449,7 +449,7 @@ "minOSVersion": "21.0.1" } }, - "sign": "./ts/scripts/sign-macos.js", + "sign": "./ts/scripts/sign-macos.node.js", "singleArchFiles": "node_modules/@signalapp/{libsignal-client/prebuilds/**,ringrtc/build/**,sqlcipher/prebuilds/**}", "target": [ { @@ -476,7 +476,7 @@ "certificateSubjectName": "Signal Messenger, LLC", "certificateSha1": "8D5E3CD800736C5E1FE459A1F5AA48287D4F6EC6", "publisherName": "Signal Messenger, LLC", - "sign": "./ts/scripts/sign-windows.js", + "sign": "./ts/scripts/sign-windows.node.js", "signingHashAlgorithms": [ "sha256" ] @@ -562,10 +562,10 @@ "signalcaptcha" ] }, - "artifactBuildCompleted": "ts/scripts/artifact-build-completed.js", - "afterSign": "ts/scripts/after-sign.js", - "afterPack": "ts/scripts/after-pack.js", - "afterAllArtifactBuild": "ts/scripts/after-all-artifact-build.js", + "artifactBuildCompleted": "ts/scripts/artifact-build-completed.node.js", + "afterSign": "ts/scripts/after-sign.node.js", + "afterPack": "ts/scripts/after-pack.node.js", + "afterAllArtifactBuild": "ts/scripts/after-all-artifact-build.node.js", "asar": { "smartUnpack": false }, diff --git a/permissions_popup.html b/permissions_popup.html index 323dc5827b..9b3754c6da 100644 --- a/permissions_popup.html +++ b/permissions_popup.html @@ -20,6 +20,6 @@
- + diff --git a/preload.wrapper.ts b/preload.wrapper.ts index 0052861823..0cc943e4ac 100644 --- a/preload.wrapper.ts +++ b/preload.wrapper.ts @@ -59,7 +59,7 @@ const fn = script.runInThisContext({ importModuleDynamically: constants.USE_MAIN_CONTEXT_DEFAULT_LOADER, }); -// See `ts/scripts/generate-preload-cache.ts` +// See `ts/scripts/generate-preload-cache.node.ts` if (process.env.GENERATE_PRELOAD_CACHE) { // Use hottest cache possible in CI if (process.env.CI) { diff --git a/screenShare.html b/screenShare.html index 5dc56396e9..63dfa86bad 100644 --- a/screenShare.html +++ b/screenShare.html @@ -20,6 +20,6 @@
- + diff --git a/scripts/esbuild.js b/scripts/esbuild.js index ebc03be2d8..a9bd92aad7 100644 --- a/scripts/esbuild.js +++ b/scripts/esbuild.js @@ -94,7 +94,7 @@ const bundleDefaults = { 'mocha', // Uses fast-glob and dynamic requires - './preload_test.js', + './preload_test.preload.js', ], }; @@ -162,7 +162,9 @@ async function main() { preloadConfig: { ...bundleDefaults, mainFields: ['browser', 'main'], - entryPoints: [path.join(ROOT_DIR, 'ts', 'windows', 'main', 'preload.ts')], + entryPoints: [ + path.join(ROOT_DIR, 'ts', 'windows', 'main', 'preload.preload.ts'), + ], outfile: path.join(ROOT_DIR, 'preload.bundle.js'), }, }); @@ -174,17 +176,17 @@ async function sandboxedEnv() { ...sandboxedBrowserDefaults, mainFields: ['browser', 'main'], entryPoints: [ - path.join(ROOT_DIR, 'ts', 'windows', 'about', 'app.tsx'), - path.join(ROOT_DIR, 'ts', 'windows', 'debuglog', 'app.tsx'), - path.join(ROOT_DIR, 'ts', 'windows', 'loading', 'start.ts'), - path.join(ROOT_DIR, 'ts', 'windows', 'permissions', 'app.tsx'), - path.join(ROOT_DIR, 'ts', 'windows', 'screenShare', 'app.tsx'), + path.join(ROOT_DIR, 'ts', 'windows', 'about', 'app.dom.tsx'), + path.join(ROOT_DIR, 'ts', 'windows', 'debuglog', 'app.dom.tsx'), + path.join(ROOT_DIR, 'ts', 'windows', 'loading', 'start.dom.ts'), + path.join(ROOT_DIR, 'ts', 'windows', 'permissions', 'app.dom.tsx'), + path.join(ROOT_DIR, 'ts', 'windows', 'screenShare', 'app.dom.tsx'), path.join( ROOT_DIR, 'ts', 'windows', 'calling-tools', - 'webrtc_internals.ts' + 'webrtc_internals.dom.ts' ), ], }, @@ -192,12 +194,30 @@ async function sandboxedEnv() { ...sandboxedPreloadDefaults, mainFields: ['browser', 'main'], entryPoints: [ - path.join(ROOT_DIR, 'ts', 'windows', 'about', 'preload.ts'), - path.join(ROOT_DIR, 'ts', 'windows', 'debuglog', 'preload.ts'), - path.join(ROOT_DIR, 'ts', 'windows', 'loading', 'preload.ts'), - path.join(ROOT_DIR, 'ts', 'windows', 'permissions', 'preload.ts'), - path.join(ROOT_DIR, 'ts', 'windows', 'calling-tools', 'preload.ts'), - path.join(ROOT_DIR, 'ts', 'windows', 'screenShare', 'preload.ts'), + path.join(ROOT_DIR, 'ts', 'windows', 'about', 'preload.preload.ts'), + path.join(ROOT_DIR, 'ts', 'windows', 'debuglog', 'preload.preload.ts'), + path.join(ROOT_DIR, 'ts', 'windows', 'loading', 'preload.preload.ts'), + path.join( + ROOT_DIR, + 'ts', + 'windows', + 'permissions', + 'preload.preload.ts' + ), + path.join( + ROOT_DIR, + 'ts', + 'windows', + 'calling-tools', + 'preload.preload.ts' + ), + path.join( + ROOT_DIR, + 'ts', + 'windows', + 'screenShare', + 'preload.preload.ts' + ), ], format: 'cjs', outdir: 'bundles', diff --git a/scripts/prepare_adhoc_build.js b/scripts/prepare_adhoc_build.js index d3eab451ae..e92c212b7d 100644 --- a/scripts/prepare_adhoc_build.js +++ b/scripts/prepare_adhoc_build.js @@ -4,7 +4,7 @@ const fs = require('node:fs'); const _ = require('lodash'); const { execSync } = require('node:child_process'); -const { isAdhoc } = require('../ts/util/version.js'); +const { isAdhoc } = require('../ts/util/version.std.js'); const { default: packageJson, version } = require('./packageJson.js'); // You might be wondering why this file is necessary. It comes down to our desire to allow diff --git a/scripts/prepare_alpha_build.js b/scripts/prepare_alpha_build.js index 0dd5a37fe8..6867fe8095 100644 --- a/scripts/prepare_alpha_build.js +++ b/scripts/prepare_alpha_build.js @@ -4,7 +4,7 @@ const fs = require('node:fs'); const _ = require('lodash'); -const { isAlpha } = require('../ts/util/version.js'); +const { isAlpha } = require('../ts/util/version.std.js'); const { default: packageJson, version } = require('./packageJson.js'); // You might be wondering why this file is necessary. It comes down to our desire to allow diff --git a/scripts/prepare_axolotl_build.js b/scripts/prepare_axolotl_build.js index 7b3d0cfd13..58fe288eba 100644 --- a/scripts/prepare_axolotl_build.js +++ b/scripts/prepare_axolotl_build.js @@ -4,7 +4,7 @@ const fs = require('node:fs'); const _ = require('lodash'); -const { isAxolotl } = require('../ts/util/version.js'); +const { isAxolotl } = require('../ts/util/version.std.js'); const { default: packageJson, version } = require('./packageJson.js'); // You might be wondering why this file is necessary. It comes down to our desire to allow diff --git a/scripts/prepare_beta_build.js b/scripts/prepare_beta_build.js index 6573defa7e..3f86526e9b 100644 --- a/scripts/prepare_beta_build.js +++ b/scripts/prepare_beta_build.js @@ -4,7 +4,7 @@ const fs = require('node:fs'); const _ = require('lodash'); -const { isBeta } = require('../ts/util/version.js'); +const { isBeta } = require('../ts/util/version.std.js'); const { default: packageJson, version } = require('./packageJson.js'); // You might be wondering why this file is necessary. It comes down to our desire to allow diff --git a/scripts/prepare_staging_build.js b/scripts/prepare_staging_build.js index c6dc9e2ead..47289fa7f5 100644 --- a/scripts/prepare_staging_build.js +++ b/scripts/prepare_staging_build.js @@ -4,7 +4,7 @@ const fs = require('node:fs'); const _ = require('lodash'); -const { isAlpha } = require('../ts/util/version.js'); +const { isAlpha } = require('../ts/util/version.std.js'); const { default: packageJson, version } = require('./packageJson.js'); // You might be wondering why this file is necessary. It comes down to our desire to allow diff --git a/scripts/prepare_tagged_version.js b/scripts/prepare_tagged_version.js index 746416bda2..5acac533f8 100644 --- a/scripts/prepare_tagged_version.js +++ b/scripts/prepare_tagged_version.js @@ -16,7 +16,7 @@ if (release !== 'alpha' && release !== 'axolotl' && release !== 'adhoc') { process.exit(1); } -const { generateTaggedVersion } = require('../ts/util/version.js'); +const { generateTaggedVersion } = require('../ts/util/version.std.js'); const shortSha = execSync('git rev-parse --short=9 HEAD') .toString('utf8') diff --git a/settings.html b/settings.html deleted file mode 100644 index 69e0e344d6..0000000000 --- a/settings.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - -
- - - diff --git a/test/setup-test-node.js b/test/setup-test-node.js index d955582c9e..577e0be147 100644 --- a/test/setup-test-node.js +++ b/test/setup-test-node.js @@ -4,10 +4,10 @@ const chai = require('chai'); const chaiAsPromised = require('chai-as-promised'); -const { Crypto } = require('../ts/context/Crypto.js'); -const { setEnvironment, Environment } = require('../ts/environment.js'); -const { HourCyclePreference } = require('../ts/types/I18N.js'); -const { default: package } = require('../ts/util/packageJson.js'); +const { Crypto } = require('../ts/context/Crypto.node.js'); +const { setEnvironment, Environment } = require('../ts/environment.std.js'); +const { HourCyclePreference } = require('../ts/types/I18N.std.js'); +const { default: package } = require('../ts/util/packageJson.node.js'); chai.use(chaiAsPromised); diff --git a/ts/Timers.dom.ts b/ts/Timers.preload.ts similarity index 100% rename from ts/Timers.dom.ts rename to ts/Timers.preload.ts diff --git a/ts/background.preload.ts b/ts/background.preload.ts index bceb72a632..b7701134d0 100644 --- a/ts/background.preload.ts +++ b/ts/background.preload.ts @@ -22,7 +22,7 @@ import createTaskWithTimeout, { } from './textsecure/TaskWithTimeout.std.js'; import type { MessageAttributesType } from './model-types.d.ts'; import * as Bytes from './Bytes.std.js'; -import * as Timers from './Timers.dom.js'; +import * as Timers from './Timers.preload.js'; import * as indexedDb from './indexeddb.dom.js'; import type { MenuOptionsType } from './types/menu.std.js'; import { SocketStatus } from './types/SocketStatus.std.js'; diff --git a/ts/components/CompositionArea.dom.stories.tsx b/ts/components/CompositionArea.dom.stories.tsx index 163216f135..064eb34a35 100644 --- a/ts/components/CompositionArea.dom.stories.tsx +++ b/ts/components/CompositionArea.dom.stories.tsx @@ -7,7 +7,7 @@ import type { Meta } from '@storybook/react'; import { IMAGE_JPEG } from '../types/MIME.std.js'; import type { Props } from './CompositionArea.dom.js'; import { CompositionArea } from './CompositionArea.dom.js'; -import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.std.js'; import { fakeDraftAttachment } from '../test-helpers/fakeAttachment.std.js'; import { landscapeGreenUrl } from '../storybook/Fixtures.std.js'; diff --git a/ts/components/CompositionInput.dom.stories.tsx b/ts/components/CompositionInput.dom.stories.tsx index c992fa3f51..42e1615ec3 100644 --- a/ts/components/CompositionInput.dom.stories.tsx +++ b/ts/components/CompositionInput.dom.stories.tsx @@ -10,7 +10,7 @@ import { getDefaultConversation } from '../test-helpers/getDefaultConversation.s import type { Props } from './CompositionInput.dom.js'; import { CompositionInput } from './CompositionInput.dom.js'; import { generateAci } from '../types/ServiceId.std.js'; -import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.std.js'; import { EmojiSkinTone } from './fun/data/emojis.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ConversationList.dom.stories.tsx b/ts/components/ConversationList.dom.stories.tsx index 077f4977c0..71ca8e125a 100644 --- a/ts/components/ConversationList.dom.stories.tsx +++ b/ts/components/ConversationList.dom.stories.tsx @@ -14,7 +14,7 @@ import { MessageStatuses } from '../types/message/MessageStatus.std.js'; import { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox.dom.js'; import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; import { ThemeType } from '../types/Util.std.js'; -import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.std.js'; import { makeFakeLookupConversationWithoutServiceId } from '../test-helpers/fakeLookupConversationWithoutServiceId.std.js'; const { times, omit } = lodash; diff --git a/ts/components/ForwardMessagesModal.dom.stories.tsx b/ts/components/ForwardMessagesModal.dom.stories.tsx index 40ac15c62a..1a07e4f87f 100644 --- a/ts/components/ForwardMessagesModal.dom.stories.tsx +++ b/ts/components/ForwardMessagesModal.dom.stories.tsx @@ -12,7 +12,7 @@ import { } from './ForwardMessagesModal.dom.js'; import { IMAGE_JPEG, VIDEO_MP4, stringToMIMEType } from '../types/MIME.std.js'; import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; -import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.std.js'; import { CompositionTextArea } from './CompositionTextArea.dom.js'; import type { MessageForwardDraft } from '../types/ForwardDraft.std.js'; import { EmojiSkinTone } from './fun/data/emojis.std.js'; diff --git a/ts/components/LeftPane.dom.stories.tsx b/ts/components/LeftPane.dom.stories.tsx index fdc3358920..7cfaf20086 100644 --- a/ts/components/LeftPane.dom.stories.tsx +++ b/ts/components/LeftPane.dom.stories.tsx @@ -27,7 +27,7 @@ import { } from '../test-helpers/getDefaultConversation.std.js'; import { DialogType } from '../types/Dialogs.std.js'; import { SocketStatus } from '../types/SocketStatus.std.js'; -import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.std.js'; import { makeFakeLookupConversationWithoutServiceId, useUuidFetchState, diff --git a/ts/components/PlaybackButton.dom.stories.tsx b/ts/components/PlaybackButton.dom.stories.tsx index 8a9bf78366..b549e8f465 100644 --- a/ts/components/PlaybackButton.dom.stories.tsx +++ b/ts/components/PlaybackButton.dom.stories.tsx @@ -7,7 +7,7 @@ import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; import type { ButtonProps } from './PlaybackButton.dom.js'; import { PlaybackButton } from './PlaybackButton.dom.js'; -import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.std.js'; import { ThemeType } from '../types/Util.std.js'; import { AUDIO_MP3 } from '../types/MIME.std.js'; diff --git a/ts/components/SafetyNumberChangeDialog.dom.stories.tsx b/ts/components/SafetyNumberChangeDialog.dom.stories.tsx index 8948511379..a3573a1939 100644 --- a/ts/components/SafetyNumberChangeDialog.dom.stories.tsx +++ b/ts/components/SafetyNumberChangeDialog.dom.stories.tsx @@ -7,7 +7,7 @@ import type { Meta } from '@storybook/react'; import type { Props } from './SafetyNumberChangeDialog.dom.js'; import { SafetyNumberChangeDialog } from './SafetyNumberChangeDialog.dom.js'; import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; -import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.std.js'; import { getFakeBadge } from '../test-helpers/getFakeBadge.std.js'; import { MY_STORY_ID } from '../types/Stories.std.js'; import { generateStoryDistributionId } from '../types/StoryDistributionId.std.js'; diff --git a/ts/components/conversation/ConversationHeader.dom.stories.tsx b/ts/components/conversation/ConversationHeader.dom.stories.tsx index 6ee499bfc3..0bee28faf0 100644 --- a/ts/components/conversation/ConversationHeader.dom.stories.tsx +++ b/ts/components/conversation/ConversationHeader.dom.stories.tsx @@ -11,7 +11,7 @@ import { } from '../../test-helpers/getDefaultConversation.std.js'; import { getRandomColor } from '../../test-helpers/getRandomColor.std.js'; import { DurationInSeconds } from '../../util/durations/index.std.js'; -import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.std.js'; import type { PropsType } from './ConversationHeader.dom.js'; import { ConversationHeader, diff --git a/ts/components/conversation/ConversationHero.dom.stories.tsx b/ts/components/conversation/ConversationHero.dom.stories.tsx index ad02ce421e..084fafddc4 100644 --- a/ts/components/conversation/ConversationHero.dom.stories.tsx +++ b/ts/components/conversation/ConversationHero.dom.stories.tsx @@ -8,7 +8,7 @@ import { action } from '@storybook/addon-actions'; import type { Props } from './ConversationHero.dom.js'; import { ConversationHero } from './ConversationHero.dom.js'; import { HasStories } from '../../types/Stories.std.js'; -import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.std.js'; import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; import { ThemeType } from '../../types/Util.std.js'; import type { GroupV2Membership } from './conversation-details/ConversationDetailsMembershipList.dom.js'; diff --git a/ts/components/conversation/Image.dom.stories.tsx b/ts/components/conversation/Image.dom.stories.tsx index bf1b876be3..b5f240b481 100644 --- a/ts/components/conversation/Image.dom.stories.tsx +++ b/ts/components/conversation/Image.dom.stories.tsx @@ -9,7 +9,7 @@ import type { Props } from './Image.dom.js'; import { CurveType, Image } from './Image.dom.js'; import { IMAGE_PNG } from '../../types/MIME.std.js'; import type { ThemeType } from '../../types/Util.std.js'; -import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.std.js'; import { fakeAttachment } from '../../test-helpers/fakeAttachment.std.js'; diff --git a/ts/components/conversation/Timeline.dom.stories.tsx b/ts/components/conversation/Timeline.dom.stories.tsx index c4dfa3f2f5..cfa5868ee4 100644 --- a/ts/components/conversation/Timeline.dom.stories.tsx +++ b/ts/components/conversation/Timeline.dom.stories.tsx @@ -11,7 +11,7 @@ import type { PropsType } from './Timeline.dom.js'; import { Timeline } from './Timeline.dom.js'; import type { TimelineItemType } from './TimelineItem.dom.js'; import { TimelineItem } from './TimelineItem.dom.js'; -import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.std.js'; import { ConversationHero } from './ConversationHero.dom.js'; import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; import { TypingBubble } from './TypingBubble.dom.js'; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsHeader.dom.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetailsHeader.dom.stories.tsx index 1e54cb5867..bc986ac653 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsHeader.dom.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsHeader.dom.stories.tsx @@ -6,7 +6,7 @@ import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; import { getFakeBadges } from '../../../test-helpers/getFakeBadge.std.js'; -import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext.std.js'; import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; import type { Props } from './ConversationDetailsHeader.dom.js'; import { ConversationDetailsHeader } from './ConversationDetailsHeader.dom.js'; diff --git a/ts/components/conversation/conversation-details/PendingInvites.dom.stories.tsx b/ts/components/conversation/conversation-details/PendingInvites.dom.stories.tsx index 849be1bf26..5c3fe76a44 100644 --- a/ts/components/conversation/conversation-details/PendingInvites.dom.stories.tsx +++ b/ts/components/conversation/conversation-details/PendingInvites.dom.stories.tsx @@ -12,7 +12,7 @@ import { PendingInvites } from './PendingInvites.dom.js'; import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; import { getFakeBadge } from '../../../test-helpers/getFakeBadge.std.js'; -import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext.std.js'; const { times } = lodash; diff --git a/ts/components/conversation/media-gallery/MediaGridItem.dom.stories.tsx b/ts/components/conversation/media-gallery/MediaGridItem.dom.stories.tsx index 844f6f8e11..f5e39e3d80 100644 --- a/ts/components/conversation/media-gallery/MediaGridItem.dom.stories.tsx +++ b/ts/components/conversation/media-gallery/MediaGridItem.dom.stories.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext.std.js'; import type { MediaItemType } from '../../../types/MediaItem.std.js'; import { SignalService } from '../../../protobuf/index.std.js'; import { diff --git a/ts/components/conversationList/MessageSearchResult.dom.stories.tsx b/ts/components/conversationList/MessageSearchResult.dom.stories.tsx index 42d70c05b2..a418b9c91e 100644 --- a/ts/components/conversationList/MessageSearchResult.dom.stories.tsx +++ b/ts/components/conversationList/MessageSearchResult.dom.stories.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; +import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.std.js'; import { strictAssert } from '../../util/assert.std.js'; import { getFakeBadge } from '../../test-helpers/getFakeBadge.std.js'; import type { PropsType } from './MessageSearchResult.dom.js'; diff --git a/ts/logging/log.std.ts b/ts/logging/log.std.ts index 6940238fdf..b08d06f5c8 100644 --- a/ts/logging/log.std.ts +++ b/ts/logging/log.std.ts @@ -1,6 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only +// We use `window` below, but it is guarded by type checks +// eslint-disable-next-line local-rules/file-suffix import pino from 'pino'; import { LRUCache } from 'lru-cache'; diff --git a/ts/protobuf/index.std.ts b/ts/protobuf/index.std.ts index 05b5d638e3..7433fe9911 100644 --- a/ts/protobuf/index.std.ts +++ b/ts/protobuf/index.std.ts @@ -1,13 +1,13 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import './wrap.node.js'; +import './wrap.std.js'; import { signal as Signal, signalbackups as Backups, signalservice as SignalService, migrations as Migrations, -} from './compiled.js'; +} from './compiled.std.js'; export { Backups, SignalService, Signal, Migrations }; diff --git a/ts/protobuf/wrap.node.ts b/ts/protobuf/wrap.std.ts similarity index 100% rename from ts/protobuf/wrap.node.ts rename to ts/protobuf/wrap.std.ts diff --git a/ts/services/backups/util/localBackup.node.ts b/ts/services/backups/util/localBackup.node.ts index dffe97c03a..7faeb75425 100644 --- a/ts/services/backups/util/localBackup.node.ts +++ b/ts/services/backups/util/localBackup.node.ts @@ -11,7 +11,7 @@ import { createLogger } from '../../../logging/log.std.js'; import * as Bytes from '../../../Bytes.std.js'; import * as Errors from '../../../types/errors.std.js'; import { Signal } from '../../../protobuf/index.std.js'; -import protobuf from '../../../protobuf/wrap.node.js'; +import protobuf from '../../../protobuf/wrap.std.js'; import { strictAssert } from '../../../util/assert.std.js'; import { decryptAesCtr, encryptAesCtr } from '../../../Crypto.node.js'; import type { LocalBackupMetadataVerificationType } from '../../../types/backups.node.js'; diff --git a/ts/sql/main.main.ts b/ts/sql/main.main.ts index cf9562c9fc..9a08b997ae 100644 --- a/ts/sql/main.main.ts +++ b/ts/sql/main.main.ts @@ -474,7 +474,12 @@ export class MainSQL { } #createWorker(): CreateWorkerResultType { - const scriptPath = join(app.getAppPath(), 'ts', 'sql', 'mainWorker.js'); + const scriptPath = join( + app.getAppPath(), + 'ts', + 'sql', + 'mainWorker.node.js' + ); const worker = new Worker(scriptPath); diff --git a/ts/test-electron/ContactsParser_test.preload.ts b/ts/test-electron/ContactsParser_test.preload.ts index bc70137380..318504ca42 100644 --- a/ts/test-electron/ContactsParser_test.preload.ts +++ b/ts/test-electron/ContactsParser_test.preload.ts @@ -15,7 +15,7 @@ import { pipeline } from 'node:stream/promises'; import { Transform } from 'node:stream'; import fse from 'fs-extra'; -import protobuf from '../protobuf/wrap.node.js'; +import protobuf from '../protobuf/wrap.std.js'; import { createLogger } from '../logging/log.std.js'; import * as Bytes from '../Bytes.std.js'; import * as Errors from '../types/errors.std.js'; diff --git a/ts/test-electron/SignalProtocolStore_test.preload.ts b/ts/test-electron/SignalProtocolStore_test.preload.ts index 5bebfba836..385f0b454e 100644 --- a/ts/test-electron/SignalProtocolStore_test.preload.ts +++ b/ts/test-electron/SignalProtocolStore_test.preload.ts @@ -15,7 +15,7 @@ import { import { v4 as generateUuid } from 'uuid'; import { DataReader, DataWriter } from '../sql/Client.preload.js'; -import { signal } from '../protobuf/compiled.js'; +import { signal } from '../protobuf/compiled.std.js'; import { sessionStructureToBytes } from '../util/sessionTranslation.node.js'; import * as durations from '../util/durations/index.std.js'; import { explodePromise } from '../util/explodePromise.std.js'; diff --git a/ts/test-mock/messaging/edit_test.preload.ts b/ts/test-mock/messaging/edit_test.node.ts similarity index 99% rename from ts/test-mock/messaging/edit_test.preload.ts rename to ts/test-mock/messaging/edit_test.node.ts index f0397dbdaa..335ad9feae 100644 --- a/ts/test-mock/messaging/edit_test.preload.ts +++ b/ts/test-mock/messaging/edit_test.node.ts @@ -1,6 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only +// `window` use below is actually executed in the browser. +// eslint-disable-next-line local-rules/file-suffix import { Proto } from '@signalapp/mock-server'; import { Aci } from '@signalapp/libsignal-client'; import { assert } from 'chai'; diff --git a/ts/test-mock/routing/routing_test.preload.ts b/ts/test-mock/routing/routing_test.node.ts similarity index 95% rename from ts/test-mock/routing/routing_test.preload.ts rename to ts/test-mock/routing/routing_test.node.ts index 35ef8ba34b..1300040072 100644 --- a/ts/test-mock/routing/routing_test.preload.ts +++ b/ts/test-mock/routing/routing_test.node.ts @@ -1,6 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only +// `window` use below is actually executed in the browser. +// eslint-disable-next-line local-rules/file-suffix import { assert } from 'chai'; import * as durations from '../../util/durations/index.std.js'; diff --git a/ts/test-node/Proto_unknown_field_test.node.ts b/ts/test-node/Proto_unknown_field_test.std.ts similarity index 100% rename from ts/test-node/Proto_unknown_field_test.node.ts rename to ts/test-node/Proto_unknown_field_test.std.ts diff --git a/ts/test-node/types/errors_test.node.ts b/ts/test-node/types/errors_test.node.ts index 622c8cded6..04bc9efb27 100644 --- a/ts/test-node/types/errors_test.node.ts +++ b/ts/test-node/types/errors_test.node.ts @@ -14,7 +14,7 @@ describe('Errors', () => { assert.typeOf(error, 'Error'); const formattedError = Errors.toLogFormat(error); - assert.include(formattedError, 'errors_test.js'); + assert.include(formattedError, 'errors_test.node.js'); assert.include( formattedError, APP_ROOT_PATH, diff --git a/ts/textsecure/ContactsParser.preload.ts b/ts/textsecure/ContactsParser.preload.ts index 1d8c4998c1..af0a9931d6 100644 --- a/ts/textsecure/ContactsParser.preload.ts +++ b/ts/textsecure/ContactsParser.preload.ts @@ -5,7 +5,7 @@ import { Transform } from 'node:stream'; import { createLogger } from '../logging/log.std.js'; import { SignalService as Proto } from '../protobuf/index.std.js'; -import protobuf from '../protobuf/wrap.node.js'; +import protobuf from '../protobuf/wrap.std.js'; import { DurationInSeconds } from '../util/durations/index.std.js'; import { getAbsoluteAttachmentPath, diff --git a/ts/textsecure/MessageReceiver.preload.ts b/ts/textsecure/MessageReceiver.preload.ts index eea7df7ed3..f0d26d634a 100644 --- a/ts/textsecure/MessageReceiver.preload.ts +++ b/ts/textsecure/MessageReceiver.preload.ts @@ -151,7 +151,7 @@ import type { SendTypesType } from '../util/handleMessageSend.preload.js'; import { getStoriesBlocked } from '../util/stories.preload.js'; import { isNotNil } from '../util/isNotNil.std.js'; import { chunk } from '../util/iterables.std.js'; -import { inspectUnknownFieldTags } from '../util/inspectProtobufs.node.js'; +import { inspectUnknownFieldTags } from '../util/inspectProtobufs.std.js'; import { incrementMessageCounter } from '../util/incrementMessageCounter.preload.js'; import { filterAndClean } from '../types/BodyRange.std.js'; import { diff --git a/ts/textsecure/WebSocket.preload.ts b/ts/textsecure/WebSocket.preload.ts index a8798ec225..5550f3445b 100644 --- a/ts/textsecure/WebSocket.preload.ts +++ b/ts/textsecure/WebSocket.preload.ts @@ -14,7 +14,7 @@ import type { ProxyAgent } from '../util/createProxyAgent.node.js'; import { createHTTPSAgent } from '../util/createHTTPSAgent.node.js'; import { HTTPError } from '../types/HTTPError.std.js'; import { createLogger } from '../logging/log.std.js'; -import * as Timers from '../Timers.dom.js'; +import * as Timers from '../Timers.preload.js'; import { ConnectTimeoutError } from './Errors.std.js'; import { handleStatusCode, translateError } from './Utils.dom.js'; diff --git a/ts/textsecure/WebsocketResources.preload.ts b/ts/textsecure/WebsocketResources.preload.ts index 06155a9295..b9ca3dc207 100644 --- a/ts/textsecure/WebsocketResources.preload.ts +++ b/ts/textsecure/WebsocketResources.preload.ts @@ -52,7 +52,7 @@ import { strictAssert } from '../util/assert.std.js'; import * as Errors from '../types/errors.std.js'; import { SignalService as Proto } from '../protobuf/index.std.js'; import { createLogger } from '../logging/log.std.js'; -import * as Timers from '../Timers.dom.js'; +import * as Timers from '../Timers.preload.js'; import type { IResource } from './WebSocket.preload.js'; import { AbortableProcess } from '../util/AbortableProcess.std.js'; diff --git a/ts/util/dns.node.ts b/ts/util/dns.node.ts index 65d6588704..575e031ceb 100644 --- a/ts/util/dns.node.ts +++ b/ts/util/dns.node.ts @@ -7,6 +7,7 @@ import type { LookupAddress, lookup as nodeLookup, } from 'node:dns'; +// eslint-disable-next-line local-rules/file-suffix import * as electron from 'electron'; import type { ResolvedHost, ResolvedEndpoint } from 'electron'; import pTimeout from 'p-timeout'; diff --git a/ts/util/formatTimestamp.dom.ts b/ts/util/formatTimestamp.dom.ts index fc0fdff680..45da02196a 100644 --- a/ts/util/formatTimestamp.dom.ts +++ b/ts/util/formatTimestamp.dom.ts @@ -77,7 +77,6 @@ export function getDateTimeFormatter( const locales = localeOverride != null ? [localeOverride] : preferredSystemLocales; const optionsWithPreferences = getOptionsWithPreferences(options); - console.error(locales); const cacheKey = getCacheKey(locales, optionsWithPreferences); const cachedFormatter = formatterCache.get(cacheKey); if (cachedFormatter) { diff --git a/ts/util/inspectProtobufs.node.ts b/ts/util/inspectProtobufs.std.ts similarity index 100% rename from ts/util/inspectProtobufs.node.ts rename to ts/util/inspectProtobufs.std.ts diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json index f10dfad89d..16d7d7562d 100644 --- a/ts/util/lint/exceptions.json +++ b/ts/util/lint/exceptions.json @@ -813,21 +813,21 @@ }, { "rule": "React-useRef", - "path": "ts/axo/AriaClickable.tsx", + "path": "ts/axo/AriaClickable.dom.tsx", "line": " const ref = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-08-28T23:36:44.974Z" }, { "rule": "React-useRef", - "path": "ts/axo/AriaClickable.tsx", + "path": "ts/axo/AriaClickable.dom.tsx", "line": " const onTriggerStateUpdateRef = useRef(onTriggerStateUpdate);", "reasonCategory": "usageTrusted", "updated": "2025-08-28T23:36:44.974Z" }, { "rule": "React-useRef", - "path": "ts/calling/useGetCallingFrameBuffer.ts", + "path": "ts/calling/useGetCallingFrameBuffer.std.ts", "line": " const ref = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-10-01T20:11:56Z", @@ -835,7 +835,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/AutoSizeInput.tsx", + "path": "ts/components/AutoSizeInput.dom.tsx", "line": " const hiddenRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2024-01-11T16:58:57.146Z", @@ -843,14 +843,14 @@ }, { "rule": "React-useRef", - "path": "ts/components/AutoSizeTextArea.tsx", + "path": "ts/components/AutoSizeTextArea.dom.tsx", "line": " const ownRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2024-03-26T17:14:14.370Z" }, { "rule": "React-useRef", - "path": "ts/components/AvatarEditor.tsx", + "path": "ts/components/AvatarEditor.dom.tsx", "line": " const tryClose = useRef<() => void | undefined>();", "reasonCategory": "usageTrusted", "updated": "2025-05-24T03:40:20.019Z", @@ -858,7 +858,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/AvatarTextEditor.tsx", + "path": "ts/components/AvatarTextEditor.dom.tsx", "line": " const measureElRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-08-04T18:18:09.236Z", @@ -866,42 +866,42 @@ }, { "rule": "React-useRef", - "path": "ts/components/AvatarTextEditor.tsx", + "path": "ts/components/AvatarTextEditor.dom.tsx", "line": " const inputRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-08-04T22:02:17.074Z" }, { "rule": "React-useRef", - "path": "ts/components/AvatarTextEditor.tsx", + "path": "ts/components/AvatarTextEditor.dom.tsx", "line": " const onDoneRef = useRef(onDone);", "reasonCategory": "usageTrusted", "updated": "2021-08-05T23:40:55.699Z" }, { "rule": "React-useRef", - "path": "ts/components/AvatarUploadButton.tsx", + "path": "ts/components/AvatarUploadButton.dom.tsx", "line": " const fileInputRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-08-03T21:17:38.615Z" }, { "rule": "React-useRef", - "path": "ts/components/CallManager.tsx", + "path": "ts/components/CallManager.dom.tsx", "line": " const imageDataCache = React.useRef(new Map());", "reasonCategory": "usageTrusted", "updated": "2024-05-06T20:18:59.647Z" }, { "rule": "React-useRef", - "path": "ts/components/CallNeedPermissionScreen.tsx", + "path": "ts/components/CallNeedPermissionScreen.dom.tsx", "line": " const autoCloseAtRef = useRef(Date.now() + AUTO_CLOSE_MS);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/CallReactionBurst.tsx", + "path": "ts/components/CallReactionBurst.dom.tsx", "line": " const timeouts = useRef>(new Map());", "reasonCategory": "usageTrusted", "updated": "2024-01-06T00:59:20.678Z", @@ -909,7 +909,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/CallReactionBurst.tsx", + "path": "ts/components/CallReactionBurst.dom.tsx", "line": " const burstsShown = useRef>(new Set());", "reasonCategory": "usageTrusted", "updated": "2024-01-06T00:59:20.678Z", @@ -917,7 +917,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/CallReactionBurst.tsx", + "path": "ts/components/CallReactionBurst.dom.tsx", "line": " const shownBursts = useRef>(new Set());", "reasonCategory": "usageTrusted", "updated": "2024-01-06T00:59:20.678Z", @@ -925,7 +925,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/CallReactionBurstEmoji.tsx", + "path": "ts/components/CallReactionBurstEmoji.dom.tsx", "line": " const containerRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2024-01-06T00:59:20.678Z", @@ -933,7 +933,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/CallScreen.tsx", + "path": "ts/components/CallScreen.dom.tsx", "line": " const burstsShown = useRef>(new Map());", "reasonCategory": "sageTrusted", "updated": "2024-01-06T00:59:20.678Z", @@ -941,7 +941,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/CallScreen.tsx", + "path": "ts/components/CallScreen.dom.tsx", "line": " const toastRegionRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-11-14T23:29:51.425Z", @@ -949,7 +949,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/CallScreen.tsx", + "path": "ts/components/CallScreen.dom.tsx", "line": " const reactionPickerRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-11-14T23:29:51.425Z", @@ -957,7 +957,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/CallScreen.tsx", + "path": "ts/components/CallScreen.dom.tsx", "line": " const burstRegionRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-12-21T11:13:56.623Z", @@ -965,7 +965,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/CallScreen.tsx", + "path": "ts/components/CallScreen.dom.tsx", "line": " const reactionsShown = useRef<", "reasonCategory": "usageTrusted", "updated": "2024-01-06T00:59:20.678Z", @@ -973,21 +973,21 @@ }, { "rule": "React-useRef", - "path": "ts/components/CallScreen.tsx", + "path": "ts/components/CallScreen.dom.tsx", "line": " const reactButtonRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2024-01-16T22:59:06.336Z" }, { "rule": "React-useRef", - "path": "ts/components/CallScreen.tsx", + "path": "ts/components/CallScreen.dom.tsx", "line": " const reactionPickerContainerRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2024-01-16T22:59:06.336Z" }, { "rule": "React-useRef", - "path": "ts/components/CallingPendingParticipants.tsx", + "path": "ts/components/CallingPendingParticipants.dom.tsx", "line": " const expandedListRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2024-06-28T01:22:22.509Z", @@ -995,7 +995,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/CallingPendingParticipants.tsx", + "path": "ts/components/CallingPendingParticipants.dom.tsx", "line": " const lastParticipantRef = React.useRef();", "reasonCategory": "usageTrusted", "updated": "2024-09-20T02:11:27.851Z", @@ -1003,210 +1003,210 @@ }, { "rule": "React-useRef", - "path": "ts/components/CallingPip.tsx", + "path": "ts/components/CallingPip.dom.tsx", "line": " const videoContainerRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/CallingToast.tsx", + "path": "ts/components/CallingToast.dom.tsx", "line": " const shownToasts = React.useRef>(new Set());", "reasonCategory": "usageTrusted", "updated": "2023-10-04T20:50:45.297Z" }, { "rule": "React-useRef", - "path": "ts/components/CallingToast.tsx", + "path": "ts/components/CallingToast.dom.tsx", "line": " const timeouts = React.useRef>(new Map());", "reasonCategory": "usageTrusted", "updated": "2023-10-10T17:05:02.468Z" }, { "rule": "React-useRef", - "path": "ts/components/CallingToast.tsx", + "path": "ts/components/CallingToast.dom.tsx", "line": " const timeoutsStatus = React.useRef<'active' | 'paused'>('active');", "reasonCategory": "usageTrusted", "updated": "2023-10-10T17:05:02.468Z" }, { "rule": "React-useRef", - "path": "ts/components/CallingToast.tsx", + "path": "ts/components/CallingToast.dom.tsx", "line": " const toastsShown = useRef>(new Set());", "reasonCategory": "usageTrusted", "updated": "2023-10-10T17:05:02.468Z" }, { "rule": "React-useRef", - "path": "ts/components/CallingToast.tsx", + "path": "ts/components/CallingToast.dom.tsx", "line": " const toastId = useRef(uuid());", "reasonCategory": "usageTrusted", "updated": "2023-11-14T16:52:45.342Z" }, { "rule": "React-useRef", - "path": "ts/components/CallingToastManager.tsx", + "path": "ts/components/CallingToastManager.dom.tsx", "line": " const toastRegionRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-10-26T13:57:41.860Z" }, { "rule": "React-useRef", - "path": "ts/components/CallingToastManager.tsx", + "path": "ts/components/CallingToastManager.dom.tsx", "line": " const toastLastShownAt = useRef(0);", "reasonCategory": "usageTrusted", "updated": "2024-01-12T18:56:18.138Z" }, { "rule": "React-useRef", - "path": "ts/components/CallingToastManager.tsx", + "path": "ts/components/CallingToastManager.dom.tsx", "line": " const handsForLastShownToast = useRef>(new Set());", "reasonCategory": "usageTrusted", "updated": "2024-01-12T18:56:18.138Z" }, { "rule": "React-useRef", - "path": "ts/components/CallsList.tsx", + "path": "ts/components/CallsList.preload.tsx", "line": " const infiniteLoaderRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-08-02T00:21:37.858Z" }, { "rule": "React-useRef", - "path": "ts/components/CallsList.tsx", + "path": "ts/components/CallsList.preload.tsx", "line": " const listRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-08-02T00:21:37.858Z" }, { "rule": "React-useRef", - "path": "ts/components/CallsList.tsx", + "path": "ts/components/CallsList.preload.tsx", "line": " const prevOptionsRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-08-18T19:09:30.283Z" }, { "rule": "React-useRef", - "path": "ts/components/CallsList.tsx", + "path": "ts/components/CallsList.preload.tsx", "line": " const getCallHistoryGroupsCountRef = useRef(getCallHistoryGroupsCount);", "reasonCategory": "usageTrusted", "updated": "2023-11-27T20:25:10.634Z" }, { "rule": "React-useRef", - "path": "ts/components/CallsList.tsx", + "path": "ts/components/CallsList.preload.tsx", "line": " const getCallHistoryGroupsRef = useRef(getCallHistoryGroups);", "reasonCategory": "usageTrusted", "updated": "2023-11-27T20:25:10.634Z" }, { "rule": "React-useRef", - "path": "ts/components/CallsList.tsx", + "path": "ts/components/CallsList.preload.tsx", "line": " const searchStateItemsRef = useRef | null>(", "reasonCategory": "usageTrusted", "updated": "2024-05-16T02:10:00.652Z" }, { "rule": "React-useRef", - "path": "ts/components/CallsList.tsx", + "path": "ts/components/CallsList.preload.tsx", "line": " const peekQueueRef = useRef>(new Set());", "reasonCategory": "usageTrusted", "updated": "2024-05-16T02:10:00.652Z" }, { "rule": "React-useRef", - "path": "ts/components/CallsList.tsx", + "path": "ts/components/CallsList.preload.tsx", "line": " const peekQueueArgsRef = useRef>(", "reasonCategory": "usageTrusted", "updated": "2024-05-16T02:10:00.652Z" }, { "rule": "React-useRef", - "path": "ts/components/CallsList.tsx", + "path": "ts/components/CallsList.preload.tsx", "line": " const inactiveCallLinksPeekedAtRef = useRef>(new Map());", "reasonCategory": "usageTrusted", "updated": "2024-05-16T02:10:00.652Z" }, { "rule": "React-useRef", - "path": "ts/components/CallsList.tsx", + "path": "ts/components/CallsList.preload.tsx", "line": " const peekQueueTimerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2024-05-16T02:10:00.652Z" }, { "rule": "React-useRef", - "path": "ts/components/CaptchaDialog.tsx", + "path": "ts/components/CaptchaDialog.dom.tsx", "line": " const buttonRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/ChatColorPicker.tsx", + "path": "ts/components/ChatColorPicker.dom.tsx", "line": " const menuRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/CompositionArea.tsx", + "path": "ts/components/CompositionArea.dom.tsx", "line": " const inputApiRef = useRef();", "reasonCategory": "usageTrusted", "updated": "2021-09-23T00:07:11.885Z" }, { "rule": "React-useRef", - "path": "ts/components/CompositionArea.tsx", + "path": "ts/components/CompositionArea.dom.tsx", "line": " const fileInputRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-09-23T00:07:11.885Z" }, { "rule": "React-useRef", - "path": "ts/components/CompositionInput.tsx", + "path": "ts/components/CompositionInput.dom.tsx", "line": " const callbacksRef = React.useRef(unstaleCallbacks);", "reasonCategory": "usageTrusted", "updated": "2021-04-21T21:35:38.757Z" }, { "rule": "React-useRef", - "path": "ts/components/CompositionInput.tsx", + "path": "ts/components/CompositionInput.dom.tsx", "line": " const emojiCompletionRef = React.useRef();", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/CompositionInput.tsx", + "path": "ts/components/CompositionInput.dom.tsx", "line": " const mentionCompletionRef = React.useRef();", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/CompositionInput.tsx", + "path": "ts/components/CompositionInput.dom.tsx", "line": " const quillRef = React.useRef();", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/CompositionInput.tsx", + "path": "ts/components/CompositionInput.dom.tsx", "line": " const propsRef = React.useRef(props);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/CompositionInput.tsx", + "path": "ts/components/CompositionInput.dom.tsx", "line": " const memberRepositoryRef = React.useRef(", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/CompositionInput.tsx", + "path": "ts/components/CompositionInput.dom.tsx", "line": " const canSendRef = React.useRef(false);", "reasonCategory": "usageTrusted", "updated": "2022-06-25T00:06:19.860Z", @@ -1214,91 +1214,91 @@ }, { "rule": "React-useRef", - "path": "ts/components/CompositionRecording.tsx", + "path": "ts/components/CompositionRecording.dom.tsx", "line": " const startTime = useRef(Date.now());", "reasonCategory": "usageTrusted", "updated": "2023-02-26T23:17:41.234Z" }, { "rule": "React-useRef", - "path": "ts/components/CompositionRecording.tsx", + "path": "ts/components/CompositionRecording.dom.tsx", "line": " const drift = useRef(0);", "reasonCategory": "usageTrusted", "updated": "2023-02-26T23:20:28.848Z" }, { "rule": "React-useRef", - "path": "ts/components/CompositionRecordingDraft.tsx", + "path": "ts/components/CompositionRecordingDraft.dom.tsx", "line": " const timeout = useRef(undefined);", "reasonCategory": "usageTrusted", "updated": "2023-02-26T23:20:28.848Z" }, { "rule": "React-useRef", - "path": "ts/components/CompositionTextArea.tsx", + "path": "ts/components/CompositionTextArea.dom.tsx", "line": " const inputApiRef = useRef();", "reasonCategory": "usageTrusted", "updated": "2025-04-01T21:15:44.903Z" }, { "rule": "React-useRef", - "path": "ts/components/ContactPills.tsx", + "path": "ts/components/ContactPills.dom.tsx", "line": " const elRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/ContextMenu.tsx", + "path": "ts/components/ContextMenu.dom.tsx", "line": " const virtualElement = useRef(generateVirtualElement(0, 0));", "reasonCategory": "usageTrusted", "updated": "2022-08-19T17:09:38.534Z" }, { "rule": "React-useRef", - "path": "ts/components/CustomizingPreferredReactionsModal.tsx", + "path": "ts/components/CustomizingPreferredReactionsModal.dom.tsx", "line": " const pickerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-04-07T19:15:28.908Z" }, { "rule": "React-useRef", - "path": "ts/components/DirectCallRemoteParticipant.tsx", + "path": "ts/components/DirectCallRemoteParticipant.dom.tsx", "line": " const remoteVideoRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/EditHistoryMessagesModal.tsx", + "path": "ts/components/EditHistoryMessagesModal.dom.tsx", "line": " const containerElementRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-03-25T01:59:04.590Z" }, { "rule": "React-useRef", - "path": "ts/components/ForwardMessagesModal.tsx", + "path": "ts/components/ForwardMessagesModal.dom.tsx", "line": " const inputRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/GradientDial.tsx", + "path": "ts/components/GradientDial.dom.tsx", "line": " const containerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/GroupCallOverflowArea.tsx", + "path": "ts/components/GroupCallOverflowArea.dom.tsx", "line": " const overflowRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/GroupCallRemoteParticipant.tsx", + "path": "ts/components/GroupCallRemoteParticipant.dom.tsx", "line": " const lastReceivedVideoAt = useRef(-Infinity);", "reasonCategory": "usageTrusted", "updated": "2021-06-17T20:46:02.342Z", @@ -1306,21 +1306,21 @@ }, { "rule": "React-useRef", - "path": "ts/components/GroupCallRemoteParticipant.tsx", + "path": "ts/components/GroupCallRemoteParticipant.dom.tsx", "line": " const remoteVideoRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/GroupCallRemoteParticipant.tsx", + "path": "ts/components/GroupCallRemoteParticipant.dom.tsx", "line": " const canvasContextRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/GroupCallRemoteParticipant.tsx", + "path": "ts/components/GroupCallRemoteParticipant.dom.tsx", "line": " const imageDataRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-12-10T23:24:31.237Z", @@ -1328,14 +1328,14 @@ }, { "rule": "React-useRef", - "path": "ts/components/ImageOrBlurhash.tsx", + "path": "ts/components/ImageOrBlurhash.dom.tsx", "line": " const ref = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-08-05T17:07:11.678Z" }, { "rule": "React-useRef", - "path": "ts/components/IncomingCallBar.tsx", + "path": "ts/components/IncomingCallBar.dom.tsx", "line": " const initialTitleRef = useRef(title);", "reasonCategory": "usageTrusted", "updated": "2021-08-16T20:52:11.043Z", @@ -1343,77 +1343,77 @@ }, { "rule": "React-useRef", - "path": "ts/components/Input.tsx", + "path": "ts/components/Input.dom.tsx", "line": " const innerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/Input.tsx", + "path": "ts/components/Input.dom.tsx", "line": " const valueOnKeydownRef = useRef(value);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/Input.tsx", + "path": "ts/components/Input.dom.tsx", "line": " const selectionStartOnKeydownRef = useRef(value.length);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/LeftPane.tsx", + "path": "ts/components/LeftPane.dom.tsx", "line": " const measureRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-08-09T21:48:42.602Z" }, { "rule": "React-useRef", - "path": "ts/components/LeftPaneSearchInput.tsx", + "path": "ts/components/LeftPaneSearchInput.dom.tsx", "line": " const inputRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2022-02-11T20:49:03.879Z" }, { "rule": "React-useRef", - "path": "ts/components/Lightbox.tsx", + "path": "ts/components/Lightbox.dom.tsx", "line": " const containerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-08-23T18:39:37.081Z" }, { "rule": "React-useRef", - "path": "ts/components/Lightbox.tsx", + "path": "ts/components/Lightbox.dom.tsx", "line": " const imageRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-09-24T00:03:36.061Z" }, { "rule": "React-useRef", - "path": "ts/components/Lightbox.tsx", + "path": "ts/components/Lightbox.dom.tsx", "line": " const animateRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-10-11T21:21:08.188Z" }, { "rule": "React-useRef", - "path": "ts/components/Lightbox.tsx", + "path": "ts/components/Lightbox.dom.tsx", "line": " const dragCacheRef = useRef<", "reasonCategory": "usageTrusted", "updated": "2021-10-11T21:21:08.188Z" }, { "rule": "React-useRef", - "path": "ts/components/Lightbox.tsx", + "path": "ts/components/Lightbox.dom.tsx", "line": " const zoomCacheRef = useRef<", "reasonCategory": "usageTrusted", "updated": "2021-10-11T21:21:08.188Z" }, { "rule": "React-useRef", - "path": "ts/components/Lightbox.tsx", + "path": "ts/components/Lightbox.dom.tsx", "line": " const downloadToastTimeout = useRef();", "reasonCategory": "usageTrusted", "updated": "2025-01-06T03:53:58.093Z", @@ -1421,21 +1421,21 @@ }, { "rule": "React-useRef", - "path": "ts/components/ListView.tsx", + "path": "ts/components/ListView.dom.tsx", "line": " const listRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2022-11-11T17:11:07.659Z" }, { "rule": "React-useRef", - "path": "ts/components/MediaEditor.tsx", + "path": "ts/components/MediaEditor.dom.tsx", "line": " const inputApiRef = useRef();", "reasonCategory": "usageTrusted", "updated": "2023-09-11T20:19:18.681Z" }, { "rule": "React-useRef", - "path": "ts/components/MediaEditor.tsx", + "path": "ts/components/MediaEditor.dom.tsx", "line": " const tryClose = useRef<() => void | undefined>();", "reasonCategory": "usageTrusted", "updated": "2025-05-19T22:29:15.758Z", @@ -1443,7 +1443,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/MediaQualitySelector.tsx", + "path": "ts/components/MediaQualitySelector.dom.tsx", "line": " const buttonRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2022-06-14T22:04:43.988Z", @@ -1451,35 +1451,35 @@ }, { "rule": "React-useRef", - "path": "ts/components/Modal.tsx", + "path": "ts/components/Modal.dom.tsx", "line": " const modalRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-08-05T00:22:31.660Z" }, { "rule": "React-useRef", - "path": "ts/components/Modal.tsx", + "path": "ts/components/Modal.dom.tsx", "line": " const bodyRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-07-25T21:55:26.191Z" }, { "rule": "React-useRef", - "path": "ts/components/Modal.tsx", + "path": "ts/components/Modal.dom.tsx", "line": " const bodyInnerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-07-25T21:55:26.191Z" }, { "rule": "React-useRef", - "path": "ts/components/ModalContainer.tsx", + "path": "ts/components/ModalContainer.dom.tsx", "line": " const containerRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2022-10-14T16:39:48.461Z" }, { "rule": "React-useRef", - "path": "ts/components/ModalHost.tsx", + "path": "ts/components/ModalHost.dom.tsx", "line": " const containerRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2022-09-14T16:20:15.384Z", @@ -1487,14 +1487,14 @@ }, { "rule": "React-useRef", - "path": "ts/components/Preferences.tsx", + "path": "ts/components/Preferences.dom.tsx", "line": " const settingsPaneRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-04-21T02:12:22.352Z" }, { "rule": "React-useRef", - "path": "ts/components/PreferencesDonateFlow.tsx", + "path": "ts/components/PreferencesDonateFlow.dom.tsx", "line": " const tryClose = useRef<() => void | undefined>();", "reasonCategory": "usageTrusted", "updated": "2025-06-26T23:23:57.292Z", @@ -1502,14 +1502,14 @@ }, { "rule": "React-useRef", - "path": "ts/components/PreferencesInternal.tsx", + "path": "ts/components/PreferencesInternal.dom.tsx", "line": " const prevAbortControlerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-08-20T18:18:34.081Z" }, { "rule": "React-useRef", - "path": "ts/components/PreferencesLocalBackups.tsx", + "path": "ts/components/PreferencesLocalBackups.dom.tsx", "line": " const backupKeyTextareaRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-05-30T22:48:14.420Z", @@ -1517,7 +1517,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/PreferencesNotificationProfiles.tsx", + "path": "ts/components/PreferencesNotificationProfiles.dom.tsx", "line": " const tryClose = React.useRef<() => void | undefined>();", "reasonCategory": "usageTrusted", "updated": "2025-08-25T21:04:21.643Z", @@ -1525,7 +1525,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/PreferencesNotificationProfiles.tsx", + "path": "ts/components/PreferencesNotificationProfiles.dom.tsx", "line": " const selectedHour = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-09-05T21:41:09.931Z", @@ -1533,7 +1533,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/PreferencesNotificationProfiles.tsx", + "path": "ts/components/PreferencesNotificationProfiles.dom.tsx", "line": " const selectedMinute = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-09-05T21:41:09.931Z", @@ -1541,14 +1541,14 @@ }, { "rule": "React-useRef", - "path": "ts/components/ProfileEditor.tsx", + "path": "ts/components/ProfileEditor.dom.tsx", "line": " const focusInputRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/ProfileEditor.tsx", + "path": "ts/components/ProfileEditor.dom.tsx", "line": " const tryClose = useRef<() => void | undefined>();", "reasonCategory": "usageTrusted", "updated": "2025-05-24T03:23:25.769Z", @@ -1556,7 +1556,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/QrCode.tsx", + "path": "ts/components/QrCode.dom.tsx", "line": " const elRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2022-01-04T21:43:17.517Z", @@ -1564,49 +1564,49 @@ }, { "rule": "React-useRef", - "path": "ts/components/SafetyTipsModal.tsx", + "path": "ts/components/SafetyTipsModal.dom.tsx", "line": " const scrollEndTimer = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2024-03-08T01:48:15.330Z" }, { "rule": "React-useRef", - "path": "ts/components/Slider.tsx", + "path": "ts/components/Slider.dom.tsx", "line": " const diff = useRef(0);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/Slider.tsx", + "path": "ts/components/Slider.dom.tsx", "line": " const handleRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/Slider.tsx", + "path": "ts/components/Slider.dom.tsx", "line": " const sliderRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/StandaloneRegistration.tsx", + "path": "ts/components/StandaloneRegistration.dom.tsx", "line": " const elemRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-11-30T10:15:33.662Z" }, { "rule": "React-useRef", - "path": "ts/components/StandaloneRegistration.tsx", + "path": "ts/components/StandaloneRegistration.dom.tsx", "line": " const pluginRef = useRef();", "reasonCategory": "usageTrusted", "updated": "2024-11-16T00:33:41.092Z" }, { "rule": "React-useRef", - "path": "ts/components/StoriesSettingsModal.tsx", + "path": "ts/components/StoriesSettingsModal.dom.tsx", "line": " const tryClose = useRef<() => void | undefined>();", "reasonCategory": "usageTrusted", "updated": "2025-05-19T22:29:15.758Z", @@ -1614,49 +1614,49 @@ }, { "rule": "React-useRef", - "path": "ts/components/StoryImage.tsx", + "path": "ts/components/StoryImage.dom.tsx", "line": " const videoRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2022-04-29T23:54:21.656Z" }, { "rule": "React-useRef", - "path": "ts/components/StoryProgressSegment.tsx", + "path": "ts/components/StoryProgressSegment.dom.tsx", "line": " const onFinishRef = useRef(onFinish);", "reasonCategory": "usageTrusted", "updated": "2024-08-13T20:48:09.226Z" }, { "rule": "React-useRef", - "path": "ts/components/StoryViewsNRepliesModal.tsx", + "path": "ts/components/StoryViewsNRepliesModal.dom.tsx", "line": " const inputApiRef = useRef();", "reasonCategory": "usageTrusted", "updated": "2022-02-15T17:57:06.507Z" }, { "rule": "React-useRef", - "path": "ts/components/StoryViewsNRepliesModal.tsx", + "path": "ts/components/StoryViewsNRepliesModal.dom.tsx", "line": " const containerElementRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2022-08-04T00:52:01.080Z" }, { "rule": "React-useRef", - "path": "ts/components/StoryViewsNRepliesModal.tsx", + "path": "ts/components/StoryViewsNRepliesModal.dom.tsx", "line": " const shouldScrollToBottomRef = useRef(true);", "reasonCategory": "usageTrusted", "updated": "2022-10-05T18:51:56.411Z" }, { "rule": "React-useRef", - "path": "ts/components/StoryViewsNRepliesModal.tsx", + "path": "ts/components/StoryViewsNRepliesModal.dom.tsx", "line": " const bottomRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2022-10-05T18:51:56.411Z" }, { "rule": "React-useRef", - "path": "ts/components/StoryViewsNRepliesModal.tsx", + "path": "ts/components/StoryViewsNRepliesModal.dom.tsx", "line": " const tryClose = useRef<() => void | undefined>();", "reasonCategory": "usageTrusted", "updated": "2025-05-19T23:20:52.448Z", @@ -1664,35 +1664,35 @@ }, { "rule": "React-useRef", - "path": "ts/components/TextAttachment.tsx", + "path": "ts/components/TextAttachment.dom.tsx", "line": " const linkPreview = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2022-04-06T00:59:17.194Z" }, { "rule": "React-useRef", - "path": "ts/components/TextAttachment.tsx", + "path": "ts/components/TextAttachment.dom.tsx", "line": " const textEditorRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2022-06-16T23:23:32.306Z" }, { "rule": "React-useRef", - "path": "ts/components/TextAttachment.tsx", + "path": "ts/components/TextAttachment.dom.tsx", "line": " const ref = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-07-25T21:55:26.191Z" }, { "rule": "React-useRef", - "path": "ts/components/TextStoryCreator.tsx", + "path": "ts/components/TextStoryCreator.dom.tsx", "line": " const textEditorRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2022-06-16T23:23:32.306Z" }, { "rule": "React-useRef", - "path": "ts/components/TextStoryCreator.tsx", + "path": "ts/components/TextStoryCreator.dom.tsx", "line": " const tryClose = useRef<() => void | undefined>();", "reasonCategory": "usageTrusted", "updated": "2025-05-19T22:29:15.758Z", @@ -1700,21 +1700,21 @@ }, { "rule": "React-useRef", - "path": "ts/components/Tooltip.tsx", + "path": "ts/components/Tooltip.dom.tsx", "line": " const wrapperRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/Tooltip.tsx", + "path": "ts/components/Tooltip.dom.tsx", "line": " const timeoutRef = useRef();", "reasonCategory": "usageTrusted", "updated": "2023-08-10T00:23:35.320Z" }, { "rule": "React-useRef", - "path": "ts/components/UsernameEditor.tsx", + "path": "ts/components/UsernameEditor.dom.tsx", "line": " const tryClose = useRef<() => void | undefined>();", "reasonCategory": "usageTrusted", "updated": "2025-05-28T00:57:39.376Z", @@ -1722,7 +1722,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/UsernameLinkEditor.tsx", + "path": "ts/components/UsernameLinkEditor.dom.tsx", "line": " const tryClose = useRef<() => void | undefined>();", "reasonCategory": "usageTrusted", "updated": "2025-05-28T00:57:39.376Z", @@ -1730,49 +1730,49 @@ }, { "rule": "React-useRef", - "path": "ts/components/conversation/CallingNotification.tsx", + "path": "ts/components/conversation/CallingNotification.dom.tsx", "line": " const menuTriggerRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-12-08T20:28:57.595Z" }, { "rule": "React-useRef", - "path": "ts/components/conversation/ConversationHeader.tsx", + "path": "ts/components/conversation/ConversationHeader.dom.tsx", "line": " const menuTriggerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2024-03-15T18:29:48.327Z" }, { "rule": "React-useRef", - "path": "ts/components/conversation/ConversationHeader.tsx", + "path": "ts/components/conversation/ConversationHeader.dom.tsx", "line": " const headerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2024-03-15T18:29:48.327Z" }, { "rule": "React-useRef", - "path": "ts/components/conversation/GIF.tsx", + "path": "ts/components/conversation/GIF.dom.tsx", "line": " const videoRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/conversation/GroupDescription.tsx", + "path": "ts/components/conversation/GroupDescription.dom.tsx", "line": " const textRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/conversation/InlineNotificationWrapper.tsx", + "path": "ts/components/conversation/InlineNotificationWrapper.dom.tsx", "line": " const focusRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-04-12T15:51:28.066Z" }, { "rule": "React-createRef", - "path": "ts/components/conversation/Message.tsx", + "path": "ts/components/conversation/Message.dom.tsx", "line": " React.createRef();", "reasonCategory": "usageTrusted", "updated": "2021-03-05T19:57:01.431Z", @@ -1780,7 +1780,7 @@ }, { "rule": "React-createRef", - "path": "ts/components/conversation/Message.tsx", + "path": "ts/components/conversation/Message.dom.tsx", "line": " public focusRef: React.RefObject = React.createRef();", "reasonCategory": "usageTrusted", "updated": "2021-03-05T19:57:01.431Z", @@ -1788,7 +1788,7 @@ }, { "rule": "React-createRef", - "path": "ts/components/conversation/Message.tsx", + "path": "ts/components/conversation/Message.dom.tsx", "line": " public audioButtonRef: React.RefObject = React.createRef();", "reasonCategory": "usageTrusted", "updated": "2021-03-05T19:57:01.431Z", @@ -1796,7 +1796,7 @@ }, { "rule": "React-createRef", - "path": "ts/components/conversation/Message.tsx", + "path": "ts/components/conversation/Message.dom.tsx", "line": " #metadataRef: React.RefObject = React.createRef();", "reasonCategory": "usageTrusted", "updated": "2023-06-30T22:12:49.259Z", @@ -1804,7 +1804,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/conversation/Message.tsx", + "path": "ts/components/conversation/Message.dom.tsx", "line": " const reactionsContainerRefMerger = useRef(createRefMerger());", "reasonCategory": "usageTrusted", "updated": "2025-06-05T12:55:51.245Z", @@ -1812,7 +1812,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/conversation/MessageDetail.tsx", + "path": "ts/components/conversation/MessageDetail.dom.tsx", "line": " const messageDetailRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-09-11T22:53:43.464Z", @@ -1820,7 +1820,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/conversation/Quote.tsx", + "path": "ts/components/conversation/Quote.dom.tsx", "line": " const imageRef = useRef(new Image());", "reasonCategory": "usageTrusted", "updated": "2021-01-20T21:30:08.430Z", @@ -1828,14 +1828,14 @@ }, { "rule": "React-useRef", - "path": "ts/components/conversation/TimelineMessage.tsx", + "path": "ts/components/conversation/TimelineMessage.dom.tsx", "line": " const menuTriggerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-12-08T20:28:57.595Z" }, { "rule": "React-useRef", - "path": "ts/components/conversation/TypingBubble.tsx", + "path": "ts/components/conversation/TypingBubble.dom.tsx", "line": " const prevTypingContactIds = React.useRef<", "reasonCategory": "usageTrusted", "updated": "2023-09-28T21:48:57.488Z", @@ -1843,42 +1843,42 @@ }, { "rule": "React-useRef", - "path": "ts/components/conversation/WaveformScrubber.tsx", + "path": "ts/components/conversation/WaveformScrubber.dom.tsx", "line": " const waveformRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-02-26T23:20:28.848Z" }, { "rule": "React-useRef", - "path": "ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx", + "path": "ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.dom.tsx", "line": " const inputRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx", + "path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.dom.tsx", "line": " const focusDescriptionRef = useRef(", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx", + "path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.dom.tsx", "line": " const startingTitleRef = useRef(externalTitle);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx", + "path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.dom.tsx", "line": " const startingAvatarUrlRef = useRef(externalAvatarUrl);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx", + "path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.dom.tsx", "line": " const tryClose = useRef<() => void | undefined>();", "reasonCategory": "usageTrusted", "updated": "2025-05-19T23:20:52.448Z", @@ -1886,7 +1886,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/conversation/media-gallery/MediaGallery.tsx", + "path": "ts/components/conversation/media-gallery/MediaGallery.dom.tsx", "line": " const focusRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2019-11-01T22:46:33.013Z", @@ -1894,7 +1894,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/conversation/media-gallery/MediaGallery.tsx", + "path": "ts/components/conversation/media-gallery/MediaGallery.dom.tsx", "line": " const loadingRef = useRef(false);", "reasonCategory": "usageTrusted", "updated": "2024-09-03T00:45:23.978Z", @@ -1902,7 +1902,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/conversation/media-gallery/MediaGallery.tsx", + "path": "ts/components/conversation/media-gallery/MediaGallery.dom.tsx", "line": " const intersectionObserver = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2024-09-03T00:45:23.978Z", @@ -1910,7 +1910,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/conversation/media-gallery/MediaGallery.tsx", + "path": "ts/components/conversation/media-gallery/MediaGallery.dom.tsx", "line": " const scrollObserverRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2024-09-03T00:45:23.978Z", @@ -1918,7 +1918,7 @@ }, { "rule": "React-useRef", - "path": "ts/components/conversation/media-gallery/MediaGallery.tsx", + "path": "ts/components/conversation/media-gallery/MediaGallery.dom.tsx", "line": " const tabViewRef = useRef(TabViews.Media);", "reasonCategory": "usageTrusted", "updated": "2024-09-03T00:45:23.978Z", @@ -1926,210 +1926,210 @@ }, { "rule": "React-useRef", - "path": "ts/components/fun/FunGif.tsx", + "path": "ts/components/fun/FunGif.dom.tsx", "line": " const ref = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-03-21T23:22:07.920Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/FunGif.tsx", + "path": "ts/components/fun/FunGif.dom.tsx", "line": " const timerRef = useRef>();", "reasonCategory": "usageTrusted", "updated": "2025-03-21T23:22:07.920Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/FunGif.tsx", + "path": "ts/components/fun/FunGif.dom.tsx", "line": " const videoRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-03-24T18:57:50.198Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/base/FunImage.tsx", + "path": "ts/components/fun/base/FunImage.dom.tsx", "line": " const imageRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/base/FunScroller.tsx", + "path": "ts/components/fun/base/FunScroller.dom.tsx", "line": " const scrollerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/base/FunScroller.tsx", + "path": "ts/components/fun/base/FunScroller.dom.tsx", "line": " const scrollerInnerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/base/FunScroller.tsx", + "path": "ts/components/fun/base/FunScroller.dom.tsx", "line": " const observerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/base/FunScroller.tsx", + "path": "ts/components/fun/base/FunScroller.dom.tsx", "line": " const onScrollChangeRef = useRef(props.onScrollSectionChange);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/base/FunScroller.tsx", + "path": "ts/components/fun/base/FunScroller.dom.tsx", "line": " const ref = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/base/FunSubNav.tsx", + "path": "ts/components/fun/base/FunSubNav.dom.tsx", "line": " const outerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/base/FunSubNav.tsx", + "path": "ts/components/fun/base/FunSubNav.dom.tsx", "line": " const innerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/base/FunSubNav.tsx", + "path": "ts/components/fun/base/FunSubNav.dom.tsx", "line": " const ref = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/base/FunTooltip.tsx", + "path": "ts/components/fun/base/FunTooltip.dom.tsx", "line": " const ref = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-05-30T20:26:57.154Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/data/infinite.ts", + "path": "ts/components/fun/data/infinite.std.ts", "line": " const loaderRef = useRef(options.loader);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/data/infinite.ts", + "path": "ts/components/fun/data/infinite.std.ts", "line": " const hasNextPageRef = useRef(options.hasNextPage);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/data/infinite.ts", + "path": "ts/components/fun/data/infinite.std.ts", "line": " const querySignalRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/data/infinite.ts", + "path": "ts/components/fun/data/infinite.std.ts", "line": " const stateRef = useRef(state);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/keyboard/FunKeyboard.tsx", + "path": "ts/components/fun/keyboard/FunKeyboard.dom.tsx", "line": " const keyboardRef = useRef(props.keyboard);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/keyboard/FunKeyboard.tsx", + "path": "ts/components/fun/keyboard/FunKeyboard.dom.tsx", "line": " const onStateChangeRef = useRef(props.onStateChange);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/panels/FunPanelEmojis.tsx", + "path": "ts/components/fun/panels/FunPanelEmojis.dom.tsx", "line": " const scrollerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/panels/FunPanelEmojis.tsx", + "path": "ts/components/fun/panels/FunPanelEmojis.dom.tsx", "line": " const popoverTriggerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-04-10T18:24:54.606Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/panels/FunPanelGifs.tsx", + "path": "ts/components/fun/panels/FunPanelGifs.dom.tsx", "line": " const scrollerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/fun/panels/FunPanelStickers.tsx", + "path": "ts/components/fun/panels/FunPanelStickers.dom.tsx", "line": " const scrollerRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-02-19T20:14:46.879Z" }, { "rule": "React-useRef", - "path": "ts/components/preferences/chatFolders/PreferencesEditChatFoldersPage.tsx", + "path": "ts/components/preferences/chatFolders/PreferencesEditChatFoldersPage.dom.tsx", "line": " const didSaveOrDiscardChangesRef = useRef(false);", "reasonCategory": "usageTrusted", "updated": "2025-09-24T17:08:10.620Z" }, { "rule": "React-useRef", - "path": "ts/components/preferences/chatFolders/PreferencesEditChatFoldersPage.tsx", + "path": "ts/components/preferences/chatFolders/PreferencesEditChatFoldersPage.dom.tsx", "line": " const inputRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-10-09T23:03:57.441Z" }, { "rule": "React-useRef", - "path": "ts/components/preferences/donations/DonateInputAmount.tsx", + "path": "ts/components/preferences/donations/DonateInputAmount.dom.tsx", "line": " const inputRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-08-01T20:31:42.993Z" }, { "rule": "React-useRef", - "path": "ts/components/preferences/donations/DonateInputCardCvc.tsx", + "path": "ts/components/preferences/donations/DonateInputCardCvc.dom.tsx", "line": " const inputRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-07-17T19:33:27.401Z" }, { "rule": "React-useRef", - "path": "ts/components/preferences/donations/DonateInputCardExp.tsx", + "path": "ts/components/preferences/donations/DonateInputCardExp.dom.tsx", "line": " const inputRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-07-17T19:33:27.401Z" }, { "rule": "React-useRef", - "path": "ts/components/preferences/donations/DonateInputCardNumber.tsx", + "path": "ts/components/preferences/donations/DonateInputCardNumber.dom.tsx", "line": " const inputRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2025-07-17T19:33:27.401Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useConfirmDiscard.tsx", + "path": "ts/hooks/useConfirmDiscard.dom.tsx", "line": " const confirmDiscardPromise = useRef<", "reasonCategory": "usageTrusted", "updated": "2025-05-19T22:29:15.758Z", @@ -2137,126 +2137,126 @@ }, { "rule": "React-useRef", - "path": "ts/hooks/useIntersectionObserver.ts", + "path": "ts/hooks/useIntersectionObserver.std.ts", "line": " const unobserveRef = useRef<(() => unknown) | null>(null);", "reasonCategory": "usageTrusted", "updated": "2021-09-17T20:16:37.959Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useIsMounted.ts", + "path": "ts/hooks/useIsMounted.std.ts", "line": " const isMounted = useRef(false);", "reasonCategory": "usageTrusted", "updated": "2023-10-04T20:50:45.297Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useNavBlocker.ts", + "path": "ts/hooks/useNavBlocker.std.ts", "line": " const nameRef = useRef(name);", "reasonCategory": "usageTrusted", "updated": "2025-09-24T17:08:10.620Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useNavBlocker.ts", + "path": "ts/hooks/useNavBlocker.std.ts", "line": " const shouldBlockRef = useRef(shouldBlock);", "reasonCategory": "usageTrusted", "updated": "2025-09-24T17:08:10.620Z" }, { "rule": "React-useRef", - "path": "ts/hooks/usePrevious.ts", + "path": "ts/hooks/usePrevious.std.ts", "line": " const previousValueRef = useRef(initialValue);", "reasonCategory": "usageTrusted", "updated": "2021-09-17T20:16:37.959Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useRestoreFocus.ts", + "path": "ts/hooks/useRestoreFocus.dom.ts", "line": " const toFocusRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useRestoreFocus.ts", + "path": "ts/hooks/useRestoreFocus.dom.ts", "line": " const lastFocusedRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-07-30T16:57:33.618Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useRestoreFocus.ts", + "path": "ts/hooks/useRestoreFocus.dom.ts", "line": " const toFocusRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-10-22T00:52:39.251Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useRestoreFocus.ts", + "path": "ts/hooks/useRestoreFocus.dom.ts", "line": " const lastFocusedRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2021-10-22T00:52:39.251Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useScrollLock.tsx", + "path": "ts/hooks/useScrollLock.dom.tsx", "line": " const onUserInterruptRef = useRef(onUserInterrupt);", "reasonCategory": "usageTrusted", "updated": "2023-09-19T17:05:51.321Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useSizeObserver.tsx", + "path": "ts/hooks/useSizeObserver.dom.tsx", "line": " const sizeRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-07-25T21:55:26.191Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useSizeObserver.tsx", + "path": "ts/hooks/useSizeObserver.dom.tsx", "line": " const onSizeChangeRef = useRef(onSizeChange);", "reasonCategory": "usageTrusted", "updated": "2023-07-25T21:55:26.191Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useSizeObserver.tsx", + "path": "ts/hooks/useSizeObserver.dom.tsx", "line": " const ref = useRef();", "reasonCategory": "usageTrusted", "updated": "2023-07-25T21:55:26.191Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useSizeObserver.tsx", + "path": "ts/hooks/useSizeObserver.dom.tsx", "line": " * const scrollerRef = useRef()", "reasonCategory": "usageTrusted", "updated": "2023-07-25T21:55:26.191Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useSizeObserver.tsx", + "path": "ts/hooks/useSizeObserver.dom.tsx", "line": " * const scrollerInnerRef = useRef()", "reasonCategory": "usageTrusted", "updated": "2023-07-25T21:55:26.191Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useSizeObserver.tsx", + "path": "ts/hooks/useSizeObserver.dom.tsx", "line": " const scrollRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-07-25T21:55:26.191Z" }, { "rule": "React-useRef", - "path": "ts/hooks/useSizeObserver.tsx", + "path": "ts/hooks/useSizeObserver.dom.tsx", "line": " const onScrollChangeRef = useRef(onScrollChange);", "reasonCategory": "usageTrusted", "updated": "2023-07-25T21:55:26.191Z" }, { "rule": "React-useRef", - "path": "ts/quill/formatting/menu.tsx", + "path": "ts/quill/formatting/menu.dom.tsx", "line": " const buttonRef = React.useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-04-22T00:07:56.294Z", @@ -2264,7 +2264,7 @@ }, { "rule": "React-useRef", - "path": "ts/quill/formatting/menu.tsx", + "path": "ts/quill/formatting/menu.dom.tsx", "line": " const fadeOutTimerRef = React.useRef();", "reasonCategory": "usageTrusted", "updated": "2023-08-02T19:01:24.771Z", @@ -2272,7 +2272,7 @@ }, { "rule": "React-useRef", - "path": "ts/quill/formatting/menu.tsx", + "path": "ts/quill/formatting/menu.dom.tsx", "line": " const hoverTimerRef = React.useRef();", "reasonCategory": "usageTrusted", "updated": "2023-08-02T19:01:24.771Z", @@ -2280,7 +2280,7 @@ }, { "rule": "DOM-innerHTML", - "path": "ts/quill/signal-clipboard/util.ts", + "path": "ts/quill/signal-clipboard/util.dom.ts", "line": " event.clipboardData?.setData('text/signal', container.innerHTML);", "reasonCategory": "regexMatchedSafeCode", "updated": "2023-06-02T00:37:19.861Z", @@ -2288,42 +2288,42 @@ }, { "rule": "React-useRef", - "path": "ts/state/smart/ChatsTab.tsx", + "path": "ts/state/smart/ChatsTab.preload.tsx", "line": " const lastOpenedConversationId = useRef();", "reasonCategory": "usageTrusted", "updated": "2023-08-25T17:37:23.002Z" }, { "rule": "React-useRef", - "path": "ts/state/smart/ConversationPanel.tsx", + "path": "ts/state/smart/ConversationPanel.preload.tsx", "line": " const animateRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-07-13T23:34:39.367Z" }, { "rule": "React-useRef", - "path": "ts/state/smart/ConversationPanel.tsx", + "path": "ts/state/smart/ConversationPanel.preload.tsx", "line": " const overlayRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-07-13T23:34:39.367Z" }, { "rule": "React-useRef", - "path": "ts/state/smart/ConversationPanel.tsx", + "path": "ts/state/smart/ConversationPanel.preload.tsx", "line": " const focusRef = useRef(null);", "reasonCategory": "usageTrusted", "updated": "2023-07-13T23:34:39.367Z" }, { "rule": "React-useRef", - "path": "ts/state/smart/ConversationPanel.tsx", + "path": "ts/state/smart/ConversationPanel.preload.tsx", "line": " const wasAnimatedRef = useRef(wasAnimated);", "reasonCategory": "usageTrusted", "updated": "2023-08-20T22:14:52.008Z" }, { "rule": "DOM-innerHTML", - "path": "ts/windows/loading/start.ts", + "path": "ts/windows/loading/start.dom.ts", "line": " message.innerHTML = window.SignalContext.i18n('icu:optimizingApplication');", "reasonCategory": "usageTrusted", "updated": "2021-09-17T21:02:59.414Z" diff --git a/ts/util/lint/license_comments.node.ts b/ts/util/lint/license_comments.node.ts index 35aea69e5c..9da419c73e 100644 --- a/ts/util/lint/license_comments.node.ts +++ b/ts/util/lint/license_comments.node.ts @@ -64,7 +64,7 @@ const FILES_TO_IGNORE = new Set( 'js/calling-tools/timeline_graph_view.js', 'js/calling-tools/user_media_table.js', 'js/calling-tools/util.js', - 'js/calling-tools/webrtc_internals.js', + 'js/calling-tools/webrtc_internals.dom.js', ].map( // This makes sure the files are correct on Windows. path.normalize diff --git a/ts/util/sessionTranslation.node.ts b/ts/util/sessionTranslation.node.ts index d74324d56e..3b001c8b9f 100644 --- a/ts/util/sessionTranslation.node.ts +++ b/ts/util/sessionTranslation.node.ts @@ -3,7 +3,7 @@ import lodash from 'lodash'; -import { signal } from '../protobuf/compiled.js'; +import { signal } from '../protobuf/compiled.std.js'; import * as Bytes from '../Bytes.std.js'; import { deriveSecrets } from '../Crypto.node.js'; diff --git a/ts/windows/calling-tools/webrtc_internals.std.ts b/ts/windows/calling-tools/webrtc_internals.dom.ts similarity index 58% rename from ts/windows/calling-tools/webrtc_internals.std.ts rename to ts/windows/calling-tools/webrtc_internals.dom.ts index e604f0dbb1..8a27fb3dc2 100644 --- a/ts/windows/calling-tools/webrtc_internals.std.ts +++ b/ts/windows/calling-tools/webrtc_internals.dom.ts @@ -1,4 +1,4 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import '../../../js/calling-tools/webrtc_internals.js'; +import '../../../js/calling-tools/webrtc_internals.dom.js'; diff --git a/ts/windows/main/phase3-post-signal.std.ts b/ts/windows/main/phase3-post-signal.preload.ts similarity index 100% rename from ts/windows/main/phase3-post-signal.std.ts rename to ts/windows/main/phase3-post-signal.preload.ts diff --git a/ts/windows/main/phase4-test.preload.ts b/ts/windows/main/phase4-test.preload.ts index 2a563e6a0b..2d20b6d556 100644 --- a/ts/windows/main/phase4-test.preload.ts +++ b/ts/windows/main/phase4-test.preload.ts @@ -11,14 +11,14 @@ export {}; if (config.environment === 'test') { console.log('Importing test infrastructure...'); - require('./preload_test.js'); + require('./preload_test.preload.js'); } if (config.ciMode) { console.log( `Importing CI infrastructure; enabled in config, mode: ${config.ciMode}` ); - const { getCI } = require('../../CI.js'); + const { getCI } = require('../../CI.preload.js'); window.SignalCI = getCI({ deviceName: window.getTitle(), forceUnprocessed: config.ciForceUnprocessed, diff --git a/ts/windows/main/preload.preload.ts b/ts/windows/main/preload.preload.ts index 3456a44374..1d3f3bb40d 100644 --- a/ts/windows/main/preload.preload.ts +++ b/ts/windows/main/preload.preload.ts @@ -10,7 +10,7 @@ const log = createLogger('preload'); window.preloadStartTime = Date.now(); try { - require('./start.js'); + require('./start.preload.js'); } catch (error) { /* eslint-disable no-console */ console.log('preload error!', error.stack); diff --git a/ts/windows/main/preload_test.preload.ts b/ts/windows/main/preload_test.preload.ts index d310f2c84b..04bf430152 100644 --- a/ts/windows/main/preload_test.preload.ts +++ b/ts/windows/main/preload_test.preload.ts @@ -146,7 +146,7 @@ window.testUtilities = { prepareTests() { console.log('Preparing tests...'); - const files = sync('../../test-{both,electron}/**/*_test.js', { + const files = sync('../../test-{both,electron}/**/*_test.*.js', { absolute: true, cwd: __dirname, }); diff --git a/ts/windows/main/start.preload.ts b/ts/windows/main/start.preload.ts index 25b646ecfb..c26ff961a8 100644 --- a/ts/windows/main/start.preload.ts +++ b/ts/windows/main/start.preload.ts @@ -15,7 +15,7 @@ import './phase0-devtools.node.js'; import './phase1-ipc.preload.js'; import '../preload.preload.js'; import './phase2-dependencies.preload.js'; -import './phase3-post-signal.std.js'; +import './phase3-post-signal.preload.js'; import './phase4-test.preload.js'; import type { diff --git a/ts/workers/heicConverterMain.main.ts b/ts/workers/heicConverterMain.main.ts index e96003bb56..9a8034b2d2 100644 --- a/ts/workers/heicConverterMain.main.ts +++ b/ts/workers/heicConverterMain.main.ts @@ -24,7 +24,7 @@ export function getHeicConverter(): ( app.getAppPath(), 'ts', 'workers', - 'heicConverterWorker.js' + 'heicConverterWorker.node.js' ); const worker = new Worker(scriptDir);