diff --git a/src/examples.mjs b/src/examples.mjs index d6b1548..9969a31 100644 --- a/src/examples.mjs +++ b/src/examples.mjs @@ -1,5 +1,5 @@ // Curated interactive examples: real inputs and terminal output captured from -// actual `flashtrace` runs (v0.7.0). No in-browser execution - the CLI needs +// actual `flashtrace` runs (v0.12.0). No in-browser execution - the CLI needs // node:fs and git, so v1 ships pre-computed, trustworthy captures. import { esc } from './layout.mjs'; @@ -27,9 +27,12 @@ export function colorizeReport(text) { s = s.replace(/^( )(needs|covers|wanted by)( )/gm, '$1$2$3'); s = s.replace(/^Summary$/m, 'Summary'); s = s.replace(/^( items +\d+ )(\(.*\))$/m, '$1$2'); - s = s.replace(/^( ok +)(\d+)$/m, '$1$2'); + s = s.replace( + /^( ok +)(\d+)( \(.*\))?$/m, + (m, pre, n, breakdown) => + `${pre}${n}${breakdown ? `${breakdown}` : ''}`, + ); s = s.replace(/^( defective +)([1-9]\d*)$/m, '$1$2'); - s = s.replace(/^( )(of the ok items.*)$/m, '$1$2'); s = s.replace(/^ok$/m, 'ok'); s = s.replace(/^not ok$/m, 'not ok'); return s; @@ -38,7 +41,7 @@ export function colorizeReport(text) { export const heroTerminal = { command: 'npx flashtrace', output: `Summary - items 2 (1 from markdown, 1 from code) + items 2 (1 from specs, 1 from code) ok 2 defective 0 @@ -50,7 +53,7 @@ export const examples = [ id: 'clean', title: 'A clean, deep-covered trace', blurb: - 'A requirement needs an implementation at any 2.x revision; the wildcard resolves to impl:login#2.4 and the whole chain is deep-covered.', + 'A requirement accepts anything within revision 2 - the 2.x wildcard resolves to impl:login#2.4 and the whole chain is deep-covered.', command: 'flashtrace -v', files: [ { @@ -78,7 +81,7 @@ export function login(token: SessionToken) { needs impl:login#2.x (→ impl:login#2.4) ✔ login.ts:1 Summary - items 2 (1 from markdown, 1 from code) + items 2 (1 from specs, 1 from code) ok 2 defective 0 @@ -119,7 +122,7 @@ test('login opens a session', () => { ... });`, • uncovered: needs test:auth/login#2, which does not exist (revision mismatch: existing revision(s) of test:auth/login: 1) Summary - items 3 (1 from markdown, 2 from code) + items 3 (1 from specs, 2 from code) ok 1 defective 2 @@ -165,7 +168,7 @@ export function openSession(token: SessionToken) { ... }`, needs impl:auth#1 ✔ auth.ts:1 Summary - items 3 (2 from markdown, 1 from code) + items 3 (2 from specs, 1 from code) ok 3 defective 0 diff --git a/src/landing.mjs b/src/landing.mjs index 358dc4d..302f289 100644 --- a/src/landing.mjs +++ b/src/landing.mjs @@ -83,7 +83,7 @@ export function login(token) { snippet: `$ npx flashtrace Summary - items 3 (1 from markdown, 2 from code) + items 3 (1 from specs, 2 from code) ok 3 defective 0 @@ -124,11 +124,12 @@ const highlightSnippet = (text) => highlightTokens(esc(text)); const features = [ ['Zero runtime dependencies', 'One self-contained script. Vendor it or install it - nothing else comes along.', null], ['Runs anywhere', 'Everything Node.js ≥ 18 runs on: your laptop, your CI, your air-gapped build box.', null], - ['Many languages', 'Tags live in ordinary comments - C-family, Python, Ruby, shell, SQL, Lua, HTML, Vue and more.', '/docs/code-tags/'], + ['Many languages (40+)', 'A tag is just a comment, so one syntax spans them all: C-family, hash (Python, shell, ..), SQL, Lua, HTML, ...', '/docs/code-tags/'], ['Deep, transitive coverage', 'An item is only deep-covered when its whole tracing chain is. Broken links show up wherever they hide.', '/docs/coverage-rules/'], - ['Wildcards & forwarding', 'Accept any 2.x revision, or delegate a requirement’s obligation to another item with a forwarding tag.', '/docs/forwarding/'], + ['SemVer revisions & wildcards', 'Revisions match as SemVer versions - 2.4 equals 2.4.0 - and a 2.x wildcard accepts anything within revision 2.', '/docs/revisions/'], + ['Forwarding', 'Delegate a requirement’s obligation to another item with a forwarding tag - coverage follows the chain.', '/docs/forwarding/'], ['Git-aware scanning', 'Files ignored by git are excluded automatically - no config to keep in sync.', '/docs/usage/'], - ['CI-friendly', 'Plain-text report, meaningful exit codes: 0 clean, 1 defects found, 2 usage error.', '/docs/command-line/'], + ['Rich, CI-friendly reports', 'A readable text report or deterministic, schema-backed JSON on stdout - and meaningful exit codes: 0 clean, 1 defects found, 2 usage error.', '/docs/json-report/'], ]; function featureGrid() {