@ryan_nookpi/pi-skill-excalidraw 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryan_nookpi/pi-skill-excalidraw",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Pi skill that writes .excalidraw diagrams and opens them in a live-synced local Excalidraw window.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -21,8 +21,9 @@
21
21
  ],
22
22
  "files": [
23
23
  "skills/excalidraw/SKILL.md",
24
- "skills/excalidraw/scripts/",
25
- "!skills/excalidraw/scripts/*.test.mjs",
24
+ "skills/excalidraw/scripts/excal.mjs",
25
+ "skills/excalidraw/scripts/lib.mjs",
26
+ "skills/excalidraw/scripts/server.mjs",
26
27
  "skills/excalidraw/references/",
27
28
  "skills/excalidraw/assets/",
28
29
  "skills/excalidraw/app/dist/",
@@ -1,64 +0,0 @@
1
- // Browser-free regression tests for excal.mjs. Commands that need the sync server
2
- // (open with a window, snapshot) are covered by the manual smoke in references/setup.md.
3
- import assert from "node:assert/strict";
4
- import { spawnSync } from "node:child_process";
5
- import fs from "node:fs";
6
- import os from "node:os";
7
- import path from "node:path";
8
- import test from "node:test";
9
- import { fileURLToPath } from "node:url";
10
-
11
- const SCRIPTS_DIR = path.dirname(fileURLToPath(import.meta.url));
12
- const CLI = path.join(SCRIPTS_DIR, "excal.mjs");
13
- const EXAMPLE = path.join(SCRIPTS_DIR, "..", "assets", "examples", "flowchart.excalidraw");
14
-
15
- const run = (args, cwd) =>
16
- spawnSync(process.execPath, [CLI, ...args], { cwd, encoding: "utf8", env: { ...process.env } });
17
-
18
- const withTempDir = (fn) => {
19
- const dir = fs.mkdtempSync(path.join(os.tmpdir(), "excal-test-"));
20
- try {
21
- return fn(dir);
22
- } finally {
23
- fs.rmSync(dir, { recursive: true, force: true });
24
- }
25
- };
26
-
27
- test("bundled example passes the bundled linter", () => {
28
- const r = run(["lint", EXAMPLE]);
29
- assert.equal(r.status, 0, r.stdout + r.stderr);
30
- assert.match(r.stdout, /^OK$/m);
31
- });
32
-
33
- test("open --from-mermaid with a missing file fails without creating the diagram", () => {
34
- withTempDir((dir) => {
35
- const target = path.join(dir, "out.excalidraw");
36
- const r = run(["open", target, "--from-mermaid", path.join(dir, "nope.mmd")], dir);
37
- assert.equal(r.status, 1);
38
- assert.match(r.stderr, /mermaid 파일이 없습니다/);
39
- assert.doesNotMatch(r.stderr, /at .*excal\.mjs/);
40
- assert.equal(fs.existsSync(target), false);
41
- });
42
- });
43
-
44
- test("inspect bounds cover text elements the window has not measured yet", () => {
45
- withTempDir((dir) => {
46
- const file = path.join(dir, "scene.excalidraw");
47
- fs.writeFileSync(
48
- file,
49
- JSON.stringify({
50
- type: "excalidraw",
51
- version: 2,
52
- elements: [
53
- { type: "text", id: "title", x: 100, y: 20, text: "제목", fontSize: 28 },
54
- { type: "rectangle", id: "box", x: 400, y: 200, width: 200, height: 72 },
55
- ],
56
- appState: {},
57
- files: {},
58
- }),
59
- );
60
- const r = run(["inspect", file], dir);
61
- assert.equal(r.status, 0, r.stdout + r.stderr);
62
- assert.match(r.stdout, /범위 x 100~600, y 20~272/);
63
- });
64
- });