mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-05-29 22:37:44 +02:00
Compare commits
42 Commits
Author | SHA1 | Date | |
---|---|---|---|
377b8e91a6 | |||
fce29c9d4a | |||
c198f47aa9 | |||
8e051332cd | |||
9f3436e1df | |||
2f2373e62f | |||
c6b455dd10 | |||
4e089b41f2 | |||
6c102b1b35 | |||
52b10944b7 | |||
db36eb3e7a | |||
c739ad951d | |||
2802ff029f | |||
1a7457b44b | |||
ff210f879d | |||
607454b360 | |||
d1522fbf44 | |||
b82eae7499 | |||
73527ce8fe | |||
0cd885ee70 | |||
2cb2df975f | |||
37f5843adb | |||
d794d38f14 | |||
fc5ba28b8a | |||
b5945150b8 | |||
aa12d626d2 | |||
6ac4782b7d | |||
0aa998d593 | |||
56f975e53c | |||
5a16d24ea1 | |||
52267005ec | |||
99b9b12ac9 | |||
2cae77481f | |||
e98b47a459 | |||
4cc87758c1 | |||
1bb0f31223 | |||
af2dd0bd60 | |||
63d7485c8d | |||
74fde0ea40 | |||
0d2b318818 | |||
266b3f8589 | |||
f7d304ca80 |
32
.github/workflows/Divlo.yml
vendored
32
.github/workflows/Divlo.yml
vendored
@ -46,7 +46,24 @@ 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'
|
||||||
|
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: 'Unit Test'
|
||||||
|
run: 'npm run test:unit'
|
||||||
|
|
||||||
|
test-lighthouse:
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-latest'
|
||||||
steps:
|
steps:
|
||||||
- uses: 'actions/checkout@v2.3.4'
|
- uses: 'actions/checkout@v2.3.4'
|
||||||
@ -64,11 +81,11 @@ jobs:
|
|||||||
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'
|
||||||
@ -82,12 +99,15 @@ jobs:
|
|||||||
- name: 'Install'
|
- name: 'Install'
|
||||||
run: 'npm install'
|
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'
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -14,6 +14,9 @@ dist
|
|||||||
|
|
||||||
# testing
|
# testing
|
||||||
coverage
|
coverage
|
||||||
|
cypress/screenshots
|
||||||
|
cypress/videos
|
||||||
|
cypress/downloads
|
||||||
|
|
||||||
# PWA
|
# PWA
|
||||||
**/workbox-*.js
|
**/workbox-*.js
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
"assert": {
|
"assert": {
|
||||||
"preset": "lighthouse:recommended",
|
"preset": "lighthouse:recommended",
|
||||||
"assertions": {
|
"assertions": {
|
||||||
"csp-xss": "warning",
|
"csp-xss": "warning"
|
||||||
"uses-responsive-images": "warning"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"upload": {
|
"upload": {
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
FROM node:16.6.1 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.6.1 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.6.1 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
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"name": "Divlo",
|
"name": "Divlo",
|
||||||
"pronouns": "He' | 'Him",
|
"pronouns": "He/Him",
|
||||||
"birthDate": "31/03/2003",
|
"birthDate": "31/03/2003",
|
||||||
"nationality": "Alsace, France",
|
"nationality": "Alsace, France",
|
||||||
"interests": [
|
"interests": [
|
||||||
@ -35,7 +35,7 @@
|
|||||||
"programmingLanguages": ["JavaScript", "TypeScript", "Python"],
|
"programmingLanguages": ["JavaScript", "TypeScript", "Python"],
|
||||||
"frontEnd": ["HTML", "CSS", "Tailwind CSS", "React.js (+ Next.js)"],
|
"frontEnd": ["HTML", "CSS", "Tailwind CSS", "React.js (+ Next.js)"],
|
||||||
"backEnd": ["Node.js", "Fastify", "Prisma", "PostgreSQL", "MySQL"],
|
"backEnd": ["Node.js", "Fastify", "Prisma", "PostgreSQL", "MySQL"],
|
||||||
"tools": ["Ubuntu", "Hyper Terminal", "VSCode", "Git", "Docker"]
|
"tools": ["Ubuntu", "Visual Studio Code", "Git", "Docker"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -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()
|
|
||||||
})
|
|
||||||
})
|
|
@ -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()
|
|
||||||
})
|
|
||||||
})
|
|
@ -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}{' '}
|
||||||
|
@ -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>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -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,28 +34,37 @@ 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
|
||||||
{i18n.locales.map((language, index) => {
|
data-cy='languages-list'
|
||||||
if (language === currentLanguage) {
|
className={classNames(
|
||||||
return null
|
'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 }
|
||||||
return (
|
)}
|
||||||
<li
|
>
|
||||||
key={index}
|
{i18n.locales.map((language, index) => {
|
||||||
className='flex items-center justify-center w-full h-12 hover:bg-[#4f545c] hover:bg-opacity-20 pl-2'
|
if (language === currentLanguage) {
|
||||||
onClick={async () => await handleLanguage(language)}
|
return null
|
||||||
>
|
}
|
||||||
<LanguageFlag language={language} />
|
return (
|
||||||
</li>
|
<li
|
||||||
)
|
key={index}
|
||||||
})}
|
className='flex items-center justify-center w-full h-12 hover:bg-[#4f545c] hover:bg-opacity-20 pl-2'
|
||||||
</ul>
|
onClick={async () => await handleLanguage(language)}
|
||||||
)}
|
>
|
||||||
|
<LanguageFlag language={language} />
|
||||||
|
</li>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import { useTheme } from 'next-themes'
|
import { useTheme } from 'next-themes'
|
||||||
|
|
||||||
export const SwitchTheme: React.FC = () => {
|
export const SwitchTheme: React.FC = () => {
|
||||||
@ -13,23 +13,29 @@ 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='toggle-button'
|
||||||
onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
|
data-cy='switch-theme-click'
|
||||||
|
onClick={handleClick}
|
||||||
>
|
>
|
||||||
<div className='toggle-theme-button'>
|
<div className='toggle-theme-button'>
|
||||||
<div className='toggle-track'>
|
<div className='toggle-track'>
|
||||||
<div className='toggle-track-check'>
|
<div data-cy='switch-theme-dark' className='toggle-track-check'>
|
||||||
<span className='toggle_Dark'>🌜</span>
|
<span className='toggle_Dark'>🌜</span>
|
||||||
</div>
|
</div>
|
||||||
<div className='toggle-track-x'>
|
<div data-cy='switch-theme-light' className='toggle-track-x'>
|
||||||
<span className='toggle_Light'>🌞</span>
|
<span className='toggle_Light'>🌞</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='toggle-thumb' />
|
<div className='toggle-thumb' />
|
||||||
<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'
|
||||||
|
@ -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 />
|
||||||
|
@ -5,7 +5,7 @@ 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 max-w-[370px] max-h-[370px]'>
|
<div className='px-2 py-6 max-w-[370px] max-h-[370px]'>
|
||||||
<Image src={DivloLogo} alt='Divlo' />
|
<Image src={DivloLogo} alt='Divlo' priority />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -31,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' />
|
||||||
|
@ -3,10 +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 version = '1.0.0'
|
const version = '1.0.0'
|
||||||
const { getByText } = render(<Footer version={version} />)
|
const { getByText } = render(<Footer version={version} />)
|
||||||
|
const versionLink = getByText(version) as HTMLAnchorElement
|
||||||
expect(getByText('Divlo')).toBeInTheDocument()
|
expect(getByText('Divlo')).toBeInTheDocument()
|
||||||
expect(getByText(version)).toBeInTheDocument()
|
expect(versionLink).toBeInTheDocument()
|
||||||
|
expect(versionLink.href).toEqual(
|
||||||
|
`https://github.com/Divlo/Divlo/releases/tag/v${version}`
|
||||||
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
8
cypress.json
Normal file
8
cypress.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"baseUrl": "http://localhost:3000",
|
||||||
|
"pluginsFile": false,
|
||||||
|
"supportFile": false,
|
||||||
|
"fixturesFolder": false,
|
||||||
|
"video": false,
|
||||||
|
"screenshotOnRunFailure": false
|
||||||
|
}
|
47
cypress/integration/common/Header.spec.ts
Normal file
47
cypress/integration/common/Header.spec.ts
Normal 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')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
7
cypress/integration/pages/404.spec.ts
Normal file
7
cypress/integration/pages/404.spec.ts
Normal 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')
|
||||||
|
})
|
||||||
|
})
|
7
cypress/integration/pages/500.spec.ts
Normal file
7
cypress/integration/pages/500.spec.ts
Normal 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')
|
||||||
|
})
|
||||||
|
})
|
19
cypress/integration/pages/index.spec.ts
Normal file
19
cypress/integration/pages/index.spec.ts
Normal 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
9
cypress/tsconfig.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"noEmit": true,
|
||||||
|
"types": ["cypress"],
|
||||||
|
"isolatedModules": false
|
||||||
|
},
|
||||||
|
"include": ["../node_modules/cypress", "./**/*.ts"]
|
||||||
|
}
|
@ -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
14
jest.config.json
Normal 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"
|
||||||
|
]
|
||||||
|
}
|
8073
package-lock.json
generated
8073
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
52
package.json
52
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "divlo",
|
"name": "divlo",
|
||||||
"version": "1.3.4",
|
"version": "1.3.5",
|
||||||
"private": true,
|
"private": true,
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -21,8 +21,10 @@
|
|||||||
"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",
|
"deploy": "vercel",
|
||||||
"postinstall": "husky install"
|
"postinstall": "husky install"
|
||||||
@ -34,52 +36,54 @@
|
|||||||
"@fortawesome/free-solid-svg-icons": "5.15.4",
|
"@fortawesome/free-solid-svg-icons": "5.15.4",
|
||||||
"@fortawesome/react-fontawesome": "0.1.15",
|
"@fortawesome/react-fontawesome": "0.1.15",
|
||||||
"classnames": "2.3.1",
|
"classnames": "2.3.1",
|
||||||
"html-react-parser": "1.2.7",
|
"html-react-parser": "1.2.8",
|
||||||
"next": "11.1.0",
|
"next": "11.1.2",
|
||||||
"next-pwa": "5.2.24",
|
"next-pwa": "5.3.1",
|
||||||
"next-themes": "0.0.15",
|
"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": "5.2.0",
|
"read-pkg": "7.0.0",
|
||||||
|
"sharp": "0.29.0",
|
||||||
"universal-cookie": "4.0.4"
|
"universal-cookie": "4.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "13.1.0",
|
"@commitlint/cli": "13.1.0",
|
||||||
"@commitlint/config-conventional": "13.1.0",
|
"@commitlint/config-conventional": "13.1.0",
|
||||||
"@lhci/cli": "0.8.0",
|
"@lhci/cli": "0.8.1",
|
||||||
"@saithodev/semantic-release-backmerge": "1.5.3",
|
"@saithodev/semantic-release-backmerge": "1.5.3",
|
||||||
"@semantic-release/git": "9.0.0",
|
"@semantic-release/git": "9.0.0",
|
||||||
"@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": "27.0.0",
|
"@types/jest": "27.0.1",
|
||||||
"@types/node": "16.6.0",
|
"@types/node": "16.7.10",
|
||||||
"@types/react": "17.0.17",
|
"@types/react": "17.0.19",
|
||||||
"@types/styled-jsx": "2.2.9",
|
"@typescript-eslint/eslint-plugin": "4.30.0",
|
||||||
"@typescript-eslint/eslint-plugin": "4.29.1",
|
"autoprefixer": "10.3.3",
|
||||||
"autoprefixer": "10.3.1",
|
"babel-jest": "27.1.0",
|
||||||
"babel-jest": "27.0.6",
|
"cypress": "8.3.1",
|
||||||
"dockerfilelint": "1.8.0",
|
"dockerfilelint": "1.8.0",
|
||||||
"editorconfig-checker": "4.0.2",
|
"editorconfig-checker": "4.0.2",
|
||||||
"eslint": "7.32.0",
|
"eslint": "7.32.0",
|
||||||
"eslint-config-next": "11.1.0",
|
"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.24.0",
|
"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",
|
||||||
"eslint-plugin-unicorn": "35.0.0",
|
"eslint-plugin-unicorn": "35.0.0",
|
||||||
"husky": "7.0.1",
|
"husky": "7.0.2",
|
||||||
"jest": "27.0.6",
|
"jest": "27.1.0",
|
||||||
"lint-staged": "11.1.2",
|
"lint-staged": "11.1.2",
|
||||||
"markdownlint-cli": "0.28.1",
|
"markdownlint-cli": "0.28.1",
|
||||||
"next-secure-headers": "2.2.0",
|
"next-secure-headers": "2.2.0",
|
||||||
"postcss": "8.3.6",
|
"postcss": "8.3.6",
|
||||||
"prettier": "2.3.2",
|
"prettier": "2.3.2",
|
||||||
"semantic-release": "17.4.4",
|
"semantic-release": "17.4.7",
|
||||||
"tailwindcss": "2.2.7",
|
"start-server-and-test": "1.13.1",
|
||||||
"typescript": "4.3.5",
|
"tailwindcss": "2.2.9",
|
||||||
|
"typescript": "4.4.2",
|
||||||
"vercel": "23.1.2"
|
"vercel": "23.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { GetStaticProps } from 'next'
|
import { GetStaticProps } from 'next'
|
||||||
import useTranslation from 'next-translate/useTranslation'
|
import useTranslation from 'next-translate/useTranslation'
|
||||||
import readPackageJSON from 'read-pkg'
|
|
||||||
|
|
||||||
import { ErrorPage } from 'components/ErrorPage'
|
import { ErrorPage } from 'components/ErrorPage'
|
||||||
import { Head } from 'components/Head'
|
import { Head } from 'components/Head'
|
||||||
@ -25,7 +24,8 @@ const Error404: React.FC<FooterProps> = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
|
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
|
||||||
const { version } = await readPackageJSON()
|
const { readPackage } = await import('read-pkg')
|
||||||
|
const { version } = await readPackage()
|
||||||
return { props: { version } }
|
return { props: { version } }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { GetStaticProps } from 'next'
|
import { GetStaticProps } from 'next'
|
||||||
import useTranslation from 'next-translate/useTranslation'
|
import useTranslation from 'next-translate/useTranslation'
|
||||||
import readPackageJSON from 'read-pkg'
|
|
||||||
|
|
||||||
import { ErrorPage } from 'components/ErrorPage'
|
import { ErrorPage } from 'components/ErrorPage'
|
||||||
import { Head } from 'components/Head'
|
import { Head } from 'components/Head'
|
||||||
@ -25,7 +24,8 @@ const Error500: React.FC<FooterProps> = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
|
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
|
||||||
const { version } = await readPackageJSON()
|
const { readPackage } = await import('read-pkg')
|
||||||
|
const { version } = await readPackage()
|
||||||
return { props: { version } }
|
return { props: { version } }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ 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'
|
||||||
|
|
||||||
const universalCookie = new UniversalCookie()
|
const universalCookie = new UniversalCookie()
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { GetStaticProps } from 'next'
|
import { GetStaticProps } from 'next'
|
||||||
import useTranslation from 'next-translate/useTranslation'
|
import useTranslation from 'next-translate/useTranslation'
|
||||||
import readPackageJSON from 'read-pkg'
|
|
||||||
|
|
||||||
import { RevealFade } from 'components/design/RevealFade'
|
import { RevealFade } from 'components/design/RevealFade'
|
||||||
import { Section } from 'components/design/Section'
|
import { Section } from 'components/design/Section'
|
||||||
@ -71,7 +70,8 @@ const Home: React.FC<FooterProps> = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
|
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
|
||||||
const { version } = await readPackageJSON()
|
const { readPackage } = await import('read-pkg')
|
||||||
|
const { version } = await readPackage()
|
||||||
return { props: { version } }
|
return { props: { version } }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 92 KiB |
@ -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,
|
||||||
|
Reference in New Issue
Block a user