diff --git a/.eslintrc.js b/.eslintrc.js index 7c68796..b15675c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -19,7 +19,7 @@ module.exports = { // Node.js builtins. [`^(${require('module').builtinModules.join('|')})(/|$)`], // Internal packages. - ['^(src|app|main|server|overlay|web)(/.*|$)'], + ['^(src|ui|main|server|overlay|web)(/.*|$)'], // Parent imports. Put `..` last. ['^\\.\\.(?!/?$)', '^\\.\\./?$'], // Other relative imports. Put same-folder imports and `.` last. diff --git a/src/overlay/components/demoSwitch.tsx b/src/overlay/components/demoSwitch.tsx index a3f50bf..f91f3dc 100644 --- a/src/overlay/components/demoSwitch.tsx +++ b/src/overlay/components/demoSwitch.tsx @@ -3,7 +3,7 @@ import styled from '@emotion/styled'; import {set} from 'mobx'; import {observer} from 'mobx-react'; -import Checkbox from 'app/components/form/Checkbox'; +import Checkbox from 'ui/components/form/Checkbox'; type Props = { config: {demoMode?: boolean}; diff --git a/src/overlay/overlays/nowPlaying/index.tsx b/src/overlay/overlays/nowPlaying/index.tsx index c5df8af..aa5d6c3 100644 --- a/src/overlay/overlays/nowPlaying/index.tsx +++ b/src/overlay/overlays/nowPlaying/index.tsx @@ -4,9 +4,6 @@ import styled from '@emotion/styled'; import {set} from 'mobx'; import {observer} from 'mobx-react'; -import Checkbox from 'app/components/form/Checkbox'; -import Field from 'app/components/form/Field'; -import Text from 'app/components/form/Text'; import {OverlayDescriptor} from 'src/overlay'; import DemoSwitch from 'src/overlay/components/demoSwitch'; import LiveHistoryIndicator from 'src/overlay/components/liveHistoryIndicator'; @@ -14,6 +11,9 @@ import Select from 'src/renderer/components/form/Select'; import {AppConfig, AppStore, PlayedTrack} from 'src/shared/store'; import useRandomHistory from 'src/utils/useRandomHistory'; import withStore from 'src/utils/withStore'; +import Checkbox from 'ui/components/form/Checkbox'; +import Field from 'ui/components/form/Field'; +import Text from 'ui/components/form/Text'; import ColorConfig from './ColorConfig'; import {availableTags, Tags} from './tags'; diff --git a/src/renderer/app.tsx b/src/renderer/app.tsx index e05f58e..ee33cfb 100644 --- a/src/renderer/app.tsx +++ b/src/renderer/app.tsx @@ -7,12 +7,12 @@ import {Global} from '@emotion/react'; import * as Sentry from '@sentry/browser'; import {when} from 'mobx'; -import Application from 'app/views/Application'; import ThemeProvider from 'src/shared/components/ThemeProvider'; import globalCss, {noSelect} from 'src/shared/globalCss'; import {createStore} from 'src/shared/store'; import {StoreContext} from 'src/shared/store/context'; import {registerRendererConfigIpc, registerRendererIpc} from 'src/shared/store/ipc'; +import Application from 'ui/views/Application'; const mainElement = document.createElement('div'); document.body.appendChild(mainElement); diff --git a/src/renderer/components/device/DbStateIndicator.tsx b/src/renderer/components/device/DbStateIndicator.tsx index 97157bb..ea7bf50 100644 --- a/src/renderer/components/device/DbStateIndicator.tsx +++ b/src/renderer/components/device/DbStateIndicator.tsx @@ -3,9 +3,9 @@ import styled from '@emotion/styled'; import filesize from 'filesize'; import {observer} from 'mobx-react'; -import ProgressRing from 'app/components/ProgressRing'; import {AppStore} from 'src/shared/store'; import withStore from 'src/utils/withStore'; +import ProgressRing from 'ui/components/ProgressRing'; type Props = { store: AppStore; diff --git a/src/renderer/views/Application.tsx b/src/renderer/views/Application.tsx index 2a07f30..aadb931 100644 --- a/src/renderer/views/Application.tsx +++ b/src/renderer/views/Application.tsx @@ -1,11 +1,11 @@ import {MemoryRouter, Redirect, Route, Switch} from 'react-router-dom'; import styled from '@emotion/styled'; -import Titlebar from 'app/components/Titlebar'; -import Devices from 'app/views/devices'; -import OverlayConfig from 'app/views/overlayConfig'; -import Settings from 'app/views/settings'; import Navigation from 'src/renderer/components/Navigation'; +import Titlebar from 'ui/components/Titlebar'; +import Devices from 'ui/views/devices'; +import OverlayConfig from 'ui/views/overlayConfig'; +import Settings from 'ui/views/settings'; const Application = () => ( diff --git a/src/renderer/views/devices/index.tsx b/src/renderer/views/devices/index.tsx index 666154b..622dc60 100644 --- a/src/renderer/views/devices/index.tsx +++ b/src/renderer/views/devices/index.tsx @@ -4,19 +4,19 @@ import {groupBy} from 'lodash'; import {observer} from 'mobx-react'; import {DeviceType, NetworkState} from 'prolink-connect/lib/types'; -import ConnectingSplash from 'app/components/ConnectingSplash'; -import ConnectionError from 'app/components/ConnectionError'; -import BeatCounter from 'app/components/device/BeatCounter'; -import BpmIndicator from 'app/components/device/BpmIndicator'; -import DbStateIndicator from 'app/components/device/DbStateIndicator'; -import DeviceInfo from 'app/components/device/DeviceInfo'; -import Metadata from 'app/components/device/Metadata'; -import PlayState from 'app/components/device/PlayState'; -import IconCdj from 'app/icons/cdj'; -import IconDjm from 'app/icons/djm'; -import IconRekordbox from 'app/icons/rekordbox'; import {AppStore, DeviceStore} from 'src/shared/store'; import withStore from 'src/utils/withStore'; +import ConnectingSplash from 'ui/components/ConnectingSplash'; +import ConnectionError from 'ui/components/ConnectionError'; +import BeatCounter from 'ui/components/device/BeatCounter'; +import BpmIndicator from 'ui/components/device/BpmIndicator'; +import DbStateIndicator from 'ui/components/device/DbStateIndicator'; +import DeviceInfo from 'ui/components/device/DeviceInfo'; +import Metadata from 'ui/components/device/Metadata'; +import PlayState from 'ui/components/device/PlayState'; +import IconCdj from 'ui/icons/cdj'; +import IconDjm from 'ui/icons/djm'; +import IconRekordbox from 'ui/icons/rekordbox'; const sortById = (a: DeviceStore, b: DeviceStore) => a.device.id - b.device.id; diff --git a/src/renderer/views/overlayConfig/index.tsx b/src/renderer/views/overlayConfig/index.tsx index 451f82a..86ef51a 100644 --- a/src/renderer/views/overlayConfig/index.tsx +++ b/src/renderer/views/overlayConfig/index.tsx @@ -4,8 +4,8 @@ import styled from '@emotion/styled'; import {AnimatePresence} from 'framer-motion'; import {observer} from 'mobx-react'; -import ActionButton from 'app/components/ActionButton'; -import {Header, HeaderInfo} from 'app/components/PaneHeader'; +import ActionButton from 'ui/components/ActionButton'; +import {Header, HeaderInfo} from 'ui/components/PaneHeader'; import AvailableOverlays from './components/AvailableOverlays'; import OverlayList from './components/OverlayList'; diff --git a/src/renderer/views/settings/index.tsx b/src/renderer/views/settings/index.tsx index bbdd6e8..d059e76 100644 --- a/src/renderer/views/settings/index.tsx +++ b/src/renderer/views/settings/index.tsx @@ -3,12 +3,12 @@ import styled from '@emotion/styled'; import {set} from 'mobx'; import {observer} from 'mobx-react'; -import Checkbox from 'app/components/form/Checkbox'; -import Field from 'app/components/form/Field'; -import InfoBox from 'app/components/form/InfoBox'; -import Text from 'app/components/form/Text'; import {AppStore} from 'src/shared/store'; import withStore from 'src/utils/withStore'; +import Checkbox from 'ui/components/form/Checkbox'; +import Field from 'ui/components/form/Field'; +import InfoBox from 'ui/components/form/InfoBox'; +import Text from 'ui/components/form/Text'; type Props = { store: AppStore; diff --git a/tsconfig.json b/tsconfig.json index 36177c3..24ac412 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,7 @@ "baseUrl": "./src", "paths": { "src/*": ["./*"], - "app/*": ["./renderer/*"], + "ui/*": ["./renderer/*"], "main/*": ["./main/*"], "overlay/*": ["./overlay/*"], "server/*": ["./server/*"], diff --git a/webpack.config.base.ts b/webpack.config.base.ts index d3d42ae..44d29a1 100644 --- a/webpack.config.base.ts +++ b/webpack.config.base.ts @@ -31,7 +31,7 @@ export const baseConfig: webpack.Configuration = { extensions: ['.tsx', '.ts', '.js', '.ttf'], alias: { main: path.resolve(__dirname, 'src/main/'), - app: path.resolve(__dirname, 'src/renderer/'), + ui: path.resolve(__dirname, 'src/renderer/'), overlay: path.resolve(__dirname, 'src/overlay/'), web: path.resolve(__dirname, 'src/website/'), src: path.resolve(__dirname, 'src/'),