flowfig 0.5.0 → 0.7.0

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/dist/verify.js CHANGED
@@ -1,10 +1,8 @@
1
- // `flowfig verify`: checks that the code a link names is still there. The link parsing lives in source.ts, which has no Node import.
2
1
  import { readFileSync, statSync } from 'node:fs';
3
- import { isAbsolute, relative, resolve } from 'node:path';
2
+ import { isAbsolute, relative, resolve, sep } from 'node:path';
4
3
  import { headingSlug, links } from './source.js';
5
4
  export { parseSource, headingSlug, owners, links } from './source.js';
6
5
  const escape = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
7
- /** The file text, or null for a missing path, a folder or an unreadable file. */
8
6
  function read(full) {
9
7
  try {
10
8
  return statSync(full).isFile() ? readFileSync(full, 'utf8') : null;
@@ -13,12 +11,11 @@ function read(full) {
13
11
  return null;
14
12
  }
15
13
  }
16
- /** True if a heading line of the Markdown text has this slug. */
17
14
  const hasHeading = (text, slug) => text.split('\n').some((line) => {
18
15
  const m = /^#{1,6}\s+(.*?)\s*#*\s*$/.exec(line);
19
16
  return m != null && headingSlug(m[1]) === slug;
20
17
  });
21
- /** The links against the files under `root`. A path outside the root is a missing file: the figure names the repo, not the disk. */
18
+ /** The links against the files under `root`. A path outside `root` counts as a missing file. */
22
19
  export function verify(fig, { root = process.cwd() } = {}) {
23
20
  const out = [];
24
21
  const all = links(fig);
@@ -28,7 +25,7 @@ export function verify(fig, { root = process.cwd() } = {}) {
28
25
  for (const l of all) {
29
26
  const full = resolve(root, l.path);
30
27
  const rel = relative(root, full);
31
- const outside = isAbsolute(l.path) || rel === '..' || rel.startsWith('../');
28
+ const outside = isAbsolute(l.path) || rel === '..' || rel.startsWith(`..${sep}`) || isAbsolute(rel);
32
29
  if (!files.has(full))
33
30
  files.set(full, outside ? null : read(full));
34
31
  const text = files.get(full);
package/dist/version.d.ts CHANGED
@@ -1,2 +1 @@
1
- /** The package version, for the MCP `serverInfo`. The release list bumps it with package.json. */
2
- export declare const VERSION = "0.5.0";
1
+ export declare const VERSION = "0.7.0";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- /** The package version, for the MCP `serverInfo`. The release list bumps it with package.json. */
2
- export const VERSION = '0.5.0';
1
+ // The release list bumps this with package.json.
2
+ export const VERSION = '0.7.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowfig",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Your coding agent draws animated diagrams from your code, and flowfig checks them. One animated SVG for a GitHub README, PR or issue, and a React player. Set up Claude Code, Cursor, GitHub Copilot, Codex, Gemini CLI, Windsurf and Kiro with npx flowfig init.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -58,7 +58,8 @@
58
58
  "format:check": "prettier --check .",
59
59
  "svg": "node scripts/figure-svg.mjs",
60
60
  "test": "npm run build && node --test src/*.test.ts",
61
- "typecheck": "tsc --noEmit"
61
+ "typecheck": "tsc --noEmit",
62
+ "lint": "oxlint src scripts"
62
63
  },
63
64
  "peerDependencies": {
64
65
  "react": ">=18"
@@ -71,6 +72,7 @@
71
72
  "@types/react": "^19.0.0",
72
73
  "@types/react-dom": "^19.0.0",
73
74
  "@vitejs/plugin-react": "^6.1.1",
75
+ "oxlint": "1.86.0",
74
76
  "playwright": "^1.50.0",
75
77
  "prettier": "^3.7.4",
76
78
  "react": "^19.0.0",