Skip to content

Commit

Permalink
v.1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sowinj01 committed Mar 25, 2018
1 parent d787685 commit 559b1d8
Show file tree
Hide file tree
Showing 81 changed files with 19,707 additions and 470 deletions.
9 changes: 3 additions & 6 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"presets": [
"es2015",
"env",
"react",
"stage-0"
],
"plugins": [
"react-hot-loader/babel"
"stage-3"
]
}
}
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
4 changes: 2 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "airbnb"
}
"extends": "eslint:recommended"
}
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# IDE settings
.DS_Store
.idea
.vscode

# modules
node_modules

# logs
npm-debug.log*
npm-debug.log
yarn-error.log

# output
coverage
dist
reports
3 changes: 3 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "stylelint-config-standard"
}
167 changes: 122 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,142 @@
## Intro
This is basic application skeleton using React and Redux in TypeScript, still under development.
# react-redux-typescript-boilerplate
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:

## Setup
#### Installation
Run
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`.
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.

## Scripts

### start
```
npm install
npm start
```
Your app is now installed and ready to go.
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.

#### Build
Run
### build
```
npm run build
npm run build:full
npm run build:full:prod
```
Result of your build will be in ``build`` directory.
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.

#### Live server
Run
```
npm start
npm run build:full:dev
```
Your live server is available at ``http://localhost:3000/``.
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.

#### Tests
Run
```
npm run build:dev
npm run build:base
```
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.

```
npm run build:prod
```
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.

```
npm run build:clean
```
Deletes directory with bundled code (`/dist`).

### test
```
npm run test
```
Tests report will be displayed in console.
Runs all tests and displays report in terminal.

```
npm run test:watch
```
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.

```
npm run test:update
```
Updates snapshots in tests and displays report in terminal.

#### Linting
In order to run general linter, use
```
npm run test:coverage
```
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.

```
npm run test:clean
```
Deletes test coverage directory (`/coverage`).

### lint
```
npm run lint
```
In order to run specific linters, use
Runs TSLint and StyleLint, checking files in `/src` directory. Outcome is displayed in terminal.

```
npm run lint:js
```
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.

```
npm run lint:ts
```
Runs TSLint, checking `.ts` and `.tsx` files in `/src` directory. Outcome is displayed in terminal.

```
npm run lint:css
```
Linters report will be displayed in console.
Runs StyleLint, checking `.*css` files in `/src` directory. Outcome is displayed in terminal.

### misc
```
npm run clean
```
Deletes directories with bundled code and test coverage.

```
npm run check-version
```
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.

## Changelog:
#### v.1.0.0
Added:
* React 16
* Webpack 4
* Routing example
* API call example
* styling example
* Express local server
* build processes for different environemnts
* Webpack compression
* EJS templating
* Jest snapshot testing
* editorconfig

## Changelist:
#### v.0.1
##### v0.1.1
Modified:
* application code structure
* directory structure

Removed:
* Intl
* Reselect
* React-Bootstrap

#### v.0.3.0
Added:
* Awesome TypeScript Loader
* TSLint
* SCSSLint
* basic linting rules

#### v.0.2.0
Added:
* React-Bootstrap
* SCSS processing

#### v.0.1.0
Added:
* React
* Redux
* TypeScript
Expand All @@ -59,24 +151,9 @@ Linters report will be displayed in console.
* Webpack Dev Server
* basic HMR

##### v0.1.2
* React-Bootstrap
* SCSS processing

##### v0.1.3
* Awesome TypeScript Loader
* TSLint
* SCSSLint
* basic linting rules

#### to be added
* Express
* IE9 support
* absolute import
* sophisticated HMR
* sophisticated linting rules
* source maps

#### to be considered
* Redux-Form
* Redux-Saga
#### to do
- fix HMR
- fix `hashSetting` variable in webpack config
- add audit mode (webpack visualizer plugin)
- add IDE support for absolute imports
- add source maps
61 changes: 0 additions & 61 deletions app/app.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions app/constants/messages.ts

This file was deleted.

19 changes: 0 additions & 19 deletions app/containers/App/index.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions app/containers/Bar/index.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions app/containers/Foo/index.tsx

This file was deleted.

Loading

0 comments on commit 559b1d8

Please sign in to comment.