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

Commit

Permalink
Merge pull request #934 from City-of-Helsinki/feature/new-folder-stru…
Browse files Browse the repository at this point in the history
…cture

New folder structure
  • Loading branch information
rBoost authored May 23, 2019
2 parents 6d9ea0f + 192ac86 commit 57e2b99
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 31 deletions.
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';
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

0 comments on commit 57e2b99

Please sign in to comment.