From 95ee08549f6c7e61633c56db32bb2363c278f9eb Mon Sep 17 00:00:00 2001 From: Michael Hudson Nkotagu Date: Fri, 25 Oct 2024 12:55:06 +0300 Subject: [PATCH 1/3] chore: Explicitly allow js and tsx files to be imported without extensions --- apps/civicsignalblog/.eslintrc.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/civicsignalblog/.eslintrc.js b/apps/civicsignalblog/.eslintrc.js index ba1843094..4c66c3da2 100644 --- a/apps/civicsignalblog/.eslintrc.js +++ b/apps/civicsignalblog/.eslintrc.js @@ -3,6 +3,15 @@ module.exports = { extends: ["eslint-config-commons-ui/next"], rules: { "react/jsx-filename-extension": [1, { extensions: [".js", ".tsx"] }], // This rule allows JSX syntax in both .js and tsx files + // Disable requirement for importing file extensions for js and tsx files, without this we cant import custom components in Payload + "import/extensions": [ + "error", + "ignorePackages", + { + js: "never", + tsx: "never", + }, + ], }, settings: { "import/resolver": { From 913c90830293ad368747658a51c32b841dec413a Mon Sep 17 00:00:00 2001 From: Michael Hudson Nkotagu Date: Fri, 25 Oct 2024 13:36:57 +0300 Subject: [PATCH 2/3] chore: Update jest config to correctly resolve @commons-ui/payload modules --- apps/civicsignalblog/jest.config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/civicsignalblog/jest.config.js b/apps/civicsignalblog/jest.config.js index dea4ec013..85bba17cd 100644 --- a/apps/civicsignalblog/jest.config.js +++ b/apps/civicsignalblog/jest.config.js @@ -11,6 +11,8 @@ module.exports = { "/../../packages/commons-ui-core/src/$1", "^@/commons-ui/next/(.*)$": "/../../packages/commons-ui-next/src/$1", + "^@/commons-ui/payload/(.*)$": + "/../../packages/commons-ui-payload/src/$1", }, transformIgnorePatterns: ["/node_modules/(?!camelcase-keys)"], }; From f628870ee131ad6c0d971f71defed4b3a4413791 Mon Sep 17 00:00:00 2001 From: Michael Hudson Nkotagu Date: Fri, 25 Oct 2024 13:42:28 +0300 Subject: [PATCH 3/3] chore: Update PageHeader snapshot --- .../src/components/PageHeader/PageHeader.snap.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/civicsignalblog/src/components/PageHeader/PageHeader.snap.js b/apps/civicsignalblog/src/components/PageHeader/PageHeader.snap.js index c324dcd58..36f2fabce 100644 --- a/apps/civicsignalblog/src/components/PageHeader/PageHeader.snap.js +++ b/apps/civicsignalblog/src/components/PageHeader/PageHeader.snap.js @@ -15,9 +15,10 @@ exports[` renders unchanged 1`] = `
-

Let's @@ -27,7 +28,7 @@ exports[` renders unchanged 1`] = ` together -

+