@lichens-innovation/react-markdown-composer
v1.6.1
Published
Reusable React component for composing markdown.
Maintainers
Keywords
Readme
react-markdown-composer
Reusable React component for composing markdown.
Installation
bun add @lichens-innovation/react-markdown-composerPeer dependencies (install in the host app): antd, react, react-dom.
Usage
import { useState } from "react";
import { MarkdownComposer } from "@lichens-innovation/react-markdown-composer";
const MyComposerDialogBody = ({ inputData }) => {
const [markdown, setMarkdown] = useState("markdown template with {{some expressions}} ");
return (
<MarkdownComposer
inputData={inputData}
markdown={markdown}
onMarkdownChange={setMarkdown}
/>
);
};
Development
Install Bun 1.4+ (see packageManager in package.json) and uv (Python 3.11+, for local lint coaching), then:
bun installbun install also installs habit-hooks automatically. If uv is not installed, install succeeds anyway — install uv and re-run bun install, or run uv tool install "habit-hooks[typescript]" manually.
bun startStarts the Vite playground on http://localhost:3000 and opens MarkdownComposer.
All Scripts
| Command | Description |
| ----------------------- | --------------------------------------------------------------------------------------------------- |
| bun prepare | Installs husky git hooks, applies patch-package patches, installs habit-hooks (runs on bun install) |
| bun habit:install | Installs habit-hooks for local lint coaching (runs via prepare on bun install; skipped in CI) |
| bun clean:node | Removes node_modules directories and bun.lock file |
| bun start | Starts the Vite playground (MarkdownComposer) |
| bun generate:version | Writes version constants from package.json (optional local helper) |
| bun typecheck | Checks TypeScript types without emitting files |
| bun lint | Runs habit-hooks — linter findings as coaching guides |
| bun lint:ci | Runs ESLint to check code quality |
| bun lint:fix | Runs ESLint with --fix |
| bun lint:package | Lints package.json via npm-package-json-lint |
| bun lint:unused | Finds unused files, exports, and dependencies (via knip) |
| bun format | Formats all files using Prettier according to .prettierrc rules |
| bun format:check | Checks if files are formatted according to Prettier rules |
| bun habit:hooks | Runs habit-hooks against the main branch (habit-hooks --branch main) |
| bun habit:snoozed | Lists the currently snoozed habit-hooks findings (.habit-hooks/snooze.json) |
| bun build | Cleans dist, then Vite library build (src/index.ts → dist/) |
| bun test | Runs tests using Vitest |
| bun test:coverage | Runs tests with a Vitest coverage report |
| bun test:crap | Runs tests with coverage, then generates a CRAP score report (crap-report/) |
Project coding guidelines
Adhering to established coding guidelines is essential for developing efficient, maintainable, and scalable software. These guidelines promote consistency across codebases, making it easier for teams to collaborate and for new developers to understand existing code. By following standardized patterns, such as those outlined in the Coding guidelines, developers can reduce errors and enhance code readability.
Contributions
Contributions to the project are made by improving the current codebase and then creating a Pull Request. When the PR is merged into main, the CI pipeline runs automatically. semantic-release determines the next version from conventional commit messages, updates CHANGELOG.md and package.json, and publishes the new version — no manual version bump required.
Library semantic versioning
Versioning is automated by semantic-release using Conventional Commits. The release type is derived from commit message prefixes:
| Commit prefix | Release type |
| ----------------------------- | ----------------------------------------------- |
| fix: | PATCH — backward-compatible bug fix |
| feat: | MINOR — new backward-compatible functionality |
| feat!: / BREAKING CHANGE: | MAJOR — incompatible API change |
Follow Semantic Versioning (MAJOR.MINOR.PATCH) when writing commit messages — the tooling takes care of the rest. Commitlint requires a scope (e.g. feat(composer): add toolbar).
License
This project is licensed under the MIT License - see the LICENSE file for details.
