perf(cli): defer command-specific modules until dispatch

This commit is contained in:
morluto
2026-10-11 13:20:15 +08:00
parent 5f4c7ff6df
commit a82d14e4db
10 changed files with 183 additions and 87 deletions
+1 -17
View File
@@ -29,6 +29,7 @@ import {
supportedClients,
type SetupClient,
} from "./SupportedClients.js";
export { isUninstallFailure } from "./UninstallFailure.js";
interface ManagedPathStats {
readonly uid?: number;
@@ -74,23 +75,6 @@ export interface UninstallResult {
readonly items: readonly UninstallItem[];
}
/** Whether any requested REA-owned uninstall action failed. */
export const isUninstallFailure = (result: UninstallResult): boolean => {
const status = result.status;
switch (status) {
case "complete":
return false;
case "failed":
return true;
default: {
const exhaustive: never = status;
throw new TypeError(
`Unhandled uninstall result status: ${String(exhaustive)}`,
);
}
}
};
/** Filesystem boundary used by the contained uninstall workflow. */
export interface UninstallHost {
clients(): Promise<readonly SetupClient[]>;