1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

Compare commits

...

130 Commits

Author SHA1 Message Date
8ecfeca50d chore(release): 1.3.6 [skip ci] 2021-09-09 08:15:20 +00:00
fd0740d12a fix: add text that I'm a student at University 2021-09-09 10:08:42 +02:00
bd2dc9c9af build(deps-dev): bump babel-jest from 27.1.0 to 27.1.1 (#212) 2021-09-09 08:46:48 +02:00
a53888ab42 build(deps-dev): bump @types/node from 16.7.13 to 16.9.0 (#213) 2021-09-09 08:46:16 +02:00
624e79eecd build(deps-dev): bump jest from 27.1.0 to 27.1.1 (#214) 2021-09-09 08:46:02 +02:00
049ec367fc build(deps-dev): bump tailwindcss from 2.2.11 to 2.2.14 (#211) 2021-09-08 21:27:01 +02:00
56f22d0c9b build(deps-dev): bump tailwindcss from 2.2.9 to 2.2.11 (#207) 2021-09-08 21:17:25 +02:00
9adb67662e build(deps-dev): bump @types/node from 16.7.10 to 16.7.13 (#208) 2021-09-08 21:17:14 +02:00
010087088f build(deps): bump html-react-parser from 1.2.8 to 1.3.0 (#209) 2021-09-08 21:17:00 +02:00
35d4396e80 build(deps): bump sharp from 0.29.0 to 0.29.1 (#210) 2021-09-08 21:16:48 +02:00
934118737a build(deps-dev): bump @typescript-eslint/eslint-plugin (#204) 2021-09-08 21:16:31 +02:00
b692dac926 build(deps): bump crazy-max/ghaction-import-gpg from 3.2.0 to 4 (#200)
Co-authored-by: Divlo <contact@divlo.fr>
2021-09-06 16:37:10 +02:00
dd582652ab build(deps-dev): bump @types/react from 17.0.19 to 17.0.20 (#201) 2021-09-06 16:28:01 +02:00
337352de0c build(deps-dev): bump @semantic-release/git from 9.0.0 to 9.0.1 (#202) 2021-09-06 16:27:44 +02:00
c513268cbb build(deps-dev): bump autoprefixer from 10.3.3 to 10.3.4 (#199) 2021-09-03 09:54:38 +02:00
4fdcb2b667 build(deps-dev): bump start-server-and-test from 1.13.1 to 1.14.0 (#198) 2021-09-03 09:54:17 +02:00
377b8e91a6 chore(release): 1.3.5 [skip ci] 2021-09-01 22:17:55 +00:00
fce29c9d4a build(deps): update latest 2021-09-02 00:13:20 +02:00
c198f47aa9 build(deps-dev): eslint-config-standard-with-typescript to 21.0.1 (#195) 2021-09-01 16:38:44 +02:00
8e051332cd build(deps-dev): bump @typescript-eslint/eslint-plugin to 4.30.0 (#197) 2021-09-01 16:37:39 +02:00
9f3436e1df build(deps-dev): bump tailwindcss from 2.2.8 to 2.2.9 (#196) 2021-09-01 16:37:17 +02:00
2f2373e62f build(deps-dev): bump cypress from 8.3.0 to 8.3.1 (#187) 2021-09-01 16:36:12 +02:00
c6b455dd10 build(deps-dev): bump eslint-plugin-prettier from 3.4.1 to 4.0.0 (#189) 2021-09-01 16:35:35 +02:00
4e089b41f2 build(deps-dev): bump @types/node from 16.7.2 to 16.7.10 (#193) 2021-09-01 16:35:19 +02:00
6c102b1b35 build(deps-dev): bump eslint-config-next from 11.1.0 to 11.1.2 (#194) 2021-09-01 16:35:03 +02:00
52b10944b7 build(deps): bump next from 11.1.0 to 11.1.2 (#192) 2021-09-01 16:34:50 +02:00
db36eb3e7a build(deps-dev): bump jest from 27.0.6 to 27.1.0 (#185) 2021-08-27 12:45:18 +02:00
c739ad951d build(deps-dev): bump babel-jest from 27.0.6 to 27.1.0 (#184) 2021-08-27 12:45:07 +02:00
2802ff029f build(deps-dev): bump tailwindcss from 2.2.7 to 2.2.8 (#182) 2021-08-27 12:43:05 +02:00
1a7457b44b build(deps-dev): bump @types/node from 16.7.1 to 16.7.2 (#183) 2021-08-27 12:41:56 +02:00
ff210f879d build(deps-dev): bump semantic-release from 17.4.6 to 17.4.7 (#178) 2021-08-27 12:41:43 +02:00
607454b360 build(deps-dev): bump eslint-plugin-import from 2.24.1 to 2.24.2 (#176) 2021-08-27 12:41:29 +02:00
d1522fbf44 build(deps): bump node from 16.7.0 to 16.8.0 (#179) 2021-08-27 12:41:06 +02:00
b82eae7499 build(deps-dev): bump autoprefixer from 10.3.2 to 10.3.3 (#181) 2021-08-27 12:40:52 +02:00
73527ce8fe build(deps-dev): bump husky from 7.0.1 to 7.0.2 (#177) 2021-08-27 12:40:30 +02:00
0cd885ee70 build(deps-dev): bump typescript from 4.3.5 to 4.4.2 (#180) 2021-08-27 12:40:16 +02:00
2cb2df975f build(deps-dev): bump @typescript-eslint/eslint-plugin to 4.29.3 (#175) 2021-08-24 02:30:24 +02:00
37f5843adb build(deps-dev): bump semantic-release from 17.4.5 to 17.4.6 (#174) 2021-08-24 02:30:06 +02:00
d794d38f14 test(e2e): visible instead of exist 2021-08-23 19:48:15 +02:00
fc5ba28b8a perf: remove unnecessary fonts weight 2021-08-23 19:41:39 +02:00
b5945150b8 fix: remove Hyper Terminal from tools used 2021-08-23 19:25:17 +02:00
aa12d626d2 perf: uses-responsive-images 2021-08-23 19:17:30 +02:00
6ac4782b7d build(deps-dev): bump @types/node from 16.6.2 to 16.7.1 (#171) 2021-08-23 12:00:52 +02:00
0aa998d593 build(deps-dev): bump eslint-plugin-prettier from 3.4.0 to 3.4.1 (#172) 2021-08-23 12:00:39 +02:00
56f975e53c build(deps-dev): bump autoprefixer from 10.3.1 to 10.3.2 (#173) 2021-08-23 12:00:26 +02:00
5a16d24ea1 build(deps-dev): bump eslint-plugin-import from 2.24.0 to 2.24.1 (#170) 2021-08-20 10:37:53 +02:00
52267005ec build(deps-dev): bump @types/react from 17.0.18 to 17.0.19 (#169) 2021-08-20 10:37:38 +02:00
99b9b12ac9 build(deps-dev): bump @types/node from 16.6.1 to 16.6.2 (#168) 2021-08-19 10:56:35 +02:00
2cae77481f build(deps): bump node from 16.6.2 to 16.7.0 (#167) 2021-08-19 10:55:46 +02:00
e98b47a459 build(deps): bump sharp from 0.28.3 to 0.29.0 (#166) 2021-08-18 11:26:24 +02:00
4cc87758c1 build(deps): bump next-pwa from 5.2.24 to 5.3.1 (#164) 2021-08-17 20:49:12 +02:00
1bb0f31223 build(deps-dev): bump @typescript-eslint/eslint-plugin (#165) 2021-08-17 20:48:56 +02:00
af2dd0bd60 build(deps-dev): bump cypress from 8.2.0 to 8.3.0 (#163) 2021-08-17 20:48:39 +02:00
63d7485c8d build(deps): bump next-pwa from 5.3.0 to 5.2.24 2021-08-16 15:38:56 +02:00
74fde0ea40 build(deps): update latest version 2021-08-16 15:31:35 +02:00
0d2b318818 build(deps): bump node from 16.6.1 to 16.6.2 (#155) 2021-08-13 15:50:10 +02:00
266b3f8589 test: add cypress e2e (#159) 2021-08-13 15:48:29 +02:00
f7d304ca80 build(deps): bump read-pkg from 5.2.0 to 6.0.0 (#136) 2021-08-12 11:03:37 +02:00
63017953d7 chore(release): 1.3.4 [skip ci] 2021-08-11 23:29:15 +00:00
20600eb976 build(deps): bump crazy-max/ghaction-import-gpg from 3.1.0 to 3.2.0 (#154) 2021-08-12 01:21:54 +02:00
7f920b77aa build(deps): bump actions/setup-node from 2.3.1 to 2.4.0 (#152) 2021-08-12 01:21:40 +02:00
4f5dfc63ea perf: reduce build size + add next-secure-headers 2021-08-12 01:19:11 +02:00
712805df93 build(deps): bump actions/setup-node from 2.3.0 to 2.3.1 (#144) 2021-08-04 10:39:56 +02:00
cd68f597c9 build(deps-dev): bump @typescript-eslint/eslint-plugin (#143) 2021-08-04 10:39:35 +02:00
7ec3fe8ced build(deps-dev): bump eslint from 7.31.0 to 7.32.0 (#141) 2021-08-04 10:39:12 +02:00
90d22b2c7f build(deps-dev): bump @types/node from 16.4.7 to 16.4.10 (#142) 2021-08-04 10:38:47 +02:00
4b06fd0522 build(deps): bump node from 16.5.0 to 16.6.1 (#145) 2021-08-04 10:38:28 +02:00
b4427f36c2 build(deps): bump @fortawesome/react-fontawesome to 0.1.15 (#146) 2021-08-04 10:38:07 +02:00
b758c64e02 build(deps-dev): bump @types/node from 16.4.6 to 16.4.7 (#139) 2021-07-30 07:21:41 +02:00
04469b83ea build(deps-dev): bump @types/node from 16.4.4 to 16.4.6 (#138) 2021-07-29 08:16:05 +02:00
36d54666a0 build(deps-dev): bump @types/node from 16.4.3 to 16.4.4 (#137) 2021-07-28 08:17:45 +02:00
a34cefec6e chore(release): set correctly env [skip ci] 2021-07-27 21:34:08 +02:00
5c343395df chore(release): 1.3.3 [skip ci] 2021-07-27 19:06:15 +00:00
028815a7b6 fix: sign release commit and backmerge to develop 2021-07-27 21:01:33 +02:00
a2ad591d6d chore(release): 1.3.2 [skip ci] 2021-07-27 18:04:31 +00:00
7087911756 ci(release): add GH_TOKEN 2021-07-27 20:01:21 +02:00
35b1c4169f ci(release): persist-credentials: false 2021-07-27 19:52:24 +02:00
4c351b8179 chore: update message of release commit 2021-07-27 19:35:08 +02:00
701dccc018 fix: include version in release 2021-07-27 19:26:08 +02:00
5133765f94 chore: add Vercel CLI 2021-07-27 19:00:21 +02:00
3b208c6614 fix: disable hover:underline on link of Respository (open source) 2021-07-27 18:31:41 +02:00
52870fd6a4 fix: replace facebook/jest to vercel/styled-jsx 2021-07-27 11:44:44 +00:00
3a278fec10 feat: add version number in footer 2021-07-27 11:36:35 +00:00
669f592a9f build(deps-dev): bump @typescript-eslint/eslint-plugin (#135) 2021-07-27 11:02:51 +02:00
9c0a3ea1af build(deps-dev): bump @types/react from 17.0.14 to 17.0.15 (#134) 2021-07-26 06:50:08 +02:00
fa8d70bf82 build(deps-dev): bump @commitlint/cli from 12.1.4 to 13.1.0 (#129) 2021-07-26 06:49:55 +02:00
3293fd488e build(deps-dev): bump lint-staged from 11.1.0 to 11.1.1 (#130) 2021-07-26 06:49:39 +02:00
426bee09da build(deps-dev): bump tailwindcss from 2.2.6 to 2.2.7 (#133) 2021-07-26 06:49:16 +02:00
dbc6c84895 build(deps-dev): bump @commitlint/config-conventional to 13.1.0 (#128) 2021-07-26 06:48:57 +02:00
fab539c9d7 build(deps-dev): bump @types/node from 16.4.1 to 16.4.3 (#132) 2021-07-26 06:48:32 +02:00
176ab64a37 build(deps-dev): bump markdownlint-cli from 0.27.1 to 0.28.1 (#131) 2021-07-26 06:48:10 +02:00
1b56bbc694 build(deps-dev): bump @types/node from 16.4.0 to 16.4.1 (#126) 2021-07-23 08:11:04 +02:00
0f9a968081 build(deps-dev): bump lint-staged from 11.0.1 to 11.1.0 (#127) 2021-07-23 08:10:52 +02:00
6b9ff4100d build(deps-dev): bump tailwindcss from 2.2.4 to 2.2.6 (#124) 2021-07-22 07:57:57 +02:00
870bc3d26b build(deps-dev): bump postcss from 8.3.5 to 8.3.6 (#125) 2021-07-22 07:55:45 +02:00
41e4b93427 build(deps-dev): bump @typescript-eslint/eslint-plugin (#120) 2021-07-21 12:57:31 +02:00
72ae4ef01d build(deps): bump next-pwa from 5.2.23 to 5.2.24 (#121) 2021-07-21 12:57:20 +02:00
748259b57c build(deps): bump actions/setup-node from 2.2.0 to 2.3.0 (#122) 2021-07-21 12:57:09 +02:00
fafd606c18 build(deps-dev): bump @types/node from 16.3.3 to 16.4.0 (#123) 2021-07-21 12:56:56 +02:00
b8c3022532 build(deps-dev): bump @types/node from 16.3.2 to 16.3.3 (#119) 2021-07-19 11:32:26 +02:00
46adaee53f build(deps-dev): bump eslint from 7.30.0 to 7.31.0 (#118) 2021-07-19 11:32:04 +02:00
508114152c build(deps-dev): bump @types/node from 16.3.1 to 16.3.2 (#116) 2021-07-15 17:19:26 +02:00
b2852d172c build(deps-dev): bump lint-staged from 11.0.0 to 11.0.1 (#115) 2021-07-15 17:19:13 +02:00
16e3b1e465 build(deps): bump node from 16.4.2 to 16.5.0 (#117) 2021-07-15 17:19:01 +02:00
ae610ff816 build(deps-dev): bump @typescript-eslint/eslint-plugin to 4.28.3 (#114) 2021-07-13 23:24:17 +02:00
7c001f3c30 build(deps-dev): bump autoprefixer from 10.3.0 to 10.3.1 (#113) 2021-07-13 23:18:52 +02:00
7eada755e1 build(deps-dev): bump autoprefixer from 10.2.6 to 10.3.0 (#112) 2021-07-12 13:28:27 +02:00
6909304f15 build(deps-dev): bump @types/node from 16.0.3 to 16.3.1 (#111) 2021-07-10 19:07:50 +02:00
25b2f05170 build(deps-dev): bump @types/react from 17.0.13 to 17.0.14 (#107) 2021-07-10 19:06:30 +02:00
0cc83a811c build(deps): bump node from 16.4.0 to 16.4.2 (#106) 2021-07-10 19:06:10 +02:00
78b14c2620 build(deps-dev): bump @types/node from 16.0.0 to 16.0.3 (#110) 2021-07-10 19:05:51 +02:00
eebdf0edd2 build(deps): bump @fontsource/montserrat from 4.4.5 to 4.5.0 (#109) 2021-07-10 19:05:40 +02:00
62e8005081 build(deps-dev): bump @types/jest from 26.0.23 to 26.0.24 (#105) 2021-07-07 19:04:04 +02:00
6473e9da7d build(deps-dev): bump husky from 7.0.0 to 7.0.1 (#104) 2021-07-07 19:03:52 +02:00
1805997f59 build(deps): bump node from 16.3.0 to 16.4.0 (#103) 2021-07-07 19:03:39 +02:00
fb25c12883 build(deps-dev): bump @typescript-eslint/eslint-plugin to 4.28.2 (#102) 2021-07-06 09:02:07 +02:00
849b758fab build(deps): bump next-pwa to 5.2.23 (#101) 2021-07-06 09:01:44 +02:00
ccf5d42c19 feat: add Open source section 2021-07-04 19:56:05 +02:00
2d68ce59ca docs(readme): usage of json instead of TypeScript (About) 2021-07-04 15:42:52 +02:00
4e6531e341 build(deps-dev): bump @types/react from 17.0.11 to 17.0.13 (#98) 2021-07-02 10:39:07 +02:00
8f2d0817ce build(deps-dev): bump husky from 6.0.0 to 7.0.0 (#99) 2021-07-02 10:38:56 +02:00
7674401e7c build(deps-dev): bump @types/node from 15.12.5 to 15.14.0 (#100) 2021-07-02 10:37:50 +02:00
61983dfc4a build(deps): bump actions/setup-node from 2.1.5 to 2.2.0 (#96) 2021-07-01 09:14:38 +02:00
ed47407b7d build(deps-dev): bump typescript from 4.3.4 to 4.3.5 (#97) 2021-07-01 09:00:18 +02:00
0a79754978 build(deps-dev): bump babel-jest to 27.0.6 (#94) 2021-06-29 11:40:39 +02:00
725afecbf3 build(deps-dev): bump jest to 27.0.6 (#95) 2021-06-29 11:39:23 +02:00
1bf79e55e1 build(deps-dev): bump @typescript-eslint/eslint-plugin to 4.28.1 (#93) 2021-06-29 11:38:57 +02:00
3a369c49fa build(deps-dev): bump prettier from 2.3.1 to 2.3.2 (#90) 2021-06-28 12:03:12 +02:00
e78ccf3db4 build(deps-dev): bump @types/node from 15.12.4 to 15.12.5 (#91) 2021-06-28 12:02:52 +02:00
acafe71f31 build(deps): bump next-themes from 0.0.14 to 0.0.15 (#92) 2021-06-28 12:02:15 +02:00
53 changed files with 8615 additions and 8131 deletions

View File

@ -1,3 +1,14 @@
{ {
"presets": ["next/babel"] "presets": [
[
"next/babel",
{
"preset-env": {
"targets": {
"browsers": ">1%, not ie 11, not dead"
}
}
}
]
]
} }

View File

@ -9,3 +9,4 @@ tmp
temp temp
.DS_Store .DS_Store
.lighthouseci .lighthouseci
.vercel

View File

@ -4,3 +4,4 @@ node_modules
next-env.d.ts next-env.d.ts
**/workbox-*.js **/workbox-*.js
**/sw.js **/sw.js
.vercel

View File

@ -5,7 +5,7 @@
"next/core-web-vitals", "next/core-web-vitals",
"prettier" "prettier"
], ],
"plugins": ["prettier"], "plugins": ["unicorn", "prettier"],
"parserOptions": { "parserOptions": {
"project": "./tsconfig.json" "project": "./tsconfig.json"
}, },
@ -15,6 +15,17 @@
"jest": true "jest": true
}, },
"rules": { "rules": {
"prettier/prettier": "error" "prettier/prettier": "error",
"unicorn/prefer-node-protocol": "error",
"unicorn/prevent-abbreviations": [
"error",
{
"replacements": {
"props": {
"properties": false
}
}
}
]
} }
} }

View File

@ -32,18 +32,13 @@ jobs:
- uses: 'actions/checkout@v2.3.4' - uses: 'actions/checkout@v2.3.4'
- name: 'Use Node.js' - name: 'Use Node.js'
uses: 'actions/setup-node@v2.1.5' uses: 'actions/setup-node@v2.4.0'
with: with:
node-version: '16.x' node-version: '16.x'
cache: 'npm'
- name: 'Cache dependencies'
uses: 'actions/cache@v2.1.6'
with:
path: '.npm'
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: 'Install' - name: 'Install'
run: 'npm ci --cache .npm --prefer-offline' run: 'npm install'
- run: 'npm run lint:commit -- --to "${{ github.sha }}"' - run: 'npm run lint:commit -- --to "${{ github.sha }}"'
- run: 'npm run lint:docker' - run: 'npm run lint:docker'
@ -51,77 +46,101 @@ jobs:
- run: 'npm run lint:markdown' - run: 'npm run lint:markdown'
- run: 'npm run lint:typescript' - run: 'npm run lint:typescript'
build: test-unit:
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
steps: steps:
- uses: 'actions/checkout@v2.3.4' - uses: 'actions/checkout@v2.3.4'
- name: 'Use Node.js' - name: 'Use Node.js'
uses: 'actions/setup-node@v2.1.5' uses: 'actions/setup-node@v2.4.0'
with: with:
node-version: '16.x' node-version: '16.x'
cache: 'npm'
- name: 'Cache dependencies'
uses: 'actions/cache@v2.1.6'
with:
path: '.npm'
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: 'Install' - name: 'Install'
run: 'npm ci --cache .npm --prefer-offline' run: 'npm install'
- name: 'Unit Test'
run: 'npm run test:unit'
test-lighthouse:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2.3.4'
- name: 'Use Node.js'
uses: 'actions/setup-node@v2.4.0'
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- name: 'Build' - name: 'Build'
run: 'npm run build' run: 'npm run build'
- name: 'Lighthouse' - name: 'Lighthouse'
run: 'npm run lighthouse' run: 'npm run test:lighthouse'
env: env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
test: test-e2e:
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
steps: steps:
- uses: 'actions/checkout@v2.3.4' - uses: 'actions/checkout@v2.3.4'
- name: 'Use Node.js' - name: 'Use Node.js'
uses: 'actions/setup-node@v2.1.5' uses: 'actions/setup-node@v2.4.0'
with: with:
node-version: '16.x' node-version: '16.x'
cache: 'npm'
- name: 'Cache dependencies'
uses: 'actions/cache@v2.1.6'
with:
path: '.npm'
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: 'Install' - name: 'Install'
run: 'npm ci --cache .npm --prefer-offline' run: 'npm install'
- name: 'Test' - name: 'Build'
run: 'npm run test' run: 'npm run build'
- name: 'End To End (e2e) Test'
run: 'npm run test:e2e'
release: release:
if: github.ref == 'refs/heads/master' && github.event_name == 'push' if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs: [analyze, lint, build, test] needs: [analyze, lint, test-unit, test-e2e, test-lighthouse]
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
steps: steps:
- uses: 'actions/checkout@v2.3.4' - uses: 'actions/checkout@v2.3.4'
with:
fetch-depth: 0
persist-credentials: false
- name: 'Import GPG key'
uses: 'crazy-max/ghaction-import-gpg@v4'
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: 'Use Node.js' - name: 'Use Node.js'
uses: 'actions/setup-node@v2.1.5' uses: 'actions/setup-node@v2.4.0'
with: with:
node-version: '16.x' node-version: '16.x'
cache: 'npm'
- name: 'Cache dependencies'
uses: 'actions/cache@v2.1.6'
with:
path: '.npm'
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: 'Install' - name: 'Install'
run: 'npm ci --cache .npm --prefer-offline' run: 'npm install'
- name: 'Release' - name: 'Release'
run: 'npm run release' run: 'npm run release'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_EMAIL }}
- name: 'Deploy to Vercel'
run: 'npm run deploy -- --token="${VERCEL_TOKEN}" --prod'
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}

4
.gitignore vendored
View File

@ -14,6 +14,9 @@ dist
# testing # testing
coverage coverage
cypress/screenshots
cypress/videos
cypress/downloads
# PWA # PWA
**/workbox-*.js **/workbox-*.js
@ -45,3 +48,4 @@ npm-debug.log*
# misc # misc
.DS_Store .DS_Store
.lighthouseci .lighthouseci
.vercel

1
.husky/.gitignore vendored
View File

@ -1 +0,0 @@
_

View File

@ -10,9 +10,7 @@
"assert": { "assert": {
"preset": "lighthouse:recommended", "preset": "lighthouse:recommended",
"assertions": { "assertions": {
"csp-xss": "warning", "csp-xss": "warning"
"non-composited-animations": "warning",
"uses-responsive-images": "warning"
} }
}, },
"upload": { "upload": {

View File

@ -6,3 +6,4 @@ package.json
package-lock.json package-lock.json
**/workbox-*.js **/workbox-*.js
**/sw.js **/sw.js
.vercel

View File

@ -13,6 +13,25 @@
"preset": "conventionalcommits" "preset": "conventionalcommits"
} }
], ],
"@semantic-release/github" [
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/git",
{
"assets": ["package.json", "package-lock.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]"
}
],
"@semantic-release/github",
[
"@saithodev/semantic-release-backmerge",
{
"backmergeStrategy": "merge"
}
]
] ]
} }

41
.vscode/settings.json vendored
View File

@ -1,9 +1,48 @@
{ {
"typescript.tsdk": "node_modules/typescript/lib", "typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.configPath": ".prettierrc.json", "prettier.configPath": ".prettierrc.json",
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll": true "source.fixAll": true
},
"[css]": {
"editor.autoClosingBrackets": "always",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[sass]": {
"editor.autoClosingBrackets": "always",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.autoClosingBrackets": "always",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.autoClosingBrackets": "always",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.autoClosingBrackets": "always",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.autoClosingBrackets": "always",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.autoClosingBrackets": "always",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.autoClosingBrackets": "always",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.autoClosingBrackets": "always",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.autoClosingBrackets": "always",
"editor.defaultFormatter": "esbenp.prettier-vscode"
} }
} }

View File

@ -51,8 +51,8 @@ Scopes define what part of the code changed.
### Prerequisites ### Prerequisites
- [Node.js](https://nodejs.org/) >= 14 - [Node.js](https://nodejs.org/) >= 14.0.0
- [npm](https://www.npmjs.com/) >= 7 - [npm](https://www.npmjs.com/) >= 7.0.0
### Installation ### Installation

View File

@ -1,15 +1,15 @@
FROM node:16.3.0 AS dependencies FROM node:16.8.0 AS dependencies
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY ./package*.json ./ COPY ./package*.json ./
RUN npm clean-install RUN npm clean-install
FROM node:16.3.0 AS builder FROM node:16.8.0 AS builder
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY ./ ./ COPY ./ ./
COPY --from=dependencies /usr/src/app/node_modules ./node_modules COPY --from=dependencies /usr/src/app/node_modules ./node_modules
RUN npm run build RUN npm run build
FROM node:16.3.0 AS runner FROM node:16.8.0 AS runner
WORKDIR /usr/src/app WORKDIR /usr/src/app
ENV NODE_ENV=production ENV NODE_ENV=production
COPY --from=builder /usr/src/app/next.config.js ./next.config.js COPY --from=builder /usr/src/app/next.config.js ./next.config.js

View File

@ -5,7 +5,7 @@
</p> </p>
<p align="center"> <p align="center">
<a href="https://github.com/Divlo/Divlo/actions?query=workflow%3A%22Divlo%22"><img src="https://github.com/Divlo/Divlo/actions/workflows/Divlo.yml/badge.svg?branch=master" alt="Divlo's CI" /></a> <a href="https://github.com/Divlo/Divlo/actions/workflows/Divlo.yml"><img src="https://github.com/Divlo/Divlo/actions/workflows/Divlo.yml/badge.svg?branch=master" alt="Divlo's CI" /></a>
<a href="https://github.com/Divlo"><img alt="GitHub" src="https://img.shields.io/badge/-GitHub-5A5A5A?style=flat&labelColor=5A5A5A&logo=github&logoColor=white"/></a> <a href="https://github.com/Divlo"><img alt="GitHub" src="https://img.shields.io/badge/-GitHub-5A5A5A?style=flat&labelColor=5A5A5A&logo=github&logoColor=white"/></a>
<a href="https://gitlab.com/Divlo"><img alt="GitLab" src="https://img.shields.io/badge/-GitLab-303030?style=flat&labelColor=303030&logo=gitlab&logoColor=white"/></a> <a href="https://gitlab.com/Divlo"><img alt="GitLab" src="https://img.shields.io/badge/-GitLab-303030?style=flat&labelColor=303030&logo=gitlab&logoColor=white"/></a>
<a href="https://www.npmjs.com/~divlo"><img alt="npm" src="https://img.shields.io/badge/-npm-c4302b?style=flat&labelColor=c4302b&logo=npm&logoColor=white"/></a> <a href="https://www.npmjs.com/~divlo"><img alt="npm" src="https://img.shields.io/badge/-npm-c4302b?style=flat&labelColor=c4302b&logo=npm&logoColor=white"/></a>
@ -20,21 +20,22 @@
## 📜 About ## 📜 About
```typescript ```json
export interface Divlo { {
pronouns: 'He' | 'Him' "name": "Divlo",
birthDate: '31/03/2003' "pronouns": "He/Him",
nationality: 'Alsace, France' "birthDate": "31/03/2003",
interests: [ "nationality": "Alsace, France",
'Developer Full Stack Junior', "interests": [
'Passionate about High-Tech', "Developer Full Stack Junior",
'Open-Source enthusiast' "Passionate about High-Tech",
] "Open-Source enthusiast"
skills: { ],
languages: ['JavaScript', 'TypeScript', 'Python', 'C/C++'] "skills": {
frontEnd: ['HTML', 'CSS', 'Tailwind CSS', 'React.js (+ Next.js)'] "programmingLanguages": ["JavaScript", "TypeScript", "Python"],
backEnd: ['Node.js', 'Fastify', 'Prisma', 'PostgreSQL', 'MySQL'] "frontEnd": ["HTML", "CSS", "Tailwind CSS", "React.js (+ Next.js)"],
tools: ['Ubuntu', 'Hyper Terminal', 'VSCode', 'Git', 'Docker'] "backEnd": ["Node.js", "Fastify", "Prisma", "PostgreSQL", "MySQL"],
"tools": ["Ubuntu", "Visual Studio Code", "Git", "Docker"]
} }
} }
``` ```
@ -45,5 +46,5 @@ export interface Divlo {
<p align=center> <p align=center>
<img height=175 align="center" src="https://github-readme-stats.vercel.app/api?username=Divlo&show_icons=true&theme=dark" /> <img height=175 align="center" src="https://github-readme-stats.vercel.app/api?username=Divlo&show_icons=true&theme=dark" />
<img height=175 align="center" src="https://github-readme-stats.vercel.app/api/top-langs/?username=Divlo&hide=html,css&langs_count=8&layout=compact&theme=dark" /> <img height=175 align="center" src="https://github-readme-stats.vercel.app/api/top-langs/?username=Divlo&hide=html,css,javascript&langs_count=8&layout=compact&theme=dark" />
</p> </p>

View File

@ -1,10 +0,0 @@
import { render } from '@testing-library/react'
import Error404 from 'pages/404'
describe('GET /404', () => {
it('should render', async () => {
const { getByText } = render(<Error404 />)
expect(getByText('404')).toBeInTheDocument()
})
})

View File

@ -1,10 +0,0 @@
import { render } from '@testing-library/react'
import Error500 from 'pages/500'
describe('GET /500', () => {
it('should render', async () => {
const { getByText } = render(<Error500 />)
expect(getByText('500')).toBeInTheDocument()
})
})

View File

@ -14,7 +14,12 @@ export const ErrorPage: React.FC<ErrorPageProps> = (props) => {
<> <>
<h1 className='my-6 font-semibold text-4xl'> <h1 className='my-6 font-semibold text-4xl'>
{t('errors:error')}{' '} {t('errors:error')}{' '}
<span className='text-yellow dark:text-yellow-dark'>{statusCode}</span> <span
className='text-yellow dark:text-yellow-dark'
data-cy='status-code'
>
{statusCode}
</span>
</h1> </h1>
<p className='text-center text-lg'> <p className='text-center text-lg'>
{message}{' '} {message}{' '}

View File

@ -1,13 +1,39 @@
import { useMemo } from 'react'
import Link from 'next/link'
import useTranslation from 'next-translate/useTranslation' import useTranslation from 'next-translate/useTranslation'
export const Footer: React.FC = () => { export interface FooterProps {
version: string
}
export const Footer: React.FC<FooterProps> = (props) => {
const { t } = useTranslation() const { t } = useTranslation()
const { version } = props
const versionLink = useMemo(() => {
return `https://github.com/Divlo/Divlo/releases/tag/v${version}`
}, [version])
return ( return (
<footer className='bg-white flex justify-center py-6 text-lg border-t-2 border-gray-600 dark:border-gray-400 dark:bg-black'> <footer className='bg-white flex flex-col items-center justify-center py-6 text-lg border-t-2 border-gray-600 dark:border-gray-400 dark:bg-black'>
<p> <p>
<span className='text-yellow dark:text-yellow-dark'>Divlo</span> |{' '} <Link href='/'>
{t('common:allRightsReserved')} <a className='hover:underline text-yellow dark:text-yellow-dark'>
Divlo
</a>
</Link>{' '}
| {t('common:allRightsReserved')}
</p>
<p className='mt-1'>
Version{' '}
<a
className='hover:underline text-yellow dark:text-yellow-dark'
href={versionLink}
target='_blank'
rel='noopener noreferrer'
>
{version}
</a>
</p> </p>
</footer> </footer>
) )

View File

@ -15,7 +15,9 @@ export const LanguageFlag: React.FC<LanguageFlagProps> = (props) => {
src={`/images/languages/${language}.svg`} src={`/images/languages/${language}.svg`}
alt={language} alt={language}
/> />
<p className='mx-2 text-base'>{language.toUpperCase()}</p> <p data-cy='language-flag-text' className='mx-2 text-base'>
{language.toUpperCase()}
</p>
</> </>
) )
} }

View File

@ -1,6 +1,7 @@
import { useCallback, useEffect, useState } from 'react' import { useCallback, useEffect, useState } from 'react'
import useTranslation from 'next-translate/useTranslation' import useTranslation from 'next-translate/useTranslation'
import setLanguage from 'next-translate/setLanguage' import setLanguage from 'next-translate/setLanguage'
import classNames from 'classnames'
import { Arrow } from './Arrow' import { Arrow } from './Arrow'
import { LanguageFlag } from './LanguageFlag' import { LanguageFlag } from './LanguageFlag'
@ -33,12 +34,22 @@ export const Language: React.FC = () => {
return ( return (
<div className='flex flex-col justify-center items-center cursor-pointer'> <div className='flex flex-col justify-center items-center cursor-pointer'>
<div className='flex items-center mr-5' onClick={handleHiddenMenu}> <div
data-cy='language-click'
className='flex items-center mr-5'
onClick={handleHiddenMenu}
>
<LanguageFlag language={currentLanguage} /> <LanguageFlag language={currentLanguage} />
<Arrow /> <Arrow />
</div> </div>
{!hiddenMenu && (
<ul className='flex flex-col justify-center items-center absolute p-0 top-14 z-10 w-24 mt-3 mr-4 rounded-lg list-none shadow-light dark:shadow-dark bg-white dark:bg-black'> <ul
data-cy='languages-list'
className={classNames(
'flex flex-col justify-center items-center absolute p-0 top-14 z-10 w-24 mt-3 mr-4 rounded-lg list-none shadow-light dark:shadow-dark bg-white dark:bg-black',
{ hidden: hiddenMenu }
)}
>
{i18n.locales.map((language, index) => { {i18n.locales.map((language, index) => {
if (language === currentLanguage) { if (language === currentLanguage) {
return null return null
@ -54,7 +65,6 @@ export const Language: React.FC = () => {
) )
})} })}
</ul> </ul>
)}
</div> </div>
) )
} }

View File

@ -13,26 +13,42 @@ export const SwitchTheme: React.FC = () => {
return null return null
} }
const handleClick = (): void => {
setTheme(theme === 'dark' ? 'light' : 'dark')
}
return ( return (
<> <>
<div <div
className='toggle-button' className='flex items-center'
onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')} data-cy='switch-theme-click'
onClick={handleClick}
> >
<div className='toggle-theme-button'> <div className='toggle-theme-button relative cursor-pointer bg-transparent inline-block'>
<div className='toggle-track'> <div className='toggle-track'>
<div className='toggle-track-check'> <div
<span className='toggle_Dark'>🌜</span> data-cy='switch-theme-dark'
className='toggle-track-check absolute'
>
<span className='toggle_Dark flex justify-center items-center relative'>
🌜
</span>
</div> </div>
<div className='toggle-track-x'> <div
<span className='toggle_Light'>🌞</span> data-cy='switch-theme-light'
className='toggle-track-x absolute'
>
<span className='toggle_Light flex justify-center items-center relative'>
🌞
</span>
</div> </div>
</div> </div>
<div className='toggle-thumb' /> <div className='toggle-thumb absolute' />
<input <input
data-cy='switch-theme-input'
type='checkbox' type='checkbox'
aria-label='Dark mode toggle' aria-label='Dark mode toggle'
className='toggle-screenreader-only' className='toggle-screenreader-only absolute overflow-hidden'
defaultChecked defaultChecked
/> />
</div> </div>
@ -40,16 +56,8 @@ export const SwitchTheme: React.FC = () => {
<style jsx> <style jsx>
{` {`
.toggle-button {
display: flex;
align-items: center;
}
.toggle-theme-button { .toggle-theme-button {
touch-action: pan-x; touch-action: pan-x;
display: inline-block;
position: relative;
cursor: pointer;
background-color: transparent;
border: 0; border: 0;
padding: 0; padding: 0;
user-select: none; user-select: none;
@ -64,7 +72,6 @@ export const SwitchTheme: React.FC = () => {
color: #fff; color: #fff;
} }
.toggle-track-check { .toggle-track-check {
position: absolute;
width: 14px; width: 14px;
height: 10px; height: 10px;
top: 0; top: 0;
@ -77,7 +84,6 @@ export const SwitchTheme: React.FC = () => {
transition: opacity 0.25s ease; transition: opacity 0.25s ease;
} }
.toggle-track-x { .toggle-track-x {
position: absolute;
width: 10px; width: 10px;
height: 10px; height: 10px;
top: 0; top: 0;
@ -90,15 +96,10 @@ export const SwitchTheme: React.FC = () => {
} }
.toggle_Dark, .toggle_Dark,
.toggle_Light { .toggle_Light {
align-items: center;
display: flex;
height: 10px; height: 10px;
justify-content: center;
position: relative;
width: 10px; width: 10px;
} }
.toggle-thumb { .toggle-thumb {
position: absolute;
left: ${theme === 'dark' ? '27px' : '0px'}; left: ${theme === 'dark' ? '27px' : '0px'};
width: 22px; width: 22px;
height: 22px; height: 22px;
@ -115,9 +116,7 @@ export const SwitchTheme: React.FC = () => {
clip: rect(0 0 0 0); clip: rect(0 0 0 0);
height: 1px; height: 1px;
margin: -1px; margin: -1px;
overflow: hidden;
padding: 0; padding: 0;
position: absolute;
width: 1px; width: 1px;
} }
`} `}

View File

@ -11,7 +11,7 @@ export const InterestParagraph: React.FC<InterestParagraphProps> = (props) => {
return ( return (
<> <>
<p className='text-center my-6 text-gray dark:text-gray-dark'> <p className='text-center my-6 text-gray dark:text-gray-dark'>
<strong className='text-yellow font-medium text-lg dark:text-yellow-dark'> <strong className='text-yellow font-semibold text-lg dark:text-yellow-dark'>
{title} {title}
</strong> </strong>
<br /> <br />

View File

@ -0,0 +1,24 @@
import { ShadowContainer } from 'components/design/ShadowContainer'
import { GitHubIcon } from 'components/Profile/SocialMediaList/SocialMediaIcons/GitHubIcon'
export interface RepositoryProps {
name: string
description: string
href: string
}
export const Repository: React.FC<RepositoryProps> = (props) => {
const { name, description, href } = props
return (
<ShadowContainer className='cursor-pointer relative p-6 !mb-4 max-h-32 transition-transform duration-200 ease-in-out hover:-translate-y-2'>
<a href={href} target='_blank' rel='noopener noreferrer'>
<div className='flex'>
<GitHubIcon className='h-6 mr-2' />
<span className='text-yellow dark:text-yellow-dark'>{name}</span>
</div>
<p className='my-4'>{description}</p>
</a>
</ShadowContainer>
)
}

View File

@ -0,0 +1,47 @@
import useTranslation from 'next-translate/useTranslation'
import { Repository } from './Repository'
export const OpenSource: React.FC = () => {
const { t } = useTranslation()
return (
<>
<div className='max-w-full mt-0 flex flex-col items-center'>
<p className='text-center'>{t('home:open-source.description')}</p>
<div className='grid grid-cols-1 md:w-10/12 md:grid-cols-2 gap-6 my-6'>
<Repository
name='nodejs/node'
description='Node.js JavaScript runtime ✨️🐢🚀✨️'
href='https://github.com/nodejs/node/commits?author=Divlo'
/>
<Repository
name='standard/standard'
description='🌟 JavaScript Style Guide, with linter & automatic code fixer'
href='https://github.com/standard/standard/commits?author=Divlo'
/>
<Repository
name='nrwl/nx'
description='Smart, Extensible Build Framework'
href='https://github.com/nrwl/nx/commits?author=Divlo'
/>
<Repository
name='vercel/styled-jsx'
description='Full CSS support for JSX without compromises'
href='https://github.com/vercel/styled-jsx/commits?author=Divlo'
/>
</div>
</div>
<style jsx global>{`
.animation-custom {
position: relative;
transition: all 0.3s ease 0s;
}
.animation-custom:hover {
transform: translateY(-7px);
}
`}</style>
</>
)
}

View File

@ -1,10 +1,9 @@
import useTranslation from 'next-translate/useTranslation' import useTranslation from 'next-translate/useTranslation'
export const ProfileInfo: React.FC = () => { export const ProfileInformation: React.FC = () => {
const { t } = useTranslation() const { t } = useTranslation()
return ( return (
<>
<div className='pb-2 mb-6 border-b-2 font-headline border-gray-600 dark:border-gray-400'> <div className='pb-2 mb-6 border-b-2 font-headline border-gray-600 dark:border-gray-400'>
<h1 className='text-4xl mb-2'> <h1 className='text-4xl mb-2'>
{t('home:about.IAm')}{' '} {t('home:about.IAm')}{' '}
@ -14,31 +13,5 @@ export const ProfileInfo: React.FC = () => {
</h1> </h1>
<h2 className='text-base mb-3'>{t('home:about.description')}</h2> <h2 className='text-base mb-3'>{t('home:about.description')}</h2>
</div> </div>
<style jsx>
{`
.profile-info {
padding-bottom: 25px;
margin-bottom: 25px;
border-bottom: 1px solid #dedede;
}
.profile-title {
font-size: 36px;
line-height: 1.1;
font-weight: 300;
margin-bottom: 10px;
}
.profile-title > strong {
font-weight: 600;
}
.profile-description {
font-size: 17.4px;
font-weight: 400;
line-height: 1.1;
margin: 0;
}
`}
</style>
</>
) )
} }

View File

@ -1,14 +1,11 @@
import Image from 'next/image' import Image from 'next/image'
import DivloLogo from 'public/images/divlo_logo.png'
export const ProfileLogo: React.FC = () => { export const ProfileLogo: React.FC = () => {
return ( return (
<div className='px-2 py-6'> <div className='px-2 py-6 max-w-[370px] max-h-[370px]'>
<Image <Image src={DivloLogo} alt='Divlo' priority />
width={370}
height={370}
src='/images/divlo_logo.png'
alt='Divlo'
/>
</div> </div>
) )
} }

View File

@ -1,11 +1,16 @@
import classNames from 'classnames'
export const Icon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => { export const Icon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
const { children, ...rest } = props const { children, className, ...rest } = props
return ( return (
<svg <svg
xmlns='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg'
viewBox='0 0 24 24' viewBox='0 0 24 24'
className='dark:text-white text-black w-8 h-8 fill-current' className={classNames(
'dark:text-white text-black w-8 h-8 fill-current',
className
)}
{...rest} {...rest}
> >
{children} {children}

View File

@ -1,14 +1,14 @@
import { ProfileDescriptionBottom } from './ProfileDescriptionBottom' import { ProfileDescriptionBottom } from './ProfileDescriptionBottom'
import { ProfileInfo } from './ProfileInfo' import { ProfileInformation } from './ProfileInfo'
import { ProfileList } from './ProfileList' import { ProfileList } from './ProfileList'
import { ProfileLogo } from './ProfileLogo' import { ProfileLogo } from './ProfileLogo'
export const Profile: React.FC = () => { export const Profile: React.FC = () => {
return ( return (
<div className='flex flex-col justify-center items-center px-10 pt-2 md:pt-10 xl:pt-0 md:flex-row'> <div className='flex flex-col justify-center items-center px-10 pt-2 md:pt-10 md:flex-row'>
<ProfileLogo /> <ProfileLogo />
<div> <div>
<ProfileInfo /> <ProfileInformation />
<ProfileList /> <ProfileList />
<ProfileDescriptionBottom /> <ProfileDescriptionBottom />
</div> </div>

View File

@ -12,7 +12,6 @@ export const Skills: React.FC = () => {
<SkillComponent skill='JavaScript' /> <SkillComponent skill='JavaScript' />
<SkillComponent skill='TypeScript' /> <SkillComponent skill='TypeScript' />
<SkillComponent skill='Python' /> <SkillComponent skill='Python' />
<SkillComponent skill='C/C++' />
</SkillsSection> </SkillsSection>
<SkillsSection title='Front-end'> <SkillsSection title='Front-end'>
@ -32,7 +31,6 @@ export const Skills: React.FC = () => {
<SkillsSection title={t('home:skills.softwareTools')}> <SkillsSection title={t('home:skills.softwareTools')}>
<SkillComponent skill='Ubuntu' /> <SkillComponent skill='Ubuntu' />
<SkillComponent skill='Hyper' />
<SkillComponent skill='Visual Studio Code' /> <SkillComponent skill='Visual Studio Code' />
<SkillComponent skill='Git' /> <SkillComponent skill='Git' />
<SkillComponent skill='Docker' /> <SkillComponent skill='Docker' />

View File

@ -3,8 +3,14 @@ import { render } from '@testing-library/react'
import { Footer } from '../Footer' import { Footer } from '../Footer'
describe('<Footer />', () => { describe('<Footer />', () => {
it('should render', async () => { it('should render with appropriate link tag version', async () => {
const { getByText } = render(<Footer />) const version = '1.0.0'
const { getByText } = render(<Footer version={version} />)
const versionLink = getByText(version) as HTMLAnchorElement
expect(getByText('Divlo')).toBeInTheDocument() expect(getByText('Divlo')).toBeInTheDocument()
expect(versionLink).toBeInTheDocument()
expect(versionLink.href).toEqual(
`https://github.com/Divlo/Divlo/releases/tag/v${version}`
)
}) })
}) })

View File

@ -4,7 +4,7 @@ export const SectionHeading: React.FC<SectionHeadingProps> = (props) => {
const { children, ...rest } = props const { children, ...rest } = props
return ( return (
<h2 {...rest} className='text-4xl font-semibold text-center mt-1 mb-7'> <h2 {...rest} className='text-4xl font-semibold text-center mt-1 mb-3'>
{children} {children}
</h2> </h2>
) )

8
cypress.json Normal file
View File

@ -0,0 +1,8 @@
{
"baseUrl": "http://localhost:3000",
"pluginsFile": false,
"supportFile": false,
"fixturesFolder": false,
"video": false,
"screenshotOnRunFailure": false
}

View File

@ -0,0 +1,47 @@
describe('Common > Header', () => {
beforeEach(() => cy.visit('/'))
describe('Switch theme color (dark/light)', () => {
it('should switch theme from `dark` (default) to `light`', () => {
cy.get('[data-cy=switch-theme-dark]').should('be.visible')
cy.get('[data-cy=switch-theme-light]').should('not.be.visible')
cy.get('body').should(
'not.have.css',
'background-color',
'rgb(255, 255, 255)'
)
cy.get('[data-cy=switch-theme-click]').click()
cy.get('[data-cy=switch-theme-dark]').should('not.be.visible')
cy.get('[data-cy=switch-theme-light]').should('be.visible')
cy.get('body').should(
'have.css',
'background-color',
'rgb(255, 255, 255)'
)
})
})
describe('Switch Language', () => {
it('should switch language from EN (default) to FR', () => {
cy.get('h1').contains('I am Divlo')
cy.get('[data-cy=language-flag-text]').contains('EN')
cy.get('[data-cy=languages-list]').should('not.be.visible')
cy.get('[data-cy=language-click]').click()
cy.get('[data-cy=languages-list]').should('be.visible')
cy.get('[data-cy=languages-list] > li:first-child').contains('FR').click()
cy.get('[data-cy=languages-list]').should('not.be.visible')
cy.get('[data-cy=language-flag-text]').contains('FR')
cy.get('h1').contains('Je suis Divlo')
})
it('should close the language list menu when clicking outside', () => {
cy.get('[data-cy=languages-list]').should('not.be.visible')
cy.get('[data-cy=language-click]').click()
cy.get('[data-cy=languages-list]').should('be.visible')
cy.get('h1').click()
cy.get('[data-cy=languages-list]').should('not.be.visible')
})
})
})

View File

@ -0,0 +1,7 @@
describe('Page /404', () => {
beforeEach(() => cy.visit('/404', { failOnStatusCode: false }))
it('should display the statusCode of 404', () => {
cy.get('[data-cy=status-code]').contains('404')
})
})

View File

@ -0,0 +1,7 @@
describe('Page /500', () => {
beforeEach(() => cy.visit('/500', { failOnStatusCode: false }))
it('should display the statusCode of 500', () => {
cy.get('[data-cy=status-code]').contains('500')
})
})

View File

@ -0,0 +1,19 @@
describe('Page /', () => {
beforeEach(() => cy.visit('/'))
it('should reveals the sections while scrolling except the about section', () => {
const sectionsReveals = [
'#interests',
'#skills',
'#portfolio',
'#open-source'
]
cy.get('#about').should('be.visible')
for (const section of sectionsReveals) {
cy.get(section)
.should('not.be.visible')
.scrollIntoView()
.should('be.visible')
}
})
})

9
cypress/tsconfig.json Normal file
View File

@ -0,0 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"noEmit": true,
"types": ["cypress"],
"isolatedModules": false
},
"include": ["../node_modules/cypress", "./**/*.ts"]
}

View File

@ -1,16 +0,0 @@
module.exports = {
roots: ['<rootDir>'],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': 'babel-jest'
},
moduleDirectories: ['node_modules', './'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
testEnvironment: 'jsdom',
setupFilesAfterEnv: [
'@testing-library/jest-dom/extend-expect',
'@testing-library/react'
],
collectCoverage: true,
coverageDirectory: './coverage',
coverageReporters: ['text', 'cobertura']
}

14
jest.config.json Normal file
View File

@ -0,0 +1,14 @@
{
"roots": ["<rootDir>"],
"transform": {
"^.+\\.(js|jsx|ts|tsx)$": "babel-jest"
},
"moduleDirectories": ["node_modules", "./"],
"modulePathIgnorePatterns": ["<rootDir>/cypress"],
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
"testEnvironment": "jsdom",
"setupFilesAfterEnv": [
"@testing-library/jest-dom/extend-expect",
"@testing-library/react"
]
}

View File

@ -4,7 +4,7 @@
"description": "Developer Full Stack Junior • Passionate about High-Tech", "description": "Developer Full Stack Junior • Passionate about High-Tech",
"birthDate": "Birth date", "birthDate": "Birth date",
"nationality": "Nationality", "nationality": "Nationality",
"descriptionBottom": "I am self-taught in Computer Science by following online trainings. <0/> <0/> I put into practice everything I learn and make many projects." "descriptionBottom": "I am self-taught in Computer Science by following online trainings and I am also a student at the university following the French training \"BUT Informatique\" (first year). <0/> <0/> I put into practice everything I learn and make many projects."
}, },
"interests": { "interests": {
"title": "Interests", "title": "Interests",
@ -50,5 +50,8 @@
"image": "/images/portfolio/leon.png" "image": "/images/portfolio/leon.png"
} }
] ]
},
"open-source": {
"description": "List of most famous open source projects I contributed to."
} }
} }

View File

@ -4,7 +4,7 @@
"description": "Développeur Full Stack Junior • Passionné de High-Tech", "description": "Développeur Full Stack Junior • Passionné de High-Tech",
"birthDate": "Date de naissance", "birthDate": "Date de naissance",
"nationality": "Nationalité", "nationality": "Nationalité",
"descriptionBottom": "Je me forme en autodidacte dans l'informatique en suivant des formations en ligne. <0/> <0/> Je mets en pratique tout ce que j'apprends et réalise de nombreux projets." "descriptionBottom": "Je me forme en autodidacte dans l'informatique en suivant des formations en ligne et je suis aussi un étudiant à l'université suivant la formation \"BUT Informatique\" (première année). <0/> <0/> Je mets en pratique tout ce que j'apprends et réalise de nombreux projets."
}, },
"interests": { "interests": {
"title": "Intérêts", "title": "Intérêts",
@ -50,5 +50,8 @@
"image": "/images/portfolio/leon.png" "image": "/images/portfolio/leon.png"
} }
] ]
},
"open-source": {
"description": "Liste des projets open source les plus célèbres auxquels j'ai contribué."
} }
} }

3
next-env.d.ts vendored
View File

@ -1,3 +1,6 @@
/// <reference types="next" /> /// <reference types="next" />
/// <reference types="next/types/global" /> /// <reference types="next/types/global" />
/// <reference types="next/image-types/global" /> /// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.

View File

@ -1,11 +1,35 @@
const nextPWA = require('next-pwa') const nextPWA = require('next-pwa')
const nextTranslate = require('next-translate') const nextTranslate = require('next-translate')
const { createSecureHeaders } = require('next-secure-headers')
/** @type {import("next").NextConfig} */
module.exports = nextTranslate( module.exports = nextTranslate(
nextPWA({ nextPWA({
pwa: { pwa: {
disable: process.env.NODE_ENV !== 'production', disable: process.env.NODE_ENV !== 'production',
dest: 'public' dest: 'public'
},
async headers() {
return [
{
source: '/:path*',
headers: createSecureHeaders({
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
scriptSrc: ["'self'", "'unsafe-eval'", "'unsafe-inline'"],
styleSrc: ["'self'", "'unsafe-inline'"],
imgSrc: ['*', 'data:', 'blob:'],
mediaSrc: "'none'",
connectSrc: '*',
objectSrc: "'none'",
fontSrc: "'self'",
baseURI: "'none'"
}
}
})
}
]
} }
}) })
) )

15740
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "divlo", "name": "divlo",
"version": "0.0.0-development", "version": "1.3.6",
"private": true, "private": true,
"repository": { "repository": {
"type": "git", "type": "git",
@ -21,58 +21,69 @@
"lint:markdown": "markdownlint '**/*.md' --dot --ignore node_modules", "lint:markdown": "markdownlint '**/*.md' --dot --ignore node_modules",
"lint:typescript": "eslint '**/*.{js,ts,jsx,tsx}'", "lint:typescript": "eslint '**/*.{js,ts,jsx,tsx}'",
"lint:staged": "lint-staged", "lint:staged": "lint-staged",
"lighthouse": "lhci autorun", "test:unit": "jest",
"test": "jest", "test:lighthouse": "lhci autorun",
"test:e2e": "start-server-and-test 'start' 'http://localhost:3000' 'cypress run'",
"test:e2e:dev": "start-server-and-test 'dev' 'http://localhost:3000' 'cypress open'",
"release": "semantic-release", "release": "semantic-release",
"deploy": "vercel",
"postinstall": "husky install" "postinstall": "husky install"
}, },
"dependencies": { "dependencies": {
"@fontsource/montserrat": "4.4.5", "@fontsource/montserrat": "4.5.1",
"@fortawesome/fontawesome-svg-core": "1.2.35", "@fortawesome/fontawesome-svg-core": "1.2.36",
"@fortawesome/free-brands-svg-icons": "5.15.3", "@fortawesome/free-brands-svg-icons": "5.15.4",
"@fortawesome/free-solid-svg-icons": "5.15.3", "@fortawesome/free-solid-svg-icons": "5.15.4",
"@fortawesome/react-fontawesome": "0.1.14", "@fortawesome/react-fontawesome": "0.1.15",
"classnames": "2.3.1", "classnames": "2.3.1",
"html-react-parser": "1.2.7", "html-react-parser": "1.3.0",
"next": "11.0.1", "next": "11.1.2",
"next-pwa": "5.2.21", "next-pwa": "5.3.1",
"next-themes": "0.0.14", "next-themes": "0.0.15",
"next-translate": "1.0.7", "next-translate": "1.0.7",
"react": "17.0.2", "react": "17.0.2",
"react-dom": "17.0.2", "react-dom": "17.0.2",
"read-pkg": "7.0.0",
"sharp": "0.29.1",
"universal-cookie": "4.0.4" "universal-cookie": "4.0.4"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "12.1.4", "@commitlint/cli": "13.1.0",
"@commitlint/config-conventional": "12.1.4", "@commitlint/config-conventional": "13.1.0",
"@lhci/cli": "0.8.0", "@lhci/cli": "0.8.1",
"@saithodev/semantic-release-backmerge": "1.5.3",
"@semantic-release/git": "9.0.1",
"@testing-library/jest-dom": "5.14.1", "@testing-library/jest-dom": "5.14.1",
"@testing-library/react": "12.0.0", "@testing-library/react": "12.0.0",
"@types/jest": "26.0.23", "@types/jest": "27.0.1",
"@types/node": "15.12.4", "@types/node": "16.9.0",
"@types/react": "17.0.11", "@types/react": "17.0.20",
"@types/styled-jsx": "2.2.8", "@typescript-eslint/eslint-plugin": "4.31.0",
"@typescript-eslint/eslint-plugin": "4.28.0", "autoprefixer": "10.3.4",
"autoprefixer": "10.2.6", "babel-jest": "27.1.1",
"babel-jest": "27.0.5", "cypress": "8.3.1",
"dockerfilelint": "1.8.0", "dockerfilelint": "1.8.0",
"editorconfig-checker": "4.0.2", "editorconfig-checker": "4.0.2",
"eslint": "7.29.0", "eslint": "7.32.0",
"eslint-config-next": "11.0.1", "eslint-config-next": "11.1.2",
"eslint-config-prettier": "8.3.0", "eslint-config-prettier": "8.3.0",
"eslint-config-standard-with-typescript": "20.0.0", "eslint-config-standard-with-typescript": "21.0.1",
"eslint-plugin-import": "2.23.4", "eslint-plugin-import": "2.24.2",
"eslint-plugin-node": "11.1.0", "eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "3.4.0", "eslint-plugin-prettier": "4.0.0",
"eslint-plugin-promise": "5.1.0", "eslint-plugin-promise": "5.1.0",
"husky": "6.0.0", "eslint-plugin-unicorn": "35.0.0",
"jest": "27.0.5", "husky": "7.0.2",
"lint-staged": "11.0.0", "jest": "27.1.1",
"markdownlint-cli": "0.27.1", "lint-staged": "11.1.2",
"postcss": "8.3.5", "markdownlint-cli": "0.28.1",
"prettier": "2.3.1", "next-secure-headers": "2.2.0",
"semantic-release": "17.4.4", "postcss": "8.3.6",
"tailwindcss": "2.2.4", "prettier": "2.3.2",
"typescript": "4.3.4" "semantic-release": "17.4.7",
"start-server-and-test": "1.14.0",
"tailwindcss": "2.2.14",
"typescript": "4.4.2",
"vercel": "23.1.2"
} }
} }

View File

@ -3,20 +3,30 @@ import useTranslation from 'next-translate/useTranslation'
import { ErrorPage } from 'components/ErrorPage' import { ErrorPage } from 'components/ErrorPage'
import { Head } from 'components/Head' import { Head } from 'components/Head'
import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer'
const Error404: React.FC = () => { const Error404: React.FC<FooterProps> = (props) => {
const { t } = useTranslation() const { t } = useTranslation()
const { version } = props
return ( return (
<> <>
<Head title='Divlo - 404' /> <Head title='Divlo - 404' />
<Header />
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
<ErrorPage statusCode={404} message={t('errors:notFound')} /> <ErrorPage statusCode={404} message={t('errors:notFound')} />
</main>
<Footer version={version} />
</> </>
) )
} }
export const getStaticProps: GetStaticProps = async () => { export const getStaticProps: GetStaticProps<FooterProps> = async () => {
return { props: {} } const { readPackage } = await import('read-pkg')
const { version } = await readPackage()
return { props: { version } }
} }
export default Error404 export default Error404

View File

@ -3,20 +3,30 @@ import useTranslation from 'next-translate/useTranslation'
import { ErrorPage } from 'components/ErrorPage' import { ErrorPage } from 'components/ErrorPage'
import { Head } from 'components/Head' import { Head } from 'components/Head'
import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer'
const Error500: React.FC = () => { const Error500: React.FC<FooterProps> = (props) => {
const { t } = useTranslation() const { t } = useTranslation()
const { version } = props
return ( return (
<> <>
<Head title='Divlo - 500' /> <Head title='Divlo - 500' />
<Header />
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
<ErrorPage statusCode={500} message={t('errors:serverError')} /> <ErrorPage statusCode={500} message={t('errors:serverError')} />
</main>
<Footer version={version} />
</> </>
) )
} }
export const getStaticProps: GetStaticProps = async () => { export const getStaticProps: GetStaticProps<FooterProps> = async () => {
return { props: {} } const { readPackage } = await import('read-pkg')
const { version } = await readPackage()
return { props: { version } }
} }
export default Error500 export default Error500

View File

@ -6,19 +6,14 @@ import UniversalCookie from 'universal-cookie'
import 'tailwindcss/tailwind.css' import 'tailwindcss/tailwind.css'
import '@fontsource/montserrat/400.css' import '@fontsource/montserrat/400.css'
import '@fontsource/montserrat/500.css'
import '@fontsource/montserrat/600.css' import '@fontsource/montserrat/600.css'
import '@fontsource/montserrat/700.css'
import { Header } from 'components/Header'
import { Footer } from 'components/Footer'
const universalCookie = new UniversalCookie() const universalCookie = new UniversalCookie()
/** how long in seconds, until the cookie expires (10 years) */ /** how long in seconds, until the cookie expires (10 years) */
const COOKIE_MAX_AGE = 10 * 365.25 * 24 * 60 * 60 const COOKIE_MAX_AGE = 10 * 365.25 * 24 * 60 * 60
const MyApp = ({ Component, pageProps }: AppProps): JSX.Element => { const Application = ({ Component, pageProps }: AppProps): JSX.Element => {
const { lang } = useTranslation() const { lang } = useTranslation()
useEffect(() => { useEffect(() => {
@ -30,13 +25,9 @@ const MyApp = ({ Component, pageProps }: AppProps): JSX.Element => {
return ( return (
<ThemeProvider attribute='class' defaultTheme='dark'> <ThemeProvider attribute='class' defaultTheme='dark'>
<Header />
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
<Component {...pageProps} /> <Component {...pageProps} />
</main>
<Footer />
</ThemeProvider> </ThemeProvider>
) )
} }
export default MyApp export default Application

View File

@ -1,21 +1,6 @@
import Document, { import { Html, Head, Main, NextScript } from 'next/document'
Html,
Head,
Main,
NextScript,
DocumentContext,
DocumentInitialProps
} from 'next/document'
class MyDocument extends Document { const Document: React.FC = () => {
static async getInitialProps(
ctx: DocumentContext
): Promise<DocumentInitialProps> {
const initialProps = await Document.getInitialProps(ctx)
return initialProps
}
render(): JSX.Element {
return ( return (
<Html> <Html>
<Head /> <Head />
@ -26,6 +11,5 @@ class MyDocument extends Document {
</Html> </Html>
) )
} }
}
export default MyDocument export default Document

View File

@ -9,14 +9,20 @@ import { Portfolio } from 'components/Portfolio'
import { Profile } from 'components/Profile' import { Profile } from 'components/Profile'
import { SocialMediaList } from 'components/Profile/SocialMediaList' import { SocialMediaList } from 'components/Profile/SocialMediaList'
import { Skills } from 'components/Skills' import { Skills } from 'components/Skills'
import { OpenSource } from 'components/OpenSource'
import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer'
const Home: React.FC = () => { const Home: React.FC<FooterProps> = (props) => {
const { t } = useTranslation() const { t } = useTranslation()
const { version } = props
return ( return (
<> <>
<Head /> <Head />
<Header />
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
<Section isMain id='about'> <Section isMain id='about'>
<Profile /> <Profile />
<SocialMediaList /> <SocialMediaList />
@ -47,12 +53,26 @@ const Home: React.FC = () => {
<Portfolio /> <Portfolio />
</Section> </Section>
</RevealFade> </RevealFade>
<RevealFade>
<Section
id='open-source'
heading='Open source'
withoutShadowContainer
>
<OpenSource />
</Section>
</RevealFade>
</main>
<Footer version={version} />
</> </>
) )
} }
export const getStaticProps: GetStaticProps = async () => { export const getStaticProps: GetStaticProps<FooterProps> = async () => {
return { props: {} } const { readPackage } = await import('read-pkg')
const { version } = await readPackage()
return { props: { version } }
} }
export default Home export default Home

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

@ -10,6 +10,7 @@
"removeComments": true, "removeComments": true,
"noEmit": true, "noEmit": true,
"strict": true, "strict": true,
"types": ["jest", "@testing-library/jest-dom", "@testing-library/react"],
"baseUrl": ".", "baseUrl": ".",
"esModuleInterop": true, "esModuleInterop": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,

5
vercel.json Normal file
View File

@ -0,0 +1,5 @@
{
"github": {
"enabled": false
}
}