From 6b127fa8510ea8cb14ab3f89102f729795e5d376 Mon Sep 17 00:00:00 2001 From: roble Date: Tue, 10 Nov 2026 11:24:08 +0000 Subject: [PATCH 1/6] test: assert behaviour, not copy or design Customers translate, reword and restyle a starter kit; tests now check test ids, data-state, URLs, counts and the data they create. Co-Authored-By: Claude Opus 5.5 --- tests/e2e/tests/sidebar.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/tests/sidebar.spec.ts b/tests/e2e/tests/sidebar.spec.ts index b9f108e..804a2e6 100644 --- a/tests/e2e/tests/sidebar.spec.ts +++ b/tests/e2e/tests/sidebar.spec.ts @@ -51,7 +51,7 @@ test.describe('Theme persistence', () => { // Select dark via the UI — this writes localStorage + cookie await page.getByTestId('user-menu-trigger').click(); await page.getByTestId('theme-selector-trigger').click(); - await page.getByRole('menuitem', { name: 'Dark' }).click(); + await page.getByTestId('color-mode-dark').click(); await expect(page.locator('html')).toHaveClass(/dark/); @@ -73,7 +73,7 @@ test.describe('Theme persistence', () => { // Select light via the UI await page.getByTestId('user-menu-trigger').click(); await page.getByTestId('theme-selector-trigger').click(); - await page.getByRole('menuitem', { name: 'Light' }).click(); + await page.getByTestId('color-mode-light').click(); await expect(page.locator('html')).not.toHaveClass(/dark/); From e9aba621abbf5c3efe24a9c0d97002ad5d602d72 Mon Sep 17 00:00:00 2001 From: roble Date: Tue, 10 Nov 2026 16:10:52 +0000 Subject: [PATCH 2/6] refactor: demo seeders become the showcase state Demo*Seeder is now Showcase*, run by modules:seed --state=showcase. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- Taskfile.yml | 4 ++-- ...tabaseSeeder.php => ShowcaseAuthDatabaseSeeder.php} | 2 +- .../{DemoStaffTest.php => ShowcaseStaffTest.php} | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) rename database/seeders/{DemoAuthDatabaseSeeder.php => ShowcaseAuthDatabaseSeeder.php} (95%) rename tests/Feature/{DemoStaffTest.php => ShowcaseStaffTest.php} (78%) diff --git a/README.md b/README.md index c323cc7..9caf341 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ Emails (reset, verification, magic links, alerts) need a working mail setup. ## Demo data ```bash -php artisan modules:seed --module=auth --demo +php artisan modules:seed --module=auth --state=showcase ``` Adds a user (`chef@saucebase.dev`) and a support staff account (`support@saucebase.dev`) that only sees user admin. Both use the `DEMO_PASSWORD` from `.env`. diff --git a/Taskfile.yml b/Taskfile.yml index 02b01c5..99c3d19 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -14,9 +14,9 @@ tasks: # ── Database ────────────────────────────────────────────────── - db:seed:demo: + db:seed:showcase: desc: Seed the Auth module with sample content - cmd: '{{.APP}} php artisan modules:seed --module=auth --demo' + cmd: '{{.APP}} php artisan modules:seed --module=auth --state=showcase' make-admin: desc: Promote an user to Admin diff --git a/database/seeders/DemoAuthDatabaseSeeder.php b/database/seeders/ShowcaseAuthDatabaseSeeder.php similarity index 95% rename from database/seeders/DemoAuthDatabaseSeeder.php rename to database/seeders/ShowcaseAuthDatabaseSeeder.php index e3e7d45..39e7183 100644 --- a/database/seeders/DemoAuthDatabaseSeeder.php +++ b/database/seeders/ShowcaseAuthDatabaseSeeder.php @@ -6,7 +6,7 @@ use Illuminate\Database\Seeder; use Spatie\Permission\Models\Role; -class DemoAuthDatabaseSeeder extends Seeder +class ShowcaseAuthDatabaseSeeder extends Seeder { /** * Run the database seeds. diff --git a/tests/Feature/DemoStaffTest.php b/tests/Feature/ShowcaseStaffTest.php similarity index 78% rename from tests/Feature/DemoStaffTest.php rename to tests/Feature/ShowcaseStaffTest.php index 19b5db1..6e17ea0 100644 --- a/tests/Feature/DemoStaffTest.php +++ b/tests/Feature/ShowcaseStaffTest.php @@ -6,20 +6,20 @@ use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\Hash; use Modules\Auth\Database\Seeders\DatabaseSeeder; -use Modules\Auth\Database\Seeders\DemoAuthDatabaseSeeder; +use Modules\Auth\Database\Seeders\ShowcaseAuthDatabaseSeeder; use Tests\TestCase; /** * The demo ships a staff account for this module's admin area, so visitors can try a * role that sees only part of the panel. */ -class DemoStaffTest extends TestCase +class ShowcaseStaffTest extends TestCase { use RefreshDatabase; public function test_the_demo_adds_a_staff_account_for_this_module_only(): void { - $this->seed([DatabaseSeeder::class, DemoAuthDatabaseSeeder::class]); + $this->seed([DatabaseSeeder::class, ShowcaseAuthDatabaseSeeder::class]); $staff = User::where('email', 'support@saucebase.dev')->firstOrFail(); @@ -29,7 +29,7 @@ public function test_the_demo_adds_a_staff_account_for_this_module_only(): void public function test_the_demo_has_one_full_admin_to_sign_in_with(): void { - $this->seed([DatabaseSeeder::class, DemoAuthDatabaseSeeder::class]); + $this->seed([DatabaseSeeder::class, ShowcaseAuthDatabaseSeeder::class]); $this->assertSame(['admin'], User::where('email', 'chef@saucebase.dev')->firstOrFail()->getRoleNames()->all()); } @@ -38,7 +38,7 @@ public function test_demo_accounts_use_the_configured_demo_password(): void { config(['saucebase.demo_password' => 'not-the-old-default']); - $this->seed([DatabaseSeeder::class, DemoAuthDatabaseSeeder::class]); + $this->seed([DatabaseSeeder::class, ShowcaseAuthDatabaseSeeder::class]); $this->assertTrue(Hash::check('not-the-old-default', User::where('email', 'support@saucebase.dev')->value('password'))); } From d851a49e2b47c4dfee6c00e7c17435bf7cae8375 Mon Sep 17 00:00:00 2001 From: roble Date: Tue, 10 Nov 2026 20:40:48 +0000 Subject: [PATCH 3/6] chore: alias the dev branch as 3.9.x-dev Co-Authored-By: Claude Opus 5.5 --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index 9a28e25..b279614 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,9 @@ "Modules\\Auth\\Providers\\AuthServiceProvider" ], "aliases": {} + }, + "branch-alias": { + "dev-dev": "3.9.x-dev" } }, "autoload": { From 7ea302791555a940123bc12cc5d626e775c50522 Mon Sep 17 00:00:00 2001 From: roble Date: Fri, 13 Nov 2026 13:20:22 +0000 Subject: [PATCH 4/6] feat: auth settings set at install Sign-up, modal sign-in, magic link and passkeys carry #[InstallSetting], so a template or the person installing can set them. Co-Authored-By: Claude Opus 5.5 --- src/Settings/AuthSettings.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Settings/AuthSettings.php b/src/Settings/AuthSettings.php index 9119dcb..022093e 100644 --- a/src/Settings/AuthSettings.php +++ b/src/Settings/AuthSettings.php @@ -2,6 +2,7 @@ namespace Modules\Auth\Settings; +use Saucebase\Core\Settings\InstallSetting; use Spatie\LaravelSettings\Settings; class AuthSettings extends Settings @@ -9,11 +10,14 @@ class AuthSettings extends Settings /** @var list */ public array $enabled_socialite_providers; + #[InstallSetting('Let people sign up?', hint: 'Off: only invited or admin-created accounts.')] public bool $registration_enabled; /** Whether signing in and registering open in a modal over the current page. */ + #[InstallSetting('Open sign-in and sign-up in a modal?')] public bool $modal_enabled; + #[InstallSetting('Let people sign in with an emailed link?')] public bool $magic_link_enabled; public int $magic_link_expiry; @@ -21,6 +25,7 @@ class AuthSettings extends Settings public bool $login_notification_enabled; /** Whether users can register passkeys and sign in with them. */ + #[InstallSetting('Let people sign in with passkeys?')] public bool $passkeys_enabled; public static function group(): string From 1797f3e87616f0b8618f24c23a386b26e14d49e7 Mon Sep 17 00:00:00 2001 From: roble Date: Sat, 14 Nov 2026 11:13:32 +0000 Subject: [PATCH 5/6] fix: sign-in and sign-up name the app, not Saucebase The headings said "Login to your Saucebase account" and "Sign up for Saucebase" in every app. They now use the site name from settings. Co-Authored-By: Claude Opus 5.5 --- resources/js/react/pages/Login.tsx | 10 ++++++++-- resources/js/react/pages/Register.tsx | 12 ++++++++---- resources/js/vue/pages/Login.vue | 15 +++++++++++++-- resources/js/vue/pages/Register.vue | 13 +++++++++++-- 4 files changed, 40 insertions(+), 10 deletions(-) diff --git a/resources/js/react/pages/Login.tsx b/resources/js/react/pages/Login.tsx index bd29b0b..397921a 100644 --- a/resources/js/react/pages/Login.tsx +++ b/resources/js/react/pages/Login.tsx @@ -1,5 +1,6 @@ import AlertMessage from '@/components/AlertMessage'; import { Modal } from '@inertiaui/modal-react'; +import { useSettings } from '@saucebase/react/hooks/useSettings'; import { useT } from '@saucebase/react/i18n'; import LoginForm from '../components/LoginForm'; import AuthCardLayout from '../layouts/AuthCardLayout'; @@ -20,12 +21,15 @@ interface LoginProps { */ export default function Login({ status, error, modal }: LoginProps) { const t = useT(); + const settings = useSettings(); if (!modal) { return ( @@ -40,7 +44,9 @@ export default function Login({ status, error, modal }: LoginProps) { {t('Welcome back')}

- {t('Login to your Saucebase account to continue')} + {t('Login to your :app account to continue', { + app: settings.general.site_name, + })}

diff --git a/resources/js/react/pages/Register.tsx b/resources/js/react/pages/Register.tsx index 5e74574..b79d377 100644 --- a/resources/js/react/pages/Register.tsx +++ b/resources/js/react/pages/Register.tsx @@ -1,4 +1,5 @@ import { Modal } from '@inertiaui/modal-react'; +import { useSettings } from '@saucebase/react/hooks/useSettings'; import { useT } from '@saucebase/react/i18n'; import RegisterForm from '../components/RegisterForm'; import AuthCardLayout from '../layouts/AuthCardLayout'; @@ -10,14 +11,15 @@ interface RegisterProps { /** Registration, as a page or a modal. See `Login.tsx` for the reasoning. */ export default function Register({ modal }: RegisterProps) { const t = useT(); + const settings = useSettings(); if (!modal) { return ( @@ -32,7 +34,9 @@ export default function Register({ modal }: RegisterProps) { {t('Create your account')}

- {t('Sign up for Saucebase to start building your SaaS')} + {t('Sign up for :app to get started', { + app: settings.general.site_name, + })}

diff --git a/resources/js/vue/pages/Login.vue b/resources/js/vue/pages/Login.vue index 208b178..36d7cda 100644 --- a/resources/js/vue/pages/Login.vue +++ b/resources/js/vue/pages/Login.vue @@ -1,9 +1,12 @@