Skip to content

Commit

Permalink
Update readme with new commands and slight cleanup #1379
Browse files Browse the repository at this point in the history
  • Loading branch information
joelvdavies committed Mar 15, 2024
1 parent 7cebf93 commit a0275df
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
sudo apt-get install libgconf-2-4
yarn --immutable
- name: Run linting
run: yarn lint:js
run: yarn lint
- name: Run unit tests
run: yarn test
- name: Upload unit test coverage
Expand Down
41 changes: 16 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,38 @@ The SciGateway application offers features such as authentication and authorisat

## Code details

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
This project uses [Vite](https://vitejs.dev/).

#### Available Scripts

In the project directory, you can run:

#### `yarn start`
### `yarn dev`

Runs the app in the development mode.<br>
Runs the `dev` script, which runs the app in development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br>
You will also see any lint errors in the console.
### `yarn test`

#### `yarn test`
Runs unit tests

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

#### `yarn build`
Runs e2e tests

Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.
### `yarn lint`

The build is minified and the filenames include the hashes.<br>
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`
Lints all code under /src

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

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.
Builds the app for production to the `dist` folder.

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.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

### Learn More
See the section about [building for production](https://vitejs.dev/guide/build.html) for more information.

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

To learn React, check out the [React documentation](https://reactjs.org/).
Deploys a static version of the build from the `dist` directory to port 5001. Use `yarn preview:build` to build and preview it in SciGateway.
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,16 @@
"build": "tsc --project tsconfig.build.json && vite build",
"preview": "vite preview",
"preview:build": "yarn build && yarn preview",
"lint:js": "eslint --max-warnings=0 --ext=tsx --ext=ts --ext=js --ext=jsx --fix ./src",
"test": "vitest --coverage",
"lint": "eslint --max-warnings=0 --ext=tsx --ext=ts --ext=js --ext=jsx --fix ./src",
"lint:cypress": "eslint --ext=tsx --ext=js --ext=jsx --fix ./cypress",
"serve:plugins": "node micro-frontend-tools/serve-plugins.js",
"start": "cross-env concurrently \"yarn serve:plugins\" \"node server/auth-server.js\" \"react-scripts start\"",
"build:e2e": "cross-env GENERATE_SOURCEMAP=false yarn build",
"test": "vitest --coverage",
"test:watch": "react-scripts test --env=jsdom --watch",
"e2e:serve": "yarn build:e2e && concurrently \"node server/auth-server.js e2e\" \"node ./server/e2e-test-server.js\"",
"e2e:interactive": "start-server-and-test e2e:serve http://localhost:3000 cy:open",
"e2e": "start-server-and-test e2e:serve http://localhost:3000 cy:run",
"cy:open": "cypress open",
"cy:run": "cypress run",
"eject": "react-scripts eject",
"postinstall": "husky install; yarn copy-cdn-fallbacks",
"copy-cdn-fallbacks": "node -e \"const fs = require('fs'); fs.copyFile('node_modules/react/umd/react.production.min.js', 'public/react.production.min.js', (err) => { if (err) throw err;}); fs.copyFile('node_modules/react-dom/umd/react-dom.production.min.js', 'public/react-dom.production.min.js', (err) => { if (err) throw err;});\""
},
Expand Down
1 change: 0 additions & 1 deletion src/react-app-env.d.ts

This file was deleted.

0 comments on commit a0275df

Please sign in to comment.