- API: Removed
parse()andrender()re-exports from main package entry point. These are internal implementation details used by the CLI; advanced users can import directly fromsrc/parser.tsandsrc/renderer.tsif needed for custom tools. - API: Removed
DocNode,ProseNode, andCodeNodetype re-exports from main package entry point. These are internal types; the public API focuses on identifier functions and configuration (setDescribeFormat()). - Packaging: Added keywords to
package.jsonfor better discoverability on npm registry. - Documentation: Minor refinements to DEVELOPMENT.md for clarity.
- Support for additional code example identifiers:
specanditas aliases fortest, andcontextandsuiteas aliases fordescribe. These are exported from the package and work identically to their counterparts, providing flexibility for different testing styles and naming conventions. (Engine) - Type definitions are now exported:
CodeNode,DescribeNode, andProseNodefor better TypeScript support when using lit-md programmatically. (Engine)
- CLI: Renamed
--waitflag to--watchfor consistency with common CLI conventions (webpack, esbuild, TypeScript, etc.). This flag enables watch mode, which automatically regenerates output when input files change. Update scripts and CI/CD configurations that uselit-md --waitto uselit-md --watchinstead.
- CLI: Snapshot matching regression where
--match-snapshotwas silently updating snapshots instead of validating them. The issue occurred because snapshots were written to disk during markdown generation, then validation compared the generated content against the file that was just written (comparing against itself). Now--match-snapshotonly validates without writing files - snapshots are only written when using-u(update) flag or when auto-generating missing snapshots. Added permanent regression test (test/snapshot-regression.test.ts) to prevent this issue from recurring.
- Engine Deal better with shellExample command failures. When a shell command fails (non-zero exit code or timeout), the error message now includes the full command output (stdout and stderr) for easier debugging. If the output is empty, it will say
(empty)instead of showing an empty diff. This provides clearer feedback on what went wrong with the command.
-
Engine:
timeoutoption forshellExample(): Prevents test hangs from long-running or infinite shell commands with a configurable timeout (default: 3000ms). For example,shellExample('npm install', { timeout: 30000 })allows 30 seconds. Timeouts result in clear error messages like "Command timed out after 3000ms: sleep 10", with proper resource cleanup. -
CLI: Visual feedback indicators for all operations. Watch mode and normal mode now display
✅ Typecheck passedor❌ Typecheck failedfor type checking results, and✅ Generated N file(s)for markdown generation, providing consistent visual feedback alongside test results. -
CLI: Additional exit keys for watch mode (
--watch). Users can now exit watch mode by pressingq,x, orescin addition toCtrl+C, making it more intuitive and accessible. -
Engine: Colored and contextual typecheck error output using TypeScript's
formatDiagnosticsWithColorAndContext(). Type errors now display with red highlighting, line numbers, and surrounding code context for better visibility and debugging. -
exitCodeoption forshellExample(): Assert the command exits with a specific exit code. For example,shellExample('ls /nonexistent', { exitCode: 2 })verifies the command exits with code 2. Commands with a non-zeroexitCodedisplay a# exits: Nannotation in the generatedshblock. -
metaoption forshellExample(): When set totrue, outputs a fenced code block showing theshellExamplecall itself before the command output, with themeta: trueoption removed for cleaner documentation.
-
Engine:
shellExampleassertion failures onoutputFiles.containsandoutputFiles.matchesnow include the actual file content in the error message. When the file is empty, the message says(empty)instead of showing a confusing empty diff. -
Engine:
shellExamplewithmeta: truenow correctly escapes backslashes and special characters (e.g.\n,\r) in the command string when reconstructing the TypeScriptshellExample(...)call. Previously, a command containing a literal backslash could generate invalid TypeScript.