Skip to content

Commit

Permalink
React, innit?
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Hyders committed Jul 16, 2021
1 parent 0e994ba commit 0a905b5
Show file tree
Hide file tree
Showing 19 changed files with 126 additions and 163 deletions.
76 changes: 13 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,20 @@
# Getting Started with Create React App
# React, innit?
`Reactinnit` is a CRA (create-react-app) template based on the default `cra-template` used by default in Create React App. It's meant to be a more organised version of cra-template. Reactinnit is used in [Devbox](https://github.com/DanningtonSystems/devbox) and can be used standalone with Create React App.

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
There is currently no TypeScript variation of Reactinnit. However, feel free to add a PR to [the Reactinnit TypeScript repository](https://github.com/DanningtonSystems/cra-template-reactinnit-ts/pullls) if you'd like to help with creating a TypeScript version of Reactinnit.

## Available Scripts
## Usage

In the project directory, you can run:
To use Reactinnit with Yarn, use a command like the following:

### `yarn start`
`yarn create react-app [application name or . for current directory] --template reactinnit`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
With NPM, you can use:

The page will reload if you make edits.\
You will also see any lint errors in the console.
`npx create-react-app [application name or . for current directory] --template reactinnit`

### `yarn test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `yarn build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `yarn build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
## Resources
- [Getting Started](https://create-react-app.dev/docs/getting-started) - The Getting Started guide for CRA-based projects.
- [Editor/IDE Tips](https://create-react-app.dev/docs/setting-up-your-editor) - A list of tips and tricks on how to configure your preferred text editor/IDE to work harmoniously with Create React App.
- [Client-side routing in React](https://reactrouter.com/web/guides/quick-start) - A quick-start guide for CSR (client side routing) in React using `react-router-dom`.
- [Deployment Tips](https://create-react-app.dev/docs/deployment) - Tips on how to deploy your Reactinnit-based app in production environments.
53 changes: 20 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,26 @@
{
"name": "dannington-react-boilerplate",
"name": "cra-reactinnit",
"version": "1.0.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"react-tooltip": "^4.2.21",
"web-vitals": "^1.0.1"
"keywords": [
"react",
"create-react-app",
"template",
"reactinnit"
],
"description": "A Create React App template based on cra-template.",
"repository": {
"type": "git",
"url": "https://github.com/DanningtonSystems/cra-reactinnit.git"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"license": "MIT",
"engines": {
"node": ">=14"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
"bugs": {
"url": "https://github.com/DanningtonSystems/cra-reactinnit/issues"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
"files": [
"template",
"template.json"
]
}
24 changes: 0 additions & 24 deletions src/assets/Core.js

This file was deleted.

38 changes: 0 additions & 38 deletions src/assets/css/Core.css

This file was deleted.

13 changes: 13 additions & 0 deletions template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"package": {
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"web-vitals": "^1.0.1"
},
"eslintConfig": {
"extends": ["react-app", "react-app/jest"]
}
}
}
13 changes: 13 additions & 0 deletions template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# React, innit?
This CRA app was created using the Reactinnit template. Learn more about Reactinnit on [GitHub](https://github.com/DanningtonSystems/cra-template-reactinnit).

## Usage

Create React App provides [documentation on how you can start and test your new application](https://create-react-app.dev/docs/available-scripts).

## Resources
- [Getting Started](https://create-react-app.dev/docs/getting-started) - The Getting Started guide for CRA-based projects.
- [Editor/IDE Tips](https://create-react-app.dev/docs/setting-up-your-editor) - A list of tips and tricks on how to configure your preferred text editor/IDE to work harmoniously with Create React App.
- [Client-side routing in React](https://reactrouter.com/web/guides/quick-start) - A quick-start guide for CSR (client side routing) in React using `react-router-dom`.
- [Deployment Tips](https://create-react-app.dev/docs/deployment) - Tips on how to deploy your Reactinnit-based app in production environments.
- [Creating PWAs](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) - A guide on how to create Progressive Web Apps using CRA.
23 changes: 23 additions & 0 deletions template/gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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

npm-debug.log*
yarn-debug.log*
yarn-error.log*
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
8 changes: 3 additions & 5 deletions src/index.js → template/src/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './assets/css/RootDOM.css';
import ReactTooltip from 'react-tooltip';
import Core from './assets/Core';
import './jsx/css/Root.css';
import Core from './jsx/Core';
import reportWebVitals from './reportWebVitals';

ReactDOM.render(
<React.StrictMode>
<Core />
<ReactTooltip className="Tooltip" />
</React.StrictMode>,
document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
reportWebVitals();
23 changes: 23 additions & 0 deletions template/src/jsx/Core.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import "./Core.css";

function App() {
return (
<div className="Core">
<header className="Core-Container">
<p>
This means that your React project is working! From here, you can begin coding. This page will reload when you save.
</p>
<a
className="Core-Link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
}

export default App;
18 changes: 18 additions & 0 deletions template/src/jsx/css/Core.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.Core {
text-align: center;
}

.Core-Contain {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.Core-Link {
color: #61dafb;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0a905b5

Please sign in to comment.