Skip to content

Commit

Permalink
chore: make basic react app (#122)
Browse files Browse the repository at this point in the history
* chore: make basic react app

* fix: unused import
  • Loading branch information
darrenvechain authored Nov 30, 2023
1 parent 03c670a commit ace3923
Show file tree
Hide file tree
Showing 74 changed files with 1,156 additions and 8,161 deletions.
1 change: 0 additions & 1 deletion apps/sample-react-app/.env

This file was deleted.

18 changes: 18 additions & 0 deletions apps/sample-react-app/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
6 changes: 0 additions & 6 deletions apps/sample-react-app/.eslintrc.js

This file was deleted.

32 changes: 22 additions & 10 deletions apps/sample-react-app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
node_modules
.env
coverage
coverage.json
typechain
typechain-types
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Hardhat files
cache
artifacts
src/hardhat
node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
60 changes: 22 additions & 38 deletions apps/sample-react-app/README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,30 @@
# Getting Started with Create React App
# React + TypeScript + Vite

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

## Available Scripts
Currently, two official plugins are available:

In the project directory, you can run:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

### `npm start`
## Expanding the ESLint configuration

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

The page will reload if you make edits.\
You will also see any lint errors in the console.
- Configure the top-level `parserOptions` property like this:

### `npm test`
```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
};
```

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

### `npm run 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://create-react-app.dev/docs/deployment/) for more information.

### `npm run 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://create-react-app.dev/docs/getting-started/).

To learn React, check out the [React documentation](https://reactjs.org/).
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
85 changes: 0 additions & 85 deletions apps/sample-react-app/config-overrides.js

This file was deleted.

13 changes: 13 additions & 0 deletions apps/sample-react-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
95 changes: 17 additions & 78 deletions apps/sample-react-app/package.json
Original file line number Diff line number Diff line change
@@ -1,93 +1,32 @@
{
"name": "sample-app-react",
"name": "sameple-react-app",
"version": "0.0.0",
"private": true,
"homepage": ".",
"main": "src/index.js",
"type": "module",
"scripts": {
"build": "react-app-rewired build",
"clean": "rm -rf build .turbo cache",
"dev": "react-app-rewired start",
"eject": "react-app-rewired eject",
"lint": "eslint src --ext .js,.jsx,.ts,.tsx",
"purge": "yarn clean && rm -rf node_modules",
"start": "HTTPS=true react-app-rewired start",
"test": "echo 'Not yet testing'"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
"build": "tsc && vite build",
"dev": "vite",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@chakra-ui/react": "^2.8.1",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@heroicons/react": "^2.0.18",
"@vechain/connex": "2.1.0",
"@vechain/picasso": "^2.1.1",
"@vechain/web3-providers-connex": "^1.1.2",
"@vechainfoundation/dapp-kit": "*",
"@vechainfoundation/dapp-kit-react": "*",
"@vechainfoundation/dapp-kit-ui": "*",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"framer-motion": "3.10.6",
"https-browserify": "^1.0.0",
"os-browserify": "^0.3.0",
"process": "^0.11.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.4.2",
"react-scripts": "5.0.1",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"thor-devkit": "^2.0.9",
"url": "^0.11.3",
"web-vitals": "^2.1.2"
"vite-plugin-node-polyfills": "^0.17.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"@typechain/ethers-v6": "^0.4.0",
"@types/chai": "^4.2.0",
"@types/jest": "^27.0.3",
"@types/mocha": ">=9.1.0",
"@types/node": "^18.17.2",
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
"@types/testing-library__jest-dom": "^5.14.5",
"@vechain/repo-config": "https://github.com/vechainfoundation/repo-config#v0.0.1",
"chai": "^4.2.0",
"copy-webpack-plugin": "^11.0.0",
"customize-cra": "^1.0.0",
"ethers": "^6.4.0",
"filemanager-webpack-plugin": "^8.0.0",
"hardhat": "^2.18.2",
"hardhat-gas-reporter": "^1.0.8",
"mini-css-extract-plugin": "^2.7.6",
"react-app-rewired": "^2.2.1",
"solidity-coverage": "^0.8.1",
"ts-import-plugin": "^3.0.0",
"ts-loader": "^9.5.0",
"ts-node": "^10.9.1",
"tsconfig": "*",
"typechain": "^8.2.0",
"typescript": "4.9.5",
"webpack": "^5.88.2"
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@vitejs/plugin-react": "^4.2.0",
"eslint": "^8.53.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.4",
"typescript": "^5.2.2",
"vite": "^5.0.0"
}
}
Binary file removed apps/sample-react-app/public/favicon.ico
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
43 changes: 0 additions & 43 deletions apps/sample-react-app/public/index.html

This file was deleted.

Binary file removed apps/sample-react-app/public/logo192.png
Binary file not shown.
Binary file removed apps/sample-react-app/public/logo512.png
Binary file not shown.
Loading

0 comments on commit ace3923

Please sign in to comment.