Skip to content

Commit

Permalink
Merge branch 'master' into fix-react18-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
hokwanhung authored Jul 30, 2024
2 parents 04d8c3b + 43417ee commit 04b8460
Show file tree
Hide file tree
Showing 52 changed files with 2,634 additions and 10,544 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"prettier",
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh"],
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
};
41 changes: 21 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +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

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

23 changes: 0 additions & 23 deletions .prettierignore

This file was deleted.

4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{}
{
"tabWidth": 4
}
60 changes: 21 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,30 @@
# Form.io React Starter Application
# React + TypeScript + Vite

---
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

This is a starter application that uses React, Bootstrap, Webpack, and Form.io to create a powerful Serverless application.
This example uses Contexts and hooks to manage application state.
Currently, two official plugins are available:

## Installation
- [@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

- Download this application within your local machine and then type the following.
## Expanding the ESLint configuration

```
npm install
```

### Running

---

You can develop within this application by typing the following

```
npm start
```

This will launch the application locally @ https://localhost:3000. Now, whenever you make changes, those will be directly reflected within the launched application.
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

### Building
- Configure the top-level `parserOptions` property like this:

---

Once you have your application developed, it is now time to build the application for deployment. This can be done by typing the following.

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

This will generate the **build** folder which you can then use to install within any webserver, Github Page, an Amazon S3 bucket, etc.

### Commands

---

To see all available commands type the following

```
npm run
```
- 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
13 changes: 13 additions & 0 deletions 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="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Form.io React App Starter Kit</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
36 changes: 36 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,40 @@
"lint-staged": {
"**/*": "prettier --write --ignore-unknown"
}
=======
"name": "react-app-starterkit",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@formio/js": "5.0.0-dev.5621.91bd945",
"@formio/react": "6.0.0-dev.568.ced0fbd",
"@microlink/react-json-view": "^1.23.0",
"bootstrap": "^5.3.3",
"react": "^18.2.0",
"react-bootstrap": "^2.10.2",
"react-code-blocks": "^0.1.6",
"react-dom": "^18.2.0",
"react-router-dom": "^6.23.1"
},
"devDependencies": {
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"prettier": "^3.3.0",
"typescript": "^5.2.2",
"vite": "^5.2.0"
}
}
Binary file removed public/favicon.ico
Binary file not shown.
Binary file added public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 0 additions & 40 deletions public/index.html

This file was deleted.

Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions public/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions public/robots.txt

This file was deleted.

26 changes: 13 additions & 13 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
@import "~bootstrap/dist/css/bootstrap.css";
@import "~@formio/js/dist/formio.full.min.css";
@import "bootstrap/dist/css/bootstrap.css";
@import "@formio/js/dist/formio.full.min.css";

.nav-link a {
color: inherit;
text-decoration: none;
color: inherit;
text-decoration: none;
}

.formio-brand {
font-size: 1rem;
display: flex;
align-items: center;
font-size: 1rem;
display: flex;
align-items: center;
}

.formio-brand > * {
margin-right: 5px;
margin-right: 5px;
}

.navbar-brand a {
color: inherit;
text-decoration: none;
color: inherit;
text-decoration: none;
}

.react-logo {
color: #0a7ea3;
color: #0a7ea3;
}

div.spacer {
margin: 0.5rem 0;
line-height: 0;
margin: 0.5rem 0;
line-height: 0;
}
22 changes: 0 additions & 22 deletions src/App.js

This file was deleted.

8 changes: 0 additions & 8 deletions src/App.test.js

This file was deleted.

19 changes: 19 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import "./App.css";
import Navigation from "./components/Navigation";
import { Route, Routes } from "react-router-dom";
import Home from "./components/Home";
import Components from "./components/Components";

function App() {
return (
<div className="App">
<Navigation />
<Routes>
<Route path="/" element={<Home />}></Route>
<Route path="components" element={<Components />}></Route>
</Routes>
</div>
);
}

export default App;
Empty file removed src/MyForm.js
Empty file.
Loading

0 comments on commit 04b8460

Please sign in to comment.