dotfiles
bugabingas dorkfiles
owned by bugabinga
fix(ascii-boxes): use node runner
a08d3053ba0bb2f7ef30ab24488deb4a31d09db3
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (4)
pi/agent/skills/ascii-boxes/SKILL.md
Modified16 16 Every output line same visual width.
19 -`index.ts` in this skill directory.
19 +`index.ts` in this skill directory. Run it with Node.
20 20 When running from another cwd, resolve it relative to this `SKILL.md` file.
24 -deno run -A ./index.ts draw
"text" --width N --style single
|double
|bold --align left
|center
|right
25 -deno run -A ./index.ts table --header
"H1,H2" --rows
"a,b" "c,d" 26 -deno run -A ./index.ts nested
"OUTER" "INNER" --gap N
24 +node ./index.ts draw
"text" --width N --style single
|double
|bold --align left
|center
|right
25 +node ./index.ts table --header
"H1,H2" --rows
"a,b" "c,d" 26 +node ./index.ts nested
"OUTER" "INNER" --gap N
pi/agent/skills/ascii-boxes/index.test.ts
Modified 1 -import { describe, expect, test }
from "vitest";
1 +import assert
from "node:assert/strict";
2 +import { describe, test }
from "node:test";
4 +function expect(actual) {
6 + toBe(expected) { assert.
equal(actual, expected); },
7 + toContain(expected) { assert.
ok(actual.
includes(expected)); },
8 + not: {
toContain(expected) { assert.
ok(
!actual.
includes(expected)); } },
9 + toBeGreaterThan(expected) { assert.
ok(actual
> expected); },
10 + toBeGreaterThanOrEqual(expected) { assert.
ok(actual
>= expected); },
11 + toBeLessThan(expected) { assert.
ok(actual
< expected); },
12 + toBeLessThanOrEqual(expected) { assert.
ok(actual
<= expected); },
2 15 import { createTable, drawBox, drawNested }
from "./index.ts";
4 17 describe(
"drawBox", ()
=> {
pi/agent/skills/ascii-boxes/node-smoke.test.mjs
Addednew file mode 100644 1 +import assert from "node:assert/strict";
2 +import { execFileSync } from "node:child_process";
3 +import { test } from "node:test";
4 +import { drawBox } from "./index.ts";
6 +test("exports draw boxes under node", () => {
7 + assert.match(drawBox("node"), /┌/);
10 +test("cli runs under node", () => {
11 + const out = execFileSync(process.execPath, ["index.ts", "draw", "node"], { encoding: "utf8" });
12 + assert.match(out, /│ node │/);
pi/agent/skills/ascii-boxes/package.json
Modified4 4 "name":
"ascii-boxes-skill",
10 + "test":
"node --test index.test.ts node-smoke.test.mjs"