diff --git a/.husky/pre-commit b/.husky/pre-commit index b56c5f0..41054f0 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,10 +2,10 @@ npx lint-staged # Verify typescript staged files -npm run type-check +node --run type-check # Run tests -npm run test +node --run test # Build the app npx turbo build diff --git a/.lintstagedrc.json b/.lintstagedrc.json index a9f9ed8..82758d8 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,3 +1,3 @@ { - "**/*.{js,jsx,ts,tsx,json,css,md}": ["npm run format"] + "**/*.{js,jsx,ts,tsx,json,css,md}": ["node --run format"] } diff --git a/.nvmrc b/.nvmrc index 209e3ef..2bd5a0a 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20 +22 diff --git a/app/[locale]/404/page.tsx b/app/[locale]/404/page.tsx index 734dd50..396d792 100644 --- a/app/[locale]/404/page.tsx +++ b/app/[locale]/404/page.tsx @@ -1,10 +1,10 @@ import { ArrowRightIcon } from '@heroicons/react/24/outline'; import { getTranslations, unstable_setRequestLocale } from 'next-intl/server'; -import ButtonLink from '~/components/Common/Button/Link'; +import ButtonLink from '~/components/Common/Button/Link/index.tsx'; import styles from './page.module.css'; import type { FC } from 'react'; import type { Metadata } from 'next'; -import type { BaseParams } from '~/types/params'; +import type { BaseParams } from '~/types/params.ts'; type NotFoundProps = { params: BaseParams; diff --git a/app/[locale]/about/page.tsx b/app/[locale]/about/page.tsx index 6a55c4d..6610b8d 100644 --- a/app/[locale]/about/page.tsx +++ b/app/[locale]/about/page.tsx @@ -1,12 +1,12 @@ import { notFound } from 'next/navigation'; import compileMDX from '~/lib/mdx'; -import { getContent } from '~/lib/content'; -import { aboutMdxComponents } from '~/lib/mdxComponents'; -import ArticleLayout from '~/components/Layout/Article'; +import { getContent } from '~/lib/content.ts'; +import { aboutMdxComponents } from '~/lib/mdxComponents.ts'; +import ArticleLayout from '~/components/Layout/Article/index.tsx'; import type { FC } from 'react'; import type { Metadata } from 'next'; -import type { AboutFrontmatter } from '~/types/frontmatter'; -import type { BaseParams } from '~/types/params'; +import type { AboutFrontmatter } from '~/types/frontmatter.ts'; +import type { BaseParams } from '~/types/params.ts'; type PageProps = { params: BaseParams; diff --git a/app/[locale]/blog/[[...page]]/page.tsx b/app/[locale]/blog/[[...page]]/page.tsx index 6f0f2de..2e16c32 100644 --- a/app/[locale]/blog/[[...page]]/page.tsx +++ b/app/[locale]/blog/[[...page]]/page.tsx @@ -1,16 +1,16 @@ import { RssIcon } from '@heroicons/react/24/solid'; import { notFound } from 'next/navigation'; import { getTranslations } from 'next-intl/server'; -import BaseLayout from '~/components/Layout/Base'; -import ButtonLink from '~/components/Common/Button/Link'; -import PostCard from '~/components/Common/PostCard'; -import Pagination from '~/components/Common/Pagination'; -import { getSlugs, getFrontmatter } from '~/lib/content'; +import BaseLayout from '~/components/Layout/Base/index.tsx'; +import ButtonLink from '~/components/Common/Button/Link/index.tsx'; +import PostCard from '~/components/Common/PostCard/index.tsx'; +import Pagination from '~/components/Common/Pagination/index.tsx'; +import { getSlugs, getFrontmatter } from '~/lib/content.ts'; import styles from './page.module.css'; import type { FC } from 'react'; import type { Metadata } from 'next'; -import type { BlogFrontmatter } from '~/types/frontmatter'; -import type { BaseParams } from '~/types/params'; +import type { BlogFrontmatter } from '~/types/frontmatter.ts'; +import type { BaseParams } from '~/types/params.ts'; const MAX_POSTS_PER_PAGE = 6; diff --git a/app/[locale]/blog/post/[post]/page.tsx b/app/[locale]/blog/post/[post]/page.tsx index 0083a5a..b84e0a6 100644 --- a/app/[locale]/blog/post/[post]/page.tsx +++ b/app/[locale]/blog/post/[post]/page.tsx @@ -1,13 +1,13 @@ import { notFound } from 'next/navigation'; -import compileMDX from '~/lib/mdx'; -import { getContent, getSlugs } from '~/lib/content'; -import PostLayout from '~/components/Layout/Post'; +import compileMDX from '~/lib/mdx.ts'; +import { getContent, getSlugs } from '~/lib/content.ts'; +import PostLayout from '~/components/Layout/Post/index.tsx'; import { blogMdxComponents } from '~/lib/mdxComponents'; -import { getGithubProfileUrl } from '~/utils/gitHubUtils'; +import { getGithubProfileUrl } from '~/utils/gitHubUtils.ts'; import type { FC } from 'react'; import type { Metadata } from 'next'; -import type { BlogFrontmatter } from '~/types/frontmatter'; -import type { BaseParams } from '~/types/params'; +import type { BlogFrontmatter } from '~/types/frontmatter.ts'; +import type { BaseParams } from '~/types/params.ts'; type PageProps = { params: { diff --git a/app/[locale]/feed/blog/rss.xml/route.ts b/app/[locale]/feed/blog/rss.xml/route.ts index 8e59e28..f65cab7 100644 --- a/app/[locale]/feed/blog/rss.xml/route.ts +++ b/app/[locale]/feed/blog/rss.xml/route.ts @@ -1,6 +1,6 @@ -import { generateRssFeed } from '~/lib/rss'; -import { availableLocales } from '~/utils/i18n'; -import type { BaseParams } from '~/types/params'; +import { generateRssFeed } from '~/lib/rss.ts'; +import { availableLocales } from '~/utils/i18n/index.ts'; +import type { BaseParams } from '~/types/params.ts'; export const generateStaticParams = () => { return availableLocales.map(lang => ({ diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index d11abbf..993d3d6 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -2,11 +2,11 @@ import { getTranslations, unstable_setRequestLocale } from 'next-intl/server'; import classNames from 'classnames'; import { GeistSans } from 'geist/font/sans'; import { GeistMono } from 'geist/font/mono'; -import { LocaleProvider } from '~/providers/localeProvider'; -import { availableLocales } from '~/utils/i18n'; +import { LocaleProvider } from '~/providers/localeProvider.tsx'; +import { availableLocales } from '~/utils/i18n/index.ts'; import type { FC, PropsWithChildren } from 'react'; import type { Metadata } from 'next'; -import type { BaseParams } from '~/types/params'; +import type { BaseParams } from '~/types/params.ts'; import '~/styles/globals.css'; type RootLayoutProps = PropsWithChildren<{ diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index eb4d2fc..cb5f8fd 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -1,6 +1,6 @@ import { getTranslations } from 'next-intl/server'; -import BaseLayout from '~/components/Layout/Base'; -import LandingPage from '~/components/Home'; +import BaseLayout from '~/components/Layout/Base/index.tsx'; +import LandingPage from '~/components/Home/index.tsx'; import type { FC } from 'react'; import type { Metadata } from 'next'; diff --git a/app/[locale]/projects/page.tsx b/app/[locale]/projects/page.tsx index 2ceff90..7b64646 100644 --- a/app/[locale]/projects/page.tsx +++ b/app/[locale]/projects/page.tsx @@ -1,12 +1,12 @@ import { notFound } from 'next/navigation'; import compileMDX from '~/lib/mdx'; -import { getContent } from '~/lib/content'; -import { projectsMdxComponents } from '~/lib/mdxComponents'; -import ArticleLayout from '~/components/Layout/Article'; +import { getContent } from '~/lib/content.ts'; +import { projectsMdxComponents } from '~/lib/mdxComponents.ts'; +import ArticleLayout from '~/components/Layout/Article/index.tsx'; import type { FC } from 'react'; import type { Metadata } from 'next'; -import type { ProjectsFrontmatter } from '~/types/frontmatter'; -import type { BaseParams } from '~/types/params'; +import type { ProjectsFrontmatter } from '~/types/frontmatter.ts'; +import type { BaseParams } from '~/types/params.ts'; type PageProps = { params: BaseParams; diff --git a/app/sitemap.ts b/app/sitemap.ts index 2041dc2..068910c 100644 --- a/app/sitemap.ts +++ b/app/sitemap.ts @@ -1,5 +1,5 @@ import { generateSitemap } from '~/lib/sitemap'; -import { availableLocaleCodes } from '~/utils/i18n'; +import { availableLocaleCodes } from '~/utils/i18n/index.ts'; import type { MetadataRoute } from 'next'; export default async function sitemap(): Promise { diff --git a/biome.json b/biome.json index ea46499..d1edd05 100644 --- a/biome.json +++ b/biome.json @@ -52,14 +52,16 @@ "noUnusedVariables": "error", "useArrayLiterals": "off", "noUnknownFunction": "error", - "noUnknownUnit": "error" + "noUnknownUnit": "error", + "useImportExtensions": "error" }, "style": { "noNamespace": "error", "useAsConstAssertion": "error", "useBlockStatements": "off", "useNodeAssertStrict": "warn", - "useNodejsImportProtocol": "error" + "useNodejsImportProtocol": "error", + "useImportType": "error" }, "suspicious": { "noExplicitAny": "error", diff --git a/components/Common/ActiveLink.tsx b/components/Common/ActiveLink.tsx index 2eeafa0..f54666c 100644 --- a/components/Common/ActiveLink.tsx +++ b/components/Common/ActiveLink.tsx @@ -1,7 +1,7 @@ 'use client'; import classNames from 'classnames'; import { usePathname } from 'next/navigation'; -import LocalizedLink from './LocalizedLink'; +import LocalizedLink from './LocalizedLink.tsx'; import type { FC, PropsWithChildren } from 'react'; type ActiveLinkProps = PropsWithChildren<{ diff --git a/components/Common/AuthorsList/index.stories.tsx b/components/Common/AuthorsList/index.stories.tsx index 376b5e5..3058e06 100644 --- a/components/Common/AuthorsList/index.stories.tsx +++ b/components/Common/AuthorsList/index.stories.tsx @@ -1,4 +1,4 @@ -import AuthorsList from '.'; +import AuthorsList from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Common/AuthorsList/index.tsx b/components/Common/AuthorsList/index.tsx index 07d569a..d54d017 100644 --- a/components/Common/AuthorsList/index.tsx +++ b/components/Common/AuthorsList/index.tsx @@ -1,6 +1,6 @@ import { getGitHubAvatarUrl } from '~/utils/gitHubUtils'; -import { getAcronymFromString } from '~/utils/stringUtils'; -import { Avatar, AvatarImage, AvatarFallback } from '../Avatar'; +import { getAcronymFromString } from '~/utils/stringUtils.ts'; +import { Avatar, AvatarImage, AvatarFallback } from '../Avatar/index.tsx'; import styles from './index.module.css'; import type { FC } from 'react'; diff --git a/components/Common/Avatar/index.stories.tsx b/components/Common/Avatar/index.stories.tsx index 5631ede..1daf408 100644 --- a/components/Common/Avatar/index.stories.tsx +++ b/components/Common/Avatar/index.stories.tsx @@ -1,6 +1,6 @@ import { getGitHubAvatarUrl } from '~/utils/gitHubUtils'; import { getAcronymFromString } from '~/utils/stringUtils'; -import { Avatar, AvatarImage, AvatarFallback } from '.'; +import { Avatar, AvatarImage, AvatarFallback } from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Common/Blockquote/index.stories.tsx b/components/Common/Blockquote/index.stories.tsx index 2ef8684..4b049ac 100644 --- a/components/Common/Blockquote/index.stories.tsx +++ b/components/Common/Blockquote/index.stories.tsx @@ -1,4 +1,4 @@ -import Blockquote from './'; +import Blockquote from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Common/Button/Link/index.stories.tsx b/components/Common/Button/Link/index.stories.tsx index 927895c..99f67b8 100644 --- a/components/Common/Button/Link/index.stories.tsx +++ b/components/Common/Button/Link/index.stories.tsx @@ -1,5 +1,5 @@ import { ArrowDownIcon } from '@heroicons/react/20/solid'; -import ButtonLink from '.'; +import ButtonLink from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Common/Button/index.stories.tsx b/components/Common/Button/index.stories.tsx index ac3028c..aa26670 100644 --- a/components/Common/Button/index.stories.tsx +++ b/components/Common/Button/index.stories.tsx @@ -1,5 +1,5 @@ import { ArrowDownIcon } from '@heroicons/react/20/solid'; -import Button from '.'; +import Button from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Common/Codebox/index.tsx b/components/Common/Codebox/index.tsx index 0ea1d85..09b17ca 100644 --- a/components/Common/Codebox/index.tsx +++ b/components/Common/Codebox/index.tsx @@ -1,7 +1,7 @@ import { DocumentIcon } from '@heroicons/react/24/outline'; import { isValidElement } from 'react'; import { codeToHtml } from 'shiki/bundle/web'; -import CopyButton from '../CopyButton'; +import CopyButton from '../CopyButton/index.tsx'; import styles from './index.module.css'; import type { FC, ReactNode } from 'react'; diff --git a/components/Common/CopyButton/index.tsx b/components/Common/CopyButton/index.tsx index 063c741..b0ff00e 100644 --- a/components/Common/CopyButton/index.tsx +++ b/components/Common/CopyButton/index.tsx @@ -1,7 +1,7 @@ 'use client'; import { useTranslations } from 'next-intl'; -import useCopyToClipboard from '~/hooks/useCopyToClipboard'; -import Button from '../Button'; +import useCopyToClipboard from '~/hooks/useCopyToClipboard.ts'; +import Button from '../Button/index.tsx'; import type { FC } from 'react'; type CopyButtonProps = { diff --git a/components/Common/DotsIllustration/index.stories.tsx b/components/Common/DotsIllustration/index.stories.tsx index 9255df2..e745b93 100644 --- a/components/Common/DotsIllustration/index.stories.tsx +++ b/components/Common/DotsIllustration/index.stories.tsx @@ -1,4 +1,4 @@ -import DotsIllustration from '.'; +import DotsIllustration from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Common/Dropdown/index.stories.tsx b/components/Common/Dropdown/index.stories.tsx index 629a976..47f14f6 100644 --- a/components/Common/Dropdown/index.stories.tsx +++ b/components/Common/Dropdown/index.stories.tsx @@ -1,5 +1,5 @@ import { LanguageIcon } from '@heroicons/react/24/outline'; -import Dropdown from '.'; +import Dropdown from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Common/Dropdown/index.tsx b/components/Common/Dropdown/index.tsx index fd01f91..935c36d 100644 --- a/components/Common/Dropdown/index.tsx +++ b/components/Common/Dropdown/index.tsx @@ -1,6 +1,6 @@ import * as RadixDropdownMenu from '@radix-ui/react-dropdown-menu'; import classNames from 'classnames'; -import Button from '../Button'; +import Button from '../Button/index.tsx'; import styles from './index.module.css'; import type { FC, ReactNode } from 'react'; diff --git a/components/Common/EnventsCard/index.stories.tsx b/components/Common/EnventsCard/index.stories.tsx index e140f04..28f6d9a 100644 --- a/components/Common/EnventsCard/index.stories.tsx +++ b/components/Common/EnventsCard/index.stories.tsx @@ -1,4 +1,4 @@ -import EventsCard from '.'; +import EventsCard from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Common/Pagination/index.stories.tsx b/components/Common/Pagination/index.stories.tsx index 9683797..b21b9fc 100644 --- a/components/Common/Pagination/index.stories.tsx +++ b/components/Common/Pagination/index.stories.tsx @@ -1,4 +1,4 @@ -import Pagination from './'; +import Pagination from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Common/Pagination/index.tsx b/components/Common/Pagination/index.tsx index dc34e64..aa57047 100644 --- a/components/Common/Pagination/index.tsx +++ b/components/Common/Pagination/index.tsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import { ArrowRightIcon, ArrowLeftIcon } from '@heroicons/react/24/outline'; import Link from 'next/link'; import { useTranslations } from 'next-intl'; -import ButtonLink from '../Button/Link'; +import ButtonLink from '../Button/Link/index.tsx'; import styles from './index.module.css'; import type { FC } from 'react'; diff --git a/components/Common/PostCard/index.stories.tsx b/components/Common/PostCard/index.stories.tsx index 1dacf4f..f132e6e 100644 --- a/components/Common/PostCard/index.stories.tsx +++ b/components/Common/PostCard/index.stories.tsx @@ -1,4 +1,4 @@ -import PostCard from '.'; +import PostCard from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Common/PostCard/index.tsx b/components/Common/PostCard/index.tsx index 706d398..5fcfc1f 100644 --- a/components/Common/PostCard/index.tsx +++ b/components/Common/PostCard/index.tsx @@ -1,5 +1,5 @@ import { getFormatter, getTranslations } from 'next-intl/server'; -import ButtonLink from '../Button/Link'; +import ButtonLink from '../Button/Link/index.tsx'; import styles from './index.module.css'; import type { FC } from 'react'; diff --git a/components/Common/ProjectCard/index.stories.tsx b/components/Common/ProjectCard/index.stories.tsx index 39fe8c2..b68bd56 100644 --- a/components/Common/ProjectCard/index.stories.tsx +++ b/components/Common/ProjectCard/index.stories.tsx @@ -1,4 +1,4 @@ -import ProjectCardProps from '.'; +import ProjectCardProps from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Common/ProjectCard/index.tsx b/components/Common/ProjectCard/index.tsx index 52b11ef..40e9764 100644 --- a/components/Common/ProjectCard/index.tsx +++ b/components/Common/ProjectCard/index.tsx @@ -1,6 +1,6 @@ import Image from 'next/image'; -import ButtonLink from '../Button/Link'; -import DotsIllustration from '../DotsIllustration'; +import ButtonLink from '../Button/Link/index.tsx'; +import DotsIllustration from '../DotsIllustration/index.tsx'; import styles from './index.module.css'; import type { FC } from 'react'; diff --git a/components/Common/TextWithImages/index.stories.tsx b/components/Common/TextWithImages/index.stories.tsx index 7f0fa5f..03320ab 100644 --- a/components/Common/TextWithImages/index.stories.tsx +++ b/components/Common/TextWithImages/index.stories.tsx @@ -1,4 +1,4 @@ -import TextWithImages from '.'; +import TextWithImages from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Common/TextWithImages/index.tsx b/components/Common/TextWithImages/index.tsx index 4ed198d..628e9ab 100644 --- a/components/Common/TextWithImages/index.tsx +++ b/components/Common/TextWithImages/index.tsx @@ -1,4 +1,4 @@ -import Images from './Images'; +import Images from './Images/index.tsx'; import styles from './index.module.css'; import type { FC, ReactNode } from 'react'; diff --git a/components/Common/TimeLine/index.stories.tsx b/components/Common/TimeLine/index.stories.tsx index 477104b..4606659 100644 --- a/components/Common/TimeLine/index.stories.tsx +++ b/components/Common/TimeLine/index.stories.tsx @@ -1,4 +1,4 @@ -import TimeLine from '.'; +import TimeLine from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Home/Hero/Images/index.stories.tsx b/components/Home/Hero/Images/index.stories.tsx index 2f72d7e..5893290 100644 --- a/components/Home/Hero/Images/index.stories.tsx +++ b/components/Home/Hero/Images/index.stories.tsx @@ -1,4 +1,4 @@ -import Images from '.'; +import Images from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Home/Hero/index.stories.tsx b/components/Home/Hero/index.stories.tsx index 540b75c..cea0f1c 100644 --- a/components/Home/Hero/index.stories.tsx +++ b/components/Home/Hero/index.stories.tsx @@ -1,4 +1,4 @@ -import Hero from '.'; +import Hero from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Home/Hero/index.tsx b/components/Home/Hero/index.tsx index 21bb912..af8a745 100644 --- a/components/Home/Hero/index.tsx +++ b/components/Home/Hero/index.tsx @@ -1,8 +1,8 @@ 'use client'; import { useTranslations } from 'next-intl'; -import { getAge, isBirthday } from '~/utils/date'; -import ButtonLink from '~/components/Common/Button/Link'; -import Images from './Images'; +import { getAge, isBirthday } from '~/utils/date.ts'; +import ButtonLink from '~/components/Common/Button/Link/index.tsx'; +import Images from './Images/index.tsx'; import styles from './index.module.css'; import type { FC } from 'react'; diff --git a/components/Home/SocialMediaList/index.stories.tsx b/components/Home/SocialMediaList/index.stories.tsx index 6735bd8..e6a9140 100644 --- a/components/Home/SocialMediaList/index.stories.tsx +++ b/components/Home/SocialMediaList/index.stories.tsx @@ -1,4 +1,4 @@ -import SocialMediaList from '.'; +import SocialMediaList from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Home/SocialMediaList/index.tsx b/components/Home/SocialMediaList/index.tsx index a9dcb32..0b3f49b 100644 --- a/components/Home/SocialMediaList/index.tsx +++ b/components/Home/SocialMediaList/index.tsx @@ -1,10 +1,10 @@ import Link from 'next/link'; -import Github from '~/components/Icons/Github'; -import Instagram from '~/components/Icons/Instagram'; -import LinkedIn from '~/components/Icons/Linkedin'; -import Mastodon from '~/components/Icons/Mastodon'; -import Twitch from '~/components/Icons/Twitch'; -import Twitter from '~/components/Icons/Twitter'; +import Github from '~/components/Icons/Github.tsx'; +import Instagram from '~/components/Icons/Instagram.tsx'; +import LinkedIn from '~/components/Icons/Linkedin.tsx'; +import Mastodon from '~/components/Icons/Mastodon.tsx'; +import Twitch from '~/components/Icons/Twitch.tsx'; +import Twitter from '~/components/Icons/Twitter.tsx'; import styles from './index.module.css'; import type { FC } from 'react'; diff --git a/components/Home/index.stories.tsx b/components/Home/index.stories.tsx index 7fdf787..7f9af53 100644 --- a/components/Home/index.stories.tsx +++ b/components/Home/index.stories.tsx @@ -1,4 +1,4 @@ -import LandingPage from '.'; +import LandingPage from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Home/index.tsx b/components/Home/index.tsx index af5af68..03458a6 100644 --- a/components/Home/index.tsx +++ b/components/Home/index.tsx @@ -1,6 +1,6 @@ -import Hero from '~/components/Home/Hero'; -import SocialMediaList from '~/components/Home/SocialMediaList'; -import WithEventsCard from '~/components/Logic/WithEnventsCard'; +import Hero from '~/components/Home/Hero/index.tsx'; +import SocialMediaList from '~/components/Home/SocialMediaList/index.tsx'; +import WithEventsCard from '~/components/Logic/WithEnventsCard.tsx'; import type { FC } from 'react'; const LandingPage: FC = () => ( diff --git a/components/Illustration/index.ts b/components/Illustration/index.ts index 9b3751b..46f80e9 100644 --- a/components/Illustration/index.ts +++ b/components/Illustration/index.ts @@ -1,2 +1,2 @@ -export { default as Neobrutalism1 } from './Neobrutalism1'; -export { default as Neobrutalism2 } from './NeoBrutalism2'; +export { default as Neobrutalism1 } from './Neobrutalism1.tsx'; +export { default as Neobrutalism2 } from './NeoBrutalism2.tsx'; diff --git a/components/Layout/Article/index.tsx b/components/Layout/Article/index.tsx index 24e01b0..73b3cdd 100644 --- a/components/Layout/Article/index.tsx +++ b/components/Layout/Article/index.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import BaseLayout from '~/components/Layout/Base'; +import BaseLayout from '~/components/Layout/Base/index.tsx'; import styles from './index.module.css'; import type { FC, PropsWithChildren } from 'react'; diff --git a/components/Layout/Base/index.tsx b/components/Layout/Base/index.tsx index a757d2e..5534676 100644 --- a/components/Layout/Base/index.tsx +++ b/components/Layout/Base/index.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; -import Footer from '~/components/Sections/Footer'; -import TopNav from '~/components/Sections/TopNav'; +import Footer from '~/components/Sections/Footer/index.tsx'; +import TopNav from '~/components/Sections/TopNav/index.tsx'; import styles from './index.module.css'; import type { FC, PropsWithChildren } from 'react'; diff --git a/components/Layout/Post/index.tsx b/components/Layout/Post/index.tsx index caa5a7d..121566a 100644 --- a/components/Layout/Post/index.tsx +++ b/components/Layout/Post/index.tsx @@ -1,5 +1,5 @@ -import BaseLayout from '~/components/Layout/Base'; -import AuthorsList from '~/components/Common/AuthorsList'; +import BaseLayout from '~/components/Layout/Base/index.tsx'; +import AuthorsList from '~/components/Common/AuthorsList/index.tsx'; import styles from './index.module.css'; import type { FC, PropsWithChildren } from 'react'; diff --git a/components/Logic/WithEnventsCard.tsx b/components/Logic/WithEnventsCard.tsx index 82f4382..bbd35e5 100644 --- a/components/Logic/WithEnventsCard.tsx +++ b/components/Logic/WithEnventsCard.tsx @@ -1,7 +1,7 @@ 'use client'; import { useTranslations } from 'next-intl'; -import EventsCard from '~/components/Common/EnventsCard'; -import { isToday, isInRange } from '~/utils/date'; +import EventsCard from '~/components/Common/EnventsCard/index.tsx'; +import { isToday, isInRange } from '~/utils/date.ts'; import type { FC } from 'react'; type Event = { diff --git a/components/Logic/__tests__/WithEnventsCard.test.tsx b/components/Logic/__tests__/WithEnventsCard.test.tsx index f2818ad..96116f2 100644 --- a/components/Logic/__tests__/WithEnventsCard.test.tsx +++ b/components/Logic/__tests__/WithEnventsCard.test.tsx @@ -1,8 +1,8 @@ import { render } from '@testing-library/react'; import { IntlProvider } from 'next-intl'; import { vi, describe, it, expect } from 'vitest'; -import messages from '~/i18n/locales/en.json'; -import WithEventsCard from '../WithEnventsCard'; +import messages from '~/i18n/locales/en.json' with { type: 'json' }; +import WithEventsCard from '../WithEnventsCard.tsx'; // Mocking the date utility functions vi.mock('~/utils/date', () => ({ diff --git a/components/Sections/Footer/index.stories.tsx b/components/Sections/Footer/index.stories.tsx index 4065a9d..196937b 100644 --- a/components/Sections/Footer/index.stories.tsx +++ b/components/Sections/Footer/index.stories.tsx @@ -1,4 +1,4 @@ -import Footer from '.'; +import Footer from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Sections/TopNav/index.stories.tsx b/components/Sections/TopNav/index.stories.tsx index d44ea03..2675b86 100644 --- a/components/Sections/TopNav/index.stories.tsx +++ b/components/Sections/TopNav/index.stories.tsx @@ -1,4 +1,4 @@ -import TopNav from '.'; +import TopNav from './index.tsx'; import type { Meta as MetaObj, StoryObj } from '@storybook/react'; type Story = StoryObj; diff --git a/components/Sections/TopNav/index.tsx b/components/Sections/TopNav/index.tsx index 7ed7ece..eba4302 100644 --- a/components/Sections/TopNav/index.tsx +++ b/components/Sections/TopNav/index.tsx @@ -1,8 +1,8 @@ 'use client'; import { useTranslations } from 'next-intl'; -import LocalizedLink from '~/components/Common/LocalizedLink'; -import { ActiveLink } from '~/components/Common/ActiveLink'; -import LanguageSelector from '~/components/Common/LanguageSelector'; +import LocalizedLink from '~/components/Common/LocalizedLink.tsx'; +import { ActiveLink } from '~/components/Common/ActiveLink.tsx'; +import LanguageSelector from '~/components/Common/LanguageSelector/index.tsx'; import styles from './index.module.css'; import type { FC } from 'react'; diff --git a/hooks/__tests__/useCopyToClipboard.test.ts b/hooks/__tests__/useCopyToClipboard.test.ts index 15e0d52..944aa1b 100644 --- a/hooks/__tests__/useCopyToClipboard.test.ts +++ b/hooks/__tests__/useCopyToClipboard.test.ts @@ -1,6 +1,6 @@ import { renderHook, act } from '@testing-library/react'; import { describe, it, expect, vi, beforeEach } from 'vitest'; -import useCopyToClipboard from '../useCopyToClipboard'; +import useCopyToClipboard from '../useCopyToClipboard.ts'; describe('useCopyToClipboard', () => { beforeEach(() => { diff --git a/lib/content.ts b/lib/content.ts index 64b0942..4bd4312 100644 --- a/lib/content.ts +++ b/lib/content.ts @@ -1,7 +1,7 @@ import fs from 'node:fs/promises'; import path from 'node:path'; import { isNodeError } from '~/utils/node'; -import compileMDX from './mdx'; +import compileMDX from './mdx.ts'; type GetContentProps = { section: string; diff --git a/lib/mdx.ts b/lib/mdx.ts index ca63e4f..1b5f3be 100644 --- a/lib/mdx.ts +++ b/lib/mdx.ts @@ -2,7 +2,7 @@ import { compileMDX as _compileMDX } from 'next-mdx-remote/rsc'; import rehypeMdxCodeProps from 'rehype-mdx-code-props'; import rehypeSlug from 'rehype-slug'; import rehypeAutolinkHeadings from 'rehype-autolink-headings'; -import { defaultMdxComponents } from './mdxComponents'; +import { defaultMdxComponents } from './mdxComponents.ts'; import type { MDXProvider } from '@mdx-js/react'; import type { ComponentProps } from 'react'; diff --git a/lib/mdxComponents.ts b/lib/mdxComponents.ts index 55cde0f..031f430 100644 --- a/lib/mdxComponents.ts +++ b/lib/mdxComponents.ts @@ -1,9 +1,9 @@ -import Codebox from '~/components/Common/Codebox'; -import Blockquote from '~/components/Common/Blockquote'; -import ProjectCard from '~/components/Common/ProjectCard'; -import TextWithImages from '~/components/Common/TextWithImages'; -import Timeline from '~/components/Common/TimeLine'; -import LocalizedLink from '~/components/Common/LocalizedLink'; +import Codebox from '~/components/Common/Codebox/index.tsx'; +import Blockquote from '~/components/Common/Blockquote/index.tsx'; +import ProjectCard from '~/components/Common/ProjectCard/index.tsx'; +import TextWithImages from '~/components/Common/TextWithImages/index.tsx'; +import Timeline from '~/components/Common/TimeLine/index.tsx'; +import LocalizedLink from '~/components/Common/LocalizedLink.tsx'; import type { MDXProvider } from '@mdx-js/react'; import type { ComponentProps } from 'react'; diff --git a/lib/rss.ts b/lib/rss.ts index 9bdd7c8..22ee7e0 100644 --- a/lib/rss.ts +++ b/lib/rss.ts @@ -1,6 +1,6 @@ import { Feed } from 'feed'; -import { getFrontmatter, getSlugs } from './content'; -import type { BlogFrontmatter } from '~/types/frontmatter'; +import { getFrontmatter, getSlugs } from './content.ts'; +import type { BlogFrontmatter } from '~/types/frontmatter.ts'; type GenerateRssFeedProps = { section: string; diff --git a/lib/sitemap.ts b/lib/sitemap.ts index cab8bf9..4cae98d 100644 --- a/lib/sitemap.ts +++ b/lib/sitemap.ts @@ -1,7 +1,7 @@ -import { availableLocaleCodes } from '~/utils/i18n'; -import { getSlugs, getFrontmatter } from './content'; +import { availableLocaleCodes } from '~/utils/i18n/index.ts'; +import { getSlugs, getFrontmatter } from './content.ts'; import type { MetadataRoute } from 'next'; -import type { BlogFrontmatter } from '~/types/frontmatter'; +import type { BlogFrontmatter } from '~/types/frontmatter.ts'; type GenerateSitemapProps = { section: string; diff --git a/package-lock.json b/package-lock.json index 2783efa..f4fbbfc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "postcss": "~8.4.47", "storybook": "~8.3.2", "tailwindcss": "~3.4.11", - "typescript": "~5.6.2", + "typescript": "~5.7.2", "vitest": "~2.1.1" }, "engines": { @@ -16099,9 +16099,9 @@ } }, "node_modules/typescript": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", - "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 8ba5ada..72651f0 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "biome:format": "biome format --write ./", "biome:lint": "biome lint --write ./", "biome:ci": "biome ci", - "format": "npm run biome:format && npm run biome:lint", + "format": "node --run biome:format && node --run biome:lint", "type-check": "tsc --noEmit", "storybook": "BUILD_ENV=storybook storybook dev -p 6006 --quiet --no-open", "storybook:build": "BUILD_ENV=storybook storybook build", @@ -61,11 +61,11 @@ "postcss": "~8.4.47", "storybook": "~8.3.2", "tailwindcss": "~3.4.11", - "typescript": "~5.6.2", + "typescript": "~5.7.2", "vitest": "~2.1.1" }, "engines": { - "node": "20.x", + "node": "22.x", "npm": "10.x" }, "packageManager": "npm@10.0.0" diff --git a/tsconfig.json b/tsconfig.json index 14ff0e6..cf7bca3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, + "allowImportingTsExtensions": true, "skipLibCheck": true, "strict": true, "noEmit": true, diff --git a/utils/__tests__/date.test.ts b/utils/__tests__/date.test.ts index 65534eb..bc672ef 100644 --- a/utils/__tests__/date.test.ts +++ b/utils/__tests__/date.test.ts @@ -1,5 +1,5 @@ import { vi, describe, it, expect, beforeAll, afterAll } from 'vitest'; -import { isInRange, isToday, isBirthday } from '../date'; +import { isInRange, isToday, isBirthday } from '../date.ts'; describe('isInRange', () => { it('should return true if the date is within the range', () => { diff --git a/utils/__tests__/gitHubUtils.test.ts b/utils/__tests__/gitHubUtils.test.ts index 60c35e6..aa2c455 100644 --- a/utils/__tests__/gitHubUtils.test.ts +++ b/utils/__tests__/gitHubUtils.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest'; -import { getGitHubAvatarUrl, getGithubProfileUrl } from '../gitHubUtils'; +import { getGitHubAvatarUrl, getGithubProfileUrl } from '../gitHubUtils.ts'; describe('getGitHubAvatarUrl', () => { it('should return the correct avatar URL for a given username', () => { diff --git a/utils/__tests__/node.test.ts b/utils/__tests__/node.test.ts index b8d4027..1da0ca8 100644 --- a/utils/__tests__/node.test.ts +++ b/utils/__tests__/node.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest'; -import { isNodeError } from '../node'; +import { isNodeError } from '../node.ts'; describe('isNodeError', () => { it('should return true for a NodeJS.ErrnoException', () => { diff --git a/utils/__tests__/strignUtils.test.ts b/utils/__tests__/strignUtils.test.ts index b6a626e..5b0ae5e 100644 --- a/utils/__tests__/strignUtils.test.ts +++ b/utils/__tests__/strignUtils.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest'; -import { getAcronymFromString, stringToSlug } from '../stringUtils'; +import { getAcronymFromString, stringToSlug } from '../stringUtils.ts'; describe('getAcronymFromString', () => { it('should return the correct acronym for a multi-word string', () => { diff --git a/utils/gitHubUtils.ts b/utils/gitHubUtils.ts index f030b76..b418bd8 100644 --- a/utils/gitHubUtils.ts +++ b/utils/gitHubUtils.ts @@ -1,4 +1,4 @@ -import { stringToSlug } from './stringUtils'; +import { stringToSlug } from './stringUtils.ts'; export const getGitHubAvatarUrl = (username: string): string => `https://avatars.githubusercontent.com/${username}`; diff --git a/utils/i18n/config.ts b/utils/i18n/config.ts index 894de96..d78f78c 100644 --- a/utils/i18n/config.ts +++ b/utils/i18n/config.ts @@ -1,5 +1,5 @@ import { getRequestConfig } from 'next-intl/server'; -import { availableLocaleCodes } from '.'; +import { availableLocaleCodes } from './index.ts'; // Loads the Application Locales/Translations Dynamically const loadLocaleDictionary = async (locale: string) => { diff --git a/utils/i18n/index.ts b/utils/i18n/index.ts index 389cf07..65e970c 100644 --- a/utils/i18n/index.ts +++ b/utils/i18n/index.ts @@ -1,4 +1,4 @@ -import localeConfig from '~/i18n/config.json' assert { type: 'json' }; +import localeConfig from '~/i18n/config.json' with { type: 'json' }; // As set of available and enabled locales for the website // This is used for allowing us to redirect the user to any