refactor: bring 18 more files under 300 lines via partial class and spec splits#110
Merged
antosubash merged 2 commits intomainfrom Apr 15, 2026
Merged
refactor: bring 18 more files under 300 lines via partial class and spec splits#110antosubash merged 2 commits intomainfrom
antosubash merged 2 commits intomainfrom
Conversation
…ass extraction Split 13 React pages by extracting sub-components, tab panels, filter toolbars, and chart helpers into sibling components/ folders. Split 7 C# services using the partial class pattern (by responsibility: query vs command, logging, export). Split 2 UI library components (chart.tsx and public-layout.tsx) into focused per-concern files. Build 0W/0E, npm typecheck 19/19, npm lint clean. Remaining 32 files (generator internals, tests, CLI commands, E2E specs) documented in tasks/todo.md for future batches.
…pec splits Continues the effort started in df56c1b to keep every source file under 300 lines. Splits 14 C# test files, the DevCommand CLI orchestrator, and 3 E2E/k6 scenario files using the same partial-class pattern established for services in the previous batch. - Tests (14 files) — split by feature area using partial class so xUnit discovery, [Collection] attributes, and fixture construction are preserved. Covers Chat, PageBuilder, Email, FileStorage, BackgroundJobs, DevTools, Database, Core (events), LoadTest/Shared factories, and Cli scaffold tests. - DevCommand.cs (777 -> 230) — split process signal helpers (Unix SIGTERM descendants), graceful shutdown, and misc helpers into sibling partials. - pagebuilder-crud.spec.ts (414) and menu-manager-crud.spec.ts (368) — split into topic-scoped .spec.ts files under subfolders, with a non-.spec helper module for shared setup so Playwright does not try to run it. - hotspots.ts (365) — converted to a thin k6 entry point re-exporting the scenario request functions and options from sibling modules (metrics, summary, requests-core/admin/tenants). - Renamed the ViteDevWatchServiceTests.* split files to match their actual sibling class names (they are not partials — each file is a distinct xUnit class) to avoid misleading naming. - Nested test entities in EntityInterceptorTests back inside the partial class as private sealed nested types to restore their original visibility after the split exposed them at namespace scope. Generator internals (framework/SimpleModule.Generator/**, the corresponding *.Tests, and NewProjectCommand.cs) are intentionally left in tasks/todo.md for a follow-up batch; they need more care than a mechanical split. Verification: - dotnet build: 0W/0E - dotnet test (all except LoadTests): ~1,226 passed, 0 failed, 1 skipped - npm run check: 0 errors, 0 warnings, typecheck 19/19 - npm run build: all workspaces built - e2e smoke (68 tests): all passed
Deploying simplemodule-website with
|
| Latest commit: |
6722c41
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6905add4.simplemodule-website.pages.dev |
| Branch Preview URL: | https://feature-frosty-mirzakhani.simplemodule-website.pages.dev |
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.
Summary
Continues df56c1b's effort to keep every source file under 300 lines. Splits the 14 test files,
DevCommand.cs, and 3 E2E/k6 scenario files documented as "remaining" in tasks/todo.md. Generator internals andNewProjectCommand.csare intentionally out of scope for this batch (left for a follow-up that needs more care).partial classso xUnit discovery,[Collection]attributes, and fixture construction are unchanged. Covers Chat, PageBuilder, Email, FileStorage, BackgroundJobs, DevTools, Database, Core events, LoadTest/Shared factories, and CLI scaffold tests.cli/SimpleModule.Cli/Commands/Dev/DevCommand.cs(777 → 230) — split Unix process signal helpers, graceful shutdown, and misc helpers intoDevCommand.Signals.cs,DevCommand.Shutdown.cs,DevCommand.Helpers.cs. Mirrors the precedent set byViteDevWatchService.{Logging,Helpers,Process}.cs.tests/e2e/tests/flows/pagebuilder-crud.spec.ts(414) andmenu-manager-crud.spec.ts(368) — split into topic-scoped.spec.tsfiles under subfolders, with non-.spechelper modules for shared setup so Playwright doesn't try to run them as tests.tests/k6/scenarios/hotspots.ts(365) — now a thin entry point that re-exports scenario functions from sibling files (metrics.ts,summary.ts,requests-core/admin/tenants.ts). k6 entry exports (default,setup,options,handleSummary) preserved.Why
The under-300-line rule was introduced in df56c1b; this PR finishes the work it left open (minus the generator/CLI-new bucket, which is gnarlier). No behavior changes — all file splits are pure code movement.
Reviewer notes
ViteDevWatchServiceTests.*.csrenamed. The original test file held 5 independent top-level classes, not a partial. The initial split mirrored its name with dot-suffixes, which would mislead future readers into thinking it was a partial. Renamed toFileWatcherIntegrationTests.cs,ServiceLifecycleTests.cs,DiscoverModuleDirectoriesTests.cs,FindRepoRootTests.cs,PathMatchingTests.cs.EntityInterceptorTeststest entities are nested back inside the partial class. The initial split moved 7 entity types and 2DbContexts to a sibling file at namespace scope (forcing thempublic). Restored asprivate sealed classnested in the partial to match the original visibility.packages/SimpleModule.Client/src/routes.tsis intentionally NOT committed —dotnet buildregenerates it and the repo convention (captured in tasks/todo.md:99) is to revert it before committing.Test plan
npm run check— 0 errors, 0 warnings, typecheck 19/19npm run build— all workspaces builtdotnet build— 0 warnings, 0 errorsdotnet test(excl. LoadTests) — ~1,226 passed, 0 failed, 1 skippednpm run test:smoke -w tests/e2e— 68/68 passed (3 Map smoke tests were flaky on first run, passed on both subsequent runs; Map code was not touched in this PR)