svg-terminal 1.2.0 → 1.2.2

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/README.md CHANGED
@@ -54,6 +54,34 @@ npx svg-terminal generate --watch # Rebuild on every save
54
54
  npx svg-terminal blocks <name> # Inspect a block's config schema
55
55
  ```
56
56
 
57
+ ### CLI reference
58
+
59
+ **Commands**
60
+
61
+ | Command | Description |
62
+ |---------|-------------|
63
+ | `generate` | Generate the SVG from a config file |
64
+ | `init` | Create a starter `terminal.yml` (refuses to overwrite without `--force`) |
65
+ | `themes` | List available themes |
66
+ | `blocks [<name>]` | List block types, or print one block's config schema |
67
+ | `cache check` | Verify dynamic-block cache freshness (exit 1 on stale/missing) |
68
+
69
+ **`generate` flags**
70
+
71
+ | Flag | Description |
72
+ |------|-------------|
73
+ | `--config <path>` | Config file path (default `terminal.yml`) |
74
+ | `--output <path>` | Output file path (default `terminal.svg`) |
75
+ | `--static` | Non-animated final-frame snapshot |
76
+ | `--minify` | Strip inter-element whitespace |
77
+ | `--strict` | Promote soft warnings (unknown block-config keys, over-tall animated bands) to hard errors |
78
+ | `--watch` | Re-generate on config-file change |
79
+ | `--timings` | Print per-phase wall-clock timings to stderr |
80
+ | `--explain` | Print the resolved config + block list as JSON to stderr |
81
+ | `--no-cache` / `--refresh-cache` / `--frozen-cache` | Cache behavior shortcuts (off / re-fetch all / cached-only) |
82
+ | `--cache-mode <m>` | Explicit cache mode: `normal` \| `refresh` \| `frozen` \| `off` |
83
+ | `--version` | Print the version |
84
+
57
85
  ## Configuration
58
86
 
59
87
  Edit `terminal.yml`:
@@ -88,6 +116,25 @@ blocks:
88
116
  - "[[fg:green]]Welcome to my terminal![[/fg]]"
89
117
  ```
90
118
 
119
+ `svg-terminal init` writes a fully-commented starter `terminal.yml`. The top-level keys:
120
+
121
+ | Key | Purpose |
122
+ |-----|---------|
123
+ | `theme` | Theme name, an inline theme object, or `random` (daily rotation) |
124
+ | `blocks` | The ordered list of blocks to render (each `{ block, config?, command?, color?, typing?, pause? }`) |
125
+ | `window` | Chrome + frame: `width`, `height`/`autoHeight` (+ `minHeight`/`maxHeight`), `title`, `style` (`macos`\|`win95`\|`floating`\|`minimal`\|`none`), `titleBarHeight`, `borderRadius` |
126
+ | `terminal` | Text rendering: `fontFamily`, `fontSize`, `lineHeight`, `prompt`, `padding`/`paddingTop` |
127
+ | `effects` | `textGlow`, `scanlines`, `vignette`, `shadow` (booleans) |
128
+ | `animation` | Timing: `loop`, `defaultTypingDuration`, `outputLineStagger`, `commandOutputPause`, `outputEndPause`, `defaultSequencePause`, `scrollDelay` |
129
+ | `chrome` | Title-bar/button styling: `titleFontFamily`, `titleFontSize`, `buttonRadius`, `buttonSpacing`, `dimOpacity` |
130
+ | `accessibility` | `{ describe }` — emit the `<title>`/`<desc>` screen-reader content (default `true`) |
131
+ | `accessibilityLabel` | Override the auto-generated `aria-label` |
132
+ | `variables` | Arbitrary values exposed to blocks (surfaced by `--explain`) |
133
+ | `maxDuration` | Hard cap (seconds) on the animation timeline (default 90) |
134
+ | `scrollDuration` | Per-scroll transition duration in ms (default 100) |
135
+ | `fetchTimeout` | Network timeout (ms) for dynamic blocks (default 10000) |
136
+ | `cachePath` / `cacheTTL` | On-disk cache file location + entry TTL for cacheable blocks |
137
+
91
138
  ## Themes
92
139
 
93
140
  | Theme | Description |
