Skip to content

Add plugin renderer system and focused test suites. issues: #23 #24 #25 # 54#74

Open
taranais wants to merge 1 commit intoakonan:mainfrom
taranais:feature/custom-renders
Open

Add plugin renderer system and focused test suites. issues: #23 #24 #25 # 54#74
taranais wants to merge 1 commit intoakonan:mainfrom
taranais:feature/custom-renders

Conversation

@taranais
Copy link
Copy Markdown
Contributor

Pull Request

Description

This PR introduces a first-class renderer plugin system for wiremd and migrates the existing built-in renderers to that model. It also adds first-party vue, svelte, and angular renderers, updates the CLI to load and use registered renderers dynamically, and expands the test strategy to focus explicitly on renderer and plugin behavior.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Documentation update
  • Test updates
  • Build/tooling changes

Related Issues

Implement Vue component renderer #23
Implement Svelte component renderer #24
Add Angular component renderer #25

Changes Made

  • Added a runtime plugin registry with support for renderer registration, transformer registration, renderer discovery, and multi-artifact outputs.
  • Migrated built-in html, json, react, and tailwind renderers to first-party plugins while preserving the existing public helper APIs.
  • Added first-party vue, svelte, and angular renderers, including Angular multi-file output support.
  • Updated the CLI to resolve formats from the registry, load external plugins, list available renderers, and handle multi-artifact renderer outputs.
  • Expanded public types for plugin authors, including plugin contracts, render artifacts/results, transformer references, and exported node aliases.
  • Added focused test suites and coverage modes for plugins and renderers, plus new renderer/plugin coverage and regression tests.
  • Updated README and API docs to reflect the actual runtime plugin API and new renderer capabilities.

Testing

Test Coverage

  • Added new tests for new functionality
  • Updated existing tests
  • All tests pass locally (npm test)
  • No decrease in code coverage

Manual Testing

  1. Ran the focused renderer and plugin suites with npm test.
  2. Ran separated coverage checks with npm run test:plugins:coverage and npm run test:renderers:coverage.
  3. Ran the full regression suite with npm run test:all.

Examples

Input

## Contact Form

[Email___]{type:email required}

[Submit]*

Output

<template>
  <div class="wmd-root wmd-sketch">
    <h2 class="wmd-h2">Contact Form</h2>
    <input v-model="formState.email" type="email" class="wmd-input" required />
    <button class="wmd-button wmd-button-primary" type="submit">Submit</button>
  </div>
</template>

Checklist

  • My code follows the project's coding standards
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Breaking Changes

None.

Migration Guide

No migration is required for existing users.

Existing helper APIs such as renderToHTML(), renderToJSON(), renderToReact(), and renderToTailwind() remain available.

New capabilities:
- registerPlugin(plugin)
- createPluginRegistry()
- renderArtifacts(ast, options)
- CLI plugin loading with --plugin

Screenshots/Recordings

Not applicable.

Performance Impact

  • No performance impact

Documentation

  • README.md updated
  • CHANGELOG.md updated
  • API documentation updated (JSDoc)
  • Example files added/updated
  • Syntax specification updated (if syntax changes)

Additional Notes

This PR keeps the existing rendering entry points for compatibility while moving the implementation to a plugin-first architecture.
It also introduces focused test scopes so renderer/plugin work can be iterated on without running the full suite every time.

Reviewer Checklist

  • Code quality and style
  • Tests are adequate
  • Documentation is complete
  • No security concerns
  • Performance is acceptable
  • Breaking changes are justified and documented

@taranais taranais changed the title Add plugin renderer system and focused test suites Add plugin renderer system and focused test suites. issues: #23 #24 #25 # 54 Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant