fix(FN-000): improve local startup UX
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildDevNodeArgs } from "../../../../scripts/dev-with-memory-lib.mjs";
|
||||
import {
|
||||
buildDevNodeArgs,
|
||||
getPrebuildCommand,
|
||||
parseDevWrapperArgs,
|
||||
resolvePrebuildMode,
|
||||
} from "../../../../scripts/dev-with-memory-lib.mjs";
|
||||
|
||||
describe("buildDevNodeArgs", () => {
|
||||
it("enables source-condition resolution before loading the tsx runtime", () => {
|
||||
@@ -25,3 +30,41 @@ describe("buildDevNodeArgs", () => {
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("dev-with-memory prebuild options", () => {
|
||||
it("strips wrapper-only prebuild and inspector flags before forwarding CLI args", () => {
|
||||
const parsed = parseDevWrapperArgs(
|
||||
["--inspect=9230", "--prebuild=none", "dashboard", "--port", "4050"],
|
||||
{},
|
||||
);
|
||||
|
||||
expect(parsed).toEqual({
|
||||
inspectFlags: ["--inspect=9230"],
|
||||
args: ["dashboard", "--port", "4050"],
|
||||
requestedPrebuild: "none",
|
||||
});
|
||||
});
|
||||
|
||||
it("defaults dashboard startup to client-only prebuild instead of full workspace build", () => {
|
||||
expect(resolvePrebuildMode("auto", ["dashboard", "--port", "4050"])).toBe("client");
|
||||
expect(getPrebuildCommand("client")).toEqual({
|
||||
command: "pnpm",
|
||||
args: ["--filter", "@fusion/dashboard", "build:client"],
|
||||
label: "dashboard client build",
|
||||
});
|
||||
});
|
||||
|
||||
it("skips prebuild by default for non-dashboard CLI commands", () => {
|
||||
expect(resolvePrebuildMode("auto", ["task", "list"])).toBe("none");
|
||||
expect(getPrebuildCommand("none")).toBeNull();
|
||||
});
|
||||
|
||||
it("keeps full workspace prebuild available when requested", () => {
|
||||
expect(resolvePrebuildMode("full", ["dashboard"])).toBe("full");
|
||||
expect(getPrebuildCommand("full")).toEqual({
|
||||
command: "pnpm",
|
||||
args: ["build"],
|
||||
label: "workspace build",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -168,6 +168,8 @@ async function flushFrames() {
|
||||
|
||||
async function focusSettingsDetailPane(stdin: { write: (chunk: string) => void }, lastFrame: () => string | undefined) {
|
||||
stdin.write("\u001b[C");
|
||||
await new Promise((resolve) => setTimeout(resolve, 25));
|
||||
await flushFrames();
|
||||
await waitForFrameContains(lastFrame, "[C/V/X/P/L/U/K/R] remote actions");
|
||||
}
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ function SplashScreen({ loadingStatus, updateStatus }: { loadingStatus: string;
|
||||
<Text color="cyanBright" dimColor>{FUSION_URL}</Text>
|
||||
<Text color="cyanBright" dimColor>{`v${FUSION_VERSION}`}</Text>
|
||||
{updateStatus?.updateAvailable && (
|
||||
<Text color="yellow" dimColor>{`Update available: v${updateStatus.currentVersion} → v${updateStatus.latestVersion}. Run \`npm install -g @runfusion/fusion\`.`}</Text>
|
||||
<Text color="yellow" dimColor>{`Update available: v${updateStatus.currentVersion} → v${updateStatus.latestVersion}. Run \`fn update\` for an installed CLI, or pull this source checkout.`}</Text>
|
||||
)}
|
||||
<Box height={1} />
|
||||
<Box flexDirection="row" gap={1}>
|
||||
|
||||
@@ -147,7 +147,7 @@ function formatUpdateMessage(updateStatus: StartupUpdateStatus | null): string |
|
||||
return null;
|
||||
}
|
||||
|
||||
return `⬆ Update available: v${updateStatus.latestVersion} (current: v${updateStatus.currentVersion})`;
|
||||
return `⬆ Update available: v${updateStatus.latestVersion} (current: v${updateStatus.currentVersion}). Run \`fn update\` for an installed CLI, or pull the source checkout.`;
|
||||
}
|
||||
|
||||
export class StreamedLogBuffer {
|
||||
|
||||
Reference in New Issue
Block a user