From 5084921b76790d735c9baf2dabb9528c61d008d3 Mon Sep 17 00:00:00 2001 From: Ryuta Hamasaki Date: Thu, 6 Feb 2025 09:56:21 +0900 Subject: [PATCH 01/11] Upgrade actions to the latest version --- .github/workflows/code-quality.yml | 2 +- .github/workflows/tests.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 02a9799ba..e513cfee7 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -14,7 +14,7 @@ jobs: quality: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0db09cb3d..5af4be3d6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -26,7 +26,7 @@ jobs: coverage: xdebug - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: '18' cache: 'npm' From dc63f8ab5f2e735abf70409a538f8995774e84af Mon Sep 17 00:00:00 2001 From: Ryuta Hamasaki Date: Thu, 6 Feb 2025 10:13:41 +0900 Subject: [PATCH 02/11] Use cn function --- resources/js/components/appearance-tabs.tsx | 8 +++++--- resources/js/components/input-error.tsx | 3 ++- resources/js/components/text-link.tsx | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/resources/js/components/appearance-tabs.tsx b/resources/js/components/appearance-tabs.tsx index 898d2911c..8ac18ebdd 100644 --- a/resources/js/components/appearance-tabs.tsx +++ b/resources/js/components/appearance-tabs.tsx @@ -1,4 +1,5 @@ import { Appearance, useAppearance } from '@/hooks/use-appearance'; +import { cn } from '@/lib/utils'; import { LucideIcon, Monitor, Moon, Sun } from 'lucide-react'; import { HTMLAttributes } from 'react'; @@ -12,16 +13,17 @@ export default function AppearanceToggleTab({ className = '', ...props }: HTMLAt ]; return ( -
+
{tabs.map(({ value, icon: Icon, label }) => ( - + updateAppearance('light')}> diff --git a/resources/js/components/nav-main.tsx b/resources/js/components/nav-main.tsx index b76843cab..08a1ed5f8 100644 --- a/resources/js/components/nav-main.tsx +++ b/resources/js/components/nav-main.tsx @@ -12,7 +12,7 @@ export function NavMain({ items = [] }: { items: NavItem[] }) { - + {item.icon && } {item.title} diff --git a/resources/js/pages/welcome.tsx b/resources/js/pages/welcome.tsx index 894ca9847..c2cac8758 100644 --- a/resources/js/pages/welcome.tsx +++ b/resources/js/pages/welcome.tsx @@ -283,7 +283,7 @@ export default function Welcome() {
- Laravel v{laravelVersion} (PHP v{phpVersion}) + Laravel v{laravelVersion as string} (PHP v{phpVersion as string})
From c73cb148a0e5d3ae63461a968ce05b19e49cf141 Mon Sep 17 00:00:00 2001 From: Ryuta Hamasaki Date: Thu, 6 Feb 2025 10:20:50 +0900 Subject: [PATCH 04/11] Format --- resources/js/components/appearance-tabs.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/components/appearance-tabs.tsx b/resources/js/components/appearance-tabs.tsx index 8ac18ebdd..19e39e188 100644 --- a/resources/js/components/appearance-tabs.tsx +++ b/resources/js/components/appearance-tabs.tsx @@ -22,7 +22,7 @@ export default function AppearanceToggleTab({ className = '', ...props }: HTMLAt 'flex items-center rounded-md px-3.5 py-1.5 transition-colors', appearance === value ? 'bg-white shadow-sm dark:bg-neutral-700 dark:text-neutral-100' - : 'text-neutral-500 hover:bg-neutral-200/60 hover:text-black dark:text-neutral-400 dark:hover:bg-neutral-700/60' + : 'text-neutral-500 hover:bg-neutral-200/60 hover:text-black dark:text-neutral-400 dark:hover:bg-neutral-700/60', )} > From 5e01767fe62e99fa3cb623ff6e0598e45e7ca24d Mon Sep 17 00:00:00 2001 From: Tony Lea Date: Thu, 6 Feb 2025 13:59:48 -0500 Subject: [PATCH 05/11] Adding updates to the verifed email controller to get tests passing --- app/Http/Controllers/Auth/VerifyEmailController.php | 6 ++---- resources/js/pages/auth/verify-email.tsx | 7 +------ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/Auth/VerifyEmailController.php b/app/Http/Controllers/Auth/VerifyEmailController.php index d8f316ebb..2477faa51 100644 --- a/app/Http/Controllers/Auth/VerifyEmailController.php +++ b/app/Http/Controllers/Auth/VerifyEmailController.php @@ -4,7 +4,6 @@ use App\Http\Controllers\Controller; use Illuminate\Auth\Events\Verified; -use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Foundation\Auth\EmailVerificationRequest; use Illuminate\Http\RedirectResponse; @@ -20,10 +19,9 @@ public function __invoke(EmailVerificationRequest $request): RedirectResponse } if ($request->user()->markEmailAsVerified()) { + /** @var \Illuminate\Contracts\Auth\MustVerifyEmail $user */ $user = $request->user(); - if ($user instanceof MustVerifyEmail) { - event(new Verified($user)); - } + event(new Verified($user)); } return redirect()->intended(route('dashboard', absolute: false).'?verified=1'); diff --git a/resources/js/pages/auth/verify-email.tsx b/resources/js/pages/auth/verify-email.tsx index 7cf531cc5..25d2fffeb 100644 --- a/resources/js/pages/auth/verify-email.tsx +++ b/resources/js/pages/auth/verify-email.tsx @@ -16,14 +16,9 @@ export default function VerifyEmail({ status }: { status?: string }) { }; return ( - + -
- Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If - you didn't receive the email, we will gladly send you another -
- {status === 'verification-link-sent' && (
A new verification link has been sent to the email address you provided during registration From d4dd34c7285e71e0cb7a7f0241166a41ef63ef50 Mon Sep 17 00:00:00 2001 From: Tony Lea Date: Thu, 6 Feb 2025 14:03:21 -0500 Subject: [PATCH 06/11] Adding priveleges for CI to commit back to the branch --- .github/workflows/lint.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f946be1bd..0b3b5f15e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,6 +10,9 @@ on: - develop - main +permissions: + contents: write + jobs: quality: runs-on: ubuntu-latest @@ -27,19 +30,13 @@ jobs: npm install - name: Run Pint - run: vendor/bin/pint + run: vendor/bin/pint --test - - name: Frontend Format - run: npm run format + - name: Frontend Format Check + run: npm run format -- --check - name: Frontend Lint run: npm run lint - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: fix code style - commit_options: "--no-verify" - - name: PHPStan run: ./vendor/bin/phpstan From 9e5d32b72a6a622a0e4fedc0e54f5ed0a10a52ae Mon Sep 17 00:00:00 2001 From: Tony Lea Date: Thu, 6 Feb 2025 14:06:30 -0500 Subject: [PATCH 07/11] Adding CI functionality to write commit --- .github/workflows/lint.yml | 11 +++++++++-- README.md | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0b3b5f15e..6f80ec208 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -30,13 +30,20 @@ jobs: npm install - name: Run Pint - run: vendor/bin/pint --test + run: vendor/bin/pint - name: Frontend Format Check - run: npm run format -- --check + run: npm run format - name: Frontend Lint run: npm run lint + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: fix code style + commit_options: "--no-verify" + + # We need to run PHPStan after commiting changes as it does not auto-fix errors. - name: PHPStan run: ./vendor/bin/phpstan diff --git a/README.md b/README.md index ba6a10f19..31df82e54 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@

Laravel Logo

-Build Status +Test Status +Lint Status License

From 4b379f5d1e3fd8450efe18f1288d4fd92eea6d64 Mon Sep 17 00:00:00 2001 From: Tony Lea Date: Thu, 6 Feb 2025 14:19:49 -0500 Subject: [PATCH 08/11] adding permissions to get CI to auto-commit --- .github/workflows/lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6f80ec208..905ff124e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,6 +12,7 @@ on: permissions: contents: write + workflows: write jobs: quality: From 0d5e1629632e6d8ce8de4077fe1ae1492d0b5b90 Mon Sep 17 00:00:00 2001 From: Tony Lea Date: Thu, 6 Feb 2025 14:23:09 -0500 Subject: [PATCH 09/11] fixing the lint yaml --- .github/workflows/lint.yml | 2 +- app/Http/Controllers/Auth/PasswordResetLinkController.php | 1 - resources/js/pages/auth/verify-email.tsx | 5 ++++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 905ff124e..1298df552 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -43,7 +43,7 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: fix code style - commit_options: "--no-verify" + commit_options: '--no-verify' # We need to run PHPStan after commiting changes as it does not auto-fix errors. - name: PHPStan diff --git a/app/Http/Controllers/Auth/PasswordResetLinkController.php b/app/Http/Controllers/Auth/PasswordResetLinkController.php index 5e4280b11..14a1b248e 100644 --- a/app/Http/Controllers/Auth/PasswordResetLinkController.php +++ b/app/Http/Controllers/Auth/PasswordResetLinkController.php @@ -6,7 +6,6 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Password; -use Illuminate\Validation\ValidationException; use Inertia\Inertia; use Inertia\Response; diff --git a/resources/js/pages/auth/verify-email.tsx b/resources/js/pages/auth/verify-email.tsx index 25d2fffeb..9e471a2e1 100644 --- a/resources/js/pages/auth/verify-email.tsx +++ b/resources/js/pages/auth/verify-email.tsx @@ -16,7 +16,10 @@ export default function VerifyEmail({ status }: { status?: string }) { }; return ( - + {status === 'verification-link-sent' && ( From 17393697c0ca1bd2e5a28f25c2a7b82fb6e1b991 Mon Sep 17 00:00:00 2001 From: Tony Lea Date: Thu, 6 Feb 2025 14:24:43 -0500 Subject: [PATCH 10/11] renaming the linter yml file name --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1298df552..9959a2320 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: Code Quality +name: linter on: push: From 1333eff84cd7d85ec98cd3b97a8c70eefe274b4b Mon Sep 17 00:00:00 2001 From: Tony Lea Date: Thu, 6 Feb 2025 14:26:44 -0500 Subject: [PATCH 11/11] getting linter to run again --- .github/workflows/lint.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9959a2320..c7d122e15 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,10 +10,6 @@ on: - develop - main -permissions: - contents: write - workflows: write - jobs: quality: runs-on: ubuntu-latest