├── .eslintrc
├── .github
└── workflows
│ ├── node.js.yml
│ └── release.yml
├── .gitignore
├── .prettierignore
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── index.html
├── netlify.toml
├── package.json
├── prerender.js
├── renovate.json
├── server.js
├── src
├── App.jsx
├── AutoRouting.jsx
├── components
│ ├── Counter.jsx
│ ├── Header.jsx
│ ├── Nav.jsx
│ └── Wrapper.jsx
├── entry-client.jsx
├── entry-server.jsx
├── index.css
├── store
│ └── root.js
└── views
│ ├── About.jsx
│ ├── Home.jsx
│ ├── NotFound.jsx
│ ├── example
│ ├── Index.jsx
│ ├── Page.jsx
│ └── [id].jsx
│ └── hello
│ └── index.mdx
├── tailwind.config.js
├── tests
├── main.js
└── setup
│ └── env.js
├── vite.config.js
└── yarn.lock
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["plugin:valtio/recommended", "plugin:react/recommended"],
3 | "rules": {
4 | "valtio/state-snapshot-rule": "warn",
5 | "react/prop-types": 0
6 | },
7 | "settings": {
8 | "react": {
9 | "version": "detect"
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/.github/workflows/node.js.yml:
--------------------------------------------------------------------------------
1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3 |
4 | name: Node.js CI
5 |
6 | on:
7 | push:
8 | branches: [main]
9 | pull_request:
10 | branches: [main]
11 |
12 | jobs:
13 | build:
14 | runs-on: ubuntu-latest
15 |
16 | strategy:
17 | matrix:
18 | node-version: [14.x, 15.x]
19 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
20 |
21 | steps:
22 | - uses: actions/checkout@v2
23 | - name: Use Node.js ${{ matrix.node-version }}
24 | uses: actions/setup-node@v2
25 | with:
26 | node-version: ${{ matrix.node-version }}
27 | - run: yarn
28 | - run: yarn format
29 | - run: yarn test
30 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 | on:
3 | push:
4 | branches:
5 | - main
6 | - master
7 | jobs:
8 | release:
9 | name: Release
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Checkout
13 | uses: actions/checkout@v2
14 | with:
15 | fetch-depth: 0
16 | - name: Setup Node.js
17 | uses: actions/setup-node@v2
18 | with:
19 | node-version: 14
20 | - name: Install dependencies
21 | run: yarn
22 | - name: Release
23 | env:
24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
26 | run: npx semantic-release
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
6 | coverage
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | dist
2 | .github
3 | CONTRIBUTING.md
4 | README.md
5 | *.css
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [1.0.1](https://github.com/thelinuxlich/react-modern-starter/compare/v1.0.0...v1.0.1) (2021-04-08)
2 |
3 |
4 | ### Bug Fixes
5 |
6 | * add semantic-release github plugin ([4a40c90](https://github.com/thelinuxlich/react-modern-starter/commit/4a40c905c662eade574605091adc57c6ab4b8d83))
7 |
8 | # 1.0.0 (2021-04-08)
9 |
10 |
11 | ### Bug Fixes
12 |
13 | * add semantic-release plugins ([f61cc6b](https://github.com/thelinuxlich/react-modern-starter/commit/f61cc6b14096bd594520e504d4ceec73a2a483aa))
14 | * change semantic-release to use yarn ([5bbcabc](https://github.com/thelinuxlich/react-modern-starter/commit/5bbcabc535ec9a9134930d964d27600a9ca21e6b))
15 | * **deps:** update dependency valtio to v1 ([360ce8d](https://github.com/thelinuxlich/react-modern-starter/commit/360ce8d0fe9f4c6683fe6344ede0add565690a15))
16 | * **deps:** update dependency valtio to v1.0.1 ([622243d](https://github.com/thelinuxlich/react-modern-starter/commit/622243d459a530efcebb44ca17a838c3eff1a42d))
17 | * **deps:** update dependency valtio to v1.0.2 ([7722504](https://github.com/thelinuxlich/react-modern-starter/commit/7722504d8f06fe62cca07308b91195c88bfa97e5))
18 | * **deps:** update dependency valtio to v1.0.3 ([cd76f17](https://github.com/thelinuxlich/react-modern-starter/commit/cd76f1731bdd5322f2be7a965898f1469d4d1373))
19 | * **deps:** update react monorepo to v17.0.2 ([75279ae](https://github.com/thelinuxlich/react-modern-starter/commit/75279aed6772bb94715ed493db1b0c21c8763227))
20 | * add publishConfig ([ddedba1](https://github.com/thelinuxlich/react-modern-starter/commit/ddedba1390ce73744a95aa5e160fa66d73943283))
21 | * add tailwind typography to mdx file ([bf9eb25](https://github.com/thelinuxlich/react-modern-starter/commit/bf9eb254750b7e51d66876c4bcba321284bbc5b4))
22 | * don't need the bumper ([ea593b7](https://github.com/thelinuxlich/react-modern-starter/commit/ea593b72fed3721be1d24122ce510eed1a70d14c))
23 | * finally the hooks are working again, phew! ([f1da5f1](https://github.com/thelinuxlich/react-modern-starter/commit/f1da5f1b34bad2944ca93e61e3f8dcf0e85d14fa))
24 | * fix format task ([0b4aadd](https://github.com/thelinuxlich/react-modern-starter/commit/0b4aaddccdd568505b3bbc03ce2ab860760fea6a))
25 | * fix lint-staged to ignore mdx ([ba85a90](https://github.com/thelinuxlich/react-modern-starter/commit/ba85a90146d8b0055da2ad51d211c75a69136a86))
26 | * fix some configs ([e2cdd4e](https://github.com/thelinuxlich/react-modern-starter/commit/e2cdd4eafd1f23144919c93290c06cc2bf4db7f9))
27 | * fix vite-plugin-babel-macros failing ([dd1c5fa](https://github.com/thelinuxlich/react-modern-starter/commit/dd1c5faf99f1435f253bd9894fc358079acb331d))
28 | * format task ignores mdx now ([d311c03](https://github.com/thelinuxlich/react-modern-starter/commit/d311c0332981e7f2b9b5443a6e3bef898b28c845))
29 | * mDX! ([38da73a](https://github.com/thelinuxlich/react-modern-starter/commit/38da73a36da4cc5a5bc8dadd0c6a83c4000bf0ad))
30 | * now using state as snapshot ([e5be838](https://github.com/thelinuxlich/react-modern-starter/commit/e5be83823cf880989b85f2c68e2a4618b3948b04))
31 | * skip git hooks for release ([0d36146](https://github.com/thelinuxlich/react-modern-starter/commit/0d36146cd0517e4f4f0e7aa9cf0b19e626190ae7))
32 | * skip hooks on release ([db28ded](https://github.com/thelinuxlich/react-modern-starter/commit/db28ded9a2e2ef52135ca90c75e9e02b99d1d243))
33 | * small fix in package.json ([09522a3](https://github.com/thelinuxlich/react-modern-starter/commit/09522a3952475a34ca1b52d8835efc42978e62c8))
34 | * some files were missing ([19e53bc](https://github.com/thelinuxlich/react-modern-starter/commit/19e53bcd4b89cda2e09979398beb1320292d9c88))
35 | * update yarn lock ([788624c](https://github.com/thelinuxlich/react-modern-starter/commit/788624cdbb616b0c8c7ac41df719abe2f493ae83))
36 | * **deps:** update dependency valtio to v0.7.1 ([ed4b750](https://github.com/thelinuxlich/react-modern-starter/commit/ed4b750db2d99fcef69fd8c2d266286e94e05305))
37 | * **deps:** update dependency valtio to v0.8.0 ([8252f59](https://github.com/thelinuxlich/react-modern-starter/commit/8252f59f990d41c241927d10f7f27778360436b7))
38 | * **deps:** update dependency valtio to v0.8.1 ([b598230](https://github.com/thelinuxlich/react-modern-starter/commit/b5982306fd3ea66a7e6fa0e4173cf5fd7f0cf649))
39 | * **deps:** update dependency valtio to v0.8.2 ([5d9101b](https://github.com/thelinuxlich/react-modern-starter/commit/5d9101b1645bf4e3c0ddfff08b39286deb178d28))
40 | * update version ([9c2b080](https://github.com/thelinuxlich/react-modern-starter/commit/9c2b080b85aaa4eb639c34c15fc84d4eab6fc223))
41 | * **readme.md:** add git-notify to the README ([b013c9a](https://github.com/thelinuxlich/react-modern-starter/commit/b013c9abbb85a8f51d47fd7426115736360ee83b))
42 |
43 |
44 | ### Features
45 |
46 | * add release bumper to package.json ([e29283b](https://github.com/thelinuxlich/react-modern-starter/commit/e29283be83530407143edb95d3c0949885867ac4))
47 | * add semantic-release to the project ([884f277](https://github.com/thelinuxlich/react-modern-starter/commit/884f27704d39a14de939182d897504b457ee8346))
48 | * added valtio/macro ([ba402f1](https://github.com/thelinuxlich/react-modern-starter/commit/ba402f1044472a5c019b69d0992bb961a6f6d2d1))
49 | * just fixing the module format required by tailwind config ([5cb1902](https://github.com/thelinuxlich/react-modern-starter/commit/5cb19029ac52d36020f5c082d515d951088c51b4))
50 | * mDX will help us write markdown files with React components ([84c89c6](https://github.com/thelinuxlich/react-modern-starter/commit/84c89c603c4b260ee30755f2d344774535f7a4e7))
51 | * mDX! ([a456382](https://github.com/thelinuxlich/react-modern-starter/commit/a456382457df1ae665a9180144a95155f195c65f))
52 | * release-it will enable a nice release task for us ([a9839c3](https://github.com/thelinuxlich/react-modern-starter/commit/a9839c3475adba6ec3bdd5a61f072f46280cc931))
53 | * replace release-it with semantic-release for automated releases ([385c7a8](https://github.com/thelinuxlich/react-modern-starter/commit/385c7a8fe60e60717f2377932fa4e186021af99c))
54 | * shortcut for imports ([cdb3e96](https://github.com/thelinuxlich/react-modern-starter/commit/cdb3e96e920a641b37625523e8ac5f56c8a42f63))
55 | * test ([4b618ab](https://github.com/thelinuxlich/react-modern-starter/commit/4b618ab1156df82ee34930554504ea14d36ef565))
56 | * typography will be nice with MDX and forms is a must-have ([a0c1d26](https://github.com/thelinuxlich/react-modern-starter/commit/a0c1d269aee33bb7e7be92c31a66a1acef98f7f2))
57 | * update semantic-release to use the main branch ([400c3b8](https://github.com/thelinuxlich/react-modern-starter/commit/400c3b8a7e3fb648980c5a35d53673c393d48bbb))
58 | * **component:** add git-standup and its task ([de0b7a8](https://github.com/thelinuxlich/react-modern-starter/commit/de0b7a8fed6db0fcb5bc9136d50fa7b21fac6272))
59 | * **component:** now with git-notify to communicate important updates to your team ([9272f95](https://github.com/thelinuxlich/react-modern-starter/commit/9272f95125591795d50ac0bc3b35a650edded329))
60 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to make participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | - Using welcoming and inclusive language
18 | - Being respectful of differing viewpoints and experiences
19 | - Gracefully accepting constructive criticism
20 | - Focusing on what is best for the community
21 | - Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | - The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | - Trolling, insulting/derogatory comments, and personal or political attacks
28 | - Public or private harassment
29 | - Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | - Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies within all project spaces, and it also applies when
49 | an individual is representing the project or its community in public spaces.
50 | Examples of representing a project or community include using an official
51 | project e-mail address, posting via an official social media account, or acting
52 | as an appointed representative at an online or offline event. Representation of
53 | a project may be further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
75 | For answers to common questions about this code of conduct, see
76 | https://www.contributor-covenant.org/faq
77 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Alisson Cavalcante Agiani
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://github.com/semantic-release/semantic-release)[](http://commitizen.github.io/cz-cli/)[](https://renovatebot.com/)
2 |
3 | # React Modern Starter
4 |
5 | - [React](https://reactjs.org/docs/getting-started.html) for rendering
6 | - [React Router](https://reactrouter.com/web/guides/quick-start) for routing
7 | - [react-seo](https://github.com/americanexpress/react-seo) for SEO
8 | - [MDX](https://mdxjs.com/) for easy markdown files powered by React Components
9 | - [Valtio](https://github.com/pmndrs/valtio) for state management
10 | - [WindyCSS](https://github.com/voorjaar/windicss/wiki/Introduction) for easy bundling TailwindCSS into the stack(typography and forms plugin builtin)
11 | - [Vite](https://vitejs.dev/guide/) for bundling
12 | - [uvu](https://github.com/lukeed/uvu) for testing
13 | - [linkedom](https://github.com/WebReflection/linkedom) for speedy simulation of the browser environment in uvu tests
14 | - [C8](https://github.com/bcoe/c8) for code coverage
15 | - [Prettier-Standard](https://github.com/sheerun/prettier-standard) for formatting and linting
16 | - [lint-staged](https://github.com/okonet/lint-staged) with precommit task for linting
17 | - [Commitizen](https://github.com/commitizen/cz-cli) intercepting your commits to help you add nice formatted messages
18 | - [Renovate](https://github.com/renovatebot/renovate) for automated dependency updates
19 | - [git-notify](https://github.com/jevakallio/git-notify) for communicating important updates during git pull to your team
20 | - [git-standup](https://github.com/kamranahmedse/git-standup) to recall what you did yesterday
21 | - [semantic-release](https://github.com/semantic-release/semantic-release) to automatically release new versions of your project(remember to set NPM_TOKEN in your repository)
22 | - Github Actions CI preconfigured for running lint + tests
23 | - SSR/SSG builtin
24 | - Rudimentary autorouting based on directory convention(similar to Next.js)
25 | - Optional configuration for Netlify deployment
26 |
27 | ## Setup
28 |
29 | - Clone to local
30 | - `cd react-modern-starter`
31 | - `yarn`
32 |
33 | ## Tasks
34 |
35 | - `yarn standup` (receive a pretty list of things you did on your last working day)
36 | - `yarn dev` (standard dev server)
37 | - `yarn format` (format and lint the codebase following prettier-standard rules)
38 | - `yarn build` (bundle client and server(SSR) for production)
39 | - `yarn build:client` (bundle client for production)
40 | - `yarn build:server` (bundle server(SSR) for production)
41 | - `yarn generate` (bundle static SSR/SSG)
42 | - `yarn serve` (preview the production bundle(SSR))
43 | - `yarn test` (run the test suite and generate code coverage)
44 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |