Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdx3 compat, tooling updates #14

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
- name: Begin CI...
uses: actions/checkout@v2

- name: Use Node 16
- name: Use Node 20
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: 20.x

- name: Use cached node_modules
uses: actions/cache@v2
Expand Down
35 changes: 21 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"version": "1.1.0",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"files": [
"dist",
"src"
Expand All @@ -11,16 +16,16 @@
"node": ">=10"
},
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test",
"lint": "tsdx lint",
"prepare": "tsdx build"
"start": "tsup --watch",
"build": "tsup",
"test": "true",
"lint": "true",
"prepare": "yarn build"
},
"peerDependencies": {
"typescript": ">=4.0"
"typescript": ">=5.0"
},
"husky": {
"_husky": {
"hooks": {
"pre-commit": "tsdx lint"
}
Expand All @@ -37,20 +42,22 @@
"devDependencies": {
"@types/prettier": "^2.1.0",
"@types/react": "^17.0.11",
"eslint-plugin-prettier": "3.1.4",
"husky": "^4.2.5",
"release-it": "^15.1.1",
"remark-mdx": "^1.6.16",
"remark-mdx": "^3.0.0",
"remark-parse": "^8.0.3",
"remark-stringify": "^8.1.1",
"tsdx": "^0.13.3",
"tslib": "^2.0.1",
"unified": "^9.2.0"
"tsup": "^8.0.1",
"typescript": "^5.3.2",
"unified": "^11.0.4"
},
"dependencies": {
"@microsoft/tsdoc": "^0.12.21",
"mdast-util-mdx-jsx": "^3.0.0",
"mdast-util-mdxjs-esm": "^2.0.1",
"prettier": "^2.1.1",
"unist-util-flatmap": "^1.0.0",
"unist-util-visit": "^2.0.3"
"unist-util-visit": "^5.0.0"
}
}
6 changes: 2 additions & 4 deletions src/linkDocblocks/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Extractor, ExtractorSettings } from './extract';
import { renderDocNode } from './utils';
import { URL } from 'url';
import type { Node, Parent } from 'unist';
import visit from 'unist-util-visit';
import { visit } from 'unist-util-visit';

import type { Plugin } from 'unified';
import type { DocNode } from '@microsoft/tsdoc';
Expand Down Expand Up @@ -118,9 +118,7 @@ export const attacher: Plugin<[Settings]> = function ({ extractorSettings }) {
return acc;
}, []);

visit<
Node & { value: string }
>({ type: 'fakeRoot', children: retVal }, 'code', (node) => {
visit({ type: 'fakeRoot', children: retVal }, 'code', (node: Node & { value: string }) => {
node.value = node.value.trimEnd();
});

Expand Down
Loading
Loading