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:
Peter Steinberger
2026-05-30 11:07:45 +02:00
committed by GitHub
parent 7b699fddac
commit de1dfab03e
351 changed files with 1158 additions and 457 deletions

View File

@@ -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";

View File

@@ -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) {

View File

@@ -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,

View File

@@ -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";

View File

@@ -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,

View File

@@ -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 {

View File

@@ -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" },

View File

@@ -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";