Skip to content

Commit e235c45

Browse files
committed
Refactor(frontend): better project structure for scale
* merge container and its corresponding component file * move related reducer, action, api, and saga files into one service folder * add css-modules support * add *.spec.tsx test files
1 parent d4a0012 commit e235c45

File tree

107 files changed

+957
-1048
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+957
-1048
lines changed

.appveyor.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
environment:
22
nodejs_version: "10"
3-
NODE_ENV: production
43

54
install:
65
- ps: Install-Product node $env:nodejs_version

backend/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ server.listen(port, (error) => {
7777
if (isProduction) {
7878
console.info(`\nExpress: Listening on port ${port}, open up http://localhost:${port}/ in your broswer!\n`.green);
7979
} else {
80-
console.info(`\nExpress: Listening on port ${port}, now you can access api on http://localhost:${port}/ \n`.green);
80+
console.info(`\nExpress: Serve api on http://localhost:${port}/ \n`);
8181
}
8282
});
8383

frontend/public/index.ejs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<meta content="ie=edge" http-equiv="x-ua-compatible">
66
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
77
<meta content="Full-stack boilerplate that using express with webpack, react and typescirpt!" name="description">
8-
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
98
<title><%= htmlWebpackPlugin.options.title %></title>
109
</head>
1110
<body>
@@ -24,5 +23,20 @@
2423
To begin the development, run `yarn dev`.
2524
To run in production mode, use `yarn prod`.
2625
-->
26+
<script>
27+
// Async load Google Material Icons, eliminate render-blocking resources.
28+
// See https://github.com/typekit/webfontloader#get-started for details.
29+
WebFontConfig = {
30+
google: {
31+
families: ['Material Icons']
32+
}
33+
};
34+
(function (d) {
35+
var wf = d.createElement('script'), s = d.scripts[0];
36+
wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
37+
wf.async = true;
38+
s.parentNode.insertBefore(wf, s);
39+
})(document);
40+
</script>
2741
</body>
2842
</html>

frontend/src/App.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1+
import { ConnectedRouter } from 'connected-react-router';
2+
import { History } from 'history';
13
import * as React from 'react';
24
import { Provider } from 'react-redux';
35
import { Store } from 'redux';
46

5-
import { ConnectedRouter } from 'connected-react-router';
6-
import { History } from 'history';
7-
87
import { router } from 'router';
9-
import { IGlobalState } from 'types';
10-
11-
import 'materialize-css';
12-
import 'prismjs/prism.js';
13-
import 'prismjs/themes/prism.css';
14-
import 'sass/index.scss';
8+
import { IGlobalState } from 'types/global';
159

1610
interface IAppProps {
1711
store: Store<IGlobalState>;

frontend/src/actions/index.tsx

Lines changed: 0 additions & 2 deletions
This file was deleted.

frontend/src/apis/index.tsx

Lines changed: 0 additions & 1 deletion
This file was deleted.

frontend/src/components/Dropdown.tsx renamed to frontend/src/components/Dropdown/dropdown.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as React from 'react';
2-
32
import { Link } from 'react-router-dom';
43

54
import { upperCaseFirstChar } from 'utils';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './dropdown';

frontend/src/components/FetchNote.tsx

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
footer.page-footer {
1+
@import 'sass/variables';
2+
3+
.footer {
24
background-color: $primary-color;
35
}

0 commit comments

Comments
 (0)