From 4bda32a196179162d5c5e3bd6f9c4409b16d761a Mon Sep 17 00:00:00 2001 From: Daniel LaCosse <3759828+daniellacosse@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:21:42 -0400 Subject: [PATCH] chore(client): move `client/src/infrastructure` to `client/infrastructure` (#1979) * chore(client): move infrastructure out of src * update infrastructure paths * update memory storage location * fix paths in electron --- client/{src => }/infrastructure/custom_error.ts | 0 client/{src => }/infrastructure/electron/app_paths.ts | 0 client/{src => }/infrastructure/i18n.ts | 0 client/{src => }/infrastructure/memory_storage.ts | 0 client/{src => }/infrastructure/timeout_promise.ts | 0 client/src/www/app/app.ts | 4 ++-- client/src/www/app/main.ts | 2 +- .../outline_server_repository.spec.ts | 2 +- client/src/www/app/settings.spec.ts | 2 +- client/src/www/model/errors.ts | 2 +- client/src/www/testing/localize.ts | 2 +- client/src/www/views/contact_view/index.ts | 2 +- client/src/www/views/contact_view/support_form/index.ts | 2 +- client/src/www/views/servers_view/index.ts | 2 +- client/src/www/views/servers_view/server_list/index.ts | 2 +- client/src/www/views/servers_view/server_list_item/index.ts | 2 +- .../views/servers_view/server_list_item/server_card/index.ts | 2 +- client/tsconfig.json | 2 +- src/electron/connectivity.ts | 2 +- src/electron/go_vpn_tunnel.ts | 2 +- src/electron/routing_service.ts | 2 +- 21 files changed, 17 insertions(+), 17 deletions(-) rename client/{src => }/infrastructure/custom_error.ts (100%) rename client/{src => }/infrastructure/electron/app_paths.ts (100%) rename client/{src => }/infrastructure/i18n.ts (100%) rename client/{src => }/infrastructure/memory_storage.ts (100%) rename client/{src => }/infrastructure/timeout_promise.ts (100%) diff --git a/client/src/infrastructure/custom_error.ts b/client/infrastructure/custom_error.ts similarity index 100% rename from client/src/infrastructure/custom_error.ts rename to client/infrastructure/custom_error.ts diff --git a/client/src/infrastructure/electron/app_paths.ts b/client/infrastructure/electron/app_paths.ts similarity index 100% rename from client/src/infrastructure/electron/app_paths.ts rename to client/infrastructure/electron/app_paths.ts diff --git a/client/src/infrastructure/i18n.ts b/client/infrastructure/i18n.ts similarity index 100% rename from client/src/infrastructure/i18n.ts rename to client/infrastructure/i18n.ts diff --git a/client/src/infrastructure/memory_storage.ts b/client/infrastructure/memory_storage.ts similarity index 100% rename from client/src/infrastructure/memory_storage.ts rename to client/infrastructure/memory_storage.ts diff --git a/client/src/infrastructure/timeout_promise.ts b/client/infrastructure/timeout_promise.ts similarity index 100% rename from client/src/infrastructure/timeout_promise.ts rename to client/infrastructure/timeout_promise.ts diff --git a/client/src/www/app/app.ts b/client/src/www/app/app.ts index 341d9f3eb3..faad30953f 100644 --- a/client/src/www/app/app.ts +++ b/client/src/www/app/app.ts @@ -15,7 +15,7 @@ import * as errors from '../model/errors'; import * as events from '../model/events'; import {Server} from '../model/server'; -import {OperationTimedOut} from '../../infrastructure/timeout_promise'; +import {OperationTimedOut} from '../../../infrastructure/timeout_promise'; import {ServerListItem, ServerConnectionState} from '../views/servers_view'; import {SERVER_CONNECTION_INDICATOR_DURATION_MS} from '../views/servers_view/server_connection_indicator'; @@ -27,7 +27,7 @@ import {Settings, SettingsKey} from './settings'; import {Updater} from './updater'; import {UrlInterceptor} from './url_interceptor'; import {VpnInstaller} from './vpn_installer'; -import {Localizer} from 'src/infrastructure/i18n'; +import {Localizer} from '../../../infrastructure/i18n'; enum OUTLINE_ACCESS_KEY_SCHEME { STATIC = 'ss', diff --git a/client/src/www/app/main.ts b/client/src/www/app/main.ts index bd8afb11b4..864e98bcdd 100644 --- a/client/src/www/app/main.ts +++ b/client/src/www/app/main.ts @@ -23,7 +23,7 @@ import {makeConfig, SIP002_URI} from 'ShadowsocksConfig'; import {OutlinePlatform} from './platform'; import {Settings} from './settings'; import {TunnelFactory} from './tunnel'; -import {Localizer} from 'src/infrastructure/i18n.js'; +import {Localizer} from '../../../infrastructure/i18n.js'; // Used to determine whether to use Polymer functionality on app initialization failure. let webComponentsAreReady = false; diff --git a/client/src/www/app/outline_server_repository/outline_server_repository.spec.ts b/client/src/www/app/outline_server_repository/outline_server_repository.spec.ts index 9a424cb8ba..2c544d69c9 100644 --- a/client/src/www/app/outline_server_repository/outline_server_repository.spec.ts +++ b/client/src/www/app/outline_server_repository/outline_server_repository.spec.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {InMemoryStorage} from '../../../infrastructure/memory_storage'; +import {InMemoryStorage} from '../../../../infrastructure/memory_storage'; import {ServerIncompatible, ServerUrlInvalid, ShadowsocksUnsupportedCipher} from '../../model/errors'; import {EventQueue, ServerAdded, ServerForgetUndone, ServerForgotten, ServerRenamed} from '../../model/events'; diff --git a/client/src/www/app/settings.spec.ts b/client/src/www/app/settings.spec.ts index c063dc897f..509557a1f1 100644 --- a/client/src/www/app/settings.spec.ts +++ b/client/src/www/app/settings.spec.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {InMemoryStorage} from '../../infrastructure/memory_storage'; +import {InMemoryStorage} from '../../../infrastructure/memory_storage'; import {Settings, SettingsKey} from './settings'; diff --git a/client/src/www/model/errors.ts b/client/src/www/model/errors.ts index 09fef3ab9b..adc49d79a3 100644 --- a/client/src/www/model/errors.ts +++ b/client/src/www/model/errors.ts @@ -13,7 +13,7 @@ // limitations under the License. import {Server} from './server'; -import {CustomError} from '../../infrastructure/custom_error'; +import {CustomError} from '../../../infrastructure/custom_error'; export class ServerAlreadyAdded extends CustomError { constructor(public readonly server: Server) { diff --git a/client/src/www/testing/localize.ts b/client/src/www/testing/localize.ts index 00a736a8c0..432d574f90 100644 --- a/client/src/www/testing/localize.ts +++ b/client/src/www/testing/localize.ts @@ -14,7 +14,7 @@ limitations under the License. */ -import type {FormattableMessage, Localizer} from 'src/infrastructure/i18n'; +import type {FormattableMessage, Localizer} from '../../../infrastructure/i18n'; import englishMessages from '../messages/en.json'; import IntlMessageFormat from 'intl-messageformat'; diff --git a/client/src/www/views/contact_view/index.ts b/client/src/www/views/contact_view/index.ts index 2b0b0c209c..92898dc4d5 100644 --- a/client/src/www/views/contact_view/index.ts +++ b/client/src/www/views/contact_view/index.ts @@ -30,7 +30,7 @@ import {IssueType, UNSUPPORTED_ISSUE_TYPE_HELPPAGES} from './issue_type'; import {AppType} from './app_type'; import {FormValues, SupportForm, ValidFormValues} from './support_form'; import {OutlineErrorReporter} from '../../shared/error_reporter'; -import {Localizer} from 'src/infrastructure/i18n'; +import {Localizer} from '../../../../infrastructure/i18n'; /** The possible steps in the stepper. Only one step is shown at a time. */ enum Step { diff --git a/client/src/www/views/contact_view/support_form/index.ts b/client/src/www/views/contact_view/support_form/index.ts index 2eb421f7d8..6f5d3ba172 100644 --- a/client/src/www/views/contact_view/support_form/index.ts +++ b/client/src/www/views/contact_view/support_form/index.ts @@ -25,7 +25,7 @@ import '@material/mwc-textfield'; import {AppType} from '../app_type'; import {TextField} from '@material/mwc-textfield'; import {SelectedDetail} from '@material/mwc-menu/mwc-menu-base'; -import {Localizer} from 'src/infrastructure/i18n'; +import {Localizer} from '../../../../../infrastructure/i18n'; type FormControl = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement; diff --git a/client/src/www/views/servers_view/index.ts b/client/src/www/views/servers_view/index.ts index 750a545310..709280a2b2 100644 --- a/client/src/www/views/servers_view/index.ts +++ b/client/src/www/views/servers_view/index.ts @@ -24,7 +24,7 @@ import './server_list'; import {ServerListItem as _ServerListItem} from './server_list_item'; import {ServerConnectionState as _ServerConnectionState} from './server_connection_indicator'; -import { Localizer } from 'src/infrastructure/i18n'; +import { Localizer } from '../../../../infrastructure/i18n'; export type ServerListItem = _ServerListItem; diff --git a/client/src/www/views/servers_view/server_list/index.ts b/client/src/www/views/servers_view/server_list/index.ts index 4f7523b2e0..d6e0b26ee8 100644 --- a/client/src/www/views/servers_view/server_list/index.ts +++ b/client/src/www/views/servers_view/server_list/index.ts @@ -16,7 +16,7 @@ import {customElement, property} from 'lit/decorators.js'; import '../server_list_item/server_card'; import {ServerListItem} from '../server_list_item'; -import {Localizer} from 'src/infrastructure/i18n'; +import {Localizer} from '../../../../../infrastructure/i18n'; @customElement('server-list') export class ServerList extends LitElement { diff --git a/client/src/www/views/servers_view/server_list_item/index.ts b/client/src/www/views/servers_view/server_list_item/index.ts index be1086e1ca..36c1cd990c 100644 --- a/client/src/www/views/servers_view/server_list_item/index.ts +++ b/client/src/www/views/servers_view/server_list_item/index.ts @@ -14,7 +14,7 @@ import {Ref} from 'lit/directives/ref'; import {Menu} from '@material/mwc-menu'; import {ServerConnectionState} from '../server_connection_indicator'; -import {Localizer} from 'src/infrastructure/i18n'; +import {Localizer} from '../../../../../infrastructure/i18n'; export enum ServerListItemEvent { CONNECT = 'ConnectPressed', diff --git a/client/src/www/views/servers_view/server_list_item/server_card/index.ts b/client/src/www/views/servers_view/server_list_item/server_card/index.ts index 9771cbe6c6..b75f68925d 100644 --- a/client/src/www/views/servers_view/server_list_item/server_card/index.ts +++ b/client/src/www/views/servers_view/server_list_item/server_card/index.ts @@ -24,7 +24,7 @@ import {Menu} from '@material/mwc-menu'; import {ServerListItem, ServerListItemElement, ServerListItemEvent} from '..'; import {ServerConnectionState} from '../../server_connection_indicator'; -import {Localizer} from 'src/infrastructure/i18n'; +import {Localizer} from '../../../../../../infrastructure/i18n'; const sharedCSS = css` /* TODO(daniellacosse): reset via postcss */ diff --git a/client/tsconfig.json b/client/tsconfig.json index f6dbb97233..581d8b92cf 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -17,5 +17,5 @@ "lib": ["es2022"] }, "exclude": ["*.cjs", "*.js", "*.mjs", "**/*.spec.ts"], - "include": ["src"] + "include": ["src", "infrastructure"] } diff --git a/src/electron/connectivity.ts b/src/electron/connectivity.ts index e1b8bfa8a4..1150c165e0 100644 --- a/src/electron/connectivity.ts +++ b/src/electron/connectivity.ts @@ -14,7 +14,7 @@ import * as dns from 'dns'; -import {timeoutPromise} from '../../client/src/infrastructure/timeout_promise'; +import {timeoutPromise} from '../../client/infrastructure/timeout_promise'; import * as errors from '../../client/src/www/model/errors'; const DNS_LOOKUP_TIMEOUT_MS = 10000; diff --git a/src/electron/go_vpn_tunnel.ts b/src/electron/go_vpn_tunnel.ts index e808b8102a..6f10f3c5f9 100755 --- a/src/electron/go_vpn_tunnel.ts +++ b/src/electron/go_vpn_tunnel.ts @@ -15,7 +15,7 @@ import {powerMonitor} from 'electron'; import {platform} from 'os'; -import {pathToEmbeddedBinary} from '../../client/src/infrastructure/electron/app_paths'; +import {pathToEmbeddedBinary} from '../../client/infrastructure/electron/app_paths'; import {ShadowsocksSessionConfig} from '../../client/src/www/app/tunnel'; import {TunnelStatus} from '../../client/src/www/app/tunnel'; import {ErrorCode, fromErrorCode, UnexpectedPluginError} from '../../client/src/www/model/errors'; diff --git a/src/electron/routing_service.ts b/src/electron/routing_service.ts index a2b3612eb8..055ceee718 100755 --- a/src/electron/routing_service.ts +++ b/src/electron/routing_service.ts @@ -19,7 +19,7 @@ import {platform, userInfo} from 'os'; import * as path from 'path'; import * as sudo from 'sudo-prompt'; -import {getAppPath} from '../../client/src/infrastructure/electron/app_paths'; +import {getAppPath} from '../../client/infrastructure/electron/app_paths'; import {TunnelStatus} from '../../client/src/www/app/tunnel'; import {ErrorCode, SystemConfigurationException} from '../../client/src/www/model/errors';