From 753cc69abf11223056ff375cd1065caa174a07c2 Mon Sep 17 00:00:00 2001 From: r-freeman Date: Thu, 19 Jan 2023 21:53:37 +0000 Subject: [PATCH] Changed project structure --- {src/components => components}/ArticleLayout.tsx | 2 +- {src/components => components}/Button.tsx | 0 {src/components => components}/Card.tsx | 0 {src/components => components}/Container.tsx | 0 {src/components => components}/Footer.tsx | 0 {src/components => components}/Header.tsx | 2 +- {src/components => components}/InlineLink.tsx | 0 {src/components => components}/Prose.tsx | 0 {src/components => components}/Section.jsx | 0 {src/components => components}/SimpleLayout.tsx | 0 {src/components => components}/SocialIcons.tsx | 0 {src/components => components}/SpotifyPlayer.tsx | 0 {src/components => components}/Views.tsx | 0 jsconfig.json | 2 +- {src/lib => lib}/createSlug.ts | 0 {src/lib => lib}/fetcher.js | 0 {src/lib => lib}/formatDate.ts | 0 {src/lib => lib}/generateRssFeed.tsx | 0 {src/lib => lib}/generateSitemap.ts | 0 {src/lib => lib}/getAllArticles.ts | 4 ++-- {src/lib => lib}/prisma.ts | 0 {src/lib => lib}/spotify.ts | 0 {src/pages => pages}/_app.tsx | 2 +- {src/pages => pages}/_document.tsx | 0 {src/pages => pages}/about.tsx | 6 +++--- .../api/spotify/currently-playing.js | 0 {src/pages => pages}/api/spotify/last-played.js | 0 {src/pages => pages}/api/views/[slug].ts | 0 {src/pages => pages}/index.tsx | 4 ++-- {src/pages => pages}/projects.tsx | 0 {src/pages => pages}/uses.jsx | 0 .../a-personal-journey-in-software-engineering.mdx | 0 ...add-typescript-to-an-existing-nextjs-project.mdx | 0 {src/pages => pages}/writing/index.tsx | 0 {src => public/static}/images/avatar.jpg | Bin .../aws-certified-cloud-practitioner-badge.png | Bin .../{photo-of-me-lg.jpg => photo-of-me-og.jpg} | Bin .../static/images/photo-of-me.jpg | Bin tailwind.config.js | 2 +- tsconfig.json | 2 +- 40 files changed, 13 insertions(+), 13 deletions(-) rename {src/components => components}/ArticleLayout.tsx (98%) rename {src/components => components}/Button.tsx (100%) rename {src/components => components}/Card.tsx (100%) rename {src/components => components}/Container.tsx (100%) rename {src/components => components}/Footer.tsx (100%) rename {src/components => components}/Header.tsx (99%) rename {src/components => components}/InlineLink.tsx (100%) rename {src/components => components}/Prose.tsx (100%) rename {src/components => components}/Section.jsx (100%) rename {src/components => components}/SimpleLayout.tsx (100%) rename {src/components => components}/SocialIcons.tsx (100%) rename {src/components => components}/SpotifyPlayer.tsx (100%) rename {src/components => components}/Views.tsx (100%) rename {src/lib => lib}/createSlug.ts (100%) rename {src/lib => lib}/fetcher.js (100%) rename {src/lib => lib}/formatDate.ts (100%) rename {src/lib => lib}/generateRssFeed.tsx (100%) rename {src/lib => lib}/generateSitemap.ts (100%) rename {src/lib => lib}/getAllArticles.ts (83%) rename {src/lib => lib}/prisma.ts (100%) rename {src/lib => lib}/spotify.ts (100%) rename {src/pages => pages}/_app.tsx (96%) rename {src/pages => pages}/_document.tsx (100%) rename {src/pages => pages}/about.tsx (97%) rename {src/pages => pages}/api/spotify/currently-playing.js (100%) rename {src/pages => pages}/api/spotify/last-played.js (100%) rename {src/pages => pages}/api/views/[slug].ts (100%) rename {src/pages => pages}/index.tsx (98%) rename {src/pages => pages}/projects.tsx (100%) rename {src/pages => pages}/uses.jsx (100%) rename {src/pages => pages}/writing/a-personal-journey-in-software-engineering.mdx (100%) rename {src/pages => pages}/writing/how-to-add-typescript-to-an-existing-nextjs-project.mdx (100%) rename {src/pages => pages}/writing/index.tsx (100%) rename {src => public/static}/images/avatar.jpg (100%) rename {src => public/static}/images/aws-certified-cloud-practitioner-badge.png (100%) rename public/static/images/{photo-of-me-lg.jpg => photo-of-me-og.jpg} (100%) rename src/images/photo-of-me-lg.jpg => public/static/images/photo-of-me.jpg (100%) diff --git a/src/components/ArticleLayout.tsx b/components/ArticleLayout.tsx similarity index 98% rename from src/components/ArticleLayout.tsx rename to components/ArticleLayout.tsx index 7dca972..051afb4 100644 --- a/src/components/ArticleLayout.tsx +++ b/components/ArticleLayout.tsx @@ -4,7 +4,7 @@ import {usePathname} from 'next/navigation' import {Container} from './Container' import {formatDate} from '@/lib/formatDate' import {Prose} from './Prose' -import {Views} from '@/components/Views' +import {Views} from './Views' type ArticleLayout = { children?: ReactNode diff --git a/src/components/Button.tsx b/components/Button.tsx similarity index 100% rename from src/components/Button.tsx rename to components/Button.tsx diff --git a/src/components/Card.tsx b/components/Card.tsx similarity index 100% rename from src/components/Card.tsx rename to components/Card.tsx diff --git a/src/components/Container.tsx b/components/Container.tsx similarity index 100% rename from src/components/Container.tsx rename to components/Container.tsx diff --git a/src/components/Footer.tsx b/components/Footer.tsx similarity index 100% rename from src/components/Footer.tsx rename to components/Footer.tsx diff --git a/src/components/Header.tsx b/components/Header.tsx similarity index 99% rename from src/components/Header.tsx rename to components/Header.tsx index 6ea37c0..804eb0f 100644 --- a/src/components/Header.tsx +++ b/components/Header.tsx @@ -6,7 +6,7 @@ import {Popover, Transition} from '@headlessui/react' import clsx from 'clsx' import {Container} from './Container' -import avatar from '@/images/avatar.jpg' +import avatar from '@/public/static/images/avatar.jpg' import type {Props} from 'types' diff --git a/src/components/InlineLink.tsx b/components/InlineLink.tsx similarity index 100% rename from src/components/InlineLink.tsx rename to components/InlineLink.tsx diff --git a/src/components/Prose.tsx b/components/Prose.tsx similarity index 100% rename from src/components/Prose.tsx rename to components/Prose.tsx diff --git a/src/components/Section.jsx b/components/Section.jsx similarity index 100% rename from src/components/Section.jsx rename to components/Section.jsx diff --git a/src/components/SimpleLayout.tsx b/components/SimpleLayout.tsx similarity index 100% rename from src/components/SimpleLayout.tsx rename to components/SimpleLayout.tsx diff --git a/src/components/SocialIcons.tsx b/components/SocialIcons.tsx similarity index 100% rename from src/components/SocialIcons.tsx rename to components/SocialIcons.tsx diff --git a/src/components/SpotifyPlayer.tsx b/components/SpotifyPlayer.tsx similarity index 100% rename from src/components/SpotifyPlayer.tsx rename to components/SpotifyPlayer.tsx diff --git a/src/components/Views.tsx b/components/Views.tsx similarity index 100% rename from src/components/Views.tsx rename to components/Views.tsx diff --git a/jsconfig.json b/jsconfig.json index d5329ef..537180e 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -3,7 +3,7 @@ "baseUrl": ".", "paths": { "@/*": [ - "src/*" + "*" ] } } diff --git a/src/lib/createSlug.ts b/lib/createSlug.ts similarity index 100% rename from src/lib/createSlug.ts rename to lib/createSlug.ts diff --git a/src/lib/fetcher.js b/lib/fetcher.js similarity index 100% rename from src/lib/fetcher.js rename to lib/fetcher.js diff --git a/src/lib/formatDate.ts b/lib/formatDate.ts similarity index 100% rename from src/lib/formatDate.ts rename to lib/formatDate.ts diff --git a/src/lib/generateRssFeed.tsx b/lib/generateRssFeed.tsx similarity index 100% rename from src/lib/generateRssFeed.tsx rename to lib/generateRssFeed.tsx diff --git a/src/lib/generateSitemap.ts b/lib/generateSitemap.ts similarity index 100% rename from src/lib/generateSitemap.ts rename to lib/generateSitemap.ts diff --git a/src/lib/getAllArticles.ts b/lib/getAllArticles.ts similarity index 83% rename from src/lib/getAllArticles.ts rename to lib/getAllArticles.ts index b525290..fe5b0cb 100644 --- a/src/lib/getAllArticles.ts +++ b/lib/getAllArticles.ts @@ -3,7 +3,7 @@ import * as path from 'path' async function importArticle(articleFilename: string) { let {meta, default: component} = await import( - `../pages/writing/${articleFilename}` + `/pages/writing/${articleFilename}` ) return { slug: articleFilename.replace(/(\/index)?\.mdx$/, ''), @@ -14,7 +14,7 @@ async function importArticle(articleFilename: string) { export async function getAllArticles() { let articleFilenames = await glob(['*.mdx', '*/index.mdx'], { - cwd: path.join(process.cwd(), 'src/pages/writing'), + cwd: path.join(process.cwd(), './pages/writing'), }) let articles = await Promise.all(articleFilenames.map(importArticle)) diff --git a/src/lib/prisma.ts b/lib/prisma.ts similarity index 100% rename from src/lib/prisma.ts rename to lib/prisma.ts diff --git a/src/lib/spotify.ts b/lib/spotify.ts similarity index 100% rename from src/lib/spotify.ts rename to lib/spotify.ts diff --git a/src/pages/_app.tsx b/pages/_app.tsx similarity index 96% rename from src/pages/_app.tsx rename to pages/_app.tsx index 39e3978..56e7b0f 100644 --- a/src/pages/_app.tsx +++ b/pages/_app.tsx @@ -3,7 +3,7 @@ import type {AppProps} from 'next/app' import {Header} from '@/components/Header' import {Footer} from '@/components/Footer' -import '../../styles/tailwind.css' +import '../styles/tailwind.css' import 'focus-visible' function usePrevious(value: string): string | null { diff --git a/src/pages/_document.tsx b/pages/_document.tsx similarity index 100% rename from src/pages/_document.tsx rename to pages/_document.tsx diff --git a/src/pages/about.tsx b/pages/about.tsx similarity index 97% rename from src/pages/about.tsx rename to pages/about.tsx index 56a2cea..cbb5031 100644 --- a/src/pages/about.tsx +++ b/pages/about.tsx @@ -11,8 +11,8 @@ import { TwitterIcon } from '@/components/SocialIcons' import {Props} from 'types' -import photoOfMeLg from '@/images/photo-of-me-lg.jpg' -import awsCCPBadge from '@/images/aws-certified-cloud-practitioner-badge.png' +import photoOfMe from '@/public/static/images/photo-of-me.jpg' +import awsCCPBadge from '@/public/static/images/aws-certified-cloud-practitioner-badge.png' function SocialLink({ className, @@ -73,7 +73,7 @@ export default function About() {
diff --git a/src/pages/projects.tsx b/pages/projects.tsx similarity index 100% rename from src/pages/projects.tsx rename to pages/projects.tsx diff --git a/src/pages/uses.jsx b/pages/uses.jsx similarity index 100% rename from src/pages/uses.jsx rename to pages/uses.jsx diff --git a/src/pages/writing/a-personal-journey-in-software-engineering.mdx b/pages/writing/a-personal-journey-in-software-engineering.mdx similarity index 100% rename from src/pages/writing/a-personal-journey-in-software-engineering.mdx rename to pages/writing/a-personal-journey-in-software-engineering.mdx diff --git a/src/pages/writing/how-to-add-typescript-to-an-existing-nextjs-project.mdx b/pages/writing/how-to-add-typescript-to-an-existing-nextjs-project.mdx similarity index 100% rename from src/pages/writing/how-to-add-typescript-to-an-existing-nextjs-project.mdx rename to pages/writing/how-to-add-typescript-to-an-existing-nextjs-project.mdx diff --git a/src/pages/writing/index.tsx b/pages/writing/index.tsx similarity index 100% rename from src/pages/writing/index.tsx rename to pages/writing/index.tsx diff --git a/src/images/avatar.jpg b/public/static/images/avatar.jpg similarity index 100% rename from src/images/avatar.jpg rename to public/static/images/avatar.jpg diff --git a/src/images/aws-certified-cloud-practitioner-badge.png b/public/static/images/aws-certified-cloud-practitioner-badge.png similarity index 100% rename from src/images/aws-certified-cloud-practitioner-badge.png rename to public/static/images/aws-certified-cloud-practitioner-badge.png diff --git a/public/static/images/photo-of-me-lg.jpg b/public/static/images/photo-of-me-og.jpg similarity index 100% rename from public/static/images/photo-of-me-lg.jpg rename to public/static/images/photo-of-me-og.jpg diff --git a/src/images/photo-of-me-lg.jpg b/public/static/images/photo-of-me.jpg similarity index 100% rename from src/images/photo-of-me-lg.jpg rename to public/static/images/photo-of-me.jpg diff --git a/tailwind.config.js b/tailwind.config.js index 400b9b4..c32d45a 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,6 +1,6 @@ /** @type {import('tailwindcss').Config} */ module.exports = { - content: ['./src/**/*.{js,jsx,tsx}'], + content: ['./pages/**/*.{js,jsx,tsx}', './components/**/*.{js,jsx,tsx}'], darkMode: 'class', plugins: [ require('@tailwindcss/typography'), diff --git a/tsconfig.json b/tsconfig.json index 8b96709..c35d1b4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,7 +21,7 @@ "baseUrl": ".", "paths": { "@/*": [ - "src/*" + "*" ] } },