Skip to content

Commit 3cac341

Browse files
lpcoxCopilot
andauthored
refactor: remove dead exports from preflight, network-setup, domain-acl, and logs barrel (#3051)
- Unexport AllowedDomainsResult interface in preflight.ts (never imported) - Unexport NetworkSetupResult interface in network-setup.ts (never imported) - Unexport DomainsByProtocol, PatternsByProtocol interfaces in domain-acl.ts (only used internally) - Unexport groupDomainsByProtocol, groupPatternsByProtocol functions in domain-acl.ts (only called within the same file) - Trim logs/index.ts barrel to the 3 symbols actually consumed via the barrel (listLogSources, LogFormatter, streamLogs); remove 9 dead re-exports (parseLogLine, extractDomain, discoverLogSources, selectMostRecent, isContainerRunning, validateSource, aggregateLogs, loadAllLogs, loadAndAggregate, AggregatedStats, DomainStats, formatStats) Closes #3044 Closes #3041 Closes #3047 Closes #3048 Closes #3050 Closes #3025 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 46be781 commit 3cac341

4 files changed

Lines changed: 6 additions & 21 deletions

File tree

src/commands/network-setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { UpstreamProxyConfig } from '../types';
77
/**
88
* The resolved network configuration produced by {@link resolveNetworkConfig}.
99
*/
10-
export interface NetworkSetupResult {
10+
interface NetworkSetupResult {
1111
upstreamProxy: UpstreamProxyConfig | undefined;
1212
dnsServers: string[];
1313
dnsOverHttps: string | undefined;

src/commands/preflight.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type OptionSourceResolver = (optionName: string) => string | undefined;
2020
/**
2121
* The result produced by {@link resolveAllowedDomains}.
2222
*/
23-
export interface AllowedDomainsResult {
23+
interface AllowedDomainsResult {
2424
allowedDomains: string[];
2525
localhostResult: ReturnType<typeof processLocalhostKeyword>;
2626
resolvedCopilotApiTarget: string | undefined;

src/logs/index.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,8 @@
22
* Log viewing utilities for Squid proxy logs
33
*/
44

5-
export { parseLogLine, extractDomain } from './log-parser';
65
export { LogFormatter } from './log-formatter';
76
export {
8-
discoverLogSources,
9-
selectMostRecent,
10-
isContainerRunning,
11-
validateSource,
127
listLogSources,
138
} from './log-discovery';
149
export { streamLogs } from './log-streamer';
15-
export {
16-
aggregateLogs,
17-
loadAllLogs,
18-
loadAndAggregate,
19-
AggregatedStats,
20-
DomainStats,
21-
} from './log-aggregator';
22-
export {
23-
formatStats,
24-
} from './stats-formatter';

src/squid/domain-acl.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
/**
1010
* Groups domains by their protocol restriction
1111
*/
12-
export interface DomainsByProtocol {
12+
interface DomainsByProtocol {
1313
http: string[];
1414
https: string[];
1515
both: string[];
@@ -18,7 +18,7 @@ export interface DomainsByProtocol {
1818
/**
1919
* Groups patterns by their protocol restriction
2020
*/
21-
export interface PatternsByProtocol {
21+
interface PatternsByProtocol {
2222
http: DomainPattern[];
2323
https: DomainPattern[];
2424
both: DomainPattern[];
@@ -50,7 +50,7 @@ export function formatDomainForSquid(domain: string): string {
5050
/**
5151
* Group plain domains by protocol
5252
*/
53-
export function groupDomainsByProtocol(domains: PlainDomainEntry[]): DomainsByProtocol {
53+
function groupDomainsByProtocol(domains: PlainDomainEntry[]): DomainsByProtocol {
5454
const result: DomainsByProtocol = { http: [], https: [], both: [] };
5555
for (const entry of domains) {
5656
result[entry.protocol].push(entry.domain);
@@ -61,7 +61,7 @@ export function groupDomainsByProtocol(domains: PlainDomainEntry[]): DomainsByPr
6161
/**
6262
* Group patterns by protocol
6363
*/
64-
export function groupPatternsByProtocol(patterns: DomainPattern[]): PatternsByProtocol {
64+
function groupPatternsByProtocol(patterns: DomainPattern[]): PatternsByProtocol {
6565
const result: PatternsByProtocol = { http: [], https: [], both: [] };
6666
for (const pattern of patterns) {
6767
result[pattern.protocol].push(pattern);

0 commit comments

Comments
 (0)