From 1cb3b53455ca3f2bf8f25783e35281d2a2747c29 Mon Sep 17 00:00:00 2001 From: MuYunyun <328375795@qq.com> Date: Mon, 31 May 2021 02:15:09 +0800 Subject: [PATCH 1/9] chore: add scripts for install quickly --- package.json | 4 +- packages/scripts/package.json | 1 + utils/uppackage-dev.sh | 1 + utils/uppackage.sh | 1 + yarn.lock | 563 +++++++++++++++++++++++++++++++++- 5 files changed, 554 insertions(+), 16 deletions(-) create mode 100644 utils/uppackage-dev.sh create mode 100644 utils/uppackage.sh diff --git a/package.json b/package.json index 635056b68..964f6f77c 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,9 @@ "release": "lerna publish", "release-qa": "lerna publish --npm-tag=beta", "cleanup": "rm -rf node_modules/gh-pages/.cache", - "deploy:site": "npm run cleanup && node gh-pages" + "deploy:site": "npm run cleanup && node gh-pages", + "up:dev": "sh utils/uppackage-dev.sh", + "up": "sh utils/uppackage.sh" }, "repository": { "type": "git", diff --git a/packages/scripts/package.json b/packages/scripts/package.json index 99280b750..6c4b2e362 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -15,6 +15,7 @@ "@babel/preset-env": "^7.3.4", "@babel/preset-react": "^7.0.0", "@babel/runtime": "^7.3.4", + "@mdx-js/loader": "^1.6.22", "@nuxtjs/friendly-errors-webpack-plugin": "^2.0.2", "babel-eslint": "^8.0.1", "babel-loader": "^8.0.5", diff --git a/utils/uppackage-dev.sh b/utils/uppackage-dev.sh new file mode 100644 index 000000000..e7c1f6e7e --- /dev/null +++ b/utils/uppackage-dev.sh @@ -0,0 +1 @@ +lerna add $1 --scope=$2 --dev \ No newline at end of file diff --git a/utils/uppackage.sh b/utils/uppackage.sh new file mode 100644 index 000000000..ab5fa7ec3 --- /dev/null +++ b/utils/uppackage.sh @@ -0,0 +1 @@ +lerna add $1 --scope=$2 \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index c52d79aab..f1d3ca236 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,11 +33,40 @@ dependencies: "@babel/highlight" "^7.10.4" +"@babel/code-frame@^7.12.13": + version "7.12.13" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" + integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== + dependencies: + "@babel/highlight" "^7.12.13" + "@babel/compat-data@^7.12.1", "@babel/compat-data@^7.12.5": version "7.12.5" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.5.tgz#f56db0c4bb1bbbf221b4e81345aab4141e7cb0e9" integrity sha512-DTsS7cxrsH3by8nqQSpFSyjSfSYl57D6Cf4q8dW3LK83tBKBDCkfcay1nYkXq1nIHXnpX8WMMb/O25HOy3h1zg== +"@babel/core@7.12.9": + version "7.12.9" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.12.9.tgz#fd450c4ec10cdbb980e2928b7aa7a28484593fc8" + integrity sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.12.5" + "@babel/helper-module-transforms" "^7.12.1" + "@babel/helpers" "^7.12.5" + "@babel/parser" "^7.12.7" + "@babel/template" "^7.12.7" + "@babel/traverse" "^7.12.9" + "@babel/types" "^7.12.7" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.1" + json5 "^2.1.2" + lodash "^4.17.19" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + "@babel/core@^7.3.4": version "7.12.3" resolved "https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz#1b436884e1e3bff6fb1328dc02b208759de92ad8" @@ -80,6 +109,15 @@ jsesc "^2.5.1" source-map "^0.5.0" +"@babel/generator@^7.14.2": + version "7.14.3" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.14.3.tgz#0c2652d91f7bddab7cccc6ba8157e4f40dcedb91" + integrity sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA== + dependencies: + "@babel/types" "^7.14.2" + jsesc "^2.5.1" + source-map "^0.5.0" + "@babel/helper-annotate-as-pure@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz#5bf0d495a3f757ac3bda48b5bf3b3ba309c72ba3" @@ -176,6 +214,15 @@ "@babel/template" "^7.10.4" "@babel/types" "^7.10.4" +"@babel/helper-function-name@^7.14.2": + version "7.14.2" + resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz#397688b590760b6ef7725b5f0860c82427ebaac2" + integrity sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ== + dependencies: + "@babel/helper-get-function-arity" "^7.12.13" + "@babel/template" "^7.12.13" + "@babel/types" "^7.14.2" + "@babel/helper-get-function-arity@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz#d03ca6dd2b9f7b0b1e6b32c56c72836140db3a15" @@ -190,6 +237,13 @@ dependencies: "@babel/types" "^7.10.4" +"@babel/helper-get-function-arity@^7.12.13": + version "7.12.13" + resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" + integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== + dependencies: + "@babel/types" "^7.12.13" + "@babel/helper-hoist-variables@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz#d49b001d1d5a68ca5e6604dda01a6297f7c9381e" @@ -233,7 +287,7 @@ dependencies: "@babel/types" "^7.10.4" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": +"@babel/helper-plugin-utils@7.10.4", "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== @@ -292,11 +346,23 @@ dependencies: "@babel/types" "^7.11.0" +"@babel/helper-split-export-declaration@^7.12.13": + version "7.12.13" + resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" + integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== + dependencies: + "@babel/types" "^7.12.13" + "@babel/helper-validator-identifier@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== +"@babel/helper-validator-identifier@^7.14.0": + version "7.14.0" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" + integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== + "@babel/helper-validator-option@^7.12.1": version "7.12.1" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.1.tgz#175567380c3e77d60ff98a54bb015fe78f2178d9" @@ -321,6 +387,15 @@ "@babel/traverse" "^7.12.5" "@babel/types" "^7.12.5" +"@babel/helpers@^7.12.5": + version "7.14.0" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.0.tgz#ea9b6be9478a13d6f961dbb5f36bf75e2f3b8f62" + integrity sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg== + dependencies: + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.14.0" + "@babel/types" "^7.14.0" + "@babel/highlight@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5" @@ -339,11 +414,25 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.12.13": + version "7.14.0" + resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz#3197e375711ef6bf834e67d0daec88e4f46113cf" + integrity sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg== + dependencies: + "@babel/helper-validator-identifier" "^7.14.0" + chalk "^2.0.0" + js-tokens "^4.0.0" + "@babel/parser@^7.10.4", "@babel/parser@^7.12.3", "@babel/parser@^7.12.5": version "7.12.5" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz#b4af32ddd473c0bfa643bd7ff0728b8e71b81ea0" integrity sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ== +"@babel/parser@^7.12.13", "@babel/parser@^7.12.7", "@babel/parser@^7.14.2": + version "7.14.4" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz#a5c560d6db6cd8e6ed342368dea8039232cbab18" + integrity sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA== + "@babel/plugin-proposal-async-generator-functions@^7.12.1": version "7.12.1" resolved "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.12.1.tgz#dc6c1170e27d8aca99ff65f4925bd06b1c90550e" @@ -409,7 +498,7 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.12.1": +"@babel/plugin-proposal-object-rest-spread@7.12.1", "@babel/plugin-proposal-object-rest-spread@^7.12.1": version "7.12.1" resolved "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz#def9bd03cea0f9b72283dac0ec22d289c7691069" integrity sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA== @@ -486,7 +575,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.12.1": +"@babel/plugin-syntax-jsx@7.12.1", "@babel/plugin-syntax-jsx@^7.12.1": version "7.12.1" resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.1.tgz#9d9d357cc818aa7ae7935917c1257f67677a0926" integrity sha512-1yRi7yAtB0ETgxdY9ti/p2TivUxJkTdhu/ZbF9MshVGqOx1TdB3b7xCXs49Fupgg50N45KcAsRP/ZqWjs9SRjg== @@ -514,7 +603,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-object-rest-spread@^7.2.0", "@babel/plugin-syntax-object-rest-spread@^7.8.0": +"@babel/plugin-syntax-object-rest-spread@7.8.3", "@babel/plugin-syntax-object-rest-spread@^7.2.0", "@babel/plugin-syntax-object-rest-spread@^7.8.0": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== @@ -988,6 +1077,15 @@ "@babel/parser" "^7.10.4" "@babel/types" "^7.10.4" +"@babel/template@^7.12.13", "@babel/template@^7.12.7": + version "7.12.13" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" + integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/parser" "^7.12.13" + "@babel/types" "^7.12.13" + "@babel/traverse@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966" @@ -1019,6 +1117,20 @@ globals "^11.1.0" lodash "^4.17.19" +"@babel/traverse@^7.12.9", "@babel/traverse@^7.14.0": + version "7.14.2" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.2.tgz#9201a8d912723a831c2679c7ebbf2fe1416d765b" + integrity sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.14.2" + "@babel/helper-function-name" "^7.14.2" + "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/parser" "^7.14.2" + "@babel/types" "^7.14.2" + debug "^4.1.0" + globals "^11.1.0" + "@babel/types@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757" @@ -1037,6 +1149,14 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" +"@babel/types@^7.12.13", "@babel/types@^7.12.7", "@babel/types@^7.14.0", "@babel/types@^7.14.2": + version "7.14.4" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.14.4.tgz#bfd6980108168593b38b3eb48a24aa026b919bc0" + integrity sha512-lCj4aIs0xUefJFQnwwQv2Bxg7Omd6bgquZ6LGC+gGMh6/s5qDVfjuCMlDmYQ15SLsWHd9n+X3E75lKIhl5Lkiw== + dependencies: + "@babel/helper-validator-identifier" "^7.14.0" + to-fast-properties "^2.0.0" + "@eslint/eslintrc@^0.2.1": version "0.2.1" resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.1.tgz#f72069c330461a06684d119384435e12a5d76e3c" @@ -1835,6 +1955,50 @@ npmlog "^4.1.2" write-file-atomic "^2.3.0" +"@mdx-js/loader@^1.6.22": + version "1.6.22" + resolved "https://registry.npmjs.org/@mdx-js/loader/-/loader-1.6.22.tgz#d9e8fe7f8185ff13c9c8639c048b123e30d322c4" + integrity sha512-9CjGwy595NaxAYp0hF9B/A0lH6C8Rms97e2JS9d3jVUtILn6pT5i5IV965ra3lIWc7Rs1GG1tBdVF7dCowYe6Q== + dependencies: + "@mdx-js/mdx" "1.6.22" + "@mdx-js/react" "1.6.22" + loader-utils "2.0.0" + +"@mdx-js/mdx@1.6.22": + version "1.6.22" + resolved "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-1.6.22.tgz#8a723157bf90e78f17dc0f27995398e6c731f1ba" + integrity sha512-AMxuLxPz2j5/6TpF/XSdKpQP1NlG0z11dFOlq+2IP/lSgl11GY8ji6S/rgsViN/L0BDvHvUMruRb7ub+24LUYA== + dependencies: + "@babel/core" "7.12.9" + "@babel/plugin-syntax-jsx" "7.12.1" + "@babel/plugin-syntax-object-rest-spread" "7.8.3" + "@mdx-js/util" "1.6.22" + babel-plugin-apply-mdx-type-prop "1.6.22" + babel-plugin-extract-import-names "1.6.22" + camelcase-css "2.0.1" + detab "2.0.4" + hast-util-raw "6.0.1" + lodash.uniq "4.5.0" + mdast-util-to-hast "10.0.1" + remark-footnotes "2.0.0" + remark-mdx "1.6.22" + remark-parse "8.0.3" + remark-squeeze-paragraphs "4.0.0" + style-to-object "0.3.0" + unified "9.2.0" + unist-builder "2.0.3" + unist-util-visit "2.0.3" + +"@mdx-js/react@1.6.22": + version "1.6.22" + resolved "https://registry.npmjs.org/@mdx-js/react/-/react-1.6.22.tgz#ae09b4744fddc74714ee9f9d6f17a66e77c43573" + integrity sha512-TDoPum4SHdfPiGSAaRBw7ECyI8VaHpK8GJugbJIJuqyh6kzw9ZLJZW3HGL3NNrJGxcAixUvqROm+YuQOo5eXtg== + +"@mdx-js/util@1.6.22": + version "1.6.22" + resolved "https://registry.npmjs.org/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" + integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== + "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" @@ -2037,6 +2201,13 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/hast@^2.0.0": + version "2.3.1" + resolved "https://registry.npmjs.org/@types/hast/-/hast-2.3.1.tgz#b16872f2a6144c7025f296fb9636a667ebb79cd9" + integrity sha512-viwwrB+6xGzw+G1eWpF9geV3fnsDgXqHG+cqgiHrvQfDUW5hzhCyV7Sy3UJxhfRFBsgky2SSW33qi/YrIkjX5Q== + dependencies: + "@types/unist" "*" + "@types/html-minifier-terser@^5.0.0": version "5.1.1" resolved "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz#3c9ee980f1a10d6021ae6632ca3e79ca2ec4fb50" @@ -2052,6 +2223,13 @@ resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= +"@types/mdast@^3.0.0": + version "3.0.3" + resolved "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.3.tgz#2d7d671b1cd1ea3deb306ea75036c2a0407d2deb" + integrity sha512-SXPBMnFVQg1s00dlMCc/jCdvPqdE4mXaMMCeRlxLDmTAEoegHT53xKtkDnzDTOcmMHUfcjyf36/YYZ6SxRdnsw== + dependencies: + "@types/unist" "*" + "@types/minimatch@*": version "3.0.3" resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" @@ -2072,6 +2250,11 @@ resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== +"@types/parse5@^5.0.0": + version "5.0.3" + resolved "https://registry.npmjs.org/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109" + integrity sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw== + "@types/puppeteer@^2.0.0": version "2.1.5" resolved "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-2.1.5.tgz#9137aa87dca21450820bfd6fa4fe747bc8176381" @@ -2101,6 +2284,11 @@ dependencies: source-map "^0.6.1" +"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3": + version "2.0.3" + resolved "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" + integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ== + "@types/webpack-sources@*": version "2.1.0" resolved "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-2.1.0.tgz#8882b0bd62d1e0ce62f183d0d01b72e6e82e8c10" @@ -2775,6 +2963,14 @@ babel-loader@^8.0.5: pify "^4.0.1" schema-utils "^2.6.5" +babel-plugin-apply-mdx-type-prop@1.6.22: + version "1.6.22" + resolved "https://registry.npmjs.org/babel-plugin-apply-mdx-type-prop/-/babel-plugin-apply-mdx-type-prop-1.6.22.tgz#d216e8fd0de91de3f1478ef3231e05446bc8705b" + integrity sha512-VefL+8o+F/DfK24lPZMtJctrCVOfgbqLAGZSkxwhazQv4VxPg3Za/i40fu22KR2m8eEda+IfSOlPLUSIiLcnCQ== + dependencies: + "@babel/helper-plugin-utils" "7.10.4" + "@mdx-js/util" "1.6.22" + babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" resolved "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" @@ -2782,6 +2978,13 @@ babel-plugin-dynamic-import-node@^2.3.3: dependencies: object.assign "^4.1.0" +babel-plugin-extract-import-names@1.6.22: + version "1.6.22" + resolved "https://registry.npmjs.org/babel-plugin-extract-import-names/-/babel-plugin-extract-import-names-1.6.22.tgz#de5f9a28eb12f3eb2578bf74472204e66d1a13dc" + integrity sha512-yJ9BsJaISua7d8zNT7oRG1ZLBJCIdZ4PZqmH8qa9N5AK01ifk3fnkc98AXhtzE7UkfCsEumvoQWgoYLhOnJ7jQ== + dependencies: + "@babel/helper-plugin-utils" "7.10.4" + babylon@7.0.0-beta.44: version "7.0.0-beta.44" resolved "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz#89159e15e6e30c5096e22d738d8c0af8a0e8ca1d" @@ -3143,6 +3346,11 @@ camel-case@^4.1.1: pascal-case "^3.1.2" tslib "^2.0.3" +camelcase-css@2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" + integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -3224,6 +3432,11 @@ caseless@~0.12.0: resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= +ccount@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" + integrity sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg== + chalk@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -3574,6 +3787,11 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" +comma-separated-tokens@^1.0.0: + version "1.0.8" + resolved "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" + integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== + commander@2.15.1: version "2.15.1" resolved "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" @@ -4353,6 +4571,13 @@ destroy@~1.0.4: resolved "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= +detab@2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/detab/-/detab-2.0.4.tgz#b927892069aff405fbb9a186fe97a44a92a94b43" + integrity sha512-8zdsQA5bIkoRECvCrNKPla84lyoR7DSAyf7p0YgXzBO9PDJx8KntPUay7NS6yp+KdxdVtiE5SpHKtbp2ZQyA9g== + dependencies: + repeat-string "^1.5.4" + detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" @@ -5937,6 +6162,74 @@ has@^1.0.0, has@^1.0.1, has@^1.0.3: dependencies: function-bind "^1.1.1" +hast-to-hyperscript@^9.0.0: + version "9.0.1" + resolved "https://registry.npmjs.org/hast-to-hyperscript/-/hast-to-hyperscript-9.0.1.tgz#9b67fd188e4c81e8ad66f803855334173920218d" + integrity sha512-zQgLKqF+O2F72S1aa4y2ivxzSlko3MAvxkwG8ehGmNiqd98BIN3JM1rAJPmplEyLmGLO2QZYJtIneOSZ2YbJuA== + dependencies: + "@types/unist" "^2.0.3" + comma-separated-tokens "^1.0.0" + property-information "^5.3.0" + space-separated-tokens "^1.0.0" + style-to-object "^0.3.0" + unist-util-is "^4.0.0" + web-namespaces "^1.0.0" + +hast-util-from-parse5@^6.0.0: + version "6.0.1" + resolved "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-6.0.1.tgz#554e34abdeea25ac76f5bd950a1f0180e0b3bc2a" + integrity sha512-jeJUWiN5pSxW12Rh01smtVkZgZr33wBokLzKLwinYOUfSzm1Nl/c3GUGebDyOKjdsRgMvoVbV0VpAcpjF4NrJA== + dependencies: + "@types/parse5" "^5.0.0" + hastscript "^6.0.0" + property-information "^5.0.0" + vfile "^4.0.0" + vfile-location "^3.2.0" + web-namespaces "^1.0.0" + +hast-util-parse-selector@^2.0.0: + version "2.2.5" + resolved "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz#d57c23f4da16ae3c63b3b6ca4616683313499c3a" + integrity sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ== + +hast-util-raw@6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-6.0.1.tgz#973b15930b7529a7b66984c98148b46526885977" + integrity sha512-ZMuiYA+UF7BXBtsTBNcLBF5HzXzkyE6MLzJnL605LKE8GJylNjGc4jjxazAHUtcwT5/CEt6afRKViYB4X66dig== + dependencies: + "@types/hast" "^2.0.0" + hast-util-from-parse5 "^6.0.0" + hast-util-to-parse5 "^6.0.0" + html-void-elements "^1.0.0" + parse5 "^6.0.0" + unist-util-position "^3.0.0" + vfile "^4.0.0" + web-namespaces "^1.0.0" + xtend "^4.0.0" + zwitch "^1.0.0" + +hast-util-to-parse5@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-6.0.0.tgz#1ec44650b631d72952066cea9b1445df699f8479" + integrity sha512-Lu5m6Lgm/fWuz8eWnrKezHtVY83JeRGaNQ2kn9aJgqaxvVkFCZQBEhgodZUDUvoodgyROHDb3r5IxAEdl6suJQ== + dependencies: + hast-to-hyperscript "^9.0.0" + property-information "^5.0.0" + web-namespaces "^1.0.0" + xtend "^4.0.0" + zwitch "^1.0.0" + +hastscript@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/hastscript/-/hastscript-6.0.0.tgz#e8768d7eac56c3fdeac8a92830d58e811e5bf640" + integrity sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w== + dependencies: + "@types/hast" "^2.0.0" + comma-separated-tokens "^1.0.0" + hast-util-parse-selector "^2.0.0" + property-information "^5.0.0" + space-separated-tokens "^1.0.0" + he@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" @@ -6044,6 +6337,11 @@ html-minifier@^4.0.0: relateurl "^0.2.7" uglify-js "^3.5.1" +html-void-elements@^1.0.0: + version "1.0.5" + resolved "https://registry.npmjs.org/html-void-elements/-/html-void-elements-1.0.5.tgz#ce9159494e86d95e45795b166c2021c2cfca4483" + integrity sha512-uE/TxKuyNIcx44cIWnjr/rfIATDH7ZaOMmstu0CwhFG1Dunhlp4OC6/NMbhiwoq5BpW0ubi303qnEk/PZj614w== + html-webpack-plugin@^4.5.1: version "4.5.1" resolved "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-4.5.1.tgz#40aaf1b5cb78f2f23a83333999625c20929cda65" @@ -6360,6 +6658,11 @@ init-package-json@^1.10.3: validate-npm-package-license "^3.0.1" validate-npm-package-name "^3.0.0" +inline-style-parser@0.1.1: + version "0.1.1" + resolved "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" + integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== + inquirer@^3.0.6: version "3.3.0" resolved "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" @@ -6486,7 +6789,7 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-alphabetical@^1.0.0: +is-alphabetical@1.0.4, is-alphabetical@^1.0.0: version "1.0.4" resolved "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" integrity sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg== @@ -6533,6 +6836,11 @@ is-buffer@^1.0.2, is-buffer@^1.1.4, is-buffer@^1.1.5: resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== +is-buffer@^2.0.0: + version "2.0.5" + resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" + integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== + is-callable@^1.1.4, is-callable@^1.2.2: version "1.2.2" resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" @@ -6725,6 +7033,11 @@ is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= +is-plain-obj@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -7186,6 +7499,15 @@ loader-runner@^4.2.0: resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384" integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== +loader-utils@2.0.0, loader-utils@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0" + integrity sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ== + dependencies: + big.js "^5.2.2" + emojis-list "^3.0.0" + json5 "^2.1.2" + loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" @@ -7195,15 +7517,6 @@ loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4 emojis-list "^3.0.0" json5 "^1.0.1" -loader-utils@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0" - integrity sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^2.1.2" - loading-cli@^1.0.6: version "1.1.0" resolved "https://registry.npmjs.org/loading-cli/-/loading-cli-1.1.0.tgz#3457edaa3290439ad0061755174363a8091d56bc" @@ -7301,7 +7614,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash.uniq@^4.5.0: +lodash.uniq@4.5.0, lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= @@ -7475,6 +7788,34 @@ mdast-add-list-metadata@1.0.1: dependencies: unist-util-visit-parents "1.1.2" +mdast-squeeze-paragraphs@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/mdast-squeeze-paragraphs/-/mdast-squeeze-paragraphs-4.0.0.tgz#7c4c114679c3bee27ef10b58e2e015be79f1ef97" + integrity sha512-zxdPn69hkQ1rm4J+2Cs2j6wDEv7O17TfXTJ33tl/+JPIoEmtV9t2ZzBM5LPHE8QlHsmVD8t3vPKCyY3oH+H8MQ== + dependencies: + unist-util-remove "^2.0.0" + +mdast-util-definitions@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-4.0.0.tgz#c5c1a84db799173b4dcf7643cda999e440c24db2" + integrity sha512-k8AJ6aNnUkB7IE+5azR9h81O5EQ/cTDXtWdMq9Kk5KcEW/8ritU5CeLg/9HhOC++nALHBlaogJ5jz0Ybk3kPMQ== + dependencies: + unist-util-visit "^2.0.0" + +mdast-util-to-hast@10.0.1: + version "10.0.1" + resolved "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-10.0.1.tgz#0cfc82089494c52d46eb0e3edb7a4eb2aea021eb" + integrity sha512-BW3LM9SEMnjf4HXXVApZMt8gLQWVNXc3jryK0nJu/rOXPOnlkUjmdkDlmxMirpbU9ILncGFIwLH/ubnWBbcdgA== + dependencies: + "@types/mdast" "^3.0.0" + "@types/unist" "^2.0.0" + mdast-util-definitions "^4.0.0" + mdurl "^1.0.0" + unist-builder "^2.0.0" + unist-util-generated "^1.0.0" + unist-util-position "^3.0.0" + unist-util-visit "^2.0.0" + mdn-data@2.0.14: version "2.0.14" resolved "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" @@ -7485,6 +7826,11 @@ mdn-data@2.0.4: resolved "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== +mdurl@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" + integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= + media-typer@0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -8580,6 +8926,18 @@ parse-entities@^1.1.0: is-decimal "^1.0.0" is-hexadecimal "^1.0.0" +parse-entities@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8" + integrity sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ== + dependencies: + character-entities "^1.0.0" + character-entities-legacy "^1.0.0" + character-reference-invalid "^1.0.0" + is-alphanumerical "^1.0.0" + is-decimal "^1.0.0" + is-hexadecimal "^1.0.0" + parse-github-repo-url@^1.3.0: version "1.4.1" resolved "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" @@ -8628,6 +8986,11 @@ parse-url@^5.0.0: parse-path "^4.0.0" protocols "^1.4.0" +parse5@^6.0.0: + version "6.0.1" + resolved "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" + integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== + parseurl@~1.3.2, parseurl@~1.3.3: version "1.3.3" resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -9483,6 +9846,13 @@ prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: object-assign "^4.1.1" react-is "^16.8.1" +property-information@^5.0.0, property-information@^5.3.0: + version "5.6.0" + resolved "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz#61675545fb23002f245c6540ec46077d4da3ed69" + integrity sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA== + dependencies: + xtend "^4.0.0" + proto-list@~1.2.1: version "1.2.4" resolved "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -10069,6 +10439,47 @@ relateurl@^0.2.7: resolved "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= +remark-footnotes@2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/remark-footnotes/-/remark-footnotes-2.0.0.tgz#9001c4c2ffebba55695d2dd80ffb8b82f7e6303f" + integrity sha512-3Clt8ZMH75Ayjp9q4CorNeyjwIxHFcTkaektplKGl2A1jNGEUey8cKL0ZC5vJwfcD5GFGsNLImLG/NGzWIzoMQ== + +remark-mdx@1.6.22: + version "1.6.22" + resolved "https://registry.npmjs.org/remark-mdx/-/remark-mdx-1.6.22.tgz#06a8dab07dcfdd57f3373af7f86bd0e992108bbd" + integrity sha512-phMHBJgeV76uyFkH4rvzCftLfKCr2RZuF+/gmVcaKrpsihyzmhXjA0BEMDaPTXG5y8qZOKPVo83NAOX01LPnOQ== + dependencies: + "@babel/core" "7.12.9" + "@babel/helper-plugin-utils" "7.10.4" + "@babel/plugin-proposal-object-rest-spread" "7.12.1" + "@babel/plugin-syntax-jsx" "7.12.1" + "@mdx-js/util" "1.6.22" + is-alphabetical "1.0.4" + remark-parse "8.0.3" + unified "9.2.0" + +remark-parse@8.0.3: + version "8.0.3" + resolved "https://registry.npmjs.org/remark-parse/-/remark-parse-8.0.3.tgz#9c62aa3b35b79a486454c690472906075f40c7e1" + integrity sha512-E1K9+QLGgggHxCQtLt++uXltxEprmWzNfg+MxpfHsZlrddKzZ/hZyWHDbK3/Ap8HJQqYJRXP+jHczdL6q6i85Q== + dependencies: + ccount "^1.0.0" + collapse-white-space "^1.0.2" + is-alphabetical "^1.0.0" + is-decimal "^1.0.0" + is-whitespace-character "^1.0.0" + is-word-character "^1.0.0" + markdown-escapes "^1.0.0" + parse-entities "^2.0.0" + repeat-string "^1.5.4" + state-toggle "^1.0.0" + trim "0.0.1" + trim-trailing-lines "^1.0.0" + unherit "^1.0.4" + unist-util-remove-position "^2.0.0" + vfile-location "^3.0.0" + xtend "^4.0.1" + remark-parse@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/remark-parse/-/remark-parse-5.0.0.tgz#4c077f9e499044d1d5c13f80d7a98cf7b9285d95" @@ -10090,6 +10501,13 @@ remark-parse@^5.0.0: vfile-location "^2.0.0" xtend "^4.0.1" +remark-squeeze-paragraphs@4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/remark-squeeze-paragraphs/-/remark-squeeze-paragraphs-4.0.0.tgz#76eb0e085295131c84748c8e43810159c5653ead" + integrity sha512-8qRqmL9F4nuLPIgl92XUuxI3pFxize+F1H0e/W3llTk0UsjJaj01+RrirkMw7P21RKe4X6goQhYRSvNWX+70Rw== + dependencies: + mdast-squeeze-paragraphs "^4.0.0" + remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -10746,6 +11164,11 @@ source-map@^0.7.3, source-map@~0.7.2: resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== +space-separated-tokens@^1.0.0: + version "1.1.5" + resolved "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899" + integrity sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA== + spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" @@ -11098,6 +11521,13 @@ style-loader@^0.19.1: loader-utils "^1.0.2" schema-utils "^0.3.0" +style-to-object@0.3.0, style-to-object@^0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46" + integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA== + dependencies: + inline-style-parser "0.1.1" + stylehacks@^4.0.0: version "4.0.3" resolved "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz#6718fcaf4d1e07d8a1318690881e8d96726a71d5" @@ -11623,6 +12053,18 @@ unicode-property-aliases-ecmascript@^1.0.4: resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz#dd57a99f6207bedff4628abefb94c50db941c8f4" integrity sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg== +unified@9.2.0: + version "9.2.0" + resolved "https://registry.npmjs.org/unified/-/unified-9.2.0.tgz#67a62c627c40589edebbf60f53edfd4d822027f8" + integrity sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg== + dependencies: + bail "^1.0.0" + extend "^3.0.0" + is-buffer "^2.0.0" + is-plain-obj "^2.0.0" + trough "^1.0.0" + vfile "^4.0.0" + unified@^6.1.5: version "6.2.0" resolved "https://registry.npmjs.org/unified/-/unified-6.2.0.tgz#7fbd630f719126d67d40c644b7e3f617035f6dba" @@ -11669,11 +12111,31 @@ unique-slug@^2.0.0: dependencies: imurmurhash "^0.1.4" +unist-builder@2.0.3, unist-builder@^2.0.0: + version "2.0.3" + resolved "https://registry.npmjs.org/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436" + integrity sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw== + +unist-util-generated@^1.0.0: + version "1.1.6" + resolved "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-1.1.6.tgz#5ab51f689e2992a472beb1b35f2ce7ff2f324d4b" + integrity sha512-cln2Mm1/CZzN5ttGK7vkoGw+RZ8VcUH6BtGbq98DDtRGquAAOXig1mrBQYelOwMXYS8rK+vZDyyojSjp7JX+Lg== + unist-util-is@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz#d9e84381c2468e82629e4a5be9d7d05a2dd324cd" integrity sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A== +unist-util-is@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz#976e5f462a7a5de73d94b706bac1b90671b57797" + integrity sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg== + +unist-util-position@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/unist-util-position/-/unist-util-position-3.1.0.tgz#1c42ee6301f8d52f47d14f62bbdb796571fa2d47" + integrity sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA== + unist-util-remove-position@^1.0.0: version "1.1.4" resolved "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.4.tgz#ec037348b6102c897703eee6d0294ca4755a2020" @@ -11681,11 +12143,32 @@ unist-util-remove-position@^1.0.0: dependencies: unist-util-visit "^1.1.0" +unist-util-remove-position@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz#5d19ca79fdba712301999b2b73553ca8f3b352cc" + integrity sha512-fDZsLYIe2uT+oGFnuZmy73K6ZxOPG/Qcm+w7jbEjaFcJgbQ6cqjs/eSPzXhsmGpAsWPkqZM9pYjww5QTn3LHMA== + dependencies: + unist-util-visit "^2.0.0" + +unist-util-remove@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/unist-util-remove/-/unist-util-remove-2.1.0.tgz#b0b4738aa7ee445c402fda9328d604a02d010588" + integrity sha512-J8NYPyBm4baYLdCbjmf1bhPu45Cr1MWTm77qd9istEkzWpnN6O9tMsEbB2JhNnBCqGENRqEWomQ+He6au0B27Q== + dependencies: + unist-util-is "^4.0.0" + unist-util-stringify-position@^1.0.0, unist-util-stringify-position@^1.1.1: version "1.1.2" resolved "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz#3f37fcf351279dcbca7480ab5889bb8a832ee1c6" integrity sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ== +unist-util-stringify-position@^2.0.0: + version "2.0.3" + resolved "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz#cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da" + integrity sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g== + dependencies: + "@types/unist" "^2.0.2" + unist-util-visit-parents@1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-1.1.2.tgz#f6e3afee8bdbf961c0e6f028ea3c0480028c3d06" @@ -11698,6 +12181,23 @@ unist-util-visit-parents@^2.0.0: dependencies: unist-util-is "^3.0.0" +unist-util-visit-parents@^3.0.0: + version "3.1.1" + resolved "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6" + integrity sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg== + dependencies: + "@types/unist" "^2.0.0" + unist-util-is "^4.0.0" + +unist-util-visit@2.0.3, unist-util-visit@^2.0.0: + version "2.0.3" + resolved "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c" + integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== + dependencies: + "@types/unist" "^2.0.0" + unist-util-is "^4.0.0" + unist-util-visit-parents "^3.0.0" + unist-util-visit@^1.1.0, unist-util-visit@^1.3.0: version "1.4.1" resolved "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz#4724aaa8486e6ee6e26d7ff3c8685960d560b1e3" @@ -11886,6 +12386,11 @@ vfile-location@^2.0.0: resolved "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.6.tgz#8a274f39411b8719ea5728802e10d9e0dff1519e" integrity sha512-sSFdyCP3G6Ka0CEmN83A2YCMKIieHx0EDaj5IDP4g1pa5ZJ4FJDvpO0WODLxo4LUX4oe52gmSCK7Jw4SBghqxA== +vfile-location@^3.0.0, vfile-location@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/vfile-location/-/vfile-location-3.2.0.tgz#d8e41fbcbd406063669ebf6c33d56ae8721d0f3c" + integrity sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA== + vfile-message@^1.0.0: version "1.1.1" resolved "https://registry.npmjs.org/vfile-message/-/vfile-message-1.1.1.tgz#5833ae078a1dfa2d96e9647886cd32993ab313e1" @@ -11893,6 +12398,14 @@ vfile-message@^1.0.0: dependencies: unist-util-stringify-position "^1.1.1" +vfile-message@^2.0.0: + version "2.0.4" + resolved "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz#5b43b88171d409eae58477d13f23dd41d52c371a" + integrity sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ== + dependencies: + "@types/unist" "^2.0.0" + unist-util-stringify-position "^2.0.0" + vfile@^2.0.0: version "2.3.0" resolved "https://registry.npmjs.org/vfile/-/vfile-2.3.0.tgz#e62d8e72b20e83c324bc6c67278ee272488bf84a" @@ -11903,6 +12416,16 @@ vfile@^2.0.0: unist-util-stringify-position "^1.0.0" vfile-message "^1.0.0" +vfile@^4.0.0: + version "4.2.1" + resolved "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz#03f1dce28fc625c625bc6514350fbdb00fa9e624" + integrity sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA== + dependencies: + "@types/unist" "^2.0.0" + is-buffer "^2.0.0" + unist-util-stringify-position "^2.0.0" + vfile-message "^2.0.0" + warning@^4.0.1: version "4.0.3" resolved "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3" @@ -11932,6 +12455,11 @@ wcwidth@^1.0.0, wcwidth@^1.0.1: dependencies: defaults "^1.0.3" +web-namespaces@^1.0.0: + version "1.1.4" + resolved "https://registry.npmjs.org/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec" + integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw== + webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" @@ -12342,3 +12870,8 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zwitch@^1.0.0: + version "1.0.5" + resolved "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" + integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== From 00408b63e45bcf13f32bca84cfd1a867aa79bc3d Mon Sep 17 00:00:00 2001 From: MuYunyun <328375795@qq.com> Date: Thu, 3 Jun 2021 13:35:18 +0800 Subject: [PATCH 2/9] feat: support React cp in markdown --- config.yml | 1 + docs/components/index.jsx | 10 ++++ ...46\345\206\231\347\273\204\344\273\266.md" | 9 ++++ packages/scripts/src/conf/webpack.config.js | 4 ++ packages/theme/markdown/InlineCode.js | 47 ++++++++-------- packages/theme/markdown/index.js | 53 ++++++++++--------- 6 files changed, 75 insertions(+), 49 deletions(-) create mode 100644 docs/components/index.jsx create mode 100644 "docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" diff --git a/config.yml b/config.yml index 9afda98db..848d04df2 100644 --- a/config.yml +++ b/config.yml @@ -14,6 +14,7 @@ menu: [ docs/自定义主题.md, docs/其它工具.md, docs/更新日志.md, + docs/书写组件.md ] ## set init open menu keys # menuOpenKeys: diff --git a/docs/components/index.jsx b/docs/components/index.jsx new file mode 100644 index 000000000..59b1268e2 --- /dev/null +++ b/docs/components/index.jsx @@ -0,0 +1,10 @@ +const Button = ({ + children, +}) => { + console.log('children', children) + return {children} +} + +export { + Button, +} diff --git "a/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" "b/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" new file mode 100644 index 000000000..bab3e8f05 --- /dev/null +++ "b/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" @@ -0,0 +1,9 @@ +import { Button } from './components' + +## 书写组件 + +create-react-doc 内置了 [mdx](https://github.com/mdx-js/mdx) 的能力, 你可以在 .md 文件中书写 React 组件。 + +### 示意 + + diff --git a/packages/scripts/src/conf/webpack.config.js b/packages/scripts/src/conf/webpack.config.js index 1f0a6108c..777c3c80c 100644 --- a/packages/scripts/src/conf/webpack.config.js +++ b/packages/scripts/src/conf/webpack.config.js @@ -74,6 +74,10 @@ module.exports = { }, ], }, + { + test: /\.mdx?$/, + use: ['babel-loader', '@mdx-js/loader'], + }, // “file-loader”确保这些资源由WebpackDevServer服务。 // 当您导入资源时,您将获得(虚拟)文件名。 // 在生产中,它们将被复制到`build`文件夹。 diff --git a/packages/theme/markdown/InlineCode.js b/packages/theme/markdown/InlineCode.js index 98b0ccf60..7c2d7c5aa 100644 --- a/packages/theme/markdown/InlineCode.js +++ b/packages/theme/markdown/InlineCode.js @@ -17,7 +17,8 @@ export default class Canvas extends PureComponent { } render() { const sourceCode = this.props.value || '' - const code = sourceCode.replace(/^__dome__/, '').replace(/\\`/g, '`') + // const code = sourceCode.replace(/^__dome__/, '').replace(/\\`/g, '`') + const code = sourceCode.replace(/\\`/g, '`') const PreCode = height => (
          this.codeDom = node} className={classNames('hljs', { [`language-${this.props.language}`]: this.props.language })}>
