Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Next.js 13.4 #26

Merged
merged 32 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5f5dc01
fix: remove useless nested anchor tags
Bartek532 Jul 1, 2023
ce13bc9
fix: config things
Bartek532 Jul 1, 2023
18ddc4e
fix: layout view
Bartek532 Jul 1, 2023
d1ed3ec
feat: include env variables validation
Bartek532 Jul 2, 2023
4beed9f
feat: move pages to app dir
Bartek532 Jul 2, 2023
c50f39b
feat: move fetching spotify track to server component
Bartek532 Jul 2, 2023
74d7872
fix: minor cleanups
Bartek532 Jul 2, 2023
924cb73
feat: optimize fonts
Bartek532 Jul 2, 2023
3ed644a
fix: more lint fixes
Bartek532 Jul 2, 2023
670a9b5
fix: minor fixes in about view
Bartek532 Jul 2, 2023
33ae4eb
fix: minor things in projects/posts
Bartek532 Jul 2, 2023
7ac6864
feat: adjust eslint config
Bartek532 Jul 3, 2023
88991d9
feat: move sending emails from contact form to server action
Bartek532 Jul 3, 2023
ef6fb5f
fix: renames
Bartek532 Jul 3, 2023
be69467
fix: mdx components
Bartek532 Jul 3, 2023
edcec9d
feat: migrate from supabase to vercel kv in tracking views
Bartek532 Jul 3, 2023
651dd8a
fix: move mailer integration to server action
Bartek532 Jul 3, 2023
3ee0a3b
feat: move seo things to app dir
Bartek532 Jul 4, 2023
bea4111
fix: remove deprecated pages dir
Bartek532 Jul 4, 2023
2fd2421
fix: remove vercel kv lib as it's bugged now
Bartek532 Jul 5, 2023
aa26fdb
fix: minor fixes
Bartek532 Jul 5, 2023
73928f3
feat: add google analytics tracking
Bartek532 Jul 5, 2023
484fcf3
feat: add some workflows
Bartek532 Jul 5, 2023
f24594c
fix: scripts fixes
Bartek532 Jul 5, 2023
4e32ca1
chore: update deps
Bartek532 Jul 5, 2023
ce871d1
fix: minor build fixes
Bartek532 Jul 5, 2023
2bb0219
fix: standarize envs
Bartek532 Jul 5, 2023
8a0b792
fix: minor deploy fixes
Bartek532 Jul 5, 2023
1fe8c45
fix: paths
Bartek532 Jul 5, 2023
1df994e
fix: analysis workflow
Bartek532 Jul 5, 2023
e3029d2
fix: scrolling issues on mdx
Bartek532 Jul 6, 2023
86030d4
fix: spotify track fetching
Bartek532 Jul 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: adjust eslint config
  • Loading branch information
