Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/legal-crews-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@mdx-js/typescript-plugin': minor
'@mdx-js/language-service': minor
'@mdx-js/language-server': minor
---

Remove support for Node.js 18
5 changes: 1 addition & 4 deletions packages/language-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,7 @@ Use [`unifiedjs.vscode-mdx`][vscode-mdx] to use the MDX language server with

## Compatibility

Projects maintained by the unified collective are compatible with all maintained
versions of Node.js.
As of now, that is Node.js and 16.0+.
Our projects sometimes work with older versions, but this is not guaranteed.
This project is compatible Node.js 20.19+.

This project uses [`vscode-languageserver`][vscode-languageserver] 9, which
implements language server protocol 3.17.4.
Expand Down
5 changes: 1 addition & 4 deletions packages/language-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,7 @@ configuration.

## Compatibility

Projects maintained by the unified collective are compatible with all maintained
versions of Node.js.
As of now, that is Node.js and 16.0+.
Our projects sometimes work with older versions, but this is not guaranteed.
This project is compatible Node.js 20.19+.

## Types

Expand Down
5 changes: 1 addition & 4 deletions packages/typescript-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ This is not intended for programmatic use.

## Compatibility

Projects maintained by the unified collective are compatible with all maintained
versions of Node.js.
As of now, that is Node.js and 16.0+.
Our projects sometimes work with older versions, but this is not guaranteed.
This project is compatible Node.js 20.19+.

## Security

Expand Down
21 changes: 8 additions & 13 deletions packages/typescript-plugin/lib/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,25 @@

/**
* @import {TsConfigSourceFile} from 'typescript'
* @import {Plugin} from 'unified' with {'resolution-mode': 'import'}
* @import {Plugin} from 'unified'
*/

const {pathToFileURL} = require('node:url')
const {
createMdxLanguagePlugin,
resolveRemarkPlugins
} = require('@mdx-js/language-service')
const {
createAsyncLanguageServicePlugin
} = require('@volar/typescript/lib/quickstart/createAsyncLanguageServicePlugin.js')
const {loadPlugin} = require('load-plugin')
const {default: remarkFrontmatter} = require('remark-frontmatter')
const {default: remarkGfm} = require('remark-gfm')

const plugin = createAsyncLanguageServicePlugin(
['.mdx'],
2 /* JSX */,
async (ts, info) => {
const [
{createMdxLanguagePlugin, resolveRemarkPlugins},
{loadPlugin},
{default: remarkFrontmatter},
{default: remarkGfm}
] = await Promise.all([
import('@mdx-js/language-service'),
import('load-plugin'),
import('remark-frontmatter'),
import('remark-gfm')
])

if (info.project.projectKind !== ts.server.ProjectKind.Configured) {
return {
languagePlugins: [
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"composite": true,
"declarationMap": true,
"lib": ["es2022"],
"module": "node16",
"module": "nodenext",
"moduleDetection": "force",
"strict": true,
"stripInternal": true,
Expand Down