Repository navigation
refactor: organize extension and webview code by topic - #1134
Merged
Merged
Conversation
EhabY
force-pushed
the
refactor/remove-util-modules
branch
from
October 5, 2026 11:41
d1985b6 to
62f4049
Compare
EhabY
force-pushed
the
refactor/remove-util-modules
branch
2 times, most recently
from
October 5, 2026 12:36
9af3d07 to
5773fb0
Compare
aslilac
approved these changes
Oct 6, 2026
aslilac
left a comment
Member
There was a problem hiding this comment.
huge fan of this kind of reorganization. I think people are often way to hesitant to do it, and I think it still matters in a world of agents for making sure they (and humans) can actually find the code they're looking for. otherwise we get the same helper functions implemented 18 times in different files. :)
EhabY
force-pushed
the
refactor/remove-util-modules
branch
2 times, most recently
from
October 9, 2026 14:42
6cd1b2d to
17b5714
Compare
Replace the util and grab-bag modules with topic-named modules, and write the layout rules down in CODE_STRUCTURE.md. Extension: - Move each util module to the module that takes most of its code (for example `util/fs` to `common/fs`, `api/utils` to `api/httpAgent`, `core/cliUtils` to `cli/cliBinary`). `core/` splits into `cli/`, `storage/` and `vscode/`; `container.ts` moves next to `extension.ts`, and `vscodeProposed.ts` becomes `vscode/proposed.ts`. - Split grab-bag modules by topic: `common/fs`, `common/strings`, `common/url`, `api/models`, `error/abort`, `error/normalize`, `logging/ids`, `oauth/tokens`, and `sessionId` in `telemetry/ids`. - Move single-consumer helpers into their consumer, and drop the unused `LogSources` re-export. Webviews: - Rename `utils` modules after their topic (`shared/error/toError`, `shared/netcheck/severity`, `shared/tasks/status`, `speedtest/chartGeometry`, `speedtest/format`), lift `tasks/src/utils/*` to the package root, and move `useTaskMenuItems` into `tasks/src/hooks/`. Tests move to mirror their source path. CODE_STRUCTURE.md covers the runtime boundary and one-way package dependencies, `@repo/ui` as a standalone library, where new code goes, topic names instead of `utils`/`helpers`, file naming, and test placement. It describes how to decide rather than listing folders, so adding a folder or package needs no doc change.
Root files: - Fold usage.md into the README and move demo.gif into media/. The README links it by relative path, which vsce rewrites to the default branch. - Move esbuild.mjs to scripts/ and the integration test config to test/integration/. - Replace .vscodeignore with a package.json "files" allowlist; vsce ls produces the same file list. - Merge .oxlintrc.react.jsonc into .oxlintrc.jsonc, listing the typescript and oxc plugins the extended file pulled in, so the resolved config is identical. - Remove the Prettier leftovers; Oxfmt formats every file type with its own bundled Prettier. - Keep the ESLint cache in node_modules and trim .gitignore. Dependencies and environment: - Drop devDependencies nothing loads since the Oxlint migration. - Update the Nix flake: pin nixpkgs, use Node 24 and nixpkgs' pnpm, and stop pnpm downloading a prebuilt binary that cannot run on NixOS. - Make the VS Code launch config build before running the extension. Docs: - Restructure AGENTS.md after coder/coder: a short root file that routes to topic guides in docs/ (code structure, architecture, testing, tooling) and packages/AGENTS.md for webviews, kept short since agents load them on every task. CONTRIBUTING.md keeps setup, PR and review guidance, and releasing. - Adopt the coder/coder rules that apply here, plus Testing Library's own testing guidance, and forbid em and en dashes as punctuation. - Match the generated SSH config example to the current output, and drop the requirement to close VS Code before integration tests.
EhabY
force-pushed
the
refactor/remove-util-modules
branch
from
October 10, 2026 15:49
17b5714 to
4f95c79
Compare
This was referenced Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the review on #1133. This removes
src/util.ts,src/util/andsrc/core/, names webview modules by topic, and writes the layout rules down inCODE_STRUCTURE.md, which AGENTS.md now links to. There are no behavior changes.How to review
Go commit by commit. Commits are grouped by area, so each could also land as its own PR:
utilandcore/modules, the panel rename and test moves.utilsmodules, the speedtest formatter split, and tests that mirror their source.CODE_STRUCTURE.md, linked from AGENTS.md and CONTRIBUTING.md.Layout rules
The full list is in
CODE_STRUCTURE.md. The main ones:base/common. Noutilsorhelpersfiles.@repo/shared, which stays free of Node, DOM andvscode.@repo/uidepends on no other workspace package, so it can be split out later (Electron process model, VS Code source organization).Where things went
common/(fs,strings,url),ui/,api/models,cli/,storage/,vscode/, andcontainer.tsnext toextension.ts(the composition root). Single-use helpers moved into the file that uses them.utilsmodules are renamed by topic:shared/{error/toError, netcheck/severity, tasks/status}, plusspeedtest/{chartGeometry, format}.tasks/src/utils/*moves to the package root, anduseTaskMenuItemsmoves intohooks/.webview-sharedtests move totest/webview/webview-shared/.Follow-ups
remote.tscommands.tsTesting
Each commit passes typecheck, lint, format check and unit tests (2780 passed / 6 skipped, the same as
main).pnpm buildpasses.🤖 Generated with Claude Code