Skip to content

refactor: group src/lib and src/commands into domain folders#253

Merged
vreshch merged 1 commit into
masterfrom
feature/structure-domain-folders
Jul 8, 2026
Merged

refactor: group src/lib and src/commands into domain folders#253
vreshch merged 1 commit into
masterfrom
feature/structure-domain-folders

Conversation

@vreshch

@vreshch vreshch commented Jul 8, 2026

Copy link
Copy Markdown
Member

Mechanical directory restructure: git mv + import-path updates only. No logic changes, no renames, no new exports, no barrels.

What changed

src/lib/ and src/commands/ files grouped into domain subfolders. Each source file moved with its co-located *.test.ts via git mv (history preserved).

Before

src/lib/          http.ts origins.ts config.ts file-lock.ts oauth.ts callback-server.ts
                  api.ts provision.ts vaults.ts vaults.schema.ts vault-registry.ts
                  daemon-client.ts daemon-pref.ts memory-client.ts status-info.ts
                  update-check.ts update-cache.ts update-lock.ts
src/commands/     setup.ts status.ts vault.ts vault-sync.ts memory.ts memory-verbs.ts
                  daemon-cmd.ts mcp.ts update.ts

After

src/lib/net/      http.ts origins.ts
src/lib/fs/       config.ts file-lock.ts
src/lib/auth/     oauth.ts callback-server.ts api.ts provision.ts
src/lib/vault/    vaults.ts vaults.schema.ts vault-registry.ts
src/lib/daemon/   daemon-client.ts daemon-pref.ts
src/lib/memory/   memory-client.ts
src/lib/status/   status-info.ts
src/lib/update/   update-check.ts update-cache.ts update-lock.ts

src/commands/auth/     setup.ts
src/commands/status/   status.ts
src/commands/vault/    vault.ts vault-sync.ts
src/commands/memory/   memory.ts memory-verbs.ts
src/commands/daemon/   daemon-cmd.ts
src/commands/mcp/      mcp.ts
src/commands/update/   update.ts

Import updates

  • All relative .js ESM imports re-resolved for moved files and their consumers across src/commands, src/daemon, src/sync/{couch,git,discover}, src/mcp, src/daemon-entry.ts, src/cli.ts.
  • Fixed stale vi.mock(...) path strings in daemon-cmd.test.ts, mcp.test.ts, status-info.test.ts, update-check.test.ts (string literals that must match their import specifiers).
  • Adjusted the update-lock.test.ts transpile fixture to mirror the new fs/ + update/ subfolder layout (it copies sibling sources by name; assertions unchanged).
  • No index/barrel files added. No files renamed. No exports/logic changed.

Docs

  • Updated CLAUDE.md Layout section to reflect the new subfolders.
  • README has no file-tree section; architecture diagram untouched.

Verify

  • npm run verify fully green: type-check + type-check:e2e + lint + format:check + 406 unit tests + build.
  • Sanity-ran the built CLI: node dist/cli.js --help and node dist/cli.js status resolve modules and run without crashing.

Files moved: 53 (with tests). Import/mock lines changed: 125.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🎉 PR Validation ✅ PASSED

Commit: b2473dfba291a4cd15e047281360a05982a494e3
Branch: feature/structure-domain-folders

Checks:

  • ✅ Release guard (no version/changelog changes)
  • ✅ Dependencies installed
  • ✅ Type check passed
  • ✅ Linting passed
  • ✅ Format check passed
  • ✅ Tests + coverage passed
  • ✅ Build successful

Ready to merge!


🔗 View workflow run
⏰ Generated at: 2026-07-08T21:40:43.509Z

@vreshch
vreshch force-pushed the feature/structure-domain-folders branch from 96f998d to b2473df Compare July 8, 2026 21:40
@vreshch
vreshch marked this pull request as ready for review July 8, 2026 21:43
@vreshch
vreshch merged commit dc8fb0e into master Jul 8, 2026
3 checks passed
@vreshch
vreshch deleted the feature/structure-domain-folders branch July 8, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant