diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..2e1ce17
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,24 @@
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+trim_trailing_whitespace = false
+
+[{package,bower}.json]
+indent_style = space
+indent_size = 2
+
+[{.eslintrc,.scss-lint.yml}]
+indent_style = space
+indent_size = 2
+
+[*.{scss,sass}]
+indent_style = space
+indent_size = 2
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..1cf4c6c
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,25 @@
+## React Boilerplate CRA Template
+
+### โ ๏ธ Clear this template before you submit (after you read the things below)
+
+Thank you for contributing! Please take a moment to review our [**contributing guidelines**](https://github.com/react-boilerplate/react-boilerplate/blob/master/CONTRIBUTING.md)
+to make the process easy and effective for everyone involved.
+
+**Please open an issue** before embarking on any significant pull request, especially those that
+add a new library or change existing tests, otherwise you risk spending a lot of time working
+on something that might not end up being merged into the project.
+
+Before opening a pull request, please ensure:
+
+- [ ] You have followed our [**contributing guidelines**](https://github.com/react-boilerplate/react-boilerplate/blob/master/CONTRIBUTING.md)
+- [ ] Double-check your branch is based on `dev` and targets `dev`
+- [ ] Pull request has tests (we are going for 100% coverage!)
+- [ ] Code is well-commented, linted and follows project conventions
+- [ ] Documentation is updated (if necessary)
+- [ ] Internal code generators and templates are updated (if necessary)
+- [ ] Description explains the issue/use-case resolved and auto-closes related issues
+
+Be kind to code reviewers, please try to keep pull requests as small and focused as possible :)
+
+**IMPORTANT**: By submitting a patch, you agree to allow the project
+owners to license your work under the terms of the [MIT License](https://github.com/react-boilerplate/react-boilerplate/blob/master/LICENSE.md).
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
new file mode 100644
index 0000000..0e51122
--- /dev/null
+++ b/.github/workflows/build.yaml
@@ -0,0 +1,69 @@
+name: build
+
+on:
+ - push
+ - pull_request
+ - workflow_dispatch
+
+jobs:
+ createNpmPackage:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Use Node.js 16.x
+ uses: actions/setup-node@v3
+ with:
+ node-version: 16.x
+ - run: yarn add shelljs
+ - run: yarn run create:npm-package
+ - name: Upload template
+ uses: actions/upload-artifact@v1
+ with:
+ name: cra-template-rb
+ path: .cra-template-rb
+
+ createAndTestCRA:
+ needs: createNpmPackage
+ runs-on: ubuntu-latest
+ steps:
+ - name: Use Node.js 16.x
+ uses: actions/setup-node@v3
+ with:
+ node-version: 16.x
+ - name: Download template
+ uses: actions/download-artifact@v1
+ with:
+ name: cra-template-rb
+ path: ../cra-template-rb # Put into the upper folder. create-react-app wants the current directory empty
+ - name: Create CRA from downloaded template
+ run: yarn create react-app --template file:../cra-template-rb .
+ - run: yarn run build
+ - run: yarn run test:generators
+ - run: yarn run lint
+ - run: yarn run checkTs
+ - run: yarn run test
+ - run: yarn run cleanAndSetup
+ - run: yarn run build
+ - run: yarn run test:generators
+ - run: yarn run lint
+ - run: yarn run checkTs
+ createCRAWithMultipleNodeVersions:
+ needs: createNpmPackage
+ strategy:
+ matrix:
+ node-version: [14.x, 18.x]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v3
+ with:
+ node-version: ${{ matrix.node-version }}
+ - name: Download template
+ uses: actions/download-artifact@v1
+ with:
+ name: cra-template-rb
+ path: ../cra-template-rb # Put into the upper folder. create-react-app wants the current directory empty
+ - name: Create CRA from downloaded template
+ run: yarn create react-app --template file:../cra-template-rb .
+ - run: yarn run build
+ - run: yarn run test
diff --git a/.github/workflows/code_validation.yml b/.github/workflows/code_validation.yml
deleted file mode 100644
index 2b1e510..0000000
--- a/.github/workflows/code_validation.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-name: Code Validation
-
-on:
- push:
- branches: [ "main" ]
- pull_request:
- # The branches below must be a subset of the branches above
- branches: [ "main" ]
-
-jobs:
- eslint:
- name: Run eslint and prettier scanning
- runs-on: ubuntu-latest
- permissions:
- contents: read
- security-events: write
- steps:
- - uses: actions/checkout@v3
- - name: Use Node.js 17
- uses: actions/setup-node@v3.3.0
- with:
- node-version: 17
- - uses: bahmutov/npm-install@v1
- - run: npm run lint:check
- - run: npm run prettier:check
diff --git a/.github/workflows/commitlint.yaml b/.github/workflows/commitlint.yaml
new file mode 100644
index 0000000..eb9ed5f
--- /dev/null
+++ b/.github/workflows/commitlint.yaml
@@ -0,0 +1,31 @@
+# Run commitlint on Pull Requests and commits
+name: commitlint
+on:
+ pull_request:
+ types: ['opened', 'edited', 'reopened', 'synchronize']
+ push:
+ branches:
+ - master
+ - dev
+
+jobs:
+ lint-pull-request-name:
+ # Only on pull requests
+ if: github.event_name == 'pull_request'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v1
+ - run: yarn add @commitlint/config-conventional
+ - uses: JulienKode/pull-request-name-linter-action@v0.1.2
+ lint-commits:
+ # Only if we are pushing or merging PR to the master
+ if: (github.event_name == 'pull_request' && github.base_ref == 'refs/heads/master') || github.event_name == 'push'
+ runs-on: ubuntu-latest
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 30 # Its fine to lint last 30 commits only
+ - run: yarn add @commitlint/config-conventional
+ - uses: wagoid/commitlint-github-action@v1
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 0000000..fdd5f3a
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,11 @@
+name: lint
+on:
+ - push
+ - pull_request
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - run: yarn --frozen-lockfile
+ - run: yarn run lint
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..bfcc838
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,31 @@
+name: release
+
+on:
+ release:
+ types:
+ - created
+ workflow_dispatch:
+
+jobs:
+ createAndTestCRAFromNpm:
+ strategy:
+ matrix:
+ node-version: [16.x, 18.x]
+
+ runs-on: ubuntu-latest
+ steps:
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v3
+ with:
+ node-version: ${{ matrix.node-version }}
+ - name: Create CRA from npm template
+ run: yarn create react-app --template cra-template-rb .
+ - run: yarn run build
+ - run: yarn run test:generators
+ - run: yarn run lint
+ - run: yarn run checkTs
+ - run: yarn run cleanAndSetup
+ - run: yarn run build
+ - run: yarn run test:generators
+ - run: yarn run lint
+ - run: yarn run checkTs
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
new file mode 100644
index 0000000..37ce229
--- /dev/null
+++ b/.github/workflows/test.yaml
@@ -0,0 +1,31 @@
+name: test
+on:
+ - push
+ - pull_request
+ - workflow_dispatch
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Use Node.js 16.x
+ uses: actions/setup-node@v3
+ with:
+ node-version: 16.x
+ - run: yarn --frozen-lockfile
+ - run: yarn run test:coverage
+ - name: Upload to Coveralls
+ uses: coverallsapp/github-action@master
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ testInternals:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Use Node.js 16.x
+ uses: actions/setup-node@v3
+ with:
+ node-version: 16.x
+ - run: yarn --frozen-lockfile
+ - run: yarn run test:internals
diff --git a/.husky/commit-msg b/.husky/commit-msg
new file mode 100755
index 0000000..f2e79f5
--- /dev/null
+++ b/.husky/commit-msg
@@ -0,0 +1,6 @@
+#!/bin/sh
+. "$(dirname "$0")/_/husky.sh"
+
+if yarn git-branch-is dev;
+then yarn commitlint --edit $1;
+fi
diff --git a/.husky/pre-commit b/.husky/pre-commit
index d24fdfc..ddb7a69 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,4 +1,6 @@
-#!/usr/bin/env sh
-. "$(dirname -- "$0")/_/husky.sh"
+#!/bin/sh
+. "$(dirname "$0")/_/husky.sh"
-npx lint-staged
+yarn checkTs
+yarn lint-staged
+yarn verify-startingTemplate-changes
diff --git a/.husky/prepare-commit-msg b/.husky/prepare-commit-msg
new file mode 100755
index 0000000..c827af9
--- /dev/null
+++ b/.husky/prepare-commit-msg
@@ -0,0 +1,4 @@
+#!/bin/sh
+. "$(dirname "$0")/_/husky.sh"
+
+yarn devmoji -e
\ No newline at end of file
diff --git a/.prettierrc.json b/.prettierrc.json
index b0a179d..b88daf7 100644
--- a/.prettierrc.json
+++ b/.prettierrc.json
@@ -1,5 +1,9 @@
{
+ "printWidth": 80,
+ "tabWidth": 2,
+ "useTabs": false,
+ "semi": true,
"singleQuote": true,
- "trailingComma": "none",
+ "trailingComma": "all",
"arrowParens": "avoid"
}
diff --git a/.versionrc.js b/.versionrc.js
new file mode 100644
index 0000000..cfe095f
--- /dev/null
+++ b/.versionrc.js
@@ -0,0 +1,35 @@
+const internalSection = `Internals`;
+/*
+ * Used for creating CHANGELOG.md automatically.
+ * Anything under the internalSection should be boilerplate internals
+ * and shouldn't interest the end users, meaning that the template shouldn't be effected.
+ */
+
+// Check the descriptions of the types -> https://github.com/commitizen/conventional-commit-types/blob/master/index.json
+module.exports = {
+ types: [
+ { type: 'feat', section: 'Features', hidden: false },
+ { type: 'fix', section: 'Bug Fixes', hidden: false },
+ { type: 'docs', section: 'Documentation', hidden: false },
+ { type: 'perf', section: 'Performance Updates', hidden: false },
+
+ // Other changes that don't modify src or test files
+ { type: 'chore', section: internalSection, hidden: false },
+
+ // Adding missing tests or correcting existing tests
+ { type: 'test', section: internalSection, hidden: false },
+
+ // Changes to our CI configuration files and scripts
+ { type: 'ci', section: internalSection, hidden: false },
+
+ // A code change that neither fixes a bug nor adds a feature
+ { type: 'refactor', section: internalSection, hidden: false },
+
+ // Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
+ { type: 'style', section: internalSection, hidden: false },
+ ],
+ skip: {
+ changelog: true,
+ },
+ commitAll: true,
+};
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
new file mode 100644
index 0000000..ea892e0
--- /dev/null
+++ b/.vscode/extensions.json
@@ -0,0 +1,7 @@
+{
+ "recommendations": [
+ "dbaeumer.vscode-eslint",
+ "esbenp.prettier-vscode",
+ "orta.vscode-jest"
+ ]
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..64fbff1
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,195 @@
+# Changelog
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+## [1.2.6](https://github.com/react-boilerplate/react-boilerplate-cra-template/compare/v1.2.5...v1.2.6) (2022-10-23)
+
+- ๐ง maintenance(multiple) ([59b46a4](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/59b46a483ea67adc1747f8852165e68fa476b6df))
+- **deps:** updated practically all dependencies ([#198](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/198)) ([8c2d9d1](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/8c2d9d14e65dc016f46453dbfa00153c052e9e2c))
+
+## [1.2.5](https://github.com/react-boilerplate/react-boilerplate-cra-template/compare/v1.2.4...v1.2.5) (2022-06-20)
+
+### Internals
+
+- ๐ง bump react to 18.1 ([#170](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/170)) ([7ef3155](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/7ef31555a29c273ffd02b55f30f913218d13eb1f))
+
+## [1.2.4](https://github.com/react-boilerplate/react-boilerplate-cra-template/compare/v1.2.3...v1.2.4) (2022-04-12)
+
+### Bug Fixes
+
+- ๐ quick fix for breaking changes of @types/react 18 ([69a5bb7](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/69a5bb7eb671db16a070950816117f3d94c9d9e0))
+
+## [1.2.3](https://github.com/react-boilerplate/react-boilerplate-cra-template/compare/v1.2.2...v1.2.3) (2022-01-19)
+
+### Internals
+
+- ๐ง maintenance(CRA v5) ([41e775f](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/41e775f4f3d003dcb5f6ccec6c5be0566c951fb8))
+
+## [1.2.2](https://github.com/react-boilerplate/react-boilerplate-cra-template/compare/v1.2.1...v1.2.2) (2021-07-20)
+
+### Bug Fixes
+
+- ๐ downgrade inquirer ([ffc735e](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/ffc735ed55b66b68301399dbdc1f33dc8b4fd9a5)), closes [#136](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/136)
+
+## [1.2.1](https://github.com/react-boilerplate/react-boilerplate-cra-template/compare/v1.2.0...v1.2.1) (2021-07-13)
+
+### Documentation
+
+- ๐๏ธ fixed typo [#129](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/129) ([e7794c8](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/e7794c87bd6e13a0ed377f1e0d18640954dabeee))
+- ๐๏ธ fixing typo for navigationBarReducer ([#114](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/114)) ([d04de39](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/d04de392090129c299828948bb7343dd25d6b016))
+- ๐๏ธadded missing selector function in async components ([#133](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/133)) ([2bb4bc7](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/2bb4bc7ae17c62d56d98efcab19e672bc84de44d))
+
+### Internals
+
+- ๐ง maintenance ([2e1b814](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/2e1b814b2e005edbe79602d9d45dd2b56cee733e))
+
+## [1.2.0](https://github.com/react-boilerplate/react-boilerplate-cra-template/compare/v1.1.1...v1.2.0) (2021-01-22)
+
+### Features
+
+- โจrevised folder structure & generators ([#107](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/107)) ([b1e9d69](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/b1e9d696c027eedd19594a071d72ceec2e832ef8))
+
+### Bug Fixes
+
+- ๐ added missing web-vitals to startingTemplate ([4fc4bc3](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/4fc4bc3a03d28e781c177f10501d8bf88458806e))
+- ๐ dynamic messages loading ([02d9a1d](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/02d9a1da3d868c0a6cde7cfbede8889210b37482)), closes [#103](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/103)
+- ๐ message extraction script [#102](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/102) ([4b8788c](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/4b8788c9b9d9e3004feebf8e04fdb96e16a3a2d7))
+- ๐ removed offline-first paradigm ([a27ceca](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/a27ceca7620c5133a70fe21cad83a391a38b8fa5))
+
+### Documentation
+
+- ๐๏ธ removed how-to repo ([324d3d3](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/324d3d3a10cd56acdd1a7be0dee31b28c718ef3d))
+
+### Internals
+
+**This section only concerns the contributors of this project. You can ignore these changes since they DO NOT create changes in the CRA Template**
+
+Click to see the internal changes
+
+- ๐ท added manual triggers ([a514701](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/a514701081fe65ea6099be810ed14c1e1ca80a7d))
+- ๐ง added i18n mock to generators ([#106](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/106)) ([2440250](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/2440250e9a69bff9216ba73aad83168f28985ca3))
+- ๐ง bumped typescript version ([386de98](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/386de985a40a2fe1e75e4873af2d94044516964a))
+- ๐จ fixed minor type error ([976d19d](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/976d19ddab033548f89637de8acd58c86663792a))
+
+
+
+## [1.1.1](https://github.com/react-boilerplate/react-boilerplate-cra-template/compare/v1.0.2...v1.1.0) (2020-12-02)
+
+### Features
+
+- โจ added translation JSON files extraction ([#65](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/65)) ([59d5cc4](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/59d5cc4c332a17c8070ef83fd3c7e2b1d10d7bbb))
+- โจ added .editorconfig ([0423d7c](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/0423d7c13b8802cd1435cff941fe4eeb727a0a49))
+- โจ added web-vitals from CRA 4.0 ([17c4f97](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/17c4f97f7edc4c64f385962fbe4aea8e07950312))
+- โจ fast refresh with CRA 4.0 ([bc7ea9c](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/bc7ea9c0bbad5cbe075c5648ad987fad06961ee9))
+
+### Bug Fixes
+
+- ๐ included .npmrc file in the template which was ignored ([53b28fd](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/53b28fd0a428ca6d53b77e5a44b3d0c73369a4fc))
+- ๐ setting html lang tag to selected language ([c2e61a2](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/c2e61a2ba49cf6558eb36188d3807a051b312492))
+
+### Internals
+
+**This section only concerns the contributors of this project. You can ignore these changes since they DO NOT create changes in the CRA Template**
+
+Click to see the internal changes
+
+- **chore:** ๐๏ธ ๐ง review & update ([45c604c](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/45c604c1e5ed7e29dfd0351b3b9c7eaf1cc01a05))
+- ๐๏ธ added release process steps ([f3eb490](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/f3eb490bf9c993b8276e0b7688b8c887b09c2e3e))
+- โป๏ธ fixing typos, settings and concistency ([c32691c](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/c32691c2dc6819e02d8f43d9054ec50375e7199c))
+- ๐ง maintenance ([#66](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/66)) ([432f449](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/432f4492aa23056e63c721629f274fc8392fd4ba))
+- ๐ง added component folder selection to generators ([#76](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/76)) ([de8e6fd](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/de8e6fd7b8ca4520f2b64c46d4ebd19daf004925))
+- ๐ง switched to yarn ([#89](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/89)) ([2a90e24](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/2a90e24b8eaf8adcfb6008f20a2fc4a8f83bfa33))
+
+
+## [1.0.2](https://github.com/react-boilerplate/react-boilerplate-cra-template/compare/v1.0.1...v1.0.2) (2020-10-27)
+
+Quick patch for cra v4 bug. No changes
+
+### Bug Fixes
+
+- CRA v4 bug fix ([#79](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/79)) ([2cae593](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/2cae593fbd53ee1e6e4a7f31cf50781c1b1ab6b9))
+
+## [1.0.1](https://github.com/react-boilerplate/react-boilerplate-cra-template/compare/v1.0.0...v1.0.1) (2020-07-03)
+
+### Bug Fixes
+
+- ๐ switched to plain objects in i18n helper function ([de76cf6](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/de76cf66da852a786822109e04b49aa62b5b0511))
+
+### Documentation
+
+- ๐๏ธ added react-router hooks ([3927a1b](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/3927a1b513035c6a19d0dab532f76655418fa002))
+
+### Internals
+
+**This section only concerns the contributors of this project. You can ignore these changes since they DO NOT create changes in the CRA Template**
+
+Click to see the internal changes
+
+- ๐ fix redux-toolkit docs ([#35](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/35)) ([30732a8](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/30732a8f68766e1a5a0685dfe5f5e8d1260f30c2))
+- ๐๏ธ fixed docs issues ([97d67f0](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/97d67f0b1f53af6922017b83f3568710a7dda50a))
+- ๐๏ธ fix redux url ([#42](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/42)) ([a491728](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/a49172853e87caa720d0af99341a932e98f3f537))
+- ๐ removing redundant "history" ([#31](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/31)) ([0793d31](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/0793d314439afd434e6ea7a07d9fef15cd47e30b))
+- โป๏ธ fixing variable name in redux-toolkit docs ([#37](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/37)) ([3968ade](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/3968aded3182ab16a35f5596ef2f53e05109d296))
+- โป๏ธ update redux-toolkit docs ([#33](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/33)) ([8dd5931](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/8dd5931b0bd62416446dfb0b2fa761ee77eab852))
+- ๐จ added og meta tags ([43657d6](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/43657d634e28d7a1fa46779657f86e46586c5ac2))
+- ๐ง merge dev for the release ([#48](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/48)) ([043c524](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/043c52477b0c15360a9682d2e0e928dd4b72fbdb))
+- **deps:** ๐ bump websocket-extensions from 0.1.3 to 0.1.4 ([#39](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/39)) ([36e1f9e](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/36e1f9eb4c5439cc4e6ec9ed71a535d52de3ecd8))
+- ๐ง removed theme from startingTemplate ([02d1e62](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/02d1e627ea8b3918f26efc461db3faafaa86a278))
+
+
+
+## [1.0.0](https://github.com/react-boilerplate/react-boilerplate-cra-template/compare/v0.1.3...v1.0.0) (2020-05-18)
+
+### Features
+
+- โจ added media query utility ([c776cdd](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/c776cdd7e55295d304268cc0821779c9720f0fdd))
+
+### Bug Fixes
+
+- ๐ removed `connected-react-router` ([#28](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/28)) ([f6a0350](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/f6a0350dc5c6203a1b1c47d2b420245b7251bd05))
+- ๐ supporting css prop in styled-components ([57895a3](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/57895a3ca97acc7e6dda2a14b093d669d3be4e9e)), closes [#27](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/27)
+
+### Documentation
+
+- ๐๏ธ added example repo to readme ([5f5e413](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/5f5e4133b85f5a7c6bbbbae24fd0c6361ad9e151))
+- ๐๏ธ added FAQ ([47d81b3](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/47d81b311e7c7d2a1f68e55af6d7e10e37526759))
+- ๐add netlify deployment ([#23](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/23)) ([fb9860d](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/fb9860defd9704d2941a2ef7bdb9c13ed462786b))
+
+### Internals
+
+**This section only concerns the contributors of this project. You can ignore these changes since they DO NOT create changes in the CRA Template**
+
+Click to see the internal changes
+
+- โป๏ธ fix typo ([a4a4f50](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/a4a4f5076abc31d9cad612c0c4daab7d37b753b4)), closes [#25](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/25)
+- โป๏ธ fix typo in toolkit.tsx comment ([#18](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/18)) ([1867a5b](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/1867a5b48fcd3b8d54ddd3a07cddf5ececc36c91))
+- โป๏ธ updated clean script name ([3cedb94](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/3cedb9494d242cc48fc605c2002d1cf173c14c55))
+- โป๏ธ updated readme ([765a897](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/765a8972733a556bd39b414cbbe1ff9458864f6a))
+- ๐ง added commit hook verify startingTemplate changes ([e0240c8](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/e0240c83f1f5d0a7fd370759c6114b25bdb5044c))
+- ๐ง added script for creating changelog ([4ed9ed5](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/4ed9ed555e6d3c5363819af3f5eebf7800ec6046))
+- ๐ง improved cleaning script ([a3d05f8](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/a3d05f8faa49cffbdb3e82fe53a9024db8f2170b)), closes [#29](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/29)
+- ๐ง moved creation of the test CRA to a script to avoid husky bug ([e6f8054](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/e6f805435b332587875f045f327e97c43b0b49bf))
+- ๐จ added media utility tests ([3f2d9c9](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/3f2d9c991e8af4914dcd899d6a346dceae0a9463))
+
+
+
+## [0.1.3](https://github.com/react-boilerplate/react-boilerplate-cra-template/compare/v0.1.2...v0.1.3) (2020-05-05)
+
+### Bug Fixes
+
+- ๐ moving typescript check to pre-commit from lint-staged ([6aac0d3](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/6aac0d302bcea714dd8a1ad49b3c77b91204d0b2))
+
+### Internals
+
+**This section only concerns the contributors of this project. You can ignore these changes since they DO NOT create changes in the CRA Template**
+
+Click to see the internal changes
+
+- โจ redux dev tools enabled on github page ([aa890c5](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/aa890c50bcd130788b0b4736efd51b71ae9c057c))
+- ๐ท added job to test the released version ([a328db6](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/a328db6f64b9baffbc2bd04f1e84809f3a9e8364))
+- ๐ง added npm test to CI ([1fbf852](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/1fbf85269e499c280c0cbe15194f882344b3e9ec))
+- ๐ง adding commitlint to workflows ([#13](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/13)) ([f049526](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/f04952662f818ea5fab6d895770e3570748b4313))
+- ๐งFix typo in README ([#9](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/9)) ([8680c10](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/8680c10d2d96e8ad2cae86a40f3c0a86ba76a513))
+- ๐งswitched to standard-version ([#15](https://github.com/react-boilerplate/react-boilerplate-cra-template/issues/15)) ([ce497b5](https://github.com/react-boilerplate/react-boilerplate-cra-template/commit/ce497b533a2aa81d1a5a08d487534e60b4189b32))
+
+
diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md
new file mode 100644
index 0000000..aeef2fd
--- /dev/null
+++ b/RELEASE_PROCESS.md
@@ -0,0 +1,18 @@
+# RELEASE PROCESS
+
+The release process is **semi-automated**. The generated changelog requires editing to keep it visually appealing and clear for everyone.
+
+## Step by step
+
+1. All the development goes into `dev` branch. There are only squash merges allowed there so that its not flooded with everyones commits.
+2. Make a PR to `master` from `dev` and if all checks are good then merge with the title `chore: ๐ง releasing x.x.x`.
+3. Generate the changelog
+ - `yarn run changelog`
+4. Take a look at the previous changelogs and modify the generated changelog accordingly. Delete and organize the commits and move them under internals section if needed.
+5. Create the release
+ - `yarn run release`
+6. Publish to npm
+ - `yarn run publish:npm`
+7. Push the changes to git.
+8. Create release in github by copy pasting the related section from the CHANGELOG.md
+9. There is a `release CI workflow`. Wait for it to be succeeded to see if there any problems with the released version.
diff --git a/commitlint.config.js b/commitlint.config.js
new file mode 100644
index 0000000..67712cf
--- /dev/null
+++ b/commitlint.config.js
@@ -0,0 +1,10 @@
+// Use types from .versionrc.js so that when generating CHANGELOG there are no inconsistencies
+const standardVersionTypes = require('./.versionrc').types;
+const typeEnums = standardVersionTypes.map(t => t.type);
+
+module.exports = {
+ extends: ['@commitlint/config-conventional'],
+ rules: {
+ 'type-enum': [2, 'always', typeEnums],
+ },
+};
diff --git a/docs/building-blocks/README.md b/docs/building-blocks/README.md
new file mode 100644
index 0000000..9cf45e7
--- /dev/null
+++ b/docs/building-blocks/README.md
@@ -0,0 +1,92 @@
+# Building Blocks
+
+In this section, we will explain the **building blocks** of the boilerplate in detail.
+
+First we have to look at what is happening when react starts its life with `index.tsx` file.
+
+### `src/index.tsx`:
+
+It is one of the most important files of the boilerplate. It contains all the global setup to make sure your app runs smoothly. Let's break its contents down:
+
+- `react-app-polyfill` is imported to enable compatibility with many browsers and cool stuff like generator functions, Promises, etc.
+- A Redux `store` is instantiated.
+- `createRoot().render()` not only renders the [root React component](https://github.com/react-boilerplate/react-boilerplate-cra-template/blob/master/src/app/index.tsx), called ``, of your application, but it renders it with ``.
+- Hot module replacement via [Webpack HMR](https://webpack.js.org/guides/hot-module-replacement/) makes the i18n translations hot re-loadable.
+- i18next internationalization support setup.
+- `` connects your app with the Redux `store`.
+
+Again, `src/index.tsx` handles all the bootstrapping and setup of the features we are using in the boilerplate. Now, let's review a summary of the **building blocks**.
+
+{% hint style="info" %}
+
+**๐งTips:** Following chapters reveal more details and tutorials on how to use the building blocks.
+
+{% endhint %}
+
+### Redux
+
+Redux is likely to play a significant role in your application. If you're new to Redux, we'd strongly suggest that you complete this checklist and then come back:
+
+- Understand the motivation behind Redux.
+- Understand the three principles of Redux.
+- Implement Redux in a small React app of yours.
+
+The Redux `store` is the heart of your application. Check out `src/store/configureStore.ts` to see how we have configured the store.
+
+The `createStore()` factory creates the Redux store and accepts three parameters.
+
+1. **Root reducer:** A master reducer combining all your reducers.
+2. **Initial state:** The initial state of your app as determined by your reducers.
+3. **Middleware/enhancers:** Middlewares are third party libraries which intercept each Redux action dispatched to the Redux store and then... do stuff. For example, if you install the [`redux-logger`](https://github.com/evgenyrodionov/redux-logger) middleware, it will listen to all the actions being dispatched to the store and print the previous and next state in the browser console. It's helpful to track what happens in your app.
+
+In our application, we are using a single middleware.
+
+1. **`redux-saga`:** Used for managing _side-effects_ such as dispatching actions asynchronously or accessing browser data.
+
+### Redux-Toolkit
+
+> The official, opinionated, batteries-included toolset for efficient Redux development.
+
+This is the latest and best way of using Redux. It handles lots of the things you would need to do to get Redux working.
+
+We will leave you alone with their [documentation](https://redux-toolkit.js.org) at this point. This boilerplate uses Redux heavily, so you must understand it.
+
+### Reselect
+
+Reselect is a library used for slicing your Redux state and providing only the relevant sub-tree to a React component. It has three key features:
+
+1. Computational power.
+2. Memoization.
+3. Composability.
+
+Imagine an application that shows a list of users. Its Redux state tree stores an array of usernames with signatures:
+
+`{ id: number, username: string, gender: string, age: number }`.
+
+Let's see how the three features of reselect help.
+
+- **Computation:** While performing a search operation, reselect will filter the original array and return only matching usernames. Redux state does not have to store a separate array of filtered usernames.
+- **Memoization:** A selector will not compute a new result unless one of its arguments change. That means, if you are repeating the same search once again, reselect will not filter the array over and over. It will just return the previously computed and, subsequently, cached result. Reselect compares the old and the new arguments and then decides whether to compute again or return the cached result.
+- **Composability:** You can combine multiple selectors. For example, one selector can filter usernames according to a search key, and another selector can filter the already filtered array according to gender. One more selector can further filter according to age. You combine these selectors by using `createSelector()`.
+
+### Redux-Saga
+
+If your application interacts with some back-end API for data, we recommend using `redux-saga` for side-effect management. Too much jargon? Let's simplify.
+
+Imagine that your application is fetching data in JSON format from a back-end. For every API call, ideally, you should define at least three kinds of [action creators](http://redux.js.org/docs/basics/Actions.html):
+
+1. `API_REQUEST`: Upon dispatching this, your application should show a spinner to let the user know that something's happening.
+2. `API_SUCCESS`: Upon dispatching this, your application should show the data to the user.
+3. `API_FAILURE`: Upon dispatching this, your application should show an error message to the user.
+
+And this is only for **_one_** API call. In a real-world scenario, one page of your application could be making tens of API calls. How do we manage all of them effectively? It essentially boils down to controlling the flow of your application. What if there was a background process that handled multiple actions simultaneously and communicated with the Redux store and React components at the same time? Here is where `redux-saga` enters the picture.
+
+For a mental model, consider a saga like a separate thread in your application that's solely responsible for side-effects. Then `redux-saga` is a Redux middleware, which means this thread can be started, paused, and canceled from the main application with standard Redux actions. It has access to the full Redux application state, and it can dispatch Redux actions as well.
+
+### Linting
+
+This boilerplate includes a complete static code analysis setup. It's composed of [ESLint](http://eslint.org/), [stylelint](https://stylelint.io/), and [Prettier](https://prettier.io/).
+
+We recommend that you install the relevant IDE extensions for each one of these tools. Once you do, every time you press [save], all your code will automatically be formatted and reviewed for quality.
+
+The boilerplate provides a pre-commit git hook to analyze and fix linting errors automatically before committing your code. If you'd like to disable it or modify its behavior, take a look at the `lint-staged` section in `package.json`.
diff --git a/docs/building-blocks/async-components.md b/docs/building-blocks/async-components.md
new file mode 100644
index 0000000..0e0651e
--- /dev/null
+++ b/docs/building-blocks/async-components.md
@@ -0,0 +1,34 @@
+# Async Components
+
+To load a component asynchronously, create a `Loadable` file by hand or via component generator with the 'Do you want to load resources asynchronously?' option activated.
+
+This is the content of the file by default:
+
+#### `Loadable.tsx`
+
+```ts
+import { lazyLoad } from 'utils/loadable';
+
+export const HomePage = lazyLoad(
+ () => import('./index'),
+ module => module.HomePage, // Select your exported HomePage function for lazy loading
+);
+```
+
+In this case, the app won't show anything while loading your component. You can, however, make it display a custom loader with:
+
+```ts
+import React from 'react';
+import { lazyLoad } from 'utils/loadable';
+
+export const HomePage = lazyLoad(
+ () => import('./index'),
+ module => module.HomePage,
+ {
+ fallback:
Loading...
,
+ }
+);
+```
+
+Make sure to rename your `Loadable.ts` file to `Loadable.tsx`.
+This feature is built into the boilerplate using React's `lazy` and `Suspense` features.
diff --git a/docs/building-blocks/css.md b/docs/building-blocks/css.md
new file mode 100644
index 0000000..8eb495c
--- /dev/null
+++ b/docs/building-blocks/css.md
@@ -0,0 +1,73 @@
+# Styling (CSS)
+
+## Next Generation CSS
+
+This boilerplate uses [`styled-components`](https://github.com/styled-components/styled-components) for styling React components. `styled-components` allows you to write actual CSS inside your JavaScript, enabling you to use the [full power of CSS](https://github.com/styled-components/styled-components/blob/master/docs/css-we-support.md) ๐ช without mapping between styles and components. There are many ways to style React applications, but many developers find `styled-components` to be a more natural approach to styling components.
+
+### Linting
+
+To complement `styled-components`, this boilerplate also has a CSS linting setup. It uses `stylelint` which will help you stay consistent with modern CSS standards. Read about it [here](linting.md).
+
+### `sanitize.css`
+
+This boilerplate also uses [`sanitize.css`](https://github.com/jonathantneal/sanitize.css) to make browsers render all elements more consistently and in line with modern standards, it's a modern alternative to CSS resets. More info available on the [`sanitize.css` page](sanitize.md).
+
+## styled-components
+
+The example below creates two styled React components (`` and ``) and renders them as children of the `` component:
+
+```ts
+import * as React from 'react';
+import styled from 'styled-components/macro';
+
+// Create a React component that renders an
which is
+// centered, palevioletred and sized at 1.5em
+const Title = styled.h1`
+ font-size: 1.5em;
+ text-align: center;
+ color: palevioletred;
+`;
+
+// Create a React component that renders a with
+// some padding and a papayawhip background
+const Wrapper = styled.section`
+ padding: 4em;
+ background: papayawhip;
+`;
+
+// Use them like any other React component โ except they're styled!
+function Button() {
+ return (
+
+ Hello, here is your first styled component!
+ ...
+
+ );
+}
+```
+
+_(The CSS rules are automatically vendor-prefixed, so you don't have to think about it!)_
+
+{% hint style="info" %}
+
+๐ง**Tips:** Importing from `styled-components/macro` will enable some features you can [see here](https://styled-components.com/docs/tooling#babel-macro).
+
+{% endhint %}
+
+## Media queries
+
+Type-safe media queries can be complicated if you haven't mastered TypeScript. Therefore we include a [media utility file](../../src/styles/media.ts) to make things easier for you.
+
+### Example Usage
+
+```ts
+import { media } from 'styles/media';
+
+const SomeDiv = styled.div`
+ display: flex;
+ .... ${media.medium} {
+ display: block;
+ }
+`;
+``;
+```
diff --git a/docs/building-blocks/i18n.md b/docs/building-blocks/i18n.md
new file mode 100644
index 0000000..1ee9230
--- /dev/null
+++ b/docs/building-blocks/i18n.md
@@ -0,0 +1,104 @@
+# `i18n`
+
+[react-i18next](https://react.i18next.com/) is a powerful internationalization framework for React / React Native which is based on `i18next`. It is a library to manage internationalization and pluralization support for your React application. This involves multi-language support for both the static text but also things like variable numbers, words, or names that change with the application state.
+
+## Usage
+
+The setup and translations are in the **`locales/`** folder. You can add more language to subfolder `de`, `en`, `fr`, and so on.
+
+**`i18n.ts`** is the setup file. It initiates `i18next` with the translations. We also include a helper function here to help use your translations with intellisense support in your project, rather than having to rely on a `something.otherthing.title` kind of string-based format which is error-prone and **not** refactorable. It maps your JSON translation file to JavaScript objects so that you can call them like, surprise, regular objects.
+
+{% hint style="info" %}
+
+๐ง**Tips:** Check the example application of this boilerplate to see how you can separate your translations into logical groups and make everything intellisense-supported ๐ช
+
+{% endhint %}
+
+### Using translations with hooks
+
+Let's say your translation JSON is this:
+
+```json
+{
+ "HomePage": {
+ "Features": {
+ "someItem": "Some text in English"
+ }
+ }
+}
+```
+
+Now you can get the **`someItem`** translation very easily and safely with intellisense support.
+
+```ts
+import * as React from 'react';
+import { useTranslation } from 'react-i18next';
+import { translations } from 'locales/translations';
+
+export function MyComponent() {
+ const { t, i18n } = useTranslation();
+ const changLanguageButtonClicked = evt => {
+ const language = event.target.value;
+ i18n.changeLanguage(language);
+ };
+ // The nested objects are intellisense supported โ
+ return
{t(translations.HomePage.Features.someItem)}
;
+}
+```
+
+Check the [react-i18next](https://react.i18next.com/) docs for other usage types. Its very flexible and well-featured.
+
+## Extracting JSON Files
+
+You don't have to add or delete each entry in `translation.json` manually. Using [i18next-scanner](https://github.com/i18next/i18next-scanner) its fairly straight-forward to extract all the translations into JSON files. It scans your code and whenever it sees something like `t('a.b.c')` it adds `{a: {b : { c: ""}}}` into the JSON files.
+
+Simply, run this script
+
+```shell
+yarn run extract-messages
+```
+
+{% hint style="warning" %}
+
+**WARNING:** The rest below only applies if you want to use `translations` object and want to extract messages later on. If you are going with the default `t('a.b')` approach or if you don't want to extract messages you don't need the `messages.ts` below
+
+{% endhint %}
+
+However, there is a catch here. As mentioned above, we provide **helper object** for translations so that they are type-safe and intellisense-supported. This ruins the scanning ability of `i18next-scanner`. In order to overcome this, we need to define our translated messages in a file
+
+#### `messages.ts`
+
+```ts
+import { translations } from 'locales/translations';
+import { _t } from 'utils/messages';
+
+export const messages = {
+ someItem: () => _t(translations.HomePage.Features.someItem, 'default value'),
+ // ...
+};
+```
+
+then we use `messages` in our react component
+
+```ts
+import * as React from 'react';
+import { useTranslation } from 'react-i18next';
+import { messages } from './messages';
+
+export function MyComponent() {
+ const { t } = useTranslation();
+ return
{t(...messages.someItem()}
;
+}
+```
+
+The reason behind this is, we have to convert this
+
+`t(translations.Homepage.Features.someItem)`
+
+to
+
+`t('Homeage.Features.someItem')`
+
+before `i18next-scanner` parses the file. To do that there is custom [function](../../internals/extractMessages/stringfyTranslations.js) running before the parsing happens. This function looks at `_t(...)`'s and converts them to strings. Then, scanner carries out its duty...
+
+The example application includes this usage and you can take a look at there for a working example.
diff --git a/docs/building-blocks/routing.md b/docs/building-blocks/routing.md
new file mode 100644
index 0000000..81bf337
--- /dev/null
+++ b/docs/building-blocks/routing.md
@@ -0,0 +1,65 @@
+# Routing
+
+`react-router` is the de-facto standard routing solution for React applications.
+
+## Why not use [connected-react-router](https://github.com/supasate/connected-react-router)?
+
+There is a detailed explanation for this decision [here](https://reacttraining.com/react-router/web/guides/deep-redux-integration). In short, the recommendation is to forego keeping routes in the Redux store, simply because it shouldn't be needed. There are other ways of navigating, as explained there.
+
+## Usage
+
+To add a new route, simply import the `Route` component and use it standalone or inside the `Routes` component (all part of [RR6 API](https://reactrouter.com/docs/en/v6/getting-started/overview)):
+
+```ts
+} />
+```
+
+Top level routes are located in `src/app/index.tsx`.
+
+If you want your route component (or any component for that matter) to be loaded asynchronously, use the component generator with 'Do you want to load resources asynchronously?' option activated.
+
+## Child Routes
+
+For example, if you have a route called `about` at `/about`, and want to make a child route called `team` at `/about/our-team`, follow the example in `src/app/index.tsx` to create a `Routes` within the parent component.
+
+#### `AboutPage/index.tsx`
+
+```ts
+import { Routes, Route } from 'react-router-dom';
+
+export function AboutPage() {
+ return (
+
+
+
+ );
+}
+```
+
+## Routing programmatically
+
+You can use the `react-router hooks`, such as [useNavigate](https://reactrouter.com/docs/en/v6/hooks/use-navigate) or [useParams](https://reactrouter.com/docs/en/v6/hooks/use-params), to change the route, get params, and more.
+
+```ts
+import { useNavigate } from 'react-router-dom';
+
+function HomeButton() {
+ let navigate = useNavigate();
+
+ function handleClick() {
+ navigate('/home');
+ }
+
+ return (
+
+ );
+}
+```
+
+{% hint style="info" %}
+
+You can read more in [`react-router`'s documentation](https://reactrouter.com/docs/en/v6).
+
+{% endhint %}
diff --git a/docs/building-blocks/slice/README.md b/docs/building-blocks/slice/README.md
new file mode 100644
index 0000000..62ed480
--- /dev/null
+++ b/docs/building-blocks/slice/README.md
@@ -0,0 +1,26 @@
+# What is a Slice?
+
+If you have read the redux-toolkit documentation you are familiar with the `slice` concept now. Here, we are taking it another step further by enriching it with `reselect` and `redux-saga`.
+
+Slice manages, encapsulates, and operates a `portion` of your application's data. For example, if you have a page that displays a user list, then you can have a slice called 'UsersPageSlice' that contains all the users in its state, also the functions to read it from the store and the functions to update the users in the list. So, in short, a slice is a redux-toolkit slice also containing the relative `reselect` and `redux-saga` operations within its folder. After all, they are all related to managing the same portion of the data.
+
+A `slice` is independent of the UI component. It can contain any kind of logic and it can be located in any folder. To follow the `folder-by-feature` pattern it is recommended to keep your `slices` closer to your component using it. But, this doesn't mean that it only belongs to that component. You can import and use that slice in whichever component you want.
+
+The next steps in the documentation describes how to use the slices with some examples.
+
+Example folder view:
+
+```
+project
+|
+โโโ app
+โ โโโ src
+โ โโโ app
+โ โ โโโ Homepage
+โ โ โ โโโ index.tsx
+โ โ โ โโโ slice => Contains the relevant stuff for Homepage data
+โ โ โ โ โโโ index.ts
+โ โ โ โ โโโ saga.ts
+โ โ โ โ โโโ selectors.ts
+โ โ โ โ โโโ types.ts
+```
diff --git a/docs/building-blocks/slice/redux-injectors.md b/docs/building-blocks/slice/redux-injectors.md
new file mode 100644
index 0000000..084c5d1
--- /dev/null
+++ b/docs/building-blocks/slice/redux-injectors.md
@@ -0,0 +1,33 @@
+# Redux Injectors
+
+[`redux-injectors`](https://github.com/react-boilerplate/redux-injectors) is an official `react-boilerplate` companion library. We built it so that it can be used and maintained independently from `react-boilerplate`. It allows you to dynamically load reducers and sagas as needed, instead of loading them all upfront. This has some nice benefits, such as avoiding having to manage a big global list of reducers and sagas. It also facilitates more effective use of [code-splitting](https://webpack.js.org/guides/code-splitting/).
+
+You can find the main repo for the library [here](https://github.com/react-boilerplate/redux-injectors) and read the docs [here](https://github.com/react-boilerplate/redux-injectors/blob/master/docs/api.md).
+
+## Usage
+
+```ts
+import {
+ useInjectSaga,
+ useInjectReducer,
+ SagaInjectionModes,
+} from 'utils/redux-injectors';
+import { saga } from './saga';
+import { reducer } from '.';
+
+export function SomeComponent() {
+ useInjectReducer({ key: 'SomeComponent', reducer });
+ useInjectSaga({
+ key: 'SomeComponent',
+ saga,
+ mode: SagaInjectionModes.DAEMON,
+ });
+ // ...
+}
+```
+
+{% hint style="info" %}
+
+**Note:** Importing `redux-injectors` from `utils/redux-injectors` will add extra type-safety.
+
+{% endhint %}
diff --git a/docs/building-blocks/slice/redux-saga.md b/docs/building-blocks/slice/redux-saga.md
new file mode 100644
index 0000000..5c027b6
--- /dev/null
+++ b/docs/building-blocks/slice/redux-saga.md
@@ -0,0 +1,60 @@
+# Redux-Saga
+
+`redux-saga` is a library to manage side-effects in your application. It works beautifully for data fetching, concurrent computations and a lot more. [Sebastien Lorber](https://twitter.com/sebastienlorber) put it best:
+
+> Imagine there is widget1 and widget2. When some button on widget1 is clicked, then it should have an effect on widget2. Instead of coupling the 2 widgets together (i.e. widget1 dispatches an action that targets widget2), widget1 only dispatches that its button was clicked. Then the saga listens for this button click and updates widget2 by dispatching a new event that widget2 is aware of.
+>
+> This adds a level of indirection that is unnecessary for simple apps, but makes it easier to scale complex applications. You can now publish widget1 and widget2 to different npm repositories so that they never have to know about each other, without having them share a global registry of actions. The 2 widgets are now bounded by contexts that can live separately. They don't need each other to be consistent and can be reused in other apps as well. **The saga is the coupling point between the two widgets that coordinate them in a meaningful way for your business.**
+
+_Note: It is well worth reading the [source](https://stackoverflow.com/questions/34570758/why-do-we-need-middleware-for-async-flow-in-redux/34623840#34623840) of this quote in its entirety!_
+
+To learn more about this amazing way to handle concurrent flows, start with the [official documentation](https://redux-saga.github.io/redux-saga) and explore some examples! (Read [this comparison](https://stackoverflow.com/questions/34930735/pros-cons-of-using-redux-saga-with-es6-generators-vs-redux-thunk-with-es7-async/34933395) if you're used to `redux-thunk`.)
+
+## Usage
+
+Sagas are associated with a slice. If your slice already has a `saga.ts` file, simply add your saga to that. If your slice does not yet have a `saga.ts` file, add one with this boilerplate structure:
+
+#### `.../slice/saga.ts`
+
+```ts
+import { takeLatest, call, put, select } from 'redux-saga/effects';
+import { homepageActions } from '.';
+
+// Root saga
+export default function* homepageSaga() {
+ // if necessary, start multiple sagas at once with `all`
+ yield [
+ takeLatest(actions.someAction.type, getSomething),
+ takeLatest(actions.someOtherAction.type, getOtherThing),
+ ];
+}
+```
+
+### Using your saga in components
+
+Once you have a saga in your slice, [`useInjectSaga`](https://github.com/react-boilerplate/redux-injectors/blob/master/docs/api.md#useinjectsaga) from `redux-injectors` will inject the root saga.
+
+#### `.../slice/index.ts`
+
+```ts
+// ... code from above
+
+export const useHomepageSlice = () => {
+ useInjectReducer({ key: slice.name, reducer: slice.reducer });
+ useInjectSaga({ key: sliceKey, saga: homepageSaga });
+ return { actions: slice.actions };
+};
+```
+
+A `mode` argument can be one of three constants (import the enum `SagaInjectionModes` from `redux-injectors`):
+
+- `DAEMON` (default value) โ starts a saga when a component is being mounted and never cancels it or starts again;
+- `RESTART_ON_REMOUNT` โ starts a saga when a component is being mounted
+ and cancels with `task.cancel()` on component un-mount for improved performance;
+- `ONCE_TILL_UNMOUNT` โ behaves like `RESTART_ON_REMOUNT` but never runs the saga again.
+
+{% hint style="info" %}
+
+๐ **Good News:** You don't need to write this boilerplate code by hand, the `slice` generator will generate it for you. โ
+
+{% endhint %}
diff --git a/docs/building-blocks/slice/redux-toolkit.md b/docs/building-blocks/slice/redux-toolkit.md
new file mode 100644
index 0000000..610921b
--- /dev/null
+++ b/docs/building-blocks/slice/redux-toolkit.md
@@ -0,0 +1,137 @@
+# Redux-Toolkit
+
+If you haven't worked with Redux, it's highly recommended (possibly indispensable!) to read through the (amazing) [official documentation](http://redux.js.org) and/or watch this [free video tutorial series](https://egghead.io/series/getting-started-with-redux).
+
+As minimal as Redux is, the challenge it addresses - app state management - is a complex topic that is too involved to properly discuss here.
+
+## Usage
+
+### 1) Creating a dedicated slice folder
+
+Let's start creating a slice to manage our Homepage data and call it `HomepageSlice`.
+
+An empty folder `.../Homepage/slice/`
+
+### 2) Declaring your state
+
+Redux manages your **state** so we have to declare our state first. We can create a `types.ts` file in our slice. Types are crucial for efficient and safe development. Your compiler and code completion will understand the shape of your state and help you code the rest of your project faster and safer.
+
+#### `.../Homepage/slice/types.ts`
+
+```ts
+/* --- STATE --- */
+export interface HomepageState {
+ username: string;
+ // declare what you want in your Homepage state
+}
+```
+
+### 3) Updating your Redux State
+
+Now that you are adding another `slice` to your state you also need to declare this in your `types/RootState.ts` file. Since we are adding Redux slices **asynchronously** with [Redux-injectors](redux-injectors.md), the compiler cannot tell what the Redux State is during the build time. So, we explicitly declare them `types/RootState.ts` file:
+
+#### `types/RootState.ts`
+
+```ts
+import { HomepageState } from 'app/.../Homepage/slice/types';
+
+// Properties are optional because they are injected when the components are mounted sometime in your application's life. So, not available always
+export interface RootState {
+ homepage?: HomepageState;
+}
+```
+
+### 4) Creating your slice
+
+Fortunately, [Redux Toolkit](https://redux-toolkit.js.org) handles most of the work for us. To create our slice, we create a `index.ts` file in our folder as well. This will be responsible for:
+
+- Our slice's **initial state**
+- **Actions** we can trigger
+- **Reducers** that decide how the state will change, given the action received
+
+#### `.../Homepage/slice/index.ts`
+
+```ts
+import { PayloadAction } from '@reduxjs/toolkit';
+import { createSlice } from 'utils/@reduxjs/toolkit'; // Importing from `utils` makes them more type-safe โ
+import { HomepageState } from './types';
+
+// The initial state of the Homepage
+export const initialState: HomepageState = {
+ username: 'Initial username for my state',
+};
+
+const slice = createSlice({
+ name: 'homepage',
+ initialState,
+ reducers: {
+ changeUsername(state, action: PayloadAction) {
+ // Here we say lets change the username in my homepage state when changeUsername actions fires
+ // Type-safe: It will expect `string` when firing the action. โ
+ state.username = action.payload;
+ },
+ },
+});
+
+/**
+ * `actions` will be used to trigger change in the state from where ever you want
+ */
+export const { actions: homepageActions } = slice;
+```
+
+### 5) Adding the slice to your Redux Store
+
+Let's add our slice to the redux state. We can write a simple 'hook' and use it in our component(whichever you want)
+
+#### `.../Homepage/slice/index.ts`
+
+```ts
+// ... code from above
+
+/**
+ * Let's turn this into a hook style usage. This will inject the slice to redux store and return actions in case you want to use in the component
+ */
+export const useHomepageSlice = () => {
+ useInjectReducer({ key: slice.name, reducer: slice.reducer });
+ return { actions: slice.actions };
+};
+```
+
+### 5) Using the slice in your component
+
+Let's use the hook we created above in our component
+
+#### `.../Homepage/index.tsx`
+
+```ts
+import React, { useEffect } from 'react';
+import { useSelector, useDispatch } from 'react-redux';
+import { useHomepageSlice } from './slice';
+import { selectUsername } from './slice/selectors';
+
+export function HomePage() {
+ // Use the slice we created
+ const { actions } = useHomepageSlice();
+
+ // Used to dispatch slice actions
+ const dispatch = useDispatch();
+
+ // `selectors` are used to read the state. Explained in other chapter
+ // Will be inferred as `string` type โ
+ const username = useSelector(selectUsername);
+
+ const textInputChanged = evt => {
+ // Trigger the action to change the state. It accepts `string` as we declared in `slice.ts`. Fully type-safe โ
+ dispatch(actions.changeUsername(evt.target.value));
+ };
+ // ...
+}
+```
+
+{% hint style="info" %}
+
+๐ **Good News:** You don't need to write this boilerplate code by hand, the `slice` generator will generate it for you. โ
+
+`yarn generate slice`
+
+{% endhint %}
diff --git a/docs/building-blocks/slice/reselect.md b/docs/building-blocks/slice/reselect.md
new file mode 100644
index 0000000..b9af3c8
--- /dev/null
+++ b/docs/building-blocks/slice/reselect.md
@@ -0,0 +1,59 @@
+# Reselect
+
+`reselect` memoizes ("caches") previous state trees and calculations based upon the said tree. This means repeated changes and calculations are fast and efficient, providing us with a performance boost over standard `useSelector` implementations.
+
+The [official documentation](https://github.com/reactjs/reselect) offers a good starting point!
+
+## Usage
+
+There are two different kinds of selectors, simple and complex ones.
+
+### Simple selectors
+
+Simple selectors are just that: they take the application state and select a part of it.
+
+```ts
+export const mySelector = (state: MyRootState) => state.someState;
+```
+
+### Complex selectors
+
+If we need to, we can combine simple selectors to build more complex ones which get nested state parts with `reselect`'s `createSelector` function. We import other selectors and pass them to the `createSelector` call:
+
+#### `.../slice/selectors.ts`
+
+```ts
+import { createSelector } from '@reduxjs/toolkit';
+
+export const mySelector = (state: MyRootState) => state.someState;
+
+// Here type of `someState` will be inferred โ
+const myComplexSelector = createSelector(
+ mySelector,
+ someState => someState.someNestedState,
+);
+
+export { myComplexSelector };
+```
+
+### Using your selectors in components
+
+#### `index.tsx`
+
+```ts
+import React, { useEffect } from 'react';
+import { useSelector } from 'react-redux';
+import { selectUsername } from './slice/selectors';
+
+export function HomePage() {
+ // Type of the `username` will be inferred โ
+ const username = useSelector(selectUsername);
+ // ...
+}
+```
+
+{% hint style="info" %}
+
+๐ **Good News:** You don't need to write this boilerplate code by hand, the `slice` generator will generate it for you. โ
+
+{% endhint %}
diff --git a/docs/building-blocks/testing.md b/docs/building-blocks/testing.md
new file mode 100644
index 0000000..c2f71c2
--- /dev/null
+++ b/docs/building-blocks/testing.md
@@ -0,0 +1,181 @@
+# Component testing
+
+
+
+- [Component testing](#component-testing)
+ - [Shallow rendering](#shallow-rendering)
+ - [`button.tsx`](#buttontsx)
+ - [`Homepage.tsx`](#homepagetsx)
+ - [react-testing-library](#react-testing-library) - [`button.test.tsx`](#buttontesttsx)
+ - [Snapshot testing](#snapshot-testing)
+ - [Behavior testing](#behavior-testing) - [`button.test.tsx`](#buttontesttsx-1) - [`button.test.tsx`](#buttontesttsx-2)
+
+
+## Shallow rendering
+
+React provides us with a nice add-on called the Shallow Renderer. This renderer will render a React component **one level deep**. Let's explore what that means with a simple `