From 56a95b93527def3d5dee1a78ac5d872ceb7b9878 Mon Sep 17 00:00:00 2001 From: roble Date: Tue, 10 Nov 2026 11:24:10 +0000 Subject: [PATCH 1/9] docs: tests assert behaviour, not copy or design Co-Authored-By: Claude Opus 5.5 --- .ai/rules/e2e-tests.md | 3 +++ .ai/skills/saucebase-testing/SKILL.md | 2 ++ 2 files changed, 5 insertions(+) diff --git a/.ai/rules/e2e-tests.md b/.ai/rules/e2e-tests.md index 866945ff..df403872 100644 --- a/.ai/rules/e2e-tests.md +++ b/.ai/rules/e2e-tests.md @@ -8,6 +8,9 @@ paths: ## Select by test id Select elements by `data-testid`, never by translated text, labels, or role names, which change with the locale. Item-specific ids use `{action}-${item.id}`. +## Assert behaviour, not copy or design +Customers translate, reword and restyle a starter kit; a test must still pass. Assert what happened: an element is shown or hidden, a URL, a count, a `data-state`, data the test created (a name, price, version). Never assert UI copy (labels, toasts, errors, empty states), CSS, sizes or positions. If a state has no hook, add a `data-testid` or `data-state` to the component instead of matching its words. The same holds in PHPUnit: assert data and state, not `assertSee` on a heading or sentence. + ## Import the shared fixture Import `test` and `expect` from `@e2e/fixtures`, not `@playwright/test`. The fixture provides `credentials` and `loginAs`, and fails the test on any uncaught page error; list errors a spec causes on purpose with `test.use({ allowedPageErrors: [...] })`. diff --git a/.ai/skills/saucebase-testing/SKILL.md b/.ai/skills/saucebase-testing/SKILL.md index f646b335..f872c953 100644 --- a/.ai/skills/saucebase-testing/SKILL.md +++ b/.ai/skills/saucebase-testing/SKILL.md @@ -7,6 +7,8 @@ description: Choose, write, and run Saucebase tests — PHPUnit (app and modules Write the failing test first, then the code that makes it pass. +Test behaviour, not wording or looks: customers translate, reword and restyle, and the tests must still pass. Assert test ids, URLs, counts, `data-state` and data the test created; never UI copy, CSS, sizes or positions. Missing a hook? Add a `data-testid` or `data-state`. Details in `.ai/rules/e2e-tests.md`. + ## Which suite | Change | Suite | Location | From d737267a425ce661952ae25a977d8af33a69aac3 Mon Sep 17 00:00:00 2001 From: roble Date: Tue, 10 Nov 2026 16:11:09 +0000 Subject: [PATCH 2/9] chore: Taskfile seeds the showcase state Co-Authored-By: Claude Opus 5.5 --- Taskfile.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 6e886ff2..5aa9fc09 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -92,7 +92,7 @@ tasks: # ── Helpers ─────────────────────────────────────────────────── db:reset: - desc: Reset the app and E2E databases (migrate:fresh + module seeds; DEMO=--demo adds sample content) + desc: Reset the app and E2E databases (migrate:fresh + module seeds; STATE=showcase adds sample content) prompt: This will erase ALL data, in the E2E database too. Are you sure? # Checked before anything runs. Without .env.e2e, --env=e2e loads .env, and a cached # config or exported DB_* variables do the same: the E2E reset would wipe the app's database. @@ -105,20 +105,20 @@ tasks: msg: 'The E2E environment resolves to the app database (check .env.e2e, a cached config, or exported DB_* variables). Nothing was reset.' cmds: - '{{.APP}} php artisan migrate:fresh --seed' - - '{{.APP}} php artisan modules:seed {{.DEMO}}' + - '{{.APP}} php artisan modules:seed {{if .STATE}}--state={{.STATE}}{{end}}' # On the host, like the E2E run itself; its server only migrates, so an # edited migration needs this to apply there. - php artisan migrate:fresh --env=e2e --force - db:reset:demo: - desc: Reset the app and E2E databases and load sample content (the auth module's demo includes an admin) + db:reset:showcase: + desc: Reset the app and E2E databases and load sample content (the auth module's showcase includes an admin) cmds: - task: db:reset - vars: { DEMO: '--demo' } + vars: { STATE: showcase } - db:seed:demo: + db:seed:showcase: desc: Seed every module with sample content - cmd: '{{.APP}} php artisan modules:seed --demo' + cmd: '{{.APP}} php artisan modules:seed --state=showcase' # ── Translation ─────────────────────────────────────────────── From 0863ed490bcae5c1a97996a9fb830cff357c30af Mon Sep 17 00:00:00 2001 From: roble Date: Tue, 10 Nov 2026 20:41:10 +0000 Subject: [PATCH 3/9] chore: drop the Discord links from the navigation Co-Authored-By: Claude Opus 5.5 --- routes/navigation.php | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/routes/navigation.php b/routes/navigation.php index 45b53cd6..bd6d2a16 100644 --- a/routes/navigation.php +++ b/routes/navigation.php @@ -53,37 +53,6 @@ function (Section $section) { } ); -Navigation::add( - 'Discord', - 'https://discord.gg/hCajBky39t', - function (Section $section) { - $section->attributes([ - 'group' => 'secondary', - 'slug' => 'discord', - 'icon' => 'discord', - 'external' => true, - 'newPage' => true, - 'order' => 5, - 'class' => 'bg-[#5865F2]/10 text-[#4752C4] hover:bg-[#5865F2]/20 hover:text-[#3C45A5] dark:text-[#949CF7] dark:hover:text-[#B5BAFA]', - ]); - } -); - -Navigation::add( - 'Discord', - 'https://discord.gg/hCajBky39t', - function (Section $section) { - $section->attributes([ - 'group' => 'landing', - 'slug' => 'discord', - 'external' => true, - 'newPage' => true, - 'order' => 99, - 'class' => 'text-[#4752C4] hover:text-[#3C45A5] dark:text-[#949CF7] dark:hover:text-[#B5BAFA]', - ]); - } -); - Navigation::addWhen( fn () => Auth::user()?->can('access admin panel') ?? false, 'Admin', From ebfb994e1744c4ab3a7dbfd21dd5dbeb29629fa1 Mon Sep 17 00:00:00 2001 From: roble Date: Sat, 14 Nov 2026 10:53:57 +0000 Subject: [PATCH 4/9] docs: add guidance on reusing shared dialogs in frontend development --- .ai/skills/saucebase-frontend-development/SKILL.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.ai/skills/saucebase-frontend-development/SKILL.md b/.ai/skills/saucebase-frontend-development/SKILL.md index 35cadbcb..76cca9b2 100644 --- a/.ai/skills/saucebase-frontend-development/SKILL.md +++ b/.ai/skills/saucebase-frontend-development/SKILL.md @@ -69,6 +69,16 @@ Never import a `vendor/` path, and never reach into the app's pages. The `@saucebase/*` names are aliases the Vite preset in `saucebase/core` defines for its `resources/js`; only the app's own framework has one. +## Reuse the shared dialogs + +Before building a dialog, check what core already provides. A confirmation +(delete, revoke, sign out everywhere) goes through `useDialog().confirm()`, with +`variant: 'destructive'` and an icon when the action can't be undone; never a +page's own `AlertDialog`. Build a new dialog only when it holds a form or content +of its own, and then use the app's `@/components/ui/dialog` primitives. Every +confirmation then looks and behaves the same, and tests reach it through +`confirm-dialog`, `confirm-dialog-confirm`, and `confirm-dialog-cancel`. + ## Navigation Items are declared in PHP (`routes/navigation.php`); see From ca9fc8daf579d8249137ed8f529e73cc564a724a Mon Sep 17 00:00:00 2001 From: roble Date: Sat, 21 Nov 2026 17:02:39 +0000 Subject: [PATCH 5/9] fix: require core ^3.1 The published skeleton still required core ^2.12, so a new app got core 2.12 and the modules that run on it (auth 3.8.1, not 3.10), and contributor mode's Taskfile, which seeds with core 3's --state, failed. The lock moves only core (v3.1.1) and module-installer (v3.3.0, which core 3.1 requires). Co-Authored-By: Claude Opus 5.5 --- composer.json | 2 +- composer.lock | 40 ++++++++++++++++++++++++---------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index fafd4841..36428af6 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "php": "^8.4", "laravel/framework": "^13.38.0", "laravel/tinker": "^3.0.2", - "saucebase/core": "^2.12" + "saucebase/core": "^3.1" }, "require-dev": { "barryvdh/laravel-ide-helper": "^3.7", diff --git a/composer.lock b/composer.lock index 87414acb..6136e58b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "36becdb7b3a3c3deb095d53f11e49bfa", + "content-hash": "98afe2ac08fea8350835912524d7371d", "packages": [ { "name": "anourvalar/eloquent-serialize", @@ -7051,16 +7051,16 @@ }, { "name": "saucebase/core", - "version": "v2.12.0", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/saucebase-dev/core.git", - "reference": "071aecf898ea63650a2313c8c627717f76c1e88d" + "reference": "7055df8864ba009aa735ef0939a398b6a2bec963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/saucebase-dev/core/zipball/071aecf898ea63650a2313c8c627717f76c1e88d", - "reference": "071aecf898ea63650a2313c8c627717f76c1e88d", + "url": "https://api.github.com/repos/saucebase-dev/core/zipball/7055df8864ba009aa735ef0939a398b6a2bec963", + "reference": "7055df8864ba009aa735ef0939a398b6a2bec963", "shasum": "" }, "require": { @@ -7075,7 +7075,7 @@ "laravel/framework": "^13.38", "php": "^8.4", "saucebase/breadcrumbs": "^1.1", - "saucebase/module-installer": "^3.0.1", + "saucebase/module-installer": "^3.3", "spatie/laravel-data": "^4.23", "spatie/laravel-navigation": "^1.3", "spatie/laravel-permission": "^8.3.2", @@ -7100,6 +7100,9 @@ "dont-discover": [ "internachi/modular" ] + }, + "branch-alias": { + "dev-dev": "3.x-dev" } }, "autoload": { @@ -7132,22 +7135,23 @@ ], "support": { "issues": "https://github.com/saucebase-dev/core/issues", - "source": "https://github.com/saucebase-dev/core/tree/v2.12.0" + "source": "https://github.com/saucebase-dev/core/tree/v3.1.1" }, - "time": "2026-11-07T16:43:51+00:00" + "time": "2026-11-20T20:30:40+00:00", + "published-time": "2026-11-20T20:30:45+00:00" }, { "name": "saucebase/module-installer", - "version": "v3.2.0", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/saucebase-dev/module-installer.git", - "reference": "93279038a9ee1afd25d0ee9d6c9ad7c2519b1d46" + "reference": "397d8c0d2e56dcebf0689b29e8ac25c247b43019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/saucebase-dev/module-installer/zipball/93279038a9ee1afd25d0ee9d6c9ad7c2519b1d46", - "reference": "93279038a9ee1afd25d0ee9d6c9ad7c2519b1d46", + "url": "https://api.github.com/repos/saucebase-dev/module-installer/zipball/397d8c0d2e56dcebf0689b29e8ac25c247b43019", + "reference": "397d8c0d2e56dcebf0689b29e8ac25c247b43019", "shasum": "" }, "require": { @@ -7163,7 +7167,10 @@ }, "type": "composer-plugin", "extra": { - "class": "Saucebase\\ModuleInstaller\\Plugin" + "class": "Saucebase\\ModuleInstaller\\Plugin", + "branch-alias": { + "dev-dev": "3.3.x-dev" + } }, "autoload": { "psr-4": { @@ -7184,9 +7191,10 @@ "description": "Custom Composer installer for Sauce Base modules (type: saucebase-module). Installs to modules/ (lowercase) with configurable base dir.", "support": { "issues": "https://github.com/saucebase-dev/module-installer/issues", - "source": "https://github.com/saucebase-dev/module-installer/tree/v3.2.0" + "source": "https://github.com/saucebase-dev/module-installer/tree/v3.3.0" }, - "time": "2026-11-03T21:09:29+00:00" + "time": "2026-11-15T17:10:40+00:00", + "published-time": "2026-11-15T17:10:54+00:00" }, { "name": "scrivo/highlight.php", @@ -15255,5 +15263,5 @@ "php": "^8.4" }, "platform-dev": {}, - "plugin-api-version": "2.9.0" + "plugin-api-version": "2.11.0" } From c72572bf32946bf8d8e7603acbb7b73e5f2bd883 Mon Sep 17 00:00:00 2001 From: roble Date: Tue, 24 Nov 2026 21:28:31 +0000 Subject: [PATCH 6/9] Document Storybook for contributors and ignore its output CONTRIBUTING gets a Storybook section: the commands, where stories live in core, and the two ways contributor mode differs from an installed app (open stubs through vendor/, and the older docgen). .gitignore ignores the test coverage and the static build, as core's installer does for new apps. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 3 +++ CONTRIBUTING.md | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/.gitignore b/.gitignore index ea2b1ca7..cb286666 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,9 @@ /auth.json /node_modules +# Storybook: test coverage and the static build +/coverage +/storage/storybook /public/build /public/hot /public/modules diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d48f3cf5..264d2693 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -203,6 +203,31 @@ task workers # both; Ctrl-C stops both `APP` set to `docker compose exec app` in `Taskfile.yml`, these run in the container. A second queue worker is harmless. +### Storybook + +Core's components have stories, and the design system (colours, type, shape, +brand) has pages, in Storybook: + +```bash +npm run storybook # http://localhost:6006 +npm run test:stories # every story renders and its checks pass +npm run storybook:build # static build in storage/storybook +``` + +Stories live beside their components in core, in the stack you're on +(`stubs/stack/vue/js/` or `stubs/stack/react/js/`). Storybook's own config is +in that stack's `js/.storybook/`. Every story is also a test: it must render, and its +`play` function must pass. + +Two things differ from an installed app because core is a symlink here: + +- Open stories through `vendor/saucebase/core/stubs/...`, not `../core/...`. At + core's real path your editor finds no `tsconfig.json` or ESLint config and + reports errors that aren't there. +- Props tables and "Show code" come from an older docgen (Storybook prints a + deprecation warning on start). Installed apps use the newer one, which + can't read components through the symlink. + `Taskfile.yml` is committed with no modules listed. Installing a module adds its tasks locally; run `php artisan saucebase:taskfile-sync` to list exactly the modules you have. Don't commit those lines. From 56576ab8116e1aa03a8014263a710ab3d49b41b4 Mon Sep 17 00:00:00 2001 From: roble Date: Tue, 24 Nov 2026 22:01:48 +0000 Subject: [PATCH 7/9] CONTRIBUTING: stack --dev gives core a tsconfig for Storybook and editors Co-Authored-By: Claude Opus 5.5 --- CONTRIBUTING.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 264d2693..cb645e11 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -219,14 +219,13 @@ Stories live beside their components in core, in the stack you're on in that stack's `js/.storybook/`. Every story is also a test: it must render, and its `play` function must pass. -Two things differ from an installed app because core is a symlink here: - -- Open stories through `vendor/saucebase/core/stubs/...`, not `../core/...`. At - core's real path your editor finds no `tsconfig.json` or ESLint config and - reports errors that aren't there. -- Props tables and "Show code" come from an older docgen (Storybook prints a - deprecation warning on start). Installed apps use the newer one, which - can't read components through the symlink. +Core's components live outside this app, where its `tsconfig.json` doesn't +reach. `saucebase stack --dev` writes core a `tsconfig.json` of its own +(in `stubs/stack//js/`, git-ignored, pointing at this app), so Storybook's +props tables, "Show code" and its `/mcp` docs work as in an installed app, and +your editor type-checks core's files. If Storybook prints a "Builder docgen" +deprecation warning, that file is missing: run `saucebase stack --reset`, then +`saucebase stack --dev` again. `Taskfile.yml` is committed with no modules listed. Installing a module adds its tasks locally; run `php artisan saucebase:taskfile-sync` to list exactly the From 7d7d58c80b8d89eb188767076e5827921a342b65 Mon Sep 17 00:00:00 2001 From: roble Date: Wed, 25 Nov 2026 09:02:13 +0000 Subject: [PATCH 8/9] CONTRIBUTING: contributor-only stories Co-Authored-By: Claude Opus 5.5 --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cb645e11..89ec593c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -217,7 +217,9 @@ npm run storybook:build # static build in storage/storybook Stories live beside their components in core, in the stack you're on (`stubs/stack/vue/js/` or `stubs/stack/react/js/`). Storybook's own config is in that stack's `js/.storybook/`. Every story is also a test: it must render, and its -`play` function must pass. +`play` function must pass. A story tagged `contributor` (`tags: ['contributor']`, +for parts of Saucebase's own welcome page) shows in the sidebar only where +`saucebase.json` has `"contributor": true`; installed apps still run it as a test. Core's components live outside this app, where its `tsconfig.json` doesn't reach. `saucebase stack --dev` writes core a `tsconfig.json` of its own From 6be2ae03d0c7d4365ded82a33953458f49848812 Mon Sep 17 00:00:00 2001 From: roble Date: Wed, 25 Nov 2026 09:28:29 +0000 Subject: [PATCH 9/9] CONTRIBUTING: stack --dev also links node_modules into core Co-Authored-By: Claude Opus 5.5 --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 89ec593c..e068defb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -223,7 +223,8 @@ for parts of Saucebase's own welcome page) shows in the sidebar only where Core's components live outside this app, where its `tsconfig.json` doesn't reach. `saucebase stack --dev` writes core a `tsconfig.json` of its own -(in `stubs/stack//js/`, git-ignored, pointing at this app), so Storybook's +and a `node_modules` link (in `stubs/stack//js/`, git-ignored, pointing at +this app), so Storybook's props tables, "Show code" and its `/mcp` docs work as in an installed app, and your editor type-checks core's files. If Storybook prints a "Builder docgen" deprecation warning, that file is missing: run `saucebase stack --reset`, then