Skip to content
This repository has been archived by the owner on Oct 18, 2022. It is now read-only.

Commit

Permalink
πŸŽ‰β€ release: v1.0.0  πŸŽ‰
Browse files Browse the repository at this point in the history
  • Loading branch information
daltonmenezes committed Feb 22, 2021
1 parent 99411b3 commit 02db8b5
Show file tree
Hide file tree
Showing 16 changed files with 289 additions and 2 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Dalton Menezes

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
57 changes: 55 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,55 @@
# cra-template-good-start
A template for create react app with typescript, minimal files and estlin/prettier configured
<p align="center"><a hrf="#"><img src="https://upload.wikimedia.org/wikipedia/commons/a/a7/React-icon.svg" alt="react logo" width="40%" /></a></p>

<h1 align="center">cra-template-good-start</h1>
<p align="center">A good starting point template to init a configured React app with typescript, eslint, prettier and more πŸ’…</p>

<p align="center">
<!-- Patreon -->
<a href="https://www.patreon.com/daltonmenezes">
<img alt="patreon url" src="https://img.shields.io/badge/support%20on-patreon-1C1E26?style=for-the-badge&labelColor=1C1E26&color=0084ff">
</a>

<!-- npm version -->
<a href="https://www.npmjs.com/package/cra-template-good-start">
<img alt="npm version" src="https://img.shields.io/npm/v/cra-template-good-start.svg?style=for-the-badge&labelColor=1C1E26&color=0084ff">
</a>

<!-- downloads -->
<a href="https://www.npmjs.com/package/cra-template-good-start">
<img alt="npm version" src="https://img.shields.io/npm/dm/cra-template-good-start.svg?style=for-the-badge&labelColor=1C1E26&color=0084ff">
</a>
</p>

## Table of Contents
- [Usage](#usage)
- [Features](#features)
- [License](#license)

## Usage

To use this template, add `--template cra-template-good-start` when creating a new app with **create-react-app**.

For example:
```bash
npx create-react-app my-app --template cra-template-good-start

# OR

yarn create react-app my-app --template cra-template-good-start
```
Then:
```bash
cd my-app
```

## Features
- βš‘β€typescript
- βš‘β€eslint
- βš‘β€prettier
- βš‘β€editor config
- βš‘β€sass
- βš‘β€css reset
- βš‘β€absolute imports

## License
[MIT Β© Dalton Menezes](https://github.com/daltonmenezes/cra-template-good-start/blob/main/LICENSE)
30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "cra-template-good-start",
"version": "1.0.0",
"keywords": [
"react",
"create-react-app",
"template",
"typescript",
"eslint",
"prettier",
"editorconfig",
"sass"
],
"description": "A good starting point template to init a configured React app with typescript, eslint, prettier and more for Create React App",
"repository": {
"type": "git",
"url": "https://github.com/daltonmenezes/cra-template-good-start.git"
},
"license": "MIT",
"engines": {
"node": ">=10"
},
"bugs": {
"url": "https://github.com/daltonmenezes/cra-template-good-start/issues"
},
"files": [
"template",
"template.json"
]
}
30 changes: 30 additions & 0 deletions template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"package": {
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"eject": "react-scripts eject"
},
"dependencies": {
"@types/node": "^12.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"typescript": "^4.1.2"
},
"devDependencies": {
"prettier": "^2.2.1",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-prettier": "^3.3.1",
"node-sass": "^5.0.0"
},
"eslintConfig": {
"extends": ["react-app", "prettier/@typescript-eslint", "plugin:prettier/recommended"],
"rules": {
"prettier/prettier": ["error", {}, { "usePrettierrc": true }],
"react/prop-types": "off",
"react-hooks/exhaustive-deps": "off",
"@typescript-eslint/no-empty-interface": "off"
}
}
}
}
12 changes: 12 additions & 0 deletions template/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
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
7 changes: 7 additions & 0 deletions template/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"trailingComma": "es5"
}
3 changes: 3 additions & 0 deletions template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Your awesome App

> This is your good starting point to creating something awesome! Let's do this! ✨
24 changes: 24 additions & 0 deletions template/gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.eslintcache

npm-debug.log*
yarn-debug.log*
yarn-error.log*
12 changes: 12 additions & 0 deletions template/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Your awesome app</title>
</head>

<body>
<div id="root"></div>
</body>
</html>
11 changes: 11 additions & 0 deletions template/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Hello from 'components/Hello'

function App() {
return (
<section className="containers">
<Hello />
</section>
)
}

export default App
15 changes: 15 additions & 0 deletions template/src/components/Hello/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import styles from './styles.module.sass'

function Hello() {
return (
<div className={styles.text}>
<h1>Hi, there!</h1>
<h2>
This is your good starting point to creating something awesome! Let's do
this! ✨
</h2>
</div>
)
}

export default Hello
7 changes: 7 additions & 0 deletions template/src/components/Hello/styles.module.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import 'styles/colors'

.text
color: $light-blue

h1
font-size: 3rem
12 changes: 12 additions & 0 deletions template/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'

import './styles/global.styles.sass'

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
)
2 changes: 2 additions & 0 deletions template/src/styles/colors.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$light-blue: #0084ff
$black: #131313
21 changes: 21 additions & 0 deletions template/src/styles/global.styles.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@import 'colors'

*
margin: 0
padding: 0
outline: 0
border: 0
text-decoration: none
box-sizing: border-box

html, body, #root, .containers
width: 100vw
height: 100vh

.containers
display: flex
flex-flow: column wrap
align-items: center
justify-content: center
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif
background-color: $black
27 changes: 27 additions & 0 deletions template/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"baseUrl": "src"
},
"include": [
"src"
]
}

0 comments on commit 02db8b5

Please sign in to comment.