fix(ui): avoid cache-dependent command startup (#130927)

This commit is contained in:
Peter Steinberger
2026-08-27 07:00:01 -07:00
committed by GitHub
parent 0b652b0091
commit eb1c111fbf
3 changed files with 9 additions and 8 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
#!/usr/bin/env node
import { runTsxCliShim } from "./lib/tsx-cli-shim.mjs";
import { runUiCli } from "./ui.mts";
await runTsxCliShim(import.meta.url, { implementation: "./ui.mts", detached: false });
// Native imports avoid loader startup and leave process lifetime with the UI owner.
runUiCli();
+2 -2
View File
@@ -409,7 +409,7 @@ function resolveScriptAction(action: string): "dev" | "build" | "test" | null {
return null;
}
function main(argv: string[] = process.argv.slice(2)): void {
export function runUiCli(argv: string[] = process.argv.slice(2)): void {
const [action, ...rest] = argv;
if (!action) {
usage();
@@ -501,5 +501,5 @@ export function isDirectScriptExecution(
const isDirectExecution = isDirectScriptExecution();
if (isDirectExecution) {
main();
runUiCli();
}
+4 -4
View File
@@ -1,8 +1,8 @@
// Shared build identity normalization for the runtime artifact and Vite config.
// Vite loads this module before source-package aliases exist, so use the canonical source path.
import { asRecord } from "../../packages/normalization-core/src/record-coerce.js";
import { normalizeNullableString } from "../../packages/normalization-core/src/string-coerce.js";
import { truncateUtf16Safe } from "../../packages/normalization-core/src/utf16-slice.js";
// Vite and native Node need explicit source paths before source-package aliases exist.
import { asRecord } from "../../packages/normalization-core/src/record-coerce.ts";
import { normalizeNullableString } from "../../packages/normalization-core/src/string-coerce.ts";
import { truncateUtf16Safe } from "../../packages/normalization-core/src/utf16-slice.ts";
import type { ControlUiBuildInfo } from "./build-info-types.ts";
type ControlUiBuildMetadata = Pick<