From 2649b4b63acbd00756ab3e805c8b20c402cb1c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Espino=20Garc=C3=ADa?= Date: Thu, 7 Nov 2024 01:34:49 +0100 Subject: [PATCH] Remove app alias for imports (#8314) --- app/actions/local/category.test.ts | 4 ++-- app/actions/local/channel.test.ts | 2 +- app/actions/local/post.test.ts | 4 ++-- app/actions/local/reactions.test.ts | 2 +- app/actions/local/systems.test.ts | 4 ++-- app/actions/local/team.test.ts | 2 +- app/actions/local/thread.test.ts | 2 +- app/actions/local/user.test.ts | 2 +- app/actions/remote/post.test.ts | 4 ++-- app/actions/remote/preference.test.ts | 4 ++-- app/actions/remote/reactions.test.ts | 2 +- app/actions/remote/search.ts | 2 +- app/actions/remote/thread.test.ts | 2 +- .../channel_bookmark/bookmark_document.tsx | 4 ++-- app/components/post_list/post/header/header.tsx | 2 +- .../calls/components/call_notification/index.ts | 2 +- .../components/bookmark_file/bookmark_file.tsx | 6 +++--- .../channel_bookmark/components/bookmark_link.tsx | 2 +- app/screens/code/index.tsx | 10 +++++----- app/screens/gallery/footer/avatar/index.tsx | 2 +- app/screens/home/tab_bar/home.tsx | 2 +- app/utils/deep_link/index.ts | 2 +- babel.config.js | 1 - tsconfig.json | 1 - 24 files changed, 34 insertions(+), 36 deletions(-) diff --git a/app/actions/local/category.test.ts b/app/actions/local/category.test.ts index c2fe36f40..21326e71d 100644 --- a/app/actions/local/category.test.ts +++ b/app/actions/local/category.test.ts @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {DMS_CATEGORY} from '@app/constants/categories'; -import {setCurrentUserId} from '@app/queries/servers/system'; +import {DMS_CATEGORY} from '@constants/categories'; import DatabaseManager from '@database/manager'; +import {setCurrentUserId} from '@queries/servers/system'; import { deleteCategory, diff --git a/app/actions/local/channel.test.ts b/app/actions/local/channel.test.ts index 6969f6ce5..409daf455 100644 --- a/app/actions/local/channel.test.ts +++ b/app/actions/local/channel.test.ts @@ -29,7 +29,7 @@ import { updateDmGmDisplayName, } from './channel'; -import type {ChannelModel, MyChannelModel, SystemModel} from '@app/database/models/server'; +import type {ChannelModel, MyChannelModel, SystemModel} from '@database/models/server'; import type ServerDataOperator from '@database/operator/server_data_operator'; import type {Database} from '@nozbe/watermelondb'; diff --git a/app/actions/local/post.test.ts b/app/actions/local/post.test.ts index 79b221b6b..aa8707abe 100644 --- a/app/actions/local/post.test.ts +++ b/app/actions/local/post.test.ts @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ActionType, Post} from '@app/constants'; -import {COMBINED_USER_ACTIVITY} from '@app/utils/post_list'; +import {ActionType, Post} from '@constants'; import {SYSTEM_IDENTIFIERS} from '@constants/database'; import DatabaseManager from '@database/manager'; import TestHelper from '@test/test_helper'; +import {COMBINED_USER_ACTIVITY} from '@utils/post_list'; import { sendAddToChannelEphemeralPost, diff --git a/app/actions/local/reactions.test.ts b/app/actions/local/reactions.test.ts index ff08b5f52..142c40c29 100644 --- a/app/actions/local/reactions.test.ts +++ b/app/actions/local/reactions.test.ts @@ -7,7 +7,7 @@ import * as logUtils from '@utils/log'; import {addRecentReaction} from './reactions'; -import type ServerDataOperator from '@app/database/operator/server_data_operator'; +import type ServerDataOperator from '@database/operator/server_data_operator'; jest.mock('@database/manager'); jest.mock('@queries/servers/system'); diff --git a/app/actions/local/systems.test.ts b/app/actions/local/systems.test.ts index 6ac807916..be3fd8e6b 100644 --- a/app/actions/local/systems.test.ts +++ b/app/actions/local/systems.test.ts @@ -3,8 +3,8 @@ import Database from '@nozbe/watermelondb/Database'; -import {ActionType} from '@app/constants'; -import {SYSTEM_IDENTIFIERS} from '@app/constants/database'; +import {ActionType} from '@constants'; +import {SYSTEM_IDENTIFIERS} from '@constants/database'; import DatabaseManager from '@database/manager'; import TestHelper from '@test/test_helper'; diff --git a/app/actions/local/team.test.ts b/app/actions/local/team.test.ts index 3790cd2cf..1e4543ea4 100644 --- a/app/actions/local/team.test.ts +++ b/app/actions/local/team.test.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import ServerDataOperator from '@app/database/operator/server_data_operator'; import DatabaseManager from '@database/manager'; +import ServerDataOperator from '@database/operator/server_data_operator'; import {getMyTeamById, getTeamById, getTeamSearchHistoryById, prepareDeleteTeam, removeTeamFromTeamHistory} from '@queries/servers/team'; import {logError} from '@utils/log'; diff --git a/app/actions/local/thread.test.ts b/app/actions/local/thread.test.ts index a8c44d551..cb7b7c220 100644 --- a/app/actions/local/thread.test.ts +++ b/app/actions/local/thread.test.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ActionType} from '@app/constants'; +import {ActionType} from '@constants'; import {SYSTEM_IDENTIFIERS} from '@constants/database'; import Preferences from '@constants/preferences'; import DatabaseManager from '@database/manager'; diff --git a/app/actions/local/user.test.ts b/app/actions/local/user.test.ts index bb0cca558..1fab4f8c6 100644 --- a/app/actions/local/user.test.ts +++ b/app/actions/local/user.test.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {SYSTEM_IDENTIFIERS} from '@app/constants/database'; +import {SYSTEM_IDENTIFIERS} from '@constants/database'; import DatabaseManager from '@database/manager'; import { diff --git a/app/actions/remote/post.test.ts b/app/actions/remote/post.test.ts index f6a087b8c..428381c3f 100644 --- a/app/actions/remote/post.test.ts +++ b/app/actions/remote/post.test.ts @@ -3,10 +3,10 @@ /* eslint-disable max-lines */ -import {ActionType, Post} from '@app/constants'; -import PostModel from '@app/database/models/server/post'; +import {ActionType, Post} from '@constants'; import {SYSTEM_IDENTIFIERS} from '@constants/database'; import DatabaseManager from '@database/manager'; +import PostModel from '@database/models/server/post'; import NetworkManager from '@managers/network_manager'; import TestHelper from '@test/test_helper'; diff --git a/app/actions/remote/preference.test.ts b/app/actions/remote/preference.test.ts index 1a3120458..320494026 100644 --- a/app/actions/remote/preference.test.ts +++ b/app/actions/remote/preference.test.ts @@ -3,7 +3,7 @@ /* eslint-disable max-lines */ -import {Preferences} from '@app/constants'; +import {Preferences} from '@constants'; import {SYSTEM_IDENTIFIERS} from '@constants/database'; import DatabaseManager from '@database/manager'; import NetworkManager from '@managers/network_manager'; @@ -22,7 +22,7 @@ import { savePreferredSkinTone, } from './preference'; -import type {PreferenceModel} from '@app/database/models/server'; +import type {PreferenceModel} from '@database/models/server'; import type ServerDataOperator from '@database/operator/server_data_operator'; const serverUrl = 'baseHandler.test.com'; diff --git a/app/actions/remote/reactions.test.ts b/app/actions/remote/reactions.test.ts index 13f18e82b..9ccc7c4f0 100644 --- a/app/actions/remote/reactions.test.ts +++ b/app/actions/remote/reactions.test.ts @@ -3,7 +3,7 @@ /* eslint-disable max-lines */ -import {ActionType} from '@app/constants'; +import {ActionType} from '@constants'; import {SYSTEM_IDENTIFIERS} from '@constants/database'; import DatabaseManager from '@database/manager'; import NetworkManager from '@managers/network_manager'; diff --git a/app/actions/remote/search.ts b/app/actions/remote/search.ts index 0010ab1a1..7f99bb6e9 100644 --- a/app/actions/remote/search.ts +++ b/app/actions/remote/search.ts @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import {getPosts} from '@actions/local/post'; -import {General} from '@app/constants'; +import {General} from '@constants'; import {SYSTEM_IDENTIFIERS} from '@constants/database'; import DatabaseManager from '@database/manager'; import NetworkManager from '@managers/network_manager'; diff --git a/app/actions/remote/thread.test.ts b/app/actions/remote/thread.test.ts index 8f5e37e9f..0352bb8b3 100644 --- a/app/actions/remote/thread.test.ts +++ b/app/actions/remote/thread.test.ts @@ -3,7 +3,7 @@ /* eslint-disable max-lines */ -import {ActionType} from '@app/constants'; +import {ActionType} from '@constants'; import {SYSTEM_IDENTIFIERS} from '@constants/database'; import DatabaseManager from '@database/manager'; import NetworkManager from '@managers/network_manager'; diff --git a/app/components/channel_bookmarks/channel_bookmark/bookmark_document.tsx b/app/components/channel_bookmarks/channel_bookmark/bookmark_document.tsx index 43ec733b3..20bb4a711 100644 --- a/app/components/channel_bookmarks/channel_bookmark/bookmark_document.tsx +++ b/app/components/channel_bookmarks/channel_bookmark/bookmark_document.tsx @@ -5,9 +5,9 @@ import {Button} from '@rneui/base'; import React, {useCallback, useRef, useState} from 'react'; import {StyleSheet, View} from 'react-native'; -import ProgressBar from '@app/components/progress_bar'; -import {useTheme} from '@app/context/theme'; import Document, {type DocumentRef} from '@components/document'; +import ProgressBar from '@components/progress_bar'; +import {useTheme} from '@context/theme'; import BookmarkDetails from './bookmark_details'; diff --git a/app/components/post_list/post/header/header.tsx b/app/components/post_list/post/header/header.tsx index 69a6977c6..f79583e8d 100644 --- a/app/components/post_list/post/header/header.tsx +++ b/app/components/post_list/post/header/header.tsx @@ -4,7 +4,7 @@ import React from 'react'; import {View} from 'react-native'; -import FormattedText from '@app/components/formatted_text'; +import FormattedText from '@components/formatted_text'; import FormattedTime from '@components/formatted_time'; import PostPriorityLabel from '@components/post_priority/post_priority_label'; import {CHANNEL, THREAD} from '@constants/screens'; diff --git a/app/products/calls/components/call_notification/index.ts b/app/products/calls/components/call_notification/index.ts index 80fd1c92a..ae3c6ae70 100644 --- a/app/products/calls/components/call_notification/index.ts +++ b/app/products/calls/components/call_notification/index.ts @@ -5,9 +5,9 @@ import {withObservables} from '@nozbe/watermelondb/react'; import {of as of$} from 'rxjs'; import {distinctUntilChanged, switchMap} from 'rxjs/operators'; -import {observeAllActiveServers} from '@app/queries/app/servers'; import {CallNotification} from '@calls/components/call_notification/call_notification'; import DatabaseManager from '@database/manager'; +import {observeAllActiveServers} from '@queries/app/servers'; import {observeChannelMembers} from '@queries/servers/channel'; import {observeCurrentUser, observeTeammateNameDisplay} from '@queries/servers/user'; diff --git a/app/screens/channel_bookmark/components/bookmark_file/bookmark_file.tsx b/app/screens/channel_bookmark/components/bookmark_file/bookmark_file.tsx index e77550b09..4fa463492 100644 --- a/app/screens/channel_bookmark/components/bookmark_file/bookmark_file.tsx +++ b/app/screens/channel_bookmark/components/bookmark_file/bookmark_file.tsx @@ -8,10 +8,10 @@ import {View, Text, Platform, type Insets} from 'react-native'; import {Shadow} from 'react-native-shadow-2'; import {uploadFile} from '@actions/remote/file'; -import CompassIcon from '@app/components/compass_icon'; -import FileIcon from '@app/components/files/file_icon'; -import ProgressBar from '@app/components/progress_bar'; +import CompassIcon from '@components/compass_icon'; +import FileIcon from '@components/files/file_icon'; import FormattedText from '@components/formatted_text'; +import ProgressBar from '@components/progress_bar'; import TouchableWithFeedback from '@components/touchable_with_feedback'; import {useServerUrl} from '@context/server'; import {useTheme} from '@context/theme'; diff --git a/app/screens/channel_bookmark/components/bookmark_link.tsx b/app/screens/channel_bookmark/components/bookmark_link.tsx index a4d59ca47..6df862dd1 100644 --- a/app/screens/channel_bookmark/components/bookmark_link.tsx +++ b/app/screens/channel_bookmark/components/bookmark_link.tsx @@ -5,12 +5,12 @@ import React, {useCallback, useMemo, useState} from 'react'; import {useIntl} from 'react-intl'; import {Platform, View} from 'react-native'; -import {useIsTablet} from '@app/hooks/device'; import FloatingTextInput from '@components/floating_text_input_label'; import FormattedText from '@components/formatted_text'; import Loading from '@components/loading'; import {useTheme} from '@context/theme'; import {debounce} from '@helpers/api/general'; +import {useIsTablet} from '@hooks/device'; import useDidUpdate from '@hooks/did_update'; import {fetchOpenGraph} from '@utils/opengraph'; import {changeOpacity, getKeyboardAppearanceFromTheme, makeStyleSheetFromTheme} from '@utils/theme'; diff --git a/app/screens/code/index.tsx b/app/screens/code/index.tsx index e8d6df8bc..816d1b1e3 100644 --- a/app/screens/code/index.tsx +++ b/app/screens/code/index.tsx @@ -7,14 +7,14 @@ import React, {useCallback, useEffect} from 'react'; import {StyleSheet, type TextStyle} from 'react-native'; import {SafeAreaView, type Edge} from 'react-native-safe-area-context'; -import CompassIcon from '@app/components/compass_icon'; -import {SNACK_BAR_TYPE} from '@app/constants/snack_bar'; -import {useTheme} from '@app/context/theme'; -import useNavButtonPressed from '@app/hooks/navigation_button_pressed'; -import {showSnackBar} from '@app/utils/snack_bar'; +import CompassIcon from '@components/compass_icon'; import SyntaxHiglight from '@components/syntax_highlight'; +import {SNACK_BAR_TYPE} from '@constants/snack_bar'; +import {useTheme} from '@context/theme'; import useAndroidHardwareBackHandler from '@hooks/android_back_handler'; +import useNavButtonPressed from '@hooks/navigation_button_pressed'; import {popTopScreen, setButtons} from '@screens/navigation'; +import {showSnackBar} from '@utils/snack_bar'; import type {AvailableScreens} from '@typings/screens/navigation'; diff --git a/app/screens/gallery/footer/avatar/index.tsx b/app/screens/gallery/footer/avatar/index.tsx index 0becc211b..c9181e3b5 100644 --- a/app/screens/gallery/footer/avatar/index.tsx +++ b/app/screens/gallery/footer/avatar/index.tsx @@ -7,8 +7,8 @@ import {StyleSheet, View} from 'react-native'; import {buildAbsoluteUrl} from '@actions/remote/file'; import {buildProfileImageUrlFromUser} from '@actions/remote/user'; -import {useServerUrl} from '@app/context/server'; import CompassIcon from '@components/compass_icon'; +import {useServerUrl} from '@context/server'; import {changeOpacity} from '@utils/theme'; import type UserModel from '@typings/database/models/servers/user'; diff --git a/app/screens/home/tab_bar/home.tsx b/app/screens/home/tab_bar/home.tsx index 87af1fbf1..543077eed 100644 --- a/app/screens/home/tab_bar/home.tsx +++ b/app/screens/home/tab_bar/home.tsx @@ -6,13 +6,13 @@ import React, {useEffect, useState} from 'react'; import {DeviceEventEmitter, Platform, StyleSheet, View} from 'react-native'; import {Notifications} from 'react-native-notifications'; -import useDidUpdate from '@app/hooks/did_update'; import Badge from '@components/badge'; import CompassIcon from '@components/compass_icon'; import {BOTTOM_TAB_ICON_SIZE} from '@constants/view'; import {subscribeAllServers} from '@database/subscription/servers'; import {subscribeUnreadAndMentionsByServer, type UnreadObserverArgs} from '@database/subscription/unreads'; import {useAppState} from '@hooks/device'; +import useDidUpdate from '@hooks/did_update'; import {logDebug} from '@utils/log'; import {changeOpacity} from '@utils/theme'; diff --git a/app/utils/deep_link/index.ts b/app/utils/deep_link/index.ts index 98d64722f..ac29edf73 100644 --- a/app/utils/deep_link/index.ts +++ b/app/utils/deep_link/index.ts @@ -9,8 +9,8 @@ import urlParse from 'url-parse'; import {makeDirectChannel, switchToChannelByName} from '@actions/remote/channel'; import {showPermalink} from '@actions/remote/permalink'; import {fetchUsersByUsernames} from '@actions/remote/user'; -import DeepLinkType from '@app/constants/deep_linking'; import {DeepLink, Launch, Screens} from '@constants'; +import DeepLinkType from '@constants/deep_linking'; import {getDefaultThemeByAppearance} from '@context/theme'; import DatabaseManager from '@database/manager'; import {DEFAULT_LOCALE, t} from '@i18n'; diff --git a/babel.config.js b/babel.config.js index 5d0fa4817..5b85629b0 100644 --- a/babel.config.js +++ b/babel.config.js @@ -15,7 +15,6 @@ module.exports = { root: ['.'], alias: { '@actions': './app/actions', - '@app': './app/', '@assets': './dist/assets/', '@calls': './app/products/calls', '@client': './app/client', diff --git a/tsconfig.json b/tsconfig.json index 5bf8e113a..8900b6afe 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -39,7 +39,6 @@ "baseUrl": ".", "paths": { "@actions/*": ["app/actions/*"], - "@app/*": ["app/*"], "@assets/*": ["dist/assets/*"], "@calls/*": ["app/products/calls/*"], "@client/*": ["app/client/*"],