refactor: clean up design debt — deprecated APIs, arg validation, dead plugin code#1065
Merged
refactor: clean up design debt — deprecated APIs, arg validation, dead plugin code#1065
Conversation
…on, dead plugin wrappers
Three improvements from the design debt audit:
1. Remove deprecated `tabId` field and `getActiveTabId()` method
- Delete `tabId` from DaemonCommand (daemon-client.ts) and Command (protocol.ts)
- Delete `getActiveTabId()` from IPage interface (types.ts) and Page class (page.ts)
- Update extension resolveCommandTabId() to remove legacy fallback
- Update handleTabs select case to remove tabId check
- The tab→page migration is now complete
2. Unify argument validation into single code path
- Remove `normalizeArgValue()` from commanderAdapter.ts
- Commander adapter now passes raw values to prepareCommandArgs()
- All coercion (bool, int, number) and validation (required, choices)
happens once in coerceAndValidateArgs() in execution.ts
- Eliminates duplicated boolean normalization
3. Remove dead plugin filesystem wrappers
- Delete `promoteDir()` — never called in production code
- Delete `replaceDir()` — thin wrapper over beginReplaceDir, never called
- Remove corresponding test-only exports and tests
- Rename PromoteDirFsOps → ReplaceDirFsOps to match remaining usage
- Transaction infrastructure (runTransaction, beginReplaceDir,
beginReplaceSymlink) retained — used by publishStandalonePlugin
and publishMonorepoPlugins for atomic multi-step operations
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.
Summary
Addresses 3 items from the design debt audit:
1. Remove deprecated
tabIdfield andgetActiveTabId()methodpage(targetId).DaemonCommand,Command(protocol),IPage,PageresolveCommandTabId()to remove legacycmd.tabIdfallback2. Unify argument validation into single code path
normalizeArgValue()fromcommanderAdapter.ts— it duplicated boolean coercion thatcoerceAndValidateArgs()inexecution.tsalready handlesprepareCommandArgs(), which is the single validation entry point3. Remove dead plugin filesystem wrappers
promoteDir()— never called in production, only test-exportedreplaceDir()— thin wrapper overbeginReplaceDir().finalize(), only test-exportedrunTransaction,beginReplaceDir,beginReplaceSymlink) retained — legitimately used bypublishStandalonePluginandpublishMonorepoPluginsNet: 9 files changed, 10 insertions, 126 deletions
Test plan
npx tsc --noEmit)