From b3cca61f65499a1cd6123f22c74f4539e2f6b2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Str=C3=B8mseng?= Date: Thu, 14 Mar 2024 11:15:36 +0100 Subject: [PATCH] 105 install prettier tailwind plugin (#141) * feat(ide): install prettier tailwind plugin * run prettier with tailwind plugin --- frontend/.prettierrc | 3 +- frontend/package-lock.json | 76 ++++++++++++++++++- frontend/package.json | 3 +- frontend/src/app/(about)/contact/page.tsx | 4 +- frontend/src/app/(about)/partners/page.tsx | 4 +- frontend/src/app/(about)/team/page.tsx | 16 ++-- frontend/src/app/blog/[articleSlug]/page.tsx | 4 +- frontend/src/app/blog/page.tsx | 6 +- frontend/src/app/layout.tsx | 2 +- frontend/src/app/page.tsx | 16 ++-- .../src/app/projects/[projectSlug]/page.tsx | 2 +- frontend/src/app/projects/page.tsx | 4 +- .../app/satellites/[satelliteSlug]/page.tsx | 2 +- frontend/src/app/satellites/page.tsx | 2 +- .../src/components/BlockRendererClient.tsx | 12 +-- frontend/src/components/ContactCard.tsx | 2 +- frontend/src/components/Footer.tsx | 10 +-- frontend/src/components/HeroWithAnimation.tsx | 2 +- frontend/src/components/Navbar.tsx | 10 +-- frontend/src/components/map/MyCustomMap.tsx | 2 +- frontend/src/components/map/MyGlobe.tsx | 2 +- .../components/map/githubglobe/GHGlobe.tsx | 2 +- .../components/map/githubglobe/tooltip.tsx | 2 +- frontend/src/components/ui/dropdown-menu.tsx | 6 +- frontend/src/components/ui/hero.tsx | 4 +- 25 files changed, 137 insertions(+), 61 deletions(-) diff --git a/frontend/.prettierrc b/frontend/.prettierrc index 12c5880..2f218be 100644 --- a/frontend/.prettierrc +++ b/frontend/.prettierrc @@ -4,5 +4,6 @@ "semi": true, "singleQuote": false, "bracketSpacing": true, - "bracketSameLine": false + "bracketSameLine": false, + "plugins": ["prettier-plugin-tailwindcss"] } diff --git a/frontend/package-lock.json b/frontend/package-lock.json index d0f2e3c..c4bc369 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -60,7 +60,8 @@ "eslint-config-next": "14.1.0", "eslint-config-prettier": "^9.1.0", "postcss": "^8", - "prettier": "3.2.4", + "prettier": "^3.2.4", + "prettier-plugin-tailwindcss": "^0.5.12", "tailwindcss": "^3.3.0", "typescript": "^5.3.3" } @@ -15046,6 +15047,79 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-plugin-tailwindcss": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.12.tgz", + "integrity": "sha512-o74kiDBVE73oHW+pdkFSluHBL3cYEvru5YgEqNkBMFF7Cjv+w1vI565lTlfoJT4VLWDe0FMtZ7FkE/7a4pMXSQ==", + "dev": true, + "engines": { + "node": ">=14.21.3" + }, + "peerDependencies": { + "@ianvs/prettier-plugin-sort-imports": "*", + "@prettier/plugin-pug": "*", + "@shopify/prettier-plugin-liquid": "*", + "@trivago/prettier-plugin-sort-imports": "*", + "prettier": "^3.0", + "prettier-plugin-astro": "*", + "prettier-plugin-css-order": "*", + "prettier-plugin-import-sort": "*", + "prettier-plugin-jsdoc": "*", + "prettier-plugin-marko": "*", + "prettier-plugin-organize-attributes": "*", + "prettier-plugin-organize-imports": "*", + "prettier-plugin-sort-imports": "*", + "prettier-plugin-style-order": "*", + "prettier-plugin-svelte": "*" + }, + "peerDependenciesMeta": { + "@ianvs/prettier-plugin-sort-imports": { + "optional": true + }, + "@prettier/plugin-pug": { + "optional": true + }, + "@shopify/prettier-plugin-liquid": { + "optional": true + }, + "@trivago/prettier-plugin-sort-imports": { + "optional": true + }, + "prettier-plugin-astro": { + "optional": true + }, + "prettier-plugin-css-order": { + "optional": true + }, + "prettier-plugin-import-sort": { + "optional": true + }, + "prettier-plugin-jsdoc": { + "optional": true + }, + "prettier-plugin-marko": { + "optional": true + }, + "prettier-plugin-organize-attributes": { + "optional": true + }, + "prettier-plugin-organize-imports": { + "optional": true + }, + "prettier-plugin-sort-imports": { + "optional": true + }, + "prettier-plugin-style-order": { + "optional": true + }, + "prettier-plugin-svelte": { + "optional": true + }, + "prettier-plugin-twig-melody": { + "optional": true + } + } + }, "node_modules/pretty-ms": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz", diff --git a/frontend/package.json b/frontend/package.json index 5525f5a..8387a21 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -65,7 +65,8 @@ "eslint-config-next": "14.1.0", "eslint-config-prettier": "^9.1.0", "postcss": "^8", - "prettier": "3.2.4", + "prettier": "^3.2.4", + "prettier-plugin-tailwindcss": "^0.5.12", "tailwindcss": "^3.3.0", "typescript": "^5.3.3" } diff --git a/frontend/src/app/(about)/contact/page.tsx b/frontend/src/app/(about)/contact/page.tsx index dba1e43..824713b 100644 --- a/frontend/src/app/(about)/contact/page.tsx +++ b/frontend/src/app/(about)/contact/page.tsx @@ -36,8 +36,8 @@ export default async function ContactPage() { const content = people?.data?.people?.data ?? []; return ( -
-
+
+
{content.map((person, index) => ( -

+

Partners and Collaborators

{partnersData.map((partner) => { @@ -57,7 +57,7 @@ export default async function PartnersPage() { href={websiteUrl} target="_blank" key={partnerName} - className="hover:transform hover:scale-105 transition-transform duration-300 ease-in-out w-full max-w-lg mx-auto" + className="mx-auto w-full max-w-lg transition-transform duration-300 ease-in-out hover:scale-105 hover:transform" > diff --git a/frontend/src/app/(about)/team/page.tsx b/frontend/src/app/(about)/team/page.tsx index 6867f6f..c9586ff 100644 --- a/frontend/src/app/(about)/team/page.tsx +++ b/frontend/src/app/(about)/team/page.tsx @@ -78,7 +78,7 @@ export default async function TeamPage() {
There are no team members to show.
) : (
-

+

MEET THE TEAM

{[ @@ -90,11 +90,11 @@ export default async function TeamPage() {
{" "} {/* Add margin bottom */} -

+

{role}

{" "} {/* Increase margin bottom and adjust font size */} -
+
{filterPeopleByRole(role || "").map( (person, index) => { const name = @@ -113,16 +113,16 @@ export default async function TeamPage() { href={employeeLink} target="_blank" key={name + index} - className="hover:transform hover:scale-105 transition-transform duration-300 ease-in-out" + className="transition-transform duration-300 ease-in-out hover:scale-105 hover:transform" > - +

{name}

- + There are no projects to show.
) : (
-

+

Ongoing PhD Projects

- +
Ongoing PhD Projects diff --git a/frontend/src/app/blog/[articleSlug]/page.tsx b/frontend/src/app/blog/[articleSlug]/page.tsx index 2ee4516..2cbab95 100644 --- a/frontend/src/app/blog/[articleSlug]/page.tsx +++ b/frontend/src/app/blog/[articleSlug]/page.tsx @@ -84,11 +84,11 @@ export default async function Page({ return ( <> -
+

{article?.attributes?.title}

-
+
{avatarURL && ( diff --git a/frontend/src/app/blog/page.tsx b/frontend/src/app/blog/page.tsx index 00f5ec3..fc75f79 100644 --- a/frontend/src/app/blog/page.tsx +++ b/frontend/src/app/blog/page.tsx @@ -70,13 +70,13 @@ export default async function BlogPage() { } return ( -
+

Blog

News and other short stories about our activities are shown here.

-
+
{graphqlData.data.articles.data.map((article) => { let avatarURL = article?.attributes?.author?.data?.attributes?.avatar @@ -129,7 +129,7 @@ export default async function BlogPage() { -
+
{avatarURL && ( diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index 32ade62..1967f48 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -22,7 +22,7 @@ export default function RootLayout({ }>) { return ( - + -
+

Empowering Space Exploration One Satellite at a Time

-
+
-
+

NTNU Small Satellite Lab is an initiative to @@ -55,7 +55,7 @@ export default function Home() {

-
+

Projects

@@ -75,10 +75,10 @@ export default function Home() {

- -
+ +

Most recent picture

-
+
+

{projects?.attributes?.title}

diff --git a/frontend/src/app/projects/page.tsx b/frontend/src/app/projects/page.tsx index f9d82dc..9daa351 100644 --- a/frontend/src/app/projects/page.tsx +++ b/frontend/src/app/projects/page.tsx @@ -55,13 +55,13 @@ export default async function ProjectsPage() { } return ( -
+

Our Projects

Information about our various projects are shown here.

-
+
{graphqlData.data.projects.data.map((project) => { let coverImage = project?.attributes?.coverImage?.data?.attributes?.url; diff --git a/frontend/src/app/satellites/[satelliteSlug]/page.tsx b/frontend/src/app/satellites/[satelliteSlug]/page.tsx index cc98921..61b4172 100644 --- a/frontend/src/app/satellites/[satelliteSlug]/page.tsx +++ b/frontend/src/app/satellites/[satelliteSlug]/page.tsx @@ -49,7 +49,7 @@ export default async function SatelliteInfoPage({ {graphqlData?.data?.satellites?.data.map((satellite) => (
-

+

{satellite?.attributes?.satelliteName}

diff --git a/frontend/src/app/satellites/page.tsx b/frontend/src/app/satellites/page.tsx index 57a57ab..f2c435d 100644 --- a/frontend/src/app/satellites/page.tsx +++ b/frontend/src/app/satellites/page.tsx @@ -50,7 +50,7 @@ export default async function Satellites() { } return ( - + {children} +

{children}

); case 2: return ( -

{children}

+

{children}

); case 3: return ( -

{children}

+

{children}

); case 4: - return

{children}

; + return

{children}

; case 5: - return
{children}
; + return
{children}
; default: return ( -

{children}

+

{children}

); } }, diff --git a/frontend/src/components/ContactCard.tsx b/frontend/src/components/ContactCard.tsx index dea1e19..1a7e4b1 100644 --- a/frontend/src/components/ContactCard.tsx +++ b/frontend/src/components/ContactCard.tsx @@ -25,7 +25,7 @@ export function ContactCard({ externalUrl, }: ContactCardProps) { return ( - + diff --git a/frontend/src/components/Footer.tsx b/frontend/src/components/Footer.tsx index 53975a3..0316697 100644 --- a/frontend/src/components/Footer.tsx +++ b/frontend/src/components/Footer.tsx @@ -2,13 +2,13 @@ import NTNULogo from "./ntnu/NTNULogo"; export default function Footer() { return ( -