Bartek532 committed Jul 3, 2023
commit 7ac6864d0aa034922e4e06817cae4b8bb7069d78
18 changes: 17 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint"],
"plugins": ["@typescript-eslint", "unused-imports"],
"extends": [
"next",
"next/core-web-vitals",
Expand Down Expand Up @@ -49,6 +49,22 @@
"warnOnUnassignedImports": true
}
],
"arrow-body-style": ["warn", "as-needed"],
"eqeqeq": [
"error",
"always",
{
"null": "ignore"
}
],
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"unused-imports/no-unused-imports": "warn",
"@typescript-eslint/naming-convention": [
"error",
{
Expand Down
4 changes: 1 addition & 3 deletions components/404/404.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import Image from "next/image";

import styles from "./404.module.scss";

export const Custom404 = () => {
return (
export const Custom404 = () => (
<div className={styles.wrapper}>
<div className={styles.image}>
<Image src="/img/avatars/pissed-off.png" alt="pissed off memoji" width="421" height="421" />
Expand All @@ -12,4 +11,3 @@ export const Custom404 = () => {
<p className={styles.description}>The page you are looking for does not exist.</p>
</div>
);
};
6 changes: 2 additions & 4 deletions components/about/components/experience/Experience.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ interface ExperienceProps {
readonly positions: readonly Position[];
}

export const Experience = memo<ExperienceProps>(({ positions }) => {
return (
export const Experience = memo<ExperienceProps>(({ positions }) => (
<section className={styles.experience}>
<h2 className={styles.title}>Experience</h2>
<p className={styles.description}>
Expand All @@ -28,7 +27,6 @@ export const Experience = memo<ExperienceProps>(({ positions }) => {
))}
</ol>
</section>
);
});
));

Experience.displayName = "Experience";
4 changes: 1 addition & 3 deletions components/about/components/hero/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { normalizeViewsCount } from "utils/functions";

import styles from "./hero.module.scss";

export const Hero = ({ views }: { views: number }) => {
return (
export const Hero = ({ views }: { views: number }) => (
<section className={styles.hero}>
<div className={styles.text}>
<h2 className={styles.title}>Hi, I&#39;m Bartosz Zagrodzki&nbsp;👋</h2>
Expand Down Expand Up @@ -40,4 +39,3 @@ export const Hero = ({ views }: { views: number }) => {
</div>
</section>
);
};
6 changes: 2 additions & 4 deletions components/blog/featuredPosts/featuredPost/FeaturedPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ interface FeaturedPostProps {
readonly post: Post;
}

export const FeaturedPost = memo<FeaturedPostProps>(({ post }) => {
return (
export const FeaturedPost = memo<FeaturedPostProps>(({ post }) => (
<Link href={`/blog/${post.slug}`}>
<motion.div className={styles.post} whileHover="hover">
<motion.div className={styles.image} variants={imageVariants}>
Expand All @@ -44,7 +43,6 @@ export const FeaturedPost = memo<FeaturedPostProps>(({ post }) => {
<h3 className={styles.title}>{post.title}</h3>
</motion.div>
</Link>
);
});
));

FeaturedPost.displayName = "FeaturedPost";
6 changes: 2 additions & 4 deletions components/blog/popularPosts/PopularPosts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ interface PopularPostsProps {
readonly posts: Post[];
}

export const PopularPosts = memo<PopularPostsProps>(({ posts }) => {
return (
export const PopularPosts = memo<PopularPostsProps>(({ posts }) => (
<section className={styles.wrapper}>
<h2 className={styles.title}>popular posts</h2>
<ul className={styles.posts}>
Expand All @@ -28,7 +27,6 @@ export const PopularPosts = memo<PopularPostsProps>(({ posts }) => {
))}
</ul>
</section>
);
});
));

PopularPosts.displayName = "PopularPosts";
70 changes: 34 additions & 36 deletions components/blog/postsListing/postThumbnail/PostThumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,40 @@ interface PostThumbnailProps {
readonly post: Post;
}

export const PostThumbnail = memo<PostThumbnailProps>(({ post }) => {
return (
<Link href={`/blog/${post.slug}`}>
<motion.article className={styles.post} layout>
<motion.h2
className={styles.title}
layoutId={`title-container-${post.slug}`}
>
{post.title}
</motion.h2>
<motion.p
className={styles.excerpt}
layoutId={`excerpt-container-${post.slug}`}
>
{post.excerpt}
</motion.p>
<div className={styles.info}>
<div className={styles.mainInfo}>
<span className={styles.category}>
{allCategories.find((c) => c.slug === post.category)?.name}
</span>
<span className={styles.time}>
{Math.round(post.timeToRead)} minutes
</span>
</div>
<div className={styles.more}>
Read more
<span className={styles.arrow}>
<Arrow />
</span>
</div>
export const PostThumbnail = memo<PostThumbnailProps>(({ post }) => (
<Link href={`/blog/${post.slug}`}>
<motion.article className={styles.post} layout>
<motion.h2
className={styles.title}
layoutId={`title-container-${post.slug}`}
>
{post.title}
</motion.h2>
<motion.p
className={styles.excerpt}
layoutId={`excerpt-container-${post.slug}`}
>
{post.excerpt}
</motion.p>
<div className={styles.info}>
<div className={styles.mainInfo}>
<span className={styles.category}>
{allCategories.find((c) => c.slug === post.category)?.name}
</span>
<span className={styles.time}>
{Math.round(post.timeToRead)} minutes
</span>
</div>
</motion.article>
</Link>
);
});
<div className={styles.more}>
Read more
<span className={styles.arrow}>
<Arrow />
</span>
</div>
</div>
</motion.article>
</Link>
));

PostThumbnail.displayName = "PostThumbnail";
6 changes: 2 additions & 4 deletions components/category/categoriesList/CategoriesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ interface CategoriesListProps {
readonly categories: Category[];
}

export const CategoriesList = memo<CategoriesListProps>(({ categories }) => {
return (
export const CategoriesList = memo<CategoriesListProps>(({ categories }) => (
<section className={styles.wrapper}>
<h2 className={styles.title}>categories</h2>
<div className={styles.categories}>
Expand All @@ -19,7 +18,6 @@ export const CategoriesList = memo<CategoriesListProps>(({ categories }) => {
))}
</div>
</section>
);
});
));

CategoriesList.displayName = "CategoriesList";
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ interface CategoryCardProps {
readonly category: CategoryType;
}

export const CategoryCard = memo<CategoryCardProps>(({ category }) => {
return (
export const CategoryCard = memo<CategoryCardProps>(({ category }) => (
<Link
href={`/blog?category=${category}`}
key={category}
className={styles.category}
>
{allCategories.find((c) => c.slug === category)?.name}
</Link>
);
});
));

CategoryCard.displayName = "CategoryCard";
4 changes: 1 addition & 3 deletions components/common/analytics/Analytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

import { Analytics as VercelAnalytics } from "@vercel/analytics/react";

export const Analytics = () => {
return <VercelAnalytics />;
};
export const Analytics = () => <VercelAnalytics />;
4 changes: 1 addition & 3 deletions components/common/grid/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ interface GridProps {
readonly children: React.ReactNode;
}

export const Grid = ({ children }: GridProps) => {
return <div className={styles.grid}>{children}</div>;
};
export const Grid = ({ children }: GridProps) => <div className={styles.grid}>{children}</div>;
10 changes: 4 additions & 6 deletions components/common/hero/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ import { memo } from "react";

import styles from "./hero.module.scss";

type HeroProps = {
interface HeroProps {
readonly title: string;
readonly description: string;
};
}

export const Hero = memo<HeroProps>(({ title, description }) => {
return (
export const Hero = memo<HeroProps>(({ title, description }) => (
<div className={styles.hero}>
<h1 className={styles.title}>{title}</h1>
<p className={styles.description}>{description}</p>
</div>
);
});
));

Hero.displayName = "Hero";
6 changes: 2 additions & 4 deletions components/common/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import styles from "./input.module.scss";
export const Input = forwardRef<
HTMLInputElement,
JSX.IntrinsicElements["input"] & { isError?: boolean }
>(({ isError, children, ...props }, ref) => {
return (
>(({ isError, children, ...props }, ref) => (
<label className={styles.wrapper}>
{children}
{props.type === "search" && <SearchIcon className={styles.icon} />}
Expand All @@ -23,7 +22,6 @@ export const Input = forwardRef<
type={props.type ?? "text"}
/>
</label>
);
});
));

Input.displayName = "Input";
4 changes: 1 addition & 3 deletions components/common/loader/LoaderRing.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import styles from "./loaderRing.module.scss";

export const LoaderRing = () => {
return (
export const LoaderRing = () => (
<div className={styles.loader}>
<span className="sr-only">loading</span>
<div className={styles.ring}>
Expand All @@ -12,4 +11,3 @@ export const LoaderRing = () => {
</div>
</div>
);
};
6 changes: 3 additions & 3 deletions components/contact/contactForm/ContactForm.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import clsx from "clsx";
import { useForm } from "react-hook-form";
import { useState, useEffect } from "react";
import { useForm } from "react-hook-form";

import { Input } from "components/common/input/Input";
import { LoaderRing } from "components/common/loader/LoaderRing";
import { fetcher } from "utils/fetcher";
import { EMAIL_REGEX } from "utils/consts";
import { fetcher } from "utils/fetcher";

import styles from "./contactForm.module.scss";

Expand All @@ -19,7 +19,7 @@ export const ContactForm = ({ handleIsSent }: { handleIsSent: (val: boolean) =>
} = useForm();
const [promiseStatus, setPromiseStatus] = useState<PromiseStatus>("pending");

const handleFormSubmit = async ({ name, email, message }: { [key: string]: string }) => {
const handleFormSubmit = async ({ name, email, message }: Record<string, string>) => {
setPromiseStatus("loading");
try {
await fetcher("/api/contact", { method: "POST", body: { name, email, message } });
Expand Down
4 changes: 1 addition & 3 deletions components/layout/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import PaperPlane from "public/svg/paper-plane.svg";
import styles from "./header.module.scss";
import { Navbar } from "./navbar/Navbar";

export const Header = () => {
return (
export const Header = () => (
<header className={styles.header}>
<Link href="#main" className={styles.skip}>
skip to content
Expand All @@ -30,4 +29,3 @@ export const Header = () => {
</div>
</header>
);
};
6 changes: 2 additions & 4 deletions components/mdx/Mdx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ export const Mdx = memo<MdxProps>(({ resource, content }) => {
const [views, setViews] = useState(0);

const getHeadingProps = useCallback(
({ children }: HeadingComponentProps) => {
return {
({ children }: HeadingComponentProps) => ({
slug: children,
url,
};
},
}),
[url],
);

Expand Down
4 changes: 2 additions & 2 deletions components/mdx/author/Author.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { Link } from "../link/Link";

import styles from "./author.module.scss";

type AuthorProps = {
interface AuthorProps {
readonly name: typeof allAuthors[number]["name"];
};
}

export const Author = memo<AuthorProps>(({ name }) => {
const author = allAuthors.find((c) => c.name === name)!;
Expand Down
Loading