Skip to content

Commit

Permalink
Merge pull request #370 from USEPA/feature/restore-create-react-app-s…
Browse files Browse the repository at this point in the history
…etup

Feature/restore create react app setup
  • Loading branch information
courtneymyers authored Oct 6, 2023
2 parents f69deb3 + 59d7cc1 commit d3f509f
Show file tree
Hide file tree
Showing 39 changed files with 38,197 additions and 8,121 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ jobs:
- name: Build front-end files and move to server
run: |
PUBLIC_URL="$SERVER_URL" \
VITE_SERVER_BASE_PATH="$SERVER_BASE_PATH" \
VITE_CLOUD_SPACE="$CLOUD_SPACE" \
VITE_FORMIO_BASE_URL="$FORMIO_BASE_URL" \
VITE_FORMIO_PROJECT_NAME="$FORMIO_PROJECT_NAME" \
REACT_APP_SERVER_BASE_PATH="$SERVER_BASE_PATH" \
REACT_APP_CLOUD_SPACE="$CLOUD_SPACE" \
REACT_APP_FORMIO_BASE_URL="$FORMIO_BASE_URL" \
REACT_APP_FORMIO_PROJECT_NAME="$FORMIO_PROJECT_NAME" \
npm run build
rm ../server/app/public/index.html
cd build
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ jobs:
- name: Build front-end files and move to server
run: |
PUBLIC_URL="$SERVER_URL" \
VITE_SERVER_BASE_PATH="$SERVER_BASE_PATH" \
VITE_CLOUD_SPACE="$CLOUD_SPACE" \
VITE_FORMIO_BASE_URL="$FORMIO_BASE_URL" \
VITE_FORMIO_PROJECT_NAME="$FORMIO_PROJECT_NAME" \
REACT_APP_SERVER_BASE_PATH="$SERVER_BASE_PATH" \
REACT_APP_CLOUD_SPACE="$CLOUD_SPACE" \
REACT_APP_FORMIO_BASE_URL="$FORMIO_BASE_URL" \
REACT_APP_FORMIO_PROJECT_NAME="$FORMIO_PROJECT_NAME" \
npm run build
rm ../server/app/public/index.html
cd build
Expand Down
8 changes: 4 additions & 4 deletions app/client/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NOTE: For local development, set `VITE_FORMIO_BASE_URL` and
# `VITE_FORMIO_PROJECT_NAME` to the same values used in the server app's
# NOTE: For local development, set `REACT_APP_FORMIO_BASE_URL` and
# `REACT_APP_FORMIO_PROJECT_NAME` to the same values used in the server app's
# `FORMIO_BASE_URL` and `FORMIO_PROJECT_NAME` env variables. When deployed, a
# GitHub Actions Workflow does this in the "build" npm script.
VITE_FORMIO_BASE_URL=
VITE_FORMIO_PROJECT_NAME=
REACT_APP_FORMIO_BASE_URL=
REACT_APP_FORMIO_PROJECT_NAME=
21 changes: 0 additions & 21 deletions app/client/.eslintrc.cjs

This file was deleted.

57 changes: 38 additions & 19 deletions app/client/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,46 @@
# React + TypeScript + Vite
# Getting Started with Create React App

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

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

- [@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
In the project directory, you can run:

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

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

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

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

- 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
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.

### `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://facebook.github.io/create-react-app/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://facebook.github.io/create-react-app/docs/getting-started).

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

0 comments on commit d3f509f

Please sign in to comment.