From 9017af786b8d10dc64296be37b4c59a0afc5c80c Mon Sep 17 00:00:00 2001 From: Christoph Stockinger <christoph@morethings.digital> Date: Mon, 24 Feb 2025 22:20:51 +0100 Subject: [PATCH 1/8] Fixed type casting --- resources/js/pages/welcome.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/js/pages/welcome.tsx b/resources/js/pages/welcome.tsx index 3f3afc1b..e936f324 100644 --- a/resources/js/pages/welcome.tsx +++ b/resources/js/pages/welcome.tsx @@ -1,5 +1,6 @@ import { type SharedData } from '@/types'; import { Head, Link, usePage } from '@inertiajs/react'; +import { Property } from 'csstype'; export default function Welcome() { const { auth } = usePage<SharedData>().props; @@ -218,8 +219,7 @@ export default function Welcome() { /> </g> <g - /** @ts-expect-error 'plus-darker' doesn't seem to be defined in the 'csstype' module */ - style={{ mixBlendMode: 'plus-darker' }} + style={{ mixBlendMode: 'plus-darker' as Property.MixBlendMode }} className="translate-y-0 opacity-100 transition-all delay-300 duration-750 starting:translate-y-4 starting:opacity-0" > <path From 5a5f8a6627be2c1137fdd67e2894cddfe9fb7eed Mon Sep 17 00:00:00 2001 From: Christoph Stockinger <christoph@morethings.digital> Date: Mon, 24 Feb 2025 22:21:15 +0100 Subject: [PATCH 2/8] Added tsc compiler step to build task --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 20229aa1..350a82ae 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,9 @@ "private": true, "type": "module", "scripts": { + "prebuild": "tsc", "build": "vite build", - "build:ssr": "vite build && vite build --ssr", + "build:ssr": "npm run build && vite build --ssr", "dev": "vite", "format": "prettier --write resources/", "format:check": "prettier --check resources/", From 80eacfdf9f4af1f204dbf9fb203385657b825eea Mon Sep 17 00:00:00 2001 From: Christoph Stockinger <christoph@morethings.digital> Date: Tue, 25 Feb 2025 08:51:47 +0100 Subject: [PATCH 3/8] Use type declaration instead of interface --- resources/js/pages/auth/reset-password.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/resources/js/pages/auth/reset-password.tsx b/resources/js/pages/auth/reset-password.tsx index 8ea53031..40b770ea 100644 --- a/resources/js/pages/auth/reset-password.tsx +++ b/resources/js/pages/auth/reset-password.tsx @@ -8,11 +8,6 @@ import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import AuthLayout from '@/layouts/auth-layout'; -interface ResetPasswordProps { - token: string; - email: string; -} - type ResetPasswordForm = { token: string; email: string; @@ -20,6 +15,12 @@ type ResetPasswordForm = { password_confirmation: string; }; +interface ResetPasswordProps { + token: string; + email: string; +} + + export default function ResetPassword({ token, email }: ResetPasswordProps) { const { data, setData, post, processing, errors, reset } = useForm<Required<ResetPasswordForm>>({ token: token, From cc5f416b9a67ee7bf3797f5b6e2b23f787f60313 Mon Sep 17 00:00:00 2001 From: Christoph Stockinger <christoph@morethings.digital> Date: Tue, 25 Feb 2025 09:02:24 +0100 Subject: [PATCH 4/8] Change steps order --- .github/workflows/tests.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 485e0839..badb849c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,11 +31,8 @@ jobs: node-version: '22' cache: 'npm' - - name: Install Node Dependencies - run: npm ci - - - name: Build Assets - run: npm run build + - name: Create SQLite Database + run: touch database/database.sqlite - name: Install Dependencies run: composer install --no-interaction --prefer-dist --optimize-autoloader @@ -46,5 +43,11 @@ jobs: - name: Generate Application Key run: php artisan key:generate + - name: Install Node Dependencies + run: npm ci + + - name: Build Assets + run: npm run build + - name: Tests run: ./vendor/bin/phpunit From f94481f7c39162ed1a045628a26966ff152ef2e8 Mon Sep 17 00:00:00 2001 From: Christoph Stockinger <christoph@morethings.digital> Date: Wed, 5 Mar 2025 09:15:26 +0100 Subject: [PATCH 5/8] Align to #52 --- .github/workflows/tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index badb849c..608b2600 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,9 +31,6 @@ jobs: node-version: '22' cache: 'npm' - - name: Create SQLite Database - run: touch database/database.sqlite - - name: Install Dependencies run: composer install --no-interaction --prefer-dist --optimize-autoloader From 4f13b445a06f6cad785bcde4f39e7a6751259f46 Mon Sep 17 00:00:00 2001 From: Christoph Stockinger <christoph@morethings.digital> Date: Sun, 16 Mar 2025 23:05:48 +0100 Subject: [PATCH 6/8] Refactor npm scripts --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 350a82ae..dcd0b71e 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,13 @@ "private": true, "type": "module", "scripts": { - "prebuild": "tsc", "build": "vite build", - "build:ssr": "npm run build && vite build --ssr", + "build:ssr": "vite build && vite build --ssr", "dev": "vite", "format": "prettier --write resources/", "format:check": "prettier --check resources/", "lint": "eslint . --fix", - "types": "tsc --noEmit" + "type:check": "tsc --noEmit" }, "devDependencies": { "@eslint/js": "^9.19.0", From 7267dc1d2575f6f67d116a3ace309eea4de29e68 Mon Sep 17 00:00:00 2001 From: Christoph Stockinger <christoph@morethings.digital> Date: Sun, 16 Mar 2025 23:05:57 +0100 Subject: [PATCH 7/8] Integrate type checking into test workflow --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 608b2600..e1d3659e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,6 +43,9 @@ jobs: - name: Install Node Dependencies run: npm ci + - name: Validate typescript + run: npm run type:check + - name: Build Assets run: npm run build From 58eeccb676d2a8da4246d116223b2d3de997fc6d Mon Sep 17 00:00:00 2001 From: Christoph Stockinger <christoph@morethings.digital> Date: Sun, 16 Mar 2025 23:23:51 +0100 Subject: [PATCH 8/8] Use type declaration instead of interface --- resources/js/pages/settings/profile.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/js/pages/settings/profile.tsx b/resources/js/pages/settings/profile.tsx index 61cdda0a..fefcc64a 100644 --- a/resources/js/pages/settings/profile.tsx +++ b/resources/js/pages/settings/profile.tsx @@ -19,10 +19,10 @@ const breadcrumbs: BreadcrumbItem[] = [ }, ]; -interface ProfileForm { +type ProfileForm = { name: string; email: string; -} +}; export default function Profile({ mustVerifyEmail, status }: { mustVerifyEmail: boolean; status?: string }) { const { auth } = usePage<SharedData>().props;