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:
@@ -24,9 +24,10 @@ describe("a subscription change", () => {
|
||||
});
|
||||
|
||||
it("is refreshed through that one function wherever it is made", () => {
|
||||
const root = new URL("../components/", import.meta.url);
|
||||
const sites = readdirSync(root)
|
||||
.filter((f) => f.endsWith(".tsx") && !f.includes(".test."))
|
||||
const root = new URL("../", import.meta.url);
|
||||
const sites = readdirSync(root, { recursive: true, encoding: "utf8" })
|
||||
.map((f) => f.split("\\").join("/"))
|
||||
.filter((f) => f.endsWith(".tsx") && !f.includes(".test.") && !f.startsWith("design-lab/"))
|
||||
.map((f) => [f, readFileSync(new URL(f, root), "utf8")] as const)
|
||||
.filter(([, src]) => /api\.(un)?subscribeChannel\(/.test(src));
|
||||
expect(sites.length).toBeGreaterThanOrEqual(3);
|
||||
|
||||
Reference in New Issue
Block a user