Skip to content

Commit 29440e6

Browse files
committed
Initial commit
0 parents  commit 29440e6

29 files changed

+12975
-0
lines changed

.commitlintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "extends": ["@commitlint/config-conventional"] }

.eslintignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
node_modules
2+
.next
3+
.cache
4+
build
5+
public
6+
dist
7+
coverage
8+
package.json
9+
package-lock.json
10+
yarn.lock
11+
storybook-static

.eslintrc.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"plugins": ["prettier"],
3+
"extends": [
4+
"react-app",
5+
"react-app/jest",
6+
"plugin:prettier/recommended",
7+
"prettier/react",
8+
"prettier/flowtype",
9+
"prettier/@typescript-eslint"
10+
],
11+
"rules": {
12+
"no-console": "off"
13+
}
14+
}

.gacprc.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"add": false,
3+
"push": false,
4+
"emoji": "emoji",
5+
"editor": false
6+
}

.gitignore

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Dependency directories
2+
node_modules/
3+
jspm_packages/
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# next.js
9+
/.next/
10+
/out/
11+
12+
# production
13+
/build
14+
15+
# testing
16+
/coverage
17+
18+
# dotenv environment variable files
19+
.env*
20+
21+
# Mac files
22+
.DS_Store
23+
24+
# Optional npm cache directory
25+
.npm
26+
27+
# Yarn
28+
yarn-error.log
29+
.pnp/
30+
.pnp.js
31+
32+
# Yarn Integrity file
33+
.yarn-integrity
34+
35+
# Storybook build
36+
storybook-static
37+
38+
# Local Netlify
39+
.netlify
40+
.idea
41+
*.env
42+
43+
# Vercel folder
44+
.vercel
45+
46+
# library folder
47+
.lib
48+
dist
49+
50+
# Compiled binary addons (http://nodejs.org/api/addons.html)
51+
build/Release
52+
53+
# Typescript v1 declaration files
54+
typings/
55+
56+
# Optional eslint cache
57+
.eslintcache
58+
59+
# Logs
60+
logs
61+
*.log
62+
lerna-debug.log
63+
64+
# debug
65+
npm-debug.log*
66+
yarn-debug.log*
67+
yarn-error.log*
68+
69+
#buildsize
70+
size-plugin.json
71+
stats-react.json
72+
stats.html

.huskyrc.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "lint-staged",
4+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
5+
}
6+
}

.lintstagedrc.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"*.{js,ts,css,less,json,md,html,yml,yaml,pcss,jsx,tsx}": [
3+
"prettier --write",
4+
"git add"
5+
],
6+
"package.json": ["yarn format:package"],
7+
"**/*.{js,jsx,tx,tsx}": ["yarn lint"]
8+
}

.prettierignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.cache
2+
build
3+
node_modules
4+
public
5+
dist
6+
coverage
7+
.next
8+
package.json
9+
package-lock.json
10+
yarn.lock
11+
storybook-static

