Remove dead code surfaced by the automations removal sweep - #339
Merged
Merged
Conversation
added 2 commits
September 7, 2026 17:18
Closes #334. Everything here had zero importers on main, verified by grepping for the import path or class name across resources/js, app, config, routes, tests and resources/views. Frontend: the leftovers of the Jan 2026 starter kit (AlertError, AppContent, AppShell, Breadcrumbs, Heading, Icon, NavFooter, PlaceholderPattern, UserInfo, WorkspaceSwitcher, GuestLayout, AuthCardLayout, AuthSimpleLayout, useDateMaska) plus 18 shadcn ui/ directories nothing ever imported. ui/sheet and ui/range-calendar stay, against what #334 listed: sheet backs the mobile drawer in ui/sidebar/Sidebar.vue, which AppSidebar renders, and range-calendar backs ui/date-range-picker, used by the analytics page. The "no importer outside ui/" criterion missed those transitive edges. posts/previews/LinkCard.vue also stays; it is live in the X, Threads and Bluesky previews. The sweep's grep only covered single-quoted imports and that one is double-quoted. ui/input/InputMask.vue was not on the list but is an orphan too, and it was the last thing holding maska. PHP: PasswordValidationRules, the Ai\Orientation enum (the image pipeline passes raw 'portrait'/'landscape' strings instead) and QuotaExhaustedException. npm: axios, embla-carousel-vue, vue-input-otp, vaul-vue and maska drop out of package.json. axios stays in the tree as a transitive dependency of @inertiajs/vue3, it just is not ours to declare any more.
…ning
tests/BrowserTestCase already says these tests load the built Vite assets,
but it only turned off the manifest fake. Laravel still prefers public/hot
when it exists, so on any machine with `npm run dev` running the browser
tests silently loaded the app from the Vite dev server instead of the build
that `npm run build` had just produced.
That is enough on its own to make three tests fail locally while CI, which
has no hot file, stays green. The dev server resolves
`import.meta.glob('../../lang/*.json')` lazily at runtime, and the
laravel-vue-i18n Vite plugin deletes lang/php_*.json when a build finishes,
so the page rendered raw translation keys -- "auth.legal" instead of the
sentence with the Terms of Service and Privacy Policy links, and the raw
repurposes.health.source_missing key instead of the banner.
Pointing the hot file at a path that can never exist makes the browser tests
use the manifest unconditionally, which is what they claim to do and what CI
has been doing all along.
AuthLegalLinksTest the login screen shows the legal sentence
AuthLegalLinksTest the register screen shows the legal sentence
RepurposeAccountHealthTest a repurpose whose source was deleted ...
The HTTP server the browser plugin runs lives in the test process
(Pest\Browser\Drivers\LaravelHttpServer resolves the kernel out of the same
container), so a setUp() override reaches the rendered page.
added 4 commits
September 7, 2026 23:05
The sweep removed 108 files under resources/js/components/ui because nothing imported them. That reasoning does not hold there: those are the shadcn-vue primitives, kept as a library to build from rather than as application code, so being unimported is their normal state, not evidence they are dead. The directory is now byte-identical to main again. Also merges main, which brought the locale work in (#341). The two test files both branches touched — WebhookPausedMailTest and WebhookTranslationsTest — combined without conflict.
This commit cleans up the BrowserTestCase by eliminating the unused Vite facade and the associated setup method, which was previously intended to configure a hot file that never existed. The class now focuses solely on its core functionality without unnecessary dependencies.
The sweep dropped five packages as unused, but four of them are imported by the primitives under resources/js/components/ui — restoring those files without the packages broke the build, which is what the e2e job hit: "Rolldown failed to resolve import maska/vue". vaul-vue (drawer), vue-input-otp and embla-carousel-vue (carousel) come back: if the primitives stay as a library to build from, so do the packages they depend on. axios and maska stay out — nothing imports either, maska only mattered for InputMask.vue, which is gone. Also drops the Vite hot-file override from BrowserTestCase. It forced the tests onto public/build even with the dev server running, so locally they read whatever was last built rather than the code under test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #334.
Two commits: the dead-code removal itself, and a one-line fix to
BrowserTestCasewithout which the browser suite fails locally for reasons that have nothing to do with this PR — see the second half.1. The removal
Every file here has zero importers on
main, verified by grepping the import path or class name acrossresources/js,app,config,routes,testsandresources/views.125 files deleted, −3073 lines.
Removed
Frontend — leftovers of the Jan 2026 starter kit:
AlertError,AppContent,AppShell,Breadcrumbs,Heading,Icon,NavFooter,PlaceholderPattern,UserInfo,WorkspaceSwitcher,composables/useDateMaska.ts,layouts/GuestLayout.vue,layouts/auth/AuthCardLayout.vue,layouts/auth/AuthSimpleLayout.vue.components/ui/*— 18 shadcn directories nothing ever imported:alert-dialog, aspect-ratio, button-group, carousel, context-menu, drawer, empty, hover-card, input-group, input-otp, kbd, native-select, navigation-menu, progress, radio-group, resizable, scroll-area, tags-input.
Any of them comes back with
npx shadcn-vue add <name>if it is ever wanted.PHP —
app/Concerns/PasswordValidationRules.php,app/Enums/Ai/Orientation.php,app/Exceptions/Ai/QuotaExhaustedException.php.npm —
axios,embla-carousel-vue,vue-input-otp,vaul-vue,maska.Three corrections to the issue's list
ui/sheetkept.ui/sidebar/Sidebar.vue:4importsSheet/SheetContentfor the mobile drawer, andSidebaris rendered byAppSidebar.vue:207→AppSidebarLayout.vue:43. Removing it would break the sidebar on phones.ui/range-calendarkept.ui/date-range-picker/DateRangePicker.vue:18uses it, and the picker is onpages/analytics/Index.vue:18.Both slipped through because the issue's criterion was "no importer outside
ui/" — a dependency from oneui/directory to another still counts.posts/previews/LinkCard.vuekept. It is live inXPreview.vue,ThreadsPreview.vueandBlueskyPreview.vue. The original sweep only matched single-quoted imports and that one is double-quoted.One addition
resources/js/components/ui/input/InputMask.vuewas not on the list but is an orphan too — exported fromui/input/index.ts, imported by nobody. It was the last thing keepingmaskaalive, so it goes withuseDateMaska.ts.Notes
Ai\Orientationwas unused because the image pipeline passes raw'portrait'/'landscape'strings (AiImageClient.php:30,TemplateImageGenerator.php:175,UnsplashService.php:36). Deleting it matches the issue; adopting it in those three call sites instead would also be defensible — happy to do that in a follow-up if you prefer.axiosstays innode_modulesas a transitive dependency of@inertiajs/vue3(via@inertiajs/coreandlaravel-precognition). Only our direct declaration goes away, and nothing inresources/jsever imported it.import/ordererrors is already resolved:npx eslint .is clean onmain.Audit
Empty,Progress,Carousel,Icon)@/components/ui/input, which still exists and exportsInput<alert-dialog>,<hover-card>)types/already existed onmainnpm lsfor the four removed packages2. Why
BrowserTestCasechanges hereWithout the second commit,
php artisan test tests/Browserfails locally on any machine withnpm run devrunning — three tests, none of them related to this PR, all failing onmaintoo. Shipping the removal next to that would make it look like the deletions broke something.tests/BrowserTestCasesays in its own docblock that these tests load the built Vite assets, but$fakesVite = falseonly turns off the manifest fake. Laravel's Vite helper still preferspublic/hotwhenever that file exists — and it exists on every machine runningnpm run dev. So the browser tests were loading the app from the Vite dev server, not from the build.That alone would be tolerable. What makes it fail is the interaction with i18n:
resources/js/app.ts:63resolves translations lazily withimport.meta.glob('../../lang/*.json').lang/php_*.jsonis generated by thelaravel-vue-i18n/viteplugin and gitignored (.gitignore:6).npm run buildwhilenpm run devis up and the dev server's runtime glob resolves nothing.The page then renders raw translation keys. From the failure screenshot:
auth.login.title,auth.login.email,auth.legal. SoassertVisible('@legal-links')passed (the div is there) whileassertSeeLink('Terms of Service')could not find the links, andRepurposeAccountHealthTestsaw the literalrepurposes.health.source_missinginstead of the banner sentence.CI has no hot file, so it always used the manifest and never saw any of this.
The fix:
Pointing the hot file at a path that can never exist makes the browser tests use the manifest unconditionally — what the class already claimed to do, and what CI has been doing all along. No effect in CI, where the hot file is absent either way.
This works because the HTTP server the browser plugin runs lives in the test process:
Pest\Browser\Drivers\LaravelHttpServer::handleRequest()resolves the kernel out of the same container, so asetUp()override reaches the rendered page.BrowserTestCaseis only extended bytests/Browser(tests/Pest.php:32), so nothing else is touched.Verification
npx vue-tsc --noEmitnpx eslint .npm run buildnpm run build:ssr(used bydocker/Dockerfile)vendor/bin/pint --dirtyphp artisan test --parallelphp artisan test tests/BrowserThe browser run is the one that matters for a PR that deletes 18 UI directories, and until the
BrowserTestCasefix it was silently exercising the dev server instead of the build. With the fix it exercises the real built assets, without the removed packages, and is green.