diff --git a/.eslintignore b/.eslintignore index d2b066d..cab4bb7 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,3 @@ -flow-typed dist dll node_modules diff --git a/.eslintrc.js b/.eslintrc.js index a64b75d..c5ef935 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -24,7 +24,7 @@ module.exports = { overrides: [ { - files: ['webpack-utils/**', 'scripts/**', 'jest/**'], + files: ['packages/webpack-utils/**', 'packages/scripts/**', 'jest/**'], env: { node: true, }, diff --git a/jest/__mocks__/intlMock.js b/jest/__mocks__/intlMock.js index 733a57f..6bc5105 100644 --- a/jest/__mocks__/intlMock.js +++ b/jest/__mocks__/intlMock.js @@ -2,7 +2,7 @@ /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-env node */ const path = require('path'); -const { transform } = require('../../webpack-utils/intl-loader'); +const { transform } = require('webpack-utils/intl-loader'); module.exports = { /** diff --git a/jest/setupAfterEnv.js b/jest/setupAfterEnv.js index e03e02b..a89a3a6 100644 --- a/jest/setupAfterEnv.js +++ b/jest/setupAfterEnv.js @@ -1,4 +1,4 @@ -import 'polyfills'; +import 'app/polyfills'; import { configure } from 'enzyme'; import Adapter from 'enzyme-adapter-react-16'; diff --git a/package.json b/package.json index 009874f..7ae1492 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { "name": "@elyby/accounts-frontend", "description": "", - "main": "src/index.js", "author": "SleepWalker ", "private": true, "maintainers": [ @@ -20,31 +19,30 @@ "node": ">=10.0.0" }, "workspaces": [ - "webpack-utils", - "scripts", + "packages/*", "tests-e2e" ], "scripts": { - "start": "yarn run clean && yarn run build:dll && NODE_PATH=./src webpack-dev-server --colors", + "start": "yarn run clean && yarn run build:dll && webpack-dev-server --colors", "clean": "rm -rf ./dist && mkdir ./dist", "e2e": "yarn --cwd ./tests-e2e test", - "test": "NODE_PATH=./src jest", + "test": "jest", "test:watch": "yarn test --watch", "lint": "eslint --fix --quiet .", "lint:check": "eslint --quiet .", - "prettier": "prettier --write \"{src/**/*,scripts/**/*,tests-e2e/**/*,webpack-utils/**/*,jest/**/*,config/**/*,*}.{js,ts,tsx,json,md,scss,css}\"", - "prettier:check": "prettier --check \"{src/**/*,scripts/**/*,tests-e2e/**/*,webpack-utils/**/*,jest/**/*,config/**/*,*}.{js,ts,tsx,json,md,scss,css}\"", + "prettier": "prettier --write \"{packages/**/*,tests-e2e/**/*,jest/**/*,config/**/*,*}.{js,ts,tsx,json,md,scss,css}\"", + "prettier:check": "prettier --check \"{packages/**/*,tests-e2e/**/*,jest/**/*,config/**/*,*}.{js,ts,tsx,json,md,scss,css}\"", "ts:check": "tsc", "ci:check": "yarn lint:check && yarn ts:check && yarn test", "analyze": "yarn run clean && yarn run build:webpack --analyze", - "i18n:collect": "babel-node ./scripts/i18n-collect.js", - "i18n:push": "babel-node ./scripts/i18n-crowdin.js push", - "i18n:pull": "babel-node ./scripts/i18n-crowdin.js pull", + "i18n:collect": "babel-node ./packages/scripts/i18n-collect.js", + "i18n:push": "babel-node ./packages/scripts/i18n-crowdin.js push", + "i18n:pull": "babel-node ./packages/scripts/i18n-crowdin.js pull", "build": "yarn run clean && yarn run build:webpack", "build:install": "yarn install", - "build:webpack": "NODE_PATH=./src webpack --colors -p --bail", + "build:webpack": "webpack --colors -p --bail", "build:quiet": "yarn run clean && yarn run build:webpack --quiet", - "build:dll": "node ./scripts/build-dll.js", + "build:dll": "node ./packages/scripts/build-dll.js", "build:serve": "http-server --proxy https://dev.account.ely.by ./dist" }, "husky": { @@ -65,7 +63,7 @@ }, "jest": { "roots": [ - "/src/" + "/packages/app" ], "setupFilesAfterEnv": [ "/jest/setupAfterEnv.js" @@ -86,38 +84,7 @@ "^.+\\.[tj]sx?$": "babel-jest" } }, - "dependencies": { - "@formatjs/intl-pluralrules": "^1.3.7", - "@formatjs/intl-relativetimeformat": "^4.4.6", - "@hot-loader/react-dom": "^16.11.0", - "@types/react-redux": "^7.1.5", - "@types/react-router-dom": "^5.1.3", - "classnames": "^2.2.6", - "copy-to-clipboard": "^3.0.8", - "debounce": "^1.0.0", - "flag-icon-css": "^3.4.5", - "intl": "^1.2.5", - "promise.prototype.finally": "3.1.1", - "prop-types": "^15.6.2", - "raf": "^3.4.1", - "raven-js": "^3.27.0", - "react": "^16.12.0", - "react-dom": "^16.12.0", - "react-helmet": "^5.0.0", - "react-hot-loader": "^4.12.18", - "react-intl": "^3.7.0", - "react-motion": "^0.5.0", - "react-redux": "^7.1.3", - "react-router-dom": "^5.1.2", - "react-textarea-autosize": "^7.1.2", - "react-transition-group": "^4.3.0", - "redux": "^4.0.4", - "redux-localstorage": "^0.4.1", - "redux-thunk": "^2.0.0", - "url-search-params-polyfill": "^7.0.0", - "webfontloader": "^1.6.26", - "whatwg-fetch": "^3.0.0" - }, + "dependencies": {}, "devDependencies": { "@babel/cli": "^7.7.4", "@babel/core": "^7.7.4", @@ -155,8 +122,6 @@ "cssnano": "^4.1.10", "dotenv": "^8.2.0", "eager-imports-webpack-plugin": "^1.0.0", - "enzyme": "^3.8.0", - "enzyme-adapter-react-16": "^1.15.1", "eslint": "^6.7.1", "eslint-config-prettier": "^6.7.0", "eslint-plugin-jsdoc": "^18.1.5", diff --git a/src/App.tsx b/packages/app/App.tsx similarity index 77% rename from src/App.tsx rename to packages/app/App.tsx index 830cc2c..0c98ed0 100644 --- a/src/App.tsx +++ b/packages/app/App.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { hot } from 'react-hot-loader/root'; import { Provider as ReduxProvider } from 'react-redux'; import { Router, Route, Switch } from 'react-router-dom'; -import { IntlProvider } from 'components/i18n'; +import { IntlProvider } from 'app/components/i18n'; import { Store } from 'redux'; -import AuthFlowRoute from 'containers/AuthFlowRoute'; -import RootPage from 'pages/root/RootPage'; -import SuccessOauthPage from 'pages/auth/SuccessOauthPage'; +import AuthFlowRoute from 'app/containers/AuthFlowRoute'; +import RootPage from 'app/pages/root/RootPage'; +import SuccessOauthPage from 'app/pages/auth/SuccessOauthPage'; const App = ({ store, diff --git a/src/components/MeasureHeight.tsx b/packages/app/components/MeasureHeight.tsx similarity index 97% rename from src/components/MeasureHeight.tsx rename to packages/app/components/MeasureHeight.tsx index bf55a6f..a375353 100644 --- a/src/components/MeasureHeight.tsx +++ b/packages/app/components/MeasureHeight.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { omit, debounce } from 'functions'; +import { omit, debounce } from 'app/functions'; /** * MeasureHeight is a component that allows you to measure the height of elements wrapped. diff --git a/src/components/accounts/AccountSwitcher.intl.json b/packages/app/components/accounts/AccountSwitcher.intl.json similarity index 100% rename from src/components/accounts/AccountSwitcher.intl.json rename to packages/app/components/accounts/AccountSwitcher.intl.json diff --git a/src/components/accounts/AccountSwitcher.tsx b/packages/app/components/accounts/AccountSwitcher.tsx similarity index 94% rename from src/components/accounts/AccountSwitcher.tsx rename to packages/app/components/accounts/AccountSwitcher.tsx index b6389d8..0fb3945 100644 --- a/src/components/accounts/AccountSwitcher.tsx +++ b/packages/app/components/accounts/AccountSwitcher.tsx @@ -3,12 +3,12 @@ import { connect } from 'react-redux'; import classNames from 'classnames'; import { Link } from 'react-router-dom'; import { FormattedMessage as Message } from 'react-intl'; -import loader from 'services/loader'; -import { SKIN_DARK, COLOR_WHITE, Skin } from 'components/ui'; -import { Button } from 'components/ui/form'; -import { authenticate, revoke } from 'components/accounts/actions'; -import { getActiveAccount, Account } from 'components/accounts/reducer'; -import { RootState } from 'reducers'; +import loader from 'app/services/loader'; +import { SKIN_DARK, COLOR_WHITE, Skin } from 'app/components/ui'; +import { Button } from 'app/components/ui/form'; +import { authenticate, revoke } from 'app/components/accounts/actions'; +import { getActiveAccount, Account } from 'app/components/accounts/reducer'; +import { RootState } from 'app/reducers'; import styles from './accountSwitcher.scss'; import messages from './AccountSwitcher.intl.json'; diff --git a/src/components/accounts/accountSwitcher.scss b/packages/app/components/accounts/accountSwitcher.scss similarity index 88% rename from src/components/accounts/accountSwitcher.scss rename to packages/app/components/accounts/accountSwitcher.scss index b727f98..7382d77 100644 --- a/src/components/accounts/accountSwitcher.scss +++ b/packages/app/components/accounts/accountSwitcher.scss @@ -1,8 +1,8 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; // TODO: эту константу можно заимпортить из panel.scss, но это приводит к странным ошибкам -//@import '~components/ui/panel.scss'; +//@import '~app/components/ui/panel.scss'; $bodyLeftRightPadding: 20px; $lightBorderColor: #eee; @@ -150,7 +150,7 @@ $lightBorderColor: #eee; } .accountIcon { - composes: minecraft-character from '~components/ui/icons.scss'; + composes: minecraft-character from '~app/components/ui/icons.scss'; float: left; @@ -184,7 +184,7 @@ $lightBorderColor: #eee; } .addIcon { - composes: plus from '~components/ui/icons.scss'; + composes: plus from '~app/components/ui/icons.scss'; color: $green; position: relative; @@ -193,7 +193,7 @@ $lightBorderColor: #eee; } .nextIcon { - composes: arrowRight from '~components/ui/icons.scss'; + composes: arrowRight from '~app/components/ui/icons.scss'; position: relative; float: right; @@ -212,7 +212,7 @@ $lightBorderColor: #eee; } .logoutIcon { - composes: exit from '~components/ui/icons.scss'; + composes: exit from '~app/components/ui/icons.scss'; color: #cdcdcd; float: right; diff --git a/src/components/accounts/actions.test.ts b/packages/app/components/accounts/actions.test.ts similarity index 95% rename from src/components/accounts/actions.test.ts rename to packages/app/components/accounts/actions.test.ts index 72ab522..11a16e7 100644 --- a/src/components/accounts/actions.test.ts +++ b/packages/app/components/accounts/actions.test.ts @@ -1,15 +1,15 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import sinon from 'sinon'; -import { browserHistory } from 'services/history'; -import { InternalServerError } from 'services/request'; -import { sessionStorage } from 'services/localStorage'; -import * as authentication from 'services/api/authentication'; +import { browserHistory } from 'app/services/history'; +import { InternalServerError } from 'app/services/request'; +import { sessionStorage } from 'app/services/localStorage'; +import * as authentication from 'app/services/api/authentication'; import { authenticate, revoke, logoutAll, logoutStrangers, -} from 'components/accounts/actions'; +} from 'app/components/accounts/actions'; import { add, ADD, @@ -17,11 +17,11 @@ import { ACTIVATE, remove, reset, -} from 'components/accounts/actions/pure-actions'; -import { SET_LOCALE } from 'components/i18n/actions'; -import { updateUser, setUser } from 'components/user/actions'; -import { setLogin, setAccountSwitcher } from 'components/auth/actions'; -import { Dispatch, RootState } from 'reducers'; +} from 'app/components/accounts/actions/pure-actions'; +import { SET_LOCALE } from 'app/components/i18n/actions'; +import { updateUser, setUser } from 'app/components/user/actions'; +import { setLogin, setAccountSwitcher } from 'app/components/auth/actions'; +import { Dispatch, RootState } from 'app/reducers'; import { Account } from './reducer'; diff --git a/src/components/accounts/actions.ts b/packages/app/components/accounts/actions.ts similarity index 93% rename from src/components/accounts/actions.ts rename to packages/app/components/accounts/actions.ts index 35ca252..c8b8ba1 100644 --- a/src/components/accounts/actions.ts +++ b/packages/app/components/accounts/actions.ts @@ -1,17 +1,17 @@ -import { getJwtPayloads } from 'functions'; -import { sessionStorage } from 'services/localStorage'; +import { getJwtPayloads } from 'app/functions'; +import { sessionStorage } from 'app/services/localStorage'; import { validateToken, requestToken, logout, -} from 'services/api/authentication'; -import { relogin as navigateToLogin } from 'components/auth/actions'; -import { updateUser, setGuest } from 'components/user/actions'; -import { setLocale } from 'components/i18n/actions'; -import { setAccountSwitcher } from 'components/auth/actions'; -import { getActiveAccount } from 'components/accounts/reducer'; -import logger from 'services/logger'; -import { ThunkAction } from 'reducers'; +} from 'app/services/api/authentication'; +import { relogin as navigateToLogin } from 'app/components/auth/actions'; +import { updateUser, setGuest } from 'app/components/user/actions'; +import { setLocale } from 'app/components/i18n/actions'; +import { setAccountSwitcher } from 'app/components/auth/actions'; +import { getActiveAccount } from 'app/components/accounts/reducer'; +import logger from 'app/services/logger'; +import { ThunkAction } from 'app/reducers'; import { Account } from './reducer'; import { diff --git a/src/components/accounts/actions/pure-actions.ts b/packages/app/components/accounts/actions/pure-actions.ts similarity index 100% rename from src/components/accounts/actions/pure-actions.ts rename to packages/app/components/accounts/actions/pure-actions.ts diff --git a/src/components/accounts/index.ts b/packages/app/components/accounts/index.ts similarity index 100% rename from src/components/accounts/index.ts rename to packages/app/components/accounts/index.ts diff --git a/src/components/accounts/reducer.test.ts b/packages/app/components/accounts/reducer.test.ts similarity index 98% rename from src/components/accounts/reducer.test.ts rename to packages/app/components/accounts/reducer.test.ts index d70151b..c4f5fa9 100644 --- a/src/components/accounts/reducer.test.ts +++ b/packages/app/components/accounts/reducer.test.ts @@ -1,4 +1,4 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import { updateToken } from './actions'; import { diff --git a/src/components/accounts/reducer.ts b/packages/app/components/accounts/reducer.ts similarity index 100% rename from src/components/accounts/reducer.ts rename to packages/app/components/accounts/reducer.ts diff --git a/src/components/auth/AuthTitle.tsx b/packages/app/components/auth/AuthTitle.tsx similarity index 100% rename from src/components/auth/AuthTitle.tsx rename to packages/app/components/auth/AuthTitle.tsx diff --git a/src/components/auth/BaseAuthBody.tsx b/packages/app/components/auth/BaseAuthBody.tsx similarity index 90% rename from src/components/auth/BaseAuthBody.tsx rename to packages/app/components/auth/BaseAuthBody.tsx index 1fd073f..9ab61a2 100644 --- a/src/components/auth/BaseAuthBody.tsx +++ b/packages/app/components/auth/BaseAuthBody.tsx @@ -3,9 +3,9 @@ */ import PropTypes from 'prop-types'; import React from 'react'; -import AuthError from 'components/auth/authError/AuthError'; -import { userShape } from 'components/user/User'; -import { FormModel } from 'components/ui/form'; +import AuthError from 'app/components/auth/authError/AuthError'; +import { userShape } from 'app/components/user/User'; +import { FormModel } from 'app/components/ui/form'; import { RouteComponentProps } from 'react-router-dom'; export default class BaseAuthBody extends React.Component< diff --git a/src/components/auth/PanelTransition.tsx b/packages/app/components/auth/PanelTransition.tsx similarity index 95% rename from src/components/auth/PanelTransition.tsx rename to packages/app/components/auth/PanelTransition.tsx index e676baf..7de4b5c 100644 --- a/src/components/auth/PanelTransition.tsx +++ b/packages/app/components/auth/PanelTransition.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import { AccountsState } from 'components/accounts'; -import { AuthState } from 'components/auth'; -import { User } from 'components/user'; +import { AccountsState } from 'app/components/accounts'; +import { AuthState } from 'app/components/auth'; +import { User } from 'app/components/user'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { TransitionMotion, spring } from 'react-motion'; @@ -10,18 +10,18 @@ import { PanelBody, PanelFooter, PanelHeader, -} from 'components/ui/Panel'; -import { getLogin } from 'components/auth/reducer'; -import { Form } from 'components/ui/form'; -import MeasureHeight from 'components/MeasureHeight'; -import defaultHelpLinksStyles from 'components/auth/helpLinks.scss'; -import panelStyles from 'components/ui/panel.scss'; -import icons from 'components/ui/icons.scss'; -import authFlow from 'services/authFlow'; -import { userShape } from 'components/user/User'; +} from 'app/components/ui/Panel'; +import { getLogin } from 'app/components/auth/reducer'; +import { Form } from 'app/components/ui/form'; +import MeasureHeight from 'app/components/MeasureHeight'; +import defaultHelpLinksStyles from 'app/components/auth/helpLinks.scss'; +import panelStyles from 'app/components/ui/panel.scss'; +import icons from 'app/components/ui/icons.scss'; +import authFlow from 'app/services/authFlow'; +import { userShape } from 'app/components/user/User'; import * as actions from './actions'; -import { RootState } from 'reducers'; +import { RootState } from 'app/reducers'; const opacitySpringConfig = { stiffness: 300, damping: 20 }; const transformSpringConfig = { stiffness: 500, damping: 50, precision: 0.5 }; diff --git a/src/components/auth/README.md b/packages/app/components/auth/README.md similarity index 100% rename from src/components/auth/README.md rename to packages/app/components/auth/README.md diff --git a/src/components/auth/RejectionLink.tsx b/packages/app/components/auth/RejectionLink.tsx similarity index 91% rename from src/components/auth/RejectionLink.tsx rename to packages/app/components/auth/RejectionLink.tsx index 0385f80..d2413b9 100644 --- a/src/components/auth/RejectionLink.tsx +++ b/packages/app/components/auth/RejectionLink.tsx @@ -1,8 +1,8 @@ import PropTypes from 'prop-types'; import React from 'react'; import { FormattedMessage as Message, MessageDescriptor } from 'react-intl'; -import { User } from 'components/user'; -import { userShape } from 'components/user/User'; +import { User } from 'app/components/user'; +import { userShape } from 'app/components/user/User'; interface Props { isAvailable?: (context: Context) => boolean; diff --git a/src/components/auth/acceptRules/AcceptRules.intl.json b/packages/app/components/auth/acceptRules/AcceptRules.intl.json similarity index 100% rename from src/components/auth/acceptRules/AcceptRules.intl.json rename to packages/app/components/auth/acceptRules/AcceptRules.intl.json diff --git a/src/components/auth/acceptRules/AcceptRules.ts b/packages/app/components/auth/acceptRules/AcceptRules.ts similarity index 100% rename from src/components/auth/acceptRules/AcceptRules.ts rename to packages/app/components/auth/acceptRules/AcceptRules.ts diff --git a/src/components/auth/acceptRules/AcceptRulesBody.js b/packages/app/components/auth/acceptRules/AcceptRulesBody.js similarity index 85% rename from src/components/auth/acceptRules/AcceptRulesBody.js rename to packages/app/components/auth/acceptRules/AcceptRulesBody.js index fe44db9..b150c92 100644 --- a/src/components/auth/acceptRules/AcceptRulesBody.js +++ b/packages/app/components/auth/acceptRules/AcceptRulesBody.js @@ -3,9 +3,9 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; import { Link } from 'react-router-dom'; -import icons from 'components/ui/icons.scss'; -import BaseAuthBody from 'components/auth/BaseAuthBody'; -import appInfo from 'components/auth/appInfo/AppInfo.intl.json'; +import icons from 'app/components/ui/icons.scss'; +import BaseAuthBody from 'app/components/auth/BaseAuthBody'; +import appInfo from 'app/components/auth/appInfo/AppInfo.intl.json'; import styles from './acceptRules.scss'; import messages from './AcceptRules.intl.json'; diff --git a/src/components/auth/acceptRules/acceptRules.scss b/packages/app/components/auth/acceptRules/acceptRules.scss similarity index 87% rename from src/components/auth/acceptRules/acceptRules.scss rename to packages/app/components/auth/acceptRules/acceptRules.scss index 633bb8d..0d79be3 100644 --- a/src/components/auth/acceptRules/acceptRules.scss +++ b/packages/app/components/auth/acceptRules/acceptRules.scss @@ -1,4 +1,4 @@ -@import '~components/ui/colors.scss'; +@import '~app/components/ui/colors.scss'; .descriptionText { font-size: 15px; diff --git a/src/components/auth/actions.test.ts b/packages/app/components/auth/actions.test.ts similarity index 97% rename from src/components/auth/actions.test.ts rename to packages/app/components/auth/actions.test.ts index 746a2fa..8fa5bc0 100644 --- a/src/components/auth/actions.test.ts +++ b/packages/app/components/auth/actions.test.ts @@ -1,7 +1,7 @@ import sinon from 'sinon'; -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; -import request from 'services/request'; +import request from 'app/services/request'; import { setLoadingState, @@ -14,7 +14,7 @@ import { requirePermissionsAccept, login, setLogin, -} from 'components/auth/actions'; +} from 'app/components/auth/actions'; const oauthData = { clientId: '', diff --git a/src/components/auth/actions.ts b/packages/app/components/auth/actions.ts similarity index 93% rename from src/components/auth/actions.ts rename to packages/app/components/auth/actions.ts index 445fea1..1ee0e3e 100644 --- a/src/components/auth/actions.ts +++ b/packages/app/components/auth/actions.ts @@ -1,26 +1,26 @@ -import { browserHistory } from 'services/history'; -import logger from 'services/logger'; -import localStorage from 'services/localStorage'; -import loader from 'services/loader'; -import history from 'services/history'; +import { browserHistory } from 'app/services/history'; +import logger from 'app/services/logger'; +import localStorage from 'app/services/localStorage'; +import loader from 'app/services/loader'; +import history from 'app/services/history'; import { updateUser, acceptRules as userAcceptRules, -} from 'components/user/actions'; -import { authenticate, logoutAll } from 'components/accounts/actions'; -import { getActiveAccount } from 'components/accounts/reducer'; +} from 'app/components/user/actions'; +import { authenticate, logoutAll } from 'app/components/accounts/actions'; +import { getActiveAccount } from 'app/components/accounts/reducer'; import { login as loginEndpoint, forgotPassword as forgotPasswordEndpoint, recoverPassword as recoverPasswordEndpoint, OAuthResponse, -} from 'services/api/authentication'; -import oauth, { OauthData, Client, Scope } from 'services/api/oauth'; -import signup from 'services/api/signup'; -import dispatchBsod from 'components/ui/bsod/dispatchBsod'; -import { create as createPopup } from 'components/ui/popup/actions'; -import ContactForm from 'components/contact/ContactForm'; -import { ThunkAction, Dispatch } from 'reducers'; +} from 'app/services/api/authentication'; +import oauth, { OauthData, Client, Scope } from 'app/services/api/oauth'; +import signup from 'app/services/api/signup'; +import dispatchBsod from 'app/components/ui/bsod/dispatchBsod'; +import { create as createPopup } from 'app/components/ui/popup/actions'; +import ContactForm from 'app/components/contact/ContactForm'; +import { ThunkAction, Dispatch } from 'app/reducers'; import { getCredentials } from './reducer'; @@ -31,14 +31,14 @@ type ValidationError = payload: { [key: string]: any }; }; -export { updateUser } from 'components/user/actions'; +export { updateUser } from 'app/components/user/actions'; export { authenticate, logoutAll as logout, remove as removeAccount, activate as activateAccount, -} from 'components/accounts/actions'; -import { Account } from 'components/accounts/reducer'; +} from 'app/components/accounts/actions'; +import { Account } from 'app/components/accounts/reducer'; /** * Reoutes user to the previous page if it is possible diff --git a/src/components/auth/activation/Activation.intl.json b/packages/app/components/auth/activation/Activation.intl.json similarity index 100% rename from src/components/auth/activation/Activation.intl.json rename to packages/app/components/auth/activation/Activation.intl.json diff --git a/src/components/auth/activation/Activation.ts b/packages/app/components/auth/activation/Activation.ts similarity index 100% rename from src/components/auth/activation/Activation.ts rename to packages/app/components/auth/activation/Activation.ts diff --git a/src/components/auth/activation/ActivationBody.js b/packages/app/components/auth/activation/ActivationBody.js similarity index 93% rename from src/components/auth/activation/ActivationBody.js rename to packages/app/components/auth/activation/ActivationBody.js index 0180098..a949715 100644 --- a/src/components/auth/activation/ActivationBody.js +++ b/packages/app/components/auth/activation/ActivationBody.js @@ -3,9 +3,9 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; -import { Input } from 'components/ui/form'; +import { Input } from 'app/components/ui/form'; -import BaseAuthBody from 'components/auth/BaseAuthBody'; +import BaseAuthBody from 'app/components/auth/BaseAuthBody'; import styles from './activation.scss'; import messages from './Activation.intl.json'; diff --git a/src/components/auth/activation/activation.scss b/packages/app/components/auth/activation/activation.scss similarity index 57% rename from src/components/auth/activation/activation.scss rename to packages/app/components/auth/activation/activation.scss index 0399199..dd817d1 100644 --- a/src/components/auth/activation/activation.scss +++ b/packages/app/components/auth/activation/activation.scss @@ -1,11 +1,11 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; .description { } .descriptionImage { - composes: envelope from '~components/ui/icons.scss'; + composes: envelope from '~app/components/ui/icons.scss'; font-size: 100px; color: $blue; diff --git a/src/components/auth/appInfo/AppInfo.intl.json b/packages/app/components/auth/appInfo/AppInfo.intl.json similarity index 100% rename from src/components/auth/appInfo/AppInfo.intl.json rename to packages/app/components/auth/appInfo/AppInfo.intl.json diff --git a/src/components/auth/appInfo/AppInfo.tsx b/packages/app/components/auth/appInfo/AppInfo.tsx similarity index 93% rename from src/components/auth/appInfo/AppInfo.tsx rename to packages/app/components/auth/appInfo/AppInfo.tsx index a4345c2..eec0634 100644 --- a/src/components/auth/appInfo/AppInfo.tsx +++ b/packages/app/components/auth/appInfo/AppInfo.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; -import { Button } from 'components/ui/form'; -import { FooterMenu } from 'components/footerMenu'; +import { Button } from 'app/components/ui/form'; +import { FooterMenu } from 'app/components/footerMenu'; import styles from './appInfo.scss'; import messages from './AppInfo.intl.json'; diff --git a/src/components/auth/appInfo/appInfo.scss b/packages/app/components/auth/appInfo/appInfo.scss similarity index 91% rename from src/components/auth/appInfo/appInfo.scss rename to packages/app/components/auth/appInfo/appInfo.scss index f3da46e..5242235 100644 --- a/src/components/auth/appInfo/appInfo.scss +++ b/packages/app/components/auth/appInfo/appInfo.scss @@ -1,5 +1,5 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; .appInfo { max-width: 270px; diff --git a/src/components/auth/auth.scss b/packages/app/components/auth/auth.scss similarity index 100% rename from src/components/auth/auth.scss rename to packages/app/components/auth/auth.scss diff --git a/src/components/auth/authError/AuthError.js b/packages/app/components/auth/authError/AuthError.js similarity index 89% rename from src/components/auth/authError/AuthError.js rename to packages/app/components/auth/authError/AuthError.js index b9587a3..93833ad 100644 --- a/src/components/auth/authError/AuthError.js +++ b/packages/app/components/auth/authError/AuthError.js @@ -1,8 +1,8 @@ import PropTypes from 'prop-types'; import React from 'react'; -import errorsDict from 'services/errorsDict'; -import { PanelBodyHeader } from 'components/ui/Panel'; +import errorsDict from 'app/services/errorsDict'; +import { PanelBodyHeader } from 'app/components/ui/Panel'; let autoHideTimer; function resetTimer() { diff --git a/src/components/auth/chooseAccount/ChooseAccount.intl.json b/packages/app/components/auth/chooseAccount/ChooseAccount.intl.json similarity index 100% rename from src/components/auth/chooseAccount/ChooseAccount.intl.json rename to packages/app/components/auth/chooseAccount/ChooseAccount.intl.json diff --git a/src/components/auth/chooseAccount/ChooseAccount.ts b/packages/app/components/auth/chooseAccount/ChooseAccount.ts similarity index 100% rename from src/components/auth/chooseAccount/ChooseAccount.ts rename to packages/app/components/auth/chooseAccount/ChooseAccount.ts diff --git a/src/components/auth/chooseAccount/ChooseAccountBody.js b/packages/app/components/auth/chooseAccount/ChooseAccountBody.js similarity index 91% rename from src/components/auth/chooseAccount/ChooseAccountBody.js rename to packages/app/components/auth/chooseAccount/ChooseAccountBody.js index 1290e5f..3b3d75e 100644 --- a/src/components/auth/chooseAccount/ChooseAccountBody.js +++ b/packages/app/components/auth/chooseAccount/ChooseAccountBody.js @@ -2,8 +2,8 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; -import BaseAuthBody from 'components/auth/BaseAuthBody'; -import { AccountSwitcher } from 'components/accounts'; +import BaseAuthBody from 'app/components/auth/BaseAuthBody'; +import { AccountSwitcher } from 'app/components/accounts'; import styles from './chooseAccount.scss'; import messages from './ChooseAccount.intl.json'; diff --git a/src/components/auth/chooseAccount/chooseAccount.scss b/packages/app/components/auth/chooseAccount/chooseAccount.scss similarity index 75% rename from src/components/auth/chooseAccount/chooseAccount.scss rename to packages/app/components/auth/chooseAccount/chooseAccount.scss index 133b077..afe267d 100644 --- a/src/components/auth/chooseAccount/chooseAccount.scss +++ b/packages/app/components/auth/chooseAccount/chooseAccount.scss @@ -1,5 +1,5 @@ -@import '~components/ui/panel.scss'; -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/panel.scss'; +@import '~app/components/ui/fonts.scss'; .accountSwitcherContainer { margin-left: -$bodyLeftRightPadding; diff --git a/src/components/auth/factory.tsx b/packages/app/components/auth/factory.tsx similarity index 86% rename from src/components/auth/factory.tsx rename to packages/app/components/auth/factory.tsx index 06bcd51..7d10072 100644 --- a/src/components/auth/factory.tsx +++ b/packages/app/components/auth/factory.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import { Button } from 'components/ui/form'; +import { Button } from 'app/components/ui/form'; import RejectionLink, { RejectionLinkProps, -} from 'components/auth/RejectionLink'; -import AuthTitle from 'components/auth/AuthTitle'; +} from 'app/components/auth/RejectionLink'; +import AuthTitle from 'app/components/auth/AuthTitle'; import { MessageDescriptor } from 'react-intl'; -import { Color } from 'components/ui'; +import { Color } from 'app/components/ui'; /** * @param {object} options diff --git a/src/components/auth/finish/Finish.intl.json b/packages/app/components/auth/finish/Finish.intl.json similarity index 100% rename from src/components/auth/finish/Finish.intl.json rename to packages/app/components/auth/finish/Finish.intl.json diff --git a/src/components/auth/finish/Finish.tsx b/packages/app/components/auth/finish/Finish.tsx similarity index 95% rename from src/components/auth/finish/Finish.tsx rename to packages/app/components/auth/finish/Finish.tsx index 54eaebb..201ef9c 100644 --- a/src/components/auth/finish/Finish.tsx +++ b/packages/app/components/auth/finish/Finish.tsx @@ -2,9 +2,9 @@ import React from 'react'; import { connect } from 'react-redux'; import { FormattedMessage as Message } from 'react-intl'; import Helmet from 'react-helmet'; -import { Button } from 'components/ui/form'; -import copy from 'services/copy'; -import { RootState } from 'reducers'; +import { Button } from 'app/components/ui/form'; +import copy from 'app/services/copy'; +import { RootState } from 'app/reducers'; import messages from './Finish.intl.json'; import styles from './finish.scss'; diff --git a/src/components/auth/finish/finish.scss b/packages/app/components/auth/finish/finish.scss similarity index 82% rename from src/components/auth/finish/finish.scss rename to packages/app/components/auth/finish/finish.scss index bda3bfd..36e8719 100644 --- a/src/components/auth/finish/finish.scss +++ b/packages/app/components/auth/finish/finish.scss @@ -1,5 +1,5 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; .finishPage { font-family: $font-family-title; @@ -20,12 +20,12 @@ } .successBackground { - composes: checkmark from '~components/ui/icons.scss'; + composes: checkmark from '~app/components/ui/icons.scss'; @extend .iconBackground; } .failBackground { - composes: close from '~components/ui/icons.scss'; + composes: close from '~app/components/ui/icons.scss'; @extend .iconBackground; } diff --git a/src/components/auth/forgotPassword/ForgotPassword.intl.json b/packages/app/components/auth/forgotPassword/ForgotPassword.intl.json similarity index 100% rename from src/components/auth/forgotPassword/ForgotPassword.intl.json rename to packages/app/components/auth/forgotPassword/ForgotPassword.intl.json diff --git a/src/components/auth/forgotPassword/ForgotPassword.ts b/packages/app/components/auth/forgotPassword/ForgotPassword.ts similarity index 100% rename from src/components/auth/forgotPassword/ForgotPassword.ts rename to packages/app/components/auth/forgotPassword/ForgotPassword.ts diff --git a/src/components/auth/forgotPassword/ForgotPasswordBody.js b/packages/app/components/auth/forgotPassword/ForgotPasswordBody.js similarity index 89% rename from src/components/auth/forgotPassword/ForgotPasswordBody.js rename to packages/app/components/auth/forgotPassword/ForgotPasswordBody.js index e6edeed..67c2e1b 100644 --- a/src/components/auth/forgotPassword/ForgotPasswordBody.js +++ b/packages/app/components/auth/forgotPassword/ForgotPasswordBody.js @@ -2,10 +2,10 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; -import { Input, Captcha } from 'components/ui/form'; -import { getLogin } from 'components/auth/reducer'; -import { PanelIcon } from 'components/ui/Panel'; -import BaseAuthBody from 'components/auth/BaseAuthBody'; +import { Input, Captcha } from 'app/components/ui/form'; +import { getLogin } from 'app/components/auth/reducer'; +import { PanelIcon } from 'app/components/ui/Panel'; +import BaseAuthBody from 'app/components/auth/BaseAuthBody'; import styles from './forgotPassword.scss'; import messages from './ForgotPassword.intl.json'; diff --git a/src/components/auth/forgotPassword/forgotPassword.scss b/packages/app/components/auth/forgotPassword/forgotPassword.scss similarity index 64% rename from src/components/auth/forgotPassword/forgotPassword.scss rename to packages/app/components/auth/forgotPassword/forgotPassword.scss index cb01477..889c3d4 100644 --- a/src/components/auth/forgotPassword/forgotPassword.scss +++ b/packages/app/components/auth/forgotPassword/forgotPassword.scss @@ -1,4 +1,4 @@ -@import '~components/ui/colors.scss'; +@import '~app/components/ui/colors.scss'; .descriptionText { font-size: 15px; @@ -8,11 +8,11 @@ } .login { - composes: email from '~components/auth/password/password.scss'; + composes: email from '~app/components/auth/password/password.scss'; } .editLogin { - composes: pencil from '~components/ui/icons.scss'; + composes: pencil from '~app/components/ui/icons.scss'; position: relative; bottom: 1px; diff --git a/src/components/auth/helpLinks.scss b/packages/app/components/auth/helpLinks.scss similarity index 100% rename from src/components/auth/helpLinks.scss rename to packages/app/components/auth/helpLinks.scss diff --git a/src/components/auth/index.ts b/packages/app/components/auth/index.ts similarity index 100% rename from src/components/auth/index.ts rename to packages/app/components/auth/index.ts diff --git a/src/components/auth/login/Login.intl.json b/packages/app/components/auth/login/Login.intl.json similarity index 100% rename from src/components/auth/login/Login.intl.json rename to packages/app/components/auth/login/Login.intl.json diff --git a/src/components/auth/login/Login.ts b/packages/app/components/auth/login/Login.ts similarity index 100% rename from src/components/auth/login/Login.ts rename to packages/app/components/auth/login/Login.ts diff --git a/src/components/auth/login/LoginBody.js b/packages/app/components/auth/login/LoginBody.js similarity index 83% rename from src/components/auth/login/LoginBody.js rename to packages/app/components/auth/login/LoginBody.js index bcd9858..f903977 100644 --- a/src/components/auth/login/LoginBody.js +++ b/packages/app/components/auth/login/LoginBody.js @@ -1,6 +1,6 @@ import React from 'react'; -import { Input } from 'components/ui/form'; -import BaseAuthBody from 'components/auth/BaseAuthBody'; +import { Input } from 'app/components/ui/form'; +import BaseAuthBody from 'app/components/auth/BaseAuthBody'; import messages from './Login.intl.json'; diff --git a/src/components/auth/mfa/Mfa.intl.json b/packages/app/components/auth/mfa/Mfa.intl.json similarity index 100% rename from src/components/auth/mfa/Mfa.intl.json rename to packages/app/components/auth/mfa/Mfa.intl.json diff --git a/src/components/auth/mfa/Mfa.tsx b/packages/app/components/auth/mfa/Mfa.tsx similarity index 100% rename from src/components/auth/mfa/Mfa.tsx rename to packages/app/components/auth/mfa/Mfa.tsx diff --git a/src/components/auth/mfa/MfaBody.tsx b/packages/app/components/auth/mfa/MfaBody.tsx similarity index 81% rename from src/components/auth/mfa/MfaBody.tsx rename to packages/app/components/auth/mfa/MfaBody.tsx index bb06f77..16eb9fc 100644 --- a/src/components/auth/mfa/MfaBody.tsx +++ b/packages/app/components/auth/mfa/MfaBody.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; -import { PanelIcon } from 'components/ui/Panel'; -import { Input } from 'components/ui/form'; -import BaseAuthBody from 'components/auth/BaseAuthBody'; +import { PanelIcon } from 'app/components/ui/Panel'; +import { Input } from 'app/components/ui/form'; +import BaseAuthBody from 'app/components/auth/BaseAuthBody'; import styles from './mfa.scss'; import messages from './Mfa.intl.json'; diff --git a/src/components/auth/mfa/mfa.scss b/packages/app/components/auth/mfa/mfa.scss similarity index 100% rename from src/components/auth/mfa/mfa.scss rename to packages/app/components/auth/mfa/mfa.scss diff --git a/src/components/auth/password/Password.intl.json b/packages/app/components/auth/password/Password.intl.json similarity index 100% rename from src/components/auth/password/Password.intl.json rename to packages/app/components/auth/password/Password.intl.json diff --git a/src/components/auth/password/Password.ts b/packages/app/components/auth/password/Password.ts similarity index 100% rename from src/components/auth/password/Password.ts rename to packages/app/components/auth/password/Password.ts diff --git a/src/components/auth/password/PasswordBody.js b/packages/app/components/auth/password/PasswordBody.js similarity index 83% rename from src/components/auth/password/PasswordBody.js rename to packages/app/components/auth/password/PasswordBody.js index 376f447..a13e379 100644 --- a/src/components/auth/password/PasswordBody.js +++ b/packages/app/components/auth/password/PasswordBody.js @@ -1,10 +1,9 @@ import React from 'react'; +import icons from 'app/components/ui/icons.scss'; +import { Input, Checkbox } from 'app/components/ui/form'; +import BaseAuthBody from 'app/components/auth/BaseAuthBody'; +import authStyles from 'app/components/auth/auth.scss'; -import icons from 'components/ui/icons.scss'; -import { Input, Checkbox } from 'components/ui/form'; -import BaseAuthBody from 'components/auth/BaseAuthBody'; - -import authStyles from 'components/auth/auth.scss'; import styles from './password.scss'; import messages from './Password.intl.json'; diff --git a/src/components/auth/password/password.scss b/packages/app/components/auth/password/password.scss similarity index 86% rename from src/components/auth/password/password.scss rename to packages/app/components/auth/password/password.scss index 79c0005..d3c084c 100644 --- a/src/components/auth/password/password.scss +++ b/packages/app/components/auth/password/password.scss @@ -1,4 +1,4 @@ -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/fonts.scss'; .avatar { width: 90px; diff --git a/src/components/auth/permissions/Permissions.intl.json b/packages/app/components/auth/permissions/Permissions.intl.json similarity index 100% rename from src/components/auth/permissions/Permissions.intl.json rename to packages/app/components/auth/permissions/Permissions.intl.json diff --git a/src/components/auth/permissions/Permissions.ts b/packages/app/components/auth/permissions/Permissions.ts similarity index 100% rename from src/components/auth/permissions/Permissions.ts rename to packages/app/components/auth/permissions/Permissions.ts diff --git a/src/components/auth/permissions/PermissionsBody.js b/packages/app/components/auth/permissions/PermissionsBody.js similarity index 91% rename from src/components/auth/permissions/PermissionsBody.js rename to packages/app/components/auth/permissions/PermissionsBody.js index 99ac7e0..be17509 100644 --- a/src/components/auth/permissions/PermissionsBody.js +++ b/packages/app/components/auth/permissions/PermissionsBody.js @@ -1,10 +1,8 @@ import React from 'react'; - import { FormattedMessage as Message } from 'react-intl'; - -import icons from 'components/ui/icons.scss'; -import { PanelBodyHeader } from 'components/ui/Panel'; -import BaseAuthBody from 'components/auth/BaseAuthBody'; +import icons from 'app/components/ui/icons.scss'; +import { PanelBodyHeader } from 'app/components/ui/Panel'; +import BaseAuthBody from 'app/components/auth/BaseAuthBody'; import styles from './permissions.scss'; import messages from './Permissions.intl.json'; diff --git a/src/components/auth/permissions/permissions.scss b/packages/app/components/auth/permissions/permissions.scss similarity index 94% rename from src/components/auth/permissions/permissions.scss rename to packages/app/components/auth/permissions/permissions.scss index 36fb7be..5c24898 100644 --- a/src/components/auth/permissions/permissions.scss +++ b/packages/app/components/auth/permissions/permissions.scss @@ -1,5 +1,5 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; .authInfo { // Отступы сверху и снизу разные т.к. мы ужимаем высоту линии строки с логином на 2 пикселя и из-за этого теряем отступ снизу diff --git a/src/components/auth/recoverPassword/RecoverPassword.intl.json b/packages/app/components/auth/recoverPassword/RecoverPassword.intl.json similarity index 100% rename from src/components/auth/recoverPassword/RecoverPassword.intl.json rename to packages/app/components/auth/recoverPassword/RecoverPassword.intl.json diff --git a/src/components/auth/recoverPassword/RecoverPassword.ts b/packages/app/components/auth/recoverPassword/RecoverPassword.ts similarity index 100% rename from src/components/auth/recoverPassword/RecoverPassword.ts rename to packages/app/components/auth/recoverPassword/RecoverPassword.ts diff --git a/src/components/auth/recoverPassword/RecoverPasswordBody.js b/packages/app/components/auth/recoverPassword/RecoverPasswordBody.js similarity index 95% rename from src/components/auth/recoverPassword/RecoverPasswordBody.js rename to packages/app/components/auth/recoverPassword/RecoverPasswordBody.js index 60b8f87..98a970f 100644 --- a/src/components/auth/recoverPassword/RecoverPasswordBody.js +++ b/packages/app/components/auth/recoverPassword/RecoverPasswordBody.js @@ -3,8 +3,8 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; -import { Input } from 'components/ui/form'; -import BaseAuthBody from 'components/auth/BaseAuthBody'; +import { Input } from 'app/components/ui/form'; +import BaseAuthBody from 'app/components/auth/BaseAuthBody'; import styles from './recoverPassword.scss'; import messages from './RecoverPassword.intl.json'; diff --git a/src/components/auth/recoverPassword/recoverPassword.scss b/packages/app/components/auth/recoverPassword/recoverPassword.scss similarity index 70% rename from src/components/auth/recoverPassword/recoverPassword.scss rename to packages/app/components/auth/recoverPassword/recoverPassword.scss index 59acd7d..7da264e 100644 --- a/src/components/auth/recoverPassword/recoverPassword.scss +++ b/packages/app/components/auth/recoverPassword/recoverPassword.scss @@ -1,4 +1,4 @@ -@import '~components/ui/colors.scss'; +@import '~app/components/ui/colors.scss'; .descriptionText { font-size: 15px; diff --git a/src/components/auth/reducer.test.ts b/packages/app/components/auth/reducer.test.ts similarity index 96% rename from src/components/auth/reducer.test.ts rename to packages/app/components/auth/reducer.test.ts index 3134aa2..666d668 100644 --- a/src/components/auth/reducer.test.ts +++ b/packages/app/components/auth/reducer.test.ts @@ -1,4 +1,4 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import auth from './reducer'; import { setLogin, diff --git a/src/components/auth/reducer.ts b/packages/app/components/auth/reducer.ts similarity index 100% rename from src/components/auth/reducer.ts rename to packages/app/components/auth/reducer.ts diff --git a/src/components/auth/register/Register.intl.json b/packages/app/components/auth/register/Register.intl.json similarity index 100% rename from src/components/auth/register/Register.intl.json rename to packages/app/components/auth/register/Register.intl.json diff --git a/src/components/auth/register/Register.ts b/packages/app/components/auth/register/Register.ts similarity index 100% rename from src/components/auth/register/Register.ts rename to packages/app/components/auth/register/Register.ts diff --git a/src/components/auth/register/RegisterBody.js b/packages/app/components/auth/register/RegisterBody.js similarity index 88% rename from src/components/auth/register/RegisterBody.js rename to packages/app/components/auth/register/RegisterBody.js index b024b29..3cc4856 100644 --- a/src/components/auth/register/RegisterBody.js +++ b/packages/app/components/auth/register/RegisterBody.js @@ -1,13 +1,11 @@ import React from 'react'; - import { FormattedMessage as Message } from 'react-intl'; import { Link } from 'react-router-dom'; +import { Input, Checkbox, Captcha } from 'app/components/ui/form'; +import BaseAuthBody from 'app/components/auth/BaseAuthBody'; -import { Input, Checkbox, Captcha } from 'components/ui/form'; -import BaseAuthBody from 'components/auth/BaseAuthBody'; -import passwordMessages from 'components/auth/password/Password.intl.json'; - -import styles from 'components/auth/auth.scss'; +import passwordMessages from '../password/Password.intl.json'; +import styles from '../auth.scss'; import messages from './Register.intl.json'; // TODO: password and username can be validate for length and sameness diff --git a/src/components/auth/resendActivation/ResendActivation.intl.json b/packages/app/components/auth/resendActivation/ResendActivation.intl.json similarity index 100% rename from src/components/auth/resendActivation/ResendActivation.intl.json rename to packages/app/components/auth/resendActivation/ResendActivation.intl.json diff --git a/src/components/auth/resendActivation/ResendActivation.ts b/packages/app/components/auth/resendActivation/ResendActivation.ts similarity index 100% rename from src/components/auth/resendActivation/ResendActivation.ts rename to packages/app/components/auth/resendActivation/ResendActivation.ts diff --git a/src/components/auth/resendActivation/ResendActivationBody.js b/packages/app/components/auth/resendActivation/ResendActivationBody.js similarity index 82% rename from src/components/auth/resendActivation/ResendActivationBody.js rename to packages/app/components/auth/resendActivation/ResendActivationBody.js index b69e60d..773e6d3 100644 --- a/src/components/auth/resendActivation/ResendActivationBody.js +++ b/packages/app/components/auth/resendActivation/ResendActivationBody.js @@ -1,11 +1,9 @@ import React from 'react'; - import { FormattedMessage as Message } from 'react-intl'; +import { Input, Captcha } from 'app/components/ui/form'; -import { Input, Captcha } from 'components/ui/form'; -import registerMessages from 'components/auth/register/Register.intl.json'; - -import BaseAuthBody from 'components/auth/BaseAuthBody'; +import BaseAuthBody from '../BaseAuthBody'; +import registerMessages from '../register/Register.intl.json'; import styles from './resendActivation.scss'; import messages from './ResendActivation.intl.json'; diff --git a/src/components/auth/resendActivation/resendActivation.scss b/packages/app/components/auth/resendActivation/resendActivation.scss similarity index 73% rename from src/components/auth/resendActivation/resendActivation.scss rename to packages/app/components/auth/resendActivation/resendActivation.scss index 4df3389..69b43c3 100644 --- a/src/components/auth/resendActivation/resendActivation.scss +++ b/packages/app/components/auth/resendActivation/resendActivation.scss @@ -1,4 +1,4 @@ -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/fonts.scss'; .description { font-family: $font-family-title; diff --git a/src/components/contact/ContactForm.test.tsx b/packages/app/components/contact/ContactForm.test.tsx similarity index 97% rename from src/components/contact/ContactForm.test.tsx rename to packages/app/components/contact/ContactForm.test.tsx index d58f3c8..4fc7a62 100644 --- a/src/components/contact/ContactForm.test.tsx +++ b/packages/app/components/contact/ContactForm.test.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import sinon from 'sinon'; import { shallow, mount } from 'enzyme'; import { IntlProvider } from 'react-intl'; -import feedback from 'services/api/feedback'; -import { User } from 'components/user'; +import feedback from 'app/services/api/feedback'; +import { User } from 'app/components/user'; import { ContactForm } from './ContactForm'; diff --git a/src/components/contact/ContactForm.tsx b/packages/app/components/contact/ContactForm.tsx similarity index 93% rename from src/components/contact/ContactForm.tsx rename to packages/app/components/contact/ContactForm.tsx index d3db30f..40fa216 100644 --- a/src/components/contact/ContactForm.tsx +++ b/packages/app/components/contact/ContactForm.tsx @@ -9,13 +9,13 @@ import { Form, FormModel, Dropdown, -} from 'components/ui/form'; -import feedback from 'services/api/feedback'; -import icons from 'components/ui/icons.scss'; -import popupStyles from 'components/ui/popup/popup.scss'; -import { RootState } from 'reducers'; -import logger from 'services/logger'; -import { User } from 'components/user'; +} from 'app/components/ui/form'; +import feedback from 'app/services/api/feedback'; +import icons from 'app/components/ui/icons.scss'; +import popupStyles from 'app/components/ui/popup/popup.scss'; +import { RootState } from 'app/reducers'; +import logger from 'app/services/logger'; +import { User } from 'app/components/user'; import styles from './contactForm.scss'; import messages from './contactForm.intl.json'; diff --git a/src/components/contact/ContactLink.tsx b/packages/app/components/contact/ContactLink.tsx similarity index 88% rename from src/components/contact/ContactLink.tsx rename to packages/app/components/contact/ContactLink.tsx index 09d7679..46c857c 100644 --- a/src/components/contact/ContactLink.tsx +++ b/packages/app/components/contact/ContactLink.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { connect } from 'react-redux'; -import { create as createPopup } from 'components/ui/popup/actions'; +import { create as createPopup } from 'app/components/ui/popup/actions'; import ContactForm from './ContactForm'; type Props = React.AnchorHTMLAttributes & { diff --git a/src/components/contact/contactForm.intl.json b/packages/app/components/contact/contactForm.intl.json similarity index 100% rename from src/components/contact/contactForm.intl.json rename to packages/app/components/contact/contactForm.intl.json diff --git a/src/components/contact/contactForm.scss b/packages/app/components/contact/contactForm.scss similarity index 70% rename from src/components/contact/contactForm.scss rename to packages/app/components/contact/contactForm.scss index 91fcbca..26ad1f1 100644 --- a/src/components/contact/contactForm.scss +++ b/packages/app/components/contact/contactForm.scss @@ -1,11 +1,11 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; -@import '~components/ui/popup/popup.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; +@import '~app/components/ui/popup/popup.scss'; /* Form state */ .contactForm { - composes: popupWrapper from '~components/ui/popup/popup.scss'; + composes: popupWrapper from '~app/components/ui/popup/popup.scss'; @include popupBounding(500px); } @@ -46,13 +46,13 @@ /* Success State */ .successState { - composes: popupWrapper from '~components/ui/popup/popup.scss'; + composes: popupWrapper from '~app/components/ui/popup/popup.scss'; @include popupBounding(320px); } .successBody { - composes: body from '~components/ui/popup/popup.scss'; + composes: body from '~app/components/ui/popup/popup.scss'; text-align: center; } @@ -64,7 +64,7 @@ } .successIcon { - composes: checkmark from '~components/ui/icons.scss'; + composes: checkmark from '~app/components/ui/icons.scss'; font-size: 90px; color: #aaa; diff --git a/src/components/contact/index.ts b/packages/app/components/contact/index.ts similarity index 100% rename from src/components/contact/index.ts rename to packages/app/components/contact/index.ts diff --git a/src/components/dev/apps/ApplicationsIndex.intl.json b/packages/app/components/dev/apps/ApplicationsIndex.intl.json similarity index 100% rename from src/components/dev/apps/ApplicationsIndex.intl.json rename to packages/app/components/dev/apps/ApplicationsIndex.intl.json diff --git a/src/components/dev/apps/ApplicationsIndex.tsx b/packages/app/components/dev/apps/ApplicationsIndex.tsx similarity index 94% rename from src/components/dev/apps/ApplicationsIndex.tsx rename to packages/app/components/dev/apps/ApplicationsIndex.tsx index e0fbd37..355200b 100644 --- a/src/components/dev/apps/ApplicationsIndex.tsx +++ b/packages/app/components/dev/apps/ApplicationsIndex.tsx @@ -2,10 +2,10 @@ import React from 'react'; import classNames from 'classnames'; import { FormattedMessage as Message } from 'react-intl'; import { Helmet } from 'react-helmet'; -import { LinkButton } from 'components/ui/form'; -import { COLOR_GREEN, COLOR_BLUE } from 'components/ui'; -import { ContactLink } from 'components/contact'; -import { OauthAppResponse } from 'services/api/oauth'; +import { LinkButton } from 'app/components/ui/form'; +import { COLOR_GREEN, COLOR_BLUE } from 'app/components/ui'; +import { ContactLink } from 'app/components/contact'; +import { OauthAppResponse } from 'app/services/api/oauth'; import styles from './applicationsIndex.scss'; import messages from './ApplicationsIndex.intl.json'; diff --git a/src/components/dev/apps/actions.ts b/packages/app/components/dev/apps/actions.ts similarity index 93% rename from src/components/dev/apps/actions.ts rename to packages/app/components/dev/apps/actions.ts index 795f0bf..fcf7ea4 100644 --- a/src/components/dev/apps/actions.ts +++ b/packages/app/components/dev/apps/actions.ts @@ -1,7 +1,7 @@ -import oauth from 'services/api/oauth'; import { Dispatch } from 'redux'; -import { OauthAppResponse } from 'services/api/oauth'; -import { User } from 'components/user'; +import { OauthAppResponse } from 'app/services/api/oauth'; +import oauth from 'app/services/api/oauth'; +import { User } from 'app/components/user'; import { Apps } from './reducer'; diff --git a/src/components/dev/apps/applicationForm/ApplicationForm.intl.json b/packages/app/components/dev/apps/applicationForm/ApplicationForm.intl.json similarity index 100% rename from src/components/dev/apps/applicationForm/ApplicationForm.intl.json rename to packages/app/components/dev/apps/applicationForm/ApplicationForm.intl.json diff --git a/src/components/dev/apps/applicationForm/ApplicationForm.tsx b/packages/app/components/dev/apps/applicationForm/ApplicationForm.tsx similarity index 87% rename from src/components/dev/apps/applicationForm/ApplicationForm.tsx rename to packages/app/components/dev/apps/applicationForm/ApplicationForm.tsx index ef4d074..14a7a93 100644 --- a/src/components/dev/apps/applicationForm/ApplicationForm.tsx +++ b/packages/app/components/dev/apps/applicationForm/ApplicationForm.tsx @@ -2,14 +2,17 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; import { Helmet } from 'react-helmet'; import { MessageDescriptor } from 'react-intl'; -import { OauthAppResponse } from 'services/api/oauth'; -import { ApplicationType } from 'components/dev/apps'; -import { Form, FormModel, Button } from 'components/ui/form'; -import { BackButton } from 'components/profile/ProfileForm'; -import { COLOR_GREEN } from 'components/ui'; -import { TYPE_APPLICATION, TYPE_MINECRAFT_SERVER } from 'components/dev/apps'; -import styles from 'components/profile/profileForm.scss'; -import logger from 'services/logger'; +import { OauthAppResponse } from 'app/services/api/oauth'; +import { ApplicationType } from 'app/components/dev/apps'; +import { Form, FormModel, Button } from 'app/components/ui/form'; +import { BackButton } from 'app/components/profile/ProfileForm'; +import { COLOR_GREEN } from 'app/components/ui'; +import { + TYPE_APPLICATION, + TYPE_MINECRAFT_SERVER, +} from 'app/components/dev/apps'; +import styles from 'app/components/profile/profileForm.scss'; +import logger from 'app/services/logger'; import messages from './ApplicationForm.intl.json'; import ApplicationTypeSwitcher from './ApplicationTypeSwitcher'; diff --git a/src/components/dev/apps/applicationForm/ApplicationTypeSwitcher.tsx b/packages/app/components/dev/apps/applicationForm/ApplicationTypeSwitcher.tsx similarity index 83% rename from src/components/dev/apps/applicationForm/ApplicationTypeSwitcher.tsx rename to packages/app/components/dev/apps/applicationForm/ApplicationTypeSwitcher.tsx index 35cd424..9fcbb58 100644 --- a/src/components/dev/apps/applicationForm/ApplicationTypeSwitcher.tsx +++ b/packages/app/components/dev/apps/applicationForm/ApplicationTypeSwitcher.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import { ApplicationType } from 'components/dev/apps'; +import { ApplicationType } from 'app/components/dev/apps'; import { MessageDescriptor } from 'react-intl'; -import { SKIN_LIGHT } from 'components/ui'; -import { Radio } from 'components/ui/form'; +import { SKIN_LIGHT } from 'app/components/ui'; +import { Radio } from 'app/components/ui/form'; import styles from './applicationTypeSwitcher.scss'; diff --git a/src/components/dev/apps/applicationForm/MinecraftServerType.tsx b/packages/app/components/dev/apps/applicationForm/MinecraftServerType.tsx similarity index 85% rename from src/components/dev/apps/applicationForm/MinecraftServerType.tsx rename to packages/app/components/dev/apps/applicationForm/MinecraftServerType.tsx index 4cf062d..53a1c31 100644 --- a/src/components/dev/apps/applicationForm/MinecraftServerType.tsx +++ b/packages/app/components/dev/apps/applicationForm/MinecraftServerType.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; -import { OauthAppResponse } from 'services/api/oauth'; -import { Input, FormModel } from 'components/ui/form'; -import { SKIN_LIGHT } from 'components/ui'; -import styles from 'components/profile/profileForm.scss'; +import { OauthAppResponse } from 'app/services/api/oauth'; +import { Input, FormModel } from 'app/components/ui/form'; +import { SKIN_LIGHT } from 'app/components/ui'; +import styles from 'app/components/profile/profileForm.scss'; import messages from './ApplicationForm.intl.json'; diff --git a/src/components/dev/apps/applicationForm/WebsiteType.tsx b/packages/app/components/dev/apps/applicationForm/WebsiteType.tsx similarity index 88% rename from src/components/dev/apps/applicationForm/WebsiteType.tsx rename to packages/app/components/dev/apps/applicationForm/WebsiteType.tsx index d9012fd..1aa54c4 100644 --- a/src/components/dev/apps/applicationForm/WebsiteType.tsx +++ b/packages/app/components/dev/apps/applicationForm/WebsiteType.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; -import { Input, TextArea, FormModel } from 'components/ui/form'; -import { OauthAppResponse } from 'services/api/oauth'; -import { SKIN_LIGHT } from 'components/ui'; -import styles from 'components/profile/profileForm.scss'; +import { Input, TextArea, FormModel } from 'app/components/ui/form'; +import { OauthAppResponse } from 'app/services/api/oauth'; +import { SKIN_LIGHT } from 'app/components/ui'; +import styles from 'app/components/profile/profileForm.scss'; import messages from './ApplicationForm.intl.json'; diff --git a/src/components/dev/apps/applicationForm/applicationTypeSwitcher.scss b/packages/app/components/dev/apps/applicationForm/applicationTypeSwitcher.scss similarity index 100% rename from src/components/dev/apps/applicationForm/applicationTypeSwitcher.scss rename to packages/app/components/dev/apps/applicationForm/applicationTypeSwitcher.scss diff --git a/src/components/dev/apps/applicationsIndex.scss b/packages/app/components/dev/apps/applicationsIndex.scss similarity index 94% rename from src/components/dev/apps/applicationsIndex.scss rename to packages/app/components/dev/apps/applicationsIndex.scss index 19659ab..91ffd13 100644 --- a/src/components/dev/apps/applicationsIndex.scss +++ b/packages/app/components/dev/apps/applicationsIndex.scss @@ -1,5 +1,5 @@ -@import '~components/ui/fonts.scss'; -@import '~components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; .container { max-width: 500px; @@ -157,7 +157,7 @@ } .appItemToggleIcon { - composes: arrowRight from '~components/ui/icons.scss'; + composes: arrowRight from '~app/components/ui/icons.scss'; position: relative; left: 0; @@ -203,7 +203,7 @@ $appDetailsContainerRightLeftPadding: 30px; } .pencilIcon { - composes: pencil from '~components/ui/icons.scss'; + composes: pencil from '~app/components/ui/icons.scss'; font-size: 14px; position: relative; @@ -248,7 +248,7 @@ $appDetailsContainerRightLeftPadding: 30px; } .continueActionLink { - composes: textLink from '~index.scss'; + composes: textLink from '~app/index.scss'; font-family: $font-family-title; font-size: 14px; diff --git a/src/components/dev/apps/icons/cube.svg b/packages/app/components/dev/apps/icons/cube.svg similarity index 100% rename from src/components/dev/apps/icons/cube.svg rename to packages/app/components/dev/apps/icons/cube.svg diff --git a/src/components/dev/apps/icons/loading-cube.svg b/packages/app/components/dev/apps/icons/loading-cube.svg similarity index 100% rename from src/components/dev/apps/icons/loading-cube.svg rename to packages/app/components/dev/apps/icons/loading-cube.svg diff --git a/src/components/dev/apps/icons/tools.svg b/packages/app/components/dev/apps/icons/tools.svg similarity index 100% rename from src/components/dev/apps/icons/tools.svg rename to packages/app/components/dev/apps/icons/tools.svg diff --git a/src/components/dev/apps/index.ts b/packages/app/components/dev/apps/index.ts similarity index 100% rename from src/components/dev/apps/index.ts rename to packages/app/components/dev/apps/index.ts diff --git a/src/components/dev/apps/list/ApplicationItem.tsx b/packages/app/components/dev/apps/list/ApplicationItem.tsx similarity index 97% rename from src/components/dev/apps/list/ApplicationItem.tsx rename to packages/app/components/dev/apps/list/ApplicationItem.tsx index 3db39e3..d8de7e6 100644 --- a/src/components/dev/apps/list/ApplicationItem.tsx +++ b/packages/app/components/dev/apps/list/ApplicationItem.tsx @@ -2,10 +2,10 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; import { Link } from 'react-router-dom'; import classNames from 'classnames'; -import { SKIN_LIGHT, COLOR_BLACK, COLOR_RED } from 'components/ui'; -import { Input, Button } from 'components/ui/form'; -import { OauthAppResponse } from 'services/api/oauth'; -import Collapse from 'components/ui/collapse'; +import { SKIN_LIGHT, COLOR_BLACK, COLOR_RED } from 'app/components/ui'; +import { Input, Button } from 'app/components/ui/form'; +import { OauthAppResponse } from 'app/services/api/oauth'; +import Collapse from 'app/components/ui/collapse'; import styles from '../applicationsIndex.scss'; import messages from '../ApplicationsIndex.intl.json'; diff --git a/src/components/dev/apps/list/ApplicationsList.tsx b/packages/app/components/dev/apps/list/ApplicationsList.tsx similarity index 92% rename from src/components/dev/apps/list/ApplicationsList.tsx rename to packages/app/components/dev/apps/list/ApplicationsList.tsx index f72cbd8..5ae0508 100644 --- a/src/components/dev/apps/list/ApplicationsList.tsx +++ b/packages/app/components/dev/apps/list/ApplicationsList.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { restoreScroll } from 'components/ui/scroll/scroll'; +import { restoreScroll } from 'app/components/ui/scroll/scroll'; import { FormattedMessage as Message } from 'react-intl'; -import { LinkButton } from 'components/ui/form'; -import { COLOR_GREEN } from 'components/ui'; -import { OauthAppResponse } from 'services/api/oauth'; +import { LinkButton } from 'app/components/ui/form'; +import { COLOR_GREEN } from 'app/components/ui'; +import { OauthAppResponse } from 'app/services/api/oauth'; import messages from '../ApplicationsIndex.intl.json'; import styles from '../applicationsIndex.scss'; diff --git a/src/components/dev/apps/list/index.ts b/packages/app/components/dev/apps/list/index.ts similarity index 100% rename from src/components/dev/apps/list/index.ts rename to packages/app/components/dev/apps/list/index.ts diff --git a/src/components/dev/apps/reducer.ts b/packages/app/components/dev/apps/reducer.ts similarity index 94% rename from src/components/dev/apps/reducer.ts rename to packages/app/components/dev/apps/reducer.ts index 34e6ac1..9a3e039 100644 --- a/src/components/dev/apps/reducer.ts +++ b/packages/app/components/dev/apps/reducer.ts @@ -1,4 +1,4 @@ -import { OauthAppResponse } from 'services/api/oauth'; +import { OauthAppResponse } from 'app/services/api/oauth'; import { Action } from './actions'; diff --git a/src/components/footerMenu/FooterMenu.tsx b/packages/app/components/footerMenu/FooterMenu.tsx similarity index 88% rename from src/components/footerMenu/FooterMenu.tsx rename to packages/app/components/footerMenu/FooterMenu.tsx index 971135e..f1b7d30 100644 --- a/src/components/footerMenu/FooterMenu.tsx +++ b/packages/app/components/footerMenu/FooterMenu.tsx @@ -2,9 +2,9 @@ import React from 'react'; import { connect } from 'react-redux'; import { Link } from 'react-router-dom'; import { FormattedMessage as Message } from 'react-intl'; -import LanguageSwitcher from 'components/languageSwitcher'; -import { create as createPopup } from 'components/ui/popup/actions'; -import { ContactLink } from 'components/contact'; +import LanguageSwitcher from 'app/components/languageSwitcher'; +import { create as createPopup } from 'app/components/ui/popup/actions'; +import { ContactLink } from 'app/components/contact'; import styles from './footerMenu.scss'; import messages from './footerMenu.intl.json'; diff --git a/src/components/footerMenu/footerMenu.intl.json b/packages/app/components/footerMenu/footerMenu.intl.json similarity index 100% rename from src/components/footerMenu/footerMenu.intl.json rename to packages/app/components/footerMenu/footerMenu.intl.json diff --git a/src/components/footerMenu/footerMenu.scss b/packages/app/components/footerMenu/footerMenu.scss similarity index 83% rename from src/components/footerMenu/footerMenu.scss rename to packages/app/components/footerMenu/footerMenu.scss index ad818bf..b5abcc8 100644 --- a/src/components/footerMenu/footerMenu.scss +++ b/packages/app/components/footerMenu/footerMenu.scss @@ -14,7 +14,7 @@ } .langTriggerIcon { - composes: globe from '~components/ui/icons.scss'; + composes: globe from '~app/components/ui/icons.scss'; position: relative; bottom: 1px; diff --git a/src/components/footerMenu/index.ts b/packages/app/components/footerMenu/index.ts similarity index 100% rename from src/components/footerMenu/index.ts rename to packages/app/components/footerMenu/index.ts diff --git a/src/components/i18n/IntlProvider.tsx b/packages/app/components/i18n/IntlProvider.tsx similarity index 88% rename from src/components/i18n/IntlProvider.tsx rename to packages/app/components/i18n/IntlProvider.tsx index daf7fe3..a1bb5a1 100644 --- a/src/components/i18n/IntlProvider.tsx +++ b/packages/app/components/i18n/IntlProvider.tsx @@ -1,8 +1,8 @@ import React, { useState, useEffect } from 'react'; import { connect } from 'react-redux'; import { RawIntlProvider, IntlShape } from 'react-intl'; -import i18n from 'services/i18n'; -import { RootState } from 'reducers'; +import i18n from 'app/services/i18n'; +import { RootState } from 'app/reducers'; type Props = { children: React.ReactNode; diff --git a/src/components/i18n/actions.ts b/packages/app/components/i18n/actions.ts similarity index 91% rename from src/components/i18n/actions.ts rename to packages/app/components/i18n/actions.ts index fdae4bc..431a1ed 100644 --- a/src/components/i18n/actions.ts +++ b/packages/app/components/i18n/actions.ts @@ -1,4 +1,4 @@ -import i18n from 'services/i18n'; +import i18n from 'app/services/i18n'; export const SET_LOCALE = 'i18n:setLocale'; export function setLocale(desiredLocale: string) { diff --git a/src/components/i18n/index.ts b/packages/app/components/i18n/index.ts similarity index 100% rename from src/components/i18n/index.ts rename to packages/app/components/i18n/index.ts diff --git a/src/components/i18n/localeFlags.ts b/packages/app/components/i18n/localeFlags.ts similarity index 95% rename from src/components/i18n/localeFlags.ts rename to packages/app/components/i18n/localeFlags.ts index bb7ce0b..6d390ed 100644 --- a/src/components/i18n/localeFlags.ts +++ b/packages/app/components/i18n/localeFlags.ts @@ -1,4 +1,4 @@ -import supportedLocales from 'i18n'; +import supportedLocales from 'app/i18n'; const localeToCountryCode = { en: 'gb', diff --git a/src/components/i18n/reducer.ts b/packages/app/components/i18n/reducer.ts similarity index 89% rename from src/components/i18n/reducer.ts rename to packages/app/components/i18n/reducer.ts index 56694ed..4266db0 100644 --- a/src/components/i18n/reducer.ts +++ b/packages/app/components/i18n/reducer.ts @@ -1,4 +1,4 @@ -import i18n from 'services/i18n'; +import i18n from 'app/services/i18n'; import { SET_LOCALE } from './actions'; diff --git a/src/components/langMenu/LangMenu.js b/packages/app/components/langMenu/LangMenu.js similarity index 100% rename from src/components/langMenu/LangMenu.js rename to packages/app/components/langMenu/LangMenu.js diff --git a/src/components/languageSwitcher/LanguageList.tsx b/packages/app/components/languageSwitcher/LanguageList.tsx similarity index 100% rename from src/components/languageSwitcher/LanguageList.tsx rename to packages/app/components/languageSwitcher/LanguageList.tsx diff --git a/src/components/languageSwitcher/LanguageSwitcher.tsx b/packages/app/components/languageSwitcher/LanguageSwitcher.tsx similarity index 93% rename from src/components/languageSwitcher/LanguageSwitcher.tsx rename to packages/app/components/languageSwitcher/LanguageSwitcher.tsx index 233da34..b73a5af 100644 --- a/src/components/languageSwitcher/LanguageSwitcher.tsx +++ b/packages/app/components/languageSwitcher/LanguageSwitcher.tsx @@ -2,16 +2,16 @@ import React from 'react'; import { FormattedMessage as Message, injectIntl, IntlShape } from 'react-intl'; import classNames from 'classnames'; import { connect } from 'react-redux'; -import { changeLang } from 'components/user/actions'; -import LANGS from 'i18n'; -import formStyles from 'components/ui/form/form.scss'; -import popupStyles from 'components/ui/popup/popup.scss'; -import icons from 'components/ui/icons.scss'; +import { changeLang } from 'app/components/user/actions'; +import LANGS from 'app/i18n'; +import formStyles from 'app/components/ui/form/form.scss'; +import popupStyles from 'app/components/ui/popup/popup.scss'; +import icons from 'app/components/ui/icons.scss'; import styles from './languageSwitcher.scss'; import messages from './languageSwitcher.intl.json'; import LanguageList from './LanguageList'; -import { RootState } from 'reducers'; +import { RootState } from 'app/reducers'; const translateUrl = 'http://ely.by/translate'; diff --git a/src/components/languageSwitcher/LocaleItem.tsx b/packages/app/components/languageSwitcher/LocaleItem.tsx similarity index 95% rename from src/components/languageSwitcher/LocaleItem.tsx rename to packages/app/components/languageSwitcher/LocaleItem.tsx index 5363016..5d7fc2e 100644 --- a/src/components/languageSwitcher/LocaleItem.tsx +++ b/packages/app/components/languageSwitcher/LocaleItem.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { localeFlags } from 'components/i18n'; +import { localeFlags } from 'app/components/i18n'; import { FormattedMessage as Message } from 'react-intl'; import messages from './languageSwitcher.intl.json'; diff --git a/src/components/languageSwitcher/changeLanguageLink/ChangeLanguageLink.tsx b/packages/app/components/languageSwitcher/changeLanguageLink/ChangeLanguageLink.tsx similarity index 81% rename from src/components/languageSwitcher/changeLanguageLink/ChangeLanguageLink.tsx rename to packages/app/components/languageSwitcher/changeLanguageLink/ChangeLanguageLink.tsx index 34ac809..3a1281d 100644 --- a/src/components/languageSwitcher/changeLanguageLink/ChangeLanguageLink.tsx +++ b/packages/app/components/languageSwitcher/changeLanguageLink/ChangeLanguageLink.tsx @@ -1,11 +1,11 @@ import React from 'react'; import classNames from 'classnames'; -import { localeFlags } from 'components/i18n'; -import LANGS from 'i18n'; +import { localeFlags } from 'app/components/i18n'; +import LANGS from 'app/i18n'; import { connect } from 'react-redux'; -import { create as createPopup } from 'components/ui/popup/actions'; -import LanguageSwitcher from 'components/languageSwitcher'; -import { RootState } from 'reducers'; +import { create as createPopup } from 'app/components/ui/popup/actions'; +import LanguageSwitcher from 'app/components/languageSwitcher'; +import { RootState } from 'app/reducers'; import styles from './link.scss'; diff --git a/src/components/languageSwitcher/changeLanguageLink/link.scss b/packages/app/components/languageSwitcher/changeLanguageLink/link.scss similarity index 92% rename from src/components/languageSwitcher/changeLanguageLink/link.scss rename to packages/app/components/languageSwitcher/changeLanguageLink/link.scss index eafc065..97d7535 100644 --- a/src/components/languageSwitcher/changeLanguageLink/link.scss +++ b/packages/app/components/languageSwitcher/changeLanguageLink/link.scss @@ -1,4 +1,4 @@ -@import '~components/ui/colors.scss'; +@import '~app/components/ui/colors.scss'; .languageLink { position: relative; diff --git a/src/components/languageSwitcher/images/bite_my_shiny_metal_ass.svg b/packages/app/components/languageSwitcher/images/bite_my_shiny_metal_ass.svg similarity index 100% rename from src/components/languageSwitcher/images/bite_my_shiny_metal_ass.svg rename to packages/app/components/languageSwitcher/images/bite_my_shiny_metal_ass.svg diff --git a/src/components/languageSwitcher/images/i_took_an_arrow_in_my_knee.svg b/packages/app/components/languageSwitcher/images/i_took_an_arrow_in_my_knee.svg similarity index 100% rename from src/components/languageSwitcher/images/i_took_an_arrow_in_my_knee.svg rename to packages/app/components/languageSwitcher/images/i_took_an_arrow_in_my_knee.svg diff --git a/src/components/languageSwitcher/images/may_the_force_be_with_you.svg b/packages/app/components/languageSwitcher/images/may_the_force_be_with_you.svg similarity index 100% rename from src/components/languageSwitcher/images/may_the_force_be_with_you.svg rename to packages/app/components/languageSwitcher/images/may_the_force_be_with_you.svg diff --git a/src/components/languageSwitcher/images/that_fucking_pumpkin.svg b/packages/app/components/languageSwitcher/images/that_fucking_pumpkin.svg similarity index 100% rename from src/components/languageSwitcher/images/that_fucking_pumpkin.svg rename to packages/app/components/languageSwitcher/images/that_fucking_pumpkin.svg diff --git a/src/components/languageSwitcher/index.ts b/packages/app/components/languageSwitcher/index.ts similarity index 100% rename from src/components/languageSwitcher/index.ts rename to packages/app/components/languageSwitcher/index.ts diff --git a/src/components/languageSwitcher/languageSwitcher.intl.json b/packages/app/components/languageSwitcher/languageSwitcher.intl.json similarity index 100% rename from src/components/languageSwitcher/languageSwitcher.intl.json rename to packages/app/components/languageSwitcher/languageSwitcher.intl.json diff --git a/src/components/languageSwitcher/languageSwitcher.scss b/packages/app/components/languageSwitcher/languageSwitcher.scss similarity index 89% rename from src/components/languageSwitcher/languageSwitcher.scss rename to packages/app/components/languageSwitcher/languageSwitcher.scss index 84e2d64..844971d 100644 --- a/src/components/languageSwitcher/languageSwitcher.scss +++ b/packages/app/components/languageSwitcher/languageSwitcher.scss @@ -1,6 +1,6 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; -@import '~components/ui/popup/popup.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; +@import '~app/components/ui/popup/popup.scss'; @mixin hideFooter { @media (max-height: 455px) { @@ -9,13 +9,13 @@ } .languageSwitcher { - composes: popupWrapper from '~components/ui/popup/popup.scss'; + composes: popupWrapper from '~app/components/ui/popup/popup.scss'; @include popupBounding(400px); } .languageSwitcherBody { - composes: body from '~components/ui/popup/popup.scss'; + composes: body from '~app/components/ui/popup/popup.scss'; display: flex; flex-direction: column; @@ -32,7 +32,7 @@ } .searchIcon { - composes: search from '~components/ui/icons.scss'; + composes: search from '~app/components/ui/icons.scss'; position: absolute; top: 14px; @@ -126,7 +126,7 @@ $languageListBorderStyle: 1px solid $languageListBorderColor; // Реализация радио кнопки. Когда у нас будет нормальный компонент радио кнопок, нужно будет перейти на него .languageCircle { - composes: checkmark from '~components/ui/icons.scss'; + composes: checkmark from '~app/components/ui/icons.scss'; position: relative; box-sizing: border-box; @@ -208,7 +208,7 @@ $languageListBorderStyle: 1px solid $languageListBorderColor; } .improveTranslatesIcon { - composes: translate from '~components/ui/icons.scss'; + composes: translate from '~app/components/ui/icons.scss'; color: lighter($blue); font-size: 22px; diff --git a/src/components/profile/Profile.intl.json b/packages/app/components/profile/Profile.intl.json similarity index 100% rename from src/components/profile/Profile.intl.json rename to packages/app/components/profile/Profile.intl.json diff --git a/src/components/profile/Profile.tsx b/packages/app/components/profile/Profile.tsx similarity index 95% rename from src/components/profile/Profile.tsx rename to packages/app/components/profile/Profile.tsx index 3a4946b..ad59f95 100644 --- a/src/components/profile/Profile.tsx +++ b/packages/app/components/profile/Profile.tsx @@ -3,11 +3,11 @@ import { connect } from 'react-redux'; import { FormattedMessage as Message } from 'react-intl'; import { Link } from 'react-router-dom'; import Helmet from 'react-helmet'; -import { ChangeLanguageLink } from 'components/languageSwitcher'; -import { RelativeTime } from 'components/ui'; -import { User } from 'components/user'; -import RulesPage from 'pages/rules/RulesPage'; -import { RootState } from 'reducers'; +import { ChangeLanguageLink } from 'app/components/languageSwitcher'; +import { RelativeTime } from 'app/components/ui'; +import { User } from 'app/components/user'; +import RulesPage from 'app/pages/rules/RulesPage'; +import { RootState } from 'app/reducers'; import ProfileField from './ProfileField'; import styles from './profile.scss'; diff --git a/src/components/profile/ProfileField.js b/packages/app/components/profile/ProfileField.js similarity index 100% rename from src/components/profile/ProfileField.js rename to packages/app/components/profile/ProfileField.js diff --git a/src/components/profile/ProfileForm.intl.json b/packages/app/components/profile/ProfileForm.intl.json similarity index 100% rename from src/components/profile/ProfileForm.intl.json rename to packages/app/components/profile/ProfileForm.intl.json diff --git a/src/components/profile/ProfileForm.tsx b/packages/app/components/profile/ProfileForm.tsx similarity index 84% rename from src/components/profile/ProfileForm.tsx rename to packages/app/components/profile/ProfileForm.tsx index 4d6edec..cc99239 100644 --- a/src/components/profile/ProfileForm.tsx +++ b/packages/app/components/profile/ProfileForm.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; import { Link } from 'react-router-dom'; -import FormComponent from 'components/ui/form/FormComponent'; -import styles from 'components/profile/profileForm.scss'; +import FormComponent from 'app/components/ui/form/FormComponent'; +import styles from './profileForm.scss'; import messages from './ProfileForm.intl.json'; export class BackButton extends FormComponent<{ diff --git a/src/components/profile/changeEmail/ChangeEmail.intl.json b/packages/app/components/profile/changeEmail/ChangeEmail.intl.json similarity index 100% rename from src/components/profile/changeEmail/ChangeEmail.intl.json rename to packages/app/components/profile/changeEmail/ChangeEmail.intl.json diff --git a/src/components/profile/changeEmail/ChangeEmail.js b/packages/app/components/profile/changeEmail/ChangeEmail.js similarity index 94% rename from src/components/profile/changeEmail/ChangeEmail.js rename to packages/app/components/profile/changeEmail/ChangeEmail.js index 8d9c7a0..f7cf28c 100644 --- a/src/components/profile/changeEmail/ChangeEmail.js +++ b/packages/app/components/profile/changeEmail/ChangeEmail.js @@ -1,16 +1,20 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; - import { FormattedMessage as Message } from 'react-intl'; import Helmet from 'react-helmet'; - -import { SlideMotion } from 'components/ui/motion'; -import { ScrollIntoView } from 'components/ui/scroll'; -import { Input, Button, Form, FormModel, FormError } from 'components/ui/form'; -import { BackButton } from 'components/profile/ProfileForm'; -import styles from 'components/profile/profileForm.scss'; -import helpLinks from 'components/auth/helpLinks.scss'; -import Stepper from 'components/ui/stepper'; +import { SlideMotion } from 'app/components/ui/motion'; +import { ScrollIntoView } from 'app/components/ui/scroll'; +import { + Input, + Button, + Form, + FormModel, + FormError, +} from 'app/components/ui/form'; +import { BackButton } from 'app/components/profile/ProfileForm'; +import styles from 'app/components/profile/profileForm.scss'; +import helpLinks from 'app/components/auth/helpLinks.scss'; +import Stepper from 'app/components/ui/stepper'; import changeEmail from './changeEmail.scss'; import messages from './ChangeEmail.intl.json'; diff --git a/src/components/profile/changeEmail/changeEmail.scss b/packages/app/components/profile/changeEmail/changeEmail.scss similarity index 100% rename from src/components/profile/changeEmail/changeEmail.scss rename to packages/app/components/profile/changeEmail/changeEmail.scss diff --git a/src/components/profile/changePassword/ChangePassword.intl.json b/packages/app/components/profile/changePassword/ChangePassword.intl.json similarity index 100% rename from src/components/profile/changePassword/ChangePassword.intl.json rename to packages/app/components/profile/changePassword/ChangePassword.intl.json diff --git a/src/components/profile/changePassword/ChangePassword.js b/packages/app/components/profile/changePassword/ChangePassword.js similarity index 93% rename from src/components/profile/changePassword/ChangePassword.js rename to packages/app/components/profile/changePassword/ChangePassword.js index 0b74d31..98fb716 100644 --- a/src/components/profile/changePassword/ChangePassword.js +++ b/packages/app/components/profile/changePassword/ChangePassword.js @@ -1,13 +1,17 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; - import { FormattedMessage as Message } from 'react-intl'; import Helmet from 'react-helmet'; +import { + Input, + Button, + Checkbox, + Form, + FormModel, +} from 'app/components/ui/form'; +import { BackButton } from 'app/components/profile/ProfileForm'; -import { Input, Button, Checkbox, Form, FormModel } from 'components/ui/form'; -import { BackButton } from 'components/profile/ProfileForm'; - -import styles from 'components/profile/profileForm.scss'; +import styles from 'app/components/profile/profileForm.scss'; import messages from './ChangePassword.intl.json'; export default class ChangePassword extends Component { diff --git a/src/components/profile/changePassword/ChangePassword.test.js b/packages/app/components/profile/changePassword/ChangePassword.test.js similarity index 83% rename from src/components/profile/changePassword/ChangePassword.test.js rename to packages/app/components/profile/changePassword/ChangePassword.test.js index ede5afc..2491a4c 100644 --- a/src/components/profile/changePassword/ChangePassword.test.js +++ b/packages/app/components/profile/changePassword/ChangePassword.test.js @@ -1,10 +1,10 @@ import React from 'react'; -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import sinon from 'sinon'; import { shallow } from 'enzyme'; -import ChangePassword from 'components/profile/changePassword/ChangePassword'; +import ChangePassword from 'app/components/profile/changePassword/ChangePassword'; describe('', () => { it('renders two components', () => { diff --git a/src/components/profile/changeUsername/ChangeUsername.intl.json b/packages/app/components/profile/changeUsername/ChangeUsername.intl.json similarity index 100% rename from src/components/profile/changeUsername/ChangeUsername.intl.json rename to packages/app/components/profile/changeUsername/ChangeUsername.intl.json diff --git a/src/components/profile/changeUsername/ChangeUsername.js b/packages/app/components/profile/changeUsername/ChangeUsername.js similarity index 92% rename from src/components/profile/changeUsername/ChangeUsername.js rename to packages/app/components/profile/changeUsername/ChangeUsername.js index 77a1320..c2d7e97 100644 --- a/src/components/profile/changeUsername/ChangeUsername.js +++ b/packages/app/components/profile/changeUsername/ChangeUsername.js @@ -4,9 +4,9 @@ import React, { Component } from 'react'; import { FormattedMessage as Message } from 'react-intl'; import Helmet from 'react-helmet'; -import { Input, Button, Form, FormModel } from 'components/ui/form'; -import { BackButton } from 'components/profile/ProfileForm'; -import styles from 'components/profile/profileForm.scss'; +import { Input, Button, Form, FormModel } from 'app/components/ui/form'; +import { BackButton } from 'app/components/profile/ProfileForm'; +import styles from 'app/components/profile/profileForm.scss'; import messages from './ChangeUsername.intl.json'; diff --git a/src/components/profile/multiFactorAuth/MfaDisable.tsx b/packages/app/components/profile/multiFactorAuth/MfaDisable.tsx similarity index 88% rename from src/components/profile/multiFactorAuth/MfaDisable.tsx rename to packages/app/components/profile/multiFactorAuth/MfaDisable.tsx index 670835f..f6bd921 100644 --- a/src/components/profile/multiFactorAuth/MfaDisable.tsx +++ b/packages/app/components/profile/multiFactorAuth/MfaDisable.tsx @@ -1,8 +1,8 @@ import React from 'react'; import PropTypes from 'prop-types'; -import logger from 'services/logger'; -import { disable as disableMFA } from 'services/api/mfa'; -import { FormModel } from 'components/ui/form'; +import logger from 'app/services/logger'; +import { disable as disableMFA } from 'app/services/api/mfa'; +import { FormModel } from 'app/components/ui/form'; import MfaDisableForm from './disableForm/MfaDisableForm'; import MfaStatus from './status/MfaStatus'; diff --git a/src/components/profile/multiFactorAuth/MfaEnable.tsx b/packages/app/components/profile/multiFactorAuth/MfaEnable.tsx similarity index 89% rename from src/components/profile/multiFactorAuth/MfaEnable.tsx rename to packages/app/components/profile/multiFactorAuth/MfaEnable.tsx index c690255..ee82425 100644 --- a/src/components/profile/multiFactorAuth/MfaEnable.tsx +++ b/packages/app/components/profile/multiFactorAuth/MfaEnable.tsx @@ -1,13 +1,13 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Button, FormModel } from 'components/ui/form'; -import styles from 'components/profile/profileForm.scss'; -import Stepper from 'components/ui/stepper'; -import { SlideMotion } from 'components/ui/motion'; -import { ScrollIntoView } from 'components/ui/scroll'; -import logger from 'services/logger'; -import { getSecret, enable as enableMFA } from 'services/api/mfa'; -import { Form } from 'components/ui/form'; +import { Button, FormModel } from 'app/components/ui/form'; +import styles from 'app/components/profile/profileForm.scss'; +import Stepper from 'app/components/ui/stepper'; +import { SlideMotion } from 'app/components/ui/motion'; +import { ScrollIntoView } from 'app/components/ui/scroll'; +import logger from 'app/services/logger'; +import { getSecret, enable as enableMFA } from 'app/services/api/mfa'; +import { Form } from 'app/components/ui/form'; import Instructions from './instructions'; import KeyForm from './keyForm'; diff --git a/src/components/profile/multiFactorAuth/MultiFactorAuth.intl.json b/packages/app/components/profile/multiFactorAuth/MultiFactorAuth.intl.json similarity index 100% rename from src/components/profile/multiFactorAuth/MultiFactorAuth.intl.json rename to packages/app/components/profile/multiFactorAuth/MultiFactorAuth.intl.json diff --git a/src/components/profile/multiFactorAuth/MultiFactorAuth.tsx b/packages/app/components/profile/multiFactorAuth/MultiFactorAuth.tsx similarity index 90% rename from src/components/profile/multiFactorAuth/MultiFactorAuth.tsx rename to packages/app/components/profile/multiFactorAuth/MultiFactorAuth.tsx index b7b479e..248620c 100644 --- a/src/components/profile/multiFactorAuth/MultiFactorAuth.tsx +++ b/packages/app/components/profile/multiFactorAuth/MultiFactorAuth.tsx @@ -1,9 +1,9 @@ import React from 'react'; import Helmet from 'react-helmet'; import { FormattedMessage as Message } from 'react-intl'; -import styles from 'components/profile/profileForm.scss'; -import { BackButton } from 'components/profile/ProfileForm'; -import { FormModel } from 'components/ui/form'; +import styles from 'app/components/profile/profileForm.scss'; +import { BackButton } from 'app/components/profile/ProfileForm'; +import { FormModel } from 'app/components/ui/form'; import MfaEnable, { MfaStep } from './MfaEnable'; import MfaDisable from './MfaDisable'; diff --git a/src/components/profile/multiFactorAuth/confirmation/Confirmation.tsx b/packages/app/components/profile/multiFactorAuth/confirmation/Confirmation.tsx similarity index 88% rename from src/components/profile/multiFactorAuth/confirmation/Confirmation.tsx rename to packages/app/components/profile/multiFactorAuth/confirmation/Confirmation.tsx index cf882aa..51194ec 100644 --- a/src/components/profile/multiFactorAuth/confirmation/Confirmation.tsx +++ b/packages/app/components/profile/multiFactorAuth/confirmation/Confirmation.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; -import { Input, Form, FormModel } from 'components/ui/form'; +import { Input, Form, FormModel } from 'app/components/ui/form'; -import profileForm from 'components/profile/profileForm.scss'; +import profileForm from 'app/components/profile/profileForm.scss'; import messages from '../MultiFactorAuth.intl.json'; export default function Confirmation({ diff --git a/src/components/profile/multiFactorAuth/confirmation/index.ts b/packages/app/components/profile/multiFactorAuth/confirmation/index.ts similarity index 100% rename from src/components/profile/multiFactorAuth/confirmation/index.ts rename to packages/app/components/profile/multiFactorAuth/confirmation/index.ts diff --git a/src/components/profile/multiFactorAuth/disableForm/MfaDisableForm.tsx b/packages/app/components/profile/multiFactorAuth/disableForm/MfaDisableForm.tsx similarity index 90% rename from src/components/profile/multiFactorAuth/disableForm/MfaDisableForm.tsx rename to packages/app/components/profile/multiFactorAuth/disableForm/MfaDisableForm.tsx index 498b5a5..b062ef0 100644 --- a/src/components/profile/multiFactorAuth/disableForm/MfaDisableForm.tsx +++ b/packages/app/components/profile/multiFactorAuth/disableForm/MfaDisableForm.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; -import { Button, Input, Form, FormModel } from 'components/ui/form'; -import styles from 'components/profile/profileForm.scss'; +import { Button, Input, Form, FormModel } from 'app/components/ui/form'; +import styles from 'app/components/profile/profileForm.scss'; import messages from '../MultiFactorAuth.intl.json'; import mfaStyles from '../mfa.scss'; diff --git a/src/components/profile/multiFactorAuth/index.ts b/packages/app/components/profile/multiFactorAuth/index.ts similarity index 100% rename from src/components/profile/multiFactorAuth/index.ts rename to packages/app/components/profile/multiFactorAuth/index.ts diff --git a/src/components/profile/multiFactorAuth/instructions/Instructions.tsx b/packages/app/components/profile/multiFactorAuth/instructions/Instructions.tsx similarity index 97% rename from src/components/profile/multiFactorAuth/instructions/Instructions.tsx rename to packages/app/components/profile/multiFactorAuth/instructions/Instructions.tsx index f195e55..b950402 100644 --- a/src/components/profile/multiFactorAuth/instructions/Instructions.tsx +++ b/packages/app/components/profile/multiFactorAuth/instructions/Instructions.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; import classNames from 'classnames'; -import profileForm from 'components/profile/profileForm.scss'; +import profileForm from '../../profileForm.scss'; import messages from '../MultiFactorAuth.intl.json'; import OsInstruction from './OsInstruction'; import OsTile from './OsTile'; diff --git a/src/components/profile/multiFactorAuth/instructions/OsInstruction.tsx b/packages/app/components/profile/multiFactorAuth/instructions/OsInstruction.tsx similarity index 100% rename from src/components/profile/multiFactorAuth/instructions/OsInstruction.tsx rename to packages/app/components/profile/multiFactorAuth/instructions/OsInstruction.tsx diff --git a/src/components/profile/multiFactorAuth/instructions/OsTile.tsx b/packages/app/components/profile/multiFactorAuth/instructions/OsTile.tsx similarity index 100% rename from src/components/profile/multiFactorAuth/instructions/OsTile.tsx rename to packages/app/components/profile/multiFactorAuth/instructions/OsTile.tsx diff --git a/src/components/profile/multiFactorAuth/instructions/images/android.svg b/packages/app/components/profile/multiFactorAuth/instructions/images/android.svg similarity index 100% rename from src/components/profile/multiFactorAuth/instructions/images/android.svg rename to packages/app/components/profile/multiFactorAuth/instructions/images/android.svg diff --git a/src/components/profile/multiFactorAuth/instructions/images/apple.svg b/packages/app/components/profile/multiFactorAuth/instructions/images/apple.svg similarity index 100% rename from src/components/profile/multiFactorAuth/instructions/images/apple.svg rename to packages/app/components/profile/multiFactorAuth/instructions/images/apple.svg diff --git a/src/components/profile/multiFactorAuth/instructions/images/windows.svg b/packages/app/components/profile/multiFactorAuth/instructions/images/windows.svg similarity index 100% rename from src/components/profile/multiFactorAuth/instructions/images/windows.svg rename to packages/app/components/profile/multiFactorAuth/instructions/images/windows.svg diff --git a/src/components/profile/multiFactorAuth/instructions/index.ts b/packages/app/components/profile/multiFactorAuth/instructions/index.ts similarity index 100% rename from src/components/profile/multiFactorAuth/instructions/index.ts rename to packages/app/components/profile/multiFactorAuth/instructions/index.ts diff --git a/src/components/profile/multiFactorAuth/instructions/instructions.scss b/packages/app/components/profile/multiFactorAuth/instructions/instructions.scss similarity index 99% rename from src/components/profile/multiFactorAuth/instructions/instructions.scss rename to packages/app/components/profile/multiFactorAuth/instructions/instructions.scss index a277342..74c318a 100644 --- a/src/components/profile/multiFactorAuth/instructions/instructions.scss +++ b/packages/app/components/profile/multiFactorAuth/instructions/instructions.scss @@ -1,4 +1,4 @@ -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/fonts.scss'; .instructionTitle { font-family: $font-family-title; diff --git a/src/components/profile/multiFactorAuth/keyForm/KeyForm.tsx b/packages/app/components/profile/multiFactorAuth/keyForm/KeyForm.tsx similarity index 92% rename from src/components/profile/multiFactorAuth/keyForm/KeyForm.tsx rename to packages/app/components/profile/multiFactorAuth/keyForm/KeyForm.tsx index 293b1eb..a0da4c1 100644 --- a/src/components/profile/multiFactorAuth/keyForm/KeyForm.tsx +++ b/packages/app/components/profile/multiFactorAuth/keyForm/KeyForm.tsx @@ -1,8 +1,8 @@ import React from 'react'; import classNames from 'classnames'; import { FormattedMessage as Message } from 'react-intl'; -import { ImageLoader } from 'components/ui/loader'; -import profileForm from 'components/profile/profileForm.scss'; +import { ImageLoader } from 'app/components/ui/loader'; +import profileForm from 'app/components/profile/profileForm.scss'; import messages from '../MultiFactorAuth.intl.json'; import styles from './key-form.scss'; diff --git a/src/components/profile/multiFactorAuth/keyForm/index.ts b/packages/app/components/profile/multiFactorAuth/keyForm/index.ts similarity index 100% rename from src/components/profile/multiFactorAuth/keyForm/index.ts rename to packages/app/components/profile/multiFactorAuth/keyForm/index.ts diff --git a/src/components/profile/multiFactorAuth/keyForm/key-form.scss b/packages/app/components/profile/multiFactorAuth/keyForm/key-form.scss similarity index 100% rename from src/components/profile/multiFactorAuth/keyForm/key-form.scss rename to packages/app/components/profile/multiFactorAuth/keyForm/key-form.scss diff --git a/src/components/profile/multiFactorAuth/mfa.scss b/packages/app/components/profile/multiFactorAuth/mfa.scss similarity index 93% rename from src/components/profile/multiFactorAuth/mfa.scss rename to packages/app/components/profile/multiFactorAuth/mfa.scss index d7d05fd..2e5c166 100644 --- a/src/components/profile/multiFactorAuth/mfa.scss +++ b/packages/app/components/profile/multiFactorAuth/mfa.scss @@ -1,5 +1,5 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; .mfaTitle { font-size: 18px; diff --git a/src/components/profile/multiFactorAuth/status/MfaStatus.tsx b/packages/app/components/profile/multiFactorAuth/status/MfaStatus.tsx similarity index 87% rename from src/components/profile/multiFactorAuth/status/MfaStatus.tsx rename to packages/app/components/profile/multiFactorAuth/status/MfaStatus.tsx index a08eb78..fd370cc 100644 --- a/src/components/profile/multiFactorAuth/status/MfaStatus.tsx +++ b/packages/app/components/profile/multiFactorAuth/status/MfaStatus.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; -import { ScrollIntoView } from 'components/ui/scroll'; -import styles from 'components/profile/profileForm.scss'; -import icons from 'components/ui/icons.scss'; +import { ScrollIntoView } from 'app/components/ui/scroll'; +import styles from 'app/components/profile/profileForm.scss'; +import icons from 'app/components/ui/icons.scss'; import messages from '../MultiFactorAuth.intl.json'; import mfaStyles from '../mfa.scss'; diff --git a/src/components/profile/passwordRequestForm/PasswordRequestForm.intl.json b/packages/app/components/profile/passwordRequestForm/PasswordRequestForm.intl.json similarity index 100% rename from src/components/profile/passwordRequestForm/PasswordRequestForm.intl.json rename to packages/app/components/profile/passwordRequestForm/PasswordRequestForm.intl.json diff --git a/src/components/profile/passwordRequestForm/PasswordRequestForm.js b/packages/app/components/profile/passwordRequestForm/PasswordRequestForm.js similarity index 92% rename from src/components/profile/passwordRequestForm/PasswordRequestForm.js rename to packages/app/components/profile/passwordRequestForm/PasswordRequestForm.js index 2fbe19e..d3c97b7 100644 --- a/src/components/profile/passwordRequestForm/PasswordRequestForm.js +++ b/packages/app/components/profile/passwordRequestForm/PasswordRequestForm.js @@ -5,8 +5,8 @@ import { FormattedMessage as Message } from 'react-intl'; import classNames from 'classnames'; -import { Form, Button, Input, FormModel } from 'components/ui/form'; -import popupStyles from 'components/ui/popup/popup.scss'; +import { Form, Button, Input, FormModel } from 'app/components/ui/form'; +import popupStyles from 'app/components/ui/popup/popup.scss'; import styles from './passwordRequestForm.scss'; import messages from './PasswordRequestForm.intl.json'; diff --git a/src/components/profile/passwordRequestForm/passwordRequestForm.scss b/packages/app/components/profile/passwordRequestForm/passwordRequestForm.scss similarity index 56% rename from src/components/profile/passwordRequestForm/passwordRequestForm.scss rename to packages/app/components/profile/passwordRequestForm/passwordRequestForm.scss index 105ddcf..cb1e029 100644 --- a/src/components/profile/passwordRequestForm/passwordRequestForm.scss +++ b/packages/app/components/profile/passwordRequestForm/passwordRequestForm.scss @@ -1,7 +1,7 @@ -@import '~components/ui/popup/popup.scss'; +@import '~app/components/ui/popup/popup.scss'; .requestPasswordForm { - composes: popupWrapper from '~components/ui/popup/popup.scss'; + composes: popupWrapper from '~app/components/ui/popup/popup.scss'; @include popupBounding(280px); } @@ -11,7 +11,7 @@ } .lockIcon { - composes: lock from '~components/ui/icons.scss'; + composes: lock from '~app/components/ui/icons.scss'; font-size: 90px; color: #aaa; diff --git a/src/components/profile/profile.scss b/packages/app/components/profile/profile.scss similarity index 94% rename from src/components/profile/profile.scss rename to packages/app/components/profile/profile.scss index 38d30b5..40af71b 100644 --- a/src/components/profile/profile.scss +++ b/packages/app/components/profile/profile.scss @@ -1,5 +1,5 @@ -@import '~components/ui/fonts.scss'; -@import '~components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; $formColumnWidth: 416px; @@ -80,7 +80,7 @@ $formColumnWidth: 416px; } .paramEditIcon { - composes: pencil from '~components/ui/icons.scss'; + composes: pencil from '~app/components/ui/icons.scss'; color: $white; transition: 0.4s; diff --git a/src/components/profile/profileForm.scss b/packages/app/components/profile/profileForm.scss similarity index 90% rename from src/components/profile/profileForm.scss rename to packages/app/components/profile/profileForm.scss index 795f919..4340c78 100644 --- a/src/components/profile/profileForm.scss +++ b/packages/app/components/profile/profileForm.scss @@ -1,5 +1,5 @@ -@import '~components/ui/fonts.scss'; -@import '~components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; .contentWithBackButton { position: relative; @@ -27,7 +27,7 @@ } .backIcon { - composes: arrowLeft from '~components/ui/icons.scss'; + composes: arrowLeft from '~app/components/ui/icons.scss'; position: relative; } diff --git a/src/components/ui/Panel.tsx b/packages/app/components/ui/Panel.tsx similarity index 98% rename from src/components/ui/Panel.tsx rename to packages/app/components/ui/Panel.tsx index 49e6288..9b371cc 100644 --- a/src/components/ui/Panel.tsx +++ b/packages/app/components/ui/Panel.tsx @@ -1,6 +1,6 @@ import React from 'react'; import classNames from 'classnames'; -import { omit } from 'functions'; +import { omit } from 'app/functions'; import styles from './panel.scss'; import icons from './icons.scss'; diff --git a/src/components/ui/RelativeTime.tsx b/packages/app/components/ui/RelativeTime.tsx similarity index 100% rename from src/components/ui/RelativeTime.tsx rename to packages/app/components/ui/RelativeTime.tsx diff --git a/src/components/ui/bsod/BSoD.intl.json b/packages/app/components/ui/bsod/BSoD.intl.json similarity index 100% rename from src/components/ui/bsod/BSoD.intl.json rename to packages/app/components/ui/bsod/BSoD.intl.json diff --git a/src/components/ui/bsod/BSoD.tsx b/packages/app/components/ui/bsod/BSoD.tsx similarity index 91% rename from src/components/ui/bsod/BSoD.tsx rename to packages/app/components/ui/bsod/BSoD.tsx index 8ae5fcb..5728fc6 100644 --- a/src/components/ui/bsod/BSoD.tsx +++ b/packages/app/components/ui/bsod/BSoD.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; -import { IntlProvider } from 'components/i18n'; -import logger from 'services/logger'; -import appInfo from 'components/auth/appInfo/AppInfo.intl.json'; +import { IntlProvider } from 'app/components/i18n'; +import logger from 'app/services/logger'; +import appInfo from 'app/components/auth/appInfo/AppInfo.intl.json'; import styles from './styles.scss'; import BoxesField from './BoxesField'; diff --git a/src/components/ui/bsod/Box.js b/packages/app/components/ui/bsod/Box.js similarity index 100% rename from src/components/ui/bsod/Box.js rename to packages/app/components/ui/bsod/Box.js diff --git a/src/components/ui/bsod/BoxesField.js b/packages/app/components/ui/bsod/BoxesField.js similarity index 100% rename from src/components/ui/bsod/BoxesField.js rename to packages/app/components/ui/bsod/BoxesField.js diff --git a/src/components/ui/bsod/BsodMiddleware.test.ts b/packages/app/components/ui/bsod/BsodMiddleware.test.ts similarity index 91% rename from src/components/ui/bsod/BsodMiddleware.test.ts rename to packages/app/components/ui/bsod/BsodMiddleware.test.ts index 0f49e5b..1df3c00 100644 --- a/src/components/ui/bsod/BsodMiddleware.test.ts +++ b/packages/app/components/ui/bsod/BsodMiddleware.test.ts @@ -1,7 +1,7 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import sinon from 'sinon'; -import BsodMiddleware from 'components/ui/bsod/BsodMiddleware'; +import BsodMiddleware from 'app/components/ui/bsod/BsodMiddleware'; describe('BsodMiddleware', () => { [500, 503, 555].forEach(code => diff --git a/src/components/ui/bsod/BsodMiddleware.ts b/packages/app/components/ui/bsod/BsodMiddleware.ts similarity index 87% rename from src/components/ui/bsod/BsodMiddleware.ts rename to packages/app/components/ui/bsod/BsodMiddleware.ts index 428e1c1..d697034 100644 --- a/src/components/ui/bsod/BsodMiddleware.ts +++ b/packages/app/components/ui/bsod/BsodMiddleware.ts @@ -1,6 +1,6 @@ -import { InternalServerError } from 'services/request'; -import { Resp, Middleware } from 'services/request'; -import defaultLogger from 'services/logger'; +import { InternalServerError } from 'app/services/request'; +import { Resp, Middleware } from 'app/services/request'; +import defaultLogger from 'app/services/logger'; type Logger = typeof defaultLogger; diff --git a/src/components/ui/bsod/actions.js b/packages/app/components/ui/bsod/actions.js similarity index 100% rename from src/components/ui/bsod/actions.js rename to packages/app/components/ui/bsod/actions.js diff --git a/src/components/ui/bsod/dispatchBsod.js b/packages/app/components/ui/bsod/dispatchBsod.js similarity index 89% rename from src/components/ui/bsod/dispatchBsod.js rename to packages/app/components/ui/bsod/dispatchBsod.js index 41e8085..854d5f6 100644 --- a/src/components/ui/bsod/dispatchBsod.js +++ b/packages/app/components/ui/bsod/dispatchBsod.js @@ -2,7 +2,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { bsod } from './actions'; -import BSoD from 'components/ui/bsod/BSoD'; +import BSoD from 'app/components/ui/bsod/BSoD'; let injectedStore; let onBsod; diff --git a/src/components/ui/bsod/factory.js b/packages/app/components/ui/bsod/factory.js similarity index 77% rename from src/components/ui/bsod/factory.js rename to packages/app/components/ui/bsod/factory.js index c028dc1..42124ba 100644 --- a/src/components/ui/bsod/factory.js +++ b/packages/app/components/ui/bsod/factory.js @@ -1,5 +1,5 @@ -import request from 'services/request'; -import logger from 'services/logger'; +import request from 'app/services/request'; +import logger from 'app/services/logger'; import dispatchBsod, { inject } from './dispatchBsod'; import BsodMiddleware from './BsodMiddleware'; diff --git a/src/components/ui/bsod/reducer.js b/packages/app/components/ui/bsod/reducer.js similarity index 100% rename from src/components/ui/bsod/reducer.js rename to packages/app/components/ui/bsod/reducer.js diff --git a/src/components/ui/bsod/styles.scss b/packages/app/components/ui/bsod/styles.scss similarity index 94% rename from src/components/ui/bsod/styles.scss rename to packages/app/components/ui/bsod/styles.scss index 83267f3..ca38ca0 100644 --- a/src/components/ui/bsod/styles.scss +++ b/packages/app/components/ui/bsod/styles.scss @@ -1,4 +1,4 @@ -@import '~components/ui/colors.scss'; +@import '~app/components/ui/colors.scss'; $font-family-monospaced: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Roboto Mono', monospace; diff --git a/src/components/ui/button-groups.scss b/packages/app/components/ui/button-groups.scss similarity index 100% rename from src/components/ui/button-groups.scss rename to packages/app/components/ui/button-groups.scss diff --git a/src/components/ui/buttons.scss b/packages/app/components/ui/buttons.scss similarity index 100% rename from src/components/ui/buttons.scss rename to packages/app/components/ui/buttons.scss diff --git a/src/components/ui/collapse/Collapse.tsx b/packages/app/components/ui/collapse/Collapse.tsx similarity index 96% rename from src/components/ui/collapse/Collapse.tsx rename to packages/app/components/ui/collapse/Collapse.tsx index 89cd659..b53abce 100644 --- a/src/components/ui/collapse/Collapse.tsx +++ b/packages/app/components/ui/collapse/Collapse.tsx @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Motion, spring } from 'react-motion'; -import MeasureHeight from 'components/MeasureHeight'; +import MeasureHeight from 'app/components/MeasureHeight'; import styles from './collapse.scss'; diff --git a/src/components/ui/collapse/collapse.scss b/packages/app/components/ui/collapse/collapse.scss similarity index 53% rename from src/components/ui/collapse/collapse.scss rename to packages/app/components/ui/collapse/collapse.scss index bf6a76c..094ab5f 100644 --- a/src/components/ui/collapse/collapse.scss +++ b/packages/app/components/ui/collapse/collapse.scss @@ -1,4 +1,4 @@ -@import '~components/ui/colors.scss'; +@import '~app/components/ui/colors.scss'; .overflow { overflow: hidden; diff --git a/src/components/ui/collapse/index.ts b/packages/app/components/ui/collapse/index.ts similarity index 100% rename from src/components/ui/collapse/index.ts rename to packages/app/components/ui/collapse/index.ts diff --git a/src/components/ui/colors.scss b/packages/app/components/ui/colors.scss similarity index 100% rename from src/components/ui/colors.scss rename to packages/app/components/ui/colors.scss diff --git a/src/components/ui/fonts.scss b/packages/app/components/ui/fonts.scss similarity index 100% rename from src/components/ui/fonts.scss rename to packages/app/components/ui/fonts.scss diff --git a/src/components/ui/form/Button.tsx b/packages/app/components/ui/form/Button.tsx similarity index 90% rename from src/components/ui/form/Button.tsx rename to packages/app/components/ui/form/Button.tsx index db22a0a..0ebdcef 100644 --- a/src/components/ui/form/Button.tsx +++ b/packages/app/components/ui/form/Button.tsx @@ -1,9 +1,9 @@ import React from 'react'; import classNames from 'classnames'; -import buttons from 'components/ui/buttons.scss'; -import { COLOR_GREEN } from 'components/ui'; +import buttons from 'app/components/ui/buttons.scss'; +import { COLOR_GREEN } from 'app/components/ui'; import { MessageDescriptor } from 'react-intl'; -import { Color } from 'components/ui'; +import { Color } from 'app/components/ui'; import FormComponent from './FormComponent'; diff --git a/src/components/ui/form/Captcha.tsx b/packages/app/components/ui/form/Captcha.tsx similarity index 86% rename from src/components/ui/form/Captcha.tsx rename to packages/app/components/ui/form/Captcha.tsx index e6e19a8..b2d8a52 100644 --- a/src/components/ui/form/Captcha.tsx +++ b/packages/app/components/ui/form/Captcha.tsx @@ -1,10 +1,10 @@ import React from 'react'; import classNames from 'classnames'; -import { CaptchaID } from 'services/captcha'; -import { Skin } from 'components/ui'; -import captcha from 'services/captcha'; -import logger from 'services/logger'; -import { ComponentLoader } from 'components/ui/loader'; +import { CaptchaID } from 'app/services/captcha'; +import { Skin } from 'app/components/ui'; +import captcha from 'app/services/captcha'; +import logger from 'app/services/logger'; +import { ComponentLoader } from 'app/components/ui/loader'; import styles from './form.scss'; import FormInputComponent from './FormInputComponent'; diff --git a/src/components/ui/form/Checkbox.tsx b/packages/app/components/ui/form/Checkbox.tsx similarity index 92% rename from src/components/ui/form/Checkbox.tsx rename to packages/app/components/ui/form/Checkbox.tsx index 8d1a34d..ec29bd8 100644 --- a/src/components/ui/form/Checkbox.tsx +++ b/packages/app/components/ui/form/Checkbox.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { MessageDescriptor } from 'react-intl'; import classNames from 'classnames'; -import { SKIN_DARK, COLOR_GREEN, Color, Skin } from 'components/ui'; -import { omit } from 'functions'; +import { SKIN_DARK, COLOR_GREEN, Color, Skin } from 'app/components/ui'; +import { omit } from 'app/functions'; import styles from './form.scss'; import FormInputComponent from './FormInputComponent'; diff --git a/src/components/ui/form/Dropdown.js b/packages/app/components/ui/form/Dropdown.js similarity index 97% rename from src/components/ui/form/Dropdown.js rename to packages/app/components/ui/form/Dropdown.js index 5a612d1..2de01fc 100644 --- a/src/components/ui/form/Dropdown.js +++ b/packages/app/components/ui/form/Dropdown.js @@ -4,8 +4,8 @@ import ReactDOM from 'react-dom'; import classNames from 'classnames'; -import { omit } from 'functions'; -import { colors, COLOR_GREEN } from 'components/ui'; +import { omit } from 'app/functions'; +import { colors, COLOR_GREEN } from 'app/components/ui'; import styles from './dropdown.scss'; import FormInputComponent from './FormInputComponent'; diff --git a/src/components/ui/form/Form.tsx b/packages/app/components/ui/form/Form.tsx similarity index 98% rename from src/components/ui/form/Form.tsx rename to packages/app/components/ui/form/Form.tsx index 26fb186..8a15b79 100644 --- a/src/components/ui/form/Form.tsx +++ b/packages/app/components/ui/form/Form.tsx @@ -1,6 +1,6 @@ import React from 'react'; import classNames from 'classnames'; -import logger from 'services/logger'; +import logger from 'app/services/logger'; import FormModel from './FormModel'; import styles from './form.scss'; diff --git a/src/components/ui/form/FormComponent.tsx b/packages/app/components/ui/form/FormComponent.tsx similarity index 96% rename from src/components/ui/form/FormComponent.tsx rename to packages/app/components/ui/form/FormComponent.tsx index 23f728b..b3b16d1 100644 --- a/src/components/ui/form/FormComponent.tsx +++ b/packages/app/components/ui/form/FormComponent.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { MessageDescriptor } from 'react-intl'; -import i18n from 'services/i18n'; +import i18n from 'app/services/i18n'; class FormComponent extends React.Component { /** diff --git a/src/components/ui/form/FormError.tsx b/packages/app/components/ui/form/FormError.tsx similarity index 92% rename from src/components/ui/form/FormError.tsx rename to packages/app/components/ui/form/FormError.tsx index 472c553..b34a5ab 100644 --- a/src/components/ui/form/FormError.tsx +++ b/packages/app/components/ui/form/FormError.tsx @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import errorsDict from 'services/errorsDict'; +import errorsDict from 'app/services/errorsDict'; import styles from './form.scss'; diff --git a/src/components/ui/form/FormInputComponent.tsx b/packages/app/components/ui/form/FormInputComponent.tsx similarity index 100% rename from src/components/ui/form/FormInputComponent.tsx rename to packages/app/components/ui/form/FormInputComponent.tsx diff --git a/src/components/ui/form/FormModel.ts b/packages/app/components/ui/form/FormModel.ts similarity index 100% rename from src/components/ui/form/FormModel.ts rename to packages/app/components/ui/form/FormModel.ts diff --git a/src/components/ui/form/Input.test.tsx b/packages/app/components/ui/form/Input.test.tsx similarity index 93% rename from src/components/ui/form/Input.test.tsx rename to packages/app/components/ui/form/Input.test.tsx index c977b1f..0c6ae69 100644 --- a/src/components/ui/form/Input.test.tsx +++ b/packages/app/components/ui/form/Input.test.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { mount } from 'enzyme'; -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import { IntlProvider } from 'react-intl'; import Input from './Input'; diff --git a/src/components/ui/form/Input.tsx b/packages/app/components/ui/form/Input.tsx similarity index 94% rename from src/components/ui/form/Input.tsx rename to packages/app/components/ui/form/Input.tsx index 68796fb..1bb6c10 100644 --- a/src/components/ui/form/Input.tsx +++ b/packages/app/components/ui/form/Input.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { MessageDescriptor } from 'react-intl'; import classNames from 'classnames'; -import { uniqueId, omit } from 'functions'; -import copy from 'services/copy'; -import icons from 'components/ui/icons.scss'; -import { SKIN_DARK, COLOR_GREEN, Skin, Color } from 'components/ui'; +import { uniqueId, omit } from 'app/functions'; +import copy from 'app/services/copy'; +import icons from 'app/components/ui/icons.scss'; +import { SKIN_DARK, COLOR_GREEN, Skin, Color } from 'app/components/ui'; import styles from './form.scss'; import FormInputComponent from './FormInputComponent'; diff --git a/src/components/ui/form/LinkButton.tsx b/packages/app/components/ui/form/LinkButton.tsx similarity index 100% rename from src/components/ui/form/LinkButton.tsx rename to packages/app/components/ui/form/LinkButton.tsx diff --git a/src/components/ui/form/Radio.tsx b/packages/app/components/ui/form/Radio.tsx similarity index 90% rename from src/components/ui/form/Radio.tsx rename to packages/app/components/ui/form/Radio.tsx index a76724a..02b8a18 100644 --- a/src/components/ui/form/Radio.tsx +++ b/packages/app/components/ui/form/Radio.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { MessageDescriptor } from 'react-intl'; import classNames from 'classnames'; -import { SKIN_DARK, COLOR_GREEN } from 'components/ui'; -import { omit } from 'functions'; -import { Color, Skin } from 'components/ui'; +import { SKIN_DARK, COLOR_GREEN } from 'app/components/ui'; +import { omit } from 'app/functions'; +import { Color, Skin } from 'app/components/ui'; import styles from './form.scss'; import FormInputComponent from './FormInputComponent'; diff --git a/src/components/ui/form/TextArea.tsx b/packages/app/components/ui/form/TextArea.tsx similarity index 95% rename from src/components/ui/form/TextArea.tsx rename to packages/app/components/ui/form/TextArea.tsx index 35eb4ba..2518233 100644 --- a/src/components/ui/form/TextArea.tsx +++ b/packages/app/components/ui/form/TextArea.tsx @@ -2,8 +2,8 @@ import React from 'react'; import { MessageDescriptor } from 'react-intl'; import TextareaAutosize from 'react-textarea-autosize'; import classNames from 'classnames'; -import { uniqueId, omit } from 'functions'; -import { SKIN_DARK, COLOR_GREEN, Skin, Color } from 'components/ui'; +import { uniqueId, omit } from 'app/functions'; +import { SKIN_DARK, COLOR_GREEN, Skin, Color } from 'app/components/ui'; import styles from './form.scss'; import FormInputComponent from './FormInputComponent'; diff --git a/src/components/ui/form/dropdown.scss b/packages/app/components/ui/form/dropdown.scss similarity index 93% rename from src/components/ui/form/dropdown.scss rename to packages/app/components/ui/form/dropdown.scss index 577b733..43d0356 100644 --- a/src/components/ui/form/dropdown.scss +++ b/packages/app/components/ui/form/dropdown.scss @@ -1,5 +1,5 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; $dropdownPadding: 15px; @@ -54,7 +54,7 @@ $dropdownPadding: 15px; } .toggleIcon { - composes: selecter from '~components/ui/icons.scss'; + composes: selecter from '~app/components/ui/icons.scss'; position: absolute; right: $dropdownPadding; diff --git a/src/components/ui/form/form.scss b/packages/app/components/ui/form/form.scss similarity index 97% rename from src/components/ui/form/form.scss rename to packages/app/components/ui/form/form.scss index a678465..06b16c6 100644 --- a/src/components/ui/form/form.scss +++ b/packages/app/components/ui/form/form.scss @@ -1,5 +1,5 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; @mixin form-transition() { // Анимация фона должна быть быстрее анимации рамки, т.к. визуально фон заполняется медленнее @@ -283,7 +283,7 @@ .mark { composes: markPosition; - composes: checkmark from '~components/ui/icons.scss'; + composes: checkmark from '~app/components/ui/icons.scss'; border: 2px #dcd8cd solid; diff --git a/src/components/ui/form/images/loader_button.gif b/packages/app/components/ui/form/images/loader_button.gif similarity index 100% rename from src/components/ui/form/images/loader_button.gif rename to packages/app/components/ui/form/images/loader_button.gif diff --git a/src/components/ui/form/index.ts b/packages/app/components/ui/form/index.ts similarity index 100% rename from src/components/ui/form/index.ts rename to packages/app/components/ui/form/index.ts diff --git a/src/components/ui/icons.scss b/packages/app/components/ui/icons.scss similarity index 91% rename from src/components/ui/icons.scss rename to packages/app/components/ui/icons.scss index cbfab29..907276a 100644 --- a/src/components/ui/icons.scss +++ b/packages/app/components/ui/icons.scss @@ -1,4 +1,4 @@ -@import '~icons.font.json'; +@import '~app/icons.font.json'; // По умолчанию стрелка смотрит вниз, это просто алиас .arrowBottom { diff --git a/src/components/ui/index.ts b/packages/app/components/ui/index.ts similarity index 100% rename from src/components/ui/index.ts rename to packages/app/components/ui/index.ts diff --git a/src/components/ui/loader/ComponentLoader.tsx b/packages/app/components/ui/loader/ComponentLoader.tsx similarity index 93% rename from src/components/ui/loader/ComponentLoader.tsx rename to packages/app/components/ui/loader/ComponentLoader.tsx index 1e76c96..794ab72 100644 --- a/src/components/ui/loader/ComponentLoader.tsx +++ b/packages/app/components/ui/loader/ComponentLoader.tsx @@ -1,6 +1,6 @@ import React from 'react'; import classNames from 'classnames'; -import { Skin } from 'components/ui'; +import { Skin } from 'app/components/ui'; import styles from './componentLoader.scss'; diff --git a/src/components/ui/loader/ImageLoader.tsx b/packages/app/components/ui/loader/ImageLoader.tsx similarity index 92% rename from src/components/ui/loader/ImageLoader.tsx rename to packages/app/components/ui/loader/ImageLoader.tsx index 02b1497..a4e2719 100644 --- a/src/components/ui/loader/ImageLoader.tsx +++ b/packages/app/components/ui/loader/ImageLoader.tsx @@ -1,7 +1,7 @@ import React from 'react'; import classNames from 'classnames'; -import { ComponentLoader } from 'components/ui/loader'; -import { SKIN_LIGHT } from 'components/ui'; +import { ComponentLoader } from 'app/components/ui/loader'; +import { SKIN_LIGHT } from 'app/components/ui'; import styles from './imageLoader.scss'; diff --git a/src/components/ui/loader/componentLoader.scss b/packages/app/components/ui/loader/componentLoader.scss similarity index 94% rename from src/components/ui/loader/componentLoader.scss rename to packages/app/components/ui/loader/componentLoader.scss index c77c343..e176fe4 100644 --- a/src/components/ui/loader/componentLoader.scss +++ b/packages/app/components/ui/loader/componentLoader.scss @@ -1,4 +1,4 @@ -@import '~components/ui/colors.scss'; +@import '~app/components/ui/colors.scss'; .componentLoader { width: 100%; diff --git a/src/components/ui/loader/imageLoader.scss b/packages/app/components/ui/loader/imageLoader.scss similarity index 100% rename from src/components/ui/loader/imageLoader.scss rename to packages/app/components/ui/loader/imageLoader.scss diff --git a/src/components/ui/loader/index.ts b/packages/app/components/ui/loader/index.ts similarity index 100% rename from src/components/ui/loader/index.ts rename to packages/app/components/ui/loader/index.ts diff --git a/src/components/ui/loader/loader.html b/packages/app/components/ui/loader/loader.html similarity index 100% rename from src/components/ui/loader/loader.html rename to packages/app/components/ui/loader/loader.html diff --git a/src/components/ui/loader/loader.scss b/packages/app/components/ui/loader/loader.scss similarity index 100% rename from src/components/ui/loader/loader.scss rename to packages/app/components/ui/loader/loader.scss diff --git a/src/components/ui/motion/SlideMotion.tsx b/packages/app/components/ui/motion/SlideMotion.tsx similarity index 97% rename from src/components/ui/motion/SlideMotion.tsx rename to packages/app/components/ui/motion/SlideMotion.tsx index 094029a..f3a3b29 100644 --- a/src/components/ui/motion/SlideMotion.tsx +++ b/packages/app/components/ui/motion/SlideMotion.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Motion, spring } from 'react-motion'; -import MeasureHeight from 'components/MeasureHeight'; +import MeasureHeight from 'app/components/MeasureHeight'; import styles from './slide-motion.scss'; diff --git a/src/components/ui/motion/index.ts b/packages/app/components/ui/motion/index.ts similarity index 100% rename from src/components/ui/motion/index.ts rename to packages/app/components/ui/motion/index.ts diff --git a/src/components/ui/motion/slide-motion.scss b/packages/app/components/ui/motion/slide-motion.scss similarity index 100% rename from src/components/ui/motion/slide-motion.scss rename to packages/app/components/ui/motion/slide-motion.scss diff --git a/src/components/ui/panel.scss b/packages/app/components/ui/panel.scss similarity index 91% rename from src/components/ui/panel.scss rename to packages/app/components/ui/panel.scss index c508bcf..ae2b0c0 100644 --- a/src/components/ui/panel.scss +++ b/packages/app/components/ui/panel.scss @@ -1,5 +1,5 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; .panel { background: $black; @@ -23,7 +23,7 @@ $headerHeight: 60px; } .headerControl { - composes: black from '~components/ui/buttons.scss'; + composes: black from '~app/components/ui/buttons.scss'; float: left; overflow: hidden; @@ -119,7 +119,7 @@ $bodyTopBottomPadding: 15px; } .close { - composes: close from '~components/ui/icons.scss'; + composes: close from '~app/components/ui/icons.scss'; position: absolute; right: 5px; diff --git a/src/components/ui/popup/PopupStack.test.js b/packages/app/components/ui/popup/PopupStack.test.js similarity index 96% rename from src/components/ui/popup/PopupStack.test.js rename to packages/app/components/ui/popup/PopupStack.test.js index 9e49b1c..48ee0b8 100644 --- a/src/components/ui/popup/PopupStack.test.js +++ b/packages/app/components/ui/popup/PopupStack.test.js @@ -1,12 +1,12 @@ import sinon from 'sinon'; -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import React from 'react'; import { shallow, mount } from 'enzyme'; -import { PopupStack } from 'components/ui/popup/PopupStack'; -import styles from 'components/ui/popup/popup.scss'; +import { PopupStack } from 'app/components/ui/popup/PopupStack'; +import styles from 'app/components/ui/popup/popup.scss'; function DummyPopup(/** @type {{[key: string]: any}} */ _props) { return null; diff --git a/src/components/ui/popup/PopupStack.tsx b/packages/app/components/ui/popup/PopupStack.tsx similarity index 95% rename from src/components/ui/popup/PopupStack.tsx rename to packages/app/components/ui/popup/PopupStack.tsx index a6b1f5b..b3a57ec 100644 --- a/src/components/ui/popup/PopupStack.tsx +++ b/packages/app/components/ui/popup/PopupStack.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { TransitionGroup, CSSTransition } from 'react-transition-group'; -import { browserHistory } from 'services/history'; +import { browserHistory } from 'app/services/history'; import { connect } from 'react-redux'; -import { RootState } from 'reducers'; +import { RootState } from 'app/reducers'; import { PopupConfig } from './reducer'; import { destroy } from './actions'; diff --git a/src/components/ui/popup/actions.ts b/packages/app/components/ui/popup/actions.ts similarity index 100% rename from src/components/ui/popup/actions.ts rename to packages/app/components/ui/popup/actions.ts diff --git a/src/components/ui/popup/popup.scss b/packages/app/components/ui/popup/popup.scss similarity index 97% rename from src/components/ui/popup/popup.scss rename to packages/app/components/ui/popup/popup.scss index d4b82e6..99132e4 100644 --- a/src/components/ui/popup/popup.scss +++ b/packages/app/components/ui/popup/popup.scss @@ -1,5 +1,5 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; $popupPadding: 20px; // Отступ контента внутри попапа $popupMargin: 20px; // Отступ попапа от краёв окна diff --git a/src/components/ui/popup/reducer.test.js b/packages/app/components/ui/popup/reducer.test.js similarity index 92% rename from src/components/ui/popup/reducer.test.js rename to packages/app/components/ui/popup/reducer.test.js index 17164b7..55fbbcc 100644 --- a/src/components/ui/popup/reducer.test.js +++ b/packages/app/components/ui/popup/reducer.test.js @@ -1,7 +1,7 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import React from 'react'; -import reducer from 'components/ui/popup/reducer'; -import { create, destroy } from 'components/ui/popup/actions'; +import reducer from 'app/components/ui/popup/reducer'; +import { create, destroy } from 'app/components/ui/popup/actions'; describe('popup/reducer', () => { it('should have no popups by default', () => { diff --git a/src/components/ui/popup/reducer.ts b/packages/app/components/ui/popup/reducer.ts similarity index 100% rename from src/components/ui/popup/reducer.ts rename to packages/app/components/ui/popup/reducer.ts diff --git a/src/components/ui/scroll/ScrollIntoView.tsx b/packages/app/components/ui/scroll/ScrollIntoView.tsx similarity index 100% rename from src/components/ui/scroll/ScrollIntoView.tsx rename to packages/app/components/ui/scroll/ScrollIntoView.tsx diff --git a/src/components/ui/scroll/index.ts b/packages/app/components/ui/scroll/index.ts similarity index 100% rename from src/components/ui/scroll/index.ts rename to packages/app/components/ui/scroll/index.ts diff --git a/src/components/ui/scroll/scroll.ts b/packages/app/components/ui/scroll/scroll.ts similarity index 100% rename from src/components/ui/scroll/scroll.ts rename to packages/app/components/ui/scroll/scroll.ts diff --git a/src/components/ui/stepper/Stepper.tsx b/packages/app/components/ui/stepper/Stepper.tsx similarity index 91% rename from src/components/ui/stepper/Stepper.tsx rename to packages/app/components/ui/stepper/Stepper.tsx index 55bdde4..facda57 100644 --- a/src/components/ui/stepper/Stepper.tsx +++ b/packages/app/components/ui/stepper/Stepper.tsx @@ -1,6 +1,6 @@ import React from 'react'; import classNames from 'classnames'; -import { Color, COLOR_GREEN } from 'components/ui'; +import { Color, COLOR_GREEN } from 'app/components/ui'; import styles from './stepper.scss'; diff --git a/src/components/ui/stepper/index.ts b/packages/app/components/ui/stepper/index.ts similarity index 100% rename from src/components/ui/stepper/index.ts rename to packages/app/components/ui/stepper/index.ts diff --git a/src/components/ui/stepper/stepper.scss b/packages/app/components/ui/stepper/stepper.scss similarity index 96% rename from src/components/ui/stepper/stepper.scss rename to packages/app/components/ui/stepper/stepper.scss index bbd14fd..5a78300 100644 --- a/src/components/ui/stepper/stepper.scss +++ b/packages/app/components/ui/stepper/stepper.scss @@ -1,4 +1,4 @@ -@import '~components/ui/colors.scss'; +@import '~app/components/ui/colors.scss'; .steps { height: 40px; diff --git a/src/components/user/User.ts b/packages/app/components/user/User.ts similarity index 100% rename from src/components/user/User.ts rename to packages/app/components/user/User.ts diff --git a/src/components/user/actions.ts b/packages/app/components/user/actions.ts similarity index 94% rename from src/components/user/actions.ts rename to packages/app/components/user/actions.ts index 827eaf8..717cb81 100644 --- a/src/components/user/actions.ts +++ b/packages/app/components/user/actions.ts @@ -3,9 +3,9 @@ import { changeLang as changeLangEndpoint, acceptRules as acceptRulesEndpoint, UserResponse, -} from 'services/api/accounts'; -import { setLocale } from 'components/i18n/actions'; -import { ThunkAction } from 'reducers'; +} from 'app/services/api/accounts'; +import { setLocale } from 'app/components/i18n/actions'; +import { ThunkAction } from 'app/reducers'; import { User } from './reducer'; diff --git a/src/components/user/factory.ts b/packages/app/components/user/factory.ts similarity index 83% rename from src/components/user/factory.ts rename to packages/app/components/user/factory.ts index 58286eb..8ab6191 100644 --- a/src/components/user/factory.ts +++ b/packages/app/components/user/factory.ts @@ -1,7 +1,7 @@ -import { authenticate, logoutStrangers } from 'components/accounts/actions'; -import { getActiveAccount } from 'components/accounts/reducer'; -import request from 'services/request'; -import { Store } from 'reducers'; +import { authenticate, logoutStrangers } from 'app/components/accounts/actions'; +import { getActiveAccount } from 'app/components/accounts/reducer'; +import request from 'app/services/request'; +import { Store } from 'app/reducers'; import { changeLang } from './actions'; import bearerHeaderMiddleware from './middlewares/bearerHeaderMiddleware'; diff --git a/packages/app/components/user/index.ts b/packages/app/components/user/index.ts new file mode 100644 index 0000000..2bf99ec --- /dev/null +++ b/packages/app/components/user/index.ts @@ -0,0 +1 @@ +export { User } from './reducer'; diff --git a/src/components/user/middlewares/bearerHeaderMiddleware.test.ts b/packages/app/components/user/middlewares/bearerHeaderMiddleware.test.ts similarity index 93% rename from src/components/user/middlewares/bearerHeaderMiddleware.test.ts rename to packages/app/components/user/middlewares/bearerHeaderMiddleware.test.ts index 4c559da..73e3ae4 100644 --- a/src/components/user/middlewares/bearerHeaderMiddleware.test.ts +++ b/packages/app/components/user/middlewares/bearerHeaderMiddleware.test.ts @@ -1,7 +1,7 @@ -import expect from 'test/unexpected'; -import { RootState } from 'reducers'; +import expect from 'app/test/unexpected'; +import { RootState } from 'app/reducers'; -import bearerHeaderMiddleware from 'components/user/middlewares/bearerHeaderMiddleware'; +import bearerHeaderMiddleware from 'app/components/user/middlewares/bearerHeaderMiddleware'; describe('bearerHeaderMiddleware', () => { const emptyState: RootState = { diff --git a/src/components/user/middlewares/bearerHeaderMiddleware.ts b/packages/app/components/user/middlewares/bearerHeaderMiddleware.ts similarity index 82% rename from src/components/user/middlewares/bearerHeaderMiddleware.ts rename to packages/app/components/user/middlewares/bearerHeaderMiddleware.ts index 6716f30..70d5223 100644 --- a/src/components/user/middlewares/bearerHeaderMiddleware.ts +++ b/packages/app/components/user/middlewares/bearerHeaderMiddleware.ts @@ -1,6 +1,6 @@ -import { getActiveAccount } from 'components/accounts/reducer'; -import { Store } from 'reducers'; -import { Middleware } from 'services/request'; +import { getActiveAccount } from 'app/components/accounts/reducer'; +import { Store } from 'app/reducers'; +import { Middleware } from 'app/services/request'; /** * Applies Bearer header for all requests diff --git a/src/components/user/middlewares/refreshTokenMiddleware.test.ts b/packages/app/components/user/middlewares/refreshTokenMiddleware.test.ts similarity index 95% rename from src/components/user/middlewares/refreshTokenMiddleware.test.ts rename to packages/app/components/user/middlewares/refreshTokenMiddleware.test.ts index 284542f..2b78fd6 100644 --- a/src/components/user/middlewares/refreshTokenMiddleware.test.ts +++ b/packages/app/components/user/middlewares/refreshTokenMiddleware.test.ts @@ -1,11 +1,11 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import sinon from 'sinon'; -import refreshTokenMiddleware from 'components/user/middlewares/refreshTokenMiddleware'; -import { browserHistory } from 'services/history'; -import * as authentication from 'services/api/authentication'; -import { InternalServerError } from 'services/request'; -import { updateToken } from 'components/accounts/actions'; +import refreshTokenMiddleware from 'app/components/user/middlewares/refreshTokenMiddleware'; +import { browserHistory } from 'app/services/history'; +import * as authentication from 'app/services/api/authentication'; +import { InternalServerError } from 'app/services/request'; +import { updateToken } from 'app/components/accounts/actions'; const refreshToken = 'foo'; const expiredToken = diff --git a/src/components/user/middlewares/refreshTokenMiddleware.ts b/packages/app/components/user/middlewares/refreshTokenMiddleware.ts similarity index 85% rename from src/components/user/middlewares/refreshTokenMiddleware.ts rename to packages/app/components/user/middlewares/refreshTokenMiddleware.ts index a9db069..356b452 100644 --- a/src/components/user/middlewares/refreshTokenMiddleware.ts +++ b/packages/app/components/user/middlewares/refreshTokenMiddleware.ts @@ -1,10 +1,10 @@ import { ensureToken, recoverFromTokenError, -} from 'components/accounts/actions'; -import { getActiveAccount } from 'components/accounts/reducer'; -import { Store } from 'reducers'; -import { Middleware } from 'services/request'; +} from 'app/components/accounts/actions'; +import { getActiveAccount } from 'app/components/accounts/reducer'; +import { Store } from 'app/reducers'; +import { Middleware } from 'app/services/request'; /** * Ensures, that all user's requests have fresh access token diff --git a/src/components/user/reducer.ts b/packages/app/components/user/reducer.ts similarity index 100% rename from src/components/user/reducer.ts rename to packages/app/components/user/reducer.ts diff --git a/src/components/userbar/LoggedInPanel.intl.json b/packages/app/components/userbar/LoggedInPanel.intl.json similarity index 100% rename from src/components/userbar/LoggedInPanel.intl.json rename to packages/app/components/userbar/LoggedInPanel.intl.json diff --git a/src/components/userbar/LoggedInPanel.tsx b/packages/app/components/userbar/LoggedInPanel.tsx similarity index 98% rename from src/components/userbar/LoggedInPanel.tsx rename to packages/app/components/userbar/LoggedInPanel.tsx index 64bbd8b..4d1356c 100644 --- a/src/components/userbar/LoggedInPanel.tsx +++ b/packages/app/components/userbar/LoggedInPanel.tsx @@ -1,6 +1,6 @@ import React from 'react'; import classNames from 'classnames'; -import { AccountSwitcher } from 'components/accounts'; +import { AccountSwitcher } from 'app/components/accounts'; import styles from './loggedInPanel.scss'; diff --git a/src/components/userbar/Userbar.intl.json b/packages/app/components/userbar/Userbar.intl.json similarity index 100% rename from src/components/userbar/Userbar.intl.json rename to packages/app/components/userbar/Userbar.intl.json diff --git a/src/components/userbar/Userbar.tsx b/packages/app/components/userbar/Userbar.tsx similarity index 91% rename from src/components/userbar/Userbar.tsx rename to packages/app/components/userbar/Userbar.tsx index cf42c5f..2c3bc5c 100644 --- a/src/components/userbar/Userbar.tsx +++ b/packages/app/components/userbar/Userbar.tsx @@ -1,8 +1,8 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import { FormattedMessage as Message } from 'react-intl'; -import { Account } from 'components/accounts/reducer'; -import buttons from 'components/ui/buttons.scss'; +import { Account } from 'app/components/accounts/reducer'; +import buttons from 'app/components/ui/buttons.scss'; import messages from './Userbar.intl.json'; import styles from './userbar.scss'; diff --git a/src/components/userbar/loggedInPanel.scss b/packages/app/components/userbar/loggedInPanel.scss similarity index 76% rename from src/components/userbar/loggedInPanel.scss rename to packages/app/components/userbar/loggedInPanel.scss index 97cd3fb..83dcba9 100644 --- a/src/components/userbar/loggedInPanel.scss +++ b/packages/app/components/userbar/loggedInPanel.scss @@ -1,4 +1,4 @@ -@import '~components/ui/colors.scss'; +@import '~app/components/ui/colors.scss'; .loggedInPanel { } @@ -13,7 +13,7 @@ } .activeAccountButton { - composes: green from '~components/ui/buttons.scss'; + composes: green from '~app/components/ui/buttons.scss'; } .activeAccountExpanded { @@ -31,7 +31,7 @@ } .userIcon { - composes: user from '~components/ui/icons.scss'; + composes: user from '~app/components/ui/icons.scss'; position: relative; bottom: 2px; @@ -40,7 +40,7 @@ } .expandIcon { - composes: caret from '~components/ui/icons.scss'; + composes: caret from '~app/components/ui/icons.scss'; margin-left: 4px; font-size: 6px; diff --git a/src/components/userbar/userbar.scss b/packages/app/components/userbar/userbar.scss similarity index 100% rename from src/components/userbar/userbar.scss rename to packages/app/components/userbar/userbar.scss diff --git a/src/containers/AuthFlowRoute.tsx b/packages/app/containers/AuthFlowRoute.tsx similarity index 100% rename from src/containers/AuthFlowRoute.tsx rename to packages/app/containers/AuthFlowRoute.tsx diff --git a/src/containers/AuthFlowRouteContents.test.tsx b/packages/app/containers/AuthFlowRouteContents.test.tsx similarity index 93% rename from src/containers/AuthFlowRouteContents.test.tsx rename to packages/app/containers/AuthFlowRouteContents.test.tsx index 3dd7440..d5f2176 100644 --- a/src/containers/AuthFlowRouteContents.test.tsx +++ b/packages/app/containers/AuthFlowRouteContents.test.tsx @@ -1,9 +1,9 @@ import React from 'react'; import sinon from 'sinon'; -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import { mount } from 'enzyme'; -import authFlow from 'services/authFlow'; +import authFlow from 'app/services/authFlow'; import AuthFlowRouteContents from './AuthFlowRouteContents'; diff --git a/src/containers/AuthFlowRouteContents.tsx b/packages/app/containers/AuthFlowRouteContents.tsx similarity index 96% rename from src/containers/AuthFlowRouteContents.tsx rename to packages/app/containers/AuthFlowRouteContents.tsx index 36df068..ed3d6c2 100644 --- a/src/containers/AuthFlowRouteContents.tsx +++ b/packages/app/containers/AuthFlowRouteContents.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Redirect } from 'react-router-dom'; -import authFlow from 'services/authFlow'; +import authFlow from 'app/services/authFlow'; type ComponentProps = { component: any; diff --git a/src/containers/PrivateRoute.tsx b/packages/app/containers/PrivateRoute.tsx similarity index 80% rename from src/containers/PrivateRoute.tsx rename to packages/app/containers/PrivateRoute.tsx index fce4216..5304ae8 100644 --- a/src/containers/PrivateRoute.tsx +++ b/packages/app/containers/PrivateRoute.tsx @@ -2,9 +2,9 @@ import React, { ComponentType } from 'react'; import { Route, Redirect, RouteProps } from 'react-router-dom'; import { Location } from 'history'; import { connect } from 'react-redux'; -import { getActiveAccount } from 'components/accounts/reducer'; -import { Account } from 'components/accounts'; -import { RootState } from 'reducers'; +import { getActiveAccount } from 'app/components/accounts/reducer'; +import { Account } from 'app/components/accounts'; +import { RootState } from 'app/reducers'; interface Props extends RouteProps { component: ComponentType; diff --git a/src/favicon.ico b/packages/app/favicon.ico similarity index 100% rename from src/favicon.ico rename to packages/app/favicon.ico diff --git a/src/first-render.js b/packages/app/first-render.js similarity index 53% rename from src/first-render.js rename to packages/app/first-render.js index 8482166..8a984e4 100644 --- a/src/first-render.js +++ b/packages/app/first-render.js @@ -3,7 +3,7 @@ */ export default ` - ${require('components/ui/loader/loader.html')} + ${require('app/components/ui/loader/loader.html')} `; diff --git a/src/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.ttf b/packages/app/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.ttf similarity index 100% rename from src/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.ttf rename to packages/app/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.ttf diff --git a/src/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.woff b/packages/app/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.woff similarity index 100% rename from src/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.woff rename to packages/app/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.woff diff --git a/src/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.woff2 b/packages/app/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.woff2 similarity index 100% rename from src/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.woff2 rename to packages/app/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.woff2 diff --git a/src/fonts/roboto/roboto-v15-cyrillic_latin-500.ttf b/packages/app/fonts/roboto/roboto-v15-cyrillic_latin-500.ttf similarity index 100% rename from src/fonts/roboto/roboto-v15-cyrillic_latin-500.ttf rename to packages/app/fonts/roboto/roboto-v15-cyrillic_latin-500.ttf diff --git a/src/fonts/roboto/roboto-v15-cyrillic_latin-500.woff b/packages/app/fonts/roboto/roboto-v15-cyrillic_latin-500.woff similarity index 100% rename from src/fonts/roboto/roboto-v15-cyrillic_latin-500.woff rename to packages/app/fonts/roboto/roboto-v15-cyrillic_latin-500.woff diff --git a/src/fonts/roboto/roboto-v15-cyrillic_latin-500.woff2 b/packages/app/fonts/roboto/roboto-v15-cyrillic_latin-500.woff2 similarity index 100% rename from src/fonts/roboto/roboto-v15-cyrillic_latin-500.woff2 rename to packages/app/fonts/roboto/roboto-v15-cyrillic_latin-500.woff2 diff --git a/src/fonts/roboto/roboto-v15-cyrillic_latin-regular.ttf b/packages/app/fonts/roboto/roboto-v15-cyrillic_latin-regular.ttf similarity index 100% rename from src/fonts/roboto/roboto-v15-cyrillic_latin-regular.ttf rename to packages/app/fonts/roboto/roboto-v15-cyrillic_latin-regular.ttf diff --git a/src/fonts/roboto/roboto-v15-cyrillic_latin-regular.woff b/packages/app/fonts/roboto/roboto-v15-cyrillic_latin-regular.woff similarity index 100% rename from src/fonts/roboto/roboto-v15-cyrillic_latin-regular.woff rename to packages/app/fonts/roboto/roboto-v15-cyrillic_latin-regular.woff diff --git a/src/fonts/roboto/roboto-v15-cyrillic_latin-regular.woff2 b/packages/app/fonts/roboto/roboto-v15-cyrillic_latin-regular.woff2 similarity index 100% rename from src/fonts/roboto/roboto-v15-cyrillic_latin-regular.woff2 rename to packages/app/fonts/roboto/roboto-v15-cyrillic_latin-regular.woff2 diff --git a/src/functions.ts b/packages/app/functions.ts similarity index 100% rename from src/functions.ts rename to packages/app/functions.ts diff --git a/src/i18n/be.json b/packages/app/i18n/be.json similarity index 100% rename from src/i18n/be.json rename to packages/app/i18n/be.json diff --git a/src/i18n/en.json b/packages/app/i18n/en.json similarity index 100% rename from src/i18n/en.json rename to packages/app/i18n/en.json diff --git a/src/i18n/fr.json b/packages/app/i18n/fr.json similarity index 100% rename from src/i18n/fr.json rename to packages/app/i18n/fr.json diff --git a/src/i18n/id.json b/packages/app/i18n/id.json similarity index 100% rename from src/i18n/id.json rename to packages/app/i18n/id.json diff --git a/src/i18n/index.js b/packages/app/i18n/index.js similarity index 100% rename from src/i18n/index.js rename to packages/app/i18n/index.js diff --git a/src/i18n/lt.json b/packages/app/i18n/lt.json similarity index 100% rename from src/i18n/lt.json rename to packages/app/i18n/lt.json diff --git a/src/i18n/pl.json b/packages/app/i18n/pl.json similarity index 100% rename from src/i18n/pl.json rename to packages/app/i18n/pl.json diff --git a/src/i18n/pt.json b/packages/app/i18n/pt.json similarity index 100% rename from src/i18n/pt.json rename to packages/app/i18n/pt.json diff --git a/src/i18n/ro.json b/packages/app/i18n/ro.json similarity index 100% rename from src/i18n/ro.json rename to packages/app/i18n/ro.json diff --git a/src/i18n/ru.json b/packages/app/i18n/ru.json similarity index 100% rename from src/i18n/ru.json rename to packages/app/i18n/ru.json diff --git a/src/i18n/sr.json b/packages/app/i18n/sr.json similarity index 100% rename from src/i18n/sr.json rename to packages/app/i18n/sr.json diff --git a/src/i18n/uk.json b/packages/app/i18n/uk.json similarity index 100% rename from src/i18n/uk.json rename to packages/app/i18n/uk.json diff --git a/src/i18n/vi.json b/packages/app/i18n/vi.json similarity index 100% rename from src/i18n/vi.json rename to packages/app/i18n/vi.json diff --git a/src/i18n/zh.json b/packages/app/i18n/zh.json similarity index 100% rename from src/i18n/zh.json rename to packages/app/i18n/zh.json diff --git a/src/icons.css.hbs b/packages/app/icons.css.hbs similarity index 100% rename from src/icons.css.hbs rename to packages/app/icons.css.hbs diff --git a/src/icons.font.json b/packages/app/icons.font.json similarity index 100% rename from src/icons.font.json rename to packages/app/icons.font.json diff --git a/src/icons/webfont/arrow.svg b/packages/app/icons/webfont/arrow.svg similarity index 100% rename from src/icons/webfont/arrow.svg rename to packages/app/icons/webfont/arrow.svg diff --git a/src/icons/webfont/caret.svg b/packages/app/icons/webfont/caret.svg similarity index 100% rename from src/icons/webfont/caret.svg rename to packages/app/icons/webfont/caret.svg diff --git a/src/icons/webfont/checkmark.svg b/packages/app/icons/webfont/checkmark.svg similarity index 100% rename from src/icons/webfont/checkmark.svg rename to packages/app/icons/webfont/checkmark.svg diff --git a/src/icons/webfont/clipboard.svg b/packages/app/icons/webfont/clipboard.svg similarity index 100% rename from src/icons/webfont/clipboard.svg rename to packages/app/icons/webfont/clipboard.svg diff --git a/src/icons/webfont/close.svg b/packages/app/icons/webfont/close.svg similarity index 100% rename from src/icons/webfont/close.svg rename to packages/app/icons/webfont/close.svg diff --git a/src/icons/webfont/envelope.svg b/packages/app/icons/webfont/envelope.svg similarity index 100% rename from src/icons/webfont/envelope.svg rename to packages/app/icons/webfont/envelope.svg diff --git a/src/icons/webfont/exit.svg b/packages/app/icons/webfont/exit.svg similarity index 100% rename from src/icons/webfont/exit.svg rename to packages/app/icons/webfont/exit.svg diff --git a/src/icons/webfont/globe.svg b/packages/app/icons/webfont/globe.svg similarity index 100% rename from src/icons/webfont/globe.svg rename to packages/app/icons/webfont/globe.svg diff --git a/src/icons/webfont/key.svg b/packages/app/icons/webfont/key.svg similarity index 100% rename from src/icons/webfont/key.svg rename to packages/app/icons/webfont/key.svg diff --git a/src/icons/webfont/lock.svg b/packages/app/icons/webfont/lock.svg similarity index 100% rename from src/icons/webfont/lock.svg rename to packages/app/icons/webfont/lock.svg diff --git a/src/icons/webfont/minecraft-character.svg b/packages/app/icons/webfont/minecraft-character.svg similarity index 100% rename from src/icons/webfont/minecraft-character.svg rename to packages/app/icons/webfont/minecraft-character.svg diff --git a/src/icons/webfont/pencil.svg b/packages/app/icons/webfont/pencil.svg similarity index 100% rename from src/icons/webfont/pencil.svg rename to packages/app/icons/webfont/pencil.svg diff --git a/src/icons/webfont/plus.svg b/packages/app/icons/webfont/plus.svg similarity index 100% rename from src/icons/webfont/plus.svg rename to packages/app/icons/webfont/plus.svg diff --git a/src/icons/webfont/search.svg b/packages/app/icons/webfont/search.svg similarity index 100% rename from src/icons/webfont/search.svg rename to packages/app/icons/webfont/search.svg diff --git a/src/icons/webfont/selecter.svg b/packages/app/icons/webfont/selecter.svg similarity index 100% rename from src/icons/webfont/selecter.svg rename to packages/app/icons/webfont/selecter.svg diff --git a/src/icons/webfont/translate.svg b/packages/app/icons/webfont/translate.svg similarity index 100% rename from src/icons/webfont/translate.svg rename to packages/app/icons/webfont/translate.svg diff --git a/src/icons/webfont/user.svg b/packages/app/icons/webfont/user.svg similarity index 100% rename from src/icons/webfont/user.svg rename to packages/app/icons/webfont/user.svg diff --git a/src/index.ejs b/packages/app/index.ejs similarity index 97% rename from src/index.ejs rename to packages/app/index.ejs index 1259740..979e343 100644 --- a/src/index.ejs +++ b/packages/app/index.ejs @@ -29,7 +29,7 @@
-<%= require('first-render').default %> +<%= require('app/first-render').default %> <% for (var css in htmlWebpackPlugin.files.css) { %> diff --git a/src/index.scss b/packages/app/index.scss similarity index 67% rename from src/index.scss rename to packages/app/index.scss index cd4bdcb..53c029e 100644 --- a/src/index.scss +++ b/packages/app/index.scss @@ -1,5 +1,5 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; html, body, @@ -73,13 +73,13 @@ a { font-style: normal; font-weight: 400; src: local('Roboto Condensed'), local('RobotoCondensed-Regular'), - url('~fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.woff2') + url('~app/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ - url('~fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.woff') + url('~app/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.woff') format('woff'), /* Modern Browsers */ - url('~fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.ttf') + url('~app/fonts/roboto-condensed/roboto-condensed-v13-cyrillic_latin-regular.ttf') format('truetype'); /* Safari, Android, iOS */ } @font-face { @@ -87,11 +87,13 @@ a { font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto-Regular'), - url('~fonts/roboto/roboto-v15-cyrillic_latin-regular.woff2') format('woff2'), + url('~app/fonts/roboto/roboto-v15-cyrillic_latin-regular.woff2') + format('woff2'), /* Super Modern Browsers */ - url('~fonts/roboto/roboto-v15-cyrillic_latin-regular.woff') format('woff'), + url('~app/fonts/roboto/roboto-v15-cyrillic_latin-regular.woff') + format('woff'), /* Modern Browsers */ - url('~fonts/roboto/roboto-v15-cyrillic_latin-regular.ttf') + url('~app/fonts/roboto/roboto-v15-cyrillic_latin-regular.ttf') format('truetype'); /* Safari, Android, iOS */ } @font-face { @@ -99,9 +101,10 @@ a { font-style: normal; font-weight: 500; src: local('Roboto Medium'), local('Roboto-Medium'), - url('~fonts/roboto/roboto-v15-cyrillic_latin-500.woff2') format('woff2'), + url('~app/fonts/roboto/roboto-v15-cyrillic_latin-500.woff2') format('woff2'), /* Super Modern Browsers */ - url('~fonts/roboto/roboto-v15-cyrillic_latin-500.woff') format('woff'), - /* Modern Browsers */ url('~fonts/roboto/roboto-v15-cyrillic_latin-500.ttf') + url('~app/fonts/roboto/roboto-v15-cyrillic_latin-500.woff') format('woff'), + /* Modern Browsers */ + url('~app/fonts/roboto/roboto-v15-cyrillic_latin-500.ttf') format('truetype'); /* Safari, Android, iOS */ } diff --git a/src/index.tsx b/packages/app/index.tsx similarity index 85% rename from src/index.tsx rename to packages/app/index.tsx index b968471..716fc8b 100644 --- a/src/index.tsx +++ b/packages/app/index.tsx @@ -1,18 +1,18 @@ -import 'polyfills'; +import 'app/polyfills'; import 'react-hot-loader'; import React from 'react'; import ReactDOM from 'react-dom'; -import { factory as userFactory } from 'components/user/factory'; -import authFlow from 'services/authFlow'; -import storeFactory from 'storeFactory'; -import bsodFactory from 'components/ui/bsod/factory'; -import loader from 'services/loader'; -import logger from 'services/logger'; -import font from 'services/font'; -import history, { browserHistory } from 'services/history'; -import i18n from 'services/i18n'; -import { loadScript, debounce } from 'functions'; +import { factory as userFactory } from 'app/components/user/factory'; +import authFlow from 'app/services/authFlow'; +import storeFactory from 'app/storeFactory'; +import bsodFactory from 'app/components/ui/bsod/factory'; +import loader from 'app/services/loader'; +import logger from 'app/services/logger'; +import font from 'app/services/font'; +import history, { browserHistory } from 'app/services/history'; +import i18n from 'app/services/i18n'; +import { loadScript, debounce } from 'app/functions'; import App from './App'; diff --git a/packages/app/package.json b/packages/app/package.json new file mode 100644 index 0000000..07c5c67 --- /dev/null +++ b/packages/app/package.json @@ -0,0 +1,40 @@ +{ + "name": "app", + "version": "1.0.0", + "dependencies": { + "@formatjs/intl-pluralrules": "^1.3.7", + "@formatjs/intl-relativetimeformat": "^4.4.6", + "@hot-loader/react-dom": "^16.11.0", + "@types/react-redux": "^7.1.5", + "@types/react-router-dom": "^5.1.3", + "classnames": "^2.2.6", + "copy-to-clipboard": "^3.0.8", + "debounce": "^1.0.0", + "flag-icon-css": "^3.4.5", + "intl": "^1.2.5", + "promise.prototype.finally": "3.1.1", + "prop-types": "^15.6.2", + "raf": "^3.4.1", + "raven-js": "^3.27.0", + "react": "^16.12.0", + "react-dom": "^16.12.0", + "react-helmet": "^5.0.0", + "react-hot-loader": "^4.12.18", + "react-intl": "^3.7.0", + "react-motion": "^0.5.0", + "react-redux": "^7.1.3", + "react-router-dom": "^5.1.2", + "react-textarea-autosize": "^7.1.2", + "react-transition-group": "^4.3.0", + "redux": "^4.0.4", + "redux-localstorage": "^0.4.1", + "redux-thunk": "^2.0.0", + "url-search-params-polyfill": "^7.0.0", + "webfontloader": "^1.6.26", + "whatwg-fetch": "^3.0.0" + }, + "devDependencies": { + "enzyme": "^3.8.0", + "enzyme-adapter-react-16": "^1.15.1" + } +} diff --git a/src/pages/404/404.scss b/packages/app/pages/404/404.scss similarity index 98% rename from src/pages/404/404.scss rename to packages/app/pages/404/404.scss index fe35dac..de57f36 100644 --- a/src/pages/404/404.scss +++ b/packages/app/pages/404/404.scss @@ -1,4 +1,4 @@ -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/fonts.scss'; // Original: http://codepen.io/vanderlanth/pen/rxpNMY diff --git a/src/pages/404/PageNotFound.intl.json b/packages/app/pages/404/PageNotFound.intl.json similarity index 100% rename from src/pages/404/PageNotFound.intl.json rename to packages/app/pages/404/PageNotFound.intl.json diff --git a/src/pages/404/PageNotFound.js b/packages/app/pages/404/PageNotFound.js similarity index 93% rename from src/pages/404/PageNotFound.js rename to packages/app/pages/404/PageNotFound.js index b15074a..9e1f839 100644 --- a/src/pages/404/PageNotFound.js +++ b/packages/app/pages/404/PageNotFound.js @@ -1,6 +1,6 @@ import React from 'react'; -import { FooterMenu } from 'components/footerMenu'; +import { FooterMenu } from 'app/components/footerMenu'; import { Link } from 'react-router-dom'; import { FormattedMessage as Message } from 'react-intl'; @@ -8,8 +8,7 @@ import Helmet from 'react-helmet'; import styles from './404.scss'; import messages from './PageNotFound.intl.json'; - -import profileStyles from 'pages/profile/profile.scss'; +import profileStyles from '../profile/profile.scss'; export default function PageNotFound() { return ( diff --git a/src/pages/404/cloud.svg b/packages/app/pages/404/cloud.svg similarity index 100% rename from src/pages/404/cloud.svg rename to packages/app/pages/404/cloud.svg diff --git a/src/pages/auth/AuthPage.tsx b/packages/app/pages/auth/AuthPage.tsx similarity index 75% rename from src/pages/auth/AuthPage.tsx rename to packages/app/pages/auth/AuthPage.tsx index 802d415..3b8cad8 100644 --- a/src/pages/auth/AuthPage.tsx +++ b/packages/app/pages/auth/AuthPage.tsx @@ -1,23 +1,23 @@ import React from 'react'; import { Route, Switch, Redirect } from 'react-router-dom'; -import AppInfo from 'components/auth/appInfo/AppInfo'; -import PanelTransition from 'components/auth/PanelTransition'; -import Register from 'components/auth/register/Register'; -import Login from 'components/auth/login/Login'; -import Permissions from 'components/auth/permissions/Permissions'; -import ChooseAccount from 'components/auth/chooseAccount/ChooseAccount'; -import Activation from 'components/auth/activation/Activation'; -import ResendActivation from 'components/auth/resendActivation/ResendActivation'; -import Password from 'components/auth/password/Password'; -import AcceptRules from 'components/auth/acceptRules/AcceptRules'; -import ForgotPassword from 'components/auth/forgotPassword/ForgotPassword'; -import RecoverPassword from 'components/auth/recoverPassword/RecoverPassword'; -import Mfa from 'components/auth/mfa/Mfa'; -import Finish from 'components/auth/finish/Finish'; +import AppInfo from 'app/components/auth/appInfo/AppInfo'; +import PanelTransition from 'app/components/auth/PanelTransition'; +import Register from 'app/components/auth/register/Register'; +import Login from 'app/components/auth/login/Login'; +import Permissions from 'app/components/auth/permissions/Permissions'; +import ChooseAccount from 'app/components/auth/chooseAccount/ChooseAccount'; +import Activation from 'app/components/auth/activation/Activation'; +import ResendActivation from 'app/components/auth/resendActivation/ResendActivation'; +import Password from 'app/components/auth/password/Password'; +import AcceptRules from 'app/components/auth/acceptRules/AcceptRules'; +import ForgotPassword from 'app/components/auth/forgotPassword/ForgotPassword'; +import RecoverPassword from 'app/components/auth/recoverPassword/RecoverPassword'; +import Mfa from 'app/components/auth/mfa/Mfa'; +import Finish from 'app/components/auth/finish/Finish'; import { connect } from 'react-redux'; import { withRouter } from 'react-router-dom'; -import { RootState } from 'reducers'; -import { Client } from 'components/auth/reducer'; +import { RootState } from 'app/reducers'; +import { Client } from 'app/components/auth/reducer'; import styles from './auth.scss'; diff --git a/src/pages/auth/SuccessOauthPage.intl.json b/packages/app/pages/auth/SuccessOauthPage.intl.json similarity index 100% rename from src/pages/auth/SuccessOauthPage.intl.json rename to packages/app/pages/auth/SuccessOauthPage.intl.json diff --git a/src/pages/auth/SuccessOauthPage.tsx b/packages/app/pages/auth/SuccessOauthPage.tsx similarity index 92% rename from src/pages/auth/SuccessOauthPage.tsx rename to packages/app/pages/auth/SuccessOauthPage.tsx index 3c9ce3a..f482fc1 100644 --- a/src/pages/auth/SuccessOauthPage.tsx +++ b/packages/app/pages/auth/SuccessOauthPage.tsx @@ -2,10 +2,10 @@ import React from 'react'; import { Link } from 'react-router-dom'; import { FormattedMessage as Message } from 'react-intl'; import Helmet from 'react-helmet'; -import loader from 'services/loader'; -import rootMessages from 'pages/root/RootPage.intl.json'; -import { Query } from 'services/request'; +import loader from 'app/services/loader'; +import { Query } from 'app/services/request'; +import rootMessages from '../root/RootPage.intl.json'; import styles from './success-oauth.scss'; import messages from './SuccessOauthPage.intl.json'; diff --git a/src/pages/auth/auth.scss b/packages/app/pages/auth/auth.scss similarity index 93% rename from src/pages/auth/auth.scss rename to packages/app/pages/auth/auth.scss index 0c82c78..93775fe 100644 --- a/src/pages/auth/auth.scss +++ b/packages/app/pages/auth/auth.scss @@ -1,4 +1,4 @@ -@import '~components/ui/colors.scss'; +@import '~app/components/ui/colors.scss'; $sidebar-width: 320px; diff --git a/src/pages/auth/success-oauth.scss b/packages/app/pages/auth/success-oauth.scss similarity index 86% rename from src/pages/auth/success-oauth.scss rename to packages/app/pages/auth/success-oauth.scss index 197e2dc..55566ca 100644 --- a/src/pages/auth/success-oauth.scss +++ b/packages/app/pages/auth/success-oauth.scss @@ -1,5 +1,5 @@ -@import '~components/ui/fonts.scss'; -@import '~components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; .page { border-top: 50px solid #ddd8ce; @@ -52,7 +52,7 @@ } .checkmark { - composes: checkmark from '~components/ui/icons.scss'; + composes: checkmark from '~app/components/ui/icons.scss'; color: lighter($green); font-size: 66px; diff --git a/src/pages/dev/ApplicationsListPage.tsx b/packages/app/pages/dev/ApplicationsListPage.tsx similarity index 88% rename from src/pages/dev/ApplicationsListPage.tsx rename to packages/app/pages/dev/ApplicationsListPage.tsx index 6dddf5a..82cd44d 100644 --- a/src/pages/dev/ApplicationsListPage.tsx +++ b/packages/app/pages/dev/ApplicationsListPage.tsx @@ -5,11 +5,11 @@ import { fetchAvailableApps, resetApp, deleteApp, -} from 'components/dev/apps/actions'; -import ApplicationsIndex from 'components/dev/apps/ApplicationsIndex'; -import { User } from 'components/user'; -import { OauthAppResponse } from 'services/api/oauth'; -import { RootState } from 'reducers'; +} from 'app/components/dev/apps/actions'; +import ApplicationsIndex from 'app/components/dev/apps/ApplicationsIndex'; +import { User } from 'app/components/user'; +import { OauthAppResponse } from 'app/services/api/oauth'; +import { RootState } from 'app/reducers'; interface Props extends RouteComponentProps { user: User; diff --git a/src/pages/dev/CreateNewApplicationPage.tsx b/packages/app/pages/dev/CreateNewApplicationPage.tsx similarity index 77% rename from src/pages/dev/CreateNewApplicationPage.tsx rename to packages/app/pages/dev/CreateNewApplicationPage.tsx index 65d37c7..3fb8c66 100644 --- a/src/pages/dev/CreateNewApplicationPage.tsx +++ b/packages/app/pages/dev/CreateNewApplicationPage.tsx @@ -1,10 +1,10 @@ import React, { Component } from 'react'; -import { FormModel } from 'components/ui/form'; -import ApplicationForm from 'components/dev/apps/applicationForm/ApplicationForm'; -import oauth from 'services/api/oauth'; -import { browserHistory } from 'services/history'; -import { OauthAppResponse } from 'services/api/oauth'; -import { ApplicationType } from 'components/dev/apps'; +import { FormModel } from 'app/components/ui/form'; +import ApplicationForm from 'app/components/dev/apps/applicationForm/ApplicationForm'; +import oauth from 'app/services/api/oauth'; +import { browserHistory } from 'app/services/history'; +import { OauthAppResponse } from 'app/services/api/oauth'; +import { ApplicationType } from 'app/components/dev/apps'; const app: OauthAppResponse = { clientId: '', diff --git a/src/pages/dev/DevPage.tsx b/packages/app/pages/dev/DevPage.tsx similarity index 90% rename from src/pages/dev/DevPage.tsx rename to packages/app/pages/dev/DevPage.tsx index 63d09a3..9ff5aeb 100644 --- a/src/pages/dev/DevPage.tsx +++ b/packages/app/pages/dev/DevPage.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Redirect, Route, Switch } from 'react-router-dom'; -import { FooterMenu } from 'components/footerMenu'; -import PrivateRoute from 'containers/PrivateRoute'; +import { FooterMenu } from 'app/components/footerMenu'; +import PrivateRoute from 'app/containers/PrivateRoute'; import styles from './dev.scss'; import ApplicationsListPage from './ApplicationsListPage'; diff --git a/src/pages/dev/UpdateApplicationPage.tsx b/packages/app/pages/dev/UpdateApplicationPage.tsx similarity index 80% rename from src/pages/dev/UpdateApplicationPage.tsx rename to packages/app/pages/dev/UpdateApplicationPage.tsx index 7027082..d824239 100644 --- a/src/pages/dev/UpdateApplicationPage.tsx +++ b/packages/app/pages/dev/UpdateApplicationPage.tsx @@ -1,19 +1,19 @@ import React from 'react'; import { connect } from 'react-redux'; -import logger from 'services/logger'; +import logger from 'app/services/logger'; import { RouteComponentProps } from 'react-router'; -import { FormModel } from 'components/ui/form'; -import { browserHistory } from 'services/history'; -import oauth from 'services/api/oauth'; -import loader from 'services/loader'; -import PageNotFound from 'pages/404/PageNotFound'; +import { FormModel } from 'app/components/ui/form'; +import { browserHistory } from 'app/services/history'; +import oauth from 'app/services/api/oauth'; +import loader from 'app/services/loader'; +import PageNotFound from 'app/pages/404/PageNotFound'; import { getApp, fetchApp as fetchAppAction, -} from 'components/dev/apps/actions'; -import ApplicationForm from 'components/dev/apps/applicationForm/ApplicationForm'; -import { OauthAppResponse } from 'services/api/oauth'; -import { RootState } from 'reducers'; +} from 'app/components/dev/apps/actions'; +import ApplicationForm from 'app/components/dev/apps/applicationForm/ApplicationForm'; +import { OauthAppResponse } from 'app/services/api/oauth'; +import { RootState } from 'app/reducers'; type OwnProps = RouteComponentProps<{ clientId: string; diff --git a/src/pages/dev/dev.scss b/packages/app/pages/dev/dev.scss similarity index 100% rename from src/pages/dev/dev.scss rename to packages/app/pages/dev/dev.scss diff --git a/src/pages/profile/ChangeEmailPage.tsx b/packages/app/pages/profile/ChangeEmailPage.tsx similarity index 93% rename from src/pages/profile/ChangeEmailPage.tsx rename to packages/app/pages/profile/ChangeEmailPage.tsx index f420baf..a405510 100644 --- a/src/pages/profile/ChangeEmailPage.tsx +++ b/packages/app/pages/profile/ChangeEmailPage.tsx @@ -2,14 +2,14 @@ import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { RouteComponentProps } from 'react-router-dom'; -import FormModel from 'components/ui/form/FormModel'; -import ChangeEmail from 'components/profile/changeEmail/ChangeEmail'; +import FormModel from 'app/components/ui/form/FormModel'; +import ChangeEmail from 'app/components/profile/changeEmail/ChangeEmail'; import { requestEmailChange, setNewEmail, confirmNewEmail, -} from 'services/api/accounts'; -import { RootState } from 'reducers'; +} from 'app/services/api/accounts'; +import { RootState } from 'app/reducers'; interface RouteParams { step: 'step1' | 'step2' | 'step3'; diff --git a/src/pages/profile/ChangePasswordPage.tsx b/packages/app/pages/profile/ChangePasswordPage.tsx similarity index 76% rename from src/pages/profile/ChangePasswordPage.tsx rename to packages/app/pages/profile/ChangePasswordPage.tsx index 1e0800c..d2769fb 100644 --- a/src/pages/profile/ChangePasswordPage.tsx +++ b/packages/app/pages/profile/ChangePasswordPage.tsx @@ -1,11 +1,11 @@ import React from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; -import { changePassword } from 'services/api/accounts'; -import { FormModel } from 'components/ui/form'; -import ChangePassword from 'components/profile/changePassword/ChangePassword'; -import { User } from 'components/user'; -import { updateUser } from 'components/user/actions'; +import { changePassword } from 'app/services/api/accounts'; +import { FormModel } from 'app/components/ui/form'; +import ChangePassword from 'app/components/profile/changePassword/ChangePassword'; +import { User } from 'app/components/user'; +import { updateUser } from 'app/components/user/actions'; type OwnProps = {}; diff --git a/src/pages/profile/ChangeUsernamePage.tsx b/packages/app/pages/profile/ChangeUsernamePage.tsx similarity index 84% rename from src/pages/profile/ChangeUsernamePage.tsx rename to packages/app/pages/profile/ChangeUsernamePage.tsx index c47d03f..0eaacc2 100644 --- a/src/pages/profile/ChangeUsernamePage.tsx +++ b/packages/app/pages/profile/ChangeUsernamePage.tsx @@ -1,11 +1,11 @@ import PropTypes from 'prop-types'; import React from 'react'; import { connect } from 'react-redux'; -import { updateUser } from 'components/user/actions'; -import { RootState } from 'reducers'; -import { changeUsername } from 'services/api/accounts'; -import { FormModel } from 'components/ui/form'; -import ChangeUsername from 'components/profile/changeUsername/ChangeUsername'; +import { updateUser } from 'app/components/user/actions'; +import { RootState } from 'app/reducers'; +import { changeUsername } from 'app/services/api/accounts'; +import { FormModel } from 'app/components/ui/form'; +import ChangeUsername from 'app/components/profile/changeUsername/ChangeUsername'; type OwnProps = {}; diff --git a/src/pages/profile/MultiFactorAuthPage.tsx b/packages/app/pages/profile/MultiFactorAuthPage.tsx similarity index 87% rename from src/pages/profile/MultiFactorAuthPage.tsx rename to packages/app/pages/profile/MultiFactorAuthPage.tsx index 73bfe83..31b666a 100644 --- a/src/pages/profile/MultiFactorAuthPage.tsx +++ b/packages/app/pages/profile/MultiFactorAuthPage.tsx @@ -2,10 +2,12 @@ import React from 'react'; import { RouteComponentProps } from 'react-router-dom'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; -import MultiFactorAuth, { MfaStep } from 'components/profile/multiFactorAuth'; -import { FormModel } from 'components/ui/form'; -import { User } from 'components/user'; -import { RootState } from 'reducers'; +import MultiFactorAuth, { + MfaStep, +} from 'app/components/profile/multiFactorAuth'; +import { FormModel } from 'app/components/ui/form'; +import { User } from 'app/components/user'; +import { RootState } from 'app/reducers'; interface Props extends RouteComponentProps<{ diff --git a/src/pages/profile/ProfilePage.tsx b/packages/app/pages/profile/ProfilePage.tsx similarity index 85% rename from src/pages/profile/ProfilePage.tsx rename to packages/app/pages/profile/ProfilePage.tsx index 156fdb2..6a2cbe5 100644 --- a/src/pages/profile/ProfilePage.tsx +++ b/packages/app/pages/profile/ProfilePage.tsx @@ -2,19 +2,19 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Route, Switch, Redirect } from 'react-router-dom'; import { connect } from 'react-redux'; -import { fetchUserData } from 'components/user/actions'; -import { create as createPopup } from 'components/ui/popup/actions'; -import PasswordRequestForm from 'components/profile/passwordRequestForm/PasswordRequestForm'; -import logger from 'services/logger'; -import { browserHistory } from 'services/history'; -import { FooterMenu } from 'components/footerMenu'; -import Profile from 'components/profile/Profile'; -import ChangePasswordPage from 'pages/profile/ChangePasswordPage'; -import ChangeUsernamePage from 'pages/profile/ChangeUsernamePage'; -import ChangeEmailPage from 'pages/profile/ChangeEmailPage'; -import MultiFactorAuthPage from 'pages/profile/MultiFactorAuthPage'; -import { FormModel } from 'components/ui/form'; -import { RootState } from 'reducers'; +import { fetchUserData } from 'app/components/user/actions'; +import { create as createPopup } from 'app/components/ui/popup/actions'; +import PasswordRequestForm from 'app/components/profile/passwordRequestForm/PasswordRequestForm'; +import logger from 'app/services/logger'; +import { browserHistory } from 'app/services/history'; +import { FooterMenu } from 'app/components/footerMenu'; +import Profile from 'app/components/profile/Profile'; +import ChangePasswordPage from 'app/pages/profile/ChangePasswordPage'; +import ChangeUsernamePage from 'app/pages/profile/ChangeUsernamePage'; +import ChangeEmailPage from 'app/pages/profile/ChangeEmailPage'; +import MultiFactorAuthPage from 'app/pages/profile/MultiFactorAuthPage'; +import { FormModel } from 'app/components/ui/form'; +import { RootState } from 'app/reducers'; import styles from './profile.scss'; diff --git a/src/pages/profile/profile.scss b/packages/app/pages/profile/profile.scss similarity index 100% rename from src/pages/profile/profile.scss rename to packages/app/pages/profile/profile.scss diff --git a/src/pages/root/RootPage.intl.json b/packages/app/pages/root/RootPage.intl.json similarity index 100% rename from src/pages/root/RootPage.intl.json rename to packages/app/pages/root/RootPage.intl.json diff --git a/src/pages/root/RootPage.tsx b/packages/app/pages/root/RootPage.tsx similarity index 76% rename from src/pages/root/RootPage.tsx rename to packages/app/pages/root/RootPage.tsx index c2259f3..ef4de14 100644 --- a/src/pages/root/RootPage.tsx +++ b/packages/app/pages/root/RootPage.tsx @@ -1,26 +1,26 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; -import { resetAuth } from 'components/auth/actions'; +import { resetAuth } from 'app/components/auth/actions'; import { withRouter } from 'react-router-dom'; import { FormattedMessage as Message } from 'react-intl'; import { Route, Link, Switch } from 'react-router-dom'; import Helmet from 'react-helmet'; import classNames from 'classnames'; -import AuthPage from 'pages/auth/AuthPage'; -import ProfilePage from 'pages/profile/ProfilePage'; -import RulesPage from 'pages/rules/RulesPage'; -import DevPage from 'pages/dev/DevPage'; -import PageNotFound from 'pages/404/PageNotFound'; -import { ScrollIntoView } from 'components/ui/scroll'; -import PrivateRoute from 'containers/PrivateRoute'; -import AuthFlowRoute from 'containers/AuthFlowRoute'; -import Userbar from 'components/userbar/Userbar'; -import PopupStack from 'components/ui/popup/PopupStack'; -import loader from 'services/loader'; -import { getActiveAccount } from 'components/accounts/reducer'; -import { User } from 'components/user'; -import { Account } from 'components/accounts/reducer'; -import { RootState } from 'reducers'; +import AuthPage from 'app/pages/auth/AuthPage'; +import ProfilePage from 'app/pages/profile/ProfilePage'; +import RulesPage from 'app/pages/rules/RulesPage'; +import DevPage from 'app/pages/dev/DevPage'; +import PageNotFound from 'app/pages/404/PageNotFound'; +import { ScrollIntoView } from 'app/components/ui/scroll'; +import PrivateRoute from 'app/containers/PrivateRoute'; +import AuthFlowRoute from 'app/containers/AuthFlowRoute'; +import Userbar from 'app/components/userbar/Userbar'; +import PopupStack from 'app/components/ui/popup/PopupStack'; +import loader from 'app/services/loader'; +import { getActiveAccount } from 'app/components/accounts/reducer'; +import { User } from 'app/components/user'; +import { Account } from 'app/components/accounts/reducer'; +import { RootState } from 'app/reducers'; import styles from './root.scss'; import messages from './RootPage.intl.json'; diff --git a/src/pages/root/root.scss b/packages/app/pages/root/root.scss similarity index 92% rename from src/pages/root/root.scss rename to packages/app/pages/root/root.scss index b06c91d..7676809 100644 --- a/src/pages/root/root.scss +++ b/packages/app/pages/root/root.scss @@ -1,5 +1,5 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; $userBarHeight: 50px; diff --git a/src/pages/rules/RulesPage.intl.json b/packages/app/pages/rules/RulesPage.intl.json similarity index 100% rename from src/pages/rules/RulesPage.intl.json rename to packages/app/pages/rules/RulesPage.intl.json diff --git a/src/pages/rules/RulesPage.test.tsx b/packages/app/pages/rules/RulesPage.test.tsx similarity index 97% rename from src/pages/rules/RulesPage.test.tsx rename to packages/app/pages/rules/RulesPage.test.tsx index c840fdf..f361621 100644 --- a/src/pages/rules/RulesPage.test.tsx +++ b/packages/app/pages/rules/RulesPage.test.tsx @@ -1,6 +1,6 @@ import React from 'react'; import sinon from 'sinon'; -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import { shallow } from 'enzyme'; import RulesPage from './RulesPage'; diff --git a/src/pages/rules/RulesPage.tsx b/packages/app/pages/rules/RulesPage.tsx similarity index 97% rename from src/pages/rules/RulesPage.tsx rename to packages/app/pages/rules/RulesPage.tsx index f7e9cce..e3b4b3c 100644 --- a/src/pages/rules/RulesPage.tsx +++ b/packages/app/pages/rules/RulesPage.tsx @@ -2,11 +2,11 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import { FormattedMessage as Message } from 'react-intl'; import Helmet from 'react-helmet'; -import { FooterMenu } from 'components/footerMenu'; +import { FooterMenu } from 'app/components/footerMenu'; +import appInfo from 'app/components/auth/appInfo/AppInfo.intl.json'; import styles from './rules.scss'; import messages from './RulesPage.intl.json'; -import appInfo from 'components/auth/appInfo/AppInfo.intl.json'; const projectName = ; diff --git a/src/pages/rules/rules.scss b/packages/app/pages/rules/rules.scss similarity index 94% rename from src/pages/rules/rules.scss rename to packages/app/pages/rules/rules.scss index 622a144..58d3a5a 100644 --- a/src/pages/rules/rules.scss +++ b/packages/app/pages/rules/rules.scss @@ -1,5 +1,5 @@ -@import '~components/ui/colors.scss'; -@import '~components/ui/fonts.scss'; +@import '~app/components/ui/colors.scss'; +@import '~app/components/ui/fonts.scss'; .rules { max-width: 500px; diff --git a/src/polyfills.js b/packages/app/polyfills.js similarity index 100% rename from src/polyfills.js rename to packages/app/polyfills.js diff --git a/src/polyfills.test.js b/packages/app/polyfills.test.js similarity index 91% rename from src/polyfills.test.js rename to packages/app/polyfills.test.js index fb1acde..0fb649c 100644 --- a/src/polyfills.test.js +++ b/packages/app/polyfills.test.js @@ -1,4 +1,4 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; describe('promise.prototype.finally', () => { it('should be invoked after promise resolved', () => diff --git a/src/reducers.ts b/packages/app/reducers.ts similarity index 62% rename from src/reducers.ts rename to packages/app/reducers.ts index 63d1923..f204bc8 100644 --- a/src/reducers.ts +++ b/packages/app/reducers.ts @@ -1,12 +1,14 @@ import { combineReducers } from 'redux'; -import auth, { State as AuthState } from 'components/auth/reducer'; -import user, { User } from 'components/user/reducer'; -import accounts, { State as AccountsState } from 'components/accounts/reducer'; -import i18n, { State as I18nState } from 'components/i18n/reducer'; -import popup, { State as PopupState } from 'components/ui/popup/reducer'; -import bsod from 'components/ui/bsod/reducer'; -import apps, { Apps } from 'components/dev/apps/reducer'; +import auth, { State as AuthState } from 'app/components/auth/reducer'; +import user, { User } from 'app/components/user/reducer'; +import accounts, { + State as AccountsState, +} from 'app/components/accounts/reducer'; +import i18n, { State as I18nState } from 'app/components/i18n/reducer'; +import popup, { State as PopupState } from 'app/components/ui/popup/reducer'; +import bsod from 'app/components/ui/bsod/reducer'; +import apps, { Apps } from 'app/components/dev/apps/reducer'; import { ThunkDispatch, ThunkAction as ReduxThunkAction } from 'redux-thunk'; import { Store as ReduxStore } from 'redux'; diff --git a/src/services/api/accounts.ts b/packages/app/services/api/accounts.ts similarity index 97% rename from src/services/api/accounts.ts rename to packages/app/services/api/accounts.ts index 21cb06b..d045620 100644 --- a/src/services/api/accounts.ts +++ b/packages/app/services/api/accounts.ts @@ -1,4 +1,4 @@ -import request from 'services/request'; +import request from 'app/services/request'; export interface UserResponse { elyProfileLink: string; diff --git a/src/services/api/activate.test.ts b/packages/app/services/api/activate.test.ts similarity index 92% rename from src/services/api/activate.test.ts rename to packages/app/services/api/activate.test.ts index 7e1d56e..642b1fb 100644 --- a/src/services/api/activate.test.ts +++ b/packages/app/services/api/activate.test.ts @@ -1,8 +1,8 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import sinon from 'sinon'; -import request from 'services/request'; -import signup from 'services/api/signup'; +import request from 'app/services/request'; +import signup from 'app/services/api/signup'; describe('signup api', () => { describe('#register', () => { diff --git a/src/services/api/authentication.test.ts b/packages/app/services/api/authentication.test.ts similarity index 97% rename from src/services/api/authentication.test.ts rename to packages/app/services/api/authentication.test.ts index 285a1fa..77f4ba2 100644 --- a/src/services/api/authentication.test.ts +++ b/packages/app/services/api/authentication.test.ts @@ -1,10 +1,10 @@ /* eslint-disable @typescript-eslint/camelcase */ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import sinon from 'sinon'; -import request from 'services/request'; -import * as authentication from 'services/api/authentication'; -import * as accounts from 'services/api/accounts'; +import request from 'app/services/request'; +import * as authentication from 'app/services/api/authentication'; +import * as accounts from 'app/services/api/accounts'; describe('authentication api', () => { let server; diff --git a/src/services/api/authentication.ts b/packages/app/services/api/authentication.ts similarity index 94% rename from src/services/api/authentication.ts rename to packages/app/services/api/authentication.ts index e9d9f76..98ef509 100644 --- a/src/services/api/authentication.ts +++ b/packages/app/services/api/authentication.ts @@ -1,7 +1,7 @@ -import { UserResponse } from 'services/api/accounts'; -import logger from 'services/logger'; -import request, { InternalServerError } from 'services/request'; -import { getInfo as getInfoEndpoint } from 'services/api/accounts'; +import { UserResponse } from 'app/services/api/accounts'; +import logger from 'app/services/logger'; +import request, { InternalServerError } from 'app/services/request'; +import { getInfo as getInfoEndpoint } from 'app/services/api/accounts'; export interface OAuthResponse { access_token: string; diff --git a/src/services/api/feedback.ts b/packages/app/services/api/feedback.ts similarity index 79% rename from src/services/api/feedback.ts rename to packages/app/services/api/feedback.ts index 78c125a..9236484 100644 --- a/src/services/api/feedback.ts +++ b/packages/app/services/api/feedback.ts @@ -1,4 +1,4 @@ -import request from 'services/request'; +import request from 'app/services/request'; export default { send({ subject = '', email = '', message = '', category = '' }) { diff --git a/src/services/api/mfa.ts b/packages/app/services/api/mfa.ts similarity index 91% rename from src/services/api/mfa.ts rename to packages/app/services/api/mfa.ts index 41aeefb..37fed0c 100644 --- a/src/services/api/mfa.ts +++ b/packages/app/services/api/mfa.ts @@ -1,4 +1,4 @@ -import request, { Resp } from 'services/request'; +import request, { Resp } from 'app/services/request'; export function getSecret( id: number, diff --git a/src/services/api/oauth.ts b/packages/app/services/api/oauth.ts similarity index 98% rename from src/services/api/oauth.ts rename to packages/app/services/api/oauth.ts index 2f92b25..30c9096 100644 --- a/src/services/api/oauth.ts +++ b/packages/app/services/api/oauth.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/camelcase */ -import { ApplicationType } from 'components/dev/apps'; -import request from 'services/request'; +import { ApplicationType } from 'app/components/dev/apps'; +import request from 'app/services/request'; export type Scope = | 'minecraft_server_session' diff --git a/src/services/api/options.test.ts b/packages/app/services/api/options.test.ts similarity index 91% rename from src/services/api/options.test.ts rename to packages/app/services/api/options.test.ts index b509c29..4b61038 100644 --- a/src/services/api/options.test.ts +++ b/packages/app/services/api/options.test.ts @@ -1,6 +1,6 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import sinon from 'sinon'; -import request from 'services/request'; +import request from 'app/services/request'; import options from './options'; describe('services/api/options', () => { diff --git a/src/services/api/options.ts b/packages/app/services/api/options.ts similarity index 86% rename from src/services/api/options.ts rename to packages/app/services/api/options.ts index 4b64947..c71e9f9 100644 --- a/src/services/api/options.ts +++ b/packages/app/services/api/options.ts @@ -1,4 +1,4 @@ -import request, { Resp } from 'services/request'; +import request, { Resp } from 'app/services/request'; type Options = { reCaptchaPublicKey: string }; diff --git a/src/services/api/signup.ts b/packages/app/services/api/signup.ts similarity index 93% rename from src/services/api/signup.ts rename to packages/app/services/api/signup.ts index 6aa0697..ccf19c7 100644 --- a/src/services/api/signup.ts +++ b/packages/app/services/api/signup.ts @@ -1,4 +1,4 @@ -import request from 'services/request'; +import request from 'app/services/request'; import { OAuthResponse } from './authentication'; diff --git a/src/services/authFlow/AbstractState.ts b/packages/app/services/authFlow/AbstractState.ts similarity index 88% rename from src/services/authFlow/AbstractState.ts rename to packages/app/services/authFlow/AbstractState.ts index ead34ce..7d2f210 100644 --- a/src/services/authFlow/AbstractState.ts +++ b/packages/app/services/authFlow/AbstractState.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { AuthContext } from 'services/authFlow'; +import { AuthContext } from 'app/services/authFlow'; export default class AbstractState { resolve(context: AuthContext, payload: { [key: string]: any }): any {} diff --git a/src/services/authFlow/AcceptRulesState.test.ts b/packages/app/services/authFlow/AcceptRulesState.test.ts similarity index 92% rename from src/services/authFlow/AcceptRulesState.test.ts rename to packages/app/services/authFlow/AcceptRulesState.test.ts index 6bcaba2..69052c5 100644 --- a/src/services/authFlow/AcceptRulesState.test.ts +++ b/packages/app/services/authFlow/AcceptRulesState.test.ts @@ -1,5 +1,5 @@ -import AcceptRulesState from 'services/authFlow/AcceptRulesState'; -import CompleteState from 'services/authFlow/CompleteState'; +import AcceptRulesState from 'app/services/authFlow/AcceptRulesState'; +import CompleteState from 'app/services/authFlow/CompleteState'; import { bootstrap, expectState, expectNavigate, expectRun } from './helpers'; diff --git a/src/services/authFlow/AcceptRulesState.ts b/packages/app/services/authFlow/AcceptRulesState.ts similarity index 93% rename from src/services/authFlow/AcceptRulesState.ts rename to packages/app/services/authFlow/AcceptRulesState.ts index f409e86..543807e 100644 --- a/src/services/authFlow/AcceptRulesState.ts +++ b/packages/app/services/authFlow/AcceptRulesState.ts @@ -1,4 +1,4 @@ -import logger from 'services/logger'; +import logger from 'app/services/logger'; import AbstractState from './AbstractState'; import CompleteState from './CompleteState'; diff --git a/src/services/authFlow/ActivationState.test.ts b/packages/app/services/authFlow/ActivationState.test.ts similarity index 90% rename from src/services/authFlow/ActivationState.test.ts rename to packages/app/services/authFlow/ActivationState.test.ts index af2c963..7621b26 100644 --- a/src/services/authFlow/ActivationState.test.ts +++ b/packages/app/services/authFlow/ActivationState.test.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import ActivationState from 'services/authFlow/ActivationState'; -import CompleteState from 'services/authFlow/CompleteState'; -import ResendActivationState from 'services/authFlow/ResendActivationState'; +import ActivationState from 'app/services/authFlow/ActivationState'; +import CompleteState from 'app/services/authFlow/CompleteState'; +import ResendActivationState from 'app/services/authFlow/ResendActivationState'; import { bootstrap, expectState, expectNavigate, expectRun } from './helpers'; diff --git a/src/services/authFlow/ActivationState.ts b/packages/app/services/authFlow/ActivationState.ts similarity index 89% rename from src/services/authFlow/ActivationState.ts rename to packages/app/services/authFlow/ActivationState.ts index 38fc953..14eee59 100644 --- a/src/services/authFlow/ActivationState.ts +++ b/packages/app/services/authFlow/ActivationState.ts @@ -1,5 +1,5 @@ -import logger from 'services/logger'; -import { AuthContext } from 'services/authFlow'; +import logger from 'app/services/logger'; +import { AuthContext } from 'app/services/authFlow'; import AbstractState from './AbstractState'; import CompleteState from './CompleteState'; diff --git a/src/services/authFlow/AuthFlow.functional.test.ts b/packages/app/services/authFlow/AuthFlow.functional.test.ts similarity index 92% rename from src/services/authFlow/AuthFlow.functional.test.ts rename to packages/app/services/authFlow/AuthFlow.functional.test.ts index 412b018..12b059c 100644 --- a/src/services/authFlow/AuthFlow.functional.test.ts +++ b/packages/app/services/authFlow/AuthFlow.functional.test.ts @@ -1,11 +1,11 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import sinon from 'sinon'; -import AuthFlow from 'services/authFlow/AuthFlow'; +import AuthFlow from 'app/services/authFlow/AuthFlow'; -import RegisterState from 'services/authFlow/RegisterState'; -import ActivationState from 'services/authFlow/ActivationState'; -import ResendActivationState from 'services/authFlow/ResendActivationState'; +import RegisterState from 'app/services/authFlow/RegisterState'; +import ActivationState from 'app/services/authFlow/ActivationState'; +import ResendActivationState from 'app/services/authFlow/ResendActivationState'; describe('AuthFlow.functional', () => { let flow; diff --git a/src/services/authFlow/AuthFlow.test.ts b/packages/app/services/authFlow/AuthFlow.test.ts similarity index 92% rename from src/services/authFlow/AuthFlow.test.ts rename to packages/app/services/authFlow/AuthFlow.test.ts index d3c0d68..cf1d1c7 100644 --- a/src/services/authFlow/AuthFlow.test.ts +++ b/packages/app/services/authFlow/AuthFlow.test.ts @@ -1,19 +1,19 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import sinon from 'sinon'; -import AuthFlow from 'services/authFlow/AuthFlow'; -import AbstractState from 'services/authFlow/AbstractState'; -import localStorage from 'services/localStorage'; +import AuthFlow from 'app/services/authFlow/AuthFlow'; +import AbstractState from 'app/services/authFlow/AbstractState'; +import localStorage from 'app/services/localStorage'; -import OAuthState from 'services/authFlow/OAuthState'; -import RegisterState from 'services/authFlow/RegisterState'; -import RecoverPasswordState from 'services/authFlow/RecoverPasswordState'; -import ForgotPasswordState from 'services/authFlow/ForgotPasswordState'; -import ActivationState from 'services/authFlow/ActivationState'; -import ResendActivationState from 'services/authFlow/ResendActivationState'; -import LoginState from 'services/authFlow/LoginState'; -import CompleteState from 'services/authFlow/CompleteState'; -import ChooseAccountState from 'services/authFlow/ChooseAccountState'; +import OAuthState from 'app/services/authFlow/OAuthState'; +import RegisterState from 'app/services/authFlow/RegisterState'; +import RecoverPasswordState from 'app/services/authFlow/RecoverPasswordState'; +import ForgotPasswordState from 'app/services/authFlow/ForgotPasswordState'; +import ActivationState from 'app/services/authFlow/ActivationState'; +import ResendActivationState from 'app/services/authFlow/ResendActivationState'; +import LoginState from 'app/services/authFlow/LoginState'; +import CompleteState from 'app/services/authFlow/CompleteState'; +import ChooseAccountState from 'app/services/authFlow/ChooseAccountState'; describe('AuthFlow', () => { let flow; diff --git a/src/services/authFlow/AuthFlow.ts b/packages/app/services/authFlow/AuthFlow.ts similarity index 97% rename from src/services/authFlow/AuthFlow.ts rename to packages/app/services/authFlow/AuthFlow.ts index 1a9f43a..03f9045 100644 --- a/src/services/authFlow/AuthFlow.ts +++ b/packages/app/services/authFlow/AuthFlow.ts @@ -1,7 +1,7 @@ -import { browserHistory } from 'services/history'; -import logger from 'services/logger'; -import localStorage from 'services/localStorage'; -import { RootState } from 'reducers'; +import { browserHistory } from 'app/services/history'; +import logger from 'app/services/logger'; +import localStorage from 'app/services/localStorage'; +import { RootState } from 'app/reducers'; import RegisterState from './RegisterState'; import LoginState from './LoginState'; diff --git a/src/services/authFlow/ChooseAccountState.test.ts b/packages/app/services/authFlow/ChooseAccountState.test.ts similarity index 88% rename from src/services/authFlow/ChooseAccountState.test.ts rename to packages/app/services/authFlow/ChooseAccountState.test.ts index d415538..23ed81b 100644 --- a/src/services/authFlow/ChooseAccountState.test.ts +++ b/packages/app/services/authFlow/ChooseAccountState.test.ts @@ -1,6 +1,6 @@ -import ChooseAccountState from 'services/authFlow/ChooseAccountState'; -import CompleteState from 'services/authFlow/CompleteState'; -import LoginState from 'services/authFlow/LoginState'; +import ChooseAccountState from 'app/services/authFlow/ChooseAccountState'; +import CompleteState from 'app/services/authFlow/CompleteState'; +import LoginState from 'app/services/authFlow/LoginState'; import { bootstrap, expectState, expectNavigate, expectRun } from './helpers'; diff --git a/src/services/authFlow/ChooseAccountState.ts b/packages/app/services/authFlow/ChooseAccountState.ts similarity index 100% rename from src/services/authFlow/ChooseAccountState.ts rename to packages/app/services/authFlow/ChooseAccountState.ts diff --git a/src/services/authFlow/CompleteState.test.ts b/packages/app/services/authFlow/CompleteState.test.ts similarity index 96% rename from src/services/authFlow/CompleteState.test.ts rename to packages/app/services/authFlow/CompleteState.test.ts index 44a61b6..1a61dde 100644 --- a/src/services/authFlow/CompleteState.test.ts +++ b/packages/app/services/authFlow/CompleteState.test.ts @@ -1,13 +1,13 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import sinon from 'sinon'; -import CompleteState from 'services/authFlow/CompleteState'; -import LoginState from 'services/authFlow/LoginState'; -import ActivationState from 'services/authFlow/ActivationState'; -import AcceptRulesState from 'services/authFlow/AcceptRulesState'; -import FinishState from 'services/authFlow/FinishState'; -import PermissionsState from 'services/authFlow/PermissionsState'; -import ChooseAccountState from 'services/authFlow/ChooseAccountState'; +import CompleteState from 'app/services/authFlow/CompleteState'; +import LoginState from 'app/services/authFlow/LoginState'; +import ActivationState from 'app/services/authFlow/ActivationState'; +import AcceptRulesState from 'app/services/authFlow/AcceptRulesState'; +import FinishState from 'app/services/authFlow/FinishState'; +import PermissionsState from 'app/services/authFlow/PermissionsState'; +import ChooseAccountState from 'app/services/authFlow/ChooseAccountState'; import { bootstrap, expectState, expectNavigate, expectRun } from './helpers'; diff --git a/src/services/authFlow/CompleteState.ts b/packages/app/services/authFlow/CompleteState.ts similarity index 98% rename from src/services/authFlow/CompleteState.ts rename to packages/app/services/authFlow/CompleteState.ts index 488ce4c..b617c4a 100644 --- a/src/services/authFlow/CompleteState.ts +++ b/packages/app/services/authFlow/CompleteState.ts @@ -1,4 +1,4 @@ -import { getActiveAccount } from 'components/accounts/reducer'; +import { getActiveAccount } from 'app/components/accounts/reducer'; import AbstractState from './AbstractState'; import LoginState from './LoginState'; import PermissionsState from './PermissionsState'; diff --git a/src/services/authFlow/FinishState.test.ts b/packages/app/services/authFlow/FinishState.test.ts similarity index 88% rename from src/services/authFlow/FinishState.test.ts rename to packages/app/services/authFlow/FinishState.test.ts index d84e4e4..1e6e866 100644 --- a/src/services/authFlow/FinishState.test.ts +++ b/packages/app/services/authFlow/FinishState.test.ts @@ -1,4 +1,4 @@ -import FinishState from 'services/authFlow/FinishState'; +import FinishState from 'app/services/authFlow/FinishState'; import { bootstrap, expectNavigate } from './helpers'; diff --git a/src/services/authFlow/FinishState.ts b/packages/app/services/authFlow/FinishState.ts similarity index 100% rename from src/services/authFlow/FinishState.ts rename to packages/app/services/authFlow/FinishState.ts diff --git a/src/services/authFlow/ForgotPasswordState.test.ts b/packages/app/services/authFlow/ForgotPasswordState.test.ts similarity index 90% rename from src/services/authFlow/ForgotPasswordState.test.ts rename to packages/app/services/authFlow/ForgotPasswordState.test.ts index a313029..a0c4563 100644 --- a/src/services/authFlow/ForgotPasswordState.test.ts +++ b/packages/app/services/authFlow/ForgotPasswordState.test.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import ForgotPasswordState from 'services/authFlow/ForgotPasswordState'; -import RecoverPasswordState from 'services/authFlow/RecoverPasswordState'; -import LoginState from 'services/authFlow/LoginState'; +import ForgotPasswordState from 'app/services/authFlow/ForgotPasswordState'; +import RecoverPasswordState from 'app/services/authFlow/RecoverPasswordState'; +import LoginState from 'app/services/authFlow/LoginState'; import { bootstrap, expectState, expectNavigate, expectRun } from './helpers'; diff --git a/src/services/authFlow/ForgotPasswordState.ts b/packages/app/services/authFlow/ForgotPasswordState.ts similarity index 95% rename from src/services/authFlow/ForgotPasswordState.ts rename to packages/app/services/authFlow/ForgotPasswordState.ts index fe2c8cb..332dc90 100644 --- a/src/services/authFlow/ForgotPasswordState.ts +++ b/packages/app/services/authFlow/ForgotPasswordState.ts @@ -1,4 +1,4 @@ -import logger from 'services/logger'; +import logger from 'app/services/logger'; import AbstractState from './AbstractState'; import LoginState from './LoginState'; diff --git a/src/services/authFlow/LoginState.test.ts b/packages/app/services/authFlow/LoginState.test.ts similarity index 91% rename from src/services/authFlow/LoginState.test.ts rename to packages/app/services/authFlow/LoginState.test.ts index df50a42..7823f64 100644 --- a/src/services/authFlow/LoginState.test.ts +++ b/packages/app/services/authFlow/LoginState.test.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import LoginState from 'services/authFlow/LoginState'; -import PasswordState from 'services/authFlow/PasswordState'; -import RegisterState from 'services/authFlow/RegisterState'; +import LoginState from 'app/services/authFlow/LoginState'; +import PasswordState from 'app/services/authFlow/PasswordState'; +import RegisterState from 'app/services/authFlow/RegisterState'; import { bootstrap, expectState, expectNavigate, expectRun } from './helpers'; diff --git a/src/services/authFlow/LoginState.ts b/packages/app/services/authFlow/LoginState.ts similarity index 93% rename from src/services/authFlow/LoginState.ts rename to packages/app/services/authFlow/LoginState.ts index 13f1494..c0bcdfd 100644 --- a/src/services/authFlow/LoginState.ts +++ b/packages/app/services/authFlow/LoginState.ts @@ -1,5 +1,5 @@ -import logger from 'services/logger'; -import { getLogin } from 'components/auth/reducer'; +import logger from 'app/services/logger'; +import { getLogin } from 'app/components/auth/reducer'; import AbstractState from './AbstractState'; import PasswordState from './PasswordState'; diff --git a/src/services/authFlow/MfaState.test.ts b/packages/app/services/authFlow/MfaState.test.ts similarity index 92% rename from src/services/authFlow/MfaState.test.ts rename to packages/app/services/authFlow/MfaState.test.ts index 7db59f9..751b8d5 100644 --- a/src/services/authFlow/MfaState.test.ts +++ b/packages/app/services/authFlow/MfaState.test.ts @@ -1,9 +1,9 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import sinon from 'sinon'; import MfaState from './MfaState'; -import CompleteState from 'services/authFlow/CompleteState'; -import PasswordState from 'services/authFlow/PasswordState'; +import CompleteState from 'app/services/authFlow/CompleteState'; +import PasswordState from 'app/services/authFlow/PasswordState'; import { bootstrap, expectState, expectNavigate, expectRun } from './helpers'; diff --git a/src/services/authFlow/MfaState.ts b/packages/app/services/authFlow/MfaState.ts similarity index 90% rename from src/services/authFlow/MfaState.ts rename to packages/app/services/authFlow/MfaState.ts index 0ba4fa6..e74b31c 100644 --- a/src/services/authFlow/MfaState.ts +++ b/packages/app/services/authFlow/MfaState.ts @@ -1,6 +1,6 @@ -import logger from 'services/logger'; +import logger from 'app/services/logger'; -import { getCredentials } from 'components/auth/reducer'; +import { getCredentials } from 'app/components/auth/reducer'; import AbstractState from './AbstractState'; import CompleteState from './CompleteState'; diff --git a/src/services/authFlow/OAuthState.test.ts b/packages/app/services/authFlow/OAuthState.test.ts similarity index 96% rename from src/services/authFlow/OAuthState.test.ts rename to packages/app/services/authFlow/OAuthState.test.ts index 4576dcf..98db590 100644 --- a/src/services/authFlow/OAuthState.test.ts +++ b/packages/app/services/authFlow/OAuthState.test.ts @@ -1,8 +1,8 @@ /* eslint @typescript-eslint/camelcase: off */ import sinon from 'sinon'; -import OAuthState from 'services/authFlow/OAuthState'; -import CompleteState from 'services/authFlow/CompleteState'; +import OAuthState from 'app/services/authFlow/OAuthState'; +import CompleteState from 'app/services/authFlow/CompleteState'; import { bootstrap, expectState, expectRun } from './helpers'; diff --git a/src/services/authFlow/OAuthState.ts b/packages/app/services/authFlow/OAuthState.ts similarity index 100% rename from src/services/authFlow/OAuthState.ts rename to packages/app/services/authFlow/OAuthState.ts diff --git a/src/services/authFlow/PasswordState.test.ts b/packages/app/services/authFlow/PasswordState.test.ts similarity index 91% rename from src/services/authFlow/PasswordState.test.ts rename to packages/app/services/authFlow/PasswordState.test.ts index 5d86e9a..6e798b0 100644 --- a/src/services/authFlow/PasswordState.test.ts +++ b/packages/app/services/authFlow/PasswordState.test.ts @@ -1,12 +1,12 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import sinon from 'sinon'; -import PasswordState from 'services/authFlow/PasswordState'; -import CompleteState from 'services/authFlow/CompleteState'; -import MfaState from 'services/authFlow/MfaState'; -import LoginState from 'services/authFlow/LoginState'; -import ForgotPasswordState from 'services/authFlow/ForgotPasswordState'; -import ChooseAccountState from 'services/authFlow/ChooseAccountState'; +import PasswordState from 'app/services/authFlow/PasswordState'; +import CompleteState from 'app/services/authFlow/CompleteState'; +import MfaState from 'app/services/authFlow/MfaState'; +import LoginState from 'app/services/authFlow/LoginState'; +import ForgotPasswordState from 'app/services/authFlow/ForgotPasswordState'; +import ChooseAccountState from 'app/services/authFlow/ChooseAccountState'; import { bootstrap, expectState, expectNavigate, expectRun } from './helpers'; diff --git a/src/services/authFlow/PasswordState.ts b/packages/app/services/authFlow/PasswordState.ts similarity index 94% rename from src/services/authFlow/PasswordState.ts rename to packages/app/services/authFlow/PasswordState.ts index 7e57b2c..6590706 100644 --- a/src/services/authFlow/PasswordState.ts +++ b/packages/app/services/authFlow/PasswordState.ts @@ -1,9 +1,9 @@ -import logger from 'services/logger'; -import { getCredentials } from 'components/auth/reducer'; +import logger from 'app/services/logger'; +import { getCredentials } from 'app/components/auth/reducer'; import { getActiveAccount, getAvailableAccounts, -} from 'components/accounts/reducer'; +} from 'app/components/accounts/reducer'; import AbstractState from './AbstractState'; import ChooseAccountState from './ChooseAccountState'; diff --git a/src/services/authFlow/PermissionsState.test.ts b/packages/app/services/authFlow/PermissionsState.test.ts similarity index 92% rename from src/services/authFlow/PermissionsState.test.ts rename to packages/app/services/authFlow/PermissionsState.test.ts index 6dde413..d5b82a4 100644 --- a/src/services/authFlow/PermissionsState.test.ts +++ b/packages/app/services/authFlow/PermissionsState.test.ts @@ -1,7 +1,7 @@ import sinon from 'sinon'; -import PermissionsState from 'services/authFlow/PermissionsState'; -import CompleteState from 'services/authFlow/CompleteState'; +import PermissionsState from 'app/services/authFlow/PermissionsState'; +import CompleteState from 'app/services/authFlow/CompleteState'; import { bootstrap, expectNavigate } from './helpers'; diff --git a/src/services/authFlow/PermissionsState.ts b/packages/app/services/authFlow/PermissionsState.ts similarity index 100% rename from src/services/authFlow/PermissionsState.ts rename to packages/app/services/authFlow/PermissionsState.ts diff --git a/src/services/authFlow/RecoverPasswordState.test.ts b/packages/app/services/authFlow/RecoverPasswordState.test.ts similarity index 91% rename from src/services/authFlow/RecoverPasswordState.test.ts rename to packages/app/services/authFlow/RecoverPasswordState.test.ts index 3de2cb3..a942c63 100644 --- a/src/services/authFlow/RecoverPasswordState.test.ts +++ b/packages/app/services/authFlow/RecoverPasswordState.test.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import RecoverPasswordState from 'services/authFlow/RecoverPasswordState'; -import CompleteState from 'services/authFlow/CompleteState'; -import LoginState from 'services/authFlow/LoginState'; +import RecoverPasswordState from 'app/services/authFlow/RecoverPasswordState'; +import CompleteState from 'app/services/authFlow/CompleteState'; +import LoginState from 'app/services/authFlow/LoginState'; import { bootstrap, expectState, expectNavigate, expectRun } from './helpers'; diff --git a/src/services/authFlow/RecoverPasswordState.ts b/packages/app/services/authFlow/RecoverPasswordState.ts similarity index 94% rename from src/services/authFlow/RecoverPasswordState.ts rename to packages/app/services/authFlow/RecoverPasswordState.ts index e40cd02..0ec0c4b 100644 --- a/src/services/authFlow/RecoverPasswordState.ts +++ b/packages/app/services/authFlow/RecoverPasswordState.ts @@ -1,4 +1,4 @@ -import logger from 'services/logger'; +import logger from 'app/services/logger'; import AbstractState from './AbstractState'; import LoginState from './LoginState'; diff --git a/src/services/authFlow/RegisterState.test.ts b/packages/app/services/authFlow/RegisterState.test.ts similarity index 86% rename from src/services/authFlow/RegisterState.test.ts rename to packages/app/services/authFlow/RegisterState.test.ts index 5c2ef36..8ce9729 100644 --- a/src/services/authFlow/RegisterState.test.ts +++ b/packages/app/services/authFlow/RegisterState.test.ts @@ -1,9 +1,9 @@ import sinon from 'sinon'; -import RegisterState from 'services/authFlow/RegisterState'; -import CompleteState from 'services/authFlow/CompleteState'; -import ActivationState from 'services/authFlow/ActivationState'; -import ResendActivationState from 'services/authFlow/ResendActivationState'; +import RegisterState from 'app/services/authFlow/RegisterState'; +import CompleteState from 'app/services/authFlow/CompleteState'; +import ActivationState from 'app/services/authFlow/ActivationState'; +import ResendActivationState from 'app/services/authFlow/ResendActivationState'; import { bootstrap, expectState, expectNavigate, expectRun } from './helpers'; diff --git a/src/services/authFlow/RegisterState.ts b/packages/app/services/authFlow/RegisterState.ts similarity index 94% rename from src/services/authFlow/RegisterState.ts rename to packages/app/services/authFlow/RegisterState.ts index 268262e..503eb40 100644 --- a/src/services/authFlow/RegisterState.ts +++ b/packages/app/services/authFlow/RegisterState.ts @@ -1,4 +1,4 @@ -import logger from 'services/logger'; +import logger from 'app/services/logger'; import AbstractState from './AbstractState'; import CompleteState from './CompleteState'; diff --git a/src/services/authFlow/ResendActivationState.test.ts b/packages/app/services/authFlow/ResendActivationState.test.ts similarity index 91% rename from src/services/authFlow/ResendActivationState.test.ts rename to packages/app/services/authFlow/ResendActivationState.test.ts index 20b1df1..0eb9cd8 100644 --- a/src/services/authFlow/ResendActivationState.test.ts +++ b/packages/app/services/authFlow/ResendActivationState.test.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import ResendActivationState from 'services/authFlow/ResendActivationState'; -import ActivationState from 'services/authFlow/ActivationState'; -import RegisterState from 'services/authFlow/RegisterState'; +import ResendActivationState from 'app/services/authFlow/ResendActivationState'; +import ActivationState from 'app/services/authFlow/ActivationState'; +import RegisterState from 'app/services/authFlow/RegisterState'; import { bootstrap, expectState, expectNavigate, expectRun } from './helpers'; diff --git a/src/services/authFlow/ResendActivationState.ts b/packages/app/services/authFlow/ResendActivationState.ts similarity index 90% rename from src/services/authFlow/ResendActivationState.ts rename to packages/app/services/authFlow/ResendActivationState.ts index 296d4ad..7625172 100644 --- a/src/services/authFlow/ResendActivationState.ts +++ b/packages/app/services/authFlow/ResendActivationState.ts @@ -1,5 +1,5 @@ -import { AuthContext } from 'services/authFlow'; -import logger from 'services/logger'; +import { AuthContext } from 'app/services/authFlow'; +import logger from 'app/services/logger'; import AbstractState from './AbstractState'; import ActivationState from './ActivationState'; diff --git a/src/services/authFlow/helpers.ts b/packages/app/services/authFlow/helpers.ts similarity index 100% rename from src/services/authFlow/helpers.ts rename to packages/app/services/authFlow/helpers.ts diff --git a/src/services/authFlow/index.ts b/packages/app/services/authFlow/index.ts similarity index 95% rename from src/services/authFlow/index.ts rename to packages/app/services/authFlow/index.ts index c708b2c..8997f4c 100644 --- a/src/services/authFlow/index.ts +++ b/packages/app/services/authFlow/index.ts @@ -1,6 +1,6 @@ import AuthFlow, { ActionsDict } from './AuthFlow'; -import * as actions from 'components/auth/actions'; +import * as actions from 'app/components/auth/actions'; const availableActions = { updateUser: actions.updateUser, diff --git a/src/services/captcha.ts b/packages/app/services/captcha.ts similarity index 95% rename from src/services/captcha.ts rename to packages/app/services/captcha.ts index 5f8e1d8..b36d659 100644 --- a/src/services/captcha.ts +++ b/packages/app/services/captcha.ts @@ -1,5 +1,5 @@ -import { loadScript } from 'functions'; -import options from 'services/api/options'; +import { loadScript } from 'app/functions'; +import options from 'app/services/api/options'; let readyPromise: Promise; let lang = 'en'; diff --git a/src/services/copy.ts b/packages/app/services/copy.ts similarity index 100% rename from src/services/copy.ts rename to packages/app/services/copy.ts diff --git a/src/services/errorsDict/errorsDict.intl.json b/packages/app/services/errorsDict/errorsDict.intl.json similarity index 100% rename from src/services/errorsDict/errorsDict.intl.json rename to packages/app/services/errorsDict/errorsDict.intl.json diff --git a/src/services/errorsDict/errorsDict.js b/packages/app/services/errorsDict/errorsDict.js similarity index 98% rename from src/services/errorsDict/errorsDict.js rename to packages/app/services/errorsDict/errorsDict.js index 9b0de6d..7034221 100644 --- a/src/services/errorsDict/errorsDict.js +++ b/packages/app/services/errorsDict/errorsDict.js @@ -1,7 +1,7 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; -import { RelativeTime } from 'components/ui'; +import { RelativeTime } from 'app/components/ui'; import { Link } from 'react-router-dom'; import messages from './errorsDict.intl.json'; diff --git a/src/services/errorsDict/index.js b/packages/app/services/errorsDict/index.js similarity index 100% rename from src/services/errorsDict/index.js rename to packages/app/services/errorsDict/index.js diff --git a/src/services/font.ts b/packages/app/services/font.ts similarity index 95% rename from src/services/font.ts rename to packages/app/services/font.ts index 7a1cf23..cebefa3 100644 --- a/src/services/font.ts +++ b/packages/app/services/font.ts @@ -1,5 +1,5 @@ import webFont from 'webfontloader'; -import logger from 'services/logger'; +import logger from 'app/services/logger'; export default { /** diff --git a/src/services/history.js b/packages/app/services/history.js similarity index 100% rename from src/services/history.js rename to packages/app/services/history.js diff --git a/src/services/i18n/i18n.ts b/packages/app/services/i18n/i18n.ts similarity index 91% rename from src/services/i18n/i18n.ts rename to packages/app/services/i18n/i18n.ts index ae4c780..ce36099 100644 --- a/src/services/i18n/i18n.ts +++ b/packages/app/services/i18n/i18n.ts @@ -1,6 +1,6 @@ import { IntlShape, createIntl, createIntlCache } from 'react-intl'; -import captcha from 'services/captcha'; -import locales from 'i18n'; +import captcha from 'app/services/captcha'; +import locales from 'app/i18n'; import intlPolyfill from './intlPolyfill'; @@ -82,7 +82,9 @@ class I18N { messages: { [key: string]: string }; }> { const [{ default: messages }] = await Promise.all([ - import(/* webpackChunkName: "locale-[request]" */ `i18n/${locale}.json`), + import( + /* webpackChunkName: "locale-[request]" */ `app/i18n/${locale}.json` + ), intlPolyfill(locale), ]); diff --git a/src/services/i18n/index.ts b/packages/app/services/i18n/index.ts similarity index 100% rename from src/services/i18n/index.ts rename to packages/app/services/i18n/index.ts diff --git a/src/services/i18n/intlPolyfill.ts b/packages/app/services/i18n/intlPolyfill.ts similarity index 98% rename from src/services/i18n/intlPolyfill.ts rename to packages/app/services/i18n/intlPolyfill.ts index a9e5d3f..4537c16 100644 --- a/src/services/i18n/intlPolyfill.ts +++ b/packages/app/services/i18n/intlPolyfill.ts @@ -1,4 +1,4 @@ -import logger from 'services/logger'; +import logger from 'app/services/logger'; const needs = { intl: !window.Intl, diff --git a/src/services/loader.js b/packages/app/services/loader.js similarity index 100% rename from src/services/loader.js rename to packages/app/services/loader.js diff --git a/src/services/localStorage.js b/packages/app/services/localStorage.js similarity index 94% rename from src/services/localStorage.js rename to packages/app/services/localStorage.js index 61bc03f..dc60659 100644 --- a/src/services/localStorage.js +++ b/packages/app/services/localStorage.js @@ -1,4 +1,4 @@ -import logger from 'services/logger'; +import logger from 'app/services/logger'; let _hasStorage = false; diff --git a/src/services/logger/abbreviate.js b/packages/app/services/logger/abbreviate.js similarity index 100% rename from src/services/logger/abbreviate.js rename to packages/app/services/logger/abbreviate.js diff --git a/src/services/logger/index.ts b/packages/app/services/logger/index.ts similarity index 100% rename from src/services/logger/index.ts rename to packages/app/services/logger/index.ts diff --git a/src/services/logger/logger.ts b/packages/app/services/logger/logger.ts similarity index 100% rename from src/services/logger/logger.ts rename to packages/app/services/logger/logger.ts diff --git a/src/services/request/InternalServerError.ts b/packages/app/services/request/InternalServerError.ts similarity index 100% rename from src/services/request/InternalServerError.ts rename to packages/app/services/request/InternalServerError.ts diff --git a/src/services/request/PromiseMiddlewareLayer.test.ts b/packages/app/services/request/PromiseMiddlewareLayer.test.ts similarity index 97% rename from src/services/request/PromiseMiddlewareLayer.test.ts rename to packages/app/services/request/PromiseMiddlewareLayer.test.ts index d6d8377..6b64565 100644 --- a/src/services/request/PromiseMiddlewareLayer.test.ts +++ b/packages/app/services/request/PromiseMiddlewareLayer.test.ts @@ -1,7 +1,7 @@ import sinon from 'sinon'; -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; -import PromiseMiddlewareLayer from 'services/request/PromiseMiddlewareLayer'; +import PromiseMiddlewareLayer from 'app/services/request/PromiseMiddlewareLayer'; describe('PromiseMiddlewareLayer', () => { describe('#add()', () => { diff --git a/src/services/request/PromiseMiddlewareLayer.ts b/packages/app/services/request/PromiseMiddlewareLayer.ts similarity index 100% rename from src/services/request/PromiseMiddlewareLayer.ts rename to packages/app/services/request/PromiseMiddlewareLayer.ts diff --git a/src/services/request/RequestAbortedError.ts b/packages/app/services/request/RequestAbortedError.ts similarity index 100% rename from src/services/request/RequestAbortedError.ts rename to packages/app/services/request/RequestAbortedError.ts diff --git a/src/services/request/index.ts b/packages/app/services/request/index.ts similarity index 100% rename from src/services/request/index.ts rename to packages/app/services/request/index.ts diff --git a/src/services/request/request.test.ts b/packages/app/services/request/request.test.ts similarity index 93% rename from src/services/request/request.test.ts rename to packages/app/services/request/request.test.ts index 0f50a73..40684c7 100644 --- a/src/services/request/request.test.ts +++ b/packages/app/services/request/request.test.ts @@ -1,8 +1,8 @@ -import expect from 'test/unexpected'; +import expect from 'app/test/unexpected'; import sinon from 'sinon'; -import request from 'services/request'; -import { InternalServerError, RequestAbortedError } from 'services/request'; +import request from 'app/services/request'; +import { InternalServerError, RequestAbortedError } from 'app/services/request'; describe('services/request', () => { beforeEach(() => { diff --git a/src/services/request/request.ts b/packages/app/services/request/request.ts similarity index 100% rename from src/services/request/request.ts rename to packages/app/services/request/request.ts diff --git a/src/storeFactory.js b/packages/app/storeFactory.js similarity index 90% rename from src/storeFactory.js rename to packages/app/storeFactory.js index 0f55a83..8d5b236 100644 --- a/src/storeFactory.js +++ b/packages/app/storeFactory.js @@ -6,7 +6,7 @@ import { createStore, applyMiddleware, compose } from 'redux'; import thunk from 'redux-thunk'; import persistState from 'redux-localstorage'; -import reducers from 'reducers'; +import reducers from 'app/reducers'; export default function storeFactory() { const middlewares = applyMiddleware(thunk); @@ -29,8 +29,8 @@ export default function storeFactory() { // Hot reload reducers if (module.hot && typeof module.hot.accept === 'function') { - module.hot.accept('reducers', () => - store.replaceReducer(require('reducers').default), + module.hot.accept('app/reducers', () => + store.replaceReducer(require('app/reducers').default), ); } diff --git a/src/test/unexpected.js b/packages/app/test/unexpected.js similarity index 100% rename from src/test/unexpected.js rename to packages/app/test/unexpected.js diff --git a/scripts/build-dll.js b/packages/scripts/build-dll.js similarity index 90% rename from scripts/build-dll.js rename to packages/scripts/build-dll.js index 71afbb8..9211f4b 100644 --- a/scripts/build-dll.js +++ b/packages/scripts/build-dll.js @@ -3,17 +3,16 @@ /* eslint-disable no-console */ const fs = require('fs'); - const webpack = require('webpack'); const chalk = require('chalk'); -const webpackConfig = require('../webpack.dll.config.js'); +const webpackConfig = require('../../webpack.dll.config'); const compiler = webpack(webpackConfig); Promise.all([ - stat(`${__dirname}/../yarn.lock`), - stat(`${__dirname}/../dll/vendor.json`), + stat(`${__dirname}/../../yarn.lock`), + stat(`${__dirname}/../../dll/vendor.json`), ]) .then(stats => { const lockFile = new Date(stats[0].mtime); diff --git a/scripts/i18n-collect.ts b/packages/scripts/i18n-collect.ts similarity index 97% rename from scripts/i18n-collect.ts rename to packages/scripts/i18n-collect.ts index a2befc4..b1e7325 100644 --- a/scripts/i18n-collect.ts +++ b/packages/scripts/i18n-collect.ts @@ -5,11 +5,10 @@ import { sync as globSync } from 'glob'; import { sync as mkdirpSync } from 'mkdirp'; import chalk from 'chalk'; import prompt from 'prompt'; +import localesMap from 'app/i18n'; -import localesMap from './../src/i18n'; - -const MESSAGES_PATTERN = `${__dirname}/../dist/messages/**/*.json`; -const LANG_DIR = `${__dirname}/../src/i18n`; +const MESSAGES_PATTERN = `${__dirname}/../../dist/messages/**/*.json`; +const LANG_DIR = `${__dirname}/../app/i18n`; const DEFAULT_LOCALE = 'en'; const SUPPORTED_LANGS = [DEFAULT_LOCALE, ...Object.keys(localesMap)]; diff --git a/scripts/i18n-crowdin.ts b/packages/scripts/i18n-crowdin.ts similarity index 99% rename from scripts/i18n-crowdin.ts rename to packages/scripts/i18n-crowdin.ts index 9cd07b3..928f842 100644 --- a/scripts/i18n-crowdin.ts +++ b/packages/scripts/i18n-crowdin.ts @@ -9,7 +9,7 @@ import ch from 'chalk'; import iso639 from 'iso-639-1'; import prompt from 'prompt'; -import config from '../config'; +import config from '../../config'; if (!config.crowdinApiKey) { console.error(ch.red`crowdinApiKey is required`); @@ -20,7 +20,7 @@ const PROJECT_ID = 'elyby'; const PROJECT_KEY = config.crowdinApiKey; const CROWDIN_FILE_PATH = 'accounts/site.json'; const SOURCE_LANG = 'en'; -const LANG_DIR = path.resolve(`${__dirname}/../src/i18n`); +const LANG_DIR = path.resolve(`${__dirname}/../app/i18n`); const INDEX_FILE_NAME = 'index.js'; const MIN_RELEASE_PROGRESS = 80; // Minimal ready percent before translation can be published diff --git a/scripts/package.json b/packages/scripts/package.json similarity index 100% rename from scripts/package.json rename to packages/scripts/package.json diff --git a/webpack-utils/fontgen-loader.js b/packages/webpack-utils/fontgen-loader.js similarity index 100% rename from webpack-utils/fontgen-loader.js rename to packages/webpack-utils/fontgen-loader.js diff --git a/webpack-utils/intl-loader.js b/packages/webpack-utils/intl-loader.js similarity index 100% rename from webpack-utils/intl-loader.js rename to packages/webpack-utils/intl-loader.js diff --git a/webpack-utils/package.json b/packages/webpack-utils/package.json similarity index 100% rename from webpack-utils/package.json rename to packages/webpack-utils/package.json diff --git a/postcss.config.js b/postcss.config.js index 3d8d4d8..dba2d33 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -23,7 +23,7 @@ module.exports = ({ webpack: loader }) => ({ load: (defaultLoad => (filename, importOptions) => { if (/\.font.(js|json)$/.test(filename)) { // separately process calls to font loader - // e.g. `@import '~icons.font.json';` + // e.g. `@import '~app/icons.font.json';` if (!fileCache[filename] || !isProduction) { // do not execute loader on the same file twice // this is an overcome for a bug with ExtractTextPlugin, for isProduction === true diff --git a/src/components/user/index.ts b/src/components/user/index.ts deleted file mode 100644 index d023bc5..0000000 --- a/src/components/user/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { User } from './reducer.js'; diff --git a/tsconfig.json b/tsconfig.json index 01ca253..5e4e74f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "baseUrl": "./src", + "baseUrl": "packages", "module": "esnext", "target": "esnext", "esModuleInterop": true, // allow importing commonjs exports as default in es imports @@ -14,5 +14,5 @@ "resolveJsonModule": false, "jsx": "preserve" }, - "include": ["@types", "src", "webpack-utils", "config", "scripts"] + "include": ["@types", "packages", "config"] } diff --git a/webpack.config.js b/webpack.config.js index d7d20ea..e054818 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -16,9 +16,9 @@ const SpeedMeasurePlugin = require('speed-measure-webpack-plugin'); const EagerImportsPlugin = require('eager-imports-webpack-plugin').default; const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); const config = require('./config'); -const SUPPORTED_LANGUAGES = Object.keys(require('./src/i18n')); -const localeFlags = require('./src/components/i18n/localeFlags').default; -const rootPath = path.resolve('./src'); +const SUPPORTED_LANGUAGES = Object.keys(require('app/i18n')); +const localeFlags = require('app/components/i18n/localeFlags').default; +const rootPath = path.resolve('./packages'); const outputPath = path.join(__dirname, 'dist'); const isProduction = process.argv.some(arg => arg === '-p'); @@ -45,7 +45,7 @@ const webpackConfig = { cache: true, entry: { - app: path.join(__dirname, 'src'), + app: path.join(__dirname, 'packages/app'), }, output: { @@ -109,8 +109,8 @@ const webpackConfig = { __PROD__: isProduction, }), new HtmlWebpackPlugin({ - template: 'src/index.ejs', - favicon: 'src/favicon.ico', + template: 'packages/app/index.ejs', + favicon: 'packages/app/favicon.ico', scripts: isProduction ? [] : ['/dll/vendor.dll.js'], hash: false, // webpack does this for all our assets automagically filename: 'index.html', @@ -230,8 +230,8 @@ const webpackConfig = { resolveLoader: { alias: { - 'intl-loader': path.resolve('./webpack-utils/intl-loader'), - 'fontgen-loader': path.resolve('./webpack-utils/fontgen-loader'), + 'intl-loader': path.resolve('./packages/webpack-utils/intl-loader'), + 'fontgen-loader': path.resolve('./packages/webpack-utils/fontgen-loader'), }, }, }; diff --git a/webpack.dll.config.js b/webpack.dll.config.js index 64d1ae3..86b5a9d 100644 --- a/webpack.dll.config.js +++ b/webpack.dll.config.js @@ -2,7 +2,7 @@ /* eslint-env node */ const path = require('path'); const webpack = require('webpack'); -const supportedLocales = require('./src/i18n'); +const supportedLocales = require('app/i18n'); const vendor = Object.keys(require('./package.json').dependencies); const isProduction = process.argv.some(arg => arg === '-p');