Skip to content

Commit ec5191f

Browse files
authored
Update dependencies related to unified (#430)
This updates `load-plugin` as well as dependencies related to markdown linting to the latest version.
1 parent 88d9956 commit ec5191f

File tree

12 files changed

+156
-145
lines changed

12 files changed

+156
-145
lines changed

.changeset/dry-pumas-begin.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@mdx-js/typescript-plugin": patch
3+
"@mdx-js/language-server": patch
4+
---
5+
6+
Update to `load-plugin` 6

CONTRIBUTING.md

+26-28
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,30 @@ bug or suggest a new feature before creating a pull request.
3333

3434
## Submitting an issue
3535

36-
* The issue tracker is for issues.
37-
Use discussions for support
38-
* Search the issue tracker (including closed issues) before opening a new
39-
issue
40-
* Ensure you’re using the latest version of our packages
41-
* Use a clear and descriptive title
42-
* Include as much information as possible: steps to reproduce the issue,
43-
error message, version, operating system, etcetera
44-
* The more time you put into an issue, the better we will be able to help you
45-
* The best issue report is a [failing test][unit-test] proving it
36+
* The issue tracker is for issues.
37+
Use discussions for support
38+
* Search the issue tracker (including closed issues) before opening a new issue
39+
* Ensure you’re using the latest version of our packages
40+
* Use a clear and descriptive title
41+
* Include as much information as possible: steps to reproduce the issue, error
42+
message, version, operating system, etcetera
43+
* The more time you put into an issue, the better we will be able to help you
44+
* The best issue report is a [failing test][unit-test] proving it
4645

4746
## Submitting a pull request
4847

49-
* See [¶ Project][project] below for info on how the project is structured,
50-
how to test, and how to build the site
51-
* Non-trivial changes are often best discussed in an issue first, to prevent
52-
you from doing unnecessary work
53-
* For ambitious tasks, you should try to get your work in front of the
54-
community for feedback as soon as possible
55-
* New features should be accompanied by tests and documentation
56-
* For significant changes, add a [changeset][] using the `npx changeset`
57-
command
58-
* Don’t include unrelated changes
59-
* Test before submitting code by running `npm test`
60-
* Write a convincing description of why we should land your pull request:
61-
it’s your job to convince us
48+
* See [¶ Project][project] below for info on how the project is structured,
49+
how to test, and how to build the site
50+
* Non-trivial changes are often best discussed in an issue first, to prevent you
51+
from doing unnecessary work
52+
* For ambitious tasks, you should try to get your work in front of the community
53+
for feedback as soon as possible
54+
* New features should be accompanied by tests and documentation
55+
* For significant changes, add a [changeset][] using the `npx changeset` command
56+
* Don’t include unrelated changes
57+
* Test before submitting code by running `npm test`
58+
* Write a convincing description of why we should land your pull request:
59+
it’s your job to convince us
6260

6361
## Project
6462

@@ -95,11 +93,11 @@ Studio Code extension to the [marketplace][], and create GitHub releases.
9593

9694
## Resources
9795

98-
* [Good first issues in the MDX repository](https://github.com/mdx-js/mdx-analyzer/labels/good%20first%20issue%20👋)
99-
* [How to contribute to open source](https://opensource.guide/how-to-contribute/)
100-
* [Making your first contribution](https://medium.com/@vadimdemedes/making-your-first-contribution-de6576ddb190)
101-
* [Using pull requests](https://help.github.com/articles/about-pull-requests/)
102-
* [GitHub help](https://help.github.com)
96+
* [Good first issues in the MDX repository](https://github.com/mdx-js/mdx-analyzer/labels/good%20first%20issue%20👋)
97+
* [How to contribute to open source](https://opensource.guide/how-to-contribute/)
98+
* [Making your first contribution](https://medium.com/@vadimdemedes/making-your-first-contribution-de6576ddb190)
99+
* [Using pull requests](https://help.github.com/articles/about-pull-requests/)
100+
* [GitHub help](https://help.github.com)
103101

104102
[changeset]: .changeset/README.md
105103

README.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ This repository contains the code to provide editor tooling support for [MDX][].
1010

1111
## Contents
1212

13-
* [Workspaces](#workspaces)
14-
* [Use](#use)
15-
* [TypeScript](#typescript)
16-
* [Plugins](#plugins)
17-
* [Contribute](#contribute)
18-
* [Sponsor](#sponsor)
19-
* [License](#license)
13+
* [Workspaces](#workspaces)
14+
* [Use](#use)
15+
* [TypeScript](#typescript)
16+
* [Plugins](#plugins)
17+
* [Contribute](#contribute)
18+
* [Sponsor](#sponsor)
19+
* [License](#license)
2020

2121
## Workspaces
2222

2323
This repository contains the following workspaces:
2424

25-
* [`@mdx-js/language-service`][] provides utilities to integrate MDX into
26-
[Volar][].
27-
* [`@mdx-js/language-server`][] provides an MDX language server using the
28-
[Language Server Protocol][].
29-
* [`@mdx-js/typescript-plugin`][] provides a [TypeScript plugin][] to
30-
integrate MDX in TypeScript editors.
31-
* [`vscode-mdx`][] integrates the MDX language server into
32-
[Visual Studio Code][], but also provides some Visual Studio Code specific
33-
features such as syntax highlighting.
25+
* [`@mdx-js/language-service`][] provides utilities to integrate MDX into
26+
[Volar][].
27+
* [`@mdx-js/language-server`][] provides an MDX language server using the
28+
[Language Server Protocol][].
29+
* [`@mdx-js/typescript-plugin`][] provides a [TypeScript plugin][] to integrate
30+
MDX in TypeScript editors.
31+
* [`vscode-mdx`][] integrates the MDX language server into
32+
[Visual Studio Code][], but also provides some Visual Studio Code specific
33+
features such as syntax highlighting.
3434

3535
## Use
3636

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"prettier": "^3.0.0",
2222
"react": "^18.0.0",
2323
"react-dom": "^18.0.0",
24-
"remark-cli": "^11.0.0",
25-
"remark-frontmatter": "^4.0.0",
26-
"remark-preset-wooorm": "^9.0.0",
24+
"remark-cli": "^12.0.0",
25+
"remark-frontmatter": "^5.0.0",
26+
"remark-preset-wooorm": "^10.0.0",
2727
"typescript": "^5.0.0",
2828
"xo": "^0.58.0"
2929
},

packages/language-server/README.md

+52-51
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ A [language server][lsp] for [MDX][].
1111

1212
## Contents
1313

14-
* [What is this?](#what-is-this)
15-
* [When should I use this?](#when-should-i-use-this)
16-
* [Install](#install)
17-
* [Use](#use)
18-
* [Language server features](#language-server-features)
19-
* [Initialize Options](#initialize-options)
20-
* [Configuration](#configuration)
21-
* [TypeScript](#typescript)
22-
* [Plugins](#plugins)
23-
* [Examples](#examples)
24-
* [Visual Studio Code](#visual-studio-code)
25-
* [Compatibility](#compatibility)
26-
* [Security](#security)
27-
* [Contribute](#contribute)
28-
* [Sponsor](#sponsor)
29-
* [Changelog](#changelog)
30-
* [License](#license)
14+
* [What is this?](#what-is-this)
15+
* [When should I use this?](#when-should-i-use-this)
16+
* [Install](#install)
17+
* [Use](#use)
18+
* [Language server features](#language-server-features)
19+
* [Initialize Options](#initialize-options)
20+
* [Configuration](#configuration)
21+
* [TypeScript](#typescript)
22+
* [Plugins](#plugins)
23+
* [Examples](#examples)
24+
* [Visual Studio Code](#visual-studio-code)
25+
* [Compatibility](#compatibility)
26+
* [Security](#security)
27+
* [Contribute](#contribute)
28+
* [Sponsor](#sponsor)
29+
* [Changelog](#changelog)
30+
* [License](#license)
3131

3232
## What is this?
3333

@@ -69,45 +69,46 @@ features specific to MDX.
6969

7070
MDX language server supports the following LSP initialization options:
7171

72-
* `typescript.enabled` (`boolean`, default: `false`) —
73-
If true, enable TypeScript.
74-
* `typescript.tsdk` (`string`, required) —
75-
The path from which to load TypeScript.
76-
* `locale` (`string`, optional) —
77-
The locale to use for TypeScript error messages.
72+
* `typescript.enabled` (`boolean`, default: `false`) —
73+
If true, enable TypeScript.
74+
* `typescript.tsdk` (`string`, required) —
75+
The path from which to load TypeScript.
76+
* `locale` (`string`, optional) —
77+
The locale to use for TypeScript error messages.
7878

7979
### Configuration
8080

8181
MDX language server supports the following LSP configuration options:
8282

83-
* `mdx.trace.server.verbosity` (`"off"` | `"messages"` | `"compact"` |
84-
`"verbose"`, default: `"off"`) —
85-
Trace MDX language server requests in the output console.
86-
* `mdx.trace.server.format` (`"text"` | `"json"`, default: `"text"`) —
87-
How to format traced MDX language server requests.
88-
* `mdx.validate.validateReferences` (`"ignore"` | `"hint"` | `"warning"` |
89-
`"error"`, default: `"warning"`) —
90-
Diagnostic level for invalid reference links, e.g. `[text][no-such-ref]`.
91-
* `mdx.validate.validateFragmentLinks` (`"ignore"` | `"hint"` | `"warning"` |
92-
`"error"`, default: `"warning"`) —
93-
Diagnostic level for fragments links to headers in the current file that
94-
don’t exist, e.g. `[text](#no-such-header)`
95-
* `mdx.validate.validateFileLinks` (`"ignore"` | `"hint"` | `"warning"` |
96-
`"error"`, default: `"warning"`) —
97-
Diagnostic level for links to local files that don’t exist, e.g.
98-
`[text](./no-such-file.png)`.
99-
* `mdx.validate.validateMarkdownFileLinkFragments` (`"ignore"` | `"hint"` |
100-
`"warning"` | `"error"`, default: `"warning"`) —
101-
Diagnostic level for the fragment part of links to other local markdown
102-
files , e.g. `[text](./no-such-file.png)`.
103-
* `mdx.validate.validateUnusedLinkDefinitions` (`"ignore"` | `"hint"` |
104-
`"warning"` | `"error"`, default: `"warning"`) —
105-
Diagnostic level for link definitions that aren’t used anywhere.
106-
`[never-used]: http://example.com`.
107-
* `mdx.validate.validateDuplicateLinkDefinitions` (`"ignore"` | `"hint"` | `"warning"` | `"error"`, default: `"warning"`) —
108-
Diagnostic level for duplicate link definitions.
109-
* `mdx.validate.ignoreLinks` (`Array<string>`, optional) —
110-
Glob of links that should not be validated.
83+
* `mdx.trace.server.verbosity` (`"off"` | `"messages"` | `"compact"` |
84+
`"verbose"`, default: `"off"`) —
85+
Trace MDX language server requests in the output console.
86+
* `mdx.trace.server.format` (`"text"` | `"json"`, default: `"text"`) —
87+
How to format traced MDX language server requests.
88+
* `mdx.validate.validateReferences` (`"ignore"` | `"hint"` | `"warning"` |
89+
`"error"`, default: `"warning"`) —
90+
Diagnostic level for invalid reference links, e.g. `[text][no-such-ref]`.
91+
* `mdx.validate.validateFragmentLinks` (`"ignore"` | `"hint"` | `"warning"` |
92+
`"error"`, default: `"warning"`) —
93+
Diagnostic level for fragments links to headers in the current file that don’t
94+
exist, e.g. `[text](#no-such-header)`
95+
* `mdx.validate.validateFileLinks` (`"ignore"` | `"hint"` | `"warning"` |
96+
`"error"`, default: `"warning"`) —
97+
Diagnostic level for links to local files that don’t exist, e.g.
98+
`[text](./no-such-file.png)`.
99+
* `mdx.validate.validateMarkdownFileLinkFragments` (`"ignore"` | `"hint"` |
100+
`"warning"` | `"error"`, default: `"warning"`) —
101+
Diagnostic level for the fragment part of links to other local markdown files,
102+
e.g. `[text](./no-such-file.png)`.
103+
* `mdx.validate.validateUnusedLinkDefinitions` (`"ignore"` | `"hint"` |
104+
`"warning"` | `"error"`, default: `"warning"`) —
105+
Diagnostic level for link definitions that aren’t used anywhere.
106+
`[never-used]: http://example.com`.
107+
* `mdx.validate.validateDuplicateLinkDefinitions` (`"ignore"` | `"hint"` |
108+
`"warning"` | `"error"`, default: `"warning"`) —
109+
Diagnostic level for duplicate link definitions.
110+
* `mdx.validate.ignoreLinks` (`Array<string>`, optional) —
111+
Glob of links that should not be validated.
111112

112113
### TypeScript
113114

packages/language-server/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import assert from 'node:assert'
1010
import path from 'node:path'
1111
import process from 'node:process'
12+
import {pathToFileURL} from 'node:url'
1213
import {
1314
createMdxLanguagePlugin,
1415
createMdxServicePlugin,
@@ -113,7 +114,7 @@ connection.onInitialize((parameters) => {
113114
commandLine.raw?.mdx,
114115
(name) =>
115116
/** @type {Promise<Plugin>} */ (
116-
loadPlugin(name, {prefix: 'remark', cwd})
117+
loadPlugin(name, {prefix: 'remark', from: pathToFileURL(cwd)})
117118
)
118119
)
119120
checkMdx = Boolean(commandLine.raw?.mdx?.checkMdx)

packages/language-server/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"dependencies": {
3535
"@mdx-js/language-service": "0.5.4",
3636
"@volar/language-server": "~2.1.0",
37-
"load-plugin": "^5.0.0",
37+
"load-plugin": "^6.0.0",
3838
"remark-frontmatter": "^5.0.0",
3939
"remark-gfm": "^4.0.0",
4040
"volar-service-markdown": "0.0.34",

packages/language-service/README.md

+31-31
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212

1313
## Contents
1414

15-
* [What is this?](#what-is-this)
16-
* [When should I use this?](#when-should-i-use-this)
17-
* [Install](#install)
18-
* [Use](#use)
19-
* [API](#api)
20-
* [`createMdxLanguagePlugin([plugins][, checkMdx][, jsxImportSource])`](#createmdxlanguagepluginplugins-checkmdx-jsximportsource)
21-
* [`createMdxServicePlugin()`](#createmdxserviceplugin)
22-
* [`resolveRemarkPlugins(mdxConfig, resolvePlugin)`](#resolveremarkpluginsmdxconfig-resolveplugin)
23-
* [Compatibility](#compatibility)
24-
* [Types](#types)
25-
* [Security](#security)
26-
* [Contribute](#contribute)
27-
* [Sponsor](#sponsor)
28-
* [Changelog](#changelog)
29-
* [License](#license)
15+
* [What is this?](#what-is-this)
16+
* [When should I use this?](#when-should-i-use-this)
17+
* [Install](#install)
18+
* [Use](#use)
19+
* [API](#api)
20+
* [`createMdxLanguagePlugin([plugins][, checkMdx][, jsxImportSource])`](#createmdxlanguagepluginplugins-checkmdx-jsximportsource)
21+
* [`createMdxServicePlugin()`](#createmdxserviceplugin)
22+
* [`resolveRemarkPlugins(mdxConfig, resolvePlugin)`](#resolveremarkpluginsmdxconfig-resolveplugin)
23+
* [Compatibility](#compatibility)
24+
* [Types](#types)
25+
* [Security](#security)
26+
* [Contribute](#contribute)
27+
* [Sponsor](#sponsor)
28+
* [Changelog](#changelog)
29+
* [License](#license)
3030

3131
## What is this?
3232

@@ -90,14 +90,14 @@ Create a [Volar][] language plugin to support [MDX][].
9090

9191
#### Parameters
9292

93-
* `plugins` ([`PluggableList`][pluggablelist], optional) —
94-
A list of remark syntax plugins.
95-
Only syntax plugins are supported.
96-
Transformers are unused.
97-
* `checkMdx` (`boolean`, default: `false`) —
98-
If true, check MDX files strictly.
99-
* `jsxImportSource` (`string`, default: `react`) —
100-
The JSX import source to use in the embedded JavaScript file.
93+
* `plugins` ([`PluggableList`][pluggablelist], optional) —
94+
A list of remark syntax plugins.
95+
Only syntax plugins are supported.
96+
Transformers are unused.
97+
* `checkMdx` (`boolean`, default: `false`) —
98+
If true, check MDX files strictly.
99+
* `jsxImportSource` (`string`, default: `react`) —
100+
The JSX import source to use in the embedded JavaScript file.
101101

102102
#### Returns
103103

@@ -108,10 +108,10 @@ A Volar language plugin to support MDX.
108108
Create a [Volar][] service module to support [MDX][].
109109
The service supports:
110110

111-
* Reporting diagnostics for parsing errors.
112-
* Document drop support for images.
113-
* Custom commands for toggling `delete`, `emphasis`, `inlineCode`, and
114-
`strong` text.
111+
* Reporting diagnostics for parsing errors.
112+
* Document drop support for images.
113+
* Custom commands for toggling `delete`, `emphasis`, `inlineCode`, and `strong`
114+
text.
115115

116116
#### Parameters
117117

@@ -127,10 +127,10 @@ Resolve remark plugins from TypeScript’s parsed command line options.
127127

128128
#### Parameters
129129

130-
* `mdxConfig` (`unknown`) —
131-
The parsed command line options from which to resolve plugins.
132-
* `resolvePlugin` (`Function`) —
133-
A function which takes a plugin name, and resolvs it to a remark plugin.
130+
* `mdxConfig` (`unknown`) —
131+
The parsed command line options from which to resolve plugins.
132+
* `resolvePlugin` (`Function`) —
133+
A function which takes a plugin name, and resolvs it to a remark plugin.
134134

135135
#### Returns
136136

packages/typescript-plugin/index.cjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* @typedef {import('unified', {with: {'resolution-mode': 'import'}}).Plugin} Plugin
66
*/
77

8+
const {pathToFileURL} = require('node:url')
89
const {
910
createAsyncLanguageServicePlugin
1011
} = require('@volar/typescript/lib/quickstart/createAsyncLanguageServicePlugin.js')
@@ -51,7 +52,7 @@ const plugin = createAsyncLanguageServicePlugin(
5152
commandLine.raw?.mdx,
5253
(name) =>
5354
/** @type {Promise<Plugin>} */ (
54-
loadPlugin(name, {prefix: 'remark', cwd})
55+
loadPlugin(name, {prefix: 'remark', from: pathToFileURL(cwd)})
5556
)
5657
)
5758

0 commit comments

Comments
 (0)