Skip to content

Commit 559b1d8

Browse files
author
sowinj01
committed
v.1.0.0
1 parent d787685 commit 559b1d8

Some content is hidden

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

81 files changed

+19707
-470
lines changed

.babelrc

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{
22
"presets": [
3-
"es2015",
3+
"env",
44
"react",
5-
"stage-0"
6-
],
7-
"plugins": [
8-
"react-hot-loader/babel"
5+
"stage-3"
96
]
10-
}
7+
}

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
indent_size = 2
8+
indent_style = space
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "airbnb"
3-
}
2+
"extends": "eslint:recommended"
3+
}

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# IDE settings
2+
.DS_Store
3+
.idea
4+
.vscode
5+
6+
# modules
7+
node_modules
8+
9+
# logs
10+
npm-debug.log*
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# output
15+
coverage
16+
dist
17+
reports

.stylelintrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "stylelint-config-standard"
3+
}

README.md

+122-45
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,142 @@
1-
## Intro
2-
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:
33

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
710
```
8-
npm install
11+
npm start
912
```
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.
1114

12-
#### Build
13-
Run
15+
### build
1416
```
1517
npm run build
18+
npm run build:full
19+
npm run build:full:prod
1620
```
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.
1822

19-
#### Live server
20-
Run
2123
```
22-
npm start
24+
npm run build:full:dev
2325
```
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.
2527

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
2845
```
2946
npm run test
3047
```
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.
3259

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
3571
```
3672
npm run lint
3773
```
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+
3981
```
4082
npm run lint:ts
83+
```
84+
Runs TSLint, checking `.ts` and `.tsx` files in `/src` directory. Outcome is displayed in terminal.
85+
86+
```
4187
npm run lint:css
4288
```
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
44116

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:
48140
* React
49141
* Redux
50142
* TypeScript
@@ -59,24 +151,9 @@ Linters report will be displayed in console.
59151
* Webpack Dev Server
60152
* basic HMR
61153

62-
##### v0.1.2
63-
* React-Bootstrap
64-
* SCSS processing
65-
66-
##### v0.1.3
67-
* Awesome TypeScript Loader
68-
* TSLint
69-
* SCSSLint
70-
* basic linting rules
71-
72-
#### to be added
73-
* Express
74-
* IE9 support
75-
* absolute import
76-
* sophisticated HMR
77-
* sophisticated linting rules
78-
* source maps
79-
80-
#### to be considered
81-
* Redux-Form
82-
* Redux-Saga
154+
#### to do
155+
- fix HMR
156+
- fix `hashSetting` variable in webpack config
157+
- add audit mode (webpack visualizer plugin)
158+
- add IDE support for absolute imports
159+
- add source maps

app/app.tsx

-61
This file was deleted.

app/constants/messages.ts

-10
This file was deleted.

app/containers/App/index.tsx

-19
This file was deleted.

app/containers/Bar/index.tsx

-16
This file was deleted.

app/containers/Foo/index.tsx

-16
This file was deleted.

0 commit comments

Comments
 (0)