Skip to content

Commit 1ce8d5e

Browse files
rickimooreantondlrjimmygchenAgeManning
authored
Feat: ssr refactor (#232)
Co-authored-by: antondlr <[email protected]> Co-authored-by: Jimmy Chen <[email protected]> Co-authored-by: Age Manning <[email protected]>
1 parent 83d5d49 commit 1ce8d5e

File tree

513 files changed

+18384
-17915
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

513 files changed

+18384
-17915
lines changed

.env.example

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
PORT=
2-
ELECTRON_START_URL=
3-
APPLE_ID=YOUR-APPLE-ID
4-
APPLE_PASSWORD=APP-SPECIFIC-PASSWORD
5-
APPLE_TEAM_ID=YOUR-TEAM-ID
1+
PORT=3000
2+
BACKEND_URL=http://127.0.0.1:3001
3+
BEACON_URL=http://your-BN-ip:5052
4+
VALIDATOR_URL=http://your-VC-ip:5062
5+
API_TOKEN=get-it-from-'.lighthouse/validators/api-token.txt'
6+
SESSION_PASSWORD="your-password"
7+
SSL_ENABLED=true

.eslintrc.json

Lines changed: 25 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,29 @@
11
{
2-
"env": {
3-
"browser": true,
4-
"es2021": true
5-
},
6-
"extends": [
7-
"eslint:recommended",
8-
"plugin:react/recommended",
9-
"plugin:@typescript-eslint/recommended",
10-
"prettier",
11-
"plugin:storybook/recommended"
2+
"plugins": ["@typescript-eslint", "import", "react-hooks", "unused-imports"],
3+
"extends": ["next/core-web-vitals"],
4+
"rules": {
5+
"@typescript-eslint/ban-ts-comment": "off",
6+
"import/order": [
7+
"error",
8+
{
9+
"alphabetize": {
10+
"order": "asc",
11+
"caseInsensitive": true
12+
}
13+
}
1214
],
13-
"overrides": [],
14-
"parser": "@typescript-eslint/parser",
15-
"parserOptions": {
16-
"ecmaVersion": "latest",
17-
"sourceType": "module"
18-
},
19-
"plugins": [
20-
"react",
21-
"@typescript-eslint",
22-
"prettier"
15+
"react-hooks/rules-of-hooks": "error",
16+
"react-hooks/exhaustive-deps": "off",
17+
"unused-imports/no-unused-imports": "error",
18+
"unused-imports/no-unused-vars": [
19+
"warn",
20+
{
21+
"vars": "all",
22+
"varsIgnorePattern": "^_",
23+
"args": "after-used",
24+
"argsIgnorePattern": "^_"
25+
}
2326
],
24-
"rules": {
25-
"react/react-in-jsx-scope": "off",
26-
"spaced-comment": "error",
27-
"quotes": [
28-
"error",
29-
"single"
30-
],
31-
"no-duplicate-imports": "error",
32-
"react/prop-types": 0,
33-
"@typescript-eslint/no-empty-function": "off",
34-
"@typescript-eslint/no-explicit-any": "off",
35-
"@typescript-eslint/no-unused-vars": [
36-
"error",
37-
{
38-
"argsIgnorePattern": "^_"
39-
}
40-
]
41-
},
42-
"settings": {
43-
"import/resolver": {
44-
"typescript": {}
45-
}
46-
}
27+
"react/react-in-jsx-scope": "off"
28+
}
4729
}

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ about: Create a report to help us improve
44
title: ''
55
labels: bug
66
assignees: rickimoore
7-
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
27+
28+
- OS: [e.g. iOS]
29+
- Browser [e.g. chrome, safari]
30+
- Version [e.g. 22]
3031

3132
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
33+
34+
- Device: [e.g. iPhone6]
35+
- OS: [e.g. iOS8.1]
36+
- Browser [e.g. stock browser, safari]
37+
- Version [e.g. 22]
3638

3739
**Additional context**
3840
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Suggest an idea for this project
44
title: ''
55
labels: enhancement
66
assignees: rickimoore
7-
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/workflows/docker.yml

Lines changed: 118 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,128 @@
11
name: docker
22

33
on:
4-
push:
5-
branches:
6-
- unstable
7-
- stable
8-
tags:
9-
- v*
4+
push:
5+
branches:
6+
- unstable
7+
- stable
8+
tags:
9+
- v*
1010

1111
env:
12-
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
13-
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
14-
IMAGE_NAME: ${{ secrets.DOCKER_USERNAME }}/siren
12+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
13+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
14+
IMAGE_NAME: ${{ secrets.DOCKER_USERNAME }}/siren
1515

1616
jobs:
17-
# Extract the VERSION which is either `latest` or `vX.Y.Z`, and the VERSION_SUFFIX
18-
# which is either empty or `-unstable`.
19-
#
20-
# It would be nice if the arch didn't get spliced into the version between `latest` and
21-
# `unstable`, but for now we keep the two parts of the version separate for backwards
22-
# compatibility.
23-
extract-version:
24-
runs-on: ubuntu-22.04
25-
steps:
26-
- name: Extract version (if stable)
27-
if: github.event.ref == 'refs/heads/stable'
28-
run: |
29-
echo "VERSION=latest" >> $GITHUB_ENV
30-
echo "VERSION_SUFFIX=" >> $GITHUB_ENV
31-
- name: Extract version (if unstable)
32-
if: github.event.ref == 'refs/heads/unstable'
33-
run: |
34-
echo "VERSION=latest" >> $GITHUB_ENV
35-
echo "VERSION_SUFFIX=-unstable" >> $GITHUB_ENV
36-
- name: Extract version (if tagged release)
37-
if: startsWith(github.event.ref, 'refs/tags')
38-
run: |
39-
echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
40-
echo "VERSION_SUFFIX=" >> $GITHUB_ENV
41-
outputs:
42-
VERSION: ${{ env.VERSION }}
43-
VERSION_SUFFIX: ${{ env.VERSION_SUFFIX }}
44-
build-html:
45-
name: build html
46-
runs-on: ubuntu-22.04
47-
needs: [extract-version]
48-
steps:
49-
- name: Checkout sources
50-
uses: actions/checkout@v4
51-
- name: Use node 18
52-
uses: actions/setup-node@v4
53-
with:
54-
node-version: 18
55-
cache: 'yarn'
56-
- name: Install dependencies
57-
env:
58-
NODE_ENV: development
59-
run: |
60-
yarn
61-
- name: Build Siren
62-
env:
63-
NODE_ENV: production
64-
run: yarn build
65-
- name: Upload artifact
66-
uses: actions/upload-artifact@v3
67-
with:
68-
name: html
69-
path: build/
70-
71-
build-docker-single-arch:
72-
name: build-docker-${{ matrix.binary }}
73-
runs-on: ubuntu-22.04
74-
strategy:
75-
matrix:
76-
binary: [aarch64, x86_64]
77-
78-
needs: [extract-version, build-html]
17+
# Extract the VERSION which is either `latest` or `vX.Y.Z`, and the VERSION_SUFFIX
18+
# which is either empty or `-unstable`.
19+
#
20+
# It would be nice if the arch didn't get spliced into the version between `latest` and
21+
# `unstable`, but for now we keep the two parts of the version separate for backwards
22+
# compatibility.
23+
extract-version:
24+
runs-on: ubuntu-22.04
25+
steps:
26+
- name: Extract version (if stable)
27+
if: github.event.ref == 'refs/heads/stable'
28+
run: |
29+
echo "VERSION=latest" >> $GITHUB_ENV
30+
echo "VERSION_SUFFIX=" >> $GITHUB_ENV
31+
- name: Extract version (if unstable)
32+
if: github.event.ref == 'refs/heads/unstable'
33+
run: |
34+
echo "VERSION=latest" >> $GITHUB_ENV
35+
echo "VERSION_SUFFIX=-unstable" >> $GITHUB_ENV
36+
- name: Extract version (if tagged release)
37+
if: startsWith(github.event.ref, 'refs/tags')
38+
run: |
39+
echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
40+
echo "VERSION_SUFFIX=" >> $GITHUB_ENV
41+
outputs:
42+
VERSION: ${{ env.VERSION }}
43+
VERSION_SUFFIX: ${{ env.VERSION_SUFFIX }}
44+
build-html:
45+
name: build html
46+
runs-on: ubuntu-22.04
47+
needs: [extract-version]
48+
steps:
49+
- name: Checkout sources
50+
uses: actions/checkout@v4
51+
- name: Use node 18
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: 18
55+
cache: 'yarn'
56+
- name: Install dependencies
7957
env:
80-
# We need to enable experimental docker features in order to use `docker buildx`
81-
DOCKER_CLI_EXPERIMENTAL: enabled
82-
VERSION: ${{ needs.extract-version.outputs.VERSION }}
83-
VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }}
84-
steps:
85-
- uses: actions/checkout@v4
86-
- uses: docker/setup-qemu-action@v3
87-
- name: Dockerhub login
88-
run: |
89-
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
90-
- name: Map aarch64 to arm64 short arch
91-
if: startsWith(matrix.binary, 'aarch64')
92-
run: echo "SHORT_ARCH=arm64" >> $GITHUB_ENV
93-
- name: Map x86_64 to amd64 short arch
94-
if: startsWith(matrix.binary, 'x86_64')
95-
run: echo "SHORT_ARCH=amd64" >> $GITHUB_ENV;
96-
- name: Download artifacts
97-
uses: actions/download-artifact@v3
98-
with:
99-
name: html
100-
path: html/
101-
- name: Build Dockerfile and push
102-
run: |
103-
docker buildx build \
104-
--platform=linux/${SHORT_ARCH} \
105-
--file ./Dockerfile.release . \
106-
--tag ${IMAGE_NAME}:${VERSION}-${SHORT_ARCH}${VERSION_SUFFIX} \
107-
--provenance=false \
108-
--push
109-
110-
build-docker-multiarch:
111-
name: build-docker-multiarch
112-
runs-on: ubuntu-22.04
113-
needs: [build-docker-single-arch, extract-version]
58+
NODE_ENV: development
59+
run: |
60+
yarn
61+
- name: Build Siren
11462
env:
115-
# We need to enable experimental docker features in order to use `docker manifest`
116-
DOCKER_CLI_EXPERIMENTAL: enabled
117-
VERSION: ${{ needs.extract-version.outputs.VERSION }}
118-
VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }}
119-
steps:
120-
- name: Dockerhub login
121-
run: |
122-
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
123-
- name: Create and push multiarch manifest
124-
run: |
125-
docker manifest create ${IMAGE_NAME}:${VERSION}${VERSION_SUFFIX} \
126-
--amend ${IMAGE_NAME}:${VERSION}-arm64${VERSION_SUFFIX} \
127-
--amend ${IMAGE_NAME}:${VERSION}-amd64${VERSION_SUFFIX};
128-
docker manifest push ${IMAGE_NAME}:${VERSION}${VERSION_SUFFIX}
63+
NODE_ENV: production
64+
run: yarn build
65+
- name: Upload artifact
66+
uses: actions/upload-artifact@v3
67+
with:
68+
name: html
69+
path: build/
70+
71+
build-docker-single-arch:
72+
name: build-docker-${{ matrix.binary }}
73+
runs-on: ubuntu-22.04
74+
strategy:
75+
matrix:
76+
binary: [aarch64, x86_64]
77+
78+
needs: [extract-version, build-html]
79+
env:
80+
# We need to enable experimental docker features in order to use `docker buildx`
81+
DOCKER_CLI_EXPERIMENTAL: enabled
82+
VERSION: ${{ needs.extract-version.outputs.VERSION }}
83+
VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }}
84+
steps:
85+
- uses: actions/checkout@v4
86+
- uses: docker/setup-qemu-action@v3
87+
- name: Dockerhub login
88+
run: |
89+
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
90+
- name: Map aarch64 to arm64 short arch
91+
if: startsWith(matrix.binary, 'aarch64')
92+
run: echo "SHORT_ARCH=arm64" >> $GITHUB_ENV
93+
- name: Map x86_64 to amd64 short arch
94+
if: startsWith(matrix.binary, 'x86_64')
95+
run: echo "SHORT_ARCH=amd64" >> $GITHUB_ENV;
96+
- name: Download artifacts
97+
uses: actions/download-artifact@v3
98+
with:
99+
name: html
100+
path: html/
101+
- name: Build Dockerfile and push
102+
run: |
103+
docker buildx build \
104+
--platform=linux/${SHORT_ARCH} \
105+
--file ./Dockerfile.release . \
106+
--tag ${IMAGE_NAME}:${VERSION}-${SHORT_ARCH}${VERSION_SUFFIX} \
107+
--provenance=false \
108+
--push
129109
110+
build-docker-multiarch:
111+
name: build-docker-multiarch
112+
runs-on: ubuntu-22.04
113+
needs: [build-docker-single-arch, extract-version]
114+
env:
115+
# We need to enable experimental docker features in order to use `docker manifest`
116+
DOCKER_CLI_EXPERIMENTAL: enabled
117+
VERSION: ${{ needs.extract-version.outputs.VERSION }}
118+
VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }}
119+
steps:
120+
- name: Dockerhub login
121+
run: |
122+
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
123+
- name: Create and push multiarch manifest
124+
run: |
125+
docker manifest create ${IMAGE_NAME}:${VERSION}${VERSION_SUFFIX} \
126+
--amend ${IMAGE_NAME}:${VERSION}-arm64${VERSION_SUFFIX} \
127+
--amend ${IMAGE_NAME}:${VERSION}-amd64${VERSION_SUFFIX};
128+
docker manifest push ${IMAGE_NAME}:${VERSION}${VERSION_SUFFIX}

0 commit comments

Comments
 (0)