Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

New folder structure #934

Merged
merged 3 commits into from
May 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
}
],

"no-debugger": "warn",

"no-unused-vars": "warn",

"import/prefer-default-export": "off",

"new-cap": ["error", { "capIsNew": false, "newIsCap": true }],
Expand Down Expand Up @@ -87,4 +91,4 @@

"comma-dangle": "off"
}
}
}
6 changes: 3 additions & 3 deletions config/webpack.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = merge(common, {
entry: [
'@babel/polyfill',
'webpack-hot-middleware/client',
path.resolve(__dirname, '../app/index.js'),
path.resolve(__dirname, '../src/index.js'),
],
devtool: 'source-map',
output: {
Expand All @@ -26,7 +26,7 @@ module.exports = merge(common, {
{
enforce: 'pre',
test: /\.(js|jsx)$/,
include: path.resolve(__dirname, '../app'),
include: [path.resolve(__dirname, '../app'), path.resolve(__dirname, '../src')],
loader: 'eslint-loader',
options: {
configFile: path.resolve(__dirname, '../.eslintrc'),
Expand All @@ -35,7 +35,7 @@ module.exports = merge(common, {
},
{
test: /\.(js|jsx)$/,
include: path.resolve(__dirname, '../app'),
include: [path.resolve(__dirname, '../app'), path.resolve(__dirname, '../src')],
exclude: path.resolve(__dirname, '../node_modules'),
options: {
presets: ['@babel/preset-env', '@babel/preset-react'],
Expand Down
4 changes: 2 additions & 2 deletions config/webpack.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const autoprefixer = require('autoprefixer');
const common = require('./webpack.common');

module.exports = merge(common, {
entry: ['@babel/polyfill', path.resolve(__dirname, '../app/index.js')],
entry: ['@babel/polyfill', path.resolve(__dirname, '../src/index.js')],
devtool: 'source-map',
mode: 'production',
output: {
Expand All @@ -23,7 +23,7 @@ module.exports = merge(common, {
rules: [
{
test: /^(?!.*\.spec\.js$).*\.js$/,
include: path.resolve(__dirname, '../app'),
include: [path.resolve(__dirname, '../app'), path.resolve(__dirname, '../src')],
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react'],
Expand Down
Empty file added src/common/.empty
Empty file.
Empty file added src/domain/.empty
Empty file.
30 changes: 16 additions & 14 deletions app/index.js → src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import { BrowserRouter as Router } from 'react-router-dom';
import { createStore } from 'redux';
import Immutable from 'seamless-immutable';

import 'assets/styles/main.scss';
import 'assets/styles/customization/espoo/customization.scss';
import 'assets/styles/customization/vantaa/customization.scss';
import { initI18n } from 'i18n';
import configureStore from 'store/configureStore';
import rootReducer from 'state/rootReducer';
import '../app/assets/styles/main.scss';
import '../app/assets/styles/customization/espoo/customization.scss';
import '../app/assets/styles/customization/vantaa/customization.scss';
import { initI18n } from '../app/i18n';
import configureStore from '../app/store/configureStore';
import rootReducer from '../app/state/rootReducer';
import getRoutes from './routes';
import BrowserWarning from './pages/browser-warning';
import BrowserWarning from '../app/pages/browser-warning';

const initialStoreState = createStore(rootReducer, {}).getState();
const initialServerState = window.INITIAL_STATE;
Expand All @@ -27,10 +27,12 @@ const store = configureStore(finalState);
const isIEBrowser = browserName === 'IE';

// TODO: Support IE11 in the future.
render(isIEBrowser ? <BrowserWarning />
: (
<Provider store={store}>
<Router>{getRoutes()}</Router>
</Provider>
),
document.getElementById('root'));
render(
isIEBrowser ? <BrowserWarning />
: (
<Provider store={store}>
<Router>{getRoutes()}</Router>
</Provider>
),
document.getElementById('root')
);
22 changes: 11 additions & 11 deletions app/routes.js → src/routes.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this file was copied instead of moved since app/routes.js still exists, maybe delete that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, good point. I'll fix that!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's gone!

import { Switch, Redirect } from 'react-router-dom';

import Route from 'shared/route';
import PrivateRoute from 'shared/private-route';
import AppContainer from 'pages/AppContainer';
import AboutPage from 'pages/about';
import AdminResourcesPage from 'pages/admin-resources';
import HomePage from 'pages/home';
import NotFoundPage from 'pages/not-found';
import ReservationPage from 'pages/reservation';
import ResourcePage from 'pages/resource';
import SearchPage from 'pages/search';
import UserReservationsPage from 'pages/user-reservations';
import Route from '../app/shared/route';
import PrivateRoute from '../app/shared/private-route';
import AppContainer from '../app/pages/AppContainer';
import AboutPage from '../app/pages/about';
import AdminResourcesPage from '../app/pages/admin-resources';
import HomePage from '../app/pages/home';
import NotFoundPage from '../app/pages/not-found';
import ReservationPage from '../app/pages/reservation';
import ResourcePage from '../app/pages/resource';
import SearchPage from '../app/pages/search';
import UserReservationsPage from '../app/pages/user-reservations';

export default () => (
<AppContainer>
Expand Down