diff --git a/.changeset/dry-pumas-begin.md b/.changeset/dry-pumas-begin.md new file mode 100644 index 00000000..adef873d --- /dev/null +++ b/.changeset/dry-pumas-begin.md @@ -0,0 +1,6 @@ +--- +"@mdx-js/typescript-plugin": patch +"@mdx-js/language-server": patch +--- + +Update to `load-plugin` 6 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 168c538f..506377b4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,32 +33,30 @@ bug or suggest a new feature before creating a pull request. ## Submitting an issue -* The issue tracker is for issues. - Use discussions for support -* Search the issue tracker (including closed issues) before opening a new - issue -* Ensure you’re using the latest version of our packages -* Use a clear and descriptive title -* Include as much information as possible: steps to reproduce the issue, - error message, version, operating system, etcetera -* The more time you put into an issue, the better we will be able to help you -* The best issue report is a [failing test][unit-test] proving it +* The issue tracker is for issues. + Use discussions for support +* Search the issue tracker (including closed issues) before opening a new issue +* Ensure you’re using the latest version of our packages +* Use a clear and descriptive title +* Include as much information as possible: steps to reproduce the issue, error + message, version, operating system, etcetera +* The more time you put into an issue, the better we will be able to help you +* The best issue report is a [failing test][unit-test] proving it ## Submitting a pull request -* See [¶ Project][project] below for info on how the project is structured, - how to test, and how to build the site -* Non-trivial changes are often best discussed in an issue first, to prevent - you from doing unnecessary work -* For ambitious tasks, you should try to get your work in front of the - community for feedback as soon as possible -* New features should be accompanied by tests and documentation -* For significant changes, add a [changeset][] using the `npx changeset` - command -* Don’t include unrelated changes -* Test before submitting code by running `npm test` -* Write a convincing description of why we should land your pull request: - it’s your job to convince us +* See [¶ Project][project] below for info on how the project is structured, + how to test, and how to build the site +* Non-trivial changes are often best discussed in an issue first, to prevent you + from doing unnecessary work +* For ambitious tasks, you should try to get your work in front of the community + for feedback as soon as possible +* New features should be accompanied by tests and documentation +* For significant changes, add a [changeset][] using the `npx changeset` command +* Don’t include unrelated changes +* Test before submitting code by running `npm test` +* Write a convincing description of why we should land your pull request: + it’s your job to convince us ## Project @@ -95,11 +93,11 @@ Studio Code extension to the [marketplace][], and create GitHub releases. ## Resources -* [Good first issues in the MDX repository](https://github.com/mdx-js/mdx-analyzer/labels/good%20first%20issue%20👋) -* [How to contribute to open source](https://opensource.guide/how-to-contribute/) -* [Making your first contribution](https://medium.com/@vadimdemedes/making-your-first-contribution-de6576ddb190) -* [Using pull requests](https://help.github.com/articles/about-pull-requests/) -* [GitHub help](https://help.github.com) +* [Good first issues in the MDX repository](https://github.com/mdx-js/mdx-analyzer/labels/good%20first%20issue%20👋) +* [How to contribute to open source](https://opensource.guide/how-to-contribute/) +* [Making your first contribution](https://medium.com/@vadimdemedes/making-your-first-contribution-de6576ddb190) +* [Using pull requests](https://help.github.com/articles/about-pull-requests/) +* [GitHub help](https://help.github.com) [changeset]: .changeset/README.md diff --git a/README.md b/README.md index 05cddebe..141dec0d 100644 --- a/README.md +++ b/README.md @@ -10,27 +10,27 @@ This repository contains the code to provide editor tooling support for [MDX][]. ## Contents -* [Workspaces](#workspaces) -* [Use](#use) - * [TypeScript](#typescript) - * [Plugins](#plugins) -* [Contribute](#contribute) -* [Sponsor](#sponsor) -* [License](#license) +* [Workspaces](#workspaces) +* [Use](#use) + * [TypeScript](#typescript) + * [Plugins](#plugins) +* [Contribute](#contribute) +* [Sponsor](#sponsor) +* [License](#license) ## Workspaces This repository contains the following workspaces: -* [`@mdx-js/language-service`][] provides utilities to integrate MDX into - [Volar][]. -* [`@mdx-js/language-server`][] provides an MDX language server using the - [Language Server Protocol][]. -* [`@mdx-js/typescript-plugin`][] provides a [TypeScript plugin][] to - integrate MDX in TypeScript editors. -* [`vscode-mdx`][] integrates the MDX language server into - [Visual Studio Code][], but also provides some Visual Studio Code specific - features such as syntax highlighting. +* [`@mdx-js/language-service`][] provides utilities to integrate MDX into + [Volar][]. +* [`@mdx-js/language-server`][] provides an MDX language server using the + [Language Server Protocol][]. +* [`@mdx-js/typescript-plugin`][] provides a [TypeScript plugin][] to integrate + MDX in TypeScript editors. +* [`vscode-mdx`][] integrates the MDX language server into + [Visual Studio Code][], but also provides some Visual Studio Code specific + features such as syntax highlighting. ## Use diff --git a/package.json b/package.json index 343b0f81..5d514adb 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,9 @@ "prettier": "^3.0.0", "react": "^18.0.0", "react-dom": "^18.0.0", - "remark-cli": "^11.0.0", - "remark-frontmatter": "^4.0.0", - "remark-preset-wooorm": "^9.0.0", + "remark-cli": "^12.0.0", + "remark-frontmatter": "^5.0.0", + "remark-preset-wooorm": "^10.0.0", "typescript": "^5.0.0", "xo": "^0.58.0" }, diff --git a/packages/language-server/README.md b/packages/language-server/README.md index b015899a..0f5a225f 100644 --- a/packages/language-server/README.md +++ b/packages/language-server/README.md @@ -11,23 +11,23 @@ A [language server][lsp] for [MDX][]. ## Contents -* [What is this?](#what-is-this) -* [When should I use this?](#when-should-i-use-this) -* [Install](#install) -* [Use](#use) - * [Language server features](#language-server-features) - * [Initialize Options](#initialize-options) - * [Configuration](#configuration) - * [TypeScript](#typescript) - * [Plugins](#plugins) -* [Examples](#examples) - * [Visual Studio Code](#visual-studio-code) -* [Compatibility](#compatibility) -* [Security](#security) -* [Contribute](#contribute) -* [Sponsor](#sponsor) -* [Changelog](#changelog) -* [License](#license) +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) + * [Language server features](#language-server-features) + * [Initialize Options](#initialize-options) + * [Configuration](#configuration) + * [TypeScript](#typescript) + * [Plugins](#plugins) +* [Examples](#examples) + * [Visual Studio Code](#visual-studio-code) +* [Compatibility](#compatibility) +* [Security](#security) +* [Contribute](#contribute) +* [Sponsor](#sponsor) +* [Changelog](#changelog) +* [License](#license) ## What is this? @@ -69,45 +69,46 @@ features specific to MDX. MDX language server supports the following LSP initialization options: -* `typescript.enabled` (`boolean`, default: `false`) — - If true, enable TypeScript. -* `typescript.tsdk` (`string`, required) — - The path from which to load TypeScript. -* `locale` (`string`, optional) — - The locale to use for TypeScript error messages. +* `typescript.enabled` (`boolean`, default: `false`) — + If true, enable TypeScript. +* `typescript.tsdk` (`string`, required) — + The path from which to load TypeScript. +* `locale` (`string`, optional) — + The locale to use for TypeScript error messages. ### Configuration MDX language server supports the following LSP configuration options: -* `mdx.trace.server.verbosity` (`"off"` | `"messages"` | `"compact"` | - `"verbose"`, default: `"off"`) — - Trace MDX language server requests in the output console. -* `mdx.trace.server.format` (`"text"` | `"json"`, default: `"text"`) — - How to format traced MDX language server requests. -* `mdx.validate.validateReferences` (`"ignore"` | `"hint"` | `"warning"` | - `"error"`, default: `"warning"`) — - Diagnostic level for invalid reference links, e.g. `[text][no-such-ref]`. -* `mdx.validate.validateFragmentLinks` (`"ignore"` | `"hint"` | `"warning"` | - `"error"`, default: `"warning"`) — - Diagnostic level for fragments links to headers in the current file that - don’t exist, e.g. `[text](#no-such-header)` -* `mdx.validate.validateFileLinks` (`"ignore"` | `"hint"` | `"warning"` | - `"error"`, default: `"warning"`) — - Diagnostic level for links to local files that don’t exist, e.g. - `[text](./no-such-file.png)`. -* `mdx.validate.validateMarkdownFileLinkFragments` (`"ignore"` | `"hint"` | - `"warning"` | `"error"`, default: `"warning"`) — - Diagnostic level for the fragment part of links to other local markdown - files , e.g. `[text](./no-such-file.png)`. -* `mdx.validate.validateUnusedLinkDefinitions` (`"ignore"` | `"hint"` | - `"warning"` | `"error"`, default: `"warning"`) — - Diagnostic level for link definitions that aren’t used anywhere. - `[never-used]: http://example.com`. -* `mdx.validate.validateDuplicateLinkDefinitions` (`"ignore"` | `"hint"` | `"warning"` | `"error"`, default: `"warning"`) — - Diagnostic level for duplicate link definitions. -* `mdx.validate.ignoreLinks` (`Array`, optional) — - Glob of links that should not be validated. +* `mdx.trace.server.verbosity` (`"off"` | `"messages"` | `"compact"` | + `"verbose"`, default: `"off"`) — + Trace MDX language server requests in the output console. +* `mdx.trace.server.format` (`"text"` | `"json"`, default: `"text"`) — + How to format traced MDX language server requests. +* `mdx.validate.validateReferences` (`"ignore"` | `"hint"` | `"warning"` | + `"error"`, default: `"warning"`) — + Diagnostic level for invalid reference links, e.g. `[text][no-such-ref]`. +* `mdx.validate.validateFragmentLinks` (`"ignore"` | `"hint"` | `"warning"` | + `"error"`, default: `"warning"`) — + Diagnostic level for fragments links to headers in the current file that don’t + exist, e.g. `[text](#no-such-header)` +* `mdx.validate.validateFileLinks` (`"ignore"` | `"hint"` | `"warning"` | + `"error"`, default: `"warning"`) — + Diagnostic level for links to local files that don’t exist, e.g. + `[text](./no-such-file.png)`. +* `mdx.validate.validateMarkdownFileLinkFragments` (`"ignore"` | `"hint"` | + `"warning"` | `"error"`, default: `"warning"`) — + Diagnostic level for the fragment part of links to other local markdown files, + e.g. `[text](./no-such-file.png)`. +* `mdx.validate.validateUnusedLinkDefinitions` (`"ignore"` | `"hint"` | + `"warning"` | `"error"`, default: `"warning"`) — + Diagnostic level for link definitions that aren’t used anywhere. + `[never-used]: http://example.com`. +* `mdx.validate.validateDuplicateLinkDefinitions` (`"ignore"` | `"hint"` | + `"warning"` | `"error"`, default: `"warning"`) — + Diagnostic level for duplicate link definitions. +* `mdx.validate.ignoreLinks` (`Array`, optional) — + Glob of links that should not be validated. ### TypeScript diff --git a/packages/language-server/package.json b/packages/language-server/package.json index 3c5967ec..198a71aa 100644 --- a/packages/language-server/package.json +++ b/packages/language-server/package.json @@ -34,7 +34,7 @@ "dependencies": { "@mdx-js/language-service": "0.5.4", "@volar/language-server": "~2.1.0", - "load-plugin": "^5.0.0", + "load-plugin": "^6.0.0", "remark-frontmatter": "^5.0.0", "remark-gfm": "^4.0.0", "volar-service-markdown": "0.0.34", diff --git a/packages/language-service/README.md b/packages/language-service/README.md index 8379288d..be3b4bad 100644 --- a/packages/language-service/README.md +++ b/packages/language-service/README.md @@ -12,21 +12,21 @@ ## Contents -* [What is this?](#what-is-this) -* [When should I use this?](#when-should-i-use-this) -* [Install](#install) -* [Use](#use) -* [API](#api) - * [`createMdxLanguagePlugin([plugins][, checkMdx][, jsxImportSource])`](#createmdxlanguagepluginplugins-checkmdx-jsximportsource) - * [`createMdxServicePlugin()`](#createmdxserviceplugin) - * [`resolveRemarkPlugins(mdxConfig, resolvePlugin)`](#resolveremarkpluginsmdxconfig-resolveplugin) -* [Compatibility](#compatibility) -* [Types](#types) -* [Security](#security) -* [Contribute](#contribute) -* [Sponsor](#sponsor) -* [Changelog](#changelog) -* [License](#license) +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`createMdxLanguagePlugin([plugins][, checkMdx][, jsxImportSource])`](#createmdxlanguagepluginplugins-checkmdx-jsximportsource) + * [`createMdxServicePlugin()`](#createmdxserviceplugin) + * [`resolveRemarkPlugins(mdxConfig, resolvePlugin)`](#resolveremarkpluginsmdxconfig-resolveplugin) +* [Compatibility](#compatibility) +* [Types](#types) +* [Security](#security) +* [Contribute](#contribute) +* [Sponsor](#sponsor) +* [Changelog](#changelog) +* [License](#license) ## What is this? @@ -90,14 +90,14 @@ Create a [Volar][] language plugin to support [MDX][]. #### Parameters -* `plugins` ([`PluggableList`][pluggablelist], optional) — - A list of remark syntax plugins. - Only syntax plugins are supported. - Transformers are unused. -* `checkMdx` (`boolean`, default: `false`) — - If true, check MDX files strictly. -* `jsxImportSource` (`string`, default: `react`) — - The JSX import source to use in the embedded JavaScript file. +* `plugins` ([`PluggableList`][pluggablelist], optional) — + A list of remark syntax plugins. + Only syntax plugins are supported. + Transformers are unused. +* `checkMdx` (`boolean`, default: `false`) — + If true, check MDX files strictly. +* `jsxImportSource` (`string`, default: `react`) — + The JSX import source to use in the embedded JavaScript file. #### Returns @@ -108,10 +108,10 @@ A Volar language plugin to support MDX. Create a [Volar][] service module to support [MDX][]. The service supports: -* Reporting diagnostics for parsing errors. -* Document drop support for images. -* Custom commands for toggling `delete`, `emphasis`, `inlineCode`, and - `strong` text. +* Reporting diagnostics for parsing errors. +* Document drop support for images. +* Custom commands for toggling `delete`, `emphasis`, `inlineCode`, and `strong` + text. #### Parameters @@ -127,10 +127,10 @@ Resolve remark plugins from TypeScript’s parsed command line options. #### Parameters -* `mdxConfig` (`unknown`) — - The parsed command line options from which to resolve plugins. -* `resolvePlugin` (`Function`) — - A function which takes a plugin name, and resolvs it to a remark plugin. +* `mdxConfig` (`unknown`) — + The parsed command line options from which to resolve plugins. +* `resolvePlugin` (`Function`) — + A function which takes a plugin name, and resolvs it to a remark plugin. #### Returns diff --git a/packages/typescript-plugin/package.json b/packages/typescript-plugin/package.json index a75c30c0..cc595e03 100644 --- a/packages/typescript-plugin/package.json +++ b/packages/typescript-plugin/package.json @@ -31,7 +31,7 @@ "dependencies": { "@mdx-js/language-service": "0.5.4", "@volar/typescript": "~2.1.0", - "load-plugin": "^5.0.0", + "load-plugin": "^6.0.0", "remark-frontmatter": "^5.0.0", "remark-gfm": "^4.0.0" }, diff --git a/packages/vscode-mdx/README.md b/packages/vscode-mdx/README.md index 53aa250a..84b85594 100644 --- a/packages/vscode-mdx/README.md +++ b/packages/vscode-mdx/README.md @@ -12,16 +12,16 @@ ## Contents -* [Install](#install) -* [Settings](#settings) -* [TypeScript](#typescript) -* [Plugins](#plugins) -* [Syntax highlighting](#syntax-highlighting) -* [ESLint](#eslint) -* [Auto-close tags](#auto-close-tags) -* [Sponsor](#sponsor) -* [Changelog](#changelog) -* [License](#license) +* [Install](#install) +* [Settings](#settings) +* [TypeScript](#typescript) +* [Plugins](#plugins) +* [Syntax highlighting](#syntax-highlighting) +* [ESLint](#eslint) +* [Auto-close tags](#auto-close-tags) +* [Sponsor](#sponsor) +* [Changelog](#changelog) +* [License](#license) ## Install @@ -38,8 +38,8 @@ All [MDX language server configurations][] can be configured via [Visual Studio Code][vscode] settings. MDX for VSCode supports the following additional setting: -* `mdx.server.enable` (`boolean`, default: `true`) — - Enable the MDX language server. +* `mdx.server.enable` (`boolean`, default: `true`) — + Enable the MDX language server. ## TypeScript