From d21cb5a5c93454a6af6db1d4f6858a1e5f81a814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kan=20Str=C3=B6berg?= Date: Thu, 27 Mar 2025 20:18:30 +0100 Subject: [PATCH 1/3] style(repo): sort tailwind classes with prettier closed COD-193 --- .prettierrc | 1 + apps/cms/src/components/Logo.client.tsx | 4 +- .../migrations/20241218_093558_cod_213.json | 62 +++++-------------- .../web/app/components/desktop-navigation.tsx | 4 +- apps/web/app/components/error-boundary.tsx | 2 +- apps/web/app/root.tsx | 6 +- apps/web/app/routes/$slug.tsx | 4 +- apps/web/app/routes/_index.tsx | 4 +- commitlint.config.js | 1 + .../ui/components/src/lib/Logo.client.tsx | 2 +- .../components/src/lib/RedirectNotifier.tsx | 8 +-- .../src/lib/blocks/ContentBlock.tsx | 2 +- .../src/lib/blocks/FormBlock.tsx | 6 +- .../src/lib/blocks/RichText.tsx | 2 +- .../ui/react-components/src/lib/Code.tsx | 2 +- .../react-components/src/lib/CopyButton.tsx | 5 +- .../ui/react-components/src/lib/Image.tsx | 8 +-- .../ui/shadcn/src/lib/components/card.tsx | 4 +- .../ui/shadcn/src/lib/components/checkbox.tsx | 2 +- .../ui/shadcn/src/lib/components/dialog.tsx | 8 +-- .../src/lib/components/dropdown-menu.tsx | 14 ++--- .../ui/shadcn/src/lib/components/form.tsx | 4 +- .../ui/shadcn/src/lib/components/input.tsx | 2 +- .../ui/shadcn/src/lib/components/menubar.tsx | 20 +++--- .../shadcn/src/lib/components/radio-group.tsx | 2 +- .../ui/shadcn/src/lib/components/select.tsx | 8 +-- .../ui/shadcn/src/lib/components/textarea.tsx | 2 +- nx.json | 6 ++ package.json | 1 + pnpm-lock.yaml | 62 +++++++++++++++++++ 30 files changed, 147 insertions(+), 111 deletions(-) diff --git a/.prettierrc b/.prettierrc index 32ebab4e5..55a5cc75b 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,5 @@ { + "plugins": ["prettier-plugin-tailwindcss"], "singleQuote": true, "trailingComma": "none" } diff --git a/apps/cms/src/components/Logo.client.tsx b/apps/cms/src/components/Logo.client.tsx index 70b0868b2..998e4563a 100644 --- a/apps/cms/src/components/Logo.client.tsx +++ b/apps/cms/src/components/Logo.client.tsx @@ -8,10 +8,10 @@ const Logo: React.FC = () => { - + Codeware CMS diff --git a/apps/cms/src/migrations/20241218_093558_cod_213.json b/apps/cms/src/migrations/20241218_093558_cod_213.json index cea948c12..170639cb4 100644 --- a/apps/cms/src/migrations/20241218_093558_cod_213.json +++ b/apps/cms/src/migrations/20241218_093558_cod_213.json @@ -147,12 +147,8 @@ "name": "articles_locales_parent_id_fk", "tableFrom": "articles_locales", "tableTo": "articles", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["_parent_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -162,10 +158,7 @@ "articles_locales_locale_parent_id_unique": { "name": "articles_locales_locale_parent_id_unique", "nullsNotDistinct": false, - "columns": [ - "_locale", - "_parent_id" - ] + "columns": ["_locale", "_parent_id"] } } }, @@ -312,12 +305,8 @@ "name": "pages_locales_parent_id_fk", "tableFrom": "pages_locales", "tableTo": "pages", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["_parent_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -327,10 +316,7 @@ "pages_locales_locale_parent_id_unique": { "name": "pages_locales_locale_parent_id_unique", "nullsNotDistinct": false, - "columns": [ - "_locale", - "_parent_id" - ] + "columns": ["_locale", "_parent_id"] } } }, @@ -722,12 +708,8 @@ "name": "payload_preferences_rels_parent_fk", "tableFrom": "payload_preferences_rels", "tableTo": "payload_preferences", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["parent_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -735,12 +717,8 @@ "name": "payload_preferences_rels_tenants_fk", "tableFrom": "payload_preferences_rels", "tableTo": "tenants", - "columnsFrom": [ - "tenants_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["tenants_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -748,12 +726,8 @@ "name": "payload_preferences_rels_users_fk", "tableFrom": "payload_preferences_rels", "tableTo": "users", - "columnsFrom": [ - "users_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["users_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -824,18 +798,12 @@ "public._locales": { "name": "_locales", "schema": "public", - "values": [ - "en", - "sv" - ] + "values": ["en", "sv"] }, "public.enum_users_role": { "name": "enum_users_role", "schema": "public", - "values": [ - "admin", - "user" - ] + "values": ["admin", "user"] } }, "schemas": {}, @@ -845,4 +813,4 @@ "tables": {}, "columns": {} } -} \ No newline at end of file +} diff --git a/apps/web/app/components/desktop-navigation.tsx b/apps/web/app/components/desktop-navigation.tsx index e903e42df..35da7bb0b 100644 --- a/apps/web/app/components/desktop-navigation.tsx +++ b/apps/web/app/components/desktop-navigation.tsx @@ -17,7 +17,7 @@ function NavItem({ to={href} className={({ isActive }) => cn( - 'relative block px-3 py-2 transition min-w-max', + 'relative block min-w-max px-3 py-2 transition', isActive ? 'text-teal-500 dark:text-teal-400' : 'hover:text-teal-500 dark:hover:text-teal-400' @@ -28,7 +28,7 @@ function NavItem({ <> {children} {isActive && ( - + )} )} diff --git a/apps/web/app/components/error-boundary.tsx b/apps/web/app/components/error-boundary.tsx index d0541cf0f..52dce70c4 100644 --- a/apps/web/app/components/error-boundary.tsx +++ b/apps/web/app/components/error-boundary.tsx @@ -37,7 +37,7 @@ export function GeneralErrorBoundary({ } return ( -
+
{isRouteErrorResponse(error) ? (statusHandlers?.[error.status] ?? defaultStatusHandler)({ error, diff --git a/apps/web/app/root.tsx b/apps/web/app/root.tsx index 7de88ec1d..689a57e02 100644 --- a/apps/web/app/root.tsx +++ b/apps/web/app/root.tsx @@ -207,8 +207,8 @@ export default function App() {
-
-
+
+
@@ -218,7 +218,7 @@ export default function App() {
-
+
{page.header && (
-

+

{page.header}

@@ -74,7 +74,7 @@ export function ErrorBoundary() { return ( -
+

{error.message} diff --git a/apps/web/app/routes/_index.tsx b/apps/web/app/routes/_index.tsx index ae2c6b0eb..9cf105375 100644 --- a/apps/web/app/routes/_index.tsx +++ b/apps/web/app/routes/_index.tsx @@ -45,7 +45,7 @@ export default function Index() { {page.header && (
-

+

{page.header}

@@ -62,7 +62,7 @@ export function ErrorBoundary() { return ( -
+

{error.message} diff --git a/commitlint.config.js b/commitlint.config.js index 0f3bcc6d6..66c505fbf 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -29,6 +29,7 @@ module.exports = { 'perf', 'refactor', 'revert', + 'style', 'test', 'release' ] diff --git a/libs/app-cms/ui/components/src/lib/Logo.client.tsx b/libs/app-cms/ui/components/src/lib/Logo.client.tsx index beda8d054..b6ab00163 100644 --- a/libs/app-cms/ui/components/src/lib/Logo.client.tsx +++ b/libs/app-cms/ui/components/src/lib/Logo.client.tsx @@ -11,7 +11,7 @@ const Logo: React.FC = () => { className="text-black dark:text-white" />

- + Codeware CMS
diff --git a/libs/app-cms/ui/components/src/lib/RedirectNotifier.tsx b/libs/app-cms/ui/components/src/lib/RedirectNotifier.tsx index f6dc79039..0d610d353 100644 --- a/libs/app-cms/ui/components/src/lib/RedirectNotifier.tsx +++ b/libs/app-cms/ui/components/src/lib/RedirectNotifier.tsx @@ -56,10 +56,10 @@ export const RedirectNotifier: React.FC = () => { aria-hidden="true" /> - -

Redirected

+ +

Redirected

-
+
You were redirected to your tenant CMS domain. For security reasons the session can not be reused.
Please log in again!
@@ -68,7 +68,7 @@ export const RedirectNotifier: React.FC = () => {
diff --git a/libs/shared/ui/payload-components/src/lib/blocks/ContentBlock.tsx b/libs/shared/ui/payload-components/src/lib/blocks/ContentBlock.tsx index f16527113..505a75102 100644 --- a/libs/shared/ui/payload-components/src/lib/blocks/ContentBlock.tsx +++ b/libs/shared/ui/payload-components/src/lib/blocks/ContentBlock.tsx @@ -15,7 +15,7 @@ type Props = ContentBlockProps; */ export const ContentBlock: React.FC = ({ columns }) => { return ( -
+
{columns?.map((col, index) => { const { richText } = col; const size = col.size ?? 'full'; diff --git a/libs/shared/ui/payload-components/src/lib/blocks/FormBlock.tsx b/libs/shared/ui/payload-components/src/lib/blocks/FormBlock.tsx index f047ab26a..7040d24b5 100644 --- a/libs/shared/ui/payload-components/src/lib/blocks/FormBlock.tsx +++ b/libs/shared/ui/payload-components/src/lib/blocks/FormBlock.tsx @@ -178,14 +178,14 @@ export const FormBlock: React.FC = ({ } return ( -
+
{enableIntro && introContent && ( )}
= ({ return ( fieldDef.message && (
diff --git a/libs/shared/ui/payload-components/src/lib/blocks/RichText.tsx b/libs/shared/ui/payload-components/src/lib/blocks/RichText.tsx index 1a12c1ac0..cf7d2e5b2 100644 --- a/libs/shared/ui/payload-components/src/lib/blocks/RichText.tsx +++ b/libs/shared/ui/payload-components/src/lib/blocks/RichText.tsx @@ -59,7 +59,7 @@ export const RichText = (props: Props) => { converters={jsxConverters} className={cn( { - 'mx-auto prose md:prose-md dark:prose-invert': !disableProse, + 'prose md:prose-md dark:prose-invert mx-auto': !disableProse, 'not-prose': disableProse }, className diff --git a/libs/shared/ui/react-components/src/lib/Code.tsx b/libs/shared/ui/react-components/src/lib/Code.tsx index 21ba171a0..40e9c9dd5 100644 --- a/libs/shared/ui/react-components/src/lib/Code.tsx +++ b/libs/shared/ui/react-components/src/lib/Code.tsx @@ -31,7 +31,7 @@ export const Code: React.FC = ({ {({ className, getLineProps, getTokenProps, style, tokens }) => (
             {tokens.map((line, i) => (
diff --git a/libs/shared/ui/react-components/src/lib/CopyButton.tsx b/libs/shared/ui/react-components/src/lib/CopyButton.tsx
index 4408b28a0..a090a0fd1 100644
--- a/libs/shared/ui/react-components/src/lib/CopyButton.tsx
+++ b/libs/shared/ui/react-components/src/lib/CopyButton.tsx
@@ -26,10 +26,7 @@ export const CopyButton = ({ code, className = '' }: CopyButtonProps) => {
   return (