migrate frontend to docusaurus (#9014)

* delete loads of really important stuff that we definitely need

* v basic MVP smoosh docusaurus PoC into repo

* TODO

* delete more really important stuff

* TODO

* tidyup: use run-s

* don't redirect images used in frontend to raster proxy

* fix routing

* preserve the /endpoint link

* delete the blog (for now)

I would quite like to re-add this at some point
but its not really the top priority thing right now

* content edits

* appease the lint gods

* update danger rules

* remove placeholder

* cypress tests

* dockerhub --> ghcr

* Revert "dockerhub --> ghcr"

This reverts commit ef74cbb26b.

* downgrade lockfile format

* implement defs/BASE_URL

* fix e2e build

* actually fix cypress tests

* always run cypress tests on build

* this never worked

* add command for docusaurus:clear

* delete more code we don't need any more

* update ESLint/prettier config

* delete unsused exports

* documentation updates

* delete a fairly large chunk of our dependency tree

* allow base_url as build arg to Dockerfile

* fixup dockerfile

* work out base url at runtime if not set

doing this at image build time is not the right approach

* remove gatsby monorepo from closebot

* rename HomepageFeatures to homepage-features
This commit is contained in:
chris48s
2023-06-17 10:59:07 +01:00
committed by GitHub
parent 67d935492d
commit 50ea7068a8
92 changed files with 22922 additions and 31531 deletions

View File

@@ -4,7 +4,7 @@
The Shields codebase is divided into several parts:
1. The frontend (about 7% of the code)
1. The frontend
1. [`frontend`][frontend]
2. The badge renderer (which is available as an npm package)
1. [`badge-maker`][badge-maker]
@@ -30,16 +30,16 @@ The Shields codebase is divided into several parts:
The tests are also divided into several parts:
1. Unit and functional tests of the frontend
1. `frontend/**/*.spec.js`
2. Unit and functional tests of the badge renderer
1. Unit and functional tests of the badge renderer
1. `badge-maker/**/*.spec.js`
3. Unit and functional tests of the core code
2. Unit and functional tests of the core code
1. `core/**/*.spec.js`
4. Unit and functional tests of the service helper functions
3. Unit and functional tests of the service helper functions
1. `services/*.spec.js`
5. Unit and functional tests of the service code (we have only a few of these)
4. Unit and functional tests of the service code (we have only a few of these)
1. `services/*/**/*.spec.js`
5. End-to-end tests for the frontend
1. `cypress/e2e/*.cy.js`
6. The service tester and service test runner
1. [`core/service-test-runner`][service-test-runner]
7. [The service tests themselves][service tests] live integration tests of the

View File

@@ -155,13 +155,13 @@ These are documented in [server-secrets.md](./server-secrets.md)
If you want to host the frontend on a separate server, such as cloud storage
or a CDN, you can do that.
First, build the frontend, pointing `GATSBY_BASE_URL` to your server.
First, build the frontend, pointing `BASE_URL` to your server.
```sh
GATSBY_BASE_URL=https://your-server.example.com npm run build
BASE_URL=https://your-server.example.com npm run build
```
Then copy the contents of the `build/` folder to your static hosting / CDN.
Then copy the contents of the `public/` folder to your static hosting / CDN.
There are also a couple settings you should configure on the server.