refactor: remove dead re-exports from cli.ts and unexport ExecaMockResult#2992
Conversation
…sult - Remove all 38 dead barrel re-exports from src/cli.ts that were added during the cli.ts split but never consumed via the cli module (all consumers import directly from the source modules) - Remove deprecated DEFAULT_DNS_SERVERS re-export (all consumers import from dns-resolver.ts directly) - Remove export keyword from ExecaMockResult interface in host-iptables-test-setup.ts (never imported outside its file) - Update cli.test.ts to import copilot API functions from copilot-api-resolver.ts instead of the cli barrel Closes #2991 Closes #2990 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 87.89% | 87.81% | 📉 -0.08% |
| Statements | 87.85% | 87.77% | 📉 -0.08% |
| Functions | 83.51% | 92.12% | 📈 +8.61% |
| Branches | 79.79% | 79.84% | 📈 +0.05% |
📁 Per-file Coverage Changes (2 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/cli.ts |
98.3% → 85.7% (-12.59%) | 98.3% → 85.7% (-12.62%) |
src/container-lifecycle.ts |
87.3% → 88.4% (+1.09%) | 87.7% → 88.7% (+1.06%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
|
Smoke Test Results: Overall: PASS (3/4 tests succeeded)
|
🔬 Smoke Test Results
Overall: FAIL
|
Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Overall: PARTIAL PASS (BYOK inference confirmed; pre-step data unavailable due to unexpanded template variables)
|
There was a problem hiding this comment.
Pull request overview
This PR reduces the package’s exposed API surface by removing unused barrel re-exports from the CLI entrypoint and tightening a test-helper module’s exported types.
Changes:
- Removed dead re-export “barrel” exports from
src/cli.ts. - Updated
src/cli.test.tsto import Copilot API resolver helpers directly fromcopilot-api-resolver. - Made
ExecaMockResultnon-exported insrc/test-helpers/host-iptables-test-setup.ts.
Show a summary per file
| File | Description |
|---|---|
src/cli.ts |
Removes unused re-exports so cli.ts is only the runtime CLI entrypoint. |
src/cli.test.ts |
Adjusts imports to no longer rely on cli.ts as a barrel. |
src/test-helpers/host-iptables-test-setup.ts |
Stops exporting an unused interface, but currently introduces a declaration-emit build issue. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 1
| type MockedExecaFn = (file: string, args?: readonly string[], options?: unknown) => Promise<ExecaMockResult>; | ||
|
|
||
| export interface ExecaMockResult { | ||
| interface ExecaMockResult { | ||
| command: string; | ||
| escapedCommand: string; | ||
| exitCode: number; |
Smoke Codex: FAILMerged PRs: ✅ refactor: fix test import path inconsistency for docker-manager; refactor: split token-tracker test file for maintainability Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Chroot Smoke Test Results
Result: Some versions differ between host and chroot environments. Go matches, but Python and Node.js have version mismatches (host is newer).
|
Smoke Test: GitHub Actions Services Connectivity
Overall: FAIL —
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Summary
Remove dead barrel re-exports from
src/cli.tsand unexport the unusedExecaMockResultinterface.Changes
src/cli.ts— Removed all 38 dead barrel re-exports added during the cli.ts split refactor. Every consumer already imports directly from the source modules (domain-utils,api-proxy-config,option-parsers,dns-resolver,copilot-api-resolver), so these re-exports only widened the public API surface without providing value.src/cli.test.ts— Updated imports: copilot API functions now imported fromcopilot-api-resolverdirectly instead of the cli barrel.src/test-helpers/host-iptables-test-setup.ts— RemovedexportfromExecaMockResultinterface. The type is only used internally byexecaResult()andMockedExecaFnwithin the same file — no external consumer imports it.Verification
npx tsc --noEmit— passesnpx jest cli.test.ts host-iptables— all 72 tests passCloses #2991
Closes #2990