@@ -366,17 +413,49 @@ For maximally reproducible CI, commit `.svg-terminal-cache.json` alongside `term
366
413
 
367
414
  The action commits as `github-actions[bot]`; the `commit` input only runs `git add output + git commit + git push` against the current branch. Skip `commit: true` and add your own commit step if you need signed commits or a custom author.
368
415
 
416
+ ### Inputs
417
+
418
+ | Input | Default | Description |
419
+ |-------|---------|-------------|
420
+ | `config` | `terminal.yml` | Path to the YAML config file |
421
+ | `output` | `terminal.svg` | Output SVG file path |
422
+ | `cache-mode` | `normal` | Dynamic-block cache behavior: `normal` \| `refresh` \| `frozen` \| `off` |
423
+ | `static` | `false` | Generate a non-animated SVG (final-frame snapshot) |
424
+ | `minify` | `false` | Strip inter-element whitespace from the output |
425
+ | `commit` | `false` | Auto-commit the generated SVG (needs `permissions: contents: write`) |
426
+ | `commit-message` | `chore: update terminal SVG [skip ci]` | Commit message when `commit: true` |
427
+
428
+ ### Outputs
429
+
430
+ | Output | Description |
431
+ |--------|-------------|
432
+ | `svg-path` | Path to the generated SVG file (echoes `output`) |
433
+ | `svg-bytes` | Byte count of the generated SVG (integer string) |
434
+ | `svg-size` | Alias of `svg-bytes` — same value |
435
+ | `svg-sha256` | Hex SHA-256 of the generated SVG, for cache-busting downstream |
436
+ | `svg-changed` | `true` \| `false` — did this run modify a pre-existing SVG? `false` on the first run (no prior file) and when bytes are unchanged. Gate commits on this. |
437
+
438
+ ```yaml
439
+ - uses: williamzujkowski/svg-terminal@v1
440
+ id: term
441
+ with: { config: terminal.yml, output: terminal.svg }
442
+ - run: echo "size=${{ steps.term.outputs.svg-bytes }} changed=${{ steps.term.outputs.svg-changed }}"
443
+ ```
444
+
369
445
  ## Text Markup
370
446
 
371
447
  Blocks support inline color markup:
372
448
 
373
449
  ```
374
450
  [[fg:green]]green text[[/fg]]
451
+ [[bg:blue]][[fg:white]]white on blue[[/fg]][[/bg]]
375
452
  [[fg:cyan]][[bold]]bold cyan[[/bold]][[/fg]]
376
453
  [[dim]]dimmed text[[/dim]]
377
454
  ```
378
455
 
379
- Available colors: `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`, `orange`, `purple`, `pink`, `comment`, plus `bright_*` variants.
456
+ Tags: `[[fg:color]]` (foreground), `[[bg:color]]` (background), `[[bold]]`, `[[dim]]` — each closed by its matching `[[/fg]]` / `[[/bg]]` / `[[/bold]]` / `[[/dim]]`, and nestable.
457
+
458
+ Available colors: `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`, `orange`, `purple`, `pink`, `comment`, plus `bright_*` variants. Colors resolve against the active theme palette; a raw hex value also works.
380
459
 
381
460
  ## ASCII Boxes
382
461
 
@@ -2617,7 +2617,7 @@ async function readCappedText(response, url) {
2617
2617
  }
2618
2618
  return new TextDecoder().decode(Buffer.concat(chunks));
2619
2619
  }
2620
- var USER_AGENT = `svg-terminal/${true ? "1.2.0" : "0.0.0-dev"}`;
2620
+ var USER_AGENT = `svg-terminal/${true ? "1.2.2" : "0.0.0-dev"}`;
2621
2621
  async function fetchWithTimeout(url, timeoutMs = DEFAULT_FETCH_TIMEOUT) {
2622
2622
  const blocked = fetchBlockReason(url);
2623
2623
  if (blocked) {
@@ -5075,4 +5075,4 @@ export {
5075
5075
  inspectCache,
5076
5076
  generateStatic
5077
5077
  };
5078
- //# sourceMappingURL=chunk-LE62SCNE.js.map
5078
+ //# sourceMappingURL=chunk-TA7SUAKV.js.map
package/dist/cli.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  mergeConfig,
12
12
  setStrictBlockConfig,
13
13
  themes
14
- } from "./chunk-LE62SCNE.js";
14
+ } from "./chunk-TA7SUAKV.js";
15
15
 
16
16
  // src/cli.ts
17
17
  import { writeFileSync, watch as fsWatch } from "fs";
@@ -127,7 +127,7 @@ function isZodOptional(t) {
127
127
  }
128
128
 
129
129
  // src/cli.ts
130
- var VERSION = true ? "1.2.0" : "0.0.0-dev";
130
+ var VERSION = true ? "1.2.2" : "0.0.0-dev";
131
131
  var args = process.argv.slice(2);
132
132
  var command = args[0];
133
133
  function getFlag(name) {
package/dist/index.js CHANGED
@@ -55,7 +55,7 @@ import {
55
55
  themes,
56
56
  tokyoNight,
57
57
  win95
58
- } from "./chunk-LE62SCNE.js";
58
+ } from "./chunk-TA7SUAKV.js";
59
59
  export {
60
60
  BlockConfigError,
61
61
  ConfigError,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "svg-terminal",
3
- "version": "1.2.0",
4
- "description": "Generate animated SVG terminals for GitHub READMEs from a declarative YAML config. 47 built-in blocks, 12 themes, zero runtime deps in the output.",
3
+ "version": "1.2.2",
4
+ "description": "Generate animated SVG terminals for GitHub READMEs from a declarative YAML config. 48 built-in blocks, 20 themes, zero runtime deps in the output.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",