Skip to content

Commit e333b4d

Browse files
refactor(rstack): reuse loaded plugin runtime
1 parent 623c4cb commit e333b4d

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

‎packages/rstack/src/cli/commands.ts‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { join, resolve } from 'node:path';
2-
import { logger } from 'rslog';
3-
import { getConfigState, loadRstackConfig } from '../config.ts';
4-
import { createPluginRuntime } from '../pluginRuntime.ts';
2+
import { getConfigState, getRstackPluginRuntime, loadRstackConfig } from '../config.ts';
53
import { insertConfigArg, parseArgs, parseCliArgs } from './args.ts';
64
import { hasHelpFlag, printCommandHelp } from './help.ts';
75

@@ -249,12 +247,8 @@ export async function setupCommands(): Promise<void> {
249247
return;
250248
}
251249

252-
const { plugins } = await loadRstackConfig();
253-
const runtime = await createPluginRuntime({
254-
plugins,
255-
context: state.invocation,
256-
logger,
257-
});
250+
const loaded = await loadRstackConfig();
251+
const runtime = await getRstackPluginRuntime(loaded);
258252

259253
if (await runtime.runCommand(command, state.invocation.args)) {
260254
return;

0 commit comments

Comments
 (0)