mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
ci(client): lint:pairs keeps a desktop view and its phone twin on one hook
Most features have a desktop view and a phone view, and until now each carried its own copy of the feature's logic, so a fix on one side drifted away from the other. With the logic moved into one shared hook per feature, scripts/feature-pairs.json names every feature with its hooks and the desktop and phone files that run on them. lint:pairs fails when a listed view stops importing one of its pair's hooks (a type only import does not count), when a listed file is gone, when a hook sits in a view layer rather than under components, hooks, utils or the folder of a page under pages/, and when a file under src/mobile/screens is in no pair and not under mobileOnly with the reason it has no twin. A new phone screen is so either wired to the desktop feature's hook or marked as phone only on purpose. lint:dup catches the copies that look alike; this one catches the copies written anew. The manifest starts with 120 features and 62 phone only screen files, each with the reason it stays on the phone alone. client/CLAUDE.md says how to change a feature, add one with both views and add a phone screen.
This commit is contained in:
@@ -356,6 +356,14 @@ jobs:
|
||||
# its phone twin share stays in one hook (scripts/dup-lint.mjs).
|
||||
run: cd client && npm run lint:dup
|
||||
|
||||
- name: Desktop and phone pairs check
|
||||
# Each view in scripts/feature-pairs.json imports its feature's shared
|
||||
# hook, and every file under src/mobile/screens is listed there, as a
|
||||
# view of a pair or as phone only with a reason, so a new phone screen
|
||||
# cannot grow its own copy of a desktop feature's logic
|
||||
# (scripts/pairs-lint.mjs).
|
||||
run: cd client && npm run lint:pairs
|
||||
|
||||
- name: Skipped and focused tests check
|
||||
run: cd client && npm run lint:skips
|
||||
|
||||
|
||||
Reference in New Issue
Block a user