@@ -17,7 +17,7 @@ import type {
1717} from "../../logging/diagnostic-stability.js" ;
1818import type { WriteDiagnosticSupportExportResult } from "../../logging/diagnostic-support-export.js" ;
1919import { defaultRuntime } from "../../runtime.js" ;
20- import { createLazyImportLoader } from "../../shared/lazy-promise.js" ;
20+ import { createLazyPromise } from "../../shared/lazy-promise.js" ;
2121import { inheritOptionFromParent } from "../command-options.js" ;
2222import { addGatewayServiceCommands } from "../daemon-cli/register-service-commands.js" ;
2323import { formatCliJsonFailure , rethrowExpectedCliError } from "../failure-output.js" ;
@@ -38,28 +38,26 @@ import { runGatewayResume, runGatewaySuspend } from "./suspend-cli.js";
3838
3939type GatewayRpcOpts = Parameters < typeof callGatewayFromCliWithTransport > [ 1 ] ;
4040
41- const configModuleLoader = createLazyImportLoader (
41+ const loadConfigModule = createLazyPromise (
4242 ( ) => import ( "../../config/read-best-effort-config.runtime.js" ) ,
4343) ;
44- const gatewayStatusModuleLoader = createLazyImportLoader (
45- ( ) => import ( "../../commands/gateway-status.js" ) ,
46- ) ;
47- const gatewayHealthModuleLoader = createLazyImportLoader ( ( ) => import ( "../../commands/health.js" ) ) ;
48- const bonjourDiscoveryModuleLoader = createLazyImportLoader (
44+ const loadGatewayStatusModule = createLazyPromise ( ( ) => import ( "../../commands/gateway-status.js" ) ) ;
45+ const loadGatewayHealthModule = createLazyPromise ( ( ) => import ( "../../commands/health.js" ) ) ;
46+ const loadBonjourDiscoveryModule = createLazyPromise (
4947 ( ) => import ( "../../infra/bonjour-discovery.js" ) ,
5048) ;
51- const wideAreaDnsModuleLoader = createLazyImportLoader ( ( ) => import ( "../../infra/widearea-dns.js" ) ) ;
52- const healthStyleModuleLoader = createLazyImportLoader (
49+ const loadWideAreaDnsModule = createLazyPromise ( ( ) => import ( "../../infra/widearea-dns.js" ) ) ;
50+ const loadHealthStyleModule = createLazyPromise (
5351 ( ) => import ( "../../../packages/terminal-core/src/health-style.js" ) ,
5452) ;
55- const usageFormatModuleLoader = createLazyImportLoader ( ( ) => import ( "../../utils/usage-format.js" ) ) ;
56- const stabilityBundleModuleLoader = createLazyImportLoader (
53+ const loadUsageFormatModule = createLazyPromise ( ( ) => import ( "../../utils/usage-format.js" ) ) ;
54+ const loadStabilityBundleModule = createLazyPromise (
5755 ( ) => import ( "../../logging/diagnostic-stability-bundle.js" ) ,
5856) ;
59- const supportExportModuleLoader = createLazyImportLoader (
57+ const loadSupportExportModule = createLazyPromise (
6058 ( ) => import ( "../../logging/diagnostic-support-export.js" ) ,
6159) ;
62- const daemonStatusGatherModuleLoader = createLazyImportLoader (
60+ const loadDaemonStatusGatherModule = createLazyPromise (
6361 ( ) => import ( "../daemon-cli/status.gather.js" ) ,
6462) ;
6563
@@ -70,46 +68,6 @@ type GatewayCliDependencies = {
7068 loadHealthStyleModule ?: typeof loadHealthStyleModule ;
7169} ;
7270
73- function loadConfigModule ( ) {
74- return configModuleLoader . load ( ) ;
75- }
76-
77- function loadGatewayStatusModule ( ) {
78- return gatewayStatusModuleLoader . load ( ) ;
79- }
80-
81- function loadGatewayHealthModule ( ) {
82- return gatewayHealthModuleLoader . load ( ) ;
83- }
84-
85- function loadBonjourDiscoveryModule ( ) {
86- return bonjourDiscoveryModuleLoader . load ( ) ;
87- }
88-
89- function loadWideAreaDnsModule ( ) {
90- return wideAreaDnsModuleLoader . load ( ) ;
91- }
92-
93- function loadHealthStyleModule ( ) {
94- return healthStyleModuleLoader . load ( ) ;
95- }
96-
97- function loadUsageFormatModule ( ) {
98- return usageFormatModuleLoader . load ( ) ;
99- }
100-
101- function loadStabilityBundleModule ( ) {
102- return stabilityBundleModuleLoader . load ( ) ;
103- }
104-
105- function loadSupportExportModule ( ) {
106- return supportExportModuleLoader . load ( ) ;
107- }
108-
109- function loadDaemonStatusGatherModule ( ) {
110- return daemonStatusGatherModuleLoader . load ( ) ;
111- }
112-
11371function gatewayCallOpts ( cmd : Command , defaultTimeoutMs = DEFAULT_GATEWAY_RPC_TIMEOUT_MS ) : Command {
11472 return addGatewayClientOptions ( cmd , { timeoutMs : defaultTimeoutMs } ) . option (
11573 "--json" ,
0 commit comments