mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-27 03:43:27 +01:00
Enforce node: schema for builtins, import extensions
This commit is contained in:
@@ -3,15 +3,15 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import * as Attachment from '../../types/Attachment';
|
||||
import * as MIME from '../../types/MIME';
|
||||
import { SignalService } from '../../protobuf';
|
||||
import * as Bytes from '../../Bytes';
|
||||
import { createLogger } from '../../logging/log';
|
||||
import * as Attachment from '../../types/Attachment.js';
|
||||
import * as MIME from '../../types/MIME.js';
|
||||
import { SignalService } from '../../protobuf/index.js';
|
||||
import * as Bytes from '../../Bytes.js';
|
||||
import { createLogger } from '../../logging/log.js';
|
||||
|
||||
import { fakeAttachment } from '../../test-helpers/fakeAttachment';
|
||||
import { DAY } from '../../util/durations';
|
||||
import { migrateDataToFileSystem } from '../../util/attachments/migrateDataToFilesystem';
|
||||
import { fakeAttachment } from '../../test-helpers/fakeAttachment.js';
|
||||
import { DAY } from '../../util/durations/index.js';
|
||||
import { migrateDataToFileSystem } from '../../util/attachments/migrateDataToFilesystem.js';
|
||||
|
||||
const logger = createLogger('Attachment_test');
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { getDefaultAvatars } from '../../types/Avatar';
|
||||
import { getDefaultAvatars } from '../../types/Avatar.js';
|
||||
|
||||
describe('Avatar', () => {
|
||||
describe('getDefaultAvatars', () => {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { assert } from 'chai';
|
||||
import type {
|
||||
HydratedBodyRangeMention,
|
||||
RangeNode,
|
||||
} from '../../types/BodyRange';
|
||||
} from '../../types/BodyRange.js';
|
||||
import {
|
||||
BodyRange,
|
||||
DisplayStyle,
|
||||
@@ -15,8 +15,8 @@ import {
|
||||
insertRange,
|
||||
processBodyRangesForSearchResult,
|
||||
trimMessageWhitespace,
|
||||
} from '../../types/BodyRange';
|
||||
import { generateAci } from '../../types/ServiceId';
|
||||
} from '../../types/BodyRange.js';
|
||||
import { generateAci } from '../../types/ServiceId.js';
|
||||
|
||||
const SERVICE_ID_1 = generateAci();
|
||||
const SERVICE_ID_2 = generateAci();
|
||||
|
||||
@@ -6,7 +6,7 @@ import type {
|
||||
CardFormFields,
|
||||
CardFormResult,
|
||||
CardFormSettings,
|
||||
} from '../../types/DonationsCardForm';
|
||||
} from '../../types/DonationsCardForm.js';
|
||||
import {
|
||||
CardCvcError,
|
||||
CardExpirationError,
|
||||
@@ -19,8 +19,8 @@ import {
|
||||
parseCardExpiration,
|
||||
parseCardForm,
|
||||
parseCardNumber,
|
||||
} from '../../types/DonationsCardForm';
|
||||
import type { CardDetail } from '../../types/Donations';
|
||||
} from '../../types/DonationsCardForm.js';
|
||||
import type { CardDetail } from '../../types/Donations.js';
|
||||
|
||||
function testCard(cardNumber: string, cvcSize: number) {
|
||||
return { cardNumber, cvcSize };
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
import { assert } from 'chai';
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
import { createLogger } from '../../logging/log';
|
||||
import { IMAGE_GIF, IMAGE_PNG } from '../../types/MIME';
|
||||
import type { MessageAttributesType } from '../../model-types.d';
|
||||
import type { Avatar, Email, Phone } from '../../types/EmbeddedContact';
|
||||
import { createLogger } from '../../logging/log.js';
|
||||
import { IMAGE_GIF, IMAGE_PNG } from '../../types/MIME.js';
|
||||
import type { MessageAttributesType } from '../../model-types.d.ts';
|
||||
import type { Avatar, Email, Phone } from '../../types/EmbeddedContact.js';
|
||||
import {
|
||||
_validate,
|
||||
ContactFormType,
|
||||
@@ -15,9 +15,9 @@ import {
|
||||
getName,
|
||||
parseAndWriteAvatar,
|
||||
parsePhoneItem,
|
||||
} from '../../types/EmbeddedContact';
|
||||
import { fakeAttachment } from '../../test-helpers/fakeAttachment';
|
||||
import { generateAci } from '../../types/ServiceId';
|
||||
} from '../../types/EmbeddedContact.js';
|
||||
import { fakeAttachment } from '../../test-helpers/fakeAttachment.js';
|
||||
import { generateAci } from '../../types/ServiceId.js';
|
||||
|
||||
const logger = createLogger('EmbeddedContact_test');
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
isValidLink,
|
||||
shouldLinkifyMessage,
|
||||
shouldPreviewHref,
|
||||
} from '../../types/LinkPreview';
|
||||
} from '../../types/LinkPreview.js';
|
||||
|
||||
describe('Link previews', () => {
|
||||
describe('#isValidLink', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import * as MIME from '../../types/MIME';
|
||||
import * as MIME from '../../types/MIME.js';
|
||||
|
||||
describe('MIME', () => {
|
||||
describe('isGif', () => {
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
import { assert } from 'chai';
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
import * as Message from '../../types/Message2';
|
||||
import { SignalService } from '../../protobuf';
|
||||
import * as Bytes from '../../Bytes';
|
||||
import * as MIME from '../../types/MIME';
|
||||
import * as Message from '../../types/Message2.js';
|
||||
import { SignalService } from '../../protobuf/index.js';
|
||||
import * as Bytes from '../../Bytes.js';
|
||||
import * as MIME from '../../types/MIME.js';
|
||||
|
||||
import type { EmbeddedContactType } from '../../types/EmbeddedContact';
|
||||
import type { MessageAttributesType } from '../../model-types.d';
|
||||
import type { EmbeddedContactType } from '../../types/EmbeddedContact.js';
|
||||
import type { MessageAttributesType } from '../../model-types.d.ts';
|
||||
import type {
|
||||
AddressableAttachmentType,
|
||||
AttachmentType,
|
||||
LocalAttachmentV2Type,
|
||||
} from '../../types/Attachment';
|
||||
import type { LoggerType } from '../../types/Logging';
|
||||
} from '../../types/Attachment.js';
|
||||
import type { LoggerType } from '../../types/Logging.js';
|
||||
|
||||
const FAKE_LOCAL_ATTACHMENT: LocalAttachmentV2Type = {
|
||||
version: 2,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { DAY, HOUR, MINUTE } from '../../util/durations';
|
||||
import { DAY, HOUR, MINUTE } from '../../util/durations/index.js';
|
||||
|
||||
import {
|
||||
DayOfWeek,
|
||||
@@ -12,13 +12,13 @@ import {
|
||||
getMidnight,
|
||||
loopThroughWeek,
|
||||
sortProfiles,
|
||||
} from '../../types/NotificationProfile';
|
||||
import { generateNotificationProfileId } from '../../types/NotificationProfile-node';
|
||||
} from '../../types/NotificationProfile.js';
|
||||
import { generateNotificationProfileId } from '../../types/NotificationProfile-node.js';
|
||||
|
||||
import type {
|
||||
NextProfileEvent,
|
||||
NotificationProfileType,
|
||||
} from '../../types/NotificationProfile';
|
||||
} from '../../types/NotificationProfile.js';
|
||||
|
||||
describe('NotificationProfile', () => {
|
||||
const startingTime = Date.now();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { getCountryCode } from '../../types/PhoneNumber';
|
||||
import { getCountryCode } from '../../types/PhoneNumber.js';
|
||||
|
||||
describe('types/PhoneNumber', () => {
|
||||
describe('#getCountryCode', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isValid } from '../../types/SchemaVersion';
|
||||
import { isValid } from '../../types/SchemaVersion.js';
|
||||
|
||||
describe('SchemaVersion', () => {
|
||||
describe('isValid', () => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright 2018 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import os from 'os';
|
||||
import os from 'node:os';
|
||||
import Sinon from 'sinon';
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { getOSFunctions } from '../../util/os/shared';
|
||||
import * as Settings from '../../types/Settings';
|
||||
import { SystemTraySetting } from '../../types/SystemTraySetting';
|
||||
import { getOSFunctions } from '../../util/os/shared.js';
|
||||
import * as Settings from '../../types/Settings.js';
|
||||
import { SystemTraySetting } from '../../types/SystemTraySetting.js';
|
||||
|
||||
describe('Settings', () => {
|
||||
let sandbox: Sinon.SinonSandbox;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import * as Stickers from '../../types/Stickers';
|
||||
import * as Stickers from '../../types/Stickers.js';
|
||||
|
||||
describe('Stickers', () => {
|
||||
describe('getDataFromLink', () => {
|
||||
|
||||
@@ -5,8 +5,8 @@ import { assert } from 'chai';
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
import type { LoggerType } from '../../types/Logging';
|
||||
import { normalizeStoryDistributionId } from '../../types/StoryDistributionId';
|
||||
import type { LoggerType } from '../../types/Logging.js';
|
||||
import { normalizeStoryDistributionId } from '../../types/StoryDistributionId.js';
|
||||
|
||||
describe('StoryDistributionId', () => {
|
||||
let warn: sinon.SinonStub;
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
SystemTraySetting,
|
||||
parseSystemTraySetting,
|
||||
shouldMinimizeToSystemTray,
|
||||
} from '../../types/SystemTraySetting';
|
||||
} from '../../types/SystemTraySetting.js';
|
||||
|
||||
describe('system tray setting utilities', () => {
|
||||
describe('shouldMinimizeToSystemTray', () => {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Copyright 2018 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as Path from 'path';
|
||||
import * as Path from 'node:path';
|
||||
import { assert } from 'chai';
|
||||
import * as Errors from '../../types/errors';
|
||||
import * as Errors from '../../types/errors.js';
|
||||
|
||||
const APP_ROOT_PATH = Path.join(__dirname, '..', '..', '..');
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import type { LocalizerType } from '../../types/Util';
|
||||
import { setupI18n } from '../../util/setupI18n';
|
||||
import type { LocalizerType } from '../../types/Util.js';
|
||||
import { setupI18n } from '../../util/setupI18n.js';
|
||||
import * as enMessages from '../../../_locales/en/messages.json';
|
||||
|
||||
describe('setupI18n', () => {
|
||||
|
||||
Reference in New Issue
Block a user