mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-08 06:02:54 +00:00
refactor: move terminal core into package (#88279)
* refactor: move terminal core into package * refactor: move terminal module files * fix: clean terminal package CI followups * test: update lint suppression allowlist * fix: ship terminal core runtime aliases
This commit is contained in:
committed by
GitHub
parent
7b699fddac
commit
de1dfab03e
@@ -1,3 +1,4 @@
|
||||
import { theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { isRestartEnabled } from "../../config/commands.flags.js";
|
||||
import { readBestEffortConfig, resolveGatewayPort } from "../../config/config.js";
|
||||
import { resolveGatewayService } from "../../daemon/service.js";
|
||||
@@ -12,7 +13,6 @@ import type { SafeGatewayRestartRequestResult } from "../../infra/restart-coordi
|
||||
import { type GatewayRestartIntent, writeGatewayRestartIntentSync } from "../../infra/restart.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { normalizeOptionalString } from "../../shared/string-coerce.js";
|
||||
import { theme } from "../../terminal/theme.js";
|
||||
import { formatCliCommand } from "../command-format.js";
|
||||
import { parseDurationMs } from "../parse-duration.js";
|
||||
import { recoverInstalledLaunchAgent } from "./launchd-recovery.js";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../../terminal/links.js";
|
||||
import { theme } from "../../terminal/theme.js";
|
||||
import { formatDocsLink } from "../../../packages/terminal-core/src/links.js";
|
||||
import { theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { addGatewayServiceCommands } from "./register-service-commands.js";
|
||||
|
||||
export function registerDaemonCli(program: Command) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { theme } from "../../terminal/theme.js";
|
||||
import { theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import {
|
||||
filterContainerGenericHints,
|
||||
parsePortFromArgs,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { colorize, isRich, theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { resolveIsNixMode } from "../../config/paths.js";
|
||||
import {
|
||||
resolveGatewayLaunchAgentLabel,
|
||||
@@ -11,7 +12,6 @@ import {
|
||||
buildPlatformServiceStartHints,
|
||||
} from "../../daemon/runtime-hints.js";
|
||||
import { parseInlineOptionToken } from "../../infra/inline-option-token.js";
|
||||
import { colorize, isRich, theme } from "../../terminal/theme.js";
|
||||
import { formatCliCommand } from "../command-format.js";
|
||||
import { parsePort } from "../shared/parse-port.js";
|
||||
import { createDaemonActionContext } from "./response.js";
|
||||
|
||||
@@ -16,9 +16,10 @@ vi.mock("../../runtime.js", () => ({
|
||||
defaultRuntime: runtime,
|
||||
}));
|
||||
|
||||
vi.mock("../../terminal/theme.js", async () => {
|
||||
const actual =
|
||||
await vi.importActual<typeof import("../../terminal/theme.js")>("../../terminal/theme.js");
|
||||
vi.mock("../../../packages/terminal-core/src/theme.js", async () => {
|
||||
const actual = await vi.importActual<
|
||||
typeof import("../../../packages/terminal-core/src/theme.js")
|
||||
>("../../../packages/terminal-core/src/theme.js");
|
||||
return {
|
||||
...actual,
|
||||
colorize: (_rich: boolean, _theme: unknown, text: string) => text,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { colorize } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { formatConfigIssueLine } from "../../config/issue-format.js";
|
||||
import {
|
||||
resolveGatewayLaunchAgentLabel,
|
||||
@@ -17,7 +18,6 @@ import { resolveControlUiLinks } from "../../gateway/control-ui-links.js";
|
||||
import { formatGatewayRestartHandoffDiagnostic } from "../../infra/restart-handoff.js";
|
||||
import { isWSLEnv } from "../../infra/wsl.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { colorize } from "../../terminal/theme.js";
|
||||
import { shortenHomePath } from "../../utils.js";
|
||||
import { formatCliCommand } from "../command-format.js";
|
||||
import {
|
||||
|
||||
@@ -25,7 +25,7 @@ vi.mock("../../runtime.js", () => ({
|
||||
defaultRuntime,
|
||||
}));
|
||||
|
||||
vi.mock("../../terminal/theme.js", () => ({
|
||||
vi.mock("../../../packages/terminal-core/src/theme.js", () => ({
|
||||
colorize: (_rich: boolean, _color: unknown, text: string) => text,
|
||||
isRich: () => false,
|
||||
theme: { error: "error" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { colorize, isRich, theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { colorize, isRich, theme } from "../../terminal/theme.js";
|
||||
import { gatherDaemonStatus } from "./status.gather.js";
|
||||
import { printDaemonStatus } from "./status.print.js";
|
||||
import type { DaemonStatusOptions } from "./types.js";
|
||||
|
||||
Reference in New Issue
Block a user