fix(ts): close effect native review blockers

This commit is contained in:
elpresidank 2026-06-06 11:01:17 -05:00
parent b6759e75df
commit a26463afc1
13 changed files with 438 additions and 528 deletions

View file

@ -2,6 +2,25 @@ import { describe, expect, it } from "vitest";
import { guessMimeType } from "../commands/library.js";
describe("library CLI helpers", () => {
it("keeps library load -t assigned to title while token remains long-only", () => {
const result = Bun.spawnSync({
cmd: ["bun", "src/index.ts", "library", "load", "--help"],
cwd: new URL("../../", import.meta.url).pathname,
stdout: "pipe",
stderr: "pipe",
});
const stdout = result.stdout.toString();
const stderr = result.stderr.toString();
expect(result.exitCode).toBe(0);
expect(stderr).toBe("");
expect(stdout).toContain("--title");
expect(stdout).toContain("-t");
expect(stdout).toContain("--token");
expect(stdout).not.toContain("-t, --token");
});
it("detects known MIME types through the Match-backed extension mapper", () => {
expect(guessMimeType("paper.pdf")).toBe("application/pdf");
expect(guessMimeType("notes.TXT")).toBe("text/plain");

View file

@ -30,7 +30,6 @@ export const rootCommand = Command.make("tg").pipe(
Flag.withDefault("cli"),
),
token: Flag.string("token").pipe(
Flag.withAlias("t"),
Flag.withDescription("Authentication token"),
Flag.optional,
),