You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address second review: rename ext/ -> vscode/ (no stutter with
extension.ts), features/browse -> features/entries/ (domain term),
move paths.ts to journal/ (journal-specific logic), align barrel
keys (J.Actions->J.Journal, J.Extension->J.VSCode, J.Provider split)
in same PR.
#209
Copy file name to clipboardExpand all lines: docs/specs/2026-05-17-209-domain-module-naming.md
+33-19Lines changed: 33 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,49 +2,62 @@
2
2
3
3
## Goal
4
4
5
-
Rename source directories from generic technical labels (`ext`, `actions`, `util`, `provider/*`) to journaling-domain terms that reveal intent at a glance.
5
+
Rename source directories from generic technical labels (`ext`, `actions`, `util`, `provider/*`) to journaling-domain terms that reveal intent at a glance, and align barrel namespace keys to match.
6
6
7
7
## Why Now
8
8
9
9
Phase 2 DI work (#207, #208) stabilized interfaces and service construction. Renaming now — before the barrel-import removal in Phase 2.3 — means the new paths are the canonical ones when named imports replace `J.*` namespaces. Doing it after 2.3 would require updating hundreds of named imports immediately.
10
10
11
11
## In Scope
12
12
13
-
Full directory rename + import path update for all TypeScript source files under `src/`. No logic changes.
13
+
Full directory rename + import path update for all TypeScript source files under `src/`. Barrel namespace keys updated to match new directories. No logic changes.
14
14
15
-
### Mapping
15
+
### Directory Mapping
16
16
17
-
> **Amendment (2026-05-17):** Dropped the `src/core/` grouping layer (depth without signal). Kept `src/util/` unchanged (pure helpers like `dates.ts` and `strings.ts` are not "infrastructure"). Renamed feature folder `navigation` → `browse` to avoid collision with `src/journal/navigation.ts`.
17
+
> **Amendment 1 (2026-05-17):** Dropped `src/core/` grouping (depth without signal). Kept `src/util/` mostly unchanged. Renamed feature folder `navigation` → `browse` to avoid collision with `src/journal/navigation.ts`.
18
+
>
19
+
> **Amendment 2 (2026-05-17):** Renamed `src/extension/` → `src/vscode/` to eliminate stutter with `src/extension.ts` entry point. Moved `paths.ts` (journal-specific logic) from `src/util/` to `src/journal/`. Renamed `src/features/browse/` → `src/features/entries/` (domain-specific). Barrel keys aligned in same PR.
18
20
19
21
| Current path | New path | Reason |
20
22
|---|---|---|
21
-
|`src/ext/`|`src/extension/`| VS Code lifecycle/config is extension plumbing, not domain|
23
+
|`src/ext/`|`src/vscode/`| VS Code binding layer; avoids stutter with `src/extension.ts`|
22
24
|`src/actions/`|`src/journal/`| Core read/write/inject logic _is_ the journal domain |
23
-
|`src/util/`|`src/util/`| No change — pure helpers are not infrastructure |
25
+
|`src/util/paths.ts`|`src/journal/paths.ts`| Journal-specific path patterns and template variables |
|`src/provider/commands/`|`src/commands/`| Commands are a top-level surface, not a provider sub-concern |
25
28
|`src/provider/codeactions/`|`src/ui/codeactions/`| VS Code UI surface grouped under `ui/`|
26
29
|`src/provider/codelens/`|`src/ui/codelens/`| VS Code UI surface grouped under `ui/`|
27
-
|`src/provider/features/sync-daily-links.ts`<br>`src/provider/features/sync-note-links.ts`|`src/features/sync/`| Sync is a domain feature, distinct from browsing |
28
-
|`src/provider/features/scan-entries.ts`<br>`src/provider/features/load-note.ts`<br>`src/provider/features/show-pick-list.ts`<br>`src/provider/features/weekly-entry-watcher.ts`|`src/features/browse/`|Power the "find and open" UX flow; `browse` avoids collision with `src/journal/navigation.ts`|
30
+
|`src/provider/features/sync-daily-links.ts`<br>`src/provider/features/sync-note-links.ts`|`src/features/sync/`| Sync is a domain feature, distinct from entry browsing |
31
+
|`src/provider/features/scan-entries.ts`<br>`src/provider/features/load-note.ts`<br>`src/provider/features/show-pick-list.ts`<br>`src/provider/features/weekly-entry-watcher.ts`|`src/features/entries/`|All operate on journal entries; domain-specific label|
29
32
|`src/provider/features/match-input.ts`|`src/journal/match-input.ts`| Smart-input resolver is parser-adjacent core logic |
30
33
|`src/model/`|`src/model/`| Already neutral; no rename |
31
34
32
35
`src/provider/` disappears entirely once all sub-paths are redistributed.
33
36
34
-
### Barrel index.ts
37
+
### Barrel Namespace Key Mapping
35
38
36
-
`src/index.ts` currently exports namespaces `J.Extension`, `J.Actions`, `J.Model`, `J.Util`, `J.Provider`. Update re-export paths to new locations; **keep namespace keys unchanged** (`J.Util`, `J.Actions`, etc.) to avoid churn in all consumers. Phase 2.3 eliminates the barrel entirely — that is the correct place to update consumer import sites.
39
+
`src/index.ts` currently exports `J.Extension`, `J.Actions`, `J.Model`, `J.Util`, `J.Provider`. Keys updated to match new directories; all consumer import sites updated in the same PR.
37
40
38
-
`src/provider/index.ts` is deleted (no new top-level `provider/` exists).
`src/provider/index.ts` is deleted. Three new barrel sub-indexes created: `src/commands/index.ts`, `src/ui/index.ts`, `src/features/index.ts`.
50
+
51
+
`dates.ts` stays in `src/util/` — it is scheduled for removal in Phase 3 (moment → `Intl`/`date-fns`); moving it now creates churn that will be immediately undone.
39
52
40
53
## Out of Scope
41
54
42
55
- Logic changes of any kind
43
-
- Renaming barrel namespace keys (`J.Util`, `J.Actions` etc.) — that belongs in Phase 2.3 alongside consumer migration
0 commit comments