Repository navigation
fix: hoist fs/path requires to top-level imports in chat-webview-provider - #729
Conversation
No changeset foundThis PR does not add a changeset, so it will not appear in the changelog or trigger a release. If the change is user-facing, add one: pnpm changesetPick a bump (patch / minor / major) and write the changelog entry in our usual voice ("Added X... Thanks to @you. Closes #123."), then commit the generated If this PR is docs-only or a chore that needs no release note, you can ignore this - or run |
A-S-Manoj
left a comment
There was a problem hiding this comment.
Verified against main, _getHtmlForWebview in chat-webview-provider.ts was the only spot in the repo with inline require('fs')/require('path') calls, and this PR hoists both to top-level imports correctly with no remaining inline requires anywhere else in the codebase. Scope matches #724 exactly, no unrelated changes. LGTM, approving.
|
Thanks for this PR @DeepamJha - feel free to add yourself as a contributor to our website via a PR which I will approve :) https://nanocollective.org/contributors |
Closes #724
Description
Hoists
require('fs')andrequire('path')out of_getHtmlForWebviewin
plugins/vscode/src/chat-webview-provider.tsinto top-level ES moduleimports, matching the existing import style in the file. No runtime
behavior change — purely a maintainability cleanup as described in #724.
Note: on current
main, this file doesn't have separaterequestPathInfo/requestOpenDialoghandlers as mentioned in the issue —_getHtmlForWebviewis the only place with the duplicated inlinerequire()calls, so that's the single location fixed here.Type of Change
Changeset
pnpm changeset) describing this change for the changelogThis is an internal chore (no user-facing behavior change), so I ran
pnpm changeset --emptyinstead of a real changeset.Testing
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)(No new tests added — this is a non-functional refactor of an existing
code path with no behavior change, so no new
.spec.tscoverage applies.)Manual Testing
(N/A — change is isolated to webview HTML loading, unrelated to provider/model integration.)
Checklist
(No logging changes needed — this touches only import statements, not runtime logic.)