Skip to content

Commit

Permalink
mdx3 compat, tooling updates
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Nov 24, 2023
1 parent 567dc17 commit 763c935
Show file tree
Hide file tree
Showing 5 changed files with 1,435 additions and 5,414 deletions.
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": "tsdx test",
"_lint": "tsdx lint",
"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

0 comments on commit 763c935

Please sign in to comment.