Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(project): adjustment of file name specification #1003

Merged
merged 3 commits into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { app } from "electron";
import closeAPP from "../utils/CloseAPP";
import closeAPP from "../utils/close-app";

export default (): void => {
const windowAllClosed = (): void => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { windowManager } from "../utils/WindowManager";
import { appActionAsync, appActionSync, injectionWindowIPCAction } from "../utils/IPCActions";
import { windowManager } from "../utils/window-manager";
import { appActionAsync, appActionSync, injectionWindowIPCAction } from "../utils/ipc-actions";
import { constants, ipc } from "flat-types";
import { ipcMain } from "electron";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import runtime from "../utils/Runtime";
import { app } from "electron";
import closeAPP from "../utils/CloseAPP";
import { CustomSingleWindow, windowManager } from "../utils/WindowManager";
import closeAPP from "../utils/close-app";
import { CustomSingleWindow, windowManager } from "../utils/window-manager";
import { constants } from "flat-types";

export default async (): Promise<void> => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { app } from "electron";
import { windowManager } from "../utils/WindowManager";
import { windowManager } from "../utils/window-manager";

export default (): void => {
app.allowRendererProcessReuse = false;
Expand Down
18 changes: 9 additions & 9 deletions desktop/main-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import bootstrap from "./utils/BootupFlow";
import initEnv from "./bootup/Init-env";
import initWindow from "./bootup/Init-window";
import initWebRequest from "./bootup/Init-webRequest";
import initMenus from "./bootup/Init-menus";
import intIPC from "./bootup/Init-ipc";
import initAppListen from "./bootup/Init-app-listener";
import initOtherListeners from "./bootup/Init-other";
import initURLProtocol from "./bootup/Init-url-protocol";
import bootstrap from "./utils/bootup-flow";
import initEnv from "./bootup/init-env";
import initWindow from "./bootup/init-window";
import initWebRequest from "./bootup/init-webRequest";
import initMenus from "./bootup/init-menus";
import intIPC from "./bootup/init-ipc";
import initAppListen from "./bootup/init-app-listener";
import initOtherListeners from "./bootup/init-other";
import initURLProtocol from "./bootup/init-url-protocol";

void bootstrap([
initEnv,
Expand Down
2 changes: 1 addition & 1 deletion desktop/main-app/src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { ipcRenderer } = require("electron");

/**
* this method will only be triggered on the main page
* see: WindowManager.ts
* see: window-manager.ts
*/
ipcRenderer.once("inject-agora-electron-sdk-addon", () => {
if (!process.env.AGORA_APP_ID) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CustomSingleWindow, windowManager } from "./WindowManager";
import { CustomSingleWindow, windowManager } from "./window-manager";
import { ipc } from "flat-types";
import { app, ipcMain, powerSaveBlocker } from "electron";
import runtime from "./Runtime";
import { updateService } from "./UpdateService";
import { updateService } from "./update-service";
import { update } from "flat-types";
import { gt } from "semver";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ipc } from "flat-types";
import { windowManager } from "./WindowManager";
import { windowManager } from "./window-manager";
import runtime from "./Runtime";
import { constants } from "flat-types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { autoUpdater, UpdateCheckResult } from "electron-updater";
import runtime from "./Runtime";
import { ProgressInfo } from "electron-updater/out/differentialDownloader/ProgressDifferentialDownloadCallbackTransform";
import { ipcEmitByMain } from "./IPCEmit";
import { ipcEmitByMain } from "./ipc-emit";
import { update } from "flat-types";

class UpdateService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ipcEmit } from "./IPCEmit";
import { CustomSingleWindow } from "./WindowManager";
import { ipcEmit } from "./ipc-emit";
import { CustomSingleWindow } from "./window-manager";
import { autoUpdater } from "electron-updater";

export const windowHookClose = (customWindow: CustomSingleWindow): void => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
IpcMainEvent,
Display,
} from "electron";
import { windowHookClose, windowOpenDevTools, windowReadyToShow } from "./WindowEvent";
import { windowHookClose, windowOpenDevTools, windowReadyToShow } from "./window-event";
import runtime from "./Runtime";
import { constants, portal } from "flat-types";
import { Subject, zip } from "rxjs";
Expand Down
2 changes: 1 addition & 1 deletion desktop/renderer-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"webpack-merge": "^5.7.3"
},
"scripts": {
"start": "cross-env NODE_ENV=development node ./scripts/Start.js",
"start": "cross-env NODE_ENV=development node scripts/start.js",
"build": "cross-env NODE_ENV=production webpack --config webpack/webpack.prod.js",
"build:analyzer": "cross-env NODE_ENV=production ANALYZER=true webpack --config webpack/webpack.prod.js",
"lint": "lint-staged"
Expand Down
2 changes: 1 addition & 1 deletion desktop/renderer-app/src/AppRoutes/AppRouteContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useIsomorphicLayoutEffect } from "react-use";
import { RouteComponentProps } from "react-router-dom";
import { ipcAsyncByMainWindow } from "../utils/ipc";
import { AppRouteErrorBoundary } from "./AppRouteErrorBoundary";
import { useURLAppLauncher } from "../utils/hooks/useURLAppLauncher";
import { useURLAppLauncher } from "../utils/hooks/use-url-app-launcher";

export interface AppRouteContainerProps {
Comp: React.ComponentType<any>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FLAT_SERVER_DOMAIN } from "../../constants/Process";
import { FLAT_SERVER_DOMAIN } from "../../constants/process";

const FLAT_SERVER_PROTOCOL = `https://${FLAT_SERVER_DOMAIN}`;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Axios, { AxiosRequestConfig } from "axios";
import { globalStore } from "../../stores/GlobalStore";
import { globalStore } from "../../stores/global-store";
import { FLAT_SERVER_VERSIONS, Status } from "./constants";
import { ServerRequestError } from "../../utils/error/ServerRequestError";
import { RequestErrorCode } from "../../constants/ErrorCode";
import { ServerRequestError } from "../../utils/error/server-request-error";
import { RequestErrorCode } from "../../constants/error-code";

export type FlatServerResponse<T> =
| {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type AgoraSdk from "agora-electron-sdk";
import { AGORA } from "../constants/Process";
import { globalStore } from "../stores/GlobalStore";
import { AGORA } from "../constants/process";
import { globalStore } from "../stores/global-store";
import { generateRTCToken } from "./flatServer/agora";

/** @see {@link https://docs.agora.io/cn/Video/API%20Reference/electron/index.html} */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import AgoraRTM, { RtmChannel, RtmClient } from "agora-rtm-sdk";
import polly from "polly-js";
import { v4 as uuidv4 } from "uuid";
import { AGORA, NODE_ENV } from "../constants/Process";
import { AGORA, NODE_ENV } from "../constants/process";
import { EventEmitter } from "events";
import { RoomStatus } from "./flatServer/constants";
import { generateRTMToken } from "./flatServer/agora";
import { globalStore } from "../stores/GlobalStore";
import { globalStore } from "../stores/global-store";

/**
* @see {@link https://docs.agora.io/cn/Real-time-Messaging/rtm_get_event?platform=RESTful#a-namecreate_history_resa创建历史消息查询资源-api(post)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { globalStore } from "../stores/GlobalStore";
import { AGORA } from "../constants/Process";
import { globalStore } from "../stores/global-store";
import { AGORA } from "../constants/process";
import type AgoraSDK from "agora-electron-sdk";
import { ScreenSymbol } from "agora-electron-sdk/types/Api/native_type";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
WhiteWebSdk,
} from "white-web-sdk";
import { Region } from "flat-components";
import { NETLESS, NODE_ENV } from "../constants/Process";
import { NETLESS, NODE_ENV } from "../constants/process";

export enum SmartPlayerEventType {
Ready = "Ready",
Expand Down
2 changes: 1 addition & 1 deletion desktop/renderer-app/src/components/AvatarCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { useEffect, useRef } from "react";
import type AgoraSDK from "agora-electron-sdk";
import { observer } from "mobx-react-lite";
import { useUpdateEffect } from "react-use";
import { User } from "../stores/ClassRoomStore";
import { User } from "../stores/class-room-store";

export interface AvatarCanvasProps {
isCreator: boolean;
Expand Down
4 changes: 2 additions & 2 deletions desktop/renderer-app/src/components/ChatPanel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { observer } from "mobx-react-lite";
import { ChatPanel as ChatPanelImpl, useComputed } from "flat-components";
import { ClassRoomStore } from "../../stores/ClassRoomStore";
import { generateAvatar } from "../../utils/generateAvatar";
import { ClassRoomStore } from "../../stores/class-room-store";
import { generateAvatar } from "../../utils/generate-avatar";

export interface ChatPanelProps {
classRoomStore: ClassRoomStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
List,
ListRowRenderer,
} from "react-virtualized";
import { ClassRoomReplayStore } from "../../stores/ClassRoomReplayStore";
import { ClassRoomReplayStore } from "../../stores/class-room-replay-store";

export interface ChatMessageListReplayProps {
classRoomReplayStore: ClassRoomReplayStore;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { observer } from "mobx-react-lite";
import { ChatMessageListReplay } from "./ChatMessageListReplay";
import { ClassRoomReplayStore } from "../../stores/ClassRoomReplayStore";
import { ClassRoomReplayStore } from "../../stores/class-room-replay-store";
import { useTranslation } from "react-i18next";

export interface ChatMessagesReplayProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import { Tabs } from "antd";
import { observer } from "mobx-react-lite";
import { ChatMessagesReplay } from "./ChatMessagesReplay";
import { ClassRoomReplayStore } from "../../stores/ClassRoomReplayStore";
import { ClassRoomReplayStore } from "../../stores/class-room-replay-store";
import { useTranslation } from "react-i18next";

export interface ChatPanelReplayProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { RoomStoppedModal } from "flat-components";
import { observer } from "mobx-react-lite";
import React, { useCallback } from "react";
import { RoomStatus } from "../../apiMiddleware/flatServer/constants";
import { RoomStatus } from "../../api-middleware/flatServer/constants";
import { RouteNameType, usePushHistory } from "../../utils/routes";

export interface RoomStatusStoppedModalProps {
Expand Down
2 changes: 1 addition & 1 deletion desktop/renderer-app/src/components/CloudStorageButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Modal } from "antd";
import { observer } from "mobx-react-lite";
import React, { useCallback, useState } from "react";
import { CloudStoragePage } from "../pages/CloudStoragePage";
import { WhiteboardStore } from "../stores/WhiteboardStore";
import { WhiteboardStore } from "../stores/whiteboard-store";
import { TopBarRightBtn } from "./TopBarRightBtn";
import "./CloudStorageButton.less";
import { useTranslation } from "react-i18next";
Expand Down
2 changes: 1 addition & 1 deletion desktop/renderer-app/src/components/DeviceSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Select } from "antd";
import { observer } from "mobx-react-lite";
import { Device } from "../types/Device";
import { Device } from "../types/device";

export interface DeviceSelectProps {
devices: Device[];
Expand Down
2 changes: 1 addition & 1 deletion desktop/renderer-app/src/components/ExitRoomConfirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ExitRoomConfirmModal,
StopClassConfirmModal,
} from "flat-components";
import { RoomStatus } from "../apiMiddleware/flatServer/constants";
import { RoomStatus } from "../api-middleware/flatServer/constants";
import { useSafePromise } from "../utils/hooks/lifecycle";
import { ipcAsyncByMainWindow, ipcReceive, ipcReceiveRemove } from "../utils/ipc";
import { RouteNameType, usePushHistory } from "../utils/routes";
Expand Down
2 changes: 1 addition & 1 deletion desktop/renderer-app/src/components/InviteButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from "react";
import { observer } from "mobx-react-lite";
import { TopBarRightBtn } from "./TopBarRightBtn";
import { RoomItem } from "../stores/RoomStore";
import { RoomItem } from "../stores/room-store";
import { InviteModal } from "./Modal/InviteModal";

export interface InviteButtonProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { MainPageLayout, MainPageLayoutItem, MainPageLayoutProps } from "flat-co
import { useTranslation } from "react-i18next";
import { routeConfig, RouteNameType } from "../../route-config";
import { GlobalStoreContext } from "../StoreProvider";
import { generateAvatar } from "../../utils/generateAvatar";
import { generateAvatar } from "../../utils/generate-avatar";

export interface MainPageLayoutContainerProps {
subMenu?: MainPageLayoutItem[];
Expand Down
4 changes: 2 additions & 2 deletions desktop/renderer-app/src/components/Modal/InviteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { observer } from "mobx-react-lite";
import { message } from "antd";
import { InviteModal as InviteModalImpl } from "flat-components";
import { useTranslation } from "react-i18next";
import { RoomItem } from "../../stores/RoomStore";
import { RoomItem } from "../../stores/room-store";
import { GlobalStoreContext, RoomStoreContext } from "../StoreProvider";
import { clipboard } from "electron";
import { errorTips } from "../Tips/ErrorTips";
import { INVITE_BASEURL } from "../../constants/Process";
import { INVITE_BASEURL } from "../../constants/process";

export interface InviteModalProps {
visible: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { observer } from "mobx-react-lite";
import { Button, Checkbox, message, Modal } from "antd";
import React, { useState } from "react";
import { roomStore } from "../../stores/RoomStore";
import { roomStore } from "../../stores/room-store";
import { errorTips } from "../Tips/ErrorTips";

interface RemoveRoomModalProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { observer } from "mobx-react-lite";
import React, { useState } from "react";
import { MenuItemProps } from "antd/lib/menu/MenuItem";
import { InviteModal } from "../Modal/InviteModal";
import { RoomItem } from "../../stores/RoomStore";
import { RoomItem } from "../../stores/room-store";

interface CopyInvitationItemProps extends MenuItemProps {
room: RoomItem | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Menu } from "antd";
import { MenuItemProps } from "antd/lib/menu/MenuItem";
import { observer } from "mobx-react-lite";
import React, { useState } from "react";
import { RoomItem, roomStore } from "../../stores/RoomStore";
import { RoomItem, roomStore } from "../../stores/room-store";
import { RemoveHistoryRoomModal } from "../Modal/RemoveHistoryRoomModal";
import { useSafePromise } from "../../utils/hooks/lifecycle";
import { errorTips } from "../Tips/ErrorTips";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Menu } from "antd";
import { MenuItemProps } from "antd/lib/menu/MenuItem";
import { observer } from "mobx-react-lite";
import React from "react";
import { RoomStatus } from "../../apiMiddleware/flatServer/constants";
import { RoomStatus } from "../../api-middleware/flatServer/constants";
import { RouteNameType } from "../../route-config";
import { RoomItem } from "../../stores/RoomStore";
import { RoomItem } from "../../stores/room-store";
import { usePushHistory } from "../../utils/routes";

interface ModifyRoomItemProps extends MenuItemProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Menu } from "antd";
import { MenuItemProps } from "antd/lib/menu/MenuItem";
import { observer } from "mobx-react-lite";
import React, { useState } from "react";
import { RoomStatus } from "../../apiMiddleware/flatServer/constants";
import { RoomItem } from "../../stores/RoomStore";
import { RoomStatus } from "../../api-middleware/flatServer/constants";
import { RoomItem } from "../../stores/room-store";
import { RemoveRoomModal } from "../Modal/RemoveRoomModal";

interface RemoveRoomItemProps extends MenuItemProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Menu } from "antd";
import { MenuItemProps } from "antd/lib/menu/MenuItem";
import { observer } from "mobx-react-lite";
import React from "react";
import { RoomItem } from "../../stores/RoomStore";
import { RoomItem } from "../../stores/room-store";
import { RouteNameType, usePushHistory } from "../../utils/routes";
import { useTranslation } from "react-i18next";

Expand Down
2 changes: 1 addition & 1 deletion desktop/renderer-app/src/components/RoomInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import classNames from "classnames";
import { RoomStatus, RoomType } from "../apiMiddleware/flatServer/constants";
import { RoomStatus, RoomType } from "../api-middleware/flatServer/constants";

import "./RoomInfo.less";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { observer } from "mobx-react-lite";
import { RoomStatus } from "../../apiMiddleware/flatServer/constants";
import { RoomStatus } from "../../api-middleware/flatServer/constants";
import "./RoomStatusElement.less";
import { RoomItem } from "../../stores/RoomStore";
import { RoomItem } from "../../stores/room-store";

export interface RoomStatusElementProps {
room: RoomItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "./style.less";
import React, { useEffect, useMemo, useRef } from "react";
import { observer } from "mobx-react-lite";
import classNames from "classnames";
import type { ShareScreenStore } from "../../../stores/ShareScreenStore";
import type { ShareScreenStore } from "../../../stores/share-screen-store";
import { ShareScreenTip } from "../ShareScreenTip";

interface ShareScreenProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ScreenInfo, ShareSymbol } from "../../../../apiMiddleware/share-screen";
import { ScreenInfo, ShareSymbol } from "../../../../api-middleware/share-screen";

export const uint8ArrayToImageURL = (buffer: Uint8Array): string => {
return URL.createObjectURL(
Expand Down
Loading