diff --git a/.prettierrc b/.prettierrc index 98cccb3..31b3103 100644 --- a/.prettierrc +++ b/.prettierrc @@ -6,4 +6,4 @@ "trailingComma": "all", "useTabs": false, "tabWidth": 2 -} \ No newline at end of file +} diff --git a/README.md b/README.md index 12e2315..dbaa6a0 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,27 @@ # New-Phone-Who-Dis (NPWD) + NPWD is our current running project. Our team has been working on the project since Auguest, 2020. This resource isn’t complete yet and currently has no ETA for release. Feel free to test it out in a dev enviorment by following the installation guide. Written completely by the Project Error Dev Team in [React](https://reactjs.org/) with a [TypeScript](https://www.typescriptlang.org/) client/server environment. ## Project Error Discord + - Join the [Discord](https://discord.gg/HYwBjTbAY5) to follow current development of the project. -## Documentation & Installation +## Documentation & Installation + - [Project-Error Docs](https://docs.projecterror.dev/#/) contains all the information regarding this resource. Please consult it for installation, dependencies, and other important information. ## Support -No support is being provided currently for the resource as it is still in an unfinished state. +No support is being provided currently for the resource as it is still in an unfinished state. Should you encounter any issues, please do the following: - Check the [Git Kraken](https://app.gitkraken.com/glo/board/X9YZ_x_SVQEcMwpH) to see if the issue you're referring to is already tracked. - Check the [State of Development](https://docs.projecterror.dev/#/npwd/state-of-dev?id=introduction) to see if the app is still a **WIP**. - - If the issue isn't on the Git Kraken and the app is finished, please open an issue. - - If the issue isn't on the Git Kraken and the app is **not** finished, please contact us in Discord. + - If the issue isn't on the Git Kraken and the app is finished, please open an issue. + - If the issue isn't on the Git Kraken and the app is **not** finished, please contact us in Discord. We do not want issues opened that are due to the phone being **WIP** as this slows down development since we now have to address it more immediately. @@ -27,7 +30,9 @@ We do not want issues opened that are due to the phone being **WIP** as this slo [Latest Teaser Video (October 28th)](https://streamable.com/f1ri9r) #### Apps (February 20th, 2021) + Most of these apps have UI that does **not** represent the final product and are subject to change. + - [**Bank**](https://i.imgur.com/P5Dg0Mj.png) - [**Calculator**](https://i.imgur.com/96e3bFF.png) - [**Camera**](https://i.imgur.com/1aGEV28.png) diff --git a/config.json b/config.json index 5415761..7e97a4a 100644 --- a/config.json +++ b/config.json @@ -1,37 +1,37 @@ { - "Locale": "en", - "KeyTogglePhone": 288, - "KeyTakeCall": 38, - "PhoneAsItem": false, - "SwimDestroy": false, - "RunRate": 10, - "DestoryChance": 100, - "DestroyPhoneReCheck": 3, - "notificationPosition": { - "horizontal": "right", - "vertical": "top" - }, - "general": { - "useDashNumber": true - }, - "twitter": { - "showNotifications": true, - "generateProfileNameFromUsers": true, - "allowEdtiableProfileName": true, - "allowDeleteTweets": true, - "allowReportTweets": true, - "characterLimit": 160, - "newLineLimit": 10, - "enableAvatars": true, - "enableEmojis": true, - "enableImages": true, - "maxImages": 3 - }, - "bank": { - "showNotifications": true - }, - "debug": { - "level": "debug", - "enabled": true - } - } \ No newline at end of file + "Locale": "en", + "KeyTogglePhone": 288, + "KeyTakeCall": 38, + "PhoneAsItem": false, + "SwimDestroy": false, + "RunRate": 10, + "DestoryChance": 100, + "DestroyPhoneReCheck": 3, + "notificationPosition": { + "horizontal": "right", + "vertical": "top" + }, + "general": { + "useDashNumber": true + }, + "twitter": { + "showNotifications": true, + "generateProfileNameFromUsers": true, + "allowEdtiableProfileName": true, + "allowDeleteTweets": true, + "allowReportTweets": true, + "characterLimit": 160, + "newLineLimit": 10, + "enableAvatars": true, + "enableEmojis": true, + "enableImages": true, + "maxImages": 3 + }, + "bank": { + "showNotifications": true + }, + "debug": { + "level": "debug", + "enabled": true + } +} diff --git a/lerna.json b/lerna.json index 01cedd1..989acb7 100644 --- a/lerna.json +++ b/lerna.json @@ -1,8 +1,5 @@ { - "packages": [ - "phone", - "resources" - ], + "packages": ["phone", "resources"], "version": "0.0.0", "npmClient": "yarn" } diff --git a/package.json b/package.json index 8053c2a..47e0e24 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ }, "scripts": { "build": "lerna run build --concurrency 1", - "prepare": "husky install" + "prepare": "husky install", + "format": "pretty-quick" }, "husky": { "hooks": { diff --git a/phone/README.md b/phone/README.md index a659e64..0d609fb 100644 --- a/phone/README.md +++ b/phone/README.md @@ -1,2 +1,3 @@ # New Phone Who Dis + A FiveM phone created with ReactJS, with the power from BTNGaming, kidz, ROCKY_shouthpaw and chip. diff --git a/phone/prettier.config.js b/phone/prettier.config.js index ecaf117..e10e5fe 100644 --- a/phone/prettier.config.js +++ b/phone/prettier.config.js @@ -1,10 +1,10 @@ // Taso: Including some default values for clarity sake module.exports = { - trailingComma: "es5", + trailingComma: 'es5', tabWidth: 2, semi: true, singleQuote: true, jsxSingleQuote: true, jsxBracketSameLine: false, - bracketSpacing: true -} \ No newline at end of file + bracketSpacing: true, +}; diff --git a/phone/public/index.html b/phone/public/index.html index bd892da..df2e9a6 100644 --- a/phone/public/index.html +++ b/phone/public/index.html @@ -2,8 +2,14 @@ - - + + Project Error - New Phone Who Dis diff --git a/phone/src/apps/bank/hooks/useBankModal.ts b/phone/src/apps/bank/hooks/useBankModal.ts index ad84007..06cda87 100644 --- a/phone/src/apps/bank/hooks/useBankModal.ts +++ b/phone/src/apps/bank/hooks/useBankModal.ts @@ -7,6 +7,6 @@ interface BankModalProps { } export const useBankModal = (): BankModalProps => { - const [ showBankModal, setShowBankModal ] = useRecoilState(bankState.bankModal); + const [showBankModal, setShowBankModal] = useRecoilState(bankState.bankModal); return { showBankModal, setShowBankModal }; }; diff --git a/phone/src/apps/bank/hooks/useBankService.ts b/phone/src/apps/bank/hooks/useBankService.ts index 19841ae..0a85d91 100644 --- a/phone/src/apps/bank/hooks/useBankService.ts +++ b/phone/src/apps/bank/hooks/useBankService.ts @@ -10,7 +10,7 @@ export const useBankService = () => { const setTransaction = useSetRecoilState(bankState.transactions); const setCredentials = useSetRecoilState(bankState.bankCredentials); const setNotification = useSetRecoilState(bankState.notification); - const { addAlert } = useSnackbar() + const { addAlert } = useSnackbar(); useNuiEvent('BANK', 'setTransaction', setTransaction); useNuiEvent('BANK', 'setCredentials', setCredentials); diff --git a/phone/src/apps/calculator/components/CalculatorIcon.tsx b/phone/src/apps/calculator/components/CalculatorIcon.tsx index 0db3dd3..fd8d201 100644 --- a/phone/src/apps/calculator/components/CalculatorIcon.tsx +++ b/phone/src/apps/calculator/components/CalculatorIcon.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { SvgIcon, SvgIconProps } from '@material-ui/core'; -export const CalculatorIcon = ({ ...props}: SvgIconProps) => { +export const CalculatorIcon = ({ ...props }: SvgIconProps) => { return ( { const { getContact } = useContacts(); const { id } = useParams(); - const { addNumber, referal } = useQueryParams({ referal: '/contacts' }); + const { addNumber, referal } = useQueryParams({ + referal: '/contacts', + }); const contact = getContact(parseInt(id)); diff --git a/phone/src/apps/contacts/hooks/state.ts b/phone/src/apps/contacts/hooks/state.ts index 9d16e4e..dfff261 100644 --- a/phone/src/apps/contacts/hooks/state.ts +++ b/phone/src/apps/contacts/hooks/state.ts @@ -20,5 +20,5 @@ export const contactsState = { contactDetail: atom({ key: 'contactDetail', default: null, - }) + }), }; diff --git a/phone/src/apps/contacts/hooks/useContactsService.ts b/phone/src/apps/contacts/hooks/useContactsService.ts index fbdc96a..9c8074b 100644 --- a/phone/src/apps/contacts/hooks/useContactsService.ts +++ b/phone/src/apps/contacts/hooks/useContactsService.ts @@ -6,8 +6,8 @@ import { useSnackbar } from '../../../ui/hooks/useSnackbar'; export const useContactsService = () => { const setContacts = useSetRecoilState(contactsState.contacts); - const { addAlert } = useSnackbar() - + const { addAlert } = useSnackbar(); + useNuiEvent('CONTACTS', 'setContacts', setContacts); useNuiEvent('CONTACTS', 'setAlert', addAlert); return useContacts(); diff --git a/phone/src/apps/dialer/components/DialPadGrid.tsx b/phone/src/apps/dialer/components/DialPadGrid.tsx index d59fadb..803c952 100644 --- a/phone/src/apps/dialer/components/DialPadGrid.tsx +++ b/phone/src/apps/dialer/components/DialPadGrid.tsx @@ -19,7 +19,12 @@ const ButtonItem = ({ label, onClick }: IBtnItem) => { const classes = useStyles(); return ( - @@ -27,10 +32,10 @@ const ButtonItem = ({ label, onClick }: IBtnItem) => { }; export const DialGrid = () => { - const { add, removeOne, clear} = useContext(DialInputCtx) + const { add, removeOne, clear } = useContext(DialInputCtx); return ( - + add(1)} /> add(2)} /> diff --git a/phone/src/apps/dialer/components/DialerInput.tsx b/phone/src/apps/dialer/components/DialerInput.tsx index 2ab6f73..7f96bbf 100644 --- a/phone/src/apps/dialer/components/DialerInput.tsx +++ b/phone/src/apps/dialer/components/DialerInput.tsx @@ -39,8 +39,8 @@ export const DialerInput = () => { }; const handleNewContact = (number: string) => { - history.push(`/contacts/-1/?addNumber=${number}&referal=/phone/contacts`) - } + history.push(`/contacts/-1/?addNumber=${number}&referal=/phone/contacts`); + }; return ( @@ -50,10 +50,13 @@ export const DialerInput = () => { value={inputVal} /> - handleCall(inputVal)} /> + handleCall(inputVal)} /> - handleNewContact(inputVal)} /> + handleNewContact(inputVal)} + /> ); diff --git a/phone/src/apps/dialer/components/DialerNavBar.tsx b/phone/src/apps/dialer/components/DialerNavBar.tsx index 1904c59..32bbe78 100644 --- a/phone/src/apps/dialer/components/DialerNavBar.tsx +++ b/phone/src/apps/dialer/components/DialerNavBar.tsx @@ -42,7 +42,7 @@ const DialerNavBar = () => { } to='/phone/dial' @@ -50,7 +50,7 @@ const DialerNavBar = () => { } to='/phone/contacts' diff --git a/phone/src/apps/dialer/components/views/DialerHistory.tsx b/phone/src/apps/dialer/components/views/DialerHistory.tsx index 80a8dab..be95d72 100644 --- a/phone/src/apps/dialer/components/views/DialerHistory.tsx +++ b/phone/src/apps/dialer/components/views/DialerHistory.tsx @@ -62,10 +62,7 @@ export const DialerHistory = ({ calls }) => { {calls.map((call: ICall) => call.transmitter === number ? ( - + {} @@ -91,10 +88,7 @@ export const DialerHistory = ({ calls }) => { ) : null} ) : ( - + {} diff --git a/phone/src/apps/dialer/dialer.theme.ts b/phone/src/apps/dialer/dialer.theme.ts index 4a7127d..abbc8b8 100644 --- a/phone/src/apps/dialer/dialer.theme.ts +++ b/phone/src/apps/dialer/dialer.theme.ts @@ -1,4 +1,4 @@ -import { common, green } from "@material-ui/core/colors"; +import { common, green } from '@material-ui/core/colors'; export const DIALER_APP_PRIMARY_COLOR = green[600]; export const DIALER_APP_TEXT_COLOR = common.white; @@ -9,9 +9,9 @@ const theme = { main: DIALER_APP_PRIMARY_COLOR, dark: green[800], light: green[400], - contrastText: DIALER_APP_TEXT_COLOR - } - } -} + contrastText: DIALER_APP_TEXT_COLOR, + }, + }, +}; export default theme; diff --git a/phone/src/apps/example/example.theme.ts b/phone/src/apps/example/example.theme.ts index ff72081..79c1eb2 100644 --- a/phone/src/apps/example/example.theme.ts +++ b/phone/src/apps/example/example.theme.ts @@ -1,9 +1,9 @@ const theme = { palette: { primary: { - main: '#f23123' - } - } -} + main: '#f23123', + }, + }, +}; -export default theme; \ No newline at end of file +export default theme; diff --git a/phone/src/apps/home/components/Home.tsx b/phone/src/apps/home/components/Home.tsx index da22aa0..32a63e4 100644 --- a/phone/src/apps/home/components/Home.tsx +++ b/phone/src/apps/home/components/Home.tsx @@ -8,7 +8,7 @@ export const HomeApp = () => { const { apps } = useApps(); return ( - + {apps && } diff --git a/phone/src/apps/messages/components/form/NewMessageGroupButton.tsx b/phone/src/apps/messages/components/form/NewMessageGroupButton.tsx index 57ab78d..f60132c 100644 --- a/phone/src/apps/messages/components/form/NewMessageGroupButton.tsx +++ b/phone/src/apps/messages/components/form/NewMessageGroupButton.tsx @@ -21,13 +21,9 @@ export function NewMessageGroupButton({ const classes = useStyles(); return ( - - - + + + ); } diff --git a/phone/src/apps/messages/components/form/NewMessageGroupForm.tsx b/phone/src/apps/messages/components/form/NewMessageGroupForm.tsx index 738c79a..29f5842 100644 --- a/phone/src/apps/messages/components/form/NewMessageGroupForm.tsx +++ b/phone/src/apps/messages/components/form/NewMessageGroupForm.tsx @@ -101,8 +101,14 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => { )} - diff --git a/phone/src/apps/messages/components/list/MessagesList.tsx b/phone/src/apps/messages/components/list/MessagesList.tsx index aa9d09d..e6ca930 100644 --- a/phone/src/apps/messages/components/list/MessagesList.tsx +++ b/phone/src/apps/messages/components/list/MessagesList.tsx @@ -41,7 +41,12 @@ const MessagesList = (): any => { goToConversation(findGroup); } } - }, [messageGroups, createMessageGroupResult, goToConversation, clearMessageGroupResult]); + }, [ + messageGroups, + createMessageGroupResult, + goToConversation, + clearMessageGroupResult, + ]); if (!messageGroups) return null; diff --git a/phone/src/apps/messages/components/modal/MessageImageModal.tsx b/phone/src/apps/messages/components/modal/MessageImageModal.tsx index 3fb388e..0de1c0c 100644 --- a/phone/src/apps/messages/components/modal/MessageImageModal.tsx +++ b/phone/src/apps/messages/components/modal/MessageImageModal.tsx @@ -84,7 +84,6 @@ export const MessageImageModal = ({ })}` ), }, - ], [history, pathname, search] ); diff --git a/phone/src/apps/messages/hooks/useMessages.ts b/phone/src/apps/messages/hooks/useMessages.ts index c093d4b..31b3037 100644 --- a/phone/src/apps/messages/hooks/useMessages.ts +++ b/phone/src/apps/messages/hooks/useMessages.ts @@ -1,5 +1,9 @@ import { useRecoilState, useRecoilValue } from 'recoil'; -import { CreateMessageGroupResult, Message, MessageGroup } from '../../../common/typings/messages'; +import { + CreateMessageGroupResult, + Message, + MessageGroup, +} from '../../../common/typings/messages'; import { messageState } from './state'; interface IUseMessages { @@ -18,11 +22,20 @@ export default (): IUseMessages => { messageState.messageGroups ); - const [createMessageGroupResult, setCreateMessageGroupResult] = useRecoilState( + const [ + createMessageGroupResult, + setCreateMessageGroupResult, + ] = useRecoilState( messageState.createMessageGroupResult ); const clearMessageGroupResult = () => setCreateMessageGroupResult(null); - return { messages, setMessages, messageGroups, createMessageGroupResult, clearMessageGroupResult }; + return { + messages, + setMessages, + messageGroups, + createMessageGroupResult, + clearMessageGroupResult, + }; }; diff --git a/phone/src/apps/messages/messages.theme.ts b/phone/src/apps/messages/messages.theme.ts index 01dd7dc..511b531 100644 --- a/phone/src/apps/messages/messages.theme.ts +++ b/phone/src/apps/messages/messages.theme.ts @@ -9,7 +9,7 @@ const theme = { main: MESSAGES_APP_PRIMARY_COLOR, dark: amber[900], light: amber[100], - contrastText: MESSAGES_APP_TEXT_COLOR + contrastText: MESSAGES_APP_TEXT_COLOR, }, }, }; diff --git a/phone/src/apps/notes/hooks/state.ts b/phone/src/apps/notes/hooks/state.ts index b01b7ba..37c31d5 100644 --- a/phone/src/apps/notes/hooks/state.ts +++ b/phone/src/apps/notes/hooks/state.ts @@ -12,5 +12,5 @@ export const noteStates = { noteDetail: atom({ key: 'noteDetail', default: null, - }) + }), }; diff --git a/phone/src/apps/notes/hooks/useNotes.ts b/phone/src/apps/notes/hooks/useNotes.ts index e663ec3..c22cd37 100644 --- a/phone/src/apps/notes/hooks/useNotes.ts +++ b/phone/src/apps/notes/hooks/useNotes.ts @@ -1,6 +1,6 @@ import { useRecoilValue } from 'recoil'; import { Note } from '../../../common/typings/notes'; -import { noteStates } from './state'; +import { noteStates } from './state'; interface NotesProps { notes: Note[]; @@ -9,4 +9,4 @@ interface NotesProps { export const useNotes = (): NotesProps => { const notes = useRecoilValue(noteStates.noteItems); return { notes }; -} +}; diff --git a/phone/src/apps/notes/modal/NoteModal.tsx b/phone/src/apps/notes/modal/NoteModal.tsx index 2b3b110..0f4e910 100644 --- a/phone/src/apps/notes/modal/NoteModal.tsx +++ b/phone/src/apps/notes/modal/NoteModal.tsx @@ -102,7 +102,7 @@ export const NoteModal = () => { {detail.content.length}/250 {!detail.id ? ( <> - + - + { ) : ( <> - + - + ({ marginBottom: 20, }, icon: { - color: theme.palette.primary.main + color: theme.palette.primary.main, }, header: { margin: 10, diff --git a/phone/src/apps/sellout/hooks/useSelloutService.ts b/phone/src/apps/sellout/hooks/useSelloutService.ts index 98b9094..ae241ac 100644 --- a/phone/src/apps/sellout/hooks/useSelloutService.ts +++ b/phone/src/apps/sellout/hooks/useSelloutService.ts @@ -11,4 +11,4 @@ export const useSelloutService = () => { useNuiEvent('SELLOUT', 'setAlert', addAlert); useNuiEvent('SELLOUT', 'setListings', setSellout); return useListing(); -}; \ No newline at end of file +}; diff --git a/phone/src/apps/sellout/providers/SelloutThemeProvider.tsx b/phone/src/apps/sellout/providers/SelloutThemeProvider.tsx index bbec2f5..6b7cd93 100644 --- a/phone/src/apps/sellout/providers/SelloutThemeProvider.tsx +++ b/phone/src/apps/sellout/providers/SelloutThemeProvider.tsx @@ -1,4 +1,4 @@ -import { createAppThemeProvider } from "../../../os/apps/utils/createAppThemeProvider"; +import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider'; import selloutTheme from '../sellout.theme'; diff --git a/phone/src/apps/sellout/sellout.theme.ts b/phone/src/apps/sellout/sellout.theme.ts index 92e3f23..43d145b 100644 --- a/phone/src/apps/sellout/sellout.theme.ts +++ b/phone/src/apps/sellout/sellout.theme.ts @@ -1,4 +1,4 @@ -import { common, red } from "@material-ui/core/colors"; +import { common, red } from '@material-ui/core/colors'; export const SELLOUT_APP_PRIMARY_COLOR = red[500]; export const SELLOUT_APP_ICON_COLOR = common.white; @@ -10,9 +10,9 @@ const theme = { main: SELLOUT_APP_PRIMARY_COLOR, dark: red[700], light: red[200], - contrastText: SELLOUT_APP_TEXT_COLOR - } - } -} + contrastText: SELLOUT_APP_TEXT_COLOR, + }, + }, +}; export default theme; diff --git a/phone/src/apps/twitter/components/TwitterApp.tsx b/phone/src/apps/twitter/components/TwitterApp.tsx index 583a89a..2003f07 100644 --- a/phone/src/apps/twitter/components/TwitterApp.tsx +++ b/phone/src/apps/twitter/components/TwitterApp.tsx @@ -186,7 +186,8 @@ InjectDebugData( profile_name: 'ItsChip', isMine: false, isReported: false, - message: 'I have tweeted this because Im even more badass... And I need this to be longer so I will continue to write', + message: + 'I have tweeted this because Im even more badass... And I need this to be longer so I will continue to write', }, }, ], diff --git a/phone/src/apps/twitter/components/images/ImagePrompt.tsx b/phone/src/apps/twitter/components/images/ImagePrompt.tsx index a1b8001..89d0d7b 100644 --- a/phone/src/apps/twitter/components/images/ImagePrompt.tsx +++ b/phone/src/apps/twitter/components/images/ImagePrompt.tsx @@ -23,10 +23,9 @@ export const ImagePrompt = ({ visible, value, handleChange }) => { textFieldRef.current && textFieldRef.current.focus(); }, [visible]); - const handleImageChange = useCallback( - (e) => handleChange(e.target.value), - [handleChange] - ); + const handleImageChange = useCallback((e) => handleChange(e.target.value), [ + handleChange, + ]); if (!visible) return null; return ( diff --git a/phone/src/apps/twitter/components/tweet/TweetMessage.tsx b/phone/src/apps/twitter/components/tweet/TweetMessage.tsx index 0643613..efcf0e4 100644 --- a/phone/src/apps/twitter/components/tweet/TweetMessage.tsx +++ b/phone/src/apps/twitter/components/tweet/TweetMessage.tsx @@ -15,7 +15,7 @@ const useStyles = makeStyles({ }, textFieldInput: { fontSize: '22px', - paddingTop: '8px' + paddingTop: '8px', }, }); diff --git a/phone/src/apps/twitter/hooks/useTwitterService.ts b/phone/src/apps/twitter/hooks/useTwitterService.ts index 410e4d1..b5a2f26 100644 --- a/phone/src/apps/twitter/hooks/useTwitterService.ts +++ b/phone/src/apps/twitter/hooks/useTwitterService.ts @@ -30,7 +30,7 @@ function processTweet(tweet) { * there and have moved that logic here instead. */ export const useTwitterService = () => { - const { addAlert } = useSnackbar() + const { addAlert } = useSnackbar(); const { setNotification } = useTwitterNotifications(); const setProfile = useSetRecoilState(twitterState.profile); @@ -38,7 +38,6 @@ export const useTwitterService = () => { twitterState.updateProfileLoading ); - const setTweets = useSetRecoilState(twitterState.tweets); const setFilteredTweets = useSetRecoilState(twitterState.filteredTweets); const setCreateLoading = useSetRecoilState(twitterState.createTweetLoading); @@ -58,4 +57,4 @@ export const useTwitterService = () => { useNuiEvent(APP_TWITTER, 'createTweetLoading', setCreateLoading); useNuiEvent(APP_TWITTER, 'createTweetResult', addAlert); useNuiEvent(APP_TWITTER, 'createTweetBroadcast', setNotification); -}; \ No newline at end of file +}; diff --git a/phone/src/apps/twitter/utils/message.ts b/phone/src/apps/twitter/utils/message.ts index cb8f6a7..113c3f5 100644 --- a/phone/src/apps/twitter/utils/message.ts +++ b/phone/src/apps/twitter/utils/message.ts @@ -1,4 +1,3 @@ - export function getNewLineCount(message: string): number { - return message.split(/\r\n|\r|\n/).length; -} \ No newline at end of file + return message.split(/\r\n|\r|\n/).length; +} diff --git a/phone/src/common/typings/alerts.ts b/phone/src/common/typings/alerts.ts index 067b731..d34e127 100644 --- a/phone/src/common/typings/alerts.ts +++ b/phone/src/common/typings/alerts.ts @@ -1,4 +1,4 @@ export interface IAlertProps { message: string; type: 'success' | 'error'; -} \ No newline at end of file +} diff --git a/phone/src/common/typings/marketplace.ts b/phone/src/common/typings/marketplace.ts index 6e6bdd3..385a160 100644 --- a/phone/src/common/typings/marketplace.ts +++ b/phone/src/common/typings/marketplace.ts @@ -6,4 +6,4 @@ export interface MarketplaceListing { title: string; url: string; description: string; -} \ No newline at end of file +} diff --git a/phone/src/common/typings/notes.ts b/phone/src/common/typings/notes.ts index 8d46deb..ec8fdb6 100644 --- a/phone/src/common/typings/notes.ts +++ b/phone/src/common/typings/notes.ts @@ -1,18 +1,16 @@ -export type AlertCategory = +export type AlertCategory = | 'NOTES_ADD_SUCCESS' | 'NOTES_ADD_FAILED' | 'NOTES_UPDATE_SUCCESS' | 'NOTES_UPDATE_FAILED' | 'NOTES_DELETE_SUCCESS' - | 'NOTES_DELETE_FAILED' - + | 'NOTES_DELETE_FAILED'; export interface INotesAlert { alert: AlertCategory; setAlert: (type: AlertCategory) => void; } - export interface Note { id?: number; title: string; diff --git a/phone/src/config.autogen.json b/phone/src/config.autogen.json index 5415761..7e97a4a 100644 --- a/phone/src/config.autogen.json +++ b/phone/src/config.autogen.json @@ -1,37 +1,37 @@ { - "Locale": "en", - "KeyTogglePhone": 288, - "KeyTakeCall": 38, - "PhoneAsItem": false, - "SwimDestroy": false, - "RunRate": 10, - "DestoryChance": 100, - "DestroyPhoneReCheck": 3, - "notificationPosition": { - "horizontal": "right", - "vertical": "top" - }, - "general": { - "useDashNumber": true - }, - "twitter": { - "showNotifications": true, - "generateProfileNameFromUsers": true, - "allowEdtiableProfileName": true, - "allowDeleteTweets": true, - "allowReportTweets": true, - "characterLimit": 160, - "newLineLimit": 10, - "enableAvatars": true, - "enableEmojis": true, - "enableImages": true, - "maxImages": 3 - }, - "bank": { - "showNotifications": true - }, - "debug": { - "level": "debug", - "enabled": true - } - } \ No newline at end of file + "Locale": "en", + "KeyTogglePhone": 288, + "KeyTakeCall": 38, + "PhoneAsItem": false, + "SwimDestroy": false, + "RunRate": 10, + "DestoryChance": 100, + "DestroyPhoneReCheck": 3, + "notificationPosition": { + "horizontal": "right", + "vertical": "top" + }, + "general": { + "useDashNumber": true + }, + "twitter": { + "showNotifications": true, + "generateProfileNameFromUsers": true, + "allowEdtiableProfileName": true, + "allowDeleteTweets": true, + "allowReportTweets": true, + "characterLimit": 160, + "newLineLimit": 10, + "enableAvatars": true, + "enableEmojis": true, + "enableImages": true, + "maxImages": 3 + }, + "bank": { + "showNotifications": true + }, + "debug": { + "level": "debug", + "enabled": true + } +} diff --git a/phone/src/locale/bh.json b/phone/src/locale/bh.json index 96bc600..b74f6e9 100644 --- a/phone/src/locale/bh.json +++ b/phone/src/locale/bh.json @@ -100,7 +100,7 @@ "APPS_NOTES_UPDATE_FAILED": "Failed to update note.", "APPS_NOTES_DELETE_SUCCESS": "Successfully deleted note.", "APPS_NOTES_DELETE_FAILED": "Failed to delete note.", - + "APPS_CALCULATOR_COPIED": "Result was copied to clipboard!", "APPS_MARKETPLACE_CREATE_LISTING_SUCCESS": "Successfully created a new listing", diff --git a/phone/src/locale/es.json b/phone/src/locale/es.json index f9ebe95..1043cd0 100644 --- a/phone/src/locale/es.json +++ b/phone/src/locale/es.json @@ -113,7 +113,7 @@ "APPS_SETTINGS_OPTION_ZOOM": "Ampliar", "APPS_SETTINGS_OPTION_RINGTONE": "Tono de llamada", "APPS_SETTINGS_OPTION_RINGTONEVOL": "Volumen del tono de llamada", - + "APPS_SETTINGS_OPTION_NOTIFICATION": "Notificacion", "APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Notificacion de volumen", diff --git a/phone/src/locale/fr.json b/phone/src/locale/fr.json index d8702e2..be62095 100644 --- a/phone/src/locale/fr.json +++ b/phone/src/locale/fr.json @@ -115,7 +115,7 @@ "APPS_SETTINGS_OPTION_RINGTONEVOL": "Volume de la sonnerie", "APPS_SETTINGS_OPTION_NOTIFICATION": "Notification", "APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Volume des notifications", - + "GENERIC_SAVE": "Sauvegarder", "GENERIC_UPDATE": "Mettre à jour", "GENERIC_DELETE": "Supprimer", diff --git a/phone/src/os/apps/config/apps.tsx b/phone/src/os/apps/config/apps.tsx index 4a08f50..853bf5f 100644 --- a/phone/src/os/apps/config/apps.tsx +++ b/phone/src/os/apps/config/apps.tsx @@ -1,10 +1,5 @@ import React from 'react'; -import { - blue, - common, - grey, - purple, -} from '@material-ui/core/colors'; +import { blue, common, grey, purple } from '@material-ui/core/colors'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faAd, @@ -41,9 +36,18 @@ import { CONTACTS_APP_PRIMARY_COLOR, CONTACTS_APP_TEXT_COLOR, } from '../../../apps/contacts/contacts.theme'; -import { SELLOUT_APP_PRIMARY_COLOR, SELLOUT_APP_ICON_COLOR } from '../../../apps/sellout/sellout.theme'; -import { NOTES_APP_ICON_COLOR, NOTES_APP_PRIMARY_COLOR } from '../../../apps/notes/notes.theme'; -import { DIALER_APP_PRIMARY_COLOR, DIALER_APP_TEXT_COLOR } from '../../../apps/dialer/dialer.theme'; +import { + SELLOUT_APP_PRIMARY_COLOR, + SELLOUT_APP_ICON_COLOR, +} from '../../../apps/sellout/sellout.theme'; +import { + NOTES_APP_ICON_COLOR, + NOTES_APP_PRIMARY_COLOR, +} from '../../../apps/notes/notes.theme'; +import { + DIALER_APP_PRIMARY_COLOR, + DIALER_APP_TEXT_COLOR, +} from '../../../apps/dialer/dialer.theme'; export interface IAppConfig { id: string; @@ -70,7 +74,7 @@ export const APPS: IAppConfig[] = [ { id: 'MESSAGES', nameLocale: 'APPS_MESSAGES', - icon: , + icon: , notificationIcon: , backgroundColor: MESSAGES_APP_PRIMARY_COLOR, color: MESSAGES_APP_TEXT_COLOR, @@ -82,7 +86,7 @@ export const APPS: IAppConfig[] = [ { id: 'CONTACTS', nameLocale: 'APPS_CONTACTS', - icon: , + icon: , notificationIcon: , backgroundColor: CONTACTS_APP_PRIMARY_COLOR, color: CONTACTS_APP_TEXT_COLOR, @@ -94,7 +98,7 @@ export const APPS: IAppConfig[] = [ { id: 'CALCULATOR', nameLocale: 'APPS_CALCULATOR', - icon: , + icon: , notificationIcon: , backgroundColor: purple[500], color: grey[50], @@ -106,7 +110,7 @@ export const APPS: IAppConfig[] = [ { id: 'SETTINGS', nameLocale: 'APPS_SETTINGS', - icon: , + icon: , notificationIcon: , backgroundColor: '#383838', color: grey[50], diff --git a/phone/src/os/apps/utils/deepMergeObjects.ts b/phone/src/os/apps/utils/deepMergeObjects.ts index f009242..006deef 100644 --- a/phone/src/os/apps/utils/deepMergeObjects.ts +++ b/phone/src/os/apps/utils/deepMergeObjects.ts @@ -5,7 +5,7 @@ * @returns {boolean} */ export function isObject(item) { - return (item && typeof item === 'object' && !Array.isArray(item)); + return item && typeof item === 'object' && !Array.isArray(item); } /** @@ -29,4 +29,4 @@ export function deepMergeObjects(target, ...sources) { } return deepMergeObjects(target, ...sources); -} \ No newline at end of file +} diff --git a/phone/src/os/call/components/CallModal.tsx b/phone/src/os/call/components/CallModal.tsx index 4a3e390..e48c4c5 100644 --- a/phone/src/os/call/components/CallModal.tsx +++ b/phone/src/os/call/components/CallModal.tsx @@ -19,7 +19,7 @@ export const CallModal = () => {
- +
diff --git a/phone/src/os/call/components/CallTimer.tsx b/phone/src/os/call/components/CallTimer.tsx index 4a65284..20c39ce 100644 --- a/phone/src/os/call/components/CallTimer.tsx +++ b/phone/src/os/call/components/CallTimer.tsx @@ -1,7 +1,6 @@ import React, { useEffect, useRef } from 'react'; import { useDuration } from '../hooks/useDuration'; - const runTimer = (updatedTime, setDuration) => { let newTime = { ...updatedTime.current }; if (newTime.m >= 60) { @@ -17,25 +16,24 @@ const runTimer = (updatedTime, setDuration) => { newTime = { ...newTime, ms: newTime.ms + 1 }; updatedTime.current = newTime; setDuration(newTime); -} +}; function CallTimer({ isAccepted }) { const { duration, setDuration } = useDuration(); const updatedTime = useRef({ ms: 0, s: 0, m: 0, h: 0 }); - const timer = useRef(null) - + const timer = useRef(null); useEffect(() => { if (isAccepted) { - runTimer(updatedTime, setDuration) + runTimer(updatedTime, setDuration); timer.current = setInterval(() => { - runTimer(updatedTime, setDuration) + runTimer(updatedTime, setDuration); }, 10); } else { clearInterval(timer.current); timer.current = null; } - return () => clearInterval(timer.current) + return () => clearInterval(timer.current); }, [isAccepted, setDuration]); if (!duration || !isAccepted) return null; diff --git a/phone/src/os/call/hooks/state.ts b/phone/src/os/call/hooks/state.ts index ea43d96..88e37d9 100644 --- a/phone/src/os/call/hooks/state.ts +++ b/phone/src/os/call/hooks/state.ts @@ -3,14 +3,14 @@ import { atom } from 'recoil'; export const callerState = { currentCall: atom({ key: 'currentCall', - default: null + default: null, }), callModal: atom({ key: 'callingModal', - default: false + default: false, }), callDuration: atom({ key: 'callDuration', - default: {ms: 0, s: 0, m: 0, h: 0} - }) + default: { ms: 0, s: 0, m: 0, h: 0 }, + }), }; diff --git a/phone/src/os/call/hooks/useCallModal.ts b/phone/src/os/call/hooks/useCallModal.ts index 89e2624..d59f00d 100644 --- a/phone/src/os/call/hooks/useCallModal.ts +++ b/phone/src/os/call/hooks/useCallModal.ts @@ -8,5 +8,5 @@ interface ModalProps { export const useCallModal = (): ModalProps => { const [modal, setModal] = useRecoilState(callerState.callModal); - return { modal, setModal } -} \ No newline at end of file + return { modal, setModal }; +}; diff --git a/phone/src/os/notifications/components/NotificationIcon.tsx b/phone/src/os/notifications/components/NotificationIcon.tsx index 831eb71..8c09560 100644 --- a/phone/src/os/notifications/components/NotificationIcon.tsx +++ b/phone/src/os/notifications/components/NotificationIcon.tsx @@ -9,7 +9,7 @@ interface INotificationIcon { export const NotificationIcon = ({ icon, to }: INotificationIcon) => { return ( - + {icon} ); diff --git a/phone/src/os/phone/hooks/usePhone.ts b/phone/src/os/phone/hooks/usePhone.ts index b511a69..595af6e 100644 --- a/phone/src/os/phone/hooks/usePhone.ts +++ b/phone/src/os/phone/hooks/usePhone.ts @@ -14,7 +14,7 @@ interface IUsePhone { export const usePhone = (): IUsePhone => { const isPhoneOpen = useRecoilValue(phoneState.visibility); - + const { removeAlerts } = useNotifications(); const closePhone = () => { diff --git a/phone/src/ui/components/Alert.tsx b/phone/src/ui/components/Alert.tsx index edfd7f7..ca1e391 100644 --- a/phone/src/ui/components/Alert.tsx +++ b/phone/src/ui/components/Alert.tsx @@ -8,8 +8,8 @@ const useStyles = makeStyles({ }, msg: { maxWidth: '300px', - wordWrap: 'break-word', - fontSize: '1em' + wordWrap: 'break-word', + fontSize: '1em', }, }); diff --git a/phone/src/ui/components/ContextMenu.tsx b/phone/src/ui/components/ContextMenu.tsx index 8423f0f..571c375 100644 --- a/phone/src/ui/components/ContextMenu.tsx +++ b/phone/src/ui/components/ContextMenu.tsx @@ -28,7 +28,7 @@ interface IContextMenuOption { selected?: boolean; icon?: React.ReactNode; key?: string; -}; +} interface IContextMenuProps { open: boolean; @@ -64,8 +64,11 @@ export const ContextMenu = ({ open, onClose, options }: IContextMenuProps) => { onClose(); }} > - {option.icon && {option.icon}} - + {option.icon && {option.icon}} + ))} diff --git a/phone/src/ui/components/GridMenu.tsx b/phone/src/ui/components/GridMenu.tsx index f18c5c9..a43b0bc 100644 --- a/phone/src/ui/components/GridMenu.tsx +++ b/phone/src/ui/components/GridMenu.tsx @@ -3,23 +3,13 @@ import { AppIcon } from './AppIcon'; import { Box, Grid } from '@material-ui/core'; import { Link } from 'react-router-dom'; -export const GridMenu = ({ - items, - Component = AppIcon, - xs = undefined, -}) => { +export const GridMenu = ({ items, Component = AppIcon, xs = undefined }) => { return ( {items && items.length && items.map((item) => ( - + diff --git a/phone/src/ui/components/PictureResponsive.tsx b/phone/src/ui/components/PictureResponsive.tsx index d25ee0d..29d3061 100644 --- a/phone/src/ui/components/PictureResponsive.tsx +++ b/phone/src/ui/components/PictureResponsive.tsx @@ -2,15 +2,15 @@ import React from 'react'; import { makeStyles } from '@material-ui/core'; interface IProps { - src: string, - alt: string + src: string; + alt: string; } const useStyles = makeStyles({ root: { width: '100%', - objectFit: 'contain' - } + objectFit: 'contain', + }, }); export const PictureResponsive = ({ src, alt }: IProps) => { diff --git a/phone/src/ui/components/PictureThumbnail.tsx b/phone/src/ui/components/PictureThumbnail.tsx index 0d7a90b..9c69bc3 100644 --- a/phone/src/ui/components/PictureThumbnail.tsx +++ b/phone/src/ui/components/PictureThumbnail.tsx @@ -6,9 +6,9 @@ interface IStyleProps { } interface IProps { - src: string, - alt: string, - size?: string + src: string; + alt: string; + size?: string; } const useStyles = makeStyles({ diff --git a/phone/src/ui/components/StatusIconButton.tsx b/phone/src/ui/components/StatusIconButton.tsx index 1f2fb98..f8d161e 100644 --- a/phone/src/ui/components/StatusIconButton.tsx +++ b/phone/src/ui/components/StatusIconButton.tsx @@ -56,5 +56,11 @@ export const StatusIconButton = ({ ...props }: Omit & { color: StatusButtonStyleColor }) => { const classes = useStyles({ color }); - return ; + return ( + + ); }; diff --git a/phone/src/ui/hooks/useSnackbar.ts b/phone/src/ui/hooks/useSnackbar.ts index b028718..ae6aae8 100644 --- a/phone/src/ui/hooks/useSnackbar.ts +++ b/phone/src/ui/hooks/useSnackbar.ts @@ -1,15 +1,14 @@ import { useContext } from 'react'; import { SnackbarContext } from '../providers/SnackbarProvider'; - export interface IAlert { message: string; - type: 'success' | 'error' | 'info' + type: 'success' | 'error' | 'info'; } interface ISnackBar { - addAlert: ({ message, type}: IAlert) => void; + addAlert: ({ message, type }: IAlert) => void; alert: IAlert | null; } -export const useSnackbar = (): ISnackBar => useContext(SnackbarContext); \ No newline at end of file +export const useSnackbar = (): ISnackBar => useContext(SnackbarContext); diff --git a/phone/src/ui/interface/InterfaceUI.ts b/phone/src/ui/interface/InterfaceUI.ts index 5f655bd..eb5f670 100644 --- a/phone/src/ui/interface/InterfaceUI.ts +++ b/phone/src/ui/interface/InterfaceUI.ts @@ -12,4 +12,4 @@ export interface AppWrapperTypes { children?: JSX.Element | JSX.Element[]; style?: CSSProperties; handleClickAway?: (...args: any[]) => void; -} \ No newline at end of file +} diff --git a/resources/babel.config.js b/resources/babel.config.js index 1d766b5..8165fe4 100644 --- a/resources/babel.config.js +++ b/resources/babel.config.js @@ -1,6 +1,6 @@ module.exports = { - presets: [ - ['@babel/preset-env', {targets: {node: 'current'}}], - '@babel/preset-typescript', - ], -}; \ No newline at end of file + presets: [ + ['@babel/preset-env', { targets: { node: 'current' } }], + '@babel/preset-typescript', + ], +}; diff --git a/resources/client/cl_contacts.ts b/resources/client/cl_contacts.ts index c3cadc9..51b51f8 100644 --- a/resources/client/cl_contacts.ts +++ b/resources/client/cl_contacts.ts @@ -45,7 +45,7 @@ onNet(events.CONTACTS_ACTION_RESULT, (alert: any) => { JSON.stringify({ app: 'CONTACTS', method: 'setAlert', - data: alert + data: alert, }) ); }); diff --git a/resources/client/cl_notes.ts b/resources/client/cl_notes.ts index c7355a5..817dd74 100644 --- a/resources/client/cl_notes.ts +++ b/resources/client/cl_notes.ts @@ -17,7 +17,7 @@ onNet(events.NOTE_SEND_NOTE_SUCCESS, () => { RegisterNuiCallbackType(events.NOTE_DELETE_NOTE); on(`__cfx_nui:${events.NOTE_DELETE_NOTE}`, (data: any) => { emitNet(events.NOTE_DELETE_NOTE, data); - + emitNet(events.NOTE_FETCH_ALL_NOTES); }); @@ -30,7 +30,6 @@ onNet(events.NOTE_UPDATE_NOTE_SUCCESS, () => { emitNet(events.NOTE_FETCH_ALL_NOTES); }); - onNet(events.NOTE_ACTION_RESULT, (alert: any) => { - sendNotesEvent('setAlert', alert) -}) \ No newline at end of file + sendNotesEvent('setAlert', alert); +}); diff --git a/resources/server/sv_bank.ts b/resources/server/sv_bank.ts index 480e427..40754c3 100644 --- a/resources/server/sv_bank.ts +++ b/resources/server/sv_bank.ts @@ -104,29 +104,25 @@ onNet(events.BANK_ADD_TRANSFER, async (transfer: Transfer) => { try { const _identifier = getIdentifier(_source); await addTransfer(_identifier, transfer); - + // we need to create a notification for bank. that's why i have commented out. // as well as creating a check if the player has enough money etc.... - + //emitNet(events.BANK_TRANSACTION_NOTIFICATION, xTarget, transferNotify); - + emitNet(events.BANK_ADD_TRANSFER_SUCCESS, _source); - emitNet(events.BANK_TRANSACTION_ALERT, _source, - { - message: 'BANK_ALERT_TRANSFER_SUCCESS', - type: 'success' - } - ); + emitNet(events.BANK_TRANSACTION_ALERT, _source, { + message: 'BANK_ALERT_TRANSFER_SUCCESS', + type: 'success', + }); } catch (e) { bankLogger.error(`Failed to add transaction, ${e.message}`, { source: _source, }); - emitNet(events.BANK_TRANSACTION_ALERT, _source, - { - message: 'APPS_BANK_ALERT_TRANSFER_FAILURE', - type: 'error' - } - ); + emitNet(events.BANK_TRANSACTION_ALERT, _source, { + message: 'APPS_BANK_ALERT_TRANSFER_FAILURE', + type: 'error', + }); } }); diff --git a/resources/server/sv_main.ts b/resources/server/sv_main.ts index ae29215..08f8908 100644 --- a/resources/server/sv_main.ts +++ b/resources/server/sv_main.ts @@ -41,17 +41,17 @@ function getRandomPhoneNumber() { } async function generatePhoneNumber(identifier: string) { - if (!await usePhoneNumber(identifier)) { + if (!(await usePhoneNumber(identifier))) { let existingId; let newNumber; do { - newNumber = getRandomPhoneNumber(); - try { - existingId = await getIdentifierByPhoneNumber(newNumber) - } catch(e) { - existingId = false - } - } while(existingId); + newNumber = getRandomPhoneNumber(); + try { + existingId = await getIdentifierByPhoneNumber(newNumber); + } catch (e) { + existingId = false; + } + } while (existingId); mainLogger.verbose(`Inserting number into Database: ${newNumber}`); const query = 'UPDATE users SET phone_number = ? WHERE identifier = ?'; await pool.query(query, [newNumber, identifier]); @@ -67,16 +67,16 @@ async function getCredentials(identifier: string): Promise { } onNet('esx:playerLoaded', async (playerId: number, xPlayer: any) => { - const _source = getSource() + const _source = getSource(); try { const identifier = xPlayer.identifier; await generatePhoneNumber(identifier); - } catch(e) { + } catch (e) { mainLogger.error(`Failed to generate a phone number, ${e.message}`, { source: _source, - }) + }); } -}) +}); onNet('phone:getCredentials', async () => { const _source = getSource(); diff --git a/resources/server/sv_twitter.ts b/resources/server/sv_twitter.ts index 5aa0d9e..7021efe 100644 --- a/resources/server/sv_twitter.ts +++ b/resources/server/sv_twitter.ts @@ -313,7 +313,7 @@ onNet(events.TWITTER_UPDATE_PROFILE, async (profile: Profile) => { await updateProfile(identifier, profile); emitNet(events.TWITTER_UPDATE_PROFILE_RESULT, _source, { message: 'TWITTER_EDIT_PROFILE_SUCCESS', - type: 'success' + type: 'success', }); } catch (e) { twitterLogger.error(`Failed to update twitter profile: ${e.message}`, { @@ -321,7 +321,7 @@ onNet(events.TWITTER_UPDATE_PROFILE, async (profile: Profile) => { }); emitNet(events.TWITTER_UPDATE_PROFILE_RESULT, _source, { message: 'TWITTER_EDIT_PROFILE_FAILURE', - type: 'error' + type: 'error', }); } }); @@ -368,8 +368,8 @@ onNet(events.TWITTER_CREATE_TWEET, async (tweet: Tweet) => { }); emitNet(events.TWITTER_CREATE_TWEET_RESULT, _source, { message: 'TWITTER_CREATE_FAILED', - type: 'error' - }); + type: 'error', + }); } }); diff --git a/resources/utils/apps.ts b/resources/utils/apps.ts index ad74728..0e99372 100644 --- a/resources/utils/apps.ts +++ b/resources/utils/apps.ts @@ -1,5 +1,5 @@ export default { TWITTER: 'TWITTER', MESSAGES: 'MESSAGES', - NOTES: 'NOTES' + NOTES: 'NOTES', }; diff --git a/resources/utils/token.ts b/resources/utils/token.ts index fea3c92..5b2deb2 100644 --- a/resources/utils/token.ts +++ b/resources/utils/token.ts @@ -1,3 +1,3 @@ export const tokenData = { - token: '2518ea90647ba45' -} \ No newline at end of file + token: '2518ea90647ba45', +}; diff --git a/resources/webpack.config.js b/resources/webpack.config.js index 738e848..7f1c9a4 100644 --- a/resources/webpack.config.js +++ b/resources/webpack.config.js @@ -1,28 +1,28 @@ -const webpack = require("webpack"); -const path = require("path"); -const RemovePlugin = require("remove-files-webpack-plugin"); +const webpack = require('webpack'); +const path = require('path'); +const RemovePlugin = require('remove-files-webpack-plugin'); -const buildPath = path.resolve(__dirname, "dist"); +const buildPath = path.resolve(__dirname, 'dist'); const server = { - entry: "./server/server.ts", + entry: './server/server.ts', module: { rules: [ { test: /\.tsx?$/, - use: ["ts-loader"], + use: ['ts-loader'], exclude: /node_modules/, }, ], }, plugins: [ - new webpack.DefinePlugin({ "global.GENTLY": false }), + new webpack.DefinePlugin({ 'global.GENTLY': false }), new RemovePlugin({ before: { - include: [path.resolve(buildPath, "server")], + include: [path.resolve(buildPath, 'server')], }, watch: { - include: [path.resolve(buildPath, "server")], + include: [path.resolve(buildPath, 'server')], }, }), ], @@ -30,22 +30,22 @@ const server = { minimize: true, }, resolve: { - extensions: [".tsx", ".ts", ".js"], + extensions: ['.tsx', '.ts', '.js'], }, output: { - filename: "[contenthash].server.js", - path: path.resolve(buildPath, "server"), + filename: '[contenthash].server.js', + path: path.resolve(buildPath, 'server'), }, - target: "node", + target: 'node', }; const client = { - entry: "./client/client.ts", + entry: './client/client.ts', module: { rules: [ { test: /\.tsx?$/, - use: ["ts-loader"], + use: ['ts-loader'], exclude: /node_modules/, }, ], @@ -53,10 +53,10 @@ const client = { plugins: [ new RemovePlugin({ before: { - include: [path.resolve(buildPath, "client")], + include: [path.resolve(buildPath, 'client')], }, watch: { - include: [path.resolve(buildPath, "client")], + include: [path.resolve(buildPath, 'client')], }, }), ], @@ -64,11 +64,11 @@ const client = { minimize: true, }, resolve: { - extensions: [".tsx", ".ts", ".js"], + extensions: ['.tsx', '.ts', '.js'], }, output: { - filename: "[contenthash].client.js", - path: path.resolve(buildPath, "client"), + filename: '[contenthash].client.js', + path: path.resolve(buildPath, 'client'), }, };