repositories / dotfiles

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

Modified
16 16 Every output line same visual width.
18 18 SCRIPT:
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.
22 22 CLI:
23 23 ```bash
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
29 29 IMPORT:

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) {
5 + return {
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); },
13 + };
2 15 import { createTable, drawBox, drawNested } from "./index.ts";
4 17 describe("drawBox", () => {

pi/agent/skills/ascii-boxes/node-smoke.test.mjs

Added
new 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"), /┌/);
8 +});
10 +test("cli runs under node", () => {
11 + const out = execFileSync(process.execPath, ["index.ts", "draw", "node"], { encoding: "utf8" });
12 + assert.match(out, /│ node │/);
13 +});

pi/agent/skills/ascii-boxes/package.json

Modified
4 4 "name": "ascii-boxes-skill",
5 5 "version": "0.1.0",
6 6 "private": true,
7 7 "type": "module",
8 - "main": "index.ts"
8 + "main": "index.ts",
9 + "scripts": {
10 + "test": "node --test index.test.ts node-smoke.test.mjs"
11 + }