.prettierrc.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"arrowParens": "avoid",
3+
"bracketSpacing": true,
4+
"jsxBracketSameLine": false,
5+
"jsxSingleQuote": false,
6+
"printWidth": 80,
7+
"proseWrap": "always",
8+
"requirePragma": false,
9+
"semi": true,
10+
"singleQuote": false,
11+
"tabWidth": 2,
12+
"trailingComma": "all",
13+
"useTabs": false,
14+
"endOfLine": "auto"
15+
}

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Timeless
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

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# React Typescript Template
2+
3+
React Typescript Project Boilerplate
4+
5+
## Get Started
6+
7+
`yarn`
8+
9+
## Eslint
10+
11+
> Uses **Create React App** configs
12+
13+
## Prettier
14+
15+
> Uses in conjuction with Eslint with `eslint-plugin-prettier` &
16+
> `eslint-config-prettier`
17+
18+
## Commit
19+
20+
`git add . && yarn commit`
21+
22+
> Uses **[gacp](https://github.com/vivaxy/gacp#readme)**
23+
24+
- Runs [Husky](https://github.com/typicode/husky) to improve the commits.
25+
- Husky runs [Lint Staged](https://github.com/okonet/lint-staged) as a
26+
pre-commit hook to run lintes & formatters
27+
- Husky lints the commit message with
28+
[Commitlint](https://github.com/conventional-changelog/commitlint)

package.json

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"name": "react-ts-template",
3+
"version": "1.0.0",
4+
"description": "React Typescript Project template",
5+
"keywords": [
6+
"react",
7+
"template",
8+
"boilerplate",
9+
"typescript",
10+
"new-project",
11+
"new-repo"
12+
],
13+
"bugs": {
14+
"url": "https://github.com/timelessco/react-ts-template/issues"
15+
},
16+
"repository": {
17+
"type": "git",
18+
"url": "git+https://github.com/timelessco/react-ts-template.git"
19+
},
20+
"license": "MIT",
21+
"author": "Navin Moorthy <[email protected]>",
22+
"scripts": {
23+
"build": "react-scripts build",
24+
"commit": "gacp",
25+
"eject": "react-scripts eject",
26+
"format": "prettier --write \"./**/*.{js,ts,css,less,json,md,html,yml,yaml,pcss,jsx,tsx}\"",
27+
"format:package": "sort-package-json",
28+
"lint": "eslint src --ext .tsx,.ts,.jsx,.js",
29+
"start": "react-scripts start",
30+
"test": "react-scripts test"
31+
},
32+
"browserslist": {
33+
"production": [
34+
">0.2%",
35+
"not dead",
36+
"not op_mini all"
37+
],
38+
"development": [
39+
"last 1 chrome version",
40+
"last 1 firefox version",
41+
"last 1 safari version"
42+
]
43+
},
44+
"eslintConfig": {
45+
"extends": [
46+
"react-app",
47+
"react-app/jest"
48+
]
49+
},
50+
"dependencies": {
51+
"react": "^17.0.1",
52+
"react-dom": "^17.0.1",
53+
"web-vitals": "^1.0.1"
54+
},
55+
"devDependencies": {
56+
"@commitlint/cli": "^11.0.0",
57+
"@commitlint/config-conventional": "^11.0.0",
58+
"@testing-library/dom": "^7.28.1",
59+
"@testing-library/jest-dom": "^5.11.6",
60+
"@testing-library/react": "^11.2.2",
61+
"@testing-library/user-event": "^12.5.0",
62+
"@types/jest": "^26.0.16",
63+
"@types/node": "^14.14.10",
64+
"@types/react": "^17.0.0",
65+
"@types/react-dom": "^17.0.0",
66+
"eslint-config-prettier": "^7.0.0",
67+
"eslint-plugin-prettier": "^3.2.0",
68+
"gacp": "^2.10.2",
69+
"husky": "^4.3.0",
70+
"lint-staged": "^10.5.3",
71+
"prettier": "^2.2.1",
72+
"react-scripts": "4.0.1",
73+
"sort-package-json": "^1.48.0",
74+
"typescript": "^4.1.2"
75+
}
76+
}

public/favicon.ico

3.78 KB
Binary file not shown.

public/index.html

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13+
<!--
14+
manifest.json provides metadata used when your web app is installed on a
15+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16+
-->
17+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18+
<!--
19+
Notice the use of %PUBLIC_URL% in the tags above.
20+
It will be replaced with the URL of the `public` folder during the build.
21+
Only files inside the `public` folder can be referenced from the HTML.
22+
23+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24+
work correctly both with client-side routing and a non-root public URL.
25+
Learn how to configure a non-root public URL by running `npm run build`.
26+
-->
27+
<title>React App</title>
28+
</head>
29+
<body>
30+
<noscript>You need to enable JavaScript to run this app.</noscript>
31+
<div id="root"></div>
32+
<!--
33+
This HTML file is a template.
34+
If you open it directly in the browser, you will see an empty page.
35+
36+
You can add webfonts, meta tags, or analytics to this file.
37+
The build step will place the bundled scripts into the <body> tag.
38+
39+
To begin the development, run `npm start` or `yarn start`.
40+
To create a production bundle, use `npm run build` or `yarn build`.
41+
-->
42+
</body>
43+
</html>

public/logo192.png

5.22 KB
Loading

public/logo512.png

9.44 KB
Loading

public/manifest.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
},
10+
{
11+
"src": "logo192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "logo512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
20+
],
21+
"start_url": ".",
22+
"display": "standalone",
23+
"theme_color": "#000000",
24+
"background_color": "#ffffff"
25+
}

public/robots.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:

src/App.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.App {
2+
text-align: center;
3+
}

src/App.test.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from "react";
2+
import { render, screen } from "@testing-library/react";
3+
import App from "./App";
4+
5+
test("renders hello world", () => {
6+
render(<App />);
7+
const h1Element = screen.getByText(/Hello World/i);
8+
expect(h1Element).toBeInTheDocument();
9+
});

src/App.tsx

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from "react";
2+
import "./App.css";
3+
4+
function App() {
5+
return (
6+
<div className="App">
7+
<h1>Hello World</h1>
8+
</div>
9+
);
10+
}
11+
12+
export default App;

src/index.css

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
body {
2+
margin: 0;
3+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
4+
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
5+
sans-serif;
6+
-webkit-font-smoothing: antialiased;
7+
-moz-osx-font-smoothing: grayscale;
8+
}
9+
10+
code {
11+
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
12+
monospace;
13+
}

0 commit comments

Comments
 (0)