Skip to content

[Story] Reorganize the extension's src/ into a feature-first directory tree #55

Done

Description

@aMonteSl

As a developer adding or looking for a feature,
I want apps/vscode-extension/src/ organized into nested subdirectories by feature and logical area, with one obvious home for each piece of functionality,
so that it is clear where everything lives, how the parts connect, and the code base can grow without new files landing in arbitrary places.

Context

Requested by the maintainer on 2026-11-25 as an extension of epic #26. Today src/ mixes several organizing schemes: some folders are by feature (code_analysis/, servers/), some by technical layer (views/, commands/, utils/), and some features are split across both (for example src/active_servers/views/ and src/views/active_servers/). Folder names mix snake_case and camelCase.

Scope

  1. Analysis first (docs/cleanup/src-layout.md):

    • the current tree with file counts per folder;
    • the problems: duplicated homes, mixed naming, cross-feature reach-ins, folders with a single file;
    • the target tree;
    • a complete old-path → new-path move map;
    • the move order.

    The target must be consistent with the layering of [Story] Clean the module layering in preparation for the IDE (no host abstraction yet) #42 and leave a clean cut for the later packages/core extraction ([Story] Extract a host-agnostic Code-XR core from the VS Code extension #13). It must not introduce that abstraction itself.

  2. The move: one commit per feature area, using git mv so history follows the files.

    • Same commit as each move: update every import, the webpack entry and copy config, test text pins (readFileSync of src/ paths, retargeted with the move map), the guardrail baseline, the feature baseline, and docs (ARCHITECTURE.md module map, CLAUDE.md, skills).
    • Folder naming: one convention, recorded in the doc.
  3. Guard: a test that pins the top-level layout and the folder-naming convention, so new code follows it.

Acceptance criteria

Activity

  1. added
    tfm
    user-story
    on Nov 25, 2026
  2. self-assigned this
    on Nov 25, 2026
  3. added 2 commits that reference this issue on Nov 25, 2026
  4. aMonteSl commented on Nov 25, 2026

    @aMonteSl
    CollaboratorAuthor

    The maintainer approved the target tree in docs/cleanup/src-layout.md (#59, merged) on 2026-11-25:

    • the layers app/ → features/ → core/ → platform/ → shared/;
    • kebab-case for all folder names.

    The move starts once #35 and #42 have merged.


    Generated by Claude Code

  5. aMonteSl commented on Nov 25, 2026

    @aMonteSl
    CollaboratorAuthor

    Done. src/ is reorganized feature-first and merged into v1.2.1 via #65, with CI green on Linux, Windows and macOS.

    Layout: extension.ts + app/ → features/ → core/ → platform/ → shared/. Every folder is kebab-case, and the 46 re-export barrels are dissolved.

    Shape:

    Before After
    Files 337 291
    Folders 172 99
    snake_case or camelCase folders 58 0
    Single-file folders 70 9
    index.ts files 48 0
    Two-way folder pairs 5 4 (reasons recorded in folderDependencies.json)

    How it was proved for every batch:

    • compiled-module equivalence: 291 of 291 modules;
    • the same webpack module count;
    • the feature baseline unchanged;
    • all gates green;
    • the Python, analysis and XR-harness suites on the batches that needed them.

    The VSIX holds the same 199 files.

    Kept in place: test/tooling/srcLayout.test.cjs guards the layout, the move map is in docs/cleanup/src-move-map.json, and the result is §7 of docs/cleanup/src-layout.md.

    Still to do: the F5 smoke (open the sidebar, run one XR analysis, start and stop a server). It runs in #43.


    Generated by Claude Code

  6. added
    area: extension
    stream: cleanup-refactor
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: extensionstream: cleanup-refactortfmuser-story

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions