Skip to content

Commit 9d2670e

Browse files
committed
docs: amend spec #209 — vscode/, entries/, paths.ts move, barrel keys
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
1 parent ec47995 commit 9d2670e

1 file changed

Lines changed: 33 additions & 19 deletions

File tree

docs/specs/2026-05-17-209-domain-module-naming.md

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,62 @@
22

33
## Goal
44

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.
66

77
## Why Now
88

99
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.
1010

1111
## In Scope
1212

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.
1414

15-
### Mapping
15+
### Directory Mapping
1616

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.
1820
1921
| Current path | New path | Reason |
2022
|---|---|---|
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` |
2224
| `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 |
26+
| `src/util/` (remainder) | `src/util/` | Generic helpers (`dates.ts`, `strings.ts`, `logger.ts`, etc.) |
2427
| `src/provider/commands/` | `src/commands/` | Commands are a top-level surface, not a provider sub-concern |
2528
| `src/provider/codeactions/` | `src/ui/codeactions/` | VS Code UI surface grouped under `ui/` |
2629
| `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 |
2932
| `src/provider/features/match-input.ts` | `src/journal/match-input.ts` | Smart-input resolver is parser-adjacent core logic |
3033
| `src/model/` | `src/model/` | Already neutral; no rename |
3134

3235
`src/provider/` disappears entirely once all sub-paths are redistributed.
3336

34-
### Barrel index.ts
37+
### Barrel Namespace Key Mapping
3538

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.
3740

38-
`src/provider/index.ts` is deleted (no new top-level `provider/` exists).
41+
| Old key | New key | Re-exports from |
42+
|---|---|---|
43+
| `J.Extension` | `J.VSCode` | `src/vscode/` |
44+
| `J.Actions` | `J.Journal` | `src/journal/` |
45+
| `J.Provider` | `J.Commands` + `J.UI` + `J.Features` | `src/commands/`, `src/ui/`, `src/features/` |
46+
| `J.Util` | `J.Util` | `src/util/` (unchanged) |
47+
| `J.Model` | `J.Model` | `src/model/` (unchanged) |
48+
49+
`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.
3952

4053
## Out of Scope
4154

4255
- Logic changes of any kind
43-
- Renaming barrel namespace keys (`J.Util`, `J.Actions` etc.) — that belongs in Phase 2.3 alongside consumer migration
44-
- Renaming individual files (only directories change)
56+
- Renaming individual files (only directories and the `paths.ts` move)
4557
- `src/model/` (unchanged)
46-
- `src/test/` (test files update their import paths but directory structure unchanged)
58+
- `src/test/` (test files update import paths but directory structure unchanged)
4759
- `src/extension.ts` entry point (stays at root)
60+
- `dates.ts` migration — Phase 3
4861

4962
## Acceptance Criteria
5063

@@ -53,18 +66,19 @@ Full directory rename + import path update for all TypeScript source files under
5366
3. `npm run compile` succeeds (zero esbuild errors).
5467
4. `npm run compile-tests` succeeds (zero tsc errors).
5568
5. `npm test` passes with the same test count as `develop` before the rename.
56-
6. `AGENTS.md` updated: all path references (`src/ext/`, `src/actions/`, `src/provider/…`) reflect new locations (`src/util/` unchanged).
57-
7. `docs/PLAN.md` updated: path references in open backlog items reflect new locations.
69+
6. No remaining references to old keys `J.Actions`, `J.Extension`, `J.Provider` in `src/` (grep-verifiable).
70+
7. `AGENTS.md` updated: all path references and barrel key examples reflect new locations/keys.
71+
8. `docs/PLAN.md` updated: path references in open backlog items reflect new locations.
5872

5973
## Entities / Contracts
6074

61-
No type or interface changes. All interfaces in `src/model/interfaces.ts` are unchanged. Barrel namespace keys are unchanged (see above).
75+
No type or interface changes. All interfaces in `src/model/interfaces.ts` are unchanged.
6276

6377
## Constraints
6478

65-
- Pure rename: zero diff to `.ts` file bodies except import path strings.
79+
- Pure rename: zero diff to `.ts` file bodies except import path strings and barrel key names.
6680
- Must land on a branch that descends from `develop` after #207 and #208 are merged.
67-
- `src/index.ts` barrel must remain functional until Phase 2.3.
81+
- `src/index.ts` barrel must remain functional (keys updated, not removed — that is Phase 2.3).
6882

6983
## Open Questions
7084

0 commit comments

Comments
 (0)