diff --git a/README.md b/README.md index 2bdecf1..64dbda4 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,10 @@ Ever opened a new codebase and felt completely lost? **CodeFlow** turns any GitHub repository or local codebase into an interactive architecture map in seconds. -- **No installation required** — runs entirely in your browser -- **No data collection** — your code never leaves your machine -- **No accounts** — just paste a URL or select local files and go -- **Works offline** — analyze local files without internet +- **No installation required** - runs entirely in your browser +- **No data collection** - your code never leaves your machine +- **No accounts** - just paste a URL or select local files and go +- **Works offline** - analyze local files without internet ``` Paste URL / Select Files -> See Architecture -> Make Better Decisions @@ -38,7 +38,7 @@ Paste URL / Select Files -> See Architecture -> Make Better Decisions See how your files connect at a glance. Click any node to highlight its dependencies. Drag, zoom, and explore. ### Blast Radius Analysis -*"If I change this file, what breaks?"* — CodeFlow answers this instantly. Select any file and see exactly how many files would be affected by changes. +*"If I change this file, what breaks?"* - CodeFlow answers this instantly. Select any file and see exactly how many files would be affected by changes. ### Code Ownership Know who owns what. See the top contributors for any file based on git history. Perfect for code reviews and knowing who to ask. @@ -72,7 +72,7 @@ Color files by commit frequency to see which parts of your codebase are most act Paste a PR URL to see exactly which files it affects and calculate the blast radius of proposed changes. ### CodeFlow Card (GitHub Action) -Health grade, scale, fragility, and hidden costs as a self-updating SVG on your README — recomputed every merge, with optional thermal-receipt PR comments. See [card/](./card/). +Health grade, scale, fragility, and hidden costs as a self-updating SVG on your README - recomputed every merge, with optional thermal-receipt PR comments. See [card/](./card/). ### Markdown & Wiki-Link Graph Point CodeFlow at an Obsidian vault or any markdown directory to see notes as a connected graph. Both `[[wiki-links]]` and `[text](./relative.md)` links become edges; each note is a `note`-layer node (distinct color) with a `dependencies[]` array in the JSON export. @@ -93,7 +93,7 @@ Analyze code directly from your computer without uploading to GitHub: A GitHub Action that drops an auto-updating SVG card on your README, recomputed on every merge by the same analyzer as the web app. Five styles, accent presets, opt-in PR receipts, and a privacy mode for public repos. The card adapts to the viewer's light/dark theme automatically.

- CodeFlow card — compact style + CodeFlow card - compact style

See [card/](./card/) for setup, or jump to the [style gallery](#card-style-gallery) below. @@ -350,7 +350,7 @@ node --test tests/ > CodeFlow runs entirely in your browser. It calls the GitHub API directly from your browser and processes everything client-side. **Q: Is my code safe?** -> Yes. Your code is fetched directly from GitHub to your browser. Nothing is sent to any server we control. Check the source — it's one file! +> Yes. Your code is fetched directly from GitHub to your browser. Nothing is sent to any server we control. Check the source - it's one file! **Q: Can I use it offline?** > Yes. With the local file analysis feature, you can analyze code from your computer without any internet connection. Click the "Open Folder" button and select your files. All processing happens entirely in your browser. @@ -367,32 +367,32 @@ node --test tests/ All examples below are real cards rendered by the [CodeFlow Card Action](./card/) against this very repo. Pick one and drop it on your README. -### `style: compact` — default +### `style: compact` - default compact ### `style: compact` with `show-grade: false, show-score: false` -For public READMEs where you'd rather show data than a letter grade. The card stays informational — files, functions, LOC, languages, tests — without the judgmental bits. +For public READMEs where you'd rather show data than a letter grade. The card stays informational - files, functions, LOC, languages, tests - without the judgmental bits. compact private -### `accent` — any preset or CSS color +### `accent` - any preset or CSS color The accent recolors the sparklines, links, and pin. Presets: `purple` (default), `teal`, `cyan`, `green`, `pink`, `blue`, `amber`, `red`. Or pass any CSS color (e.g. `#ff6b6b`). compact teal compact pink -### `style: row` — status-bar strip +### `style: row` - status-bar strip row -### `style: minimal` — single text line +### `style: minimal` - single text line minimal -### `style: hero` — splashy gradient +### `style: hero` - splashy gradient hero @@ -400,7 +400,7 @@ The accent recolors the sparklines, links, and pin. Presets: `purple` (default), hero private -### `style: detailed` — information-rich +### `style: detailed` - information-rich Everything: grade, scale, language breakdown, composition (connections, tests, folders, function stats, patterns), top folders, fragility, hidden costs. @@ -420,7 +420,7 @@ If you find CodeFlow useful, please star the repo. ## License -MIT License — use it however you want. +MIT License - use it however you want. --- diff --git a/card/README.md b/card/README.md index eaf8d43..6be0439 100644 --- a/card/README.md +++ b/card/README.md @@ -1,8 +1,8 @@ # CodeFlow Card -A GitHub Action that drops a slick auto-updating SVG card on your README — health grade, scale, fragility, hidden costs — recomputed every merge by [codeflow](https://github.com/braedonsaunders/codeflow). +A GitHub Action that drops a slick auto-updating SVG card on your README - health grade, scale, fragility, hidden costs - recomputed every merge by [codeflow](https://github.com/braedonsaunders/codeflow). -The card uses the **same analyzer** as the codeflow web app. There's no separate parser, no version drift — the Action reads codeflow's `index.html` and runs its analyzer in a Node `vm`. +The card uses the **same analyzer** as the codeflow web app. There's no separate parser, no version drift - the Action reads codeflow's `index.html` and runs its analyzer in a Node `vm`. ## Quick start @@ -58,10 +58,10 @@ The Action commits the rendered SVG to `.github/codeflow-card.svg` (overwriting ## What's on the card -- **Health** — letter grade (A+ → F) with delta arrow vs the last run, plus the underlying score. -- **Scale** — files / functions / LOC / languages, each with a 30-run sparkline (after the second run). -- **Fragility** — top 3 highest-blast-radius files. The numbers nobody usually shows. -- **Hidden costs** — circular deps, dead code %, average coupling. Lower-is-better arrows. +- **Health** - letter grade (A+ -> F) with delta arrow vs the last run, plus the underlying score. +- **Scale** - files / functions / LOC / languages, each with a 30-run sparkline (after the second run). +- **Fragility** - top 3 highest-blast-radius files. The numbers nobody usually shows. +- **Hidden costs** - circular deps, dead code %, average coupling. Lower-is-better arrows. ## PR receipts (opt-in) @@ -85,7 +85,7 @@ The comment is sticky (updates in place via `` mar ## Notes -- **First run**: with no history yet, sparklines and deltas don't render — the panels degrade gracefully. +- **First run**: with no history yet, sparklines and deltas don't render - the panels degrade gracefully. - **Permissions**: the workflow needs `contents: write` to commit the SVG, and `pull-requests: write` if `receipts: true`. -- **CI cost**: analysis runs in pure Node (no Docker, no external APIs); typical run is 10–30 seconds depending on repo size. +- **CI cost**: analysis runs in pure Node (no Docker, no external APIs); typical run is 10-30 seconds depending on repo size. - **Privacy**: nothing leaves the runner. Same guarantee as the codeflow web app. diff --git a/card/action.yml b/card/action.yml index 105b91d..5e9a5c6 100644 --- a/card/action.yml +++ b/card/action.yml @@ -14,7 +14,7 @@ inputs: required: false default: '.github/codeflow-card.json' theme: - description: 'Card theme: dark | light | auto. `auto` (default) produces a single SVG that adapts to the viewer''s system theme via `prefers-color-scheme` — one card looks native on light and dark READMEs.' + description: 'Card theme: dark | light | auto. `auto` (default) produces a single SVG that adapts to the viewer''s system theme via `prefers-color-scheme` - one card looks native on light and dark READMEs.' required: false default: 'auto' accent: diff --git a/card/index.js b/card/index.js index bc404b7..284af59 100644 --- a/card/index.js +++ b/card/index.js @@ -1,4 +1,4 @@ -// CodeFlow Card — GitHub Action entry point. +// CodeFlow Card - GitHub Action entry point. // Reads codeflow's analyzer out of index.html, runs it on the consuming repo, // renders an SVG card, optionally posts a PR receipt comment, then commits the // updated card + history file back to the repo. @@ -132,7 +132,7 @@ async function run() { log('receipt post failed: ' + (e.message || e)); } } else if (inputs.receipts) { - log('receipts enabled, but not a merged PR — skipping'); + log('receipts enabled, but not a merged PR - skipping'); } // Commit changes back to the repo (skip when running outside a checkout). @@ -151,7 +151,7 @@ async function run() { log('git commit failed: ' + (e.message || e)); } } else { - log('local mode — skipping git commit'); + log('local mode - skipping git commit'); } } diff --git a/card/lib/analyzer.js b/card/lib/analyzer.js index 3f65f00..a7264de 100644 --- a/card/lib/analyzer.js +++ b/card/lib/analyzer.js @@ -1,5 +1,5 @@ // Extract the codeflow analyzer block from index.html and run it in a Node vm -// context. Mirrors what tests/codeflow-golden.test.mjs does — the analyzer is +// context. Mirrors what tests/codeflow-golden.test.mjs does - the analyzer is // the single source of truth, lives in one file, never drifts. 'use strict'; diff --git a/card/lib/state.js b/card/lib/state.js index 1d2be65..a14dde4 100644 --- a/card/lib/state.js +++ b/card/lib/state.js @@ -11,7 +11,7 @@ function readState(statePath) { const parsed = JSON.parse(raw); if (parsed && Array.isArray(parsed.runs)) return parsed; } catch { - // missing or corrupt — start fresh + // missing or corrupt - start fresh } return { version: 1, runs: [] }; } @@ -87,7 +87,7 @@ function snapshotFromAnalysis(data, helpers, ctx) { .slice(0, 5); } - // Function size stats — derive from `code` if `lines` isn't populated. + // Function size stats - derive from `code` if `lines` isn't populated. const fnLines = Array.isArray(data && data.functions) ? data.functions .map((fn) => fn.lines || (fn.code ? fn.code.split('\n').length : 0)) diff --git a/card/render/receipt-md.js b/card/render/receipt-md.js index 42a5f9d..85e24bd 100644 --- a/card/render/receipt-md.js +++ b/card/render/receipt-md.js @@ -12,7 +12,7 @@ function diff(curr, prev) { } function fmtSigned(n) { - if (n == null) return '—'; + if (n == null) return '-'; return (n > 0 ? '+' : '') + n; } @@ -20,7 +20,7 @@ function dirArrow(n, lowerIsBetter) { if (n == null || n === 0) return ''; const better = lowerIsBetter ? n < 0 : n > 0; const sym = n < 0 ? '▼' : '▲'; - return better ? ' :small_blue_diamond: ' + sym : ' :warning: ' + sym; + return ' ' + sym; } function gradeArrow(curr, prev) { diff --git a/card/render/receipt.js b/card/render/receipt.js index d76d2d7..92cc8f8 100644 --- a/card/render/receipt.js +++ b/card/render/receipt.js @@ -15,7 +15,7 @@ function diff(curr, prev) { } function fmtSigned(n, opts) { - if (n == null) return '—'; + if (n == null) return '-'; const sign = n > 0 ? '+' : ''; const v = (opts && opts.suffix) ? sign + n + opts.suffix : sign + n; return v; @@ -36,7 +36,7 @@ function row(label, value, color, theme) { function renderReceipt(opts) { // Receipts are PR-comment images that don't go through svgWrap, so they - // can't host a