refactor(frontend): the flat components/ folder moves into shell/, modules/<page>/ and features/<name>/
A pure move (git mv, history kept): 333 files leave components/, which now holds only the platform layer (ui/) and the legal pages. The shell is the frame (App, header, nav rail, palette, boot); each page lives in modules/<page>/ with its rail, store and tests; what several pages share sits in features/<name>/; the shared-link page is watch/. Domain-free helpers went straight to ui/ (ViewSwitcher, FilterRail, the confirm dialog, the language switcher, the copy rows). Every relative specifier was rewritten (imports, dynamic imports, vi.mock, new URL), and the contract tests that scan sources now scan the whole app source, not only components/ — each glob was counted before and after so none went green over fewer files. The locale-format rule matched `/src/components/` only, so the move would have taken ~300 files out from under its i18n-singleton check; it now covers every folder that holds components, with a test per folder.
This commit is contained in:
@@ -5,7 +5,7 @@ import { readSources } from "./rawSources.testkit";
|
||||
// settles. A read-ahead that only checks `isFetchingNextPage` calls during a background
|
||||
// refetch, joins it through NEXT_PAGE and loads no page: the grid stalls at its loaded end until the
|
||||
// reader scrolls the range. The jsdom virtualizer measures nothing, so the wiring is pinned in source.
|
||||
const files = readSources(__dirname, ["../components/**/*.tsx", "!../components/**/*.test.tsx"]);
|
||||
const files = readSources(__dirname, ["../**/*.tsx", "!../**/*.test.tsx", "!../design-lab/**"]);
|
||||
const source = (name: string) => {
|
||||
const hit = Object.entries(files).find(([path]) => path.endsWith(`/${name}`));
|
||||
if (!hit) throw new Error(`no ${name}`);
|
||||
@@ -43,11 +43,11 @@ describe("an infinite list's read-ahead", () => {
|
||||
// NEXT_PAGE it would join the refetch and load nothing. NEXT_PAGE is only for the read-aheads, so a
|
||||
// click site that goes back to it fails here (the YouTube "Load more" was once missed).
|
||||
describe("a click that loads the next page", () => {
|
||||
const READ_AHEADS = new Set(["ui/VirtualGrid.tsx", "PlexBrowse.tsx"]);
|
||||
const READ_AHEADS = new Set(["components/ui/VirtualGrid.tsx", "modules/plex/PlexBrowse.tsx"]);
|
||||
it("uses nextPageOnClick; NEXT_PAGE only in the read-aheads", () => {
|
||||
const users = Object.entries(files)
|
||||
.filter(([, src]) => /fetchNextPage\(NEXT_PAGE\)/.test(src as string))
|
||||
.map(([path]) => path.replace("../components/", ""));
|
||||
.map(([path]) => path.replace(/^\.\.\//, ""));
|
||||
expect(users.sort()).toEqual([...READ_AHEADS].sort());
|
||||
for (const [file, sites] of [
|
||||
["AdminLogs.tsx", 2],
|
||||
|
||||
Reference in New Issue
Block a user