You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is basic application skeleton using React and Redux in TypeScript, still under development.
1
+
#react-redux-typescript-boilerplate
2
+
This is skeleton of React application, coded in TypeScript, using Redux to handle application state. It runs on React in version 16 and TypeScript in version 2.7. It consists of two parts and thus may serve two purposes:
3
3
4
-
## Setup
5
-
#### Installation
6
-
Run
4
+
1. Application infrastructure, which includes transpilation from TypeScript to ES6 and to ES5, module bundling, live server, serving application on your localhost with hot module replacement enabled, unit tests runners, code linters, code style configuration etc. It can be used to quickly setup and start coding new project, simply by cloning and removing `/src` directory and some redundant packages from `package.json`.
5
+
2. Application code samples, which display how to write certain common features of web application in TypeScript with React and Redux. This is generally content of `/src` directory. It can be used as an example to learn from, or standard piece of code to duplicate, solving some common problem. So far, it contains general setup of such application, with store, actions and reducers; example of simple routing; example of asynchronous call to external API.
6
+
7
+
## Scripts
8
+
9
+
### start
7
10
```
8
-
npm install
11
+
npm start
9
12
```
10
-
Your app is now installed and ready to go.
13
+
Runs Express server with code in it's current state, bundled by Webpack with configuration for development environment. Result of build process and output from TSLint and StyleLint are displayed in terminal. The application is available at `http://localhost:3000/`. Hot module replacement is enabled, it's output can be found in browser's console.
11
14
12
-
#### Build
13
-
Run
15
+
### build
14
16
```
15
17
npm run build
18
+
npm run build:full
19
+
npm run build:full:prod
16
20
```
17
-
Result of your build will be in ``build`` directory.
21
+
Builds production version of the application. First runs TSLint and StyleLint, which outcome is presented in terminal. Then, if linters are fine, runs tests, which outcome is presented in terminal as well. If tests are fine too, deletes build directories and bundles production version of the application with Webpack. Result of build process is displayed in terminal. Bundled code is available in `/dist` directory.
18
22
19
-
#### Live server
20
-
Run
21
23
```
22
-
npm start
24
+
npm run build:full:dev
23
25
```
24
-
Your live server is available at ``http://localhost:3000/``.
26
+
Runs linters and tests, deletes build directories and bundles development version of the application. Result of linters, tests and build process output are displayed in terminal. Bundled code is available in `/dist` directory.
25
27
26
-
#### Tests
27
-
Run
28
+
```
29
+
npm run build:dev
30
+
npm run build:base
31
+
```
32
+
Bundles development version of the application. Result of build process and output from TSLint and StyleLint are displayed in terminal. Bundled code is available in `/dist` directory.
33
+
34
+
```
35
+
npm run build:prod
36
+
```
37
+
Bundles production version of the application. Result of build process and output from TSLint and StyleLint are displayed in terminal. Bundled code is available in `/dist` directory.
38
+
39
+
```
40
+
npm run build:clean
41
+
```
42
+
Deletes directory with bundled code (`/dist`).
43
+
44
+
### test
28
45
```
29
46
npm run test
30
47
```
31
-
Tests report will be displayed in console.
48
+
Runs all tests and displays report in terminal.
49
+
50
+
```
51
+
npm run test:watch
52
+
```
53
+
Runs tests watcher. Any change in file with test (inside `__test__` directory and ending with `.test.ts(x)`) will trigger automatic rerun of this test until watcher is killed. After ever rerun, there is report displayed in terminal.
54
+
55
+
```
56
+
npm run test:update
57
+
```
58
+
Updates snapshots in tests and displays report in terminal.
32
59
33
-
#### Linting
34
-
In order to run general linter, use
60
+
```
61
+
npm run test:coverage
62
+
```
63
+
Generates test coverage. It's result is displayed in terminal. Detailed results are available in `/coverage` directory. File `/coverage/lcov-report/index.html` contains convenient, human readable file with test coverage of each file with code in our `/src` directory.
64
+
65
+
```
66
+
npm run test:clean
67
+
```
68
+
Deletes test coverage directory (`/coverage`).
69
+
70
+
### lint
35
71
```
36
72
npm run lint
37
73
```
38
-
In order to run specific linters, use
74
+
Runs TSLint and StyleLint, checking files in `/src` directory. Outcome is displayed in terminal.
75
+
76
+
```
77
+
npm run lint:js
78
+
```
79
+
Runs ESLint, checking `.js` files in `/scripts` directory. Outcome is displayed in terminal. This is not part of `lint` command, because we don't want checking our build scripts to be a part of our build process.
80
+
39
81
```
40
82
npm run lint:ts
83
+
```
84
+
Runs TSLint, checking `.ts` and `.tsx` files in `/src` directory. Outcome is displayed in terminal.
85
+
86
+
```
41
87
npm run lint:css
42
88
```
43
-
Linters report will be displayed in console.
89
+
Runs StyleLint, checking `.*css` files in `/src` directory. Outcome is displayed in terminal.
90
+
91
+
### misc
92
+
```
93
+
npm run clean
94
+
```
95
+
Deletes directories with bundled code and test coverage.
96
+
97
+
```
98
+
npm run check-version
99
+
```
100
+
Checks if current version of Node satisfies requirement stated in `package.json`, displays message in terminal if not. This command is part of `postinstall` process.
101
+
102
+
## Changelog:
103
+
#### v.1.0.0
104
+
Added:
105
+
* React 16
106
+
* Webpack 4
107
+
* Routing example
108
+
* API call example
109
+
* styling example
110
+
* Express local server
111
+
* build processes for different environemnts
112
+
* Webpack compression
113
+
* EJS templating
114
+
* Jest snapshot testing
115
+
* editorconfig
44
116
45
-
## Changelist:
46
-
#### v.0.1
47
-
##### v0.1.1
117
+
Modified:
118
+
* application code structure
119
+
* directory structure
120
+
121
+
Removed:
122
+
* Intl
123
+
* Reselect
124
+
* React-Bootstrap
125
+
126
+
#### v.0.3.0
127
+
Added:
128
+
* Awesome TypeScript Loader
129
+
* TSLint
130
+
* SCSSLint
131
+
* basic linting rules
132
+
133
+
#### v.0.2.0
134
+
Added:
135
+
* React-Bootstrap
136
+
* SCSS processing
137
+
138
+
#### v.0.1.0
139
+
Added:
48
140
* React
49
141
* Redux
50
142
* TypeScript
@@ -59,24 +151,9 @@ Linters report will be displayed in console.
0 commit comments