diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 66e1c9a..0000000 --- a/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -.next -.lighthouseci -coverage -node_modules -next-env.d.ts -**/workbox-*.js -**/sw.js diff --git a/.eslintrc.json b/.eslintrc.json index 380586a..c474feb 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,8 +6,7 @@ }, "env": { "node": true, - "browser": true, - "jest": true + "browser": true }, "rules": { "prettier/prettier": "error", diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 6e8df8b..7a275b7 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,10 +1,6 @@ { "*": ["editorconfig-checker"], - "*.{js,jsx,ts,tsx}": [ - "prettier --write", - "eslint --fix", - "jest --findRelatedTests" - ], + "*.{js,jsx,ts,tsx}": ["prettier --write", "eslint --fix"], "*.{css,scss,sass,json,jsonc,yml,yaml}": ["prettier --write"], - "*.md": ["prettier --write", "markdownlint --dot --fix"] + "*.{md,mdx}": ["prettier --write", "markdownlint-cli2 --fix"] } diff --git a/.markdownlint-cli2.jsonc b/.markdownlint-cli2.jsonc new file mode 100644 index 0000000..66f8351 --- /dev/null +++ b/.markdownlint-cli2.jsonc @@ -0,0 +1,11 @@ +{ + "config": { + "default": true, + "MD013": false, + "MD024": false, + "MD033": false, + "MD041": false + }, + "globs": ["**/*.{md,mdx}"], + "ignores": ["**/node_modules"] +} diff --git a/.markdownlint.json b/.markdownlint.json deleted file mode 100644 index 1dd8622..0000000 --- a/.markdownlint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD013": false, - "MD033": false, - "MD041": false -} diff --git a/Dockerfile b/Dockerfile index cf996dc..5f4ae08 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,15 @@ -FROM node:16.16.0 AS dependencies +FROM node:16.17.0 AS dependencies WORKDIR /usr/src/app COPY ./package*.json ./ RUN npm install -FROM node:16.16.0 AS builder +FROM node:16.17.0 AS builder WORKDIR /usr/src/app COPY ./ ./ COPY --from=dependencies /usr/src/app/node_modules ./node_modules RUN npm run build -FROM node:16.16.0 AS runner +FROM node:16.17.0 AS runner WORKDIR /usr/src/app ENV NODE_ENV=production COPY --from=builder /usr/src/app/next.config.js ./next.config.js diff --git a/components/Application/Channels/Channel/Channel.tsx b/components/Application/Channels/Channel.tsx similarity index 86% rename from components/Application/Channels/Channel/Channel.tsx rename to components/Application/Channels/Channel.tsx index 7750d8a..8688042 100644 --- a/components/Application/Channels/Channel/Channel.tsx +++ b/components/Application/Channels/Channel.tsx @@ -3,10 +3,10 @@ import Link from 'next/link' import { useRouter } from 'next/router' import { CogIcon } from '@heroicons/react/solid' -import { GuildsChannelsPath } from '../../Application' -import { Channel as ChannelType } from '../../../../models/Channel' -import { useGuildMember } from '../../../../contexts/GuildMember' -import { IconButton } from '../../../design/IconButton' +import { GuildsChannelsPath } from '../Application' +import { Channel as ChannelType } from '../../../models/Channel' +import { useGuildMember } from '../../../contexts/GuildMember' +import { IconButton } from '../../design/IconButton' export interface ChannelProps { path: GuildsChannelsPath diff --git a/components/Application/Channels/Channel/index.ts b/components/Application/Channels/Channel/index.ts deleted file mode 100644 index 8d34a7c..0000000 --- a/components/Application/Channels/Channel/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Channel' diff --git a/components/Application/Guilds/Guild/Guild.tsx b/components/Application/Guilds/Guild.tsx similarity index 85% rename from components/Application/Guilds/Guild/Guild.tsx rename to components/Application/Guilds/Guild.tsx index 45b81bb..c7e33b4 100644 --- a/components/Application/Guilds/Guild/Guild.tsx +++ b/components/Application/Guilds/Guild.tsx @@ -1,7 +1,7 @@ import Image from 'next/image' -import { GuildWithDefaultChannelId } from '../../../../models/Guild' -import { IconLink } from '../../../design/IconLink' +import { GuildWithDefaultChannelId } from '../../../models/Guild' +import { IconLink } from '../../design/IconLink' export interface GuildProps { guild: GuildWithDefaultChannelId diff --git a/components/Application/Guilds/Guild/Guild.test.tsx b/components/Application/Guilds/Guild/Guild.test.tsx deleted file mode 100644 index 4264f1e..0000000 --- a/components/Application/Guilds/Guild/Guild.test.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { render } from '@testing-library/react' - -import { Guild } from './Guild' -import { guildExample } from '../../../../cypress/fixtures/guilds/guild' - -describe('', () => { - it('should render successfully', () => { - const { baseElement } = render( - - ) - expect(baseElement).toBeTruthy() - }) -}) diff --git a/components/Application/Guilds/Guild/index.ts b/components/Application/Guilds/Guild/index.ts deleted file mode 100644 index 847eb76..0000000 --- a/components/Application/Guilds/Guild/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Guild' diff --git a/components/Application/JoinGuildsPublic/GuildPublic/GuildPublic.tsx b/components/Application/JoinGuildsPublic/GuildPublic.tsx similarity index 94% rename from components/Application/JoinGuildsPublic/GuildPublic/GuildPublic.tsx rename to components/Application/JoinGuildsPublic/GuildPublic.tsx index 97f7aca..938934e 100644 --- a/components/Application/JoinGuildsPublic/GuildPublic/GuildPublic.tsx +++ b/components/Application/JoinGuildsPublic/GuildPublic.tsx @@ -5,13 +5,13 @@ import useTranslation from 'next-translate/useTranslation' import classNames from 'classnames' import axios from 'axios' -import { Emoji } from '../../../Emoji' -import { ConfirmPopup } from '../../ConfirmPopup' +import { Emoji } from '../../Emoji' +import { ConfirmPopup } from '../ConfirmPopup' import { GuildPublic as GuildPublicType, GuildWithDefaultChannelId -} from '../../../../models/Guild' -import { useAuthentication } from '../../../../tools/authentication' +} from '../../../models/Guild' +import { useAuthentication } from '../../../tools/authentication' export interface GuildPublicProps { guild: GuildPublicType diff --git a/components/Application/JoinGuildsPublic/GuildPublic/index.ts b/components/Application/JoinGuildsPublic/GuildPublic/index.ts deleted file mode 100644 index 06029b8..0000000 --- a/components/Application/JoinGuildsPublic/GuildPublic/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './GuildPublic' diff --git a/components/Application/Members/Member/Member.tsx b/components/Application/Members/Member.tsx similarity index 92% rename from components/Application/Members/Member/Member.tsx rename to components/Application/Members/Member.tsx index 53e1e9a..93c3147 100644 --- a/components/Application/Members/Member/Member.tsx +++ b/components/Application/Members/Member.tsx @@ -1,8 +1,8 @@ import Image from 'next/image' import Link from 'next/link' -import { MemberWithPublicUser } from '../../../../models/Member' -import { Emoji } from '../../../Emoji' +import { MemberWithPublicUser } from '../../../models/Member' +import { Emoji } from '../../Emoji' export interface MemberProps { member: MemberWithPublicUser diff --git a/components/Application/Members/Member/index.ts b/components/Application/Members/Member/index.ts deleted file mode 100644 index 96315a7..0000000 --- a/components/Application/Members/Member/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Member' diff --git a/components/Application/PopupGuild/PopupGuild.test.tsx b/components/Application/PopupGuild/PopupGuild.test.tsx deleted file mode 100644 index 1549371..0000000 --- a/components/Application/PopupGuild/PopupGuild.test.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { render } from '@testing-library/react' - -import { PopupGuild } from './PopupGuild' - -describe('', () => { - it('should render successfully', () => { - const { baseElement } = render() - expect(baseElement).toBeTruthy() - }) -}) diff --git a/components/Application/PopupGuild/PopupGuild.tsx b/components/Application/PopupGuild/PopupGuild.tsx index ec2f901..f5858ff 100644 --- a/components/Application/PopupGuild/PopupGuild.tsx +++ b/components/Application/PopupGuild/PopupGuild.tsx @@ -3,7 +3,8 @@ import { PlusSmIcon, ArrowDownIcon } from '@heroicons/react/solid' import classNames from 'classnames' import Image from 'next/image' -import { PopupGuildCard } from './PopupGuildCard/PopupGuildCard' +import { PopupGuildCard } from './PopupGuildCard' + export interface PopupGuildProps { className?: string } diff --git a/components/Application/PopupGuild/PopupGuildCard/PopupGuildCard.tsx b/components/Application/PopupGuild/PopupGuildCard.tsx similarity index 100% rename from components/Application/PopupGuild/PopupGuildCard/PopupGuildCard.tsx rename to components/Application/PopupGuild/PopupGuildCard.tsx diff --git a/components/Application/PopupGuild/PopupGuildCard/PopupGuildCard.test.tsx b/components/Application/PopupGuild/PopupGuildCard/PopupGuildCard.test.tsx deleted file mode 100644 index 140293f..0000000 --- a/components/Application/PopupGuild/PopupGuildCard/PopupGuildCard.test.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { render } from '@testing-library/react' -import { PlusSmIcon } from '@heroicons/react/solid' -import Image from 'next/image' - -import { PopupGuildCard } from './PopupGuildCard' - -describe('', () => { - it('should render successfully', () => { - const { baseElement } = render( - - } - description='Create your own guild and manage everything within a few clicks !' - link={{ - icon: , - text: 'Create a server', - href: '/application/guilds/create' - }} - /> - ) - expect(baseElement).toBeTruthy() - }) -}) diff --git a/components/Application/PopupGuild/PopupGuildCard/index.ts b/components/Application/PopupGuild/PopupGuildCard/index.ts deleted file mode 100644 index 99d186f..0000000 --- a/components/Application/PopupGuild/PopupGuildCard/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './PopupGuildCard' diff --git a/components/Application/Sidebar/Sidebar.test.tsx b/components/Application/Sidebar/Sidebar.test.tsx deleted file mode 100644 index 97593f9..0000000 --- a/components/Application/Sidebar/Sidebar.test.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { render } from '@testing-library/react' - -import { Sidebar } from './Sidebar' - -describe('', () => { - it('should render successfully', () => { - const { baseElement } = render( - - ) - expect(baseElement).toBeTruthy() - }) -}) diff --git a/components/Application/UserProfile/UserProfile.test.tsx b/components/Application/UserProfile/UserProfile.test.tsx deleted file mode 100644 index e254492..0000000 --- a/components/Application/UserProfile/UserProfile.test.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { render } from '@testing-library/react' - -import { - guildExample, - guildExample2 -} from '../../../cypress/fixtures/guilds/guild' -import { - userExample, - userSettingsExample -} from '../../../cypress/fixtures/users/user' -import { UserProfile } from './UserProfile' - -describe('', () => { - it('should render successfully', () => { - const { baseElement } = render( - - ) - expect(baseElement).toBeTruthy() - }) -}) diff --git a/components/Emoji/isStringWithOnlyOneEmoji.test.ts b/components/Emoji/isStringWithOnlyOneEmoji.test.ts deleted file mode 100644 index 168a605..0000000 --- a/components/Emoji/isStringWithOnlyOneEmoji.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { isStringWithOnlyOneEmoji } from './isStringWithOnlyOneEmoji' - -describe('components/Emoji/isStringWithOnlyOneEmoji', () => { - it('returns true with a string with only one emoji', () => { - expect(isStringWithOnlyOneEmoji(':wave:')).toBeTruthy() - expect(isStringWithOnlyOneEmoji(':smile:')).toBeTruthy() - }) - - it('returns false with a string with multiple emoji or with text', () => { - expect(isStringWithOnlyOneEmoji(':wave: :smile:')).toBeFalsy() - expect(isStringWithOnlyOneEmoji(':wave: some text')).toBeFalsy() - expect(isStringWithOnlyOneEmoji('some text :wave:')).toBeFalsy() - }) - - it('returns false with a string without emoji', () => { - expect(isStringWithOnlyOneEmoji('some text')).toBeFalsy() - }) -}) diff --git a/components/ErrorPage/ErrorPage.tsx b/components/ErrorPage.tsx similarity index 100% rename from components/ErrorPage/ErrorPage.tsx rename to components/ErrorPage.tsx diff --git a/components/ErrorPage/ErrorPage.test.tsx b/components/ErrorPage/ErrorPage.test.tsx deleted file mode 100644 index fdb74ec..0000000 --- a/components/ErrorPage/ErrorPage.test.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { render } from '@testing-library/react' - -import { ErrorPage } from '.' - -describe('', () => { - it('should render the message and statusCode', () => { - const messageContent = 'message content' - const statusCode = 404 - const { getByText } = render( - - ) - expect(getByText(messageContent)).toBeInTheDocument() - expect(getByText(statusCode)).toBeInTheDocument() - }) -}) diff --git a/components/ErrorPage/index.ts b/components/ErrorPage/index.ts deleted file mode 100644 index 61b2c2a..0000000 --- a/components/ErrorPage/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './ErrorPage' diff --git a/components/Footer/Footer.test.tsx b/components/Footer/Footer.test.tsx deleted file mode 100644 index 3e95fac..0000000 --- a/components/Footer/Footer.test.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { render } from '@testing-library/react' - -import { Footer } from '.' - -describe('