Skip to content

Commit

Permalink
perf: use corepack and update deps (#437)
Browse files Browse the repository at this point in the history
* perf: use corepack and update deps

Signed-off-by: mateonunez <mateonunez95@gmail.com>

* chore: lint

Signed-off-by: mateonunez <mateonunez95@gmail.com>

---------

Signed-off-by: mateonunez <mateonunez95@gmail.com>
  • Loading branch information
mateonunez authored May 10, 2024
1 parent aaa6b4f commit ed137ee
Show file tree
Hide file tree
Showing 48 changed files with 5,455 additions and 3,736 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,22 @@

## Getting Started

Run `yarn` to install the necessary dependencies and `yarn dev` to start the local server.
Activate corepack:

```bash
corepack enable
```

Install dependencies:

```bash
yarn install
```

Open [http://localhost:3000/](http://localhost:3000/). Pages will live-refresh when source files are changed.

> Note: remember to set your environment variables in a `.env.local` file.
## License

Site content is licensed under the [CC-BY-4.0](LICENSE), which means that you can copy, redistribute, remix, transform, and build upon the content for any purpose as long as you give appropriate credit.
Expand Down
2 changes: 0 additions & 2 deletions app/api/spotify/currently-listening/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { normalizeCurrentlyListening } from 'lib/utils/normalizers';
export async function GET() {
const response = await getCurrentlyListening();

console.log('response', response);

if (!response) {
return NextResponse.json({ error: 'Spotify not available' }, { status: 503 });
}
Expand Down
4 changes: 1 addition & 3 deletions app/error.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { useEffect } from 'react';
import s from 'styles/pages/404.module.css';

export default function Eror({ error, reset }) {
useEffect(() => {
console.error(error);
}, [error]);
useEffect(() => {}, [error]);

return (
<>
Expand Down
4 changes: 2 additions & 2 deletions app/loading.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function Loading() {
return (
<div className="flex items-center justify-center h-screen">
<div className="w-32 h-32 border-b-2 border-gray-300 rounded-full animate-spin" />
<div className="flex h-screen items-center justify-center">
<div className="h-32 w-32 animate-spin rounded-full border-gray-300 border-b-2" />
</div>
);
}
6 changes: 3 additions & 3 deletions app/open-source/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default async function OpenSourcePage() {
<Container clean name="you">
<div className={s.thanksContainer}>
<Fade direction="left" clean className="w-full">
<h2 className="text-4xl font-bold text-center">Thank you.</h2>
<h2 className="text-center font-bold text-4xl">Thank you.</h2>

<Sponsors sponsors={sponsors} />
</Fade>
Expand All @@ -56,7 +56,7 @@ export default async function OpenSourcePage() {
<Container clean name="people">
<div className={s.genericContainer}>
<Fade direction="left" delay={0.5} className="w-full">
<h2 className="text-4xl font-bold text-center">Still You</h2>
<h2 className="text-center font-bold text-4xl">Still You</h2>

<Followers followers={followers} />
</Fade>
Expand All @@ -67,7 +67,7 @@ export default async function OpenSourcePage() {
<Container clean name="passion">
<div className={s.genericContainer}>
<Fade direction="left" delay={0.5} className="w-full">
<h2 className="text-4xl font-bold text-center">About me</h2>
<h2 className="text-center font-bold text-4xl">About me</h2>

<GitHubProfile {...profile} />
</Fade>
Expand Down
4 changes: 2 additions & 2 deletions app/sitemap.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'fs';
import fs from 'node:fs';
import config from 'lib/config';
import path from 'path';
import path from 'node:path';

function generateArticlesSitemap() {
const result = [];
Expand Down
9 changes: 7 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.4.1/schema.json",
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"organizeImports": {
"enabled": true
},
Expand All @@ -9,11 +9,16 @@
"recommended": true,
"nursery": {
"all": true,
"noDefaultExport": "off"
"noReactSpecificProps": "off",
"noUndeclaredDependencies": "off",
"noNodejsModules": "off"
},
"correctness": {
"all": true,
"useExhaustiveDependencies": "off"
},
"suspicious": {
"noArrayIndexKey": "off"
}
},
"ignore": [".next/", "node_modules/", "./**/*.json"]
Expand Down
5 changes: 2 additions & 3 deletions components/about/about.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const About = ({ ...props }) => {
<div className={cn(s.profileQuote, 'text-right')}></div>
</div>
<div className="w-full">
<p className="font-bold text-center text-amber-500 text-md">@mateonunez</p>
<p className="text-center font-bold text-amber-500 text-md">@mateonunez</p>
</div>
</div>
</Fade>
Expand All @@ -79,8 +79,7 @@ const About = ({ ...props }) => {
</div>
<div className={s.bio}>
<span className={s.bioYear}>2009</span>
Move to Milan, Italy. <br />
I started a new life. Known new friends. Learned how to cook.
Move to Milan, Italy. <br />I started a new life. Known new friends. Learned how to cook.
</div>
<div className={s.bio}>
<span className={s.bioYear}>2015</span>
Expand Down
2 changes: 1 addition & 1 deletion components/animations/word-animator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const WordAnimator = ({ words, clickable }, ref) => {
<Wrapper {...wrapperProps} ref={ref}>
<span
ref={wordRef}
className={cn(s.wordAnimator, `transition-opacity duration-500 ${opacity}`, clickable && 'cursor-pointer')}
className={cn(s.wordAnimator, `transition-opacity duration-500${opacity}`, clickable && 'cursor-pointer')}
>
{currentWord}
</span>
Expand Down
2 changes: 1 addition & 1 deletion components/articles/mdx/heading/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const extractName = (title) => {

const CopyToClipboard = ({ id, title, children }) => (
<button
className="hover:text-amber-700 hover:scale-105 transform transition-all duration-500 hover:underline text-amber-500"
className="transform text-amber-500 transition-all duration-500 hover:scale-105 hover:text-amber-700 hover:underline"
title={`Copy "${title}" to clipboard`}
onClick={(event) => {
const fullUrl = `${window.location.origin}${window.location.pathname}#${id}`;
Expand Down
2 changes: 1 addition & 1 deletion components/articles/mdx/image/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Link from 'next/link';

export default function MDXImage({ src, width, height, alt, quality, priority, href, target = '_self', ...rest }) {
const ImageWrapper = (
<div className="w-full h-full">
<div className="h-full w-full">
<Image
src={src}
width={width}
Expand Down
2 changes: 1 addition & 1 deletion components/articles/mdx/row/index.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const Row = ({ children }) => <div className="flex flex-wrap -mx-4">{children}</div>;
const Row = ({ children }) => <div className="-mx-4 flex flex-wrap">{children}</div>;

export default Row;
2 changes: 0 additions & 2 deletions components/articles/preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export default function ArticlePreview({
}) {
return (
<div className={s.root}>


<Link as={`/blog/${slug}`} rel="canonical" href={`/blog/${slug}`} title={title}>
<div className={s.body}>
<div className={s.imagePreview}>
Expand Down
2 changes: 1 addition & 1 deletion components/common/circular-progress/circular-progress.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const CircularProgress = ({ progress = 50, ...props }) => {

return (
<div>
<svg alt="circular-progress" className="w-8 h-8 rotate-90" {...props}>
<svg alt="circular-progress" className="h-8 w-8 rotate-90" {...props}>
<title>Circular Progress</title>
{/* Gray */}
<circle
Expand Down
2 changes: 1 addition & 1 deletion components/common/footer/footer.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default function Footer() {
return (
<footer className="p-4 mt-auto text-right text-white sm:text-center">
<footer className="mt-auto p-4 text-right text-white sm:text-center">
<p className="absolute left-0 ml-2 text-xs">
Made with{' '}
<span role="img" aria-label="heart">
Expand Down
2 changes: 1 addition & 1 deletion components/common/social-links/social-links.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import s from './social-links.module.css';

import Link from 'next/link';
import { Github, LinkedIn, Instagram, Spotify, Twitter } from 'components/icons';
import { Github, LinkedIn, Spotify, Twitter } from 'components/icons';

export default function SocialLinks() {
return (
Expand Down
8 changes: 4 additions & 4 deletions components/github/followers/followers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export default function Followers({ followers }) {
<Image
src={follower.avatar}
alt={follower.username}
className="w-32 h-32 rounded-full shadow-lg"
className="h-32 w-32 rounded-full shadow-lg"
width={128}
height={128}
/>
<span className="mt-2 text-sm text-center text-caption">@{follower.username}</span>
<span className="mt-2 text-center text-caption text-sm">@{follower.username}</span>
</Link>
</div>
))}
Expand All @@ -37,10 +37,10 @@ export default function Followers({ followers }) {
href="https://github.com/mateonunez?tab=followers"
target="_blank"
rel="noopener noreferrer"
className="text-sm font-black text-center"
className="text-center font-black text-sm"
>
and {followers.length - followersShown.length} more...{' '}
<span className="text-xs text-emoji">(thank you ❤️)</span>
<span className="text-emoji text-xs">(thank you ❤️)</span>
</a>
</div>

Expand Down
3 changes: 1 addition & 2 deletions components/github/last-activity/last-activity.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import s from './last-activity.module.css';

export default function LastActivity({ contributions }) {
console.log({ contributions });
export default function LastActivity() {
return (
<>
<div className={s.root}>
Expand Down
4 changes: 2 additions & 2 deletions components/github/repositories/preview/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function RepositoryPreview({
title={`${name} stars`}
className="flex"
>
<Star className="w-5 h-5" />
<Star className="h-5 w-5" />
<span className={s.starsCount}>{stars}</span>
</Link>
</div>
Expand All @@ -65,7 +65,7 @@ export default function RepositoryPreview({
title={`${name} forks`}
className="flex"
>
<Fork className="w-5 h-5" />
<Fork className="h-5 w-5" />
<div className={s.forksCount}>{forks}</div>
</Link>
</div>
Expand Down
10 changes: 5 additions & 5 deletions components/github/sponsors/sponsors.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function Sponsors({ sponsors }) {
<Image
src={sponsor.avatar}
alt={sponsor.username}
className="w-64 h-64 rounded-full shadow-lg"
className="h-64 w-64 rounded-full shadow-lg"
width={512}
height={512}
/>
Expand All @@ -42,23 +42,23 @@ export default function Sponsors({ sponsors }) {

{/* Consider sposoring me section */}
<div className={s.considerSponsoringContainer}>
<h2 className="text-4xl font-bold text-center">You love my work?</h2>
<h2 className="text-center font-bold text-4xl">You love my work?</h2>

<article className={s.description}>
If you like my work and want to support me, consider sponsoring me on GitHub.
</article>

<div className="flex flex-col items-center justify-center w-1/2 p-4 m-4" style={{ margin: 'auto' }}>
<div className="m-4 flex w-1/2 flex-col items-center justify-center p-4" style={{ margin: 'auto' }}>
<Link
href="https://github.com/sponsors/mateonunez"
target="_blank"
rel="noopener noreferrer"
className="mt-4 text-lg font-bold text-center"
className="mt-4 text-center font-bold text-lg"
>
<Image
src="https://github.githubassets.com/images/modules/site/sponsors/pixel-mona-heart.gif"
alt="Sponsor me"
className="w-24 h-24 shadow-lg"
className="h-24 w-24 shadow-lg"
width={128}
height={128}
/>
Expand Down
4 changes: 2 additions & 2 deletions components/header/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const ActiveLink = ({ href, children, title }) => {
<Link
href={href}
as={href}
className={`${s.link} ${pathname.split('/')[1] === href.split('/')[1] ? s.active : ''}`}
className={`${s.link}${pathname.split('/')[1] === href.split('/')[1] ? s.active : ''}`}
rel="canonical"
title={title}
>
Expand Down Expand Up @@ -62,7 +62,7 @@ export default function Header() {

<button
type="button"
className={cn(s.toggle, 'transform ease-linear duration-300', mobileNavShown && 'rotate-90')}
className={cn(s.toggle, 'transform duration-300 ease-linear', mobileNavShown && 'rotate-90')}
onClick={toggle}
aria-label="Toggle Menu"
>
Expand Down
2 changes: 1 addition & 1 deletion components/hero/hero.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function Hero({ article, ...props }) {
{/* Last Article */}
<div className={s.lastArticle}>
<Fade>
<h2 className="text-center subtitle">
<h2 className="subtitle text-center">
<Link href="/blog" title="Blog" aria-label="Blog" rel="canonical">
From the Blog
</Link>
Expand Down
2 changes: 1 addition & 1 deletion components/icons/ChevronDown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default function ChevronDown({ ...props }) {
<>
<svg
xmlns="http://www.w3.org/2000/svg"
className="w-6 h-6"
className="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
Expand Down
2 changes: 1 addition & 1 deletion components/icons/ChevronUp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default function ChevronUp({ ...props }) {
<svg
alt="up"
xmlns="http://www.w3.org/2000/svg"
className="w-6 h-6"
className="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
Expand Down
2 changes: 1 addition & 1 deletion components/icons/Clock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function Clock({ ...props }) {
<svg
alt="clock"
xmlns="http://www.w3.org/2000/svg"
className="w-6 h-6"
className="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
Expand Down
2 changes: 1 addition & 1 deletion components/icons/Close.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const Close = ({ ...props }) => {
<svg
alt="close"
xmlns="http://www.w3.org/2000/svg"
className="w-6 h-6"
className="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
Expand Down
2 changes: 1 addition & 1 deletion components/icons/Fork.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function Fork({ ...props }) {
<svg
alt="fork"
xmlns="http://www.w3.org/2000/svg"
className="w-6 h-6"
className="h-6 w-6"
fill="none"
viewBox="0 0 16 16"
stroke="currentColor"
Expand Down
2 changes: 1 addition & 1 deletion components/icons/Github.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function Github({ ...props }) {
fill="#fff"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
className="w-6 h-6"
className="h-6 w-6"
{...props}
>
<title>GitHub</title>
Expand Down
2 changes: 1 addition & 1 deletion components/icons/Instagram.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function Instagram({ ...props }) {
fill="#fff"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
className="w-6 h-6"
className="h-6 w-6"
{...props}
>
<title>Instagram</title>
Expand Down
2 changes: 1 addition & 1 deletion components/icons/LinkedIn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function LinkedIn({ ...props }) {
fill="#fff"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 30 30"
className="w-6 h-6"
className="h-6 w-6"
{...props}
>
<title>LinkedIn</title>
Expand Down
Loading

0 comments on commit ed137ee

Please sign in to comment.