@@ -25,29 +26,29 @@ export default class Canvas extends PureComponent {
         
       
) - const isPreview = /^(html|htm)$/.test(this.props.language) + // const isPreview = /^(html|htm)$/.test(this.props.language) - if (/^__dome__/.test(sourceCode)) { - return ( -
- {isPreview && ( -
-
-
- )} - {PreCode(this.state.height)} -
- {this.state.height === 0 ? '显示' : '隐藏'}代码 - {this.props.language &&
{this.props.language}
} -
-
- ) - } + // if (/^__dome__/.test(sourceCode)) { + // return ( + //
+ // {isPreview && ( + //
+ //
+ //
+ // )} + // {PreCode(this.state.height)} + //
+ // {this.state.height === 0 ? '显示' : '隐藏'}代码 + // {this.props.language &&
{this.props.language}
} + //
+ //
+ // ) + // } return PreCode() } } diff --git a/packages/theme/markdown/index.js b/packages/theme/markdown/index.js index 1768ba69e..dc0320531 100644 --- a/packages/theme/markdown/index.js +++ b/packages/theme/markdown/index.js @@ -49,43 +49,44 @@ function Markdown({ props }) { } }, [markdownStr]) + console.log('markdownStr', markdownStr) return (
{markdownStr ? ( { - if (node.type === 'html') { - // if (//.test(node.value)) return false; - // const scriptValue = node.value.match(/(.*?)<\/script>/ig); - // node.value.replace(/(.*?)<\/script>/, (te) => { - // console.log('te:', te); - // }); - } - // 判断 上一个节点是否为 - if ( - node.type === 'code' && - parent.children && - parent.children.length > 0 && - parent.children[index - 1] - ) { - const parentNode = parent.children[index - 1] - if ( - parentNode.type === 'html' && - //.test(parentNode.value) - ) { - node.value = `__dome__${node.value}` - } - } - return node - }} + // allowNode={(node, index, parent) => { + // if (node.type === 'html') { + // // if (//.test(node.value)) return false; + // // const scriptValue = node.value.match(/(.*?)<\/script>/ig); + // // node.value.replace(/(.*?)<\/script>/, (te) => { + // // console.log('te:', te); + // // }); + // } + // // 判断 上一个节点是否为 + // if ( + // node.type === 'code' && + // parent.children && + // parent.children.length > 0 && + // parent.children[index - 1] + // ) { + // const parentNode = parent.children[index - 1] + // if ( + // parentNode.type === 'html' && + // //.test(parentNode.value) + // ) { + // node.value = `__dome__${node.value}` + // } + // } + // return node + // }} /> ) : ( From b090ec46c2028ceea70daf5d1d8c95ba43e8094e Mon Sep 17 00:00:00 2001 From: MuYunyun <328375795@qq.com> Date: Fri, 4 Jun 2021 20:14:30 +0800 Subject: [PATCH 3/9] feat: support jsx in md --- .babelrc.js | 36 + ...46\345\206\231\347\273\204\344\273\266.md" | 4 +- ...30\351\230\266\347\224\250\346\263\225.md" | 62 -- packages/crd-markdown-loader/.npmrc | 10 + packages/crd-markdown-loader/README.md | 3 + packages/crd-markdown-loader/index.js | 130 ++++ packages/crd-markdown-loader/package.json | 24 + packages/scripts/package.json | 6 +- packages/scripts/src/conf/mdloader.js | 131 ++++ packages/scripts/src/conf/webpack.config.js | 24 +- packages/theme/markdown/index.js | 66 +- yarn.lock | 623 ++---------------- 12 files changed, 449 insertions(+), 670 deletions(-) create mode 100644 .babelrc.js create mode 100644 packages/crd-markdown-loader/.npmrc create mode 100644 packages/crd-markdown-loader/README.md create mode 100644 packages/crd-markdown-loader/index.js create mode 100644 packages/crd-markdown-loader/package.json create mode 100644 packages/scripts/src/conf/mdloader.js diff --git a/.babelrc.js b/.babelrc.js new file mode 100644 index 000000000..806a2b7fe --- /dev/null +++ b/.babelrc.js @@ -0,0 +1,36 @@ +const babelrc = { + presets: [ + [ + "@babel/preset-env", + { + targets: { + browsers: ["last 2 versions", "ie >= 10"], + }, + }, + ], + ["@babel/preset-react", { + "runtime": "automatic" + }] + ], + plugins: [ + "@babel/plugin-syntax-object-rest-spread", + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-transform-async-to-generator", + "@babel/plugin-proposal-class-properties", + "@babel/plugin-transform-runtime" + ], + env: { + production: {}, + }, +}; + +if (process.env.NODE_ENV === 'development') { + // 不要包含多余的空格字符和行结束符。 + // 设置为“auto”时,对于大于500KB的输入大小,设置为"true"。 + // https://babeljs.io/docs/usage/api/#options + babelrc.cacheDirectory = true; +} else { + babelrc.compact = true; +} + +module.exports = babelrc diff --git "a/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" "b/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" index bab3e8f05..582bd8dd6 100644 --- "a/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" +++ "b/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" @@ -1,4 +1,4 @@ -import { Button } from './components' + ## 书写组件 @@ -6,4 +6,4 @@ create-react-doc 内置了 [mdx](https://github.com/mdx-js/mdx) 的能力, 你 ### 示意 - + diff --git "a/docs/\351\253\230\351\230\266\347\224\250\346\263\225.md" "b/docs/\351\253\230\351\230\266\347\224\250\346\263\225.md" index 50a36da90..b5e383643 100644 --- "a/docs/\351\253\230\351\230\266\347\224\250\346\263\225.md" +++ "b/docs/\351\253\230\351\230\266\347\224\250\346\263\225.md" @@ -1,65 +1,3 @@ ## 高阶用法 与 git 文件结构类似, 如果在展示的文件夹中有私有文件不方便展示在文档站点, 可以在 `.gitignore` 文件中设置过滤文件, 这样它们就不会展示在文档站点中了。eg: [.gitignore](https://github.com/MuYunyun/blog/blob/main/.gitignore) - -## 数学公式 - -以 [MathJax](https://github.com/mathjax/MathJax) 为例, 当书写以下数学符号时 - -```markdown -

- When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are - $$x = {-b \pm \sqrt{\texttip{b^2-4ac}{descriminant}} \over 2a}.$$ -

-``` - -会被转换为: - -

- When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are - $$x = {-b \pm \sqrt{\texttip{b^2-4ac}{descriminant}} \over 2a}.$$ -

- - - -### 使用方式 - -在 `config.yml` 文件中加入 `inject` 字段。 - -```diff -+ inject: injectLogic/index.js -``` - -然后在根目录新建与 `inject` 字段相对应的文件, 声明 `injectWithPathname` 函数, 写入[自定义逻辑](https://github.com/MuYunyun/create-react-doc/injectLogic/index.js), 完成 MathJax 的使用。 - -```js -// perf injectWithPathname logic every pathname changes -const injectWithPathname = (pathname) => { - // demo for using mathjax. see https://github.com/MuYunyun/create-react-doc/issues/63 - if (pathname !== '/高阶用法') return; - window.MathJax = { - tex: { - inlineMath: [['$', '$'], ['\\(', '\\)']], - }, - svg: { - fontCache: 'global', - }, - }; - const script = document.createElement('script'); - script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js'; - const tag = 'mathjax'; - script.id = tag; - script.async = true; - const scriptNode = document.getElementById(tag); - try { - if (!scriptNode) { - document.head.appendChild(script); - } else { - scriptNode.remove(); - document.head.appendChild(script); - } - } catch (error) {} -}; - -module.exports = { injectWithPathname }; -``` \ No newline at end of file diff --git a/packages/crd-markdown-loader/.npmrc b/packages/crd-markdown-loader/.npmrc new file mode 100644 index 000000000..7edb6af8b --- /dev/null +++ b/packages/crd-markdown-loader/.npmrc @@ -0,0 +1,10 @@ +# .npmrc + +registry=https://registry.npmjs.org/ + +# https://github.com/sass/node-sass#binary-configuration-parameters +sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ + +# https://github.com/Medium/phantomjs#deciding-where-to-get-phantomjs +# phantomjs_cdnurl=http://cnpmjs.org/downloads +phantomjs_cdnurl=https://npm.taobao.org/dist/phantomjs diff --git a/packages/crd-markdown-loader/README.md b/packages/crd-markdown-loader/README.md new file mode 100644 index 000000000..66be9a52e --- /dev/null +++ b/packages/crd-markdown-loader/README.md @@ -0,0 +1,3 @@ +### crd-markdown-loader + +markdown loader with webpack for [create-react-doc](https://github.com/MuYunyun/create-react-doc)。 \ No newline at end of file diff --git a/packages/crd-markdown-loader/index.js b/packages/crd-markdown-loader/index.js new file mode 100644 index 000000000..45cb4556a --- /dev/null +++ b/packages/crd-markdown-loader/index.js @@ -0,0 +1,130 @@ +import highlight from 'highlight.js' +import frontMatter from 'front-matter' +import mdContainer from 'markdown-it-container' +import md from 'markdown-it' + +console.log('✅✅✅✅✅✅✅') + +const options = { + className: 'wrap', +} + +const mdLoader = md({ + html: true, // Enable HTML tags in source + xhtmlOut: true, // Use '/' to close single tags (
) + typographer: false, + linkify: false, // Auto convert URL-like text to links +}) + .enable(['smartquotes']) + .set({ + highlight(content: any, languageHint: any) { + let highlightedContent = null + + highlight.configure({ + useBR: true, + tabReplace: ' ', + }) + + if (languageHint && highlight.getLanguage(languageHint)) { + try { + highlightedContent = highlight.highlight(languageHint, content).value + } catch (err) { + console.log(err) + } + } + + if (!highlightedContent) { + try { + highlightedContent = highlight.highlightAuto(content).value + } catch (err) { + console.log(err) + } + } + + // 把代码中的{}转 + highlightedContent = highlightedContent.replace( + /[{}]/g, + (match: string) => `{'${match}'}`, + ) + // 加上 highlight js + highlightedContent = highlightedContent + .replace('', '') + + return highlight.fixMarkup(highlightedContent) + }, + }) + +/** at-component-docs__container 用于做除 demo 和 table 之外的公共样式 */ +const formatModule = (imports: string, jsx: string) => { + const moduleText = ` + ${imports} + + export default class extends React.Component { + render(){ + return ( +
+
+ ${jsx} +
+
+ ); + } + };` + return moduleText +} + +const formatOpening = () => + `
+
+
` +const formatClosing = () => + `
` + +function markdownLoader(source: any) { + const { + body, + attributes: { imports: importMap }, + } = frontMatter(source) + const imports = `import * as React from 'react';${importMap}` + + /* 处理 :::demo 开头的 markdown 内容 */ + mdLoader.use(mdContainer, 'demo', { + validate: (params: string) => params.trim().match(/^demo\s*(.*)$/), + render: (tokens: any[], idx: number) => { + // container 从开头到结尾把之间的token跑一遍,其中idx定位到具体的位置 + // 有此标记代表 ::: 开始 + if (tokens[idx].nesting === 1) { + let i = 1 + // 从 ::: 下一个token开始 + let token = tokens[idx + i] + + // 如果没有到结尾 + while (token.markup !== ':::') { + i++ + token = tokens[idx + i] + } + // 描述也执行md + return formatOpening() + } + return formatClosing() + }, + }) + + // md 处理过后的字符串含有 class 和 style ,需要再次处理给到 react + let content = mdLoader.render(body) + + content = content + .replace(/
/g, '
') + .replace(/
/g, '
') + .replace(/class=/g, 'className=') + .replace(/style="text-align:center"/g, 'style={{ textAlign: "center"}}') + .replace(/style="text-align:left"/g, 'style={{ textAlign: "left"}}') + .replace(/style="text-align:right"/g, 'style={{ textAlign: "right"}}') + .replace(/\(_blank\)/g, ` target="_blank">`) + + return formatModule(imports, content) +} + +module.exports = markdownLoader diff --git a/packages/crd-markdown-loader/package.json b/packages/crd-markdown-loader/package.json new file mode 100644 index 000000000..12532f36b --- /dev/null +++ b/packages/crd-markdown-loader/package.json @@ -0,0 +1,24 @@ +{ + "name": "crd-markdown-loader", + "version": "1.1.3", + "description": "markdown-loader with webpack for create react doc", + "main": "index.js", + "dependencies": { + "front-matter": "^4.0.2", + "highlight.js": "^11.0.1", + "markdown-it": "^12.0.6", + "markdown-it-container": "^3.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/MuYunyun/create-react-doc", + "directory": "packages/utils" + }, + "keywords": [], + "publishConfig": { + "access": "public" + }, + "author": "muyunyun", + "license": "MIT", + "gitHead": "ffc5e4cbc94a7356da558c2dbf46e2f39bb8b199" +} diff --git a/packages/scripts/package.json b/packages/scripts/package.json index 6c4b2e362..5952fef9c 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -15,7 +15,6 @@ "@babel/preset-env": "^7.3.4", "@babel/preset-react": "^7.0.0", "@babel/runtime": "^7.3.4", - "@mdx-js/loader": "^1.6.22", "@nuxtjs/friendly-errors-webpack-plugin": "^2.0.2", "babel-eslint": "^8.0.1", "babel-loader": "^8.0.5", @@ -33,14 +32,17 @@ "eslint": "^7.11.0", "eslint-loader": "^4.0.2", "file-loader": "^1.1.11", + "front-matter": "^4.0.2", "fs-extra": "^5.0.0", "gh-pages": "^1.2.0", - "highlight.js": "^10.5.0", + "highlight.js": "^11.0.1", "html-webpack-plugin": "^4.5.1", "less-loader": "^7.2.1", "loader-utils": "^2.0.0", "loading-cli": "^1.0.6", "local-ip-url": "^1.0.1", + "markdown-it": "^12.0.6", + "markdown-it-container": "^3.0.0", "mini-css-extract-plugin": "^0.4.0", "open-browsers": "^1.1.1", "path-browserify": "^1.0.1", diff --git a/packages/scripts/src/conf/mdloader.js b/packages/scripts/src/conf/mdloader.js new file mode 100644 index 000000000..c7a3caa08 --- /dev/null +++ b/packages/scripts/src/conf/mdloader.js @@ -0,0 +1,131 @@ +import highlight from 'highlight.js' +import frontMatter from 'front-matter' +import mdContainer from 'markdown-it-container' +import md from 'markdown-it' + +const options = { + className: 'wrap', +} + +const mdLoader = md({ + html: true, // Enable HTML tags in source + xhtmlOut: true, // Use '/' to close single tags (
) + typographer: false, + linkify: false, // Auto convert URL-like text to links +}) + .enable(['smartquotes']) + .set({ + highlight(content: any, languageHint: any) { + let highlightedContent = null + + highlight.configure({ + useBR: true, + tabReplace: ' ', + }) + + if (languageHint && highlight.getLanguage(languageHint)) { + try { + highlightedContent = highlight.highlight(languageHint, content).value + } catch (err) { + console.log(err) + } + } + + if (!highlightedContent) { + try { + highlightedContent = highlight.highlightAuto(content).value + } catch (err) { + console.log(err) + } + } + + // 把代码中的{}转 + highlightedContent = highlightedContent.replace( + /[{}]/g, + (match: string) => `{'${match}'}`, + ) + // 加上 highlight js + highlightedContent = highlightedContent + .replace('', '') + + return highlight.fixMarkup(highlightedContent) + }, + }) + +/** at-component-docs__container 用于做除 demo 和 table 之外的公共样式 */ +const formatModule = (imports: string, jsx: string) => { + const moduleText = ` + ${imports} + + export default class extends React.Component { + render(){ + return ( +
+
+ ${jsx} +
+
+ ); + } + };` + return moduleText +} + +const formatOpening = () => + `
+
+
` +const formatClosing = () => + `
` + +function markdownLoader(source: any) { + const { + body, + attributes: { imports: importMap }, + } = frontMatter(source) + const imports = `import * as React from 'react';${importMap}` + + /* 处理 :::demo 开头的 markdown 内容 */ + mdLoader.use(mdContainer, 'demo', { + validate: (params: string) => params.trim().match(/^demo\s*(.*)$/), + render: (tokens: any[], idx: number) => { + // container 从开头到结尾把之间的token跑一遍,其中idx定位到具体的位置 + // 有此标记代表 ::: 开始 + if (tokens[idx].nesting === 1) { + let i = 1 + // 从 ::: 下一个token开始 + let token = tokens[idx + i] + + // 如果没有到结尾 + while (token.markup !== ':::') { + i++ + token = tokens[idx + i] + } + // 描述也执行md + return formatOpening() + } + return formatClosing() + }, + }) + + // md 处理过后的字符串含有 class 和 style ,需要再次处理给到 react + let content = mdLoader.render(body) + + content = content + .replace(/
/g, '
') + .replace(/
/g, '
') + .replace(/class=/g, 'className=') + .replace(/style="text-align:center"/g, 'style={{ textAlign: "center"}}') + .replace(/style="text-align:left"/g, 'style={{ textAlign: "left"}}') + .replace(/style="text-align:right"/g, 'style={{ textAlign: "right"}}') + .replace(/\(_blank\)/g, ` target="_blank">`) + + return formatModule(imports, content) +} + + +console.log('123', 123) + +module.exports = markdownLoader diff --git a/packages/scripts/src/conf/webpack.config.js b/packages/scripts/src/conf/webpack.config.js index 777c3c80c..22d57a041 100644 --- a/packages/scripts/src/conf/webpack.config.js +++ b/packages/scripts/src/conf/webpack.config.js @@ -32,6 +32,8 @@ if (docsConfig) { } } +console.log(`require.resolve('crd-markdown-loader')`, require.resolve('crd-markdown-loader')) + module.exports = { entry: {}, output: { @@ -75,9 +77,25 @@ module.exports = { ], }, { - test: /\.mdx?$/, - use: ['babel-loader', '@mdx-js/loader'], + test: /\.md$/, + use: [ + // { + // loader: `babel-loader!${path.join(__dirname, './mdloader.js')}`, + // }, + { + loader: require.resolve('crd-markdown-loader'), + }, + { + loader: require.resolve('babel-loader'), + // options: require('../../.babelrc'), // eslint-disable-line + }, + ], }, + // { + // test: /\.mdx?$/, + // use: ['babel-loader', '@mdx-js/loader'], + // include: [/\.cache\/md/], + // }, // “file-loader”确保这些资源由WebpackDevServer服务。 // 当您导入资源时,您将获得(虚拟)文件名。 // 在生产中,它们将被复制到`build`文件夹。 @@ -110,6 +128,8 @@ module.exports = { resolve: { fallback: { path: require.resolve('path-browserify'), + assert: false, + fs: false, }, }, } diff --git a/packages/theme/markdown/index.js b/packages/theme/markdown/index.js index dc0320531..456aa3031 100644 --- a/packages/theme/markdown/index.js +++ b/packages/theme/markdown/index.js @@ -2,6 +2,7 @@ import { useState, useEffect, useRef } from 'react' import cx from 'classnames' import ReactMarkdown from 'react-markdown' import hljs from 'highlight.js' +import { renderToString } from 'react-dom/server' import InlineCode from './InlineCode' import Link from './Link' import Loading from '../component/Loading' @@ -21,7 +22,7 @@ const formatPath = path => function Markdown({ props }) { const { type, relative } = props - const [markdownStr, setMarkdownStr] = useState('') + const [markdownStr, setMarkdownStr] = useState(null) const markdownWrapperRef = useRef(null) const renderMarkdown = () => { @@ -32,6 +33,7 @@ function Markdown({ props }) { filename = formatPath(relativeMd) } import(`__project_root__/.cache/md/${filename}.md`).then((data) => { + console.log('data', data) setMarkdownStr(data.default || data) }) } @@ -40,54 +42,30 @@ function Markdown({ props }) { renderMarkdown() }, []) - useEffect(() => { - const code = markdownWrapperRef.current.getElementsByTagName('code') - for (let i = 0; i < code.length; i += 1) { - if (code[i].parentNode && code[i].parentNode.tagName === 'PRE') { - hljs.highlightBlock(code[i]) - } - } - }, [markdownStr]) + // useEffect(() => { + // const code = markdownWrapperRef.current.getElementsByTagName('code') + // for (let i = 0; i < code.length; i += 1) { + // if (code[i].parentNode && code[i].parentNode.tagName === 'PRE') { + // hljs.highlightBlock(code[i]) + // } + // } + // }, [markdownStr]) console.log('markdownStr', markdownStr) return (
{markdownStr ? ( - { - // if (node.type === 'html') { - // // if (//.test(node.value)) return false; - // // const scriptValue = node.value.match(/(.*?)<\/script>/ig); - // // node.value.replace(/(.*?)<\/script>/, (te) => { - // // console.log('te:', te); - // // }); - // } - // // 判断 上一个节点是否为 - // if ( - // node.type === 'code' && - // parent.children && - // parent.children.length > 0 && - // parent.children[index - 1] - // ) { - // const parentNode = parent.children[index - 1] - // if ( - // parentNode.type === 'html' && - // //.test(parentNode.value) - // ) { - // node.value = `__dome__${node.value}` - // } - // } - // return node - // }} - /> + // +
123
) : ( )} diff --git a/yarn.lock b/yarn.lock index f1d3ca236..6f9d9e103 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,40 +33,11 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.12.13": - version "7.12.13" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" - integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== - dependencies: - "@babel/highlight" "^7.12.13" - "@babel/compat-data@^7.12.1", "@babel/compat-data@^7.12.5": version "7.12.5" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.5.tgz#f56db0c4bb1bbbf221b4e81345aab4141e7cb0e9" integrity sha512-DTsS7cxrsH3by8nqQSpFSyjSfSYl57D6Cf4q8dW3LK83tBKBDCkfcay1nYkXq1nIHXnpX8WMMb/O25HOy3h1zg== -"@babel/core@7.12.9": - version "7.12.9" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.12.9.tgz#fd450c4ec10cdbb980e2928b7aa7a28484593fc8" - integrity sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.12.5" - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helpers" "^7.12.5" - "@babel/parser" "^7.12.7" - "@babel/template" "^7.12.7" - "@babel/traverse" "^7.12.9" - "@babel/types" "^7.12.7" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.1" - json5 "^2.1.2" - lodash "^4.17.19" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" - "@babel/core@^7.3.4": version "7.12.3" resolved "https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz#1b436884e1e3bff6fb1328dc02b208759de92ad8" @@ -109,15 +80,6 @@ jsesc "^2.5.1" source-map "^0.5.0" -"@babel/generator@^7.14.2": - version "7.14.3" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.14.3.tgz#0c2652d91f7bddab7cccc6ba8157e4f40dcedb91" - integrity sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA== - dependencies: - "@babel/types" "^7.14.2" - jsesc "^2.5.1" - source-map "^0.5.0" - "@babel/helper-annotate-as-pure@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz#5bf0d495a3f757ac3bda48b5bf3b3ba309c72ba3" @@ -214,15 +176,6 @@ "@babel/template" "^7.10.4" "@babel/types" "^7.10.4" -"@babel/helper-function-name@^7.14.2": - version "7.14.2" - resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz#397688b590760b6ef7725b5f0860c82427ebaac2" - integrity sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ== - dependencies: - "@babel/helper-get-function-arity" "^7.12.13" - "@babel/template" "^7.12.13" - "@babel/types" "^7.14.2" - "@babel/helper-get-function-arity@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz#d03ca6dd2b9f7b0b1e6b32c56c72836140db3a15" @@ -237,13 +190,6 @@ dependencies: "@babel/types" "^7.10.4" -"@babel/helper-get-function-arity@^7.12.13": - version "7.12.13" - resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" - integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== - dependencies: - "@babel/types" "^7.12.13" - "@babel/helper-hoist-variables@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz#d49b001d1d5a68ca5e6604dda01a6297f7c9381e" @@ -287,7 +233,7 @@ dependencies: "@babel/types" "^7.10.4" -"@babel/helper-plugin-utils@7.10.4", "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== @@ -346,23 +292,11 @@ dependencies: "@babel/types" "^7.11.0" -"@babel/helper-split-export-declaration@^7.12.13": - version "7.12.13" - resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" - integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== - dependencies: - "@babel/types" "^7.12.13" - "@babel/helper-validator-identifier@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== -"@babel/helper-validator-identifier@^7.14.0": - version "7.14.0" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" - integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== - "@babel/helper-validator-option@^7.12.1": version "7.12.1" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.1.tgz#175567380c3e77d60ff98a54bb015fe78f2178d9" @@ -387,15 +321,6 @@ "@babel/traverse" "^7.12.5" "@babel/types" "^7.12.5" -"@babel/helpers@^7.12.5": - version "7.14.0" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.0.tgz#ea9b6be9478a13d6f961dbb5f36bf75e2f3b8f62" - integrity sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg== - dependencies: - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.14.0" - "@babel/types" "^7.14.0" - "@babel/highlight@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5" @@ -414,25 +339,11 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/highlight@^7.12.13": - version "7.14.0" - resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz#3197e375711ef6bf834e67d0daec88e4f46113cf" - integrity sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg== - dependencies: - "@babel/helper-validator-identifier" "^7.14.0" - chalk "^2.0.0" - js-tokens "^4.0.0" - "@babel/parser@^7.10.4", "@babel/parser@^7.12.3", "@babel/parser@^7.12.5": version "7.12.5" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz#b4af32ddd473c0bfa643bd7ff0728b8e71b81ea0" integrity sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ== -"@babel/parser@^7.12.13", "@babel/parser@^7.12.7", "@babel/parser@^7.14.2": - version "7.14.4" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz#a5c560d6db6cd8e6ed342368dea8039232cbab18" - integrity sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA== - "@babel/plugin-proposal-async-generator-functions@^7.12.1": version "7.12.1" resolved "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.12.1.tgz#dc6c1170e27d8aca99ff65f4925bd06b1c90550e" @@ -498,7 +409,7 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@7.12.1", "@babel/plugin-proposal-object-rest-spread@^7.12.1": +"@babel/plugin-proposal-object-rest-spread@^7.12.1": version "7.12.1" resolved "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz#def9bd03cea0f9b72283dac0ec22d289c7691069" integrity sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA== @@ -575,7 +486,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@7.12.1", "@babel/plugin-syntax-jsx@^7.12.1": +"@babel/plugin-syntax-jsx@^7.12.1": version "7.12.1" resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.1.tgz#9d9d357cc818aa7ae7935917c1257f67677a0926" integrity sha512-1yRi7yAtB0ETgxdY9ti/p2TivUxJkTdhu/ZbF9MshVGqOx1TdB3b7xCXs49Fupgg50N45KcAsRP/ZqWjs9SRjg== @@ -603,7 +514,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-object-rest-spread@7.8.3", "@babel/plugin-syntax-object-rest-spread@^7.2.0", "@babel/plugin-syntax-object-rest-spread@^7.8.0": +"@babel/plugin-syntax-object-rest-spread@^7.2.0", "@babel/plugin-syntax-object-rest-spread@^7.8.0": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== @@ -1077,15 +988,6 @@ "@babel/parser" "^7.10.4" "@babel/types" "^7.10.4" -"@babel/template@^7.12.13", "@babel/template@^7.12.7": - version "7.12.13" - resolved "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" - integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/parser" "^7.12.13" - "@babel/types" "^7.12.13" - "@babel/traverse@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966" @@ -1117,20 +1019,6 @@ globals "^11.1.0" lodash "^4.17.19" -"@babel/traverse@^7.12.9", "@babel/traverse@^7.14.0": - version "7.14.2" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.2.tgz#9201a8d912723a831c2679c7ebbf2fe1416d765b" - integrity sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.14.2" - "@babel/helper-function-name" "^7.14.2" - "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/parser" "^7.14.2" - "@babel/types" "^7.14.2" - debug "^4.1.0" - globals "^11.1.0" - "@babel/types@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757" @@ -1149,14 +1037,6 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" -"@babel/types@^7.12.13", "@babel/types@^7.12.7", "@babel/types@^7.14.0", "@babel/types@^7.14.2": - version "7.14.4" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.14.4.tgz#bfd6980108168593b38b3eb48a24aa026b919bc0" - integrity sha512-lCj4aIs0xUefJFQnwwQv2Bxg7Omd6bgquZ6LGC+gGMh6/s5qDVfjuCMlDmYQ15SLsWHd9n+X3E75lKIhl5Lkiw== - dependencies: - "@babel/helper-validator-identifier" "^7.14.0" - to-fast-properties "^2.0.0" - "@eslint/eslintrc@^0.2.1": version "0.2.1" resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.1.tgz#f72069c330461a06684d119384435e12a5d76e3c" @@ -1955,50 +1835,6 @@ npmlog "^4.1.2" write-file-atomic "^2.3.0" -"@mdx-js/loader@^1.6.22": - version "1.6.22" - resolved "https://registry.npmjs.org/@mdx-js/loader/-/loader-1.6.22.tgz#d9e8fe7f8185ff13c9c8639c048b123e30d322c4" - integrity sha512-9CjGwy595NaxAYp0hF9B/A0lH6C8Rms97e2JS9d3jVUtILn6pT5i5IV965ra3lIWc7Rs1GG1tBdVF7dCowYe6Q== - dependencies: - "@mdx-js/mdx" "1.6.22" - "@mdx-js/react" "1.6.22" - loader-utils "2.0.0" - -"@mdx-js/mdx@1.6.22": - version "1.6.22" - resolved "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-1.6.22.tgz#8a723157bf90e78f17dc0f27995398e6c731f1ba" - integrity sha512-AMxuLxPz2j5/6TpF/XSdKpQP1NlG0z11dFOlq+2IP/lSgl11GY8ji6S/rgsViN/L0BDvHvUMruRb7ub+24LUYA== - dependencies: - "@babel/core" "7.12.9" - "@babel/plugin-syntax-jsx" "7.12.1" - "@babel/plugin-syntax-object-rest-spread" "7.8.3" - "@mdx-js/util" "1.6.22" - babel-plugin-apply-mdx-type-prop "1.6.22" - babel-plugin-extract-import-names "1.6.22" - camelcase-css "2.0.1" - detab "2.0.4" - hast-util-raw "6.0.1" - lodash.uniq "4.5.0" - mdast-util-to-hast "10.0.1" - remark-footnotes "2.0.0" - remark-mdx "1.6.22" - remark-parse "8.0.3" - remark-squeeze-paragraphs "4.0.0" - style-to-object "0.3.0" - unified "9.2.0" - unist-builder "2.0.3" - unist-util-visit "2.0.3" - -"@mdx-js/react@1.6.22": - version "1.6.22" - resolved "https://registry.npmjs.org/@mdx-js/react/-/react-1.6.22.tgz#ae09b4744fddc74714ee9f9d6f17a66e77c43573" - integrity sha512-TDoPum4SHdfPiGSAaRBw7ECyI8VaHpK8GJugbJIJuqyh6kzw9ZLJZW3HGL3NNrJGxcAixUvqROm+YuQOo5eXtg== - -"@mdx-js/util@1.6.22": - version "1.6.22" - resolved "https://registry.npmjs.org/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" - integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== - "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" @@ -2201,13 +2037,6 @@ "@types/minimatch" "*" "@types/node" "*" -"@types/hast@^2.0.0": - version "2.3.1" - resolved "https://registry.npmjs.org/@types/hast/-/hast-2.3.1.tgz#b16872f2a6144c7025f296fb9636a667ebb79cd9" - integrity sha512-viwwrB+6xGzw+G1eWpF9geV3fnsDgXqHG+cqgiHrvQfDUW5hzhCyV7Sy3UJxhfRFBsgky2SSW33qi/YrIkjX5Q== - dependencies: - "@types/unist" "*" - "@types/html-minifier-terser@^5.0.0": version "5.1.1" resolved "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz#3c9ee980f1a10d6021ae6632ca3e79ca2ec4fb50" @@ -2223,13 +2052,6 @@ resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= -"@types/mdast@^3.0.0": - version "3.0.3" - resolved "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.3.tgz#2d7d671b1cd1ea3deb306ea75036c2a0407d2deb" - integrity sha512-SXPBMnFVQg1s00dlMCc/jCdvPqdE4mXaMMCeRlxLDmTAEoegHT53xKtkDnzDTOcmMHUfcjyf36/YYZ6SxRdnsw== - dependencies: - "@types/unist" "*" - "@types/minimatch@*": version "3.0.3" resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" @@ -2250,11 +2072,6 @@ resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== -"@types/parse5@^5.0.0": - version "5.0.3" - resolved "https://registry.npmjs.org/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109" - integrity sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw== - "@types/puppeteer@^2.0.0": version "2.1.5" resolved "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-2.1.5.tgz#9137aa87dca21450820bfd6fa4fe747bc8176381" @@ -2284,11 +2101,6 @@ dependencies: source-map "^0.6.1" -"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3": - version "2.0.3" - resolved "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" - integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ== - "@types/webpack-sources@*": version "2.1.0" resolved "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-2.1.0.tgz#8882b0bd62d1e0ce62f183d0d01b72e6e82e8c10" @@ -2725,6 +2537,11 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + aria-query@^4.2.2: version "4.2.2" resolved "https://registry.npmjs.org/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" @@ -2963,14 +2780,6 @@ babel-loader@^8.0.5: pify "^4.0.1" schema-utils "^2.6.5" -babel-plugin-apply-mdx-type-prop@1.6.22: - version "1.6.22" - resolved "https://registry.npmjs.org/babel-plugin-apply-mdx-type-prop/-/babel-plugin-apply-mdx-type-prop-1.6.22.tgz#d216e8fd0de91de3f1478ef3231e05446bc8705b" - integrity sha512-VefL+8o+F/DfK24lPZMtJctrCVOfgbqLAGZSkxwhazQv4VxPg3Za/i40fu22KR2m8eEda+IfSOlPLUSIiLcnCQ== - dependencies: - "@babel/helper-plugin-utils" "7.10.4" - "@mdx-js/util" "1.6.22" - babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" resolved "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" @@ -2978,13 +2787,6 @@ babel-plugin-dynamic-import-node@^2.3.3: dependencies: object.assign "^4.1.0" -babel-plugin-extract-import-names@1.6.22: - version "1.6.22" - resolved "https://registry.npmjs.org/babel-plugin-extract-import-names/-/babel-plugin-extract-import-names-1.6.22.tgz#de5f9a28eb12f3eb2578bf74472204e66d1a13dc" - integrity sha512-yJ9BsJaISua7d8zNT7oRG1ZLBJCIdZ4PZqmH8qa9N5AK01ifk3fnkc98AXhtzE7UkfCsEumvoQWgoYLhOnJ7jQ== - dependencies: - "@babel/helper-plugin-utils" "7.10.4" - babylon@7.0.0-beta.44: version "7.0.0-beta.44" resolved "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz#89159e15e6e30c5096e22d738d8c0af8a0e8ca1d" @@ -3346,11 +3148,6 @@ camel-case@^4.1.1: pascal-case "^3.1.2" tslib "^2.0.3" -camelcase-css@2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" - integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== - camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -3417,26 +3214,16 @@ caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: resolved "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30001156.tgz#279f2188d3f7a29313ec0e7e9efb600ca9c61418" integrity sha512-L9vmkUDqH5QWgnB3RUukW1B5P6Vvkf44pjvaoPOUbIkchkUsq+vwXjzjQl9Hw3Ri8xS3XJmfm3H0UGyTx+s+Rg== -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001173: - version "1.0.30001173" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001173.tgz#3c47bbe3cd6d7a9eda7f50ac016d158005569f56" - integrity sha512-R3aqmjrICdGCTAnSXtNyvWYMK3YtV5jwudbq0T7nN9k4kmE4CBuwPqyJ+KBzepSTh0huivV2gLbSMEzTTmfeYw== - -caniuse-lite@^1.0.30001154: - version "1.0.30001156" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001156.tgz#75c20937b6012fe2b02ab58b30d475bf0718de97" - integrity sha512-z7qztybA2eFZTB6Z3yvaQBIoJpQtsewRD74adw2UbRWwsRq3jIPvgrQGawBMbfafekQaD21FWuXNcywtTDGGCw== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001154, caniuse-lite@^1.0.30001173: + version "1.0.30001234" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001234.tgz" + integrity sha512-a3gjUVKkmwLdNysa1xkUAwN2VfJUJyVW47rsi3aCbkRCtbHAfo+rOsCqVw29G6coQ8gzAPb5XBXwiGHwme3isA== caseless@~0.12.0: version "0.12.0" resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -ccount@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" - integrity sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg== - chalk@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -3787,11 +3574,6 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -comma-separated-tokens@^1.0.0: - version "1.0.8" - resolved "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" - integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== - commander@2.15.1: version "2.15.1" resolved "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" @@ -4571,13 +4353,6 @@ destroy@~1.0.4: resolved "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= -detab@2.0.4: - version "2.0.4" - resolved "https://registry.npmjs.org/detab/-/detab-2.0.4.tgz#b927892069aff405fbb9a186fe97a44a92a94b43" - integrity sha512-8zdsQA5bIkoRECvCrNKPla84lyoR7DSAyf7p0YgXzBO9PDJx8KntPUay7NS6yp+KdxdVtiE5SpHKtbp2ZQyA9g== - dependencies: - repeat-string "^1.5.4" - detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" @@ -4840,7 +4615,7 @@ entities@^1.1.1: resolved "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== -entities@^2.0.0: +entities@^2.0.0, entities@~2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== @@ -5718,6 +5493,13 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" +front-matter@^4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/front-matter/-/front-matter-4.0.2.tgz#b14e54dc745cfd7293484f3210d15ea4edd7f4d5" + integrity sha512-I8ZuJ/qG92NWX8i5x1Y8qyj3vizhXS31OxjKDu3LKP+7/qBgfIKValiZIEwoVoJKUHlhWtYrktkxV1XsX+pPlg== + dependencies: + js-yaml "^3.13.1" + fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" @@ -6162,74 +5944,6 @@ has@^1.0.0, has@^1.0.1, has@^1.0.3: dependencies: function-bind "^1.1.1" -hast-to-hyperscript@^9.0.0: - version "9.0.1" - resolved "https://registry.npmjs.org/hast-to-hyperscript/-/hast-to-hyperscript-9.0.1.tgz#9b67fd188e4c81e8ad66f803855334173920218d" - integrity sha512-zQgLKqF+O2F72S1aa4y2ivxzSlko3MAvxkwG8ehGmNiqd98BIN3JM1rAJPmplEyLmGLO2QZYJtIneOSZ2YbJuA== - dependencies: - "@types/unist" "^2.0.3" - comma-separated-tokens "^1.0.0" - property-information "^5.3.0" - space-separated-tokens "^1.0.0" - style-to-object "^0.3.0" - unist-util-is "^4.0.0" - web-namespaces "^1.0.0" - -hast-util-from-parse5@^6.0.0: - version "6.0.1" - resolved "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-6.0.1.tgz#554e34abdeea25ac76f5bd950a1f0180e0b3bc2a" - integrity sha512-jeJUWiN5pSxW12Rh01smtVkZgZr33wBokLzKLwinYOUfSzm1Nl/c3GUGebDyOKjdsRgMvoVbV0VpAcpjF4NrJA== - dependencies: - "@types/parse5" "^5.0.0" - hastscript "^6.0.0" - property-information "^5.0.0" - vfile "^4.0.0" - vfile-location "^3.2.0" - web-namespaces "^1.0.0" - -hast-util-parse-selector@^2.0.0: - version "2.2.5" - resolved "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz#d57c23f4da16ae3c63b3b6ca4616683313499c3a" - integrity sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ== - -hast-util-raw@6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-6.0.1.tgz#973b15930b7529a7b66984c98148b46526885977" - integrity sha512-ZMuiYA+UF7BXBtsTBNcLBF5HzXzkyE6MLzJnL605LKE8GJylNjGc4jjxazAHUtcwT5/CEt6afRKViYB4X66dig== - dependencies: - "@types/hast" "^2.0.0" - hast-util-from-parse5 "^6.0.0" - hast-util-to-parse5 "^6.0.0" - html-void-elements "^1.0.0" - parse5 "^6.0.0" - unist-util-position "^3.0.0" - vfile "^4.0.0" - web-namespaces "^1.0.0" - xtend "^4.0.0" - zwitch "^1.0.0" - -hast-util-to-parse5@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-6.0.0.tgz#1ec44650b631d72952066cea9b1445df699f8479" - integrity sha512-Lu5m6Lgm/fWuz8eWnrKezHtVY83JeRGaNQ2kn9aJgqaxvVkFCZQBEhgodZUDUvoodgyROHDb3r5IxAEdl6suJQ== - dependencies: - hast-to-hyperscript "^9.0.0" - property-information "^5.0.0" - web-namespaces "^1.0.0" - xtend "^4.0.0" - zwitch "^1.0.0" - -hastscript@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/hastscript/-/hastscript-6.0.0.tgz#e8768d7eac56c3fdeac8a92830d58e811e5bf640" - integrity sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w== - dependencies: - "@types/hast" "^2.0.0" - comma-separated-tokens "^1.0.0" - hast-util-parse-selector "^2.0.0" - property-information "^5.0.0" - space-separated-tokens "^1.0.0" - he@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" @@ -6240,10 +5954,10 @@ hex-color-regex@^1.1.0: resolved "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== -highlight.js@^10.5.0: - version "10.5.0" - resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-10.5.0.tgz#3f09fede6a865757378f2d9ebdcbc15ba268f98f" - integrity sha512-xTmvd9HiIHR6L53TMC7TKolEj65zG1XU+Onr8oi86mYa+nLcIbxTTWkpW7CsEwv/vK7u1zb8alZIMLDqqN6KTw== +highlight.js@^11.0.1: + version "11.0.1" + resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-11.0.1.tgz#a78bafccd9aa297978799fe5eed9beb7ee1ef887" + integrity sha512-EqYpWyTF2s8nMfttfBA2yLKPNoZCO33pLS4MnbXQ4hECf1TKujCt1Kq7QAdrio7roL4+CqsfjqwYj4tYgq0pJQ== history@^4.7.2: version "4.10.1" @@ -6337,11 +6051,6 @@ html-minifier@^4.0.0: relateurl "^0.2.7" uglify-js "^3.5.1" -html-void-elements@^1.0.0: - version "1.0.5" - resolved "https://registry.npmjs.org/html-void-elements/-/html-void-elements-1.0.5.tgz#ce9159494e86d95e45795b166c2021c2cfca4483" - integrity sha512-uE/TxKuyNIcx44cIWnjr/rfIATDH7ZaOMmstu0CwhFG1Dunhlp4OC6/NMbhiwoq5BpW0ubi303qnEk/PZj614w== - html-webpack-plugin@^4.5.1: version "4.5.1" resolved "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-4.5.1.tgz#40aaf1b5cb78f2f23a83333999625c20929cda65" @@ -6658,11 +6367,6 @@ init-package-json@^1.10.3: validate-npm-package-license "^3.0.1" validate-npm-package-name "^3.0.0" -inline-style-parser@0.1.1: - version "0.1.1" - resolved "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" - integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== - inquirer@^3.0.6: version "3.3.0" resolved "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" @@ -6789,7 +6493,7 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-alphabetical@1.0.4, is-alphabetical@^1.0.0: +is-alphabetical@^1.0.0: version "1.0.4" resolved "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" integrity sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg== @@ -6836,11 +6540,6 @@ is-buffer@^1.0.2, is-buffer@^1.1.4, is-buffer@^1.1.5: resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-buffer@^2.0.0: - version "2.0.5" - resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" - integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== - is-callable@^1.1.4, is-callable@^1.2.2: version "1.2.2" resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" @@ -7033,11 +6732,6 @@ is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= -is-plain-obj@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -7452,6 +7146,13 @@ lines-and-columns@^1.1.6: resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= +linkify-it@^3.0.1: + version "3.0.2" + resolved "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.2.tgz#f55eeb8bc1d3ae754049e124ab3bb56d97797fb8" + integrity sha512-gDBO4aHNZS6coiZCKVhSNh43F9ioIL4JwRjLZPkoLIY4yZFwg264Y5lu2x6rb1Js42Gh6Yqm2f6L2AJcnkzinQ== + dependencies: + uc.micro "^1.0.1" + load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -7499,15 +7200,6 @@ loader-runner@^4.2.0: resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384" integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== -loader-utils@2.0.0, loader-utils@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0" - integrity sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^2.1.2" - loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" @@ -7517,6 +7209,15 @@ loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4 emojis-list "^3.0.0" json5 "^1.0.1" +loader-utils@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0" + integrity sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ== + dependencies: + big.js "^5.2.2" + emojis-list "^3.0.0" + json5 "^2.1.2" + loading-cli@^1.0.6: version "1.1.0" resolved "https://registry.npmjs.org/loading-cli/-/loading-cli-1.1.0.tgz#3457edaa3290439ad0061755174363a8091d56bc" @@ -7614,7 +7315,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash.uniq@4.5.0, lodash.uniq@^4.5.0: +lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= @@ -7761,6 +7462,22 @@ markdown-escapes@^1.0.0: resolved "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg== +markdown-it-container@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/markdown-it-container/-/markdown-it-container-3.0.0.tgz#1d19b06040a020f9a827577bb7dbf67aa5de9a5b" + integrity sha512-y6oKTq4BB9OQuY/KLfk/O3ysFhB3IMYoIWhGJEidXt1NQFocFK2sA2t0NYZAMyMShAGL6x5OPIbrmXPIqaN9rw== + +markdown-it@^12.0.6: + version "12.0.6" + resolved "https://registry.npmjs.org/markdown-it/-/markdown-it-12.0.6.tgz#adcc8e5fe020af292ccbdf161fe84f1961516138" + integrity sha512-qv3sVLl4lMT96LLtR7xeRJX11OUFjsaD5oVat2/SNBIb21bJXwal2+SklcRbTwGwqWpWH/HRtYavOoJE+seL8w== + dependencies: + argparse "^2.0.1" + entities "~2.1.0" + linkify-it "^3.0.1" + mdurl "^1.0.1" + uc.micro "^1.0.5" + math-expression-evaluator@^1.2.14: version "1.2.22" resolved "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.22.tgz#c14dcb3d8b4d150e5dcea9c68c8dad80309b0d5e" @@ -7788,34 +7505,6 @@ mdast-add-list-metadata@1.0.1: dependencies: unist-util-visit-parents "1.1.2" -mdast-squeeze-paragraphs@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/mdast-squeeze-paragraphs/-/mdast-squeeze-paragraphs-4.0.0.tgz#7c4c114679c3bee27ef10b58e2e015be79f1ef97" - integrity sha512-zxdPn69hkQ1rm4J+2Cs2j6wDEv7O17TfXTJ33tl/+JPIoEmtV9t2ZzBM5LPHE8QlHsmVD8t3vPKCyY3oH+H8MQ== - dependencies: - unist-util-remove "^2.0.0" - -mdast-util-definitions@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-4.0.0.tgz#c5c1a84db799173b4dcf7643cda999e440c24db2" - integrity sha512-k8AJ6aNnUkB7IE+5azR9h81O5EQ/cTDXtWdMq9Kk5KcEW/8ritU5CeLg/9HhOC++nALHBlaogJ5jz0Ybk3kPMQ== - dependencies: - unist-util-visit "^2.0.0" - -mdast-util-to-hast@10.0.1: - version "10.0.1" - resolved "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-10.0.1.tgz#0cfc82089494c52d46eb0e3edb7a4eb2aea021eb" - integrity sha512-BW3LM9SEMnjf4HXXVApZMt8gLQWVNXc3jryK0nJu/rOXPOnlkUjmdkDlmxMirpbU9ILncGFIwLH/ubnWBbcdgA== - dependencies: - "@types/mdast" "^3.0.0" - "@types/unist" "^2.0.0" - mdast-util-definitions "^4.0.0" - mdurl "^1.0.0" - unist-builder "^2.0.0" - unist-util-generated "^1.0.0" - unist-util-position "^3.0.0" - unist-util-visit "^2.0.0" - mdn-data@2.0.14: version "2.0.14" resolved "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" @@ -7826,7 +7515,7 @@ mdn-data@2.0.4: resolved "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== -mdurl@^1.0.0: +mdurl@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= @@ -8926,18 +8615,6 @@ parse-entities@^1.1.0: is-decimal "^1.0.0" is-hexadecimal "^1.0.0" -parse-entities@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8" - integrity sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ== - dependencies: - character-entities "^1.0.0" - character-entities-legacy "^1.0.0" - character-reference-invalid "^1.0.0" - is-alphanumerical "^1.0.0" - is-decimal "^1.0.0" - is-hexadecimal "^1.0.0" - parse-github-repo-url@^1.3.0: version "1.4.1" resolved "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" @@ -8986,11 +8663,6 @@ parse-url@^5.0.0: parse-path "^4.0.0" protocols "^1.4.0" -parse5@^6.0.0: - version "6.0.1" - resolved "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" - integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== - parseurl@~1.3.2, parseurl@~1.3.3: version "1.3.3" resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -9846,13 +9518,6 @@ prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: object-assign "^4.1.1" react-is "^16.8.1" -property-information@^5.0.0, property-information@^5.3.0: - version "5.6.0" - resolved "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz#61675545fb23002f245c6540ec46077d4da3ed69" - integrity sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA== - dependencies: - xtend "^4.0.0" - proto-list@~1.2.1: version "1.2.4" resolved "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -10439,47 +10104,6 @@ relateurl@^0.2.7: resolved "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= -remark-footnotes@2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/remark-footnotes/-/remark-footnotes-2.0.0.tgz#9001c4c2ffebba55695d2dd80ffb8b82f7e6303f" - integrity sha512-3Clt8ZMH75Ayjp9q4CorNeyjwIxHFcTkaektplKGl2A1jNGEUey8cKL0ZC5vJwfcD5GFGsNLImLG/NGzWIzoMQ== - -remark-mdx@1.6.22: - version "1.6.22" - resolved "https://registry.npmjs.org/remark-mdx/-/remark-mdx-1.6.22.tgz#06a8dab07dcfdd57f3373af7f86bd0e992108bbd" - integrity sha512-phMHBJgeV76uyFkH4rvzCftLfKCr2RZuF+/gmVcaKrpsihyzmhXjA0BEMDaPTXG5y8qZOKPVo83NAOX01LPnOQ== - dependencies: - "@babel/core" "7.12.9" - "@babel/helper-plugin-utils" "7.10.4" - "@babel/plugin-proposal-object-rest-spread" "7.12.1" - "@babel/plugin-syntax-jsx" "7.12.1" - "@mdx-js/util" "1.6.22" - is-alphabetical "1.0.4" - remark-parse "8.0.3" - unified "9.2.0" - -remark-parse@8.0.3: - version "8.0.3" - resolved "https://registry.npmjs.org/remark-parse/-/remark-parse-8.0.3.tgz#9c62aa3b35b79a486454c690472906075f40c7e1" - integrity sha512-E1K9+QLGgggHxCQtLt++uXltxEprmWzNfg+MxpfHsZlrddKzZ/hZyWHDbK3/Ap8HJQqYJRXP+jHczdL6q6i85Q== - dependencies: - ccount "^1.0.0" - collapse-white-space "^1.0.2" - is-alphabetical "^1.0.0" - is-decimal "^1.0.0" - is-whitespace-character "^1.0.0" - is-word-character "^1.0.0" - markdown-escapes "^1.0.0" - parse-entities "^2.0.0" - repeat-string "^1.5.4" - state-toggle "^1.0.0" - trim "0.0.1" - trim-trailing-lines "^1.0.0" - unherit "^1.0.4" - unist-util-remove-position "^2.0.0" - vfile-location "^3.0.0" - xtend "^4.0.1" - remark-parse@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/remark-parse/-/remark-parse-5.0.0.tgz#4c077f9e499044d1d5c13f80d7a98cf7b9285d95" @@ -10501,13 +10125,6 @@ remark-parse@^5.0.0: vfile-location "^2.0.0" xtend "^4.0.1" -remark-squeeze-paragraphs@4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/remark-squeeze-paragraphs/-/remark-squeeze-paragraphs-4.0.0.tgz#76eb0e085295131c84748c8e43810159c5653ead" - integrity sha512-8qRqmL9F4nuLPIgl92XUuxI3pFxize+F1H0e/W3llTk0UsjJaj01+RrirkMw7P21RKe4X6goQhYRSvNWX+70Rw== - dependencies: - mdast-squeeze-paragraphs "^4.0.0" - remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -11164,11 +10781,6 @@ source-map@^0.7.3, source-map@~0.7.2: resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== -space-separated-tokens@^1.0.0: - version "1.1.5" - resolved "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899" - integrity sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA== - spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" @@ -11521,13 +11133,6 @@ style-loader@^0.19.1: loader-utils "^1.0.2" schema-utils "^0.3.0" -style-to-object@0.3.0, style-to-object@^0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46" - integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA== - dependencies: - inline-style-parser "0.1.1" - stylehacks@^4.0.0: version "4.0.3" resolved "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz#6718fcaf4d1e07d8a1318690881e8d96726a71d5" @@ -11994,6 +11599,11 @@ typedarray@^0.0.6: resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= +uc.micro@^1.0.1, uc.micro@^1.0.5: + version "1.0.6" + resolved "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" + integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== + uglify-js@^3.1.4: version "3.11.5" resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.5.tgz#d6788bc83cf35ff18ea78a65763e480803409bc6" @@ -12053,18 +11663,6 @@ unicode-property-aliases-ecmascript@^1.0.4: resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz#dd57a99f6207bedff4628abefb94c50db941c8f4" integrity sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg== -unified@9.2.0: - version "9.2.0" - resolved "https://registry.npmjs.org/unified/-/unified-9.2.0.tgz#67a62c627c40589edebbf60f53edfd4d822027f8" - integrity sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg== - dependencies: - bail "^1.0.0" - extend "^3.0.0" - is-buffer "^2.0.0" - is-plain-obj "^2.0.0" - trough "^1.0.0" - vfile "^4.0.0" - unified@^6.1.5: version "6.2.0" resolved "https://registry.npmjs.org/unified/-/unified-6.2.0.tgz#7fbd630f719126d67d40c644b7e3f617035f6dba" @@ -12111,31 +11709,11 @@ unique-slug@^2.0.0: dependencies: imurmurhash "^0.1.4" -unist-builder@2.0.3, unist-builder@^2.0.0: - version "2.0.3" - resolved "https://registry.npmjs.org/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436" - integrity sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw== - -unist-util-generated@^1.0.0: - version "1.1.6" - resolved "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-1.1.6.tgz#5ab51f689e2992a472beb1b35f2ce7ff2f324d4b" - integrity sha512-cln2Mm1/CZzN5ttGK7vkoGw+RZ8VcUH6BtGbq98DDtRGquAAOXig1mrBQYelOwMXYS8rK+vZDyyojSjp7JX+Lg== - unist-util-is@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz#d9e84381c2468e82629e4a5be9d7d05a2dd324cd" integrity sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A== -unist-util-is@^4.0.0: - version "4.1.0" - resolved "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz#976e5f462a7a5de73d94b706bac1b90671b57797" - integrity sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg== - -unist-util-position@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/unist-util-position/-/unist-util-position-3.1.0.tgz#1c42ee6301f8d52f47d14f62bbdb796571fa2d47" - integrity sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA== - unist-util-remove-position@^1.0.0: version "1.1.4" resolved "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.4.tgz#ec037348b6102c897703eee6d0294ca4755a2020" @@ -12143,32 +11721,11 @@ unist-util-remove-position@^1.0.0: dependencies: unist-util-visit "^1.1.0" -unist-util-remove-position@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz#5d19ca79fdba712301999b2b73553ca8f3b352cc" - integrity sha512-fDZsLYIe2uT+oGFnuZmy73K6ZxOPG/Qcm+w7jbEjaFcJgbQ6cqjs/eSPzXhsmGpAsWPkqZM9pYjww5QTn3LHMA== - dependencies: - unist-util-visit "^2.0.0" - -unist-util-remove@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/unist-util-remove/-/unist-util-remove-2.1.0.tgz#b0b4738aa7ee445c402fda9328d604a02d010588" - integrity sha512-J8NYPyBm4baYLdCbjmf1bhPu45Cr1MWTm77qd9istEkzWpnN6O9tMsEbB2JhNnBCqGENRqEWomQ+He6au0B27Q== - dependencies: - unist-util-is "^4.0.0" - unist-util-stringify-position@^1.0.0, unist-util-stringify-position@^1.1.1: version "1.1.2" resolved "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz#3f37fcf351279dcbca7480ab5889bb8a832ee1c6" integrity sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ== -unist-util-stringify-position@^2.0.0: - version "2.0.3" - resolved "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz#cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da" - integrity sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g== - dependencies: - "@types/unist" "^2.0.2" - unist-util-visit-parents@1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-1.1.2.tgz#f6e3afee8bdbf961c0e6f028ea3c0480028c3d06" @@ -12181,23 +11738,6 @@ unist-util-visit-parents@^2.0.0: dependencies: unist-util-is "^3.0.0" -unist-util-visit-parents@^3.0.0: - version "3.1.1" - resolved "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6" - integrity sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg== - dependencies: - "@types/unist" "^2.0.0" - unist-util-is "^4.0.0" - -unist-util-visit@2.0.3, unist-util-visit@^2.0.0: - version "2.0.3" - resolved "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c" - integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== - dependencies: - "@types/unist" "^2.0.0" - unist-util-is "^4.0.0" - unist-util-visit-parents "^3.0.0" - unist-util-visit@^1.1.0, unist-util-visit@^1.3.0: version "1.4.1" resolved "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz#4724aaa8486e6ee6e26d7ff3c8685960d560b1e3" @@ -12386,11 +11926,6 @@ vfile-location@^2.0.0: resolved "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.6.tgz#8a274f39411b8719ea5728802e10d9e0dff1519e" integrity sha512-sSFdyCP3G6Ka0CEmN83A2YCMKIieHx0EDaj5IDP4g1pa5ZJ4FJDvpO0WODLxo4LUX4oe52gmSCK7Jw4SBghqxA== -vfile-location@^3.0.0, vfile-location@^3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/vfile-location/-/vfile-location-3.2.0.tgz#d8e41fbcbd406063669ebf6c33d56ae8721d0f3c" - integrity sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA== - vfile-message@^1.0.0: version "1.1.1" resolved "https://registry.npmjs.org/vfile-message/-/vfile-message-1.1.1.tgz#5833ae078a1dfa2d96e9647886cd32993ab313e1" @@ -12398,14 +11933,6 @@ vfile-message@^1.0.0: dependencies: unist-util-stringify-position "^1.1.1" -vfile-message@^2.0.0: - version "2.0.4" - resolved "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz#5b43b88171d409eae58477d13f23dd41d52c371a" - integrity sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ== - dependencies: - "@types/unist" "^2.0.0" - unist-util-stringify-position "^2.0.0" - vfile@^2.0.0: version "2.3.0" resolved "https://registry.npmjs.org/vfile/-/vfile-2.3.0.tgz#e62d8e72b20e83c324bc6c67278ee272488bf84a" @@ -12416,16 +11943,6 @@ vfile@^2.0.0: unist-util-stringify-position "^1.0.0" vfile-message "^1.0.0" -vfile@^4.0.0: - version "4.2.1" - resolved "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz#03f1dce28fc625c625bc6514350fbdb00fa9e624" - integrity sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA== - dependencies: - "@types/unist" "^2.0.0" - is-buffer "^2.0.0" - unist-util-stringify-position "^2.0.0" - vfile-message "^2.0.0" - warning@^4.0.1: version "4.0.3" resolved "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3" @@ -12455,11 +11972,6 @@ wcwidth@^1.0.0, wcwidth@^1.0.1: dependencies: defaults "^1.0.3" -web-namespaces@^1.0.0: - version "1.1.4" - resolved "https://registry.npmjs.org/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec" - integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw== - webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" @@ -12870,8 +12382,3 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== - -zwitch@^1.0.0: - version "1.0.5" - resolved "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" - integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== From 0f904395655577393e641e6cdfe745cb08ac38d6 Mon Sep 17 00:00:00 2001 From: MuYunyun <328375795@qq.com> Date: Sat, 5 Jun 2021 21:44:01 +0800 Subject: [PATCH 4/9] feat: support write cp in md --- ...30\350\256\244\344\270\273\351\242\230.md" | 37 -- packages/crd-markdown-loader/index.js | 7 +- packages/scripts/package.json | 2 +- packages/scripts/src/conf/mdloader.js | 131 ---- .../scripts/src/conf/modifyMarkdownLoader.js | 24 + packages/scripts/src/conf/webpack.config.js | 49 +- packages/theme/markdown/index.js | 50 +- packages/theme/package.json | 1 + yarn.lock | 567 +++++++++++++++++- 9 files changed, 629 insertions(+), 239 deletions(-) delete mode 100644 packages/scripts/src/conf/mdloader.js create mode 100644 packages/scripts/src/conf/modifyMarkdownLoader.js diff --git "a/docs/\351\273\230\350\256\244\344\270\273\351\242\230.md" "b/docs/\351\273\230\350\256\244\344\270\273\351\242\230.md" index 843946479..a7f83148c 100644 --- "a/docs/\351\273\230\350\256\244\344\270\273\351\242\230.md" +++ "b/docs/\351\273\230\350\256\244\344\270\273\351\242\230.md" @@ -1,39 +1,2 @@ ## 默认主题 -create-react-doc 的默认主题为 [crd-seed](https://github.com/MuYunyun/create-react-doc/tree/main/packages/crd-seed)。该主题有以下特性: - -* 适配移动、PC 多端展示。 -* 支持暗黑模式。 -* 文档支持内嵌 codepen、codesandbox。 -* GitHub 联动。 - -使用该主题搭建的项目有: - -* [blog](https://github.com/MuYunyun/blog), [站点](http://muyunyun.cn/blog) - * ![](http://with.muyunyun.cn/ec330b8ac2175c828be41f446f9f9619.jpg) - * ![](http://with.muyunyun.cn/2e7440e4256debda2d73a4e6392c7146.jpg-300) -* [diana](https://github.com/MuYunyun/diana), [站点](https://muyunyun.cn/diana/) - -> 如果您有其它的改进优化想法, 欢迎留言补充 - -## config.yml - -[config.yml](https://github.com/MuYunyun/create-react-doc/blob/main/packages/templates/default/_config.yml) 文件是配置站点主题功能的地方。 - -它支持配置的属性如下: - -| 属性名 | 作用 | 类型 | 默认 | -| :------------: | :----------------------------------: | :------------------: | :------: | -| title | 站点名 | string | | -| menu | 作为站点菜单的文件/文件夹路径 | string[] | | -| menuOpenKeys | 默认展开菜单的文件夹路径 | string | | -| user | Github 用户名 | string | | -| repo | Github 项目名 | string | | -| language | 站点语言 | en \| zh-cn | en | -| github-ribbons | 是否在右上角显示 github 丝带 | boolean | false | -| theme | 使用主题 | string | crd-seed | -| devTheme | 开发自定义主题时, 需设置其为 true | string | ./index | -| seo | 是否开启 SEO 优化 | { google?: boolean } | | -| domain | SEO 优化的站点域名, 用于生成 sitemap | string | | - -详细用法可以参考 [config.yml](https://github.com/MuYunyun/blog/blob/main/config.yml)。 \ No newline at end of file diff --git a/packages/crd-markdown-loader/index.js b/packages/crd-markdown-loader/index.js index 45cb4556a..38333938c 100644 --- a/packages/crd-markdown-loader/index.js +++ b/packages/crd-markdown-loader/index.js @@ -81,7 +81,8 @@ const formatOpening = () => const formatClosing = () => `
` -function markdownLoader(source: any) { +module.exports = function (source: any) { + console.log('✅✅✅✅✅source') const { body, attributes: { imports: importMap }, @@ -124,7 +125,5 @@ function markdownLoader(source: any) { .replace(/\(_blank\)/g, ` target="_blank">`) - return formatModule(imports, content) + return `module.exports = ${formatModule(imports, content)}` } - -module.exports = markdownLoader diff --git a/packages/scripts/package.json b/packages/scripts/package.json index 5952fef9c..786bd5ca2 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -15,6 +15,7 @@ "@babel/preset-env": "^7.3.4", "@babel/preset-react": "^7.0.0", "@babel/runtime": "^7.3.4", + "@mdx-js/loader": "^1.6.22", "@nuxtjs/friendly-errors-webpack-plugin": "^2.0.2", "babel-eslint": "^8.0.1", "babel-loader": "^8.0.5", @@ -49,7 +50,6 @@ "postcss-flexbugs-fixes": "^3.3.1", "postcss-loader": "^2.0.9", "process": "^0.11.10", - "raw-content-replace-loader": "^1.0.1", "rimraf": "^2.6.2", "string-replace-loader": "^3.0.1", "style-loader": "^0.19.1", diff --git a/packages/scripts/src/conf/mdloader.js b/packages/scripts/src/conf/mdloader.js deleted file mode 100644 index c7a3caa08..000000000 --- a/packages/scripts/src/conf/mdloader.js +++ /dev/null @@ -1,131 +0,0 @@ -import highlight from 'highlight.js' -import frontMatter from 'front-matter' -import mdContainer from 'markdown-it-container' -import md from 'markdown-it' - -const options = { - className: 'wrap', -} - -const mdLoader = md({ - html: true, // Enable HTML tags in source - xhtmlOut: true, // Use '/' to close single tags (
) - typographer: false, - linkify: false, // Auto convert URL-like text to links -}) - .enable(['smartquotes']) - .set({ - highlight(content: any, languageHint: any) { - let highlightedContent = null - - highlight.configure({ - useBR: true, - tabReplace: ' ', - }) - - if (languageHint && highlight.getLanguage(languageHint)) { - try { - highlightedContent = highlight.highlight(languageHint, content).value - } catch (err) { - console.log(err) - } - } - - if (!highlightedContent) { - try { - highlightedContent = highlight.highlightAuto(content).value - } catch (err) { - console.log(err) - } - } - - // 把代码中的{}转 - highlightedContent = highlightedContent.replace( - /[{}]/g, - (match: string) => `{'${match}'}`, - ) - // 加上 highlight js - highlightedContent = highlightedContent - .replace('', '') - - return highlight.fixMarkup(highlightedContent) - }, - }) - -/** at-component-docs__container 用于做除 demo 和 table 之外的公共样式 */ -const formatModule = (imports: string, jsx: string) => { - const moduleText = ` - ${imports} - - export default class extends React.Component { - render(){ - return ( -
-
- ${jsx} -
-
- ); - } - };` - return moduleText -} - -const formatOpening = () => - `
-
-
` -const formatClosing = () => - `
` - -function markdownLoader(source: any) { - const { - body, - attributes: { imports: importMap }, - } = frontMatter(source) - const imports = `import * as React from 'react';${importMap}` - - /* 处理 :::demo 开头的 markdown 内容 */ - mdLoader.use(mdContainer, 'demo', { - validate: (params: string) => params.trim().match(/^demo\s*(.*)$/), - render: (tokens: any[], idx: number) => { - // container 从开头到结尾把之间的token跑一遍,其中idx定位到具体的位置 - // 有此标记代表 ::: 开始 - if (tokens[idx].nesting === 1) { - let i = 1 - // 从 ::: 下一个token开始 - let token = tokens[idx + i] - - // 如果没有到结尾 - while (token.markup !== ':::') { - i++ - token = tokens[idx + i] - } - // 描述也执行md - return formatOpening() - } - return formatClosing() - }, - }) - - // md 处理过后的字符串含有 class 和 style ,需要再次处理给到 react - let content = mdLoader.render(body) - - content = content - .replace(/
/g, '
') - .replace(/
/g, '
') - .replace(/class=/g, 'className=') - .replace(/style="text-align:center"/g, 'style={{ textAlign: "center"}}') - .replace(/style="text-align:left"/g, 'style={{ textAlign: "left"}}') - .replace(/style="text-align:right"/g, 'style={{ textAlign: "right"}}') - .replace(/\(_blank\)/g, ` target="_blank">`) - - return formatModule(imports, content) -} - - -console.log('123', 123) - -module.exports = markdownLoader diff --git a/packages/scripts/src/conf/modifyMarkdownLoader.js b/packages/scripts/src/conf/modifyMarkdownLoader.js new file mode 100644 index 000000000..7d2333bdb --- /dev/null +++ b/packages/scripts/src/conf/modifyMarkdownLoader.js @@ -0,0 +1,24 @@ +/** + * this webpack plugin is to modify markdown position. + */ +const loaderUtils = require('loader-utils') +const PATH = require('path') +const FS = require('fs') + +module.exports = function (source) { + const options = loaderUtils.getOptions(this) || {} + const { replace, sep, path, include, extensions } = options + let content = '' + + let fpath = this.resourcePath.replace(sep || /___/g, PATH.sep) + if (path && replace && (!include || include.test(fpath))) { + fpath = fpath.replace(path, replace) + this.addDependency(fpath) + } + + if (FS.existsSync(fpath)) { + content = FS.readFileSync(fpath) + } + // content = JSON.stringify(content).replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029'); + return content +} diff --git a/packages/scripts/src/conf/webpack.config.js b/packages/scripts/src/conf/webpack.config.js index 22d57a041..5f2adc009 100644 --- a/packages/scripts/src/conf/webpack.config.js +++ b/packages/scripts/src/conf/webpack.config.js @@ -32,8 +32,6 @@ if (docsConfig) { } } -console.log(`require.resolve('crd-markdown-loader')`, require.resolve('crd-markdown-loader')) - module.exports = { entry: {}, output: { @@ -65,9 +63,19 @@ module.exports = { { test: /\.md$/, use: [ + // { + // loader: require.resolve('crd-markdown-loader'), + // }, + // 'crd-markdown-loader', + // 'babel-loader' { - // https://github.com/react-doc/raw-content-replace-loader/blob/master/index.js - loader: require.resolve('raw-content-replace-loader'), + loader: require.resolve('babel-loader'), + options: require('../../.babelrc'), // eslint-disable-line + }, + '@mdx-js/loader', + // 'crd-markdown-loader', + { + loader: `${path.join(__dirname, './modifyMarkdownLoader.js')}`, options: { path: path.join(cacheDirPath, './md'), // dir need to replace replace: paths.projectPath, // the dir to replace @@ -76,25 +84,20 @@ module.exports = { }, ], }, - { - test: /\.md$/, - use: [ - // { - // loader: `babel-loader!${path.join(__dirname, './mdloader.js')}`, - // }, - { - loader: require.resolve('crd-markdown-loader'), - }, - { - loader: require.resolve('babel-loader'), - // options: require('../../.babelrc'), // eslint-disable-line - }, - ], - }, // { - // test: /\.mdx?$/, - // use: ['babel-loader', '@mdx-js/loader'], - // include: [/\.cache\/md/], + // test: /\.md$/, + // use: [ + // // { + // // loader: `babel-loader!${path.join(__dirname, './mdloader.js')}`, + // // }, + // { + // loader: require.resolve('crd-markdown-loader'), + // }, + // { + // loader: require.resolve('babel-loader'), + // options: require('../../.babelrc'), // eslint-disable-line + // }, + // ], // }, // “file-loader”确保这些资源由WebpackDevServer服务。 // 当您导入资源时,您将获得(虚拟)文件名。 @@ -128,8 +131,6 @@ module.exports = { resolve: { fallback: { path: require.resolve('path-browserify'), - assert: false, - fs: false, }, }, } diff --git a/packages/theme/markdown/index.js b/packages/theme/markdown/index.js index 456aa3031..cf7953736 100644 --- a/packages/theme/markdown/index.js +++ b/packages/theme/markdown/index.js @@ -3,10 +3,14 @@ import cx from 'classnames' import ReactMarkdown from 'react-markdown' import hljs from 'highlight.js' import { renderToString } from 'react-dom/server' +import { MDXProvider } from '@mdx-js/react' import InlineCode from './InlineCode' import Link from './Link' import Loading from '../component/Loading' import styles from './style/index.less' +// import A from '../../../.cache/md/docs___快速上手.md' + +// console.log('abcde', a) hljs.configure({ tabReplace: ' ', // 2 spaces @@ -22,7 +26,7 @@ const formatPath = path => function Markdown({ props }) { const { type, relative } = props - const [markdownStr, setMarkdownStr] = useState(null) + const [MarkdownCP, setMarkdownCP] = useState(null) const markdownWrapperRef = useRef(null) const renderMarkdown = () => { @@ -33,8 +37,8 @@ function Markdown({ props }) { filename = formatPath(relativeMd) } import(`__project_root__/.cache/md/${filename}.md`).then((data) => { - console.log('data', data) - setMarkdownStr(data.default || data) + // data.default is a function, so we should write () => data.default in setState here. + setMarkdownCP(() => (data.default || data)) }) } @@ -51,24 +55,32 @@ function Markdown({ props }) { // } // }, [markdownStr]) - console.log('markdownStr', markdownStr) + // console.log('markdownStr', markdownStr) + // { /* {markdownStr ? ( + // // + //
123
+ // ) : ( + // + // )} */ } return (
- {markdownStr ? ( - // -
123
- ) : ( - - )} + { + MarkdownCP + ? + + + + : + }
) } diff --git a/packages/theme/package.json b/packages/theme/package.json index 12227832a..51995b7dc 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -4,6 +4,7 @@ "description": "Default Theme with Create React Doc", "main": "index.js", "dependencies": { + "@mdx-js/react": "^1.6.22", "classnames": "^2.2.6", "diana": "^1.0.2", "less": "^3.0.2", diff --git a/yarn.lock b/yarn.lock index 6f9d9e103..6f1a6e9e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,11 +33,40 @@ dependencies: "@babel/highlight" "^7.10.4" +"@babel/code-frame@^7.12.13": + version "7.12.13" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" + integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== + dependencies: + "@babel/highlight" "^7.12.13" + "@babel/compat-data@^7.12.1", "@babel/compat-data@^7.12.5": version "7.12.5" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.5.tgz#f56db0c4bb1bbbf221b4e81345aab4141e7cb0e9" integrity sha512-DTsS7cxrsH3by8nqQSpFSyjSfSYl57D6Cf4q8dW3LK83tBKBDCkfcay1nYkXq1nIHXnpX8WMMb/O25HOy3h1zg== +"@babel/core@7.12.9": + version "7.12.9" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.12.9.tgz#fd450c4ec10cdbb980e2928b7aa7a28484593fc8" + integrity sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.12.5" + "@babel/helper-module-transforms" "^7.12.1" + "@babel/helpers" "^7.12.5" + "@babel/parser" "^7.12.7" + "@babel/template" "^7.12.7" + "@babel/traverse" "^7.12.9" + "@babel/types" "^7.12.7" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.1" + json5 "^2.1.2" + lodash "^4.17.19" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + "@babel/core@^7.3.4": version "7.12.3" resolved "https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz#1b436884e1e3bff6fb1328dc02b208759de92ad8" @@ -80,6 +109,15 @@ jsesc "^2.5.1" source-map "^0.5.0" +"@babel/generator@^7.14.2": + version "7.14.3" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.14.3.tgz#0c2652d91f7bddab7cccc6ba8157e4f40dcedb91" + integrity sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA== + dependencies: + "@babel/types" "^7.14.2" + jsesc "^2.5.1" + source-map "^0.5.0" + "@babel/helper-annotate-as-pure@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz#5bf0d495a3f757ac3bda48b5bf3b3ba309c72ba3" @@ -176,6 +214,15 @@ "@babel/template" "^7.10.4" "@babel/types" "^7.10.4" +"@babel/helper-function-name@^7.14.2": + version "7.14.2" + resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz#397688b590760b6ef7725b5f0860c82427ebaac2" + integrity sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ== + dependencies: + "@babel/helper-get-function-arity" "^7.12.13" + "@babel/template" "^7.12.13" + "@babel/types" "^7.14.2" + "@babel/helper-get-function-arity@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz#d03ca6dd2b9f7b0b1e6b32c56c72836140db3a15" @@ -190,6 +237,13 @@ dependencies: "@babel/types" "^7.10.4" +"@babel/helper-get-function-arity@^7.12.13": + version "7.12.13" + resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" + integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== + dependencies: + "@babel/types" "^7.12.13" + "@babel/helper-hoist-variables@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz#d49b001d1d5a68ca5e6604dda01a6297f7c9381e" @@ -233,7 +287,7 @@ dependencies: "@babel/types" "^7.10.4" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": +"@babel/helper-plugin-utils@7.10.4", "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== @@ -292,11 +346,23 @@ dependencies: "@babel/types" "^7.11.0" +"@babel/helper-split-export-declaration@^7.12.13": + version "7.12.13" + resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" + integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== + dependencies: + "@babel/types" "^7.12.13" + "@babel/helper-validator-identifier@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== +"@babel/helper-validator-identifier@^7.14.0": + version "7.14.0" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" + integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== + "@babel/helper-validator-option@^7.12.1": version "7.12.1" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.1.tgz#175567380c3e77d60ff98a54bb015fe78f2178d9" @@ -321,6 +387,15 @@ "@babel/traverse" "^7.12.5" "@babel/types" "^7.12.5" +"@babel/helpers@^7.12.5": + version "7.14.0" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.0.tgz#ea9b6be9478a13d6f961dbb5f36bf75e2f3b8f62" + integrity sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg== + dependencies: + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.14.0" + "@babel/types" "^7.14.0" + "@babel/highlight@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5" @@ -339,11 +414,25 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.12.13": + version "7.14.0" + resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz#3197e375711ef6bf834e67d0daec88e4f46113cf" + integrity sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg== + dependencies: + "@babel/helper-validator-identifier" "^7.14.0" + chalk "^2.0.0" + js-tokens "^4.0.0" + "@babel/parser@^7.10.4", "@babel/parser@^7.12.3", "@babel/parser@^7.12.5": version "7.12.5" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz#b4af32ddd473c0bfa643bd7ff0728b8e71b81ea0" integrity sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ== +"@babel/parser@^7.12.13", "@babel/parser@^7.12.7", "@babel/parser@^7.14.2": + version "7.14.4" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz#a5c560d6db6cd8e6ed342368dea8039232cbab18" + integrity sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA== + "@babel/plugin-proposal-async-generator-functions@^7.12.1": version "7.12.1" resolved "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.12.1.tgz#dc6c1170e27d8aca99ff65f4925bd06b1c90550e" @@ -409,7 +498,7 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.12.1": +"@babel/plugin-proposal-object-rest-spread@7.12.1", "@babel/plugin-proposal-object-rest-spread@^7.12.1": version "7.12.1" resolved "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz#def9bd03cea0f9b72283dac0ec22d289c7691069" integrity sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA== @@ -486,7 +575,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.12.1": +"@babel/plugin-syntax-jsx@7.12.1", "@babel/plugin-syntax-jsx@^7.12.1": version "7.12.1" resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.1.tgz#9d9d357cc818aa7ae7935917c1257f67677a0926" integrity sha512-1yRi7yAtB0ETgxdY9ti/p2TivUxJkTdhu/ZbF9MshVGqOx1TdB3b7xCXs49Fupgg50N45KcAsRP/ZqWjs9SRjg== @@ -514,7 +603,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-object-rest-spread@^7.2.0", "@babel/plugin-syntax-object-rest-spread@^7.8.0": +"@babel/plugin-syntax-object-rest-spread@7.8.3", "@babel/plugin-syntax-object-rest-spread@^7.2.0", "@babel/plugin-syntax-object-rest-spread@^7.8.0": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== @@ -988,6 +1077,15 @@ "@babel/parser" "^7.10.4" "@babel/types" "^7.10.4" +"@babel/template@^7.12.13", "@babel/template@^7.12.7": + version "7.12.13" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" + integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/parser" "^7.12.13" + "@babel/types" "^7.12.13" + "@babel/traverse@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966" @@ -1019,6 +1117,20 @@ globals "^11.1.0" lodash "^4.17.19" +"@babel/traverse@^7.12.9", "@babel/traverse@^7.14.0": + version "7.14.2" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.2.tgz#9201a8d912723a831c2679c7ebbf2fe1416d765b" + integrity sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.14.2" + "@babel/helper-function-name" "^7.14.2" + "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/parser" "^7.14.2" + "@babel/types" "^7.14.2" + debug "^4.1.0" + globals "^11.1.0" + "@babel/types@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757" @@ -1037,6 +1149,14 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" +"@babel/types@^7.12.13", "@babel/types@^7.12.7", "@babel/types@^7.14.0", "@babel/types@^7.14.2": + version "7.14.4" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.14.4.tgz#bfd6980108168593b38b3eb48a24aa026b919bc0" + integrity sha512-lCj4aIs0xUefJFQnwwQv2Bxg7Omd6bgquZ6LGC+gGMh6/s5qDVfjuCMlDmYQ15SLsWHd9n+X3E75lKIhl5Lkiw== + dependencies: + "@babel/helper-validator-identifier" "^7.14.0" + to-fast-properties "^2.0.0" + "@eslint/eslintrc@^0.2.1": version "0.2.1" resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.1.tgz#f72069c330461a06684d119384435e12a5d76e3c" @@ -1835,6 +1955,50 @@ npmlog "^4.1.2" write-file-atomic "^2.3.0" +"@mdx-js/loader@^1.6.22": + version "1.6.22" + resolved "https://registry.npmjs.org/@mdx-js/loader/-/loader-1.6.22.tgz#d9e8fe7f8185ff13c9c8639c048b123e30d322c4" + integrity sha512-9CjGwy595NaxAYp0hF9B/A0lH6C8Rms97e2JS9d3jVUtILn6pT5i5IV965ra3lIWc7Rs1GG1tBdVF7dCowYe6Q== + dependencies: + "@mdx-js/mdx" "1.6.22" + "@mdx-js/react" "1.6.22" + loader-utils "2.0.0" + +"@mdx-js/mdx@1.6.22": + version "1.6.22" + resolved "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-1.6.22.tgz#8a723157bf90e78f17dc0f27995398e6c731f1ba" + integrity sha512-AMxuLxPz2j5/6TpF/XSdKpQP1NlG0z11dFOlq+2IP/lSgl11GY8ji6S/rgsViN/L0BDvHvUMruRb7ub+24LUYA== + dependencies: + "@babel/core" "7.12.9" + "@babel/plugin-syntax-jsx" "7.12.1" + "@babel/plugin-syntax-object-rest-spread" "7.8.3" + "@mdx-js/util" "1.6.22" + babel-plugin-apply-mdx-type-prop "1.6.22" + babel-plugin-extract-import-names "1.6.22" + camelcase-css "2.0.1" + detab "2.0.4" + hast-util-raw "6.0.1" + lodash.uniq "4.5.0" + mdast-util-to-hast "10.0.1" + remark-footnotes "2.0.0" + remark-mdx "1.6.22" + remark-parse "8.0.3" + remark-squeeze-paragraphs "4.0.0" + style-to-object "0.3.0" + unified "9.2.0" + unist-builder "2.0.3" + unist-util-visit "2.0.3" + +"@mdx-js/react@1.6.22", "@mdx-js/react@^1.6.22": + version "1.6.22" + resolved "https://registry.npmjs.org/@mdx-js/react/-/react-1.6.22.tgz#ae09b4744fddc74714ee9f9d6f17a66e77c43573" + integrity sha512-TDoPum4SHdfPiGSAaRBw7ECyI8VaHpK8GJugbJIJuqyh6kzw9ZLJZW3HGL3NNrJGxcAixUvqROm+YuQOo5eXtg== + +"@mdx-js/util@1.6.22": + version "1.6.22" + resolved "https://registry.npmjs.org/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" + integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== + "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" @@ -2037,6 +2201,13 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/hast@^2.0.0": + version "2.3.1" + resolved "https://registry.npmjs.org/@types/hast/-/hast-2.3.1.tgz#b16872f2a6144c7025f296fb9636a667ebb79cd9" + integrity sha512-viwwrB+6xGzw+G1eWpF9geV3fnsDgXqHG+cqgiHrvQfDUW5hzhCyV7Sy3UJxhfRFBsgky2SSW33qi/YrIkjX5Q== + dependencies: + "@types/unist" "*" + "@types/html-minifier-terser@^5.0.0": version "5.1.1" resolved "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz#3c9ee980f1a10d6021ae6632ca3e79ca2ec4fb50" @@ -2052,6 +2223,13 @@ resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= +"@types/mdast@^3.0.0": + version "3.0.3" + resolved "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.3.tgz#2d7d671b1cd1ea3deb306ea75036c2a0407d2deb" + integrity sha512-SXPBMnFVQg1s00dlMCc/jCdvPqdE4mXaMMCeRlxLDmTAEoegHT53xKtkDnzDTOcmMHUfcjyf36/YYZ6SxRdnsw== + dependencies: + "@types/unist" "*" + "@types/minimatch@*": version "3.0.3" resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" @@ -2072,6 +2250,11 @@ resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== +"@types/parse5@^5.0.0": + version "5.0.3" + resolved "https://registry.npmjs.org/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109" + integrity sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw== + "@types/puppeteer@^2.0.0": version "2.1.5" resolved "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-2.1.5.tgz#9137aa87dca21450820bfd6fa4fe747bc8176381" @@ -2101,6 +2284,11 @@ dependencies: source-map "^0.6.1" +"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3": + version "2.0.3" + resolved "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" + integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ== + "@types/webpack-sources@*": version "2.1.0" resolved "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-2.1.0.tgz#8882b0bd62d1e0ce62f183d0d01b72e6e82e8c10" @@ -2780,6 +2968,14 @@ babel-loader@^8.0.5: pify "^4.0.1" schema-utils "^2.6.5" +babel-plugin-apply-mdx-type-prop@1.6.22: + version "1.6.22" + resolved "https://registry.npmjs.org/babel-plugin-apply-mdx-type-prop/-/babel-plugin-apply-mdx-type-prop-1.6.22.tgz#d216e8fd0de91de3f1478ef3231e05446bc8705b" + integrity sha512-VefL+8o+F/DfK24lPZMtJctrCVOfgbqLAGZSkxwhazQv4VxPg3Za/i40fu22KR2m8eEda+IfSOlPLUSIiLcnCQ== + dependencies: + "@babel/helper-plugin-utils" "7.10.4" + "@mdx-js/util" "1.6.22" + babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" resolved "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" @@ -2787,6 +2983,13 @@ babel-plugin-dynamic-import-node@^2.3.3: dependencies: object.assign "^4.1.0" +babel-plugin-extract-import-names@1.6.22: + version "1.6.22" + resolved "https://registry.npmjs.org/babel-plugin-extract-import-names/-/babel-plugin-extract-import-names-1.6.22.tgz#de5f9a28eb12f3eb2578bf74472204e66d1a13dc" + integrity sha512-yJ9BsJaISua7d8zNT7oRG1ZLBJCIdZ4PZqmH8qa9N5AK01ifk3fnkc98AXhtzE7UkfCsEumvoQWgoYLhOnJ7jQ== + dependencies: + "@babel/helper-plugin-utils" "7.10.4" + babylon@7.0.0-beta.44: version "7.0.0-beta.44" resolved "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz#89159e15e6e30c5096e22d738d8c0af8a0e8ca1d" @@ -3148,6 +3351,11 @@ camel-case@^4.1.1: pascal-case "^3.1.2" tslib "^2.0.3" +camelcase-css@2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" + integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -3224,6 +3432,11 @@ caseless@~0.12.0: resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= +ccount@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" + integrity sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg== + chalk@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -3574,6 +3787,11 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" +comma-separated-tokens@^1.0.0: + version "1.0.8" + resolved "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" + integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== + commander@2.15.1: version "2.15.1" resolved "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" @@ -4353,6 +4571,13 @@ destroy@~1.0.4: resolved "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= +detab@2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/detab/-/detab-2.0.4.tgz#b927892069aff405fbb9a186fe97a44a92a94b43" + integrity sha512-8zdsQA5bIkoRECvCrNKPla84lyoR7DSAyf7p0YgXzBO9PDJx8KntPUay7NS6yp+KdxdVtiE5SpHKtbp2ZQyA9g== + dependencies: + repeat-string "^1.5.4" + detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" @@ -5944,6 +6169,74 @@ has@^1.0.0, has@^1.0.1, has@^1.0.3: dependencies: function-bind "^1.1.1" +hast-to-hyperscript@^9.0.0: + version "9.0.1" + resolved "https://registry.npmjs.org/hast-to-hyperscript/-/hast-to-hyperscript-9.0.1.tgz#9b67fd188e4c81e8ad66f803855334173920218d" + integrity sha512-zQgLKqF+O2F72S1aa4y2ivxzSlko3MAvxkwG8ehGmNiqd98BIN3JM1rAJPmplEyLmGLO2QZYJtIneOSZ2YbJuA== + dependencies: + "@types/unist" "^2.0.3" + comma-separated-tokens "^1.0.0" + property-information "^5.3.0" + space-separated-tokens "^1.0.0" + style-to-object "^0.3.0" + unist-util-is "^4.0.0" + web-namespaces "^1.0.0" + +hast-util-from-parse5@^6.0.0: + version "6.0.1" + resolved "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-6.0.1.tgz#554e34abdeea25ac76f5bd950a1f0180e0b3bc2a" + integrity sha512-jeJUWiN5pSxW12Rh01smtVkZgZr33wBokLzKLwinYOUfSzm1Nl/c3GUGebDyOKjdsRgMvoVbV0VpAcpjF4NrJA== + dependencies: + "@types/parse5" "^5.0.0" + hastscript "^6.0.0" + property-information "^5.0.0" + vfile "^4.0.0" + vfile-location "^3.2.0" + web-namespaces "^1.0.0" + +hast-util-parse-selector@^2.0.0: + version "2.2.5" + resolved "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz#d57c23f4da16ae3c63b3b6ca4616683313499c3a" + integrity sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ== + +hast-util-raw@6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-6.0.1.tgz#973b15930b7529a7b66984c98148b46526885977" + integrity sha512-ZMuiYA+UF7BXBtsTBNcLBF5HzXzkyE6MLzJnL605LKE8GJylNjGc4jjxazAHUtcwT5/CEt6afRKViYB4X66dig== + dependencies: + "@types/hast" "^2.0.0" + hast-util-from-parse5 "^6.0.0" + hast-util-to-parse5 "^6.0.0" + html-void-elements "^1.0.0" + parse5 "^6.0.0" + unist-util-position "^3.0.0" + vfile "^4.0.0" + web-namespaces "^1.0.0" + xtend "^4.0.0" + zwitch "^1.0.0" + +hast-util-to-parse5@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-6.0.0.tgz#1ec44650b631d72952066cea9b1445df699f8479" + integrity sha512-Lu5m6Lgm/fWuz8eWnrKezHtVY83JeRGaNQ2kn9aJgqaxvVkFCZQBEhgodZUDUvoodgyROHDb3r5IxAEdl6suJQ== + dependencies: + hast-to-hyperscript "^9.0.0" + property-information "^5.0.0" + web-namespaces "^1.0.0" + xtend "^4.0.0" + zwitch "^1.0.0" + +hastscript@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/hastscript/-/hastscript-6.0.0.tgz#e8768d7eac56c3fdeac8a92830d58e811e5bf640" + integrity sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w== + dependencies: + "@types/hast" "^2.0.0" + comma-separated-tokens "^1.0.0" + hast-util-parse-selector "^2.0.0" + property-information "^5.0.0" + space-separated-tokens "^1.0.0" + he@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" @@ -6051,6 +6344,11 @@ html-minifier@^4.0.0: relateurl "^0.2.7" uglify-js "^3.5.1" +html-void-elements@^1.0.0: + version "1.0.5" + resolved "https://registry.npmjs.org/html-void-elements/-/html-void-elements-1.0.5.tgz#ce9159494e86d95e45795b166c2021c2cfca4483" + integrity sha512-uE/TxKuyNIcx44cIWnjr/rfIATDH7ZaOMmstu0CwhFG1Dunhlp4OC6/NMbhiwoq5BpW0ubi303qnEk/PZj614w== + html-webpack-plugin@^4.5.1: version "4.5.1" resolved "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-4.5.1.tgz#40aaf1b5cb78f2f23a83333999625c20929cda65" @@ -6367,6 +6665,11 @@ init-package-json@^1.10.3: validate-npm-package-license "^3.0.1" validate-npm-package-name "^3.0.0" +inline-style-parser@0.1.1: + version "0.1.1" + resolved "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" + integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== + inquirer@^3.0.6: version "3.3.0" resolved "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" @@ -6493,7 +6796,7 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-alphabetical@^1.0.0: +is-alphabetical@1.0.4, is-alphabetical@^1.0.0: version "1.0.4" resolved "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" integrity sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg== @@ -6540,6 +6843,11 @@ is-buffer@^1.0.2, is-buffer@^1.1.4, is-buffer@^1.1.5: resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== +is-buffer@^2.0.0: + version "2.0.5" + resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" + integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== + is-callable@^1.1.4, is-callable@^1.2.2: version "1.2.2" resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" @@ -6732,6 +7040,11 @@ is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= +is-plain-obj@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -7200,6 +7513,15 @@ loader-runner@^4.2.0: resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384" integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== +loader-utils@2.0.0, loader-utils@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0" + integrity sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ== + dependencies: + big.js "^5.2.2" + emojis-list "^3.0.0" + json5 "^2.1.2" + loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" @@ -7209,15 +7531,6 @@ loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4 emojis-list "^3.0.0" json5 "^1.0.1" -loader-utils@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0" - integrity sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^2.1.2" - loading-cli@^1.0.6: version "1.1.0" resolved "https://registry.npmjs.org/loading-cli/-/loading-cli-1.1.0.tgz#3457edaa3290439ad0061755174363a8091d56bc" @@ -7315,7 +7628,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash.uniq@^4.5.0: +lodash.uniq@4.5.0, lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= @@ -7505,6 +7818,34 @@ mdast-add-list-metadata@1.0.1: dependencies: unist-util-visit-parents "1.1.2" +mdast-squeeze-paragraphs@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/mdast-squeeze-paragraphs/-/mdast-squeeze-paragraphs-4.0.0.tgz#7c4c114679c3bee27ef10b58e2e015be79f1ef97" + integrity sha512-zxdPn69hkQ1rm4J+2Cs2j6wDEv7O17TfXTJ33tl/+JPIoEmtV9t2ZzBM5LPHE8QlHsmVD8t3vPKCyY3oH+H8MQ== + dependencies: + unist-util-remove "^2.0.0" + +mdast-util-definitions@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-4.0.0.tgz#c5c1a84db799173b4dcf7643cda999e440c24db2" + integrity sha512-k8AJ6aNnUkB7IE+5azR9h81O5EQ/cTDXtWdMq9Kk5KcEW/8ritU5CeLg/9HhOC++nALHBlaogJ5jz0Ybk3kPMQ== + dependencies: + unist-util-visit "^2.0.0" + +mdast-util-to-hast@10.0.1: + version "10.0.1" + resolved "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-10.0.1.tgz#0cfc82089494c52d46eb0e3edb7a4eb2aea021eb" + integrity sha512-BW3LM9SEMnjf4HXXVApZMt8gLQWVNXc3jryK0nJu/rOXPOnlkUjmdkDlmxMirpbU9ILncGFIwLH/ubnWBbcdgA== + dependencies: + "@types/mdast" "^3.0.0" + "@types/unist" "^2.0.0" + mdast-util-definitions "^4.0.0" + mdurl "^1.0.0" + unist-builder "^2.0.0" + unist-util-generated "^1.0.0" + unist-util-position "^3.0.0" + unist-util-visit "^2.0.0" + mdn-data@2.0.14: version "2.0.14" resolved "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" @@ -7515,7 +7856,7 @@ mdn-data@2.0.4: resolved "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== -mdurl@^1.0.1: +mdurl@^1.0.0, mdurl@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= @@ -8615,6 +8956,18 @@ parse-entities@^1.1.0: is-decimal "^1.0.0" is-hexadecimal "^1.0.0" +parse-entities@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8" + integrity sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ== + dependencies: + character-entities "^1.0.0" + character-entities-legacy "^1.0.0" + character-reference-invalid "^1.0.0" + is-alphanumerical "^1.0.0" + is-decimal "^1.0.0" + is-hexadecimal "^1.0.0" + parse-github-repo-url@^1.3.0: version "1.4.1" resolved "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" @@ -8663,6 +9016,11 @@ parse-url@^5.0.0: parse-path "^4.0.0" protocols "^1.4.0" +parse5@^6.0.0: + version "6.0.1" + resolved "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" + integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== + parseurl@~1.3.2, parseurl@~1.3.3: version "1.3.3" resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -9518,6 +9876,13 @@ prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: object-assign "^4.1.1" react-is "^16.8.1" +property-information@^5.0.0, property-information@^5.3.0: + version "5.6.0" + resolved "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz#61675545fb23002f245c6540ec46077d4da3ed69" + integrity sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA== + dependencies: + xtend "^4.0.0" + proto-list@~1.2.1: version "1.2.4" resolved "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -9730,13 +10095,6 @@ raw-body@2.4.0: iconv-lite "0.4.24" unpipe "1.0.0" -raw-content-replace-loader@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/raw-content-replace-loader/-/raw-content-replace-loader-1.0.1.tgz#a89cdd574acef724a9bc986768a0e74ca87b1ce7" - integrity sha512-ZPqeRwfgvYuBRZDKgsUNwFvcOOomWCkCcYRm9EppWMi6bFB1ofoFuE1ueGQIrdnvZ2z1RlIFsmVe9KzdpaKXig== - dependencies: - loader-utils "^1.1.0" - react-dom@^17.0.1: version "17.0.1" resolved "https://registry.npmjs.org/react-dom/-/react-dom-17.0.1.tgz#1de2560474ec9f0e334285662ede52dbc5426fc6" @@ -10104,6 +10462,47 @@ relateurl@^0.2.7: resolved "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= +remark-footnotes@2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/remark-footnotes/-/remark-footnotes-2.0.0.tgz#9001c4c2ffebba55695d2dd80ffb8b82f7e6303f" + integrity sha512-3Clt8ZMH75Ayjp9q4CorNeyjwIxHFcTkaektplKGl2A1jNGEUey8cKL0ZC5vJwfcD5GFGsNLImLG/NGzWIzoMQ== + +remark-mdx@1.6.22: + version "1.6.22" + resolved "https://registry.npmjs.org/remark-mdx/-/remark-mdx-1.6.22.tgz#06a8dab07dcfdd57f3373af7f86bd0e992108bbd" + integrity sha512-phMHBJgeV76uyFkH4rvzCftLfKCr2RZuF+/gmVcaKrpsihyzmhXjA0BEMDaPTXG5y8qZOKPVo83NAOX01LPnOQ== + dependencies: + "@babel/core" "7.12.9" + "@babel/helper-plugin-utils" "7.10.4" + "@babel/plugin-proposal-object-rest-spread" "7.12.1" + "@babel/plugin-syntax-jsx" "7.12.1" + "@mdx-js/util" "1.6.22" + is-alphabetical "1.0.4" + remark-parse "8.0.3" + unified "9.2.0" + +remark-parse@8.0.3: + version "8.0.3" + resolved "https://registry.npmjs.org/remark-parse/-/remark-parse-8.0.3.tgz#9c62aa3b35b79a486454c690472906075f40c7e1" + integrity sha512-E1K9+QLGgggHxCQtLt++uXltxEprmWzNfg+MxpfHsZlrddKzZ/hZyWHDbK3/Ap8HJQqYJRXP+jHczdL6q6i85Q== + dependencies: + ccount "^1.0.0" + collapse-white-space "^1.0.2" + is-alphabetical "^1.0.0" + is-decimal "^1.0.0" + is-whitespace-character "^1.0.0" + is-word-character "^1.0.0" + markdown-escapes "^1.0.0" + parse-entities "^2.0.0" + repeat-string "^1.5.4" + state-toggle "^1.0.0" + trim "0.0.1" + trim-trailing-lines "^1.0.0" + unherit "^1.0.4" + unist-util-remove-position "^2.0.0" + vfile-location "^3.0.0" + xtend "^4.0.1" + remark-parse@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/remark-parse/-/remark-parse-5.0.0.tgz#4c077f9e499044d1d5c13f80d7a98cf7b9285d95" @@ -10125,6 +10524,13 @@ remark-parse@^5.0.0: vfile-location "^2.0.0" xtend "^4.0.1" +remark-squeeze-paragraphs@4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/remark-squeeze-paragraphs/-/remark-squeeze-paragraphs-4.0.0.tgz#76eb0e085295131c84748c8e43810159c5653ead" + integrity sha512-8qRqmL9F4nuLPIgl92XUuxI3pFxize+F1H0e/W3llTk0UsjJaj01+RrirkMw7P21RKe4X6goQhYRSvNWX+70Rw== + dependencies: + mdast-squeeze-paragraphs "^4.0.0" + remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -10781,6 +11187,11 @@ source-map@^0.7.3, source-map@~0.7.2: resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== +space-separated-tokens@^1.0.0: + version "1.1.5" + resolved "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899" + integrity sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA== + spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" @@ -11133,6 +11544,13 @@ style-loader@^0.19.1: loader-utils "^1.0.2" schema-utils "^0.3.0" +style-to-object@0.3.0, style-to-object@^0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46" + integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA== + dependencies: + inline-style-parser "0.1.1" + stylehacks@^4.0.0: version "4.0.3" resolved "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz#6718fcaf4d1e07d8a1318690881e8d96726a71d5" @@ -11663,6 +12081,18 @@ unicode-property-aliases-ecmascript@^1.0.4: resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz#dd57a99f6207bedff4628abefb94c50db941c8f4" integrity sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg== +unified@9.2.0: + version "9.2.0" + resolved "https://registry.npmjs.org/unified/-/unified-9.2.0.tgz#67a62c627c40589edebbf60f53edfd4d822027f8" + integrity sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg== + dependencies: + bail "^1.0.0" + extend "^3.0.0" + is-buffer "^2.0.0" + is-plain-obj "^2.0.0" + trough "^1.0.0" + vfile "^4.0.0" + unified@^6.1.5: version "6.2.0" resolved "https://registry.npmjs.org/unified/-/unified-6.2.0.tgz#7fbd630f719126d67d40c644b7e3f617035f6dba" @@ -11709,11 +12139,31 @@ unique-slug@^2.0.0: dependencies: imurmurhash "^0.1.4" +unist-builder@2.0.3, unist-builder@^2.0.0: + version "2.0.3" + resolved "https://registry.npmjs.org/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436" + integrity sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw== + +unist-util-generated@^1.0.0: + version "1.1.6" + resolved "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-1.1.6.tgz#5ab51f689e2992a472beb1b35f2ce7ff2f324d4b" + integrity sha512-cln2Mm1/CZzN5ttGK7vkoGw+RZ8VcUH6BtGbq98DDtRGquAAOXig1mrBQYelOwMXYS8rK+vZDyyojSjp7JX+Lg== + unist-util-is@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz#d9e84381c2468e82629e4a5be9d7d05a2dd324cd" integrity sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A== +unist-util-is@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz#976e5f462a7a5de73d94b706bac1b90671b57797" + integrity sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg== + +unist-util-position@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/unist-util-position/-/unist-util-position-3.1.0.tgz#1c42ee6301f8d52f47d14f62bbdb796571fa2d47" + integrity sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA== + unist-util-remove-position@^1.0.0: version "1.1.4" resolved "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.4.tgz#ec037348b6102c897703eee6d0294ca4755a2020" @@ -11721,11 +12171,32 @@ unist-util-remove-position@^1.0.0: dependencies: unist-util-visit "^1.1.0" +unist-util-remove-position@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz#5d19ca79fdba712301999b2b73553ca8f3b352cc" + integrity sha512-fDZsLYIe2uT+oGFnuZmy73K6ZxOPG/Qcm+w7jbEjaFcJgbQ6cqjs/eSPzXhsmGpAsWPkqZM9pYjww5QTn3LHMA== + dependencies: + unist-util-visit "^2.0.0" + +unist-util-remove@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/unist-util-remove/-/unist-util-remove-2.1.0.tgz#b0b4738aa7ee445c402fda9328d604a02d010588" + integrity sha512-J8NYPyBm4baYLdCbjmf1bhPu45Cr1MWTm77qd9istEkzWpnN6O9tMsEbB2JhNnBCqGENRqEWomQ+He6au0B27Q== + dependencies: + unist-util-is "^4.0.0" + unist-util-stringify-position@^1.0.0, unist-util-stringify-position@^1.1.1: version "1.1.2" resolved "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz#3f37fcf351279dcbca7480ab5889bb8a832ee1c6" integrity sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ== +unist-util-stringify-position@^2.0.0: + version "2.0.3" + resolved "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz#cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da" + integrity sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g== + dependencies: + "@types/unist" "^2.0.2" + unist-util-visit-parents@1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-1.1.2.tgz#f6e3afee8bdbf961c0e6f028ea3c0480028c3d06" @@ -11738,6 +12209,23 @@ unist-util-visit-parents@^2.0.0: dependencies: unist-util-is "^3.0.0" +unist-util-visit-parents@^3.0.0: + version "3.1.1" + resolved "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6" + integrity sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg== + dependencies: + "@types/unist" "^2.0.0" + unist-util-is "^4.0.0" + +unist-util-visit@2.0.3, unist-util-visit@^2.0.0: + version "2.0.3" + resolved "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c" + integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== + dependencies: + "@types/unist" "^2.0.0" + unist-util-is "^4.0.0" + unist-util-visit-parents "^3.0.0" + unist-util-visit@^1.1.0, unist-util-visit@^1.3.0: version "1.4.1" resolved "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz#4724aaa8486e6ee6e26d7ff3c8685960d560b1e3" @@ -11926,6 +12414,11 @@ vfile-location@^2.0.0: resolved "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.6.tgz#8a274f39411b8719ea5728802e10d9e0dff1519e" integrity sha512-sSFdyCP3G6Ka0CEmN83A2YCMKIieHx0EDaj5IDP4g1pa5ZJ4FJDvpO0WODLxo4LUX4oe52gmSCK7Jw4SBghqxA== +vfile-location@^3.0.0, vfile-location@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/vfile-location/-/vfile-location-3.2.0.tgz#d8e41fbcbd406063669ebf6c33d56ae8721d0f3c" + integrity sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA== + vfile-message@^1.0.0: version "1.1.1" resolved "https://registry.npmjs.org/vfile-message/-/vfile-message-1.1.1.tgz#5833ae078a1dfa2d96e9647886cd32993ab313e1" @@ -11933,6 +12426,14 @@ vfile-message@^1.0.0: dependencies: unist-util-stringify-position "^1.1.1" +vfile-message@^2.0.0: + version "2.0.4" + resolved "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz#5b43b88171d409eae58477d13f23dd41d52c371a" + integrity sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ== + dependencies: + "@types/unist" "^2.0.0" + unist-util-stringify-position "^2.0.0" + vfile@^2.0.0: version "2.3.0" resolved "https://registry.npmjs.org/vfile/-/vfile-2.3.0.tgz#e62d8e72b20e83c324bc6c67278ee272488bf84a" @@ -11943,6 +12444,16 @@ vfile@^2.0.0: unist-util-stringify-position "^1.0.0" vfile-message "^1.0.0" +vfile@^4.0.0: + version "4.2.1" + resolved "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz#03f1dce28fc625c625bc6514350fbdb00fa9e624" + integrity sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA== + dependencies: + "@types/unist" "^2.0.0" + is-buffer "^2.0.0" + unist-util-stringify-position "^2.0.0" + vfile-message "^2.0.0" + warning@^4.0.1: version "4.0.3" resolved "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3" @@ -11972,6 +12483,11 @@ wcwidth@^1.0.0, wcwidth@^1.0.1: dependencies: defaults "^1.0.3" +web-namespaces@^1.0.0: + version "1.1.4" + resolved "https://registry.npmjs.org/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec" + integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw== + webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" @@ -12382,3 +12898,8 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zwitch@^1.0.0: + version "1.0.5" + resolved "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" + integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== From a1273248a66a282733cb679d76af123fedd7de06 Mon Sep 17 00:00:00 2001 From: MuYunyun <328375795@qq.com> Date: Sun, 6 Jun 2021 13:53:43 +0800 Subject: [PATCH 5/9] feat: support write react in markdown --- README-en.md | 1 + README.md | 1 + ...46\345\206\231\347\273\204\344\273\266.md" | 10 +- ...30\351\230\266\347\224\250\346\263\225.md" | 46 ++++++ ...30\350\256\244\344\270\273\351\242\230.md" | 37 +++++ .../scripts/src/conf/modifyMarkdownLoader.js | 1 - packages/theme/markdown/InlineCode.js | 120 ++++++++------ packages/theme/markdown/codeBlock.js | 52 ++++++ packages/theme/markdown/index.js | 32 ++-- packages/theme/markdown/style/default.less | 152 ++++++++++++------ packages/theme/package.json | 1 + yarn.lock | 5 + 12 files changed, 335 insertions(+), 123 deletions(-) create mode 100644 packages/theme/markdown/codeBlock.js diff --git a/README-en.md b/README-en.md index dcbb455ae..edf9e5480 100644 --- a/README-en.md +++ b/README-en.md @@ -28,6 +28,7 @@ English | [简体中文](./README.md) * The idea of ​​building a site: Just write markdown files as a blog site [like me](https://github.com/MuYunyun/blog). * Out of box: One-click generation of documents and blog sites by specifying directories or documents, no need to care about site environment configuration information. * Performance: greatly improve site loading speed through pre-rendering and lazy loading. +* Based on mdx: Support writing React components, mathematical formulas, etc. in markdown. * Search engine optimization: Support SEO, making documents easier to search. Related documents: [SEO Practice in SPA Site](https://github.com/MuYunyun/blog/issues/84) * Personalization: Support [custom theme](http://muyunyun.cn/create-react-doc/%E8%87%AA%E5%AE%9A%E4%B9%89%E4%B8%BB% E9%A2%98). * Workflow: Integrate Github actions, support automated packaging and publishing sites. diff --git a/README.md b/README.md index ccacdea74..79f4657af 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ * 建站理念: 文件即站点 (Files as a Site)。 * 开箱即用: 通过指定目录或文档, 一键生成文档、博客站点, 无需关心站点环境配置信息。 * 性能: 通过预渲染、懒加载大幅提升站点加载速度。 +* 基于 mdx: 支持在 markdown 中书写 React 组件、数学公式等。 * 搜索引擎优化: 支持 SEO, 让文档更易被搜索。相关文档: [SEO 在 SPA 站点中的实践](https://github.com/MuYunyun/blog/issues/84) * 个性化: 支持[自定义主题](http://muyunyun.cn/create-react-doc/%E8%87%AA%E5%AE%9A%E4%B9%89%E4%B8%BB%E9%A2%98)。 * 工作流: 集成 Github action, 支持自动化打包、发布站点。 diff --git "a/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" "b/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" index 582bd8dd6..208e5c3a6 100644 --- "a/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" +++ "b/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" @@ -1,9 +1,9 @@ - - ## 书写组件 -create-react-doc 内置了 [mdx](https://github.com/mdx-js/mdx) 的能力, 你可以在 .md 文件中书写 React 组件。 +[create-react-doc](https://github.com/MuYunyun/create-react-doc) 内置了 [mdx](https://github.com/mdx-js/mdx), 你可以在 .md 文件中书写 React 组件, 因此你可以选择 create-react-doc 来快速搭建组件站点开发环境。 + +## 例子 -### 示意 +### Button 组件 - + diff --git "a/docs/\351\253\230\351\230\266\347\224\250\346\263\225.md" "b/docs/\351\253\230\351\230\266\347\224\250\346\263\225.md" index b5e383643..5c172ec53 100644 --- "a/docs/\351\253\230\351\230\266\347\224\250\346\263\225.md" +++ "b/docs/\351\253\230\351\230\266\347\224\250\346\263\225.md" @@ -1,3 +1,49 @@ ## 高阶用法 与 git 文件结构类似, 如果在展示的文件夹中有私有文件不方便展示在文档站点, 可以在 `.gitignore` 文件中设置过滤文件, 这样它们就不会展示在文档站点中了。eg: [.gitignore](https://github.com/MuYunyun/blog/blob/main/.gitignore) + +## 数学公式 + +Todo: + +### 使用方式 + +在 `config.yml` 文件中加入 `inject` 字段。 + +```diff ++ inject: injectLogic/index.js +``` + +然后在根目录新建与 `inject` 字段相对应的文件, 声明 `injectWithPathname` 函数, 写入[自定义逻辑](https://github.com/MuYunyun/create-react-doc/injectLogic/index.js), 完成 MathJax 的使用。 + +```js +// perf injectWithPathname logic every pathname changes +const injectWithPathname = (pathname) => { + // demo for using mathjax. see https://github.com/MuYunyun/create-react-doc/issues/63 + if (pathname !== '/高阶用法') return; + window.MathJax = { + tex: { + inlineMath: [['$', '$'], ['\\(', '\\)']], + }, + svg: { + fontCache: 'global', + }, + }; + const script = document.createElement('script'); + script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js'; + const tag = 'mathjax'; + script.id = tag; + script.async = true; + const scriptNode = document.getElementById(tag); + try { + if (!scriptNode) { + document.head.appendChild(script); + } else { + scriptNode.remove(); + document.head.appendChild(script); + } + } catch (error) {} +}; + +module.exports = { injectWithPathname }; +``` \ No newline at end of file diff --git "a/docs/\351\273\230\350\256\244\344\270\273\351\242\230.md" "b/docs/\351\273\230\350\256\244\344\270\273\351\242\230.md" index a7f83148c..843946479 100644 --- "a/docs/\351\273\230\350\256\244\344\270\273\351\242\230.md" +++ "b/docs/\351\273\230\350\256\244\344\270\273\351\242\230.md" @@ -1,2 +1,39 @@ ## 默认主题 +create-react-doc 的默认主题为 [crd-seed](https://github.com/MuYunyun/create-react-doc/tree/main/packages/crd-seed)。该主题有以下特性: + +* 适配移动、PC 多端展示。 +* 支持暗黑模式。 +* 文档支持内嵌 codepen、codesandbox。 +* GitHub 联动。 + +使用该主题搭建的项目有: + +* [blog](https://github.com/MuYunyun/blog), [站点](http://muyunyun.cn/blog) + * ![](http://with.muyunyun.cn/ec330b8ac2175c828be41f446f9f9619.jpg) + * ![](http://with.muyunyun.cn/2e7440e4256debda2d73a4e6392c7146.jpg-300) +* [diana](https://github.com/MuYunyun/diana), [站点](https://muyunyun.cn/diana/) + +> 如果您有其它的改进优化想法, 欢迎留言补充 + +## config.yml + +[config.yml](https://github.com/MuYunyun/create-react-doc/blob/main/packages/templates/default/_config.yml) 文件是配置站点主题功能的地方。 + +它支持配置的属性如下: + +| 属性名 | 作用 | 类型 | 默认 | +| :------------: | :----------------------------------: | :------------------: | :------: | +| title | 站点名 | string | | +| menu | 作为站点菜单的文件/文件夹路径 | string[] | | +| menuOpenKeys | 默认展开菜单的文件夹路径 | string | | +| user | Github 用户名 | string | | +| repo | Github 项目名 | string | | +| language | 站点语言 | en \| zh-cn | en | +| github-ribbons | 是否在右上角显示 github 丝带 | boolean | false | +| theme | 使用主题 | string | crd-seed | +| devTheme | 开发自定义主题时, 需设置其为 true | string | ./index | +| seo | 是否开启 SEO 优化 | { google?: boolean } | | +| domain | SEO 优化的站点域名, 用于生成 sitemap | string | | + +详细用法可以参考 [config.yml](https://github.com/MuYunyun/blog/blob/main/config.yml)。 \ No newline at end of file diff --git a/packages/scripts/src/conf/modifyMarkdownLoader.js b/packages/scripts/src/conf/modifyMarkdownLoader.js index 7d2333bdb..9497693a7 100644 --- a/packages/scripts/src/conf/modifyMarkdownLoader.js +++ b/packages/scripts/src/conf/modifyMarkdownLoader.js @@ -19,6 +19,5 @@ module.exports = function (source) { if (FS.existsSync(fpath)) { content = FS.readFileSync(fpath) } - // content = JSON.stringify(content).replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029'); return content } diff --git a/packages/theme/markdown/InlineCode.js b/packages/theme/markdown/InlineCode.js index 7c2d7c5aa..f84e21f4c 100644 --- a/packages/theme/markdown/InlineCode.js +++ b/packages/theme/markdown/InlineCode.js @@ -1,54 +1,74 @@ -import { PureComponent } from 'react' -import classNames from 'classnames' +// import classNames from 'classnames' +import React from 'react' +import Highlight, { defaultProps } from 'prism-react-renderer' import styles from './InlineCode.less' -export default class Canvas extends PureComponent { - constructor() { - super() - this.state = { - height: 0, - } - this.playerId = `${parseInt(Math.random() * 1e9, 10).toString(36)}` - } - onClick() { - this.setState({ - height: this.state.height === 0 ? this.codeDom.clientHeight : 0, - }) - } - render() { - const sourceCode = this.props.value || '' - // const code = sourceCode.replace(/^__dome__/, '').replace(/\\`/g, '`') - const code = sourceCode.replace(/\\`/g, '`') - const PreCode = height => ( -
-         this.codeDom = node} className={classNames('hljs', { [`language-${this.props.language}`]: this.props.language })}>
-          {code}
-        
-      
- ) - // const isPreview = /^(html|htm)$/.test(this.props.language) +// export default class Canvas extends PureComponent { +// constructor() { +// super() +// this.state = { +// height: 0, +// } +// this.playerId = `${parseInt(Math.random() * 1e9, 10).toString(36)}` +// } +// onClick() { +// this.setState({ +// height: this.state.height === 0 ? this.codeDom.clientHeight : 0, +// }) +// } +// render() { +// const sourceCode = this.props.value || '' +// // const code = sourceCode.replace(/^__dome__/, '').replace(/\\`/g, '`') +// const code = sourceCode.replace(/\\`/g, '`') +// const PreCode = height => ( +//
+//          this.codeDom = node} className={classNames('hljs', { [`language-${this.props.language}`]: this.props.language })}>
+//           {code}
+//         
+//       
+// ) +// // const isPreview = /^(html|htm)$/.test(this.props.language) - // if (/^__dome__/.test(sourceCode)) { - // return ( - //
- // {isPreview && ( - //
- //
- //
- // )} - // {PreCode(this.state.height)} - //
- // {this.state.height === 0 ? '显示' : '隐藏'}代码 - // {this.props.language &&
{this.props.language}
} - //
- //
- // ) - // } - return PreCode() - } +// // if (/^__dome__/.test(sourceCode)) { +// // return ( +// //
+// // {isPreview && ( +// //
+// //
+// //
+// // )} +// // {PreCode(this.state.height)} +// //
+// // {this.state.height === 0 ? '显示' : '隐藏'}代码 +// // {this.props.language &&
{this.props.language}
} +// //
+// //
+// // ) +// // } +// return PreCode() +// } +// } + +export default ({ children, className }) => { + const language = className.replace(/language-/, '') + return ( + + {({ className, style, tokens, getLineProps, getTokenProps }) => ( +
+          {tokens.map((line, i) => (
+            
+ {line.map((token, key) => ( + + ))} +
+ ))} +
+ )} +
+ ) } diff --git a/packages/theme/markdown/codeBlock.js b/packages/theme/markdown/codeBlock.js new file mode 100644 index 000000000..4e8c8a6f1 --- /dev/null +++ b/packages/theme/markdown/codeBlock.js @@ -0,0 +1,52 @@ +/** @jsxRuntime classic / +/* @jsx jsx */ +import Highlight, { defaultProps } from 'prism-react-renderer' +import nightOwlLight from 'prism-react-renderer/themes/nightOwlLight' +import { mdx } from '@mdx-js/react' +// import {LiveProvider, LiveEditor, LiveError, LivePreview} from 'react-live' + +export default ({ children, className, live, render }) => { + // const language = className.replace(/language-/, '') + + // if (live) { + // return ( + //
+ // '/** @jsx mdx */' + code} + // scope={{mdx}} + // > + // + // + // + // + //
+ // ) + // } + + // if (render) { + // return ( + //
+ // + // + // + //
+ // ) + // } + + return ( + + {({ className, style, tokens, getLineProps, getTokenProps }) => ( +
+          {tokens.map((line, i) => (
+            
+ {line.map((token, key) => ( + + ))} +
+ ))} +
+ )} +
+ ) +} diff --git a/packages/theme/markdown/index.js b/packages/theme/markdown/index.js index cf7953736..06cf77ad7 100644 --- a/packages/theme/markdown/index.js +++ b/packages/theme/markdown/index.js @@ -2,15 +2,12 @@ import { useState, useEffect, useRef } from 'react' import cx from 'classnames' import ReactMarkdown from 'react-markdown' import hljs from 'highlight.js' -import { renderToString } from 'react-dom/server' import { MDXProvider } from '@mdx-js/react' +import CodeBlock from './codeBlock' import InlineCode from './InlineCode' import Link from './Link' import Loading from '../component/Loading' import styles from './style/index.less' -// import A from '../../../.cache/md/docs___快速上手.md' - -// console.log('abcde', a) hljs.configure({ tabReplace: ' ', // 2 spaces @@ -24,6 +21,11 @@ const formatPath = path => .split('/') .join('___') +const components = { + code: CodeBlock, + link: Link, +} + function Markdown({ props }) { const { type, relative } = props const [MarkdownCP, setMarkdownCP] = useState(null) @@ -55,28 +57,14 @@ function Markdown({ props }) { // } // }, [markdownStr]) - // console.log('markdownStr', markdownStr) - // { /* {markdownStr ? ( - // // - //
123
- // ) : ( - // - // )} */ } return ( -
+
{ MarkdownCP ? - + : diff --git a/packages/theme/markdown/style/default.less b/packages/theme/markdown/style/default.less index 037a4bbde..4e36f86bc 100644 --- a/packages/theme/markdown/style/default.less +++ b/packages/theme/markdown/style/default.less @@ -1,15 +1,16 @@ - code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; word-wrap: normal; } -code:not(.hljs){ + +code:not(.hljs) { padding: 0.2em 0.4em; margin: 0; font-size: 85%; background-color: rgba(27, 31, 35, 0.07); border-radius: 3px; } + code.hljs { padding: 16px; font-size: 95%; @@ -17,24 +18,31 @@ code.hljs { display: block; text-shadow: 0 1px #fff; } + pre { max-height: 35em; position: relative; overflow: auto; - background-color: #F0F0F0; + // background-color: #F0F0F0; + background-color: rgb(251, 251, 251); border-radius: 3px; } + pre code { background: none; font-size: 1em; overflow-wrap: normal; white-space: inherit; } -ul, ol { + +ul, +ol { padding-left: 2em; } + dl { padding: 0; + dt { padding: 0; margin-top: 16px; @@ -43,28 +51,35 @@ dl { font-weight: 600; } } -li + li { + +li+li { margin-top: 3px; } + a { color: #0366d6; } + p { margin-bottom: 16px; } + blockquote { margin: 0; padding: 0 1em; margin: 16px 0 16px 0; color: #6a737d; border-left: 0.25em solid #dfe2e5; - & >:first-child { + + &>:first-child { margin-top: 0; } - & >:last-child { + + &>:last-child { margin-bottom: 0; } } + hr { height: 0.25em; padding: 0; @@ -73,7 +88,18 @@ hr { border: 0; } -h1 tt,h1 code,h2 tt,h2 code,h3 tt,h3 code,h4 tt,h4 code,h5 tt,h5 code,h6 tt,h6 code { +h1 tt, +h1 code, +h2 tt, +h2 code, +h3 tt, +h3 code, +h4 tt, +h4 code, +h5 tt, +h5 code, +h6 tt, +h6 code { font-size: inherit } @@ -110,7 +136,8 @@ table { border-collapse: collapse; border-spacing: 0; width: 100%; - & + table { + + &+table { margin-top: 16px; } } @@ -119,10 +146,11 @@ table th { font-weight: 600; white-space: nowrap; color: #5c6b77; - background: rgba(0,0,0,.02); + background: rgba(0, 0, 0, .02); } -table th,table td { +table th, +table td { padding: 8px 13px; border: 1px solid #dfe2e5; } @@ -155,53 +183,87 @@ img[align=left] { padding-right: 20px; } -.comment,.quote{ - color:#998; +.comment, +.quote { + color: #998; } -.keyword,.selector-tag,.subst{ - color:#333;font-weight:bold; -} -.number,.literal,.variable,.template-variable,.tag .attr{ - color:#008080; + +.keyword, +.selector-tag, +.subst { + color: #333; + font-weight: bold; } -.string,.doctag{ - color:#d14; + +.number, +.literal, +.variable, +.template-variable, +.tag .attr { + color: #008080; } -.title,.section,.selector-id{ - color:#900;font-weight:bold; + +.string, +.doctag { + color: #d14; } -.subst{ - font-weight:normal; + +.title, +.section, +.selector-id { + color: #900; + font-weight: bold; } -.type,.class .title{ - color:#458;font-weight:bold; + +.subst { + font-weight: normal; } -.tag,.name,.attribute{ - color:#000098; - font-weight:normal; + +.type, +.class .title { + color: #458; + font-weight: bold; } -.regexp,.link{ - color:#009926; + +.tag, +.name, +.attribute { + color: #000098; + font-weight: normal; } -.symbol,.bullet{ - color:#990073; + +.regexp, +.link { + color: #009926; } -.built_in,.builtin-name{ - color:#0086b3; + +.symbol, +.bullet { + color: #990073; } -.meta{ - color:#999;font-weight:bold; + +.built_in, +.builtin-name { + color: #0086b3; } -.deletion{ - background:#fdd; + +.meta { + color: #999; + font-weight: bold; } -.addition{ - background:#dfd; + +.deletion { + background: #fdd; } -.emphasis{ - font-style:italic; + +.addition { + background: #dfd; } -.strong{ - font-weight:bold; + +.emphasis { + font-style: italic; } +.strong { + font-weight: bold; +} \ No newline at end of file diff --git a/packages/theme/package.json b/packages/theme/package.json index 51995b7dc..3cb4c7041 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -8,6 +8,7 @@ "classnames": "^2.2.6", "diana": "^1.0.2", "less": "^3.0.2", + "prism-react-renderer": "^1.2.1", "react": "^17.0.1", "react-dom": "^17.0.1", "react-hot-loader": "^4.1.1", diff --git a/yarn.lock b/yarn.lock index 6f1a6e9e3..82d82c2f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9827,6 +9827,11 @@ pretty-time@^1.1.0: resolved "https://registry.npmjs.org/pretty-time/-/pretty-time-1.1.0.tgz#ffb7429afabb8535c346a34e41873adf3d74dd0e" integrity sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA== +prism-react-renderer@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/prism-react-renderer/-/prism-react-renderer-1.2.1.tgz#392460acf63540960e5e3caa699d851264e99b89" + integrity sha512-w23ch4f75V1Tnz8DajsYKvY5lF7H1+WvzvLUcF0paFxkTHSp42RS0H5CttdN2Q8RR3DRGZ9v5xD/h3n8C8kGmg== + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" From d658e8e7dc37fb85de5a47d1aab11095336a9b69 Mon Sep 17 00:00:00 2001 From: MuYunyun <328375795@qq.com> Date: Tue, 8 Jun 2021 13:29:50 +0800 Subject: [PATCH 6/9] feat: support write react component in .md --- components/Button/index.jsx | 9 ++ components/Button/index.less | 17 +++ components/index.jsx | 5 + docs/components/index.jsx | 10 -- ...46\345\206\231\347\273\204\344\273\266.md" | 11 +- packages/crd-markdown-loader/.npmrc | 10 -- packages/crd-markdown-loader/README.md | 3 - packages/crd-markdown-loader/index.js | 129 ------------------ packages/crd-markdown-loader/package.json | 24 ---- packages/create-react-doc/index.js | 1 + .../scripts/src/conf/webpack.config.dev.js | 20 +-- packages/scripts/src/conf/webpack.config.js | 17 +-- .../scripts/src/conf/webpack.config.prod.js | 22 +-- packages/scripts/src/utils/initCache.js | 1 + packages/theme/markdown/index.js | 39 ++++-- 15 files changed, 97 insertions(+), 221 deletions(-) create mode 100644 components/Button/index.jsx create mode 100644 components/Button/index.less create mode 100644 components/index.jsx delete mode 100644 docs/components/index.jsx delete mode 100644 packages/crd-markdown-loader/.npmrc delete mode 100644 packages/crd-markdown-loader/README.md delete mode 100644 packages/crd-markdown-loader/index.js delete mode 100644 packages/crd-markdown-loader/package.json diff --git a/components/Button/index.jsx b/components/Button/index.jsx new file mode 100644 index 000000000..4880414c6 --- /dev/null +++ b/components/Button/index.jsx @@ -0,0 +1,9 @@ +import styles from './index.less' + +const Button = ({ + children, +}) => { + return +} + +export default Button diff --git a/components/Button/index.less b/components/Button/index.less new file mode 100644 index 000000000..35d4d2dfb --- /dev/null +++ b/components/Button/index.less @@ -0,0 +1,17 @@ +.btn { + color: #fff; + background: #1890ff; + border-color: #1890ff; + text-shadow: 0 -1px 0 rgb(0 0 0 / 12%); + box-shadow: 0 2px #0000000b; + height: 40px; + padding: 6.4px 15px; + font-size: 16px; + border-radius: 2px; + line-height: 1.5715; + position: relative; + display: inline-block; + font-weight: 400; + white-space: nowrap; + text-align: center; +} \ No newline at end of file diff --git a/components/index.jsx b/components/index.jsx new file mode 100644 index 000000000..cff0bc61f --- /dev/null +++ b/components/index.jsx @@ -0,0 +1,5 @@ +import Button from './Button/index.jsx' + +export { + Button, +} diff --git a/docs/components/index.jsx b/docs/components/index.jsx deleted file mode 100644 index 59b1268e2..000000000 --- a/docs/components/index.jsx +++ /dev/null @@ -1,10 +0,0 @@ -const Button = ({ - children, -}) => { - console.log('children', children) - return {children} -} - -export { - Button, -} diff --git "a/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" "b/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" index 208e5c3a6..21b3a89d6 100644 --- "a/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" +++ "b/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" @@ -1,9 +1,16 @@ +import { Button } from '../components/index.jsx' + ## 书写组件 [create-react-doc](https://github.com/MuYunyun/create-react-doc) 内置了 [mdx](https://github.com/mdx-js/mdx), 你可以在 .md 文件中书写 React 组件, 因此你可以选择 create-react-doc 来快速搭建组件站点开发环境。 ## 例子 - ### Button 组件 - +```js +import { Button } from '../components/index.jsx' + + +``` + + \ No newline at end of file diff --git a/packages/crd-markdown-loader/.npmrc b/packages/crd-markdown-loader/.npmrc deleted file mode 100644 index 7edb6af8b..000000000 --- a/packages/crd-markdown-loader/.npmrc +++ /dev/null @@ -1,10 +0,0 @@ -# .npmrc - -registry=https://registry.npmjs.org/ - -# https://github.com/sass/node-sass#binary-configuration-parameters -sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ - -# https://github.com/Medium/phantomjs#deciding-where-to-get-phantomjs -# phantomjs_cdnurl=http://cnpmjs.org/downloads -phantomjs_cdnurl=https://npm.taobao.org/dist/phantomjs diff --git a/packages/crd-markdown-loader/README.md b/packages/crd-markdown-loader/README.md deleted file mode 100644 index 66be9a52e..000000000 --- a/packages/crd-markdown-loader/README.md +++ /dev/null @@ -1,3 +0,0 @@ -### crd-markdown-loader - -markdown loader with webpack for [create-react-doc](https://github.com/MuYunyun/create-react-doc)。 \ No newline at end of file diff --git a/packages/crd-markdown-loader/index.js b/packages/crd-markdown-loader/index.js deleted file mode 100644 index 38333938c..000000000 --- a/packages/crd-markdown-loader/index.js +++ /dev/null @@ -1,129 +0,0 @@ -import highlight from 'highlight.js' -import frontMatter from 'front-matter' -import mdContainer from 'markdown-it-container' -import md from 'markdown-it' - -console.log('✅✅✅✅✅✅✅') - -const options = { - className: 'wrap', -} - -const mdLoader = md({ - html: true, // Enable HTML tags in source - xhtmlOut: true, // Use '/' to close single tags (
) - typographer: false, - linkify: false, // Auto convert URL-like text to links -}) - .enable(['smartquotes']) - .set({ - highlight(content: any, languageHint: any) { - let highlightedContent = null - - highlight.configure({ - useBR: true, - tabReplace: ' ', - }) - - if (languageHint && highlight.getLanguage(languageHint)) { - try { - highlightedContent = highlight.highlight(languageHint, content).value - } catch (err) { - console.log(err) - } - } - - if (!highlightedContent) { - try { - highlightedContent = highlight.highlightAuto(content).value - } catch (err) { - console.log(err) - } - } - - // 把代码中的{}转 - highlightedContent = highlightedContent.replace( - /[{}]/g, - (match: string) => `{'${match}'}`, - ) - // 加上 highlight js - highlightedContent = highlightedContent - .replace('', '') - - return highlight.fixMarkup(highlightedContent) - }, - }) - -/** at-component-docs__container 用于做除 demo 和 table 之外的公共样式 */ -const formatModule = (imports: string, jsx: string) => { - const moduleText = ` - ${imports} - - export default class extends React.Component { - render(){ - return ( -
-
- ${jsx} -
-
- ); - } - };` - return moduleText -} - -const formatOpening = () => - `
-
-
` -const formatClosing = () => - `
` - -module.exports = function (source: any) { - console.log('✅✅✅✅✅source') - const { - body, - attributes: { imports: importMap }, - } = frontMatter(source) - const imports = `import * as React from 'react';${importMap}` - - /* 处理 :::demo 开头的 markdown 内容 */ - mdLoader.use(mdContainer, 'demo', { - validate: (params: string) => params.trim().match(/^demo\s*(.*)$/), - render: (tokens: any[], idx: number) => { - // container 从开头到结尾把之间的token跑一遍,其中idx定位到具体的位置 - // 有此标记代表 ::: 开始 - if (tokens[idx].nesting === 1) { - let i = 1 - // 从 ::: 下一个token开始 - let token = tokens[idx + i] - - // 如果没有到结尾 - while (token.markup !== ':::') { - i++ - token = tokens[idx + i] - } - // 描述也执行md - return formatOpening() - } - return formatClosing() - }, - }) - - // md 处理过后的字符串含有 class 和 style ,需要再次处理给到 react - let content = mdLoader.render(body) - - content = content - .replace(/
/g, '
') - .replace(/
/g, '
') - .replace(/class=/g, 'className=') - .replace(/style="text-align:center"/g, 'style={{ textAlign: "center"}}') - .replace(/style="text-align:left"/g, 'style={{ textAlign: "left"}}') - .replace(/style="text-align:right"/g, 'style={{ textAlign: "right"}}') - .replace(/\(_blank\)/g, ` target="_blank">`) - - return `module.exports = ${formatModule(imports, content)}` -} diff --git a/packages/crd-markdown-loader/package.json b/packages/crd-markdown-loader/package.json deleted file mode 100644 index 12532f36b..000000000 --- a/packages/crd-markdown-loader/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "crd-markdown-loader", - "version": "1.1.3", - "description": "markdown-loader with webpack for create react doc", - "main": "index.js", - "dependencies": { - "front-matter": "^4.0.2", - "highlight.js": "^11.0.1", - "markdown-it": "^12.0.6", - "markdown-it-container": "^3.0.0" - }, - "repository": { - "type": "git", - "url": "https://github.com/MuYunyun/create-react-doc", - "directory": "packages/utils" - }, - "keywords": [], - "publishConfig": { - "access": "public" - }, - "author": "muyunyun", - "license": "MIT", - "gitHead": "ffc5e4cbc94a7356da558c2dbf46e2f39bb8b199" -} diff --git a/packages/create-react-doc/index.js b/packages/create-react-doc/index.js index e8da6f216..935a90c8f 100755 --- a/packages/create-react-doc/index.js +++ b/packages/create-react-doc/index.js @@ -39,6 +39,7 @@ program const { start, build, deploy, theme } = program +console.log('start', start) if (!start && !build && !deploy && !theme) return initProject(program) if (theme) { diff --git a/packages/scripts/src/conf/webpack.config.dev.js b/packages/scripts/src/conf/webpack.config.dev.js index c72d4e8f8..e83ae437d 100644 --- a/packages/scripts/src/conf/webpack.config.dev.js +++ b/packages/scripts/src/conf/webpack.config.dev.js @@ -121,16 +121,16 @@ module.exports = function (cmd) { template: defaultHTMLPath, title: docsConfig && docsConfig.title ? docsConfig.title : 'Create React Doc', }), - new CreateSpareWebpackPlugin({ - // 备用文件目录,比对是否存在,不存在生成,根据 sep 目录规则生成 - path: path.join(cacheDirPath, './md'), - sep: '___', // 检查目标目录文件,文件名存储,文件夹+下划线间隔+文件名 - directoryTrees: { // 索引目录 - dir: cmd.markdownPaths, - mdconf: true, - extensions: /\.md$/, - }, - }), + // new CreateSpareWebpackPlugin({ + // // 备用文件目录,比对是否存在,不存在生成,根据 sep 目录规则生成 + // path: path.join(cacheDirPath, './md'), + // sep: '___', // 检查目标目录文件,文件名存储,文件夹+下划线间隔+文件名 + // directoryTrees: { // 索引目录 + // dir: cmd.markdownPaths, + // mdconf: true, + // extensions: /\.md$/, + // }, + // }), new FriendlyErrorsWebpackPlugin({ clearConsole: true, }), diff --git a/packages/scripts/src/conf/webpack.config.js b/packages/scripts/src/conf/webpack.config.js index 5f2adc009..864e4e24a 100644 --- a/packages/scripts/src/conf/webpack.config.js +++ b/packages/scripts/src/conf/webpack.config.js @@ -74,15 +74,16 @@ module.exports = { }, '@mdx-js/loader', // 'crd-markdown-loader', - { - loader: `${path.join(__dirname, './modifyMarkdownLoader.js')}`, - options: { - path: path.join(cacheDirPath, './md'), // dir need to replace - replace: paths.projectPath, // the dir to replace - sep: /___/g, // name saved, folder + __ + file - }, - }, + // { + // loader: `${path.join(__dirname, './modifyMarkdownLoader.js')}`, + // options: { + // path: path.join(cacheDirPath, './md'), // dir need to replace + // replace: paths.projectPath, // the dir to replace + // sep: /___/g, // name saved, folder + __ + file + // }, + // }, ], + exclude: /(node_modules)/, }, // { // test: /\.md$/, diff --git a/packages/scripts/src/conf/webpack.config.prod.js b/packages/scripts/src/conf/webpack.config.prod.js index e16a888aa..c1fc15317 100755 --- a/packages/scripts/src/conf/webpack.config.prod.js +++ b/packages/scripts/src/conf/webpack.config.prod.js @@ -147,17 +147,17 @@ module.exports = function (cmd) { dir: cmd.markdownPaths, toDir: config.output.path, }), - new CreateSpareWebpackPlugin({ - // 备用文件目录,比对是否存在,不存在生成,根据 sep 目录规则生成 - path: path.join(cacheDirPath, './md'), - sep: '___', // 检查目标目录文件,文件名存储,文件夹+下划线间隔+文件名 - directoryTrees: { - // 索引目录 - dir: cmd.markdownPaths, - mdconf: true, - extensions: /\.md$/, - }, - }), + // new CreateSpareWebpackPlugin({ + // // 备用文件目录,比对是否存在,不存在生成,根据 sep 目录规则生成 + // path: path.join(cacheDirPath, './md'), + // sep: '___', // 检查目标目录文件,文件名存储,文件夹+下划线间隔+文件名 + // directoryTrees: { + // // 索引目录 + // dir: cmd.markdownPaths, + // mdconf: true, + // extensions: /\.md$/, + // }, + // }), // new webpack.optimize.DedupePlugin(), new MiniCssExtractPlugin({ // Options similar to the same options in webpackOptions.output diff --git a/packages/scripts/src/utils/initCache.js b/packages/scripts/src/utils/initCache.js index ce265b079..7e2ffd08d 100644 --- a/packages/scripts/src/utils/initCache.js +++ b/packages/scripts/src/utils/initCache.js @@ -38,6 +38,7 @@ module.exports = function (program, cb) { ) // generate file cache only it isn't in .gitignore if (!ifInGitIgnore(mdfilePath)) { + // todo: remove ___ const underlineFileName = mdfilePath.split(path.sep).join('___') const writeMarkdownPath = path.resolve( process.cwd(), diff --git a/packages/theme/markdown/index.js b/packages/theme/markdown/index.js index 06cf77ad7..00c92d946 100644 --- a/packages/theme/markdown/index.js +++ b/packages/theme/markdown/index.js @@ -1,18 +1,18 @@ import { useState, useEffect, useRef } from 'react' import cx from 'classnames' -import ReactMarkdown from 'react-markdown' -import hljs from 'highlight.js' +// import ReactMarkdown from 'react-markdown' +// import hljs from 'highlight.js' import { MDXProvider } from '@mdx-js/react' import CodeBlock from './codeBlock' -import InlineCode from './InlineCode' +// import InlineCode from './InlineCode' import Link from './Link' import Loading from '../component/Loading' import styles from './style/index.less' -hljs.configure({ - tabReplace: ' ', // 2 spaces - classPrefix: '', // don't append class prefix -}) +// hljs.configure({ +// tabReplace: ' ', // 2 spaces +// classPrefix: '', // don't append class prefix +// }) const formatPath = path => path.replace(/^(\/|\\)/, '') @@ -26,19 +26,30 @@ const components = { link: Link, } -function Markdown({ props }) { - const { type, relative } = props +function Markdown(markdownProps) { + // const { props } = markdownProps + const { props } = markdownProps + const { relative } = props const [MarkdownCP, setMarkdownCP] = useState(null) const markdownWrapperRef = useRef(null) const renderMarkdown = () => { const relativeMd = relative if (!relativeMd) return null - let filename = formatPath(relativeMd) - if (type === 'directory') { - filename = formatPath(relativeMd) - } - import(`__project_root__/.cache/md/${filename}.md`).then((data) => { + // let filename = formatPath(relativeMd) + // if (type === 'directory') { + // filename = formatPath(relativeMd) + // } + // import(`__project_root__/.cache/md/${filename}.md`).then((data) => { + // import(`__project_root__${relative}`).then((data) => { + // console.log('data', data) + // // data.default is a function, so we should write () => data.default in setState here. + // // setMarkdownCP(() => (data.default || data)) + // }) + + const rmFirstSlash = relative.slice(1, relative.length - 3) + // it must be writen with / & .md in dynamic import + import(`__project_root__/${rmFirstSlash}.md`).then((data) => { // data.default is a function, so we should write () => data.default in setState here. setMarkdownCP(() => (data.default || data)) }) From 73a082f4b9fb4fea78578a6f56af59b5b0bb5040 Mon Sep 17 00:00:00 2001 From: MuYunyun <328375795@qq.com> Date: Wed, 9 Jun 2021 10:44:50 +0800 Subject: [PATCH 7/9] feat: support math in markdown --- config.yml | 7 +- ...60\345\255\246\345\205\254\345\274\217.md" | 35 +++++++++ ...32\344\271\211\344\270\273\351\242\230.md" | 2 +- packages/scripts/package.json | 2 + packages/scripts/src/conf/webpack.config.js | 54 ++++++------- packages/theme/index.html | 4 +- yarn.lock | 77 ++++++++++++++++++- 7 files changed, 145 insertions(+), 36 deletions(-) create mode 100644 "docs/\346\225\260\345\255\246\345\205\254\345\274\217.md" diff --git a/config.yml b/config.yml index 848d04df2..d74d598b5 100644 --- a/config.yml +++ b/config.yml @@ -8,13 +8,14 @@ title: Create React Doc ## todo: auto menu menu: [ docs/快速上手.md, + docs/更新日志.md, docs/默认主题.md, docs/站点发布.md, - docs/高阶用法.md, docs/自定义主题.md, docs/其它工具.md, - docs/更新日志.md, - docs/书写组件.md + docs/书写组件.md, + docs/数学公式.md, + docs/高阶用法.md, ] ## set init open menu keys # menuOpenKeys: diff --git "a/docs/\346\225\260\345\255\246\345\205\254\345\274\217.md" "b/docs/\346\225\260\345\255\246\345\205\254\345\274\217.md" new file mode 100644 index 000000000..ddd0a9dfa --- /dev/null +++ "b/docs/\346\225\260\345\255\246\345\205\254\345\274\217.md" @@ -0,0 +1,35 @@ +## 数学公式 + +在 `$$` 与 `$$` 之间书写 latex 数学公式即能显示在网页上。 + +```js +$$ +z = \frac{x}{y} +$$ + +$$ +C_1 \quad= \quad c_2 + c_4^3 +$$ + +$$ +y = \sqrt {x_1^2 + x_2^2 + x_3^2 + x_4^2} +$$ +``` + +被转化为 + +$$ +z = \frac{x}{y} +$$ + +$$ +C_1 \quad= \quad c_2 + c_4^3 +$$ + +$$ +y = \sqrt {x_1^2 + x_2^2 + x_3^2 + x_4^2} +$$ + +## 参考链接 + +* [latex 数学公式示例汇总](https://zhuanlan.zhihu.com/p/34799800) diff --git "a/docs/\350\207\252\345\256\232\344\271\211\344\270\273\351\242\230.md" "b/docs/\350\207\252\345\256\232\344\271\211\344\270\273\351\242\230.md" index 5c136bcb9..04f911900 100644 --- "a/docs/\350\207\252\345\256\232\344\271\211\344\270\273\351\242\230.md" +++ "b/docs/\350\207\252\345\256\232\344\271\211\344\270\273\351\242\230.md" @@ -1,4 +1,4 @@ -### 使用自定义主题 +## 使用自定义主题 切换主题非常简单, 只需要将根目录文件 `config.yml` 中的 `theme` 更改为您想使用的主题即可。 diff --git a/packages/scripts/package.json b/packages/scripts/package.json index 786bd5ca2..5f5bfca15 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -50,6 +50,8 @@ "postcss-flexbugs-fixes": "^3.3.1", "postcss-loader": "^2.0.9", "process": "^0.11.10", + "rehype-katex": "^5.0.0", + "remark-math": "^3.0.1", "rimraf": "^2.6.2", "string-replace-loader": "^3.0.1", "style-loader": "^0.19.1", diff --git a/packages/scripts/src/conf/webpack.config.js b/packages/scripts/src/conf/webpack.config.js index 864e4e24a..61f84104c 100644 --- a/packages/scripts/src/conf/webpack.config.js +++ b/packages/scripts/src/conf/webpack.config.js @@ -7,6 +7,8 @@ const fs = require('fs') const { resolveApp, docsConfig, cacheDirPath, docsBuildDist } = require('crd-utils') const { getDocsConfig } = require('crd-utils') // const { getSearchContent } = require('../utils'); +const remarkMath = require('remark-math') +const rehypeKatex = require('rehype-katex') const paths = require('./path') const pkg = require('../../package.json') @@ -63,43 +65,35 @@ module.exports = { { test: /\.md$/, use: [ - // { - // loader: require.resolve('crd-markdown-loader'), - // }, - // 'crd-markdown-loader', - // 'babel-loader' { loader: require.resolve('babel-loader'), options: require('../../.babelrc'), // eslint-disable-line }, - '@mdx-js/loader', - // 'crd-markdown-loader', - // { - // loader: `${path.join(__dirname, './modifyMarkdownLoader.js')}`, - // options: { - // path: path.join(cacheDirPath, './md'), // dir need to replace - // replace: paths.projectPath, // the dir to replace - // sep: /___/g, // name saved, folder + __ + file - // }, - // }, + // '@mdx-js/loader', + { + loader: require.resolve('@mdx-js/loader'), + options: { + remarkPlugins: [ + [ + remarkMath, + { + /* options */ + }, + ], + ], + rehypePlugins: [ + [ + rehypeKatex, + { + /* options */ + }, + ], + ], + }, + }, ], exclude: /(node_modules)/, }, - // { - // test: /\.md$/, - // use: [ - // // { - // // loader: `babel-loader!${path.join(__dirname, './mdloader.js')}`, - // // }, - // { - // loader: require.resolve('crd-markdown-loader'), - // }, - // { - // loader: require.resolve('babel-loader'), - // options: require('../../.babelrc'), // eslint-disable-line - // }, - // ], - // }, // “file-loader”确保这些资源由WebpackDevServer服务。 // 当您导入资源时,您将获得(虚拟)文件名。 // 在生产中,它们将被复制到`build`文件夹。 diff --git a/packages/theme/index.html b/packages/theme/index.html index ad901f2b2..1471b8b92 100644 --- a/packages/theme/index.html +++ b/packages/theme/index.html @@ -9,7 +9,9 @@ - + + diff --git a/yarn.lock b/yarn.lock index 82d82c2f9..dfe869cd1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2223,6 +2223,11 @@ resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= +"@types/katex@^0.11.0": + version "0.11.0" + resolved "https://registry.npmjs.org/@types/katex/-/katex-0.11.0.tgz#b16c54ee670925ffef0616beae9e90c557e17334" + integrity sha512-27BfE8zASRLYfSBNMk5/+KIjr2CBBrH0i5lhsO04fca4TGirIIMay73v3zNkzqmsaeIa/Mi5kejWDcxPLAmkvA== + "@types/mdast@^3.0.0": version "3.0.3" resolved "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.3.tgz#2d7d671b1cd1ea3deb306ea75036c2a0407d2deb" @@ -3807,6 +3812,11 @@ commander@^4.0.1, commander@^4.1.1: resolved "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== +commander@^6.0.0: + version "6.2.1" + resolved "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" + integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== + commondir@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -6194,6 +6204,11 @@ hast-util-from-parse5@^6.0.0: vfile-location "^3.2.0" web-namespaces "^1.0.0" +hast-util-is-element@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-1.1.0.tgz#3b3ed5159a2707c6137b48637fbfe068e175a425" + integrity sha512-oUmNua0bFbdrD/ELDSSEadRVtWZOf3iF6Lbv81naqsIV99RnSCieTbWuWCY8BAeEfKJTKl0gRdokv+dELutHGQ== + hast-util-parse-selector@^2.0.0: version "2.2.5" resolved "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz#d57c23f4da16ae3c63b3b6ca4616683313499c3a" @@ -6226,6 +6241,15 @@ hast-util-to-parse5@^6.0.0: xtend "^4.0.0" zwitch "^1.0.0" +hast-util-to-text@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/hast-util-to-text/-/hast-util-to-text-2.0.1.tgz#04f2e065642a0edb08341976084aa217624a0f8b" + integrity sha512-8nsgCARfs6VkwH2jJU9b8LNTuR4700na+0h3PqCaEk4MAnMDeu5P0tP8mjk9LLNGxIeQRLbiDbZVw6rku+pYsQ== + dependencies: + hast-util-is-element "^1.0.0" + repeat-string "^1.0.0" + unist-util-find-after "^3.0.0" + hastscript@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/hastscript/-/hastscript-6.0.0.tgz#e8768d7eac56c3fdeac8a92830d58e811e5bf640" @@ -7327,6 +7351,13 @@ jsprim@^1.2.2: array-includes "^3.1.1" object.assign "^4.1.1" +katex@^0.13.0: + version "0.13.11" + resolved "https://registry.npmjs.org/katex/-/katex-0.13.11.tgz#66138ebf173f25ef130cd3a3ea3ea1d12a3f1362" + integrity sha512-yJBHVIgwlAaapzlbvTpVF/ZOs8UkTj/sd46Fl8+qAf2/UiituPYVeapVD8ADZtqyRg/qNWUKt7gJoyYVWLrcXw== + dependencies: + commander "^6.0.0" + killable@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" @@ -10462,6 +10493,26 @@ regjsparser@^0.6.4: dependencies: jsesc "~0.5.0" +rehype-katex@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/rehype-katex/-/rehype-katex-5.0.0.tgz#b556f24fde918f28ba1cb642ea71c7e82f3373d7" + integrity sha512-ksSuEKCql/IiIadOHiKRMjypva9BLhuwQNascMqaoGLDVd0k2NlE2wMvgZ3rpItzRKCd6vs8s7MFbb8pcR0AEg== + dependencies: + "@types/katex" "^0.11.0" + hast-util-to-text "^2.0.0" + katex "^0.13.0" + rehype-parse "^7.0.0" + unified "^9.0.0" + unist-util-visit "^2.0.0" + +rehype-parse@^7.0.0: + version "7.0.1" + resolved "https://registry.npmjs.org/rehype-parse/-/rehype-parse-7.0.1.tgz#58900f6702b56767814afc2a9efa2d42b1c90c57" + integrity sha512-fOiR9a9xH+Le19i4fGzIEowAbwG7idy2Jzs4mOrFWBSJ0sNUgy0ev871dwWnbOo371SjgjG4pwzrbgSVrKxecw== + dependencies: + hast-util-from-parse5 "^6.0.0" + parse5 "^6.0.0" + relateurl@^0.2.7: version "0.2.7" resolved "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" @@ -10472,6 +10523,11 @@ remark-footnotes@2.0.0: resolved "https://registry.npmjs.org/remark-footnotes/-/remark-footnotes-2.0.0.tgz#9001c4c2ffebba55695d2dd80ffb8b82f7e6303f" integrity sha512-3Clt8ZMH75Ayjp9q4CorNeyjwIxHFcTkaektplKGl2A1jNGEUey8cKL0ZC5vJwfcD5GFGsNLImLG/NGzWIzoMQ== +remark-math@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/remark-math/-/remark-math-3.0.1.tgz#85a02a15b15cad34b89a27244d4887b3a95185bb" + integrity sha512-epT77R/HK0x7NqrWHdSV75uNLwn8g9qTyMqCRCDujL0vj/6T6+yhdrR7mjELWtkse+Fw02kijAaBuVcHBor1+Q== + remark-mdx@1.6.22: version "1.6.22" resolved "https://registry.npmjs.org/remark-mdx/-/remark-mdx-1.6.22.tgz#06a8dab07dcfdd57f3373af7f86bd0e992108bbd" @@ -10557,7 +10613,7 @@ repeat-element@^1.1.2: resolved "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== -repeat-string@^1.5.4, repeat-string@^1.6.1: +repeat-string@^1.0.0, repeat-string@^1.5.4, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= @@ -12110,6 +12166,18 @@ unified@^6.1.5: vfile "^2.0.0" x-is-string "^0.1.0" +unified@^9.0.0: + version "9.2.1" + resolved "https://registry.npmjs.org/unified/-/unified-9.2.1.tgz#ae18d5674c114021bfdbdf73865ca60f410215a3" + integrity sha512-juWjuI8Z4xFg8pJbnEZ41b5xjGUWGHqXALmBZ3FC3WX0PIx1CZBIIJ6mXbYMcf6Yw4Fi0rFUTA1cdz/BglbOhA== + dependencies: + bail "^1.0.0" + extend "^3.0.0" + is-buffer "^2.0.0" + is-plain-obj "^2.0.0" + trough "^1.0.0" + vfile "^4.0.0" + union-value@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" @@ -12149,6 +12217,13 @@ unist-builder@2.0.3, unist-builder@^2.0.0: resolved "https://registry.npmjs.org/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436" integrity sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw== +unist-util-find-after@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/unist-util-find-after/-/unist-util-find-after-3.0.0.tgz#5c65fcebf64d4f8f496db46fa8fd0fbf354b43e6" + integrity sha512-ojlBqfsBftYXExNu3+hHLfJQ/X1jYY/9vdm4yZWjIbf0VuWF6CRufci1ZyoD/wV2TYMKxXUoNuoqwy+CkgzAiQ== + dependencies: + unist-util-is "^4.0.0" + unist-util-generated@^1.0.0: version "1.1.6" resolved "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-1.1.6.tgz#5ab51f689e2992a472beb1b35f2ce7ff2f324d4b" From f7e57bb9259e34b0142bf6b04f407bc0eb6669a6 Mon Sep 17 00:00:00 2001 From: MuYunyun <328375795@qq.com> Date: Wed, 9 Jun 2021 13:40:29 +0800 Subject: [PATCH 8/9] =?UTF-8?q?feat:=20create-react-doc=20=E9=9B=86?= =?UTF-8?q?=E6=88=90=20MDX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + config.yml | 1 + ...64\346\226\260\346\227\245\345\277\227.md" | 9 +++++ ...30\351\230\266\347\224\250\346\263\225.md" | 37 ++--------------- injectLogic/index.js | 27 +------------ .../scripts/src/conf/modifyMarkdownLoader.js | 40 +++++++++---------- .../scripts/src/conf/webpack.config.dev.js | 4 +- packages/scripts/src/conf/webpack.config.js | 2 - packages/scripts/src/utils/initCache.js | 36 ++++++++--------- 9 files changed, 57 insertions(+), 101 deletions(-) diff --git a/.gitignore b/.gitignore index 51554dd20..1de26e584 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ package-lock.json #.swp *.*~ ~*.* + +docs/忽略文件.md \ No newline at end of file diff --git a/config.yml b/config.yml index d74d598b5..b4c90064f 100644 --- a/config.yml +++ b/config.yml @@ -16,6 +16,7 @@ menu: [ docs/书写组件.md, docs/数学公式.md, docs/高阶用法.md, + docs/忽略文件.md ] ## set init open menu keys # menuOpenKeys: diff --git "a/docs/\346\233\264\346\226\260\346\227\245\345\277\227.md" "b/docs/\346\233\264\346\226\260\346\227\245\345\277\227.md" index 9fc49fd05..f30f7c77c 100644 --- "a/docs/\346\233\264\346\226\260\346\227\245\345\277\227.md" +++ "b/docs/\346\233\264\346\226\260\346\227\245\345\277\227.md" @@ -2,6 +2,15 @@ `create-react-doc` 严格遵循 [Semantic Versioning 2.0.0](http://semver.org/lang/zh-CN/) 语义化版本规范。 +### 1.4.0 + +`2020-06-09` + +- **Feature** + + - 🚀 create-react-doc 集成 MDX。[issue](https://github.com/MuYunyun/create-react-doc/issues/138)、[mr](https://github.com/MuYunyun/create-react-doc/pull/143) + - 🚀 支持在 .md 文件中`书写 React 组件`。 + - 🚀 支持在 .md 文件中`书写数学公式`。 ### 1.2.0 diff --git "a/docs/\351\253\230\351\230\266\347\224\250\346\263\225.md" "b/docs/\351\253\230\351\230\266\347\224\250\346\263\225.md" index 5c172ec53..975f03252 100644 --- "a/docs/\351\253\230\351\230\266\347\224\250\346\263\225.md" +++ "b/docs/\351\253\230\351\230\266\347\224\250\346\263\225.md" @@ -2,11 +2,7 @@ 与 git 文件结构类似, 如果在展示的文件夹中有私有文件不方便展示在文档站点, 可以在 `.gitignore` 文件中设置过滤文件, 这样它们就不会展示在文档站点中了。eg: [.gitignore](https://github.com/MuYunyun/blog/blob/main/.gitignore) -## 数学公式 - -Todo: - -### 使用方式 +### 插入自定义脚本 在 `config.yml` 文件中加入 `inject` 字段。 @@ -14,36 +10,11 @@ Todo: + inject: injectLogic/index.js ``` -然后在根目录新建与 `inject` 字段相对应的文件, 声明 `injectWithPathname` 函数, 写入[自定义逻辑](https://github.com/MuYunyun/create-react-doc/injectLogic/index.js), 完成 MathJax 的使用。 +然后在根目录新建与 `inject` 字段相对应的文件, 声明 `injectWithPathname` 函数, 写入[自定义逻辑](https://github.com/MuYunyun/create-react-doc/injectLogic/index.js)。 ```js // perf injectWithPathname logic every pathname changes -const injectWithPathname = (pathname) => { - // demo for using mathjax. see https://github.com/MuYunyun/create-react-doc/issues/63 - if (pathname !== '/高阶用法') return; - window.MathJax = { - tex: { - inlineMath: [['$', '$'], ['\\(', '\\)']], - }, - svg: { - fontCache: 'global', - }, - }; - const script = document.createElement('script'); - script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js'; - const tag = 'mathjax'; - script.id = tag; - script.async = true; - const scriptNode = document.getElementById(tag); - try { - if (!scriptNode) { - document.head.appendChild(script); - } else { - scriptNode.remove(); - document.head.appendChild(script); - } - } catch (error) {} -}; +const injectWithPathname = (pathname) => {} -module.exports = { injectWithPathname }; +module.exports = { injectWithPathname } ``` \ No newline at end of file diff --git a/injectLogic/index.js b/injectLogic/index.js index 44ffdd691..a1a94c89d 100644 --- a/injectLogic/index.js +++ b/injectLogic/index.js @@ -9,31 +9,6 @@ const inject = () => { } // perf injectWithPathname logic every pathname changes -const injectWithPathname = (pathname) => { - // demo for using mathjax. see https://github.com/MuYunyun/create-react-doc/issues/63 - if (pathname !== '/高阶用法') return - window.MathJax = { - tex: { - inlineMath: [['$', '$'], ['\\(', '\\)']], - }, - svg: { - fontCache: 'global', - }, - } - const script = document.createElement('script') - script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js' - const tag = 'mathjax' - script.id = tag - script.async = true - const scriptNode = document.getElementById(tag) - try { - if (!scriptNode) { - document.head.appendChild(script) - } else { - scriptNode.remove() - document.head.appendChild(script) - } - } catch (error) {} -} +const injectWithPathname = (pathname) => {} module.exports = { inject, injectWithPathname } diff --git a/packages/scripts/src/conf/modifyMarkdownLoader.js b/packages/scripts/src/conf/modifyMarkdownLoader.js index 9497693a7..0fd6eeffe 100644 --- a/packages/scripts/src/conf/modifyMarkdownLoader.js +++ b/packages/scripts/src/conf/modifyMarkdownLoader.js @@ -1,23 +1,23 @@ -/** - * this webpack plugin is to modify markdown position. - */ -const loaderUtils = require('loader-utils') -const PATH = require('path') -const FS = require('fs') +// /** +// * this webpack plugin is to modify markdown position. +// */ +// const loaderUtils = require('loader-utils') +// const PATH = require('path') +// const FS = require('fs') -module.exports = function (source) { - const options = loaderUtils.getOptions(this) || {} - const { replace, sep, path, include, extensions } = options - let content = '' +// module.exports = function (source) { +// const options = loaderUtils.getOptions(this) || {} +// const { replace, sep, path, include, extensions } = options +// let content = '' - let fpath = this.resourcePath.replace(sep || /___/g, PATH.sep) - if (path && replace && (!include || include.test(fpath))) { - fpath = fpath.replace(path, replace) - this.addDependency(fpath) - } +// let fpath = this.resourcePath.replace(sep || /___/g, PATH.sep) +// if (path && replace && (!include || include.test(fpath))) { +// fpath = fpath.replace(path, replace) +// this.addDependency(fpath) +// } - if (FS.existsSync(fpath)) { - content = FS.readFileSync(fpath) - } - return content -} +// if (FS.existsSync(fpath)) { +// content = FS.readFileSync(fpath) +// } +// return content +// } diff --git a/packages/scripts/src/conf/webpack.config.dev.js b/packages/scripts/src/conf/webpack.config.dev.js index e83ae437d..dbddb072e 100644 --- a/packages/scripts/src/conf/webpack.config.dev.js +++ b/packages/scripts/src/conf/webpack.config.dev.js @@ -3,10 +3,10 @@ const webpack = require('webpack') const path = require('path') const upath = require('upath') const HtmlWebpackPlugin = require('html-webpack-plugin') -const { defaultHTMLPath, cacheDirPath } = require('crd-utils') +const { defaultHTMLPath } = require('crd-utils') const FriendlyErrorsWebpackPlugin = require('@nuxtjs/friendly-errors-webpack-plugin') const { getDocsConfig } = require('crd-utils') -const CreateSpareWebpackPlugin = require('./createSpareWebpackPlugin') +// const CreateSpareWebpackPlugin = require('./createSpareWebpackPlugin') const config = require('./webpack.config') const paths = require('./path') diff --git a/packages/scripts/src/conf/webpack.config.js b/packages/scripts/src/conf/webpack.config.js index 61f84104c..92bffd03b 100644 --- a/packages/scripts/src/conf/webpack.config.js +++ b/packages/scripts/src/conf/webpack.config.js @@ -1,6 +1,5 @@ /* eslint-disable global-require */ /* eslint-disable import/no-dynamic-require */ -const path = require('path') const webpack = require('webpack') const webpackbar = require('webpackbar') const fs = require('fs') @@ -69,7 +68,6 @@ module.exports = { loader: require.resolve('babel-loader'), options: require('../../.babelrc'), // eslint-disable-line }, - // '@mdx-js/loader', { loader: require.resolve('@mdx-js/loader'), options: { diff --git a/packages/scripts/src/utils/initCache.js b/packages/scripts/src/utils/initCache.js index 7e2ffd08d..4b87aeba6 100644 --- a/packages/scripts/src/utils/initCache.js +++ b/packages/scripts/src/utils/initCache.js @@ -32,25 +32,25 @@ module.exports = function (program, cb) { // eslint-disable-next-line no-plusplus for (let i = 0; i < flatTreeData.length; i++) { const mdfile = flatTreeData[i] - const mdfilePath = mdfile.replace( - process.cwd() + path.sep, - '', - ) + // const mdfilePath = mdfile.replace( + // process.cwd() + path.sep, + // '', + // ) // generate file cache only it isn't in .gitignore - if (!ifInGitIgnore(mdfilePath)) { - // todo: remove ___ - const underlineFileName = mdfilePath.split(path.sep).join('___') - const writeMarkdownPath = path.resolve( - process.cwd(), - cacheDirPath, - 'md', - underlineFileName, - ) - if (fs.existsSync(mdfile)) { - const content = fs.readFileSync(mdfile) - write.sync(writeMarkdownPath, content) - } - } + // if (!ifInGitIgnore(mdfilePath)) { + // // todo: remove ___ + // const underlineFileName = mdfilePath.split(path.sep).join('___') + // const writeMarkdownPath = path.resolve( + // process.cwd(), + // cacheDirPath, + // 'md', + // underlineFileName, + // ) + // if (fs.existsSync(mdfile)) { + // const content = fs.readFileSync(mdfile) + // write.sync(writeMarkdownPath, content) + // } + // } } function dfsMap(data) { From 291eebba6f0c081bfde3ef8322278555d1a8549d Mon Sep 17 00:00:00 2001 From: MuYunyun <328375795@qq.com> Date: Wed, 9 Jun 2021 18:55:50 +0800 Subject: [PATCH 9/9] feat: create-react-doc support MDX --- .babelrc.js | 36 --------- config.yml | 3 +- ...32\344\271\211\344\270\273\351\242\230.md" | 0 ...30\350\256\244\344\270\273\351\242\230.md" | 0 ...46\345\206\231\347\273\204\344\273\266.md" | 2 +- ...60\345\255\246\345\205\254\345\274\217.md" | 20 +++-- ...64\346\226\260\346\227\245\345\277\227.md" | 12 ++- packages/create-react-doc/index.js | 1 - packages/scripts/package.json | 4 - .../scripts/src/conf/modifyMarkdownLoader.js | 23 ------ .../scripts/src/conf/webpack.config.dev.js | 11 --- .../scripts/src/conf/webpack.config.prod.js | 14 +--- packages/scripts/src/utils/initCache.js | 40 +--------- packages/theme/index.html | 1 - packages/theme/markdown/InlineCode.js | 74 ------------------- packages/theme/markdown/InlineCode.less | 33 --------- packages/theme/markdown/index.js | 35 --------- packages/theme/markdown/style/default.less | 31 ++++---- yarn.lock | 49 +----------- 19 files changed, 43 insertions(+), 346 deletions(-) delete mode 100644 .babelrc.js rename "docs/\350\207\252\345\256\232\344\271\211\344\270\273\351\242\230.md" => "docs/\344\270\273\351\242\230/\350\207\252\345\256\232\344\271\211\344\270\273\351\242\230.md" (100%) rename "docs/\351\273\230\350\256\244\344\270\273\351\242\230.md" => "docs/\344\270\273\351\242\230/\351\273\230\350\256\244\344\270\273\351\242\230.md" (100%) delete mode 100644 packages/scripts/src/conf/modifyMarkdownLoader.js delete mode 100644 packages/theme/markdown/InlineCode.js delete mode 100644 packages/theme/markdown/InlineCode.less diff --git a/.babelrc.js b/.babelrc.js deleted file mode 100644 index 806a2b7fe..000000000 --- a/.babelrc.js +++ /dev/null @@ -1,36 +0,0 @@ -const babelrc = { - presets: [ - [ - "@babel/preset-env", - { - targets: { - browsers: ["last 2 versions", "ie >= 10"], - }, - }, - ], - ["@babel/preset-react", { - "runtime": "automatic" - }] - ], - plugins: [ - "@babel/plugin-syntax-object-rest-spread", - "@babel/plugin-syntax-dynamic-import", - "@babel/plugin-transform-async-to-generator", - "@babel/plugin-proposal-class-properties", - "@babel/plugin-transform-runtime" - ], - env: { - production: {}, - }, -}; - -if (process.env.NODE_ENV === 'development') { - // 不要包含多余的空格字符和行结束符。 - // 设置为“auto”时,对于大于500KB的输入大小,设置为"true"。 - // https://babeljs.io/docs/usage/api/#options - babelrc.cacheDirectory = true; -} else { - babelrc.compact = true; -} - -module.exports = babelrc diff --git a/config.yml b/config.yml index b4c90064f..c4ea33148 100644 --- a/config.yml +++ b/config.yml @@ -9,9 +9,8 @@ title: Create React Doc menu: [ docs/快速上手.md, docs/更新日志.md, - docs/默认主题.md, + docs/主题, docs/站点发布.md, - docs/自定义主题.md, docs/其它工具.md, docs/书写组件.md, docs/数学公式.md, diff --git "a/docs/\350\207\252\345\256\232\344\271\211\344\270\273\351\242\230.md" "b/docs/\344\270\273\351\242\230/\350\207\252\345\256\232\344\271\211\344\270\273\351\242\230.md" similarity index 100% rename from "docs/\350\207\252\345\256\232\344\271\211\344\270\273\351\242\230.md" rename to "docs/\344\270\273\351\242\230/\350\207\252\345\256\232\344\271\211\344\270\273\351\242\230.md" diff --git "a/docs/\351\273\230\350\256\244\344\270\273\351\242\230.md" "b/docs/\344\270\273\351\242\230/\351\273\230\350\256\244\344\270\273\351\242\230.md" similarity index 100% rename from "docs/\351\273\230\350\256\244\344\270\273\351\242\230.md" rename to "docs/\344\270\273\351\242\230/\351\273\230\350\256\244\344\270\273\351\242\230.md" diff --git "a/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" "b/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" index 21b3a89d6..0e82c45a4 100644 --- "a/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" +++ "b/docs/\344\271\246\345\206\231\347\273\204\344\273\266.md" @@ -2,7 +2,7 @@ import { Button } from '../components/index.jsx' ## 书写组件 -[create-react-doc](https://github.com/MuYunyun/create-react-doc) 内置了 [mdx](https://github.com/mdx-js/mdx), 你可以在 .md 文件中书写 React 组件, 因此你可以选择 create-react-doc 来快速搭建组件站点开发环境。 +[create-react-doc](https://github.com/MuYunyun/create-react-doc) 内置了 [mdx](https://github.com/mdx-js/mdx), 你可以在 .md 文件中书写 React 组件, 因此你可以选择 create-react-doc 来快速搭建组件站点。 ## 例子 ### Button 组件 diff --git "a/docs/\346\225\260\345\255\246\345\205\254\345\274\217.md" "b/docs/\346\225\260\345\255\246\345\205\254\345\274\217.md" index ddd0a9dfa..5cebe3e23 100644 --- "a/docs/\346\225\260\345\255\246\345\205\254\345\274\217.md" +++ "b/docs/\346\225\260\345\255\246\345\205\254\345\274\217.md" @@ -1,30 +1,38 @@ ## 数学公式 -在 `$$` 与 `$$` 之间书写 latex 数学公式即能显示在网页上。 +支持在 `$$` 与 `$$` 之间书写 latex 数学公式即能显示在网页上。 ```js $$ z = \frac{x}{y} $$ +``` + +被转化为: $$ -C_1 \quad= \quad c_2 + c_4^3 +z = \frac{x}{y} $$ +```js $$ -y = \sqrt {x_1^2 + x_2^2 + x_3^2 + x_4^2} +C_1 \quad= \quad c_2 + c_4^3 $$ ``` -被转化为 +被转化为: $$ -z = \frac{x}{y} +C_1 \quad= \quad c_2 + c_4^3 $$ +```js $$ -C_1 \quad= \quad c_2 + c_4^3 +y = \sqrt {x_1^2 + x_2^2 + x_3^2 + x_4^2} $$ +``` + +被转化为: $$ y = \sqrt {x_1^2 + x_2^2 + x_3^2 + x_4^2} diff --git "a/docs/\346\233\264\346\226\260\346\227\245\345\277\227.md" "b/docs/\346\233\264\346\226\260\346\227\245\345\277\227.md" index f30f7c77c..fecc3e11a 100644 --- "a/docs/\346\233\264\346\226\260\346\227\245\345\277\227.md" +++ "b/docs/\346\233\264\346\226\260\346\227\245\345\277\227.md" @@ -2,15 +2,19 @@ `create-react-doc` 严格遵循 [Semantic Versioning 2.0.0](http://semver.org/lang/zh-CN/) 语义化版本规范。 -### 1.4.0 +### 1.3.0 `2020-06-09` - **Feature** - 🚀 create-react-doc 集成 MDX。[issue](https://github.com/MuYunyun/create-react-doc/issues/138)、[mr](https://github.com/MuYunyun/create-react-doc/pull/143) - - 🚀 支持在 .md 文件中`书写 React 组件`。 - - 🚀 支持在 .md 文件中`书写数学公式`。 + - 🚀 支持在 markdown 文件中`书写 React 组件`。 + - 🚀 支持在 markdown 文件中`书写数学公式`。 + +- **Enhancement** + + - 🎈 支持 yarn up、yarn up:dev 在 lerna 项目中快速安装包。[mr](https://github.com/MuYunyun/create-react-doc/pull/143/files?file-filters%5B%5D=.html&file-filters%5B%5D=.js&file-filters%5B%5D=.json&file-filters%5B%5D=.less&file-filters%5B%5D=.lock&file-filters%5B%5D=.sh) ### 1.2.0 @@ -114,7 +118,7 @@ - **Enhancement** - - 🎈项目结构重构为 monorepo。[pr](https://github.com/MuYunyun/create-react-doc/pull/16) + - 🎈 项目结构重构为 monorepo。[pr](https://github.com/MuYunyun/create-react-doc/pull/16) ### 0.1.0 diff --git a/packages/create-react-doc/index.js b/packages/create-react-doc/index.js index 935a90c8f..e8da6f216 100755 --- a/packages/create-react-doc/index.js +++ b/packages/create-react-doc/index.js @@ -39,7 +39,6 @@ program const { start, build, deploy, theme } = program -console.log('start', start) if (!start && !build && !deploy && !theme) return initProject(program) if (theme) { diff --git a/packages/scripts/package.json b/packages/scripts/package.json index 5f5bfca15..207d2ba40 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -33,17 +33,13 @@ "eslint": "^7.11.0", "eslint-loader": "^4.0.2", "file-loader": "^1.1.11", - "front-matter": "^4.0.2", "fs-extra": "^5.0.0", "gh-pages": "^1.2.0", - "highlight.js": "^11.0.1", "html-webpack-plugin": "^4.5.1", "less-loader": "^7.2.1", "loader-utils": "^2.0.0", "loading-cli": "^1.0.6", "local-ip-url": "^1.0.1", - "markdown-it": "^12.0.6", - "markdown-it-container": "^3.0.0", "mini-css-extract-plugin": "^0.4.0", "open-browsers": "^1.1.1", "path-browserify": "^1.0.1", diff --git a/packages/scripts/src/conf/modifyMarkdownLoader.js b/packages/scripts/src/conf/modifyMarkdownLoader.js deleted file mode 100644 index 0fd6eeffe..000000000 --- a/packages/scripts/src/conf/modifyMarkdownLoader.js +++ /dev/null @@ -1,23 +0,0 @@ -// /** -// * this webpack plugin is to modify markdown position. -// */ -// const loaderUtils = require('loader-utils') -// const PATH = require('path') -// const FS = require('fs') - -// module.exports = function (source) { -// const options = loaderUtils.getOptions(this) || {} -// const { replace, sep, path, include, extensions } = options -// let content = '' - -// let fpath = this.resourcePath.replace(sep || /___/g, PATH.sep) -// if (path && replace && (!include || include.test(fpath))) { -// fpath = fpath.replace(path, replace) -// this.addDependency(fpath) -// } - -// if (FS.existsSync(fpath)) { -// content = FS.readFileSync(fpath) -// } -// return content -// } diff --git a/packages/scripts/src/conf/webpack.config.dev.js b/packages/scripts/src/conf/webpack.config.dev.js index dbddb072e..227108fd0 100644 --- a/packages/scripts/src/conf/webpack.config.dev.js +++ b/packages/scripts/src/conf/webpack.config.dev.js @@ -6,7 +6,6 @@ const HtmlWebpackPlugin = require('html-webpack-plugin') const { defaultHTMLPath } = require('crd-utils') const FriendlyErrorsWebpackPlugin = require('@nuxtjs/friendly-errors-webpack-plugin') const { getDocsConfig } = require('crd-utils') -// const CreateSpareWebpackPlugin = require('./createSpareWebpackPlugin') const config = require('./webpack.config') const paths = require('./path') @@ -121,16 +120,6 @@ module.exports = function (cmd) { template: defaultHTMLPath, title: docsConfig && docsConfig.title ? docsConfig.title : 'Create React Doc', }), - // new CreateSpareWebpackPlugin({ - // // 备用文件目录,比对是否存在,不存在生成,根据 sep 目录规则生成 - // path: path.join(cacheDirPath, './md'), - // sep: '___', // 检查目标目录文件,文件名存储,文件夹+下划线间隔+文件名 - // directoryTrees: { // 索引目录 - // dir: cmd.markdownPaths, - // mdconf: true, - // extensions: /\.md$/, - // }, - // }), new FriendlyErrorsWebpackPlugin({ clearConsole: true, }), diff --git a/packages/scripts/src/conf/webpack.config.prod.js b/packages/scripts/src/conf/webpack.config.prod.js index c1fc15317..631397b4d 100755 --- a/packages/scripts/src/conf/webpack.config.prod.js +++ b/packages/scripts/src/conf/webpack.config.prod.js @@ -10,9 +10,8 @@ const { generateSiteMap } = require('crd-generator-sitemap') // const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); // const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const fs = require('fs-extra') -const { defaultHTMLPath, cacheDirPath, docsBuildDist } = require('crd-utils') +const { defaultHTMLPath, docsBuildDist } = require('crd-utils') const { getDocsConfig } = require('crd-utils') -const CreateSpareWebpackPlugin = require('./createSpareWebpackPlugin') const config = require('./webpack.config') const paths = require('./path') const getPrerenderRoutes = require('./getPrerenderRoutes') @@ -147,17 +146,6 @@ module.exports = function (cmd) { dir: cmd.markdownPaths, toDir: config.output.path, }), - // new CreateSpareWebpackPlugin({ - // // 备用文件目录,比对是否存在,不存在生成,根据 sep 目录规则生成 - // path: path.join(cacheDirPath, './md'), - // sep: '___', // 检查目标目录文件,文件名存储,文件夹+下划线间隔+文件名 - // directoryTrees: { - // // 索引目录 - // dir: cmd.markdownPaths, - // mdconf: true, - // extensions: /\.md$/, - // }, - // }), // new webpack.optimize.DedupePlugin(), new MiniCssExtractPlugin({ // Options similar to the same options in webpackOptions.output diff --git a/packages/scripts/src/utils/initCache.js b/packages/scripts/src/utils/initCache.js index 4b87aeba6..de31ed6ca 100644 --- a/packages/scripts/src/utils/initCache.js +++ b/packages/scripts/src/utils/initCache.js @@ -1,57 +1,19 @@ const write = require('write') const path = require('path') -const fs = require('fs') const { cacheDirPath, getDocsConfig } = require('crd-utils') const DirectoryTree = require('../conf/node-directory-tree') -const { ifInGitIgnore } = require('./index') - -function restRuctureMarkdown(items, arr = []) { - items.forEach((item) => { - if (item.type === 'directory') { - restRuctureMarkdown(item.children, arr) - } else if (/\.md$/.test(item.path)) { - arr.push(item.path) - } - }) - return arr -} module.exports = function (program, cb) { const treeData = program.markdownPaths.map((markdownPath) => { return DirectoryTree(markdownPath, { - mdconf: true, // 存在 Markdown 设置 + mdconf: true, // Markdown config for exsiting file. extensions: /\.md/, }) }) - // cache Markdown, Markdown file name rule: `folder__folder__Markdown name.md` - const flatTreeData = restRuctureMarkdown(treeData) // to collect search data const searchData = [] const docsConfig = getDocsConfig() const useSearchPlugin = docsConfig.search && docsConfig.host - // eslint-disable-next-line no-plusplus - for (let i = 0; i < flatTreeData.length; i++) { - const mdfile = flatTreeData[i] - // const mdfilePath = mdfile.replace( - // process.cwd() + path.sep, - // '', - // ) - // generate file cache only it isn't in .gitignore - // if (!ifInGitIgnore(mdfilePath)) { - // // todo: remove ___ - // const underlineFileName = mdfilePath.split(path.sep).join('___') - // const writeMarkdownPath = path.resolve( - // process.cwd(), - // cacheDirPath, - // 'md', - // underlineFileName, - // ) - // if (fs.existsSync(mdfile)) { - // const content = fs.readFileSync(mdfile) - // write.sync(writeMarkdownPath, content) - // } - // } - } function dfsMap(data) { // eslint-disable-next-line no-plusplus diff --git a/packages/theme/index.html b/packages/theme/index.html index 1471b8b92..02b7a91c4 100644 --- a/packages/theme/index.html +++ b/packages/theme/index.html @@ -9,7 +9,6 @@ - diff --git a/packages/theme/markdown/InlineCode.js b/packages/theme/markdown/InlineCode.js deleted file mode 100644 index f84e21f4c..000000000 --- a/packages/theme/markdown/InlineCode.js +++ /dev/null @@ -1,74 +0,0 @@ -// import classNames from 'classnames' -import React from 'react' -import Highlight, { defaultProps } from 'prism-react-renderer' -import styles from './InlineCode.less' - -// export default class Canvas extends PureComponent { -// constructor() { -// super() -// this.state = { -// height: 0, -// } -// this.playerId = `${parseInt(Math.random() * 1e9, 10).toString(36)}` -// } -// onClick() { -// this.setState({ -// height: this.state.height === 0 ? this.codeDom.clientHeight : 0, -// }) -// } -// render() { -// const sourceCode = this.props.value || '' -// // const code = sourceCode.replace(/^__dome__/, '').replace(/\\`/g, '`') -// const code = sourceCode.replace(/\\`/g, '`') -// const PreCode = height => ( -//
-//          this.codeDom = node} className={classNames('hljs', { [`language-${this.props.language}`]: this.props.language })}>
-//           {code}
-//         
-//       
-// ) -// // const isPreview = /^(html|htm)$/.test(this.props.language) - -// // if (/^__dome__/.test(sourceCode)) { -// // return ( -// //
-// // {isPreview && ( -// //
-// //
-// //
-// // )} -// // {PreCode(this.state.height)} -// //
-// // {this.state.height === 0 ? '显示' : '隐藏'}代码 -// // {this.props.language &&
{this.props.language}
} -// //
-// //
-// // ) -// // } -// return PreCode() -// } -// } - -export default ({ children, className }) => { - const language = className.replace(/language-/, '') - return ( - - {({ className, style, tokens, getLineProps, getTokenProps }) => ( -
-          {tokens.map((line, i) => (
-            
- {line.map((token, key) => ( - - ))} -
- ))} -
- )} -
- ) -} diff --git a/packages/theme/markdown/InlineCode.less b/packages/theme/markdown/InlineCode.less deleted file mode 100644 index 0398827f8..000000000 --- a/packages/theme/markdown/InlineCode.less +++ /dev/null @@ -1,33 +0,0 @@ -.demo { - border: 1px solid #d5d5d5; - border-radius: 4px; - margin-bottom: 15px; - .demoBody { - padding: 10px; - } - pre.highlight { - margin-bottom: 0; - margin-top: 0; - transition: all .3s; - :global(.hljs) { - padding: 10px; - } - } - .demoBody + pre.highlight + .demoControl { - border-top: 1px solid #d5d5d5; - } - .isPreview { - border-top: 1px solid #d5d5d5; - } - .demoControl { - padding: 3px 8px; - line-height: 20px; - background-color: rgba(0,0,0,.03); - cursor: pointer; - .language { - float: right; - text-shadow: 0 1px white; - color: #b1b1b1; - } - } -} diff --git a/packages/theme/markdown/index.js b/packages/theme/markdown/index.js index 00c92d946..391022a2c 100644 --- a/packages/theme/markdown/index.js +++ b/packages/theme/markdown/index.js @@ -1,33 +1,17 @@ import { useState, useEffect, useRef } from 'react' import cx from 'classnames' -// import ReactMarkdown from 'react-markdown' -// import hljs from 'highlight.js' import { MDXProvider } from '@mdx-js/react' import CodeBlock from './codeBlock' -// import InlineCode from './InlineCode' import Link from './Link' import Loading from '../component/Loading' import styles from './style/index.less' -// hljs.configure({ -// tabReplace: ' ', // 2 spaces -// classPrefix: '', // don't append class prefix -// }) - -const formatPath = path => - path.replace(/^(\/|\\)/, '') - .replace(/\.md$/, '') - .replace(/\\/g, '/') - .split('/') - .join('___') - const components = { code: CodeBlock, link: Link, } function Markdown(markdownProps) { - // const { props } = markdownProps const { props } = markdownProps const { relative } = props const [MarkdownCP, setMarkdownCP] = useState(null) @@ -36,16 +20,6 @@ function Markdown(markdownProps) { const renderMarkdown = () => { const relativeMd = relative if (!relativeMd) return null - // let filename = formatPath(relativeMd) - // if (type === 'directory') { - // filename = formatPath(relativeMd) - // } - // import(`__project_root__/.cache/md/${filename}.md`).then((data) => { - // import(`__project_root__${relative}`).then((data) => { - // console.log('data', data) - // // data.default is a function, so we should write () => data.default in setState here. - // // setMarkdownCP(() => (data.default || data)) - // }) const rmFirstSlash = relative.slice(1, relative.length - 3) // it must be writen with / & .md in dynamic import @@ -59,15 +33,6 @@ function Markdown(markdownProps) { renderMarkdown() }, []) - // useEffect(() => { - // const code = markdownWrapperRef.current.getElementsByTagName('code') - // for (let i = 0; i < code.length; i += 1) { - // if (code[i].parentNode && code[i].parentNode.tagName === 'PRE') { - // hljs.highlightBlock(code[i]) - // } - // } - // }, [markdownStr]) - return (
{ diff --git a/packages/theme/markdown/style/default.less b/packages/theme/markdown/style/default.less index 4e36f86bc..4f945c55c 100644 --- a/packages/theme/markdown/style/default.less +++ b/packages/theme/markdown/style/default.less @@ -3,27 +3,26 @@ code { word-wrap: normal; } -code:not(.hljs) { - padding: 0.2em 0.4em; - margin: 0; - font-size: 85%; - background-color: rgba(27, 31, 35, 0.07); - border-radius: 3px; -} - -code.hljs { - padding: 16px; - font-size: 95%; - line-height: 1.5; - display: block; - text-shadow: 0 1px #fff; -} +// code:not(.hljs) { +// padding: 0.2em 0.4em; +// margin: 0; +// font-size: 85%; +// background-color: rgba(27, 31, 35, 0.07); +// border-radius: 3px; +// } + +// code.hljs { +// padding: 16px; +// font-size: 95%; +// line-height: 1.5; +// display: block; +// text-shadow: 0 1px #fff; +// } pre { max-height: 35em; position: relative; overflow: auto; - // background-color: #F0F0F0; background-color: rgb(251, 251, 251); border-radius: 3px; } diff --git a/yarn.lock b/yarn.lock index dfe869cd1..1d9f577cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2730,11 +2730,6 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - aria-query@^4.2.2: version "4.2.2" resolved "https://registry.npmjs.org/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" @@ -4850,7 +4845,7 @@ entities@^1.1.1: resolved "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== -entities@^2.0.0, entities@~2.1.0: +entities@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== @@ -5728,13 +5723,6 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" -front-matter@^4.0.2: - version "4.0.2" - resolved "https://registry.npmjs.org/front-matter/-/front-matter-4.0.2.tgz#b14e54dc745cfd7293484f3210d15ea4edd7f4d5" - integrity sha512-I8ZuJ/qG92NWX8i5x1Y8qyj3vizhXS31OxjKDu3LKP+7/qBgfIKValiZIEwoVoJKUHlhWtYrktkxV1XsX+pPlg== - dependencies: - js-yaml "^3.13.1" - fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" @@ -6271,11 +6259,6 @@ hex-color-regex@^1.1.0: resolved "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== -highlight.js@^11.0.1: - version "11.0.1" - resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-11.0.1.tgz#a78bafccd9aa297978799fe5eed9beb7ee1ef887" - integrity sha512-EqYpWyTF2s8nMfttfBA2yLKPNoZCO33pLS4MnbXQ4hECf1TKujCt1Kq7QAdrio7roL4+CqsfjqwYj4tYgq0pJQ== - history@^4.7.2: version "4.10.1" resolved "https://registry.npmjs.org/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3" @@ -7490,13 +7473,6 @@ lines-and-columns@^1.1.6: resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= -linkify-it@^3.0.1: - version "3.0.2" - resolved "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.2.tgz#f55eeb8bc1d3ae754049e124ab3bb56d97797fb8" - integrity sha512-gDBO4aHNZS6coiZCKVhSNh43F9ioIL4JwRjLZPkoLIY4yZFwg264Y5lu2x6rb1Js42Gh6Yqm2f6L2AJcnkzinQ== - dependencies: - uc.micro "^1.0.1" - load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -7806,22 +7782,6 @@ markdown-escapes@^1.0.0: resolved "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg== -markdown-it-container@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/markdown-it-container/-/markdown-it-container-3.0.0.tgz#1d19b06040a020f9a827577bb7dbf67aa5de9a5b" - integrity sha512-y6oKTq4BB9OQuY/KLfk/O3ysFhB3IMYoIWhGJEidXt1NQFocFK2sA2t0NYZAMyMShAGL6x5OPIbrmXPIqaN9rw== - -markdown-it@^12.0.6: - version "12.0.6" - resolved "https://registry.npmjs.org/markdown-it/-/markdown-it-12.0.6.tgz#adcc8e5fe020af292ccbdf161fe84f1961516138" - integrity sha512-qv3sVLl4lMT96LLtR7xeRJX11OUFjsaD5oVat2/SNBIb21bJXwal2+SklcRbTwGwqWpWH/HRtYavOoJE+seL8w== - dependencies: - argparse "^2.0.1" - entities "~2.1.0" - linkify-it "^3.0.1" - mdurl "^1.0.1" - uc.micro "^1.0.5" - math-expression-evaluator@^1.2.14: version "1.2.22" resolved "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.22.tgz#c14dcb3d8b4d150e5dcea9c68c8dad80309b0d5e" @@ -7887,7 +7847,7 @@ mdn-data@2.0.4: resolved "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== -mdurl@^1.0.0, mdurl@^1.0.1: +mdurl@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= @@ -12078,11 +12038,6 @@ typedarray@^0.0.6: resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -uc.micro@^1.0.1, uc.micro@^1.0.5: - version "1.0.6" - resolved "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" - integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== - uglify-js@^3.1.4: version "3.11.5" resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.5.tgz#d6788bc83cf35ff18ea78a65763e480803409bc6"