Skip to content

Commit 68bd052

Browse files
authored
refactor: reorganize src/ into domain/, features/, presentation/ layers (#456)
* refactor: reorganize src/ into domain/, features/, presentation/ layers Move source files into a domain-driven directory structure: - src/domain/ — core graph building, queries, analysis, search (embeddings) - src/features/ — composable feature modules (audit, check, complexity, etc.) - src/presentation/ — CLI formatting and output rendering - src/db/ — database layer (db.js → db/index.js) All 199 files updated with corrected import paths. 1858 tests pass, 0 cycles, all manifesto rules green. Impact: 22 functions changed, 5 affected * docs: update CLAUDE.md architecture table for new directory structure Update file paths in the architecture table to reflect the domain/, features/, presentation/, db/ reorganization. Addresses Greptile review.
1 parent 2c87165 commit 68bd052

200 files changed

Lines changed: 572 additions & 539 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 35 additions & 25 deletions

src/ast-analysis/engine.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import path from 'node:path';
1919
import { performance } from 'node:perf_hooks';
20-
import { bulkNodeIdsByFile } from '../db.js';
20+
import { bulkNodeIdsByFile } from '../db/index.js';
2121
import { debug } from '../logger.js';
2222
import { computeLOCMetrics, computeMaintainabilityIndex } from './metrics.js';
2323
import {

src/cli/commands/audit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { audit } from '../../commands/audit.js';
2-
import { EVERY_SYMBOL_KIND } from '../../queries.js';
3-
import { explain } from '../../queries-cli.js';
2+
import { EVERY_SYMBOL_KIND } from '../../domain/queries.js';
3+
import { explain } from '../../presentation/queries-cli.js';
44

55
export const command = {
66
name: 'audit <target>',

src/cli/commands/batch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import fs from 'node:fs';
2-
import { BATCH_COMMANDS, multiBatchData, splitTargets } from '../../batch.js';
32
import { batch } from '../../commands/batch.js';
3+
import { EVERY_SYMBOL_KIND } from '../../domain/queries.js';
44
import { ConfigError } from '../../errors.js';
5-
import { EVERY_SYMBOL_KIND } from '../../queries.js';
5+
import { BATCH_COMMANDS, multiBatchData, splitTargets } from '../../features/batch.js';
66

77
export const command = {
88
name: 'batch <command> [targets...]',

src/cli/commands/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'node:path';
2-
import { buildGraph } from '../../builder.js';
2+
import { buildGraph } from '../../domain/graph/builder.js';
33

44
export const command = {
55
name: 'build [dir]',

src/cli/commands/cfg.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EVERY_SYMBOL_KIND } from '../../queries.js';
1+
import { EVERY_SYMBOL_KIND } from '../../domain/queries.js';
22

33
export const command = {
44
name: 'cfg <name>',

src/cli/commands/check.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { EVERY_SYMBOL_KIND } from '../../domain/queries.js';
12
import { ConfigError } from '../../errors.js';
2-
import { EVERY_SYMBOL_KIND } from '../../queries.js';
33

44
export const command = {
55
name: 'check [ref]',

src/cli/commands/children.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { EVERY_SYMBOL_KIND } from '../../queries.js';
2-
import { children } from '../../queries-cli.js';
1+
import { EVERY_SYMBOL_KIND } from '../../domain/queries.js';
2+
import { children } from '../../presentation/queries-cli.js';
33

44
export const command = {
55
name: 'children <name>',

src/cli/commands/complexity.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EVERY_SYMBOL_KIND } from '../../queries.js';
1+
import { EVERY_SYMBOL_KIND } from '../../domain/queries.js';
22

33
export const command = {
44
name: 'complexity [target]',

src/cli/commands/context.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { EVERY_SYMBOL_KIND } from '../../queries.js';
2-
import { context } from '../../queries-cli.js';
1+
import { EVERY_SYMBOL_KIND } from '../../domain/queries.js';
2+
import { context } from '../../presentation/queries-cli.js';
33

44
export const command = {
55
name: 'context <name>',

0 commit comments

Comments
 (0)