{"id":15416599,"url":"https://github.com/remcohaszing/monaco-unified","last_synced_at":"2026-03-04T17:31:16.070Z","repository":{"id":62355029,"uuid":"501650201","full_name":"remcohaszing/monaco-unified","owner":"remcohaszing","description":"Get warnings and error messages in monaco editor based on a unified processor.","archived":false,"fork":false,"pushed_at":"2025-06-12T07:33:49.000Z","size":1506,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-26T23:41:05.831Z","etag":null,"topics":["monaco-editor","rehype","remark","unifiedjs","unist"],"latest_commit_sha":null,"homepage":"https://monaco-unified.js.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remcohaszing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-09T12:48:15.000Z","updated_at":"2025-06-12T07:33:53.000Z","dependencies_parsed_at":"2024-04-16T10:43:26.443Z","dependency_job_id":"c0a7df7c-a173-4a4c-8727-1baf2bf3adf0","html_url":"https://github.com/remcohaszing/monaco-unified","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"eff10334e2b76499a31d87bb869818df963bf320"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/remcohaszing/monaco-unified","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fmonaco-unified","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fmonaco-unified/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fmonaco-unified/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fmonaco-unified/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remcohaszing","download_url":"https://codeload.github.com/remcohaszing/monaco-unified/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fmonaco-unified/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30087315,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T15:40:14.053Z","status":"ssl_error","status_checked_at":"2026-03-04T15:40:13.655Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["monaco-editor","rehype","remark","unifiedjs","unist"],"created_at":"2024-10-01T17:12:40.223Z","updated_at":"2026-03-04T17:31:16.045Z","avatar_url":"https://github.com/remcohaszing.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# monaco-unified\n\n[![ci](https://github.com/remcohaszing/monaco-unified/actions/workflows/ci.yaml/badge.svg)](https://github.com/remcohaszing/monaco-unified/actions/workflows/ci.yaml)\n[![npm badge](https://img.shields.io/npm/v/monaco-unified)](https://www.npmjs.com/package/monaco-unified)\n[![prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io)\n\nGet warnings and error messages in monaco editor based on a unified processor.\n\n## Installation\n\n```sh\nnpm install monaco-unified\n```\n\n## Usage\n\nFirst, create your own unified worker. Let’s create a remark worker for this example.\n\n`unified.worker.js`:\n\n```js\nimport { initialize } from 'monaco-unified/worker'\nimport { remark } from 'remark'\nimport remarkLintHeadingIncrement from 'remark-lint-heading-increment'\n\ninitialize((vfile, configuration) =\u003e remark().use(remarkLintHeadingIncrement))\n```\n\nNext, configure `monaco-unified` in the main thread. Also add your worker in the monaco environment.\n\n```js\nimport * as monaco from 'monaco-editor'\nimport { configureMonacoUnified } from 'monaco-unified'\n\nwindow.MonacoEnvironment = {\n  getWorker(moduleId, label) {\n    switch (label) {\n      case 'editorWorkerService':\n        return new Worker(new URL('monaco-editor/esm/vs/editor/editor.worker', import.meta.url))\n      case 'remark':\n        return new Worker(new URL('unified.worker', import.meta.url))\n      default:\n        throw new Error(`Unknown label ${label}`)\n    }\n  }\n}\n\nconst monacoUnified = configureMonacoUnified(monaco, {\n  languageSelector: 'markdown',\n  label: 'remark',\n  configuration: {\n    // This configuration will be passed to your worker.\n  }\n})\n```\n\n## API\n\nThis package exposes two exports. One to setup the main logic, another to create a worker.\n\n### `monaco-unified`\n\n#### `configureMonacoUnified(monaco, options)`\n\nConfigure monaco-unified.\n\n**Arguments**:\n\n- `monaco`: The `monaco-editor` module.\n- `options`: An object with the following properties:\n  - `label`: The label to use for the worker. This is used to match a worker in `MonacoEnvironment`\n    (`string`).\n  - `languageSelector`: The language ID or IDs to which to apply `monaco-unified`. (`string` |\n    `string[]`)\n  - `configuration`: The configuration that will be sent to the worker. (optional)\n  - `formatting`: By default `monaco-unified` supports formatting using unified. Set this to `false`\n    to disable. (`boolean`, optional, default: `true`)\n  - `validation`: By default `monaco-unified` supports validation using unified. Set this to `false`\n    to disable.. (`boolean`, optional, default: `true`)\n\n**Returns**: A disposable with the following additional properties:\n\n- `reconfigure(configuration)`: Update the configuration.\n\n### `monaco-unified/worker`\n\n#### `initialize(getProcessor)`\n\nInitialize the worker.\n\n**Arguments**:\n\n- `getProcessor`: A function which gets called with a [VFile](https://github.com/vfile/vfile)\n  instance and the passed configuration, and should return a unified processor.\n\n## Related projects\n\n- [`monaco-tailwindcss`](https://monaco-tailwindcss.js.org)\n- [`monaco-yaml`](https://monaco-yaml.js.org)\n\n## Showcase\n\n- [Motif](https://motif.land) uses `monaco-unified` to provide a rich editing experience for MDX\n  files.\n\n## License\n\n[MIT](LICENSE.md) © [Remco Haszing](https://github.com/remcohaszing)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremcohaszing%2Fmonaco-unified","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremcohaszing%2Fmonaco-unified","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremcohaszing%2Fmonaco-unified/lists"}