mirror of
https://github.com/mdx-js/mdx.git
synced 2024-09-11 15:05:32 +03:00
Use symlinked monorepo packages again (#1673)
This commit is contained in:
parent
2bb13da51b
commit
6029a14f24
@ -4,7 +4,7 @@ import {VFile} from 'vfile'
|
||||
import {VFileMessage} from 'vfile-message'
|
||||
import {statistics} from 'vfile-statistics'
|
||||
import {reporter} from 'vfile-reporter'
|
||||
import {evaluate} from 'xdm'
|
||||
import {evaluate} from '@mdx-js/mdx'
|
||||
import CodeMirror from 'rodemirror'
|
||||
import {basicSetup} from '@codemirror/basic-setup'
|
||||
import {markdown as langMarkdown} from '@codemirror/lang-markdown'
|
||||
|
97
package-lock.json
generated
97
package-lock.json
generated
@ -6844,6 +6844,7 @@
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.1.tgz",
|
||||
"integrity": "sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"estree-walker": "^2.0.1",
|
||||
"picomatch": "^2.2.2"
|
||||
@ -6855,7 +6856,8 @@
|
||||
"node_modules/@rollup/pluginutils/node_modules/estree-walker": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@sideway/address": {
|
||||
"version": "4.1.2",
|
||||
@ -9636,6 +9638,7 @@
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
|
||||
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"file-uri-to-path": "1.0.0"
|
||||
@ -12261,6 +12264,7 @@
|
||||
"version": "0.1.23",
|
||||
"resolved": "https://registry.npmjs.org/deasync/-/deasync-0.1.23.tgz",
|
||||
"integrity": "sha512-CGZSokFwidI50GOAmkz/7z3QdMzTQqAiUOzt95PuhKgi6VVztn9D03ZCzzi93uUWlp/v6A9osvNWpIvqHvKjTA==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
@ -12275,6 +12279,7 @@
|
||||
"version": "1.7.2",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz",
|
||||
"integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/debug": {
|
||||
@ -15231,6 +15236,7 @@
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/file-url": {
|
||||
@ -24792,9 +24798,9 @@
|
||||
"integrity": "sha1-n7CwmbzSoCGUDmA8ZCVNwAPZp6g="
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.4.tgz",
|
||||
"integrity": "sha512-aD1fO+xtLiSCc9vuD+sYMxpIuQyhHscGSkBEo2o5LTV/3bTEAYvdUii29n8LlO5uLCmWdGP7uVUVXFo5SRdkLA==",
|
||||
"version": "2.6.5",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
|
||||
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
@ -39419,6 +39425,7 @@
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/xdm/-/xdm-2.0.4.tgz",
|
||||
"integrity": "sha512-lV45TIx4I3VHzC1SFFolSxxJI54QnmZX5F+YQcBfRu40Fyybktq5ujIbGC6S+lsCnO2teMhVn7ZdEYRoy6bYwA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@rollup/pluginutils": "^4.0.0",
|
||||
"@types/estree-jsx": "^0.0.1",
|
||||
@ -39691,8 +39698,8 @@
|
||||
"version": "2.0.0-next.9",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"loader-utils": "^2.0.0",
|
||||
"xdm": "^2.0.0"
|
||||
"@mdx-js/mdx": "^2.0.0-next.9",
|
||||
"loader-utils": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/loader-utils": "^2.0.0",
|
||||
@ -39792,7 +39799,7 @@
|
||||
},
|
||||
"packages/mdx": {
|
||||
"name": "@mdx-js/mdx",
|
||||
"version": "2.0.0-next.999",
|
||||
"version": "2.0.0-next.9",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/estree-jsx": "^0.0.1",
|
||||
@ -39802,9 +39809,8 @@
|
||||
"estree-walker": "^3.0.0",
|
||||
"hast-util-to-estree": "^2.0.0",
|
||||
"markdown-extensions": "^1.0.0",
|
||||
"mdast-util-mdx": "^1.0.0",
|
||||
"micromark-extension-mdxjs": "^1.0.0",
|
||||
"periscopic": "^3.0.0",
|
||||
"remark-mdx": "^2.0.0-next.9",
|
||||
"remark-parse": "^10.0.0",
|
||||
"remark-rehype": "^9.0.0",
|
||||
"source-map": "^0.7.0",
|
||||
@ -39815,7 +39821,7 @@
|
||||
"vfile": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mdx-js/react": "2.0.0-next.8",
|
||||
"@mdx-js/react": "2.0.0-next.9",
|
||||
"react": "^17.0.0",
|
||||
"react-dom": "^17.0.0",
|
||||
"rehype-katex": "^6.0.0",
|
||||
@ -39829,19 +39835,6 @@
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"packages/mdx/node_modules/@mdx-js/react": {
|
||||
"version": "2.0.0-next.8",
|
||||
"resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-2.0.0-next.8.tgz",
|
||||
"integrity": "sha512-I/ped8Wb1L4sUlumQmUlYQsH0tjd2Zj2eyCWbqgigpg+rtRlNFO9swkeyr0GY9hNZnwI8QOnJtNe+UdIZim8LQ==",
|
||||
"dev": true,
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.13.1"
|
||||
}
|
||||
},
|
||||
"packages/mdx/node_modules/react": {
|
||||
"version": "17.0.2",
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz",
|
||||
@ -39874,9 +39867,9 @@
|
||||
"version": "2.0.0-next.9",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@mdx-js/mdx": "^2.0.0-next.9",
|
||||
"preact": "^10.0.0",
|
||||
"preact-render-to-string": "^5.0.0",
|
||||
"xdm": "^2.0.0"
|
||||
"preact-render-to-string": "^5.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
@ -39888,17 +39881,17 @@
|
||||
},
|
||||
"packages/react": {
|
||||
"name": "@mdx-js/react",
|
||||
"version": "2.0.0-next.999",
|
||||
"version": "2.0.0-next.9",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/react": ">=16"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mdx-js/mdx": "^2.0.0-next.9",
|
||||
"@types/react": "^17.0.0",
|
||||
"@types/react-dom": "^17.0.0",
|
||||
"react": "^17.0.0",
|
||||
"react-dom": "^17.0.0",
|
||||
"xdm": "^2.0.0"
|
||||
"react-dom": "^17.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
@ -39936,7 +39929,7 @@
|
||||
}
|
||||
},
|
||||
"packages/remark-mdx": {
|
||||
"version": "2.0.0-next.999",
|
||||
"version": "2.0.0-next.9",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mdast-util-mdx": "^1.0.0",
|
||||
@ -39976,11 +39969,11 @@
|
||||
"version": "2.0.0-next.9",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@mdx-js/mdx": "^2.0.0-next.9",
|
||||
"@types/babel__core": "^7.0.0",
|
||||
"@vue/babel-plugin-jsx": "^1.0.0",
|
||||
"@vue/server-renderer": "^3.0.0",
|
||||
"vue": "^3.0.0",
|
||||
"xdm": "^2.0.0"
|
||||
"vue": "^3.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
@ -42095,6 +42088,7 @@
|
||||
"@mdx-js/loader": {
|
||||
"version": "file:packages/loader",
|
||||
"requires": {
|
||||
"@mdx-js/mdx": "^2.0.0-next.9",
|
||||
"@types/loader-utils": "^2.0.0",
|
||||
"@types/react": "^17.0.0",
|
||||
"@types/react-dom": "^17.0.0",
|
||||
@ -42107,8 +42101,7 @@
|
||||
"react": "^17.0.0",
|
||||
"react-dom": "^17.0.0",
|
||||
"vue": "^3.0.0",
|
||||
"webpack": "^5.0.0",
|
||||
"xdm": "^2.0.0"
|
||||
"webpack": "^5.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": {
|
||||
@ -42169,7 +42162,7 @@
|
||||
"@mdx-js/mdx": {
|
||||
"version": "file:packages/mdx",
|
||||
"requires": {
|
||||
"@mdx-js/react": "2.0.0-next.8",
|
||||
"@mdx-js/react": "2.0.0-next.9",
|
||||
"@types/estree-jsx": "^0.0.1",
|
||||
"astring": "^1.6.0",
|
||||
"estree-util-build-jsx": "^2.0.0",
|
||||
@ -42177,8 +42170,6 @@
|
||||
"estree-walker": "^3.0.0",
|
||||
"hast-util-to-estree": "^2.0.0",
|
||||
"markdown-extensions": "^1.0.0",
|
||||
"mdast-util-mdx": "^1.0.0",
|
||||
"micromark-extension-mdxjs": "^1.0.0",
|
||||
"periscopic": "^3.0.0",
|
||||
"react": "^17.0.0",
|
||||
"react-dom": "^17.0.0",
|
||||
@ -42186,6 +42177,7 @@
|
||||
"remark-footnotes": "^4.0.0",
|
||||
"remark-gfm": "^2.0.0",
|
||||
"remark-math": "^5.0.0",
|
||||
"remark-mdx": "^2.0.0-next.9",
|
||||
"remark-parse": "^10.0.0",
|
||||
"remark-rehype": "^9.0.0",
|
||||
"source-map": "^0.7.0",
|
||||
@ -42197,12 +42189,6 @@
|
||||
"vfile": "^5.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@mdx-js/react": {
|
||||
"version": "2.0.0-next.8",
|
||||
"resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-2.0.0-next.8.tgz",
|
||||
"integrity": "sha512-I/ped8Wb1L4sUlumQmUlYQsH0tjd2Zj2eyCWbqgigpg+rtRlNFO9swkeyr0GY9hNZnwI8QOnJtNe+UdIZim8LQ==",
|
||||
"dev": true
|
||||
},
|
||||
"react": {
|
||||
"version": "17.0.2",
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz",
|
||||
@ -42229,19 +42215,19 @@
|
||||
"@mdx-js/preact": {
|
||||
"version": "file:packages/preact",
|
||||
"requires": {
|
||||
"@mdx-js/mdx": "^2.0.0-next.9",
|
||||
"preact": "^10.0.0",
|
||||
"preact-render-to-string": "^5.0.0",
|
||||
"xdm": "^2.0.0"
|
||||
"preact-render-to-string": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"@mdx-js/react": {
|
||||
"version": "file:packages/react",
|
||||
"requires": {
|
||||
"@mdx-js/mdx": "^2.0.0-next.9",
|
||||
"@types/react": "^17.0.0",
|
||||
"@types/react-dom": "^17.0.0",
|
||||
"react": "^17.0.0",
|
||||
"react-dom": "^17.0.0",
|
||||
"xdm": "^2.0.0"
|
||||
"react-dom": "^17.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": {
|
||||
@ -42466,11 +42452,11 @@
|
||||
"@mdx-js/vue": {
|
||||
"version": "file:packages/vue",
|
||||
"requires": {
|
||||
"@mdx-js/mdx": "^2.0.0-next.9",
|
||||
"@types/babel__core": "^7.0.0",
|
||||
"@vue/babel-plugin-jsx": "^1.0.0",
|
||||
"@vue/server-renderer": "^3.0.0",
|
||||
"vue": "^3.0.0",
|
||||
"xdm": "^2.0.0"
|
||||
"vue": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"@microsoft/fetch-event-source": {
|
||||
@ -43918,6 +43904,7 @@
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.1.tgz",
|
||||
"integrity": "sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"estree-walker": "^2.0.1",
|
||||
"picomatch": "^2.2.2"
|
||||
@ -43926,7 +43913,8 @@
|
||||
"estree-walker": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -46222,6 +46210,7 @@
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
|
||||
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"file-uri-to-path": "1.0.0"
|
||||
@ -48333,6 +48322,7 @@
|
||||
"version": "0.1.23",
|
||||
"resolved": "https://registry.npmjs.org/deasync/-/deasync-0.1.23.tgz",
|
||||
"integrity": "sha512-CGZSokFwidI50GOAmkz/7z3QdMzTQqAiUOzt95PuhKgi6VVztn9D03ZCzzi93uUWlp/v6A9osvNWpIvqHvKjTA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"bindings": "^1.5.0",
|
||||
@ -48343,6 +48333,7 @@
|
||||
"version": "1.7.2",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz",
|
||||
"integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
@ -50594,6 +50585,7 @@
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"file-url": {
|
||||
@ -58095,9 +58087,9 @@
|
||||
"integrity": "sha1-n7CwmbzSoCGUDmA8ZCVNwAPZp6g="
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.4.tgz",
|
||||
"integrity": "sha512-aD1fO+xtLiSCc9vuD+sYMxpIuQyhHscGSkBEo2o5LTV/3bTEAYvdUii29n8LlO5uLCmWdGP7uVUVXFo5SRdkLA==",
|
||||
"version": "2.6.5",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
|
||||
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
|
||||
"requires": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
}
|
||||
@ -70065,6 +70057,7 @@
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/xdm/-/xdm-2.0.4.tgz",
|
||||
"integrity": "sha512-lV45TIx4I3VHzC1SFFolSxxJI54QnmZX5F+YQcBfRu40Fyybktq5ujIbGC6S+lsCnO2teMhVn7ZdEYRoy6bYwA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@rollup/pluginutils": "^4.0.0",
|
||||
"@types/estree-jsx": "^0.0.1",
|
||||
|
@ -41,7 +41,7 @@
|
||||
"lint": "eslint --ext .jsx --report-unused-disable-directives --cache .",
|
||||
"publish-ci": "# lerna publish -y --canary --preid ci --pre-dist-tag ci",
|
||||
"publish-next": "# lerna publish --force-publish=\"*\" --pre-dist-tag next --preid next",
|
||||
"build": "npm run build --workspaces -w packages/loader -w packages/mdx -w packages/preact -w packages/react -w packages/remark-mdx -w packages/vue --if-present",
|
||||
"build": "npm run build --workspaces -w packages/remark-mdx -w packages/mdx -w packages/react -w packages/preact -w packages/vue -w packages/loader --if-present",
|
||||
"test-api": "npm run test-api --workspaces --if-present",
|
||||
"test-coverage": "npm run test-coverage --workspaces --if-present",
|
||||
"test": "npm run build && npm run lint && npm run test-coverage"
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import {getOptions} from 'loader-utils'
|
||||
import {compile} from 'xdm/lib/compile.js'
|
||||
import {compile} from '@mdx-js/mdx'
|
||||
|
||||
/**
|
||||
* A Webpack (4+) loader for MDX.
|
||||
|
@ -43,7 +43,7 @@
|
||||
"index.cjs"
|
||||
],
|
||||
"dependencies": {
|
||||
"xdm": "^2.0.0",
|
||||
"@mdx-js/mdx": "^2.0.0-next.9",
|
||||
"loader-utils": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
import {unified} from 'unified'
|
||||
import remarkMdx from 'remark-mdx'
|
||||
import remarkParse from 'remark-parse'
|
||||
import remarkRehype from 'remark-rehype'
|
||||
import {recmaJsxBuild} from './plugin/recma-jsx-build.js'
|
||||
@ -29,7 +30,6 @@ import {recmaStringify} from './plugin/recma-stringify.js'
|
||||
import {rehypeRecma} from './plugin/rehype-recma.js'
|
||||
import {rehypeRemoveRaw} from './plugin/rehype-remove-raw.js'
|
||||
import {remarkMarkAndUnravel} from './plugin/remark-mark-and-unravel.js'
|
||||
import {remarkMdx} from './plugin/remark-mdx.js'
|
||||
import {nodeTypes} from './node-types.js'
|
||||
|
||||
/**
|
||||
|
@ -121,7 +121,7 @@ export function recmaJsxRewrite(options = {}) {
|
||||
}
|
||||
// @ts-expect-error Allow fields passed through from mdast through hast to
|
||||
// esast.
|
||||
else if (node.data && node.data._xdmExplicitJsx) {
|
||||
else if (node.data && node.data._mdxExplicitJsx) {
|
||||
// Do not turn explicit JSX into components from `_components`.
|
||||
// As in, a given `h1` component is used for `# heading` (next case),
|
||||
// but not for `<h1>heading</h1>`.
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @typedef {Root|Content} Node
|
||||
* @typedef {Extract<Node, import('unist').Parent>} Parent
|
||||
*
|
||||
* @typedef {import('./remark-mdx.js')} DoNotTouchAsThisImportIncludesMdxInTree
|
||||
* @typedef {import('remark-mdx')} DoNotTouchAsThisImportItIncludesMdxInTree
|
||||
*/
|
||||
|
||||
import {visit} from 'unist-util-visit'
|
||||
@ -75,7 +75,7 @@ export function remarkMarkAndUnravel() {
|
||||
node.type === 'mdxJsxTextElement'
|
||||
) {
|
||||
const data = node.data || (node.data = {})
|
||||
data._xdmExplicitJsx = true
|
||||
data._mdxExplicitJsx = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -1,36 +0,0 @@
|
||||
/**
|
||||
* @typedef {import('mdast').Root} Root
|
||||
* @typedef {import('micromark-extension-mdxjs').Options} Options
|
||||
*
|
||||
* @typedef {import('mdast-util-mdx')} DoNotTouchAsThisImportIncludesMdxInTree
|
||||
*/
|
||||
|
||||
import {mdxjs} from 'micromark-extension-mdxjs'
|
||||
import {mdxFromMarkdown, mdxToMarkdown} from 'mdast-util-mdx'
|
||||
|
||||
/**
|
||||
* Add the micromark and mdast extensions for MDX.js (JS aware MDX).
|
||||
*
|
||||
* @type {import('unified').Plugin<[Options?]|[], Root>}
|
||||
*/
|
||||
export function remarkMdx(options = {}) {
|
||||
const data = this.data()
|
||||
|
||||
add('micromarkExtensions', mdxjs(options))
|
||||
add('fromMarkdownExtensions', mdxFromMarkdown)
|
||||
add('toMarkdownExtensions', mdxToMarkdown)
|
||||
|
||||
/**
|
||||
* @param {string} field
|
||||
* @param {unknown} value
|
||||
*/
|
||||
function add(field, value) {
|
||||
const list = /** @type {unknown[]} */ (
|
||||
// Other extensions
|
||||
/* c8 ignore next 2 */
|
||||
data[field] ? data[field] : (data[field] = [])
|
||||
)
|
||||
|
||||
list.push(value)
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "@mdx-js/mdx",
|
||||
"#": "to do: this prevents for a second that siblings use this",
|
||||
"version": "2.0.0-next.999",
|
||||
"version": "2.0.0-next.9",
|
||||
"description": "Compile MDX",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
@ -48,9 +47,8 @@
|
||||
"estree-walker": "^3.0.0",
|
||||
"hast-util-to-estree": "^2.0.0",
|
||||
"markdown-extensions": "^1.0.0",
|
||||
"mdast-util-mdx": "^1.0.0",
|
||||
"micromark-extension-mdxjs": "^1.0.0",
|
||||
"periscopic": "^3.0.0",
|
||||
"remark-mdx": "^2.0.0-next.9",
|
||||
"remark-parse": "^10.0.0",
|
||||
"remark-rehype": "^9.0.0",
|
||||
"source-map": "^0.7.0",
|
||||
@ -61,7 +59,7 @@
|
||||
"vfile": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mdx-js/react": "2.0.0-next.8",
|
||||
"@mdx-js/react": "2.0.0-next.9",
|
||||
"react": "^17.0.0",
|
||||
"react-dom": "^17.0.0",
|
||||
"rehype-katex": "^6.0.0",
|
||||
|
@ -3,18 +3,16 @@ import * as assert from 'uvu/assert'
|
||||
import {removePosition} from 'unist-util-remove-position'
|
||||
import React from 'react'
|
||||
import * as runtime from 'react/jsx-runtime.js'
|
||||
import {renderToStaticMarkup} from 'react-dom/server.js'
|
||||
// `eslint-plugin-import` is wrong.
|
||||
/* eslint-disable-next-line import/default */
|
||||
import mdxReact from '@mdx-js/react'
|
||||
// Note: this is needed because the root react is an experimental version,
|
||||
// for the website, but the React here and in `@mdx-js/react` is a stable one.
|
||||
import {renderToStaticMarkup} from '../../react/node_modules/react-dom/server.js'
|
||||
import {MDXProvider, useMDXComponents} from '../../react/index.js'
|
||||
import footnotes from 'remark-footnotes'
|
||||
import gfm from 'remark-gfm'
|
||||
import math from 'remark-math'
|
||||
import katex from 'rehype-katex'
|
||||
import {compile, compileSync, evaluate, createProcessor} from '../index.js'
|
||||
|
||||
const {MDXProvider, useMDXComponents} = mdxReact
|
||||
|
||||
test('should generate JSX', async () => {
|
||||
const result = await compile('Hello World', {jsx: true})
|
||||
|
||||
|
@ -47,9 +47,9 @@
|
||||
"preact": ">=10.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mdx-js/mdx": "^2.0.0-next.9",
|
||||
"preact": "^10.0.0",
|
||||
"preact-render-to-string": "^5.0.0",
|
||||
"xdm": "^2.0.0"
|
||||
"preact-render-to-string": "^5.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"prepack": "npm run build",
|
||||
|
@ -5,7 +5,7 @@ import * as assert from 'uvu/assert'
|
||||
import {h, Fragment} from 'preact'
|
||||
import * as runtime from 'preact/jsx-runtime'
|
||||
import {render} from 'preact-render-to-string'
|
||||
import {evaluate} from 'xdm'
|
||||
import {evaluate} from '@mdx-js/mdx'
|
||||
import {MDXProvider, useMDXComponents, withMDXComponents} from '../index.js'
|
||||
|
||||
test('should support `components` with `MDXProvider`', async () => {
|
||||
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "@mdx-js/react",
|
||||
"#": "to do: this prevents for a second that siblings use this",
|
||||
"version": "2.0.0-next.999",
|
||||
"version": "2.0.0-next.9",
|
||||
"description": "React context for MDX",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
@ -49,11 +48,11 @@
|
||||
"react": ">=16"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mdx-js/mdx": "^2.0.0-next.9",
|
||||
"@types/react": "^17.0.0",
|
||||
"@types/react-dom": "^17.0.0",
|
||||
"react": "^17.0.0",
|
||||
"react-dom": "^17.0.0",
|
||||
"xdm": "^2.0.0"
|
||||
"react-dom": "^17.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"prepack": "npm run build",
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {test} from 'uvu'
|
||||
import * as assert from 'uvu/assert'
|
||||
import {evaluate} from 'xdm'
|
||||
import {evaluate} from '@mdx-js/mdx'
|
||||
import React from 'react'
|
||||
import * as runtime from 'react/jsx-runtime.js'
|
||||
import {renderToString} from 'react-dom/server.js'
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @typedef {import('mdast').Root} Root
|
||||
* @typedef {import('micromark-extension-mdxjs').Options} Options
|
||||
* @typedef {import('mdast-util-mdx')} DoNotTouchAsThisImportIncludesMdxInTree
|
||||
* @typedef {import('mdast-util-mdx')} DoNotTouchAsThisImportItIncludesMdxInTree
|
||||
*/
|
||||
|
||||
import {mdxjs} from 'micromark-extension-mdxjs'
|
||||
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "remark-mdx",
|
||||
"#": "to do: this prevents for a second that siblings use this",
|
||||
"version": "2.0.0-next.999",
|
||||
"version": "2.0.0-next.9",
|
||||
"description": "remark plugin to support MDX syntax",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
@ -42,11 +42,11 @@
|
||||
"vue": ">=3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mdx-js/mdx": "^2.0.0-next.9",
|
||||
"@types/babel__core": "^7.0.0",
|
||||
"@vue/babel-plugin-jsx": "^1.0.0",
|
||||
"@vue/server-renderer": "^3.0.0",
|
||||
"vue": "^3.0.0",
|
||||
"xdm": "^2.0.0"
|
||||
"vue": "^3.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"prepack": "npm run build",
|
||||
|
@ -7,8 +7,8 @@
|
||||
import {test} from 'uvu'
|
||||
import * as assert from 'uvu/assert'
|
||||
import * as babel from '@babel/core'
|
||||
import {compile} from 'xdm'
|
||||
import {run} from 'xdm/lib/run.js'
|
||||
import {compile} from '@mdx-js/mdx'
|
||||
import {run} from '@mdx-js/mdx/lib/run.js'
|
||||
import * as vue from 'vue'
|
||||
// eslint-disable-next-line import/default
|
||||
import serverRenderer from '@vue/server-renderer'
|
||||
|
@ -3,7 +3,7 @@ import url from 'url'
|
||||
import process from 'process'
|
||||
import webpack from 'webpack'
|
||||
import ReactServerWebpackPlugin from 'react-server-dom-webpack/plugin'
|
||||
import xdmConfig from './xdm-config.js'
|
||||
import mdxConfig from './mdx-config.js'
|
||||
import {config} from '../docs/_config.js'
|
||||
|
||||
const production = process.env.NODE_ENV === 'production'
|
||||
@ -28,7 +28,7 @@ webpack(
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{test: /\.mdx$/, use: {loader: 'xdm/webpack.cjs', options: xdmConfig}},
|
||||
{test: /\.mdx$/, use: {loader: '@mdx-js/loader', options: mdxConfig}},
|
||||
{test: /\.js$/, use: 'babel-loader', exclude: /node_modules/}
|
||||
]
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {createLoader} from 'xdm/esm-loader.js'
|
||||
import * as babel from '@node-loader/babel'
|
||||
import config from './xdm-config.js'
|
||||
import config from './mdx-config.js'
|
||||
|
||||
const loader = {loaders: [createLoader(config), babel]}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user