Skip to content

refactor: extract client/ folder — Phase 5#960

Merged
thymikee merged 1 commit into
mainfrom
phase5-client-folder
Jun 30, 2026
Merged

refactor: extract client/ folder — Phase 5#960
thymikee merged 1 commit into
mainfrom
phase5-client-folder

Conversation

@thymikee

Copy link
Copy Markdown
Member

What

Moves the SDK client + companion-tunnel cluster out of the src/ root into a dedicated src/client/ folder, per plans/perfect-shape.md §5.5 ("~8k LOC client/remote unfoldered at src root"; remote/ already extracted in #951).

Files moved (9): client, client-types, client-shared, client-normalizers, client-companion-tunnel{,-contract,-worker}, client-react-devtools-companion, companion-tunnel.

How

  • All 9 moved as git renames; 68 importers repointed via the resolve-based codemod (intra-client stays ./, staying deps recomputed).
  • companion-tunnel.ts keeps its rslib key internal/companion-tunnel, so dist output stays dist/src/internal/companion-tunnel.js and the public subpath is byte-identical (verified by build).
  • Updated non-src importers (3 integration tests + harness, vitest coverage include), .fallowrc.json entrypoint, and fallow-baselines/health.json keys.
  • Fixed two vi.mock('../client-react-devtools-companion.ts') paths the static-import codemod doesn't see (a wrong mock path would silently load the real module) — confirmed the mocks still apply.

Scope note

backend.ts and daemon-client*.ts are intentionally left for a follow-up (the daemon/client/ split) to keep this PR a focused client-cluster move.

Safety

typecheck ✅ · oxlint ✅ · format ✅ · build ✅ (public internal/companion-tunnel dist preserved) · fallow audit ✅ (no issues in 79 changed files) · targeted unit tests ✅ (client 34, the two mock-fixed tests 47). Behaviorless path codemod, 78 files.

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.4 MB 1.4 MB -4 B
JS gzip 456.1 kB 456.1 kB -5 B
npm tarball 557.8 kB 557.9 kB +108 B
npm unpacked 2.0 MB 2.0 MB -4 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.0 ms 26.2 ms +0.2 ms
CLI --help 47.1 ms 47.0 ms -0.1 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/495.js +64.1 kB +21.5 kB
dist/src/cli.js -1 B -2 B
dist/src/server.js -1 B 0 B

Move the SDK client + companion-tunnel cluster out of the src/ root into a
dedicated src/client/ folder, per plans/perfect-shape.md §5.5 (~8k LOC
client/remote unfoldered at src root; remote/ already extracted in #951).

Files moved (9): client, client-types, client-shared, client-normalizers,
client-companion-tunnel{,-contract,-worker}, client-react-devtools-companion,
companion-tunnel.

- git renames; 68 importers repointed via the resolve-based codemod
  (intra-client stays ./, staying deps recomputed)
- companion-tunnel.ts keeps rslib key 'internal/companion-tunnel' so dist
  output stays dist/src/internal/companion-tunnel.js (public subpath
  byte-identical; verified by build)
- update non-src importers (3 integration tests, vitest coverage include),
  .fallowrc.json entrypoint, fallow-baselines/health.json keys

backend.ts and daemon-client*.ts are intentionally left for follow-up
(daemon/client split). Behaviorless path codemod; all gates green.
@thymikee thymikee force-pushed the phase5-client-folder branch from 97b3f39 to a8684f6 Compare June 30, 2026 12:25
@thymikee

Copy link
Copy Markdown
Member Author

Reviewed against plans/perfect-shape.md section 5.5 and the package/build seams. This is a behaviorless client-cluster move: the nine client/companion files are preserved as renames with relative import updates, stale root imports were repointed to src/client, and the internal/companion-tunnel rslib key still emits the same public dist path. The mock path fixes cover the non-static import cases, fallow/package paths were updated, and checks are green. No blockers; marking ready-for-human.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Jun 30, 2026
@thymikee thymikee merged commit 189b062 into main Jun 30, 2026
21 checks passed
@thymikee thymikee deleted the phase5-client-folder branch June 30, 2026 12:37
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-30 12:37 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant