feat: session-first workspace activity and installable daemon
Workspaces page: - list the newest sessions across workspaces in the activity column; the daemon exposes GET /api/v1/sessions/recent as a disk projection and the browser enriches live rows from the per-workspace session relay - put recent activity first below 1100px and fix the mobile page-header flex-basis gap Smoke: - pin PI2_HOST=127.0.0.1 in both smoke scripts and make the startup-line assertion follow the configured host; the daemon default stays 0.0.0.0 Install: - standalone binary build/install scripts, packaging templates, CI/release hooks, CLI-first install docs and the supporting config/doctor changes
This commit is contained in:
1 parent
fc51c3be37
commit
d2e20d428a
50 files changed
+5104
-188
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { dirname, isAbsolute, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import {
|
||||
defaultStaticDir,
|
||||
executablePath,
|
||||
isBundledRuntime,
|
||||
runtimeDescription,
|
||||
staticDirCandidates,
|
||||
version,
|
||||
} from "../../src/core/install.js";
|
||||
|
||||
describe("install helpers", () => {
|
||||
it("reports version matching package.json when running from a checkout", () => {
|
||||
const pkgPath = fileURLToPath(new URL("../../package.json", import.meta.url));
|
||||
const pkg = JSON.parse(readFileSync(pkgPath, "utf8")) as { version: string };
|
||||
expect(version()).toBe(pkg.version);
|
||||
});
|
||||
|
||||
it("returns three absolute candidates with share/pi2d/web/dist first", () => {
|
||||
const candidates = staticDirCandidates();
|
||||
expect(candidates).toHaveLength(3);
|
||||
for (const candidate of candidates) {
|
||||
expect(isAbsolute(candidate)).toBe(true);
|
||||
}
|
||||
const exeDir = dirname(executablePath());
|
||||
const expectedFirst = resolve(exeDir, "..", "share", "pi2d", "web", "dist");
|
||||
expect(candidates[0]).toBe(expectedFirst);
|
||||
});
|
||||
|
||||
it("resolves defaultStaticDir without throwing and returns dev checkout web/dist", () => {
|
||||
expect(() => defaultStaticDir()).not.toThrow();
|
||||
const dir = defaultStaticDir();
|
||||
expect(isAbsolute(dir)).toBe(true);
|
||||
const expectedDevPath = resolve(fileURLToPath(new URL("../../web/dist", import.meta.url)));
|
||||
expect(dir).toBe(expectedDevPath);
|
||||
});
|
||||
|
||||
it("reports isBundledRuntime as false under vitest", () => {
|
||||
expect(isBundledRuntime()).toBe(false);
|
||||
});
|
||||
|
||||
it("reports runtimeDescription starting with 'node '", () => {
|
||||
expect(runtimeDescription().startsWith("node ")).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user