Skip to content

Commit

Permalink
migrate frontend to docusaurus (#9014)
Browse files Browse the repository at this point in the history
* 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 ef74cbb.

* 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
  • Loading branch information
chris48s authored and calebcartwright committed Jun 17, 2023
1 parent 67d9354 commit bcfbaec
Show file tree
Hide file tree
Showing 94 changed files with 32,221 additions and 40,830 deletions.
47 changes: 14 additions & 33 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ extends:
- standard
- standard-jsx
- standard-react
- plugin:@typescript-eslint/recommended
- prettier
- eslint:recommended

Expand All @@ -18,7 +17,7 @@ settings:
react:
version: '16.8'
jsdoc:
mode: jsdoc
mode: typescript

plugins:
- chai-friendly
Expand All @@ -37,39 +36,33 @@ overrides:
# rules listed here are only ones which conflict.

- files:
- '**/*.js'
- '!frontend/**/*.js'
- 'badge-maker/**/*.js'
- '**/*.cjs'
env:
node: true
es6: true
rules:
no-console: 'off'
'@typescript-eslint/explicit-module-boundary-types': 'off'

- files:
- '**/*.@(ts|tsx)'
- '**/*.js'
- '!frontend/**/*.js'
- '!badge-maker/**/*.js'
env:
node: true
es6: true
parserOptions:
sourceType: 'module'
parser: '@typescript-eslint/parser'
rules:
# Argh.
'@typescript-eslint/explicit-function-return-type':
['error', { 'allowExpressions': true }]
'@typescript-eslint/no-empty-function': 'error'
'@typescript-eslint/no-var-requires': 'error'
'@typescript-eslint/no-object-literal-type-assertion': 'off'
'@typescript-eslint/no-explicit-any': 'error'
'@typescript-eslint/ban-ts-ignore': 'off'
'@typescript-eslint/explicit-module-boundary-types': 'off'
no-console: 'off'

- files:
- core/**/*.ts
- '**/*.ts'
parserOptions:
sourceType: 'module'
parser: '@typescript-eslint/parser'

- files:
- gatsby-browser.js
- 'frontend/**/*.@(js|ts|tsx)'
- 'frontend/**/*.js'
parserOptions:
sourceType: 'module'
env:
Expand Down Expand Up @@ -128,14 +121,6 @@ rules:
# Disable some rules from eslint:recommended.
no-empty: ['error', { 'allowEmptyCatch': true }]

# Allow unused parameters. In callbacks, removing them seems to obscure
# what the functions are doing.
'@typescript-eslint/no-unused-vars': ['error', { 'args': 'none' }]
no-unused-vars: 'off'

'@typescript-eslint/no-var-requires': 'off'

'@typescript-eslint/no-use-before-define': 'error'
no-use-before-define: 'off'

# These should be disabled by eslint-config-prettier, but are not.
Expand Down Expand Up @@ -197,11 +182,7 @@ rules:
jsdoc/require-returns-type: 'error'
jsdoc/valid-types: 'error'

# Disable some from TypeScript.
'@typescript-eslint/camelcase': off
'@typescript-eslint/explicit-function-return-type': 'off'
'@typescript-eslint/no-empty-function': 'off'

react/prop-types: 'off'
react/jsx-sort-props: 'error'
react-hooks/rules-of-hooks: 'error'
react-hooks/exhaustive-deps: 'error'
Expand Down
1 change: 0 additions & 1 deletion .github/actions/close-bot/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ function allChangelogLinesAreVersionBump(changelogLines) {

function isPointlessVersionBump(body) {
const pointlessBumpLinks = [
'https://github.com/gatsbyjs/gatsby',
'https://github.com/typescript-eslint/typescript-eslint',
]

Expand Down
31 changes: 0 additions & 31 deletions .github/actions/frontend-tests/action.yml

This file was deleted.

5 changes: 1 addition & 4 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@ jobs:
node-version: 16
cypress: true

- name: Frontend build
run: GATSBY_BASE_URL=http://localhost:8080 npm run build

- name: Run tests
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: npm run e2e-on-build
run: npm run e2e

- name: Archive videos
if: always()
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/test-frontend.yml

This file was deleted.

14 changes: 5 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ typings/

# Temporary build artifacts.
/build
.next
badge-examples.json
supported-features.json
service-definitions.yml
frontend/categories/*.yaml

# Local runtime configuration.
Expand All @@ -104,11 +100,6 @@ frontend/categories/*.yaml
# Template for the local runtime configuration.
!/config/local*.template.yml

# Gatsby
/frontend/.cache
/frontend/public
/public

# Cypress
/cypress/videos/
/cypress/screenshots/
Expand All @@ -121,3 +112,8 @@ flamegraph.html

# config file for node-pg-migrate
migrations-config.json

# Frontend/Docusaurus
frontend/.docusaurus
frontend/.cache-loader
/public
5 changes: 0 additions & 5 deletions .mocharc-frontend.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .nycrc-frontend.json

This file was deleted.

4 changes: 2 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ public
private/*.json
/.nyc_output
analytics.json
supported-features.json
service-definitions.yml
frontend/.docusaurus
frontend/categories
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ You can read a [tutorial on how to add a badge][tutorial].

When server source files change, the badge server should automatically restart
itself (using [nodemon][]). When the frontend files change, the frontend dev
server (`gatsby dev`) should also automatically reload. However the badge
server (`docusaurus start`) should also automatically reload. However the badge
definitions are built only before the server first starts. To regenerate those,
either run `npm run defs` or manually restart the server.

Expand Down
94 changes: 0 additions & 94 deletions core/badge-urls/make-badge-url.d.ts

This file was deleted.

Loading

0 comments on commit bcfbaec

Please sign in to comment.