From d1913479e15fab32befb6c4194972b2cb898a3cf Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 5 May 2022 08:26:53 +0000 Subject: [PATCH 1/2] Bump unist-util-visit to ^4.1.0 --- package.json | 2 +- yarn.lock | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 95b776fabd6211..cdc7019ed01501 100644 --- a/package.json +++ b/package.json @@ -180,7 +180,7 @@ "terser-webpack-plugin": "^5.3.1", "tslint": "5.14.0", "typescript": "^4.6.4", - "unist-util-visit": "^2.0.3", + "unist-util-visit": "^4.1.0", "util": "^0.12.4", "webpack": "^5.72.0", "webpack-bundle-analyzer": "^4.5.0", diff --git a/yarn.lock b/yarn.lock index 8454c9e9c8db35..cc7816ca427b6b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15762,6 +15762,11 @@ unist-util-is@^4.0.0: resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-4.0.2.tgz#c7d1341188aa9ce5b3cff538958de9895f14a5de" integrity sha512-Ofx8uf6haexJwI1gxWMGg6I/dLnF2yE+KibhD3/diOqY2TinLcqHXCV6OI5gFVn3xQqDH+u0M625pfKwIwgBKQ== +unist-util-is@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-5.1.1.tgz#e8aece0b102fa9bc097b0fef8f870c496d4a6236" + integrity sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ== + unist-util-stringify-position@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz#cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da" @@ -15769,22 +15774,22 @@ unist-util-stringify-position@^2.0.0: dependencies: "@types/unist" "^2.0.2" -unist-util-visit-parents@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-3.0.2.tgz#d4076af3011739c71d2ce99d05de37d545f4351d" - integrity sha512-yJEfuZtzFpQmg1OSCyS9M5NJRrln/9FbYosH3iW0MG402QbdbaB8ZESwUv9RO6nRfLAKvWcMxCwdLWOov36x/g== +unist-util-visit-parents@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-5.1.0.tgz#44bbc5d25f2411e7dfc5cecff12de43296aa8521" + integrity sha512-y+QVLcY5eR/YVpqDsLf/xh9R3Q2Y4HxkZTp7ViLDU6WtJCEcPmRzW1gpdWDCDIqIlhuPDXOgttqPlykrHYDekg== dependencies: "@types/unist" "^2.0.0" - unist-util-is "^4.0.0" + unist-util-is "^5.0.0" -unist-util-visit@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c" - integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== +unist-util-visit@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-4.1.0.tgz#f41e407a9e94da31594e6b1c9811c51ab0b3d8f5" + integrity sha512-n7lyhFKJfVZ9MnKtqbsqkQEk5P1KShj0+//V7mAcoI6bpbUjh3C/OG8HVD+pBihfh6Ovl01m8dkcv9HNqYajmQ== dependencies: "@types/unist" "^2.0.0" - unist-util-is "^4.0.0" - unist-util-visit-parents "^3.0.0" + unist-util-is "^5.0.0" + unist-util-visit-parents "^5.0.0" universal-url@^2.0.0: version "2.0.0" From 114487af71f3d5abce4788d1720a99e7750a1121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dudak?= Date: Tue, 31 May 2022 11:44:39 +0200 Subject: [PATCH 2/2] Resolve issues from breaking changes --- docs/scripts/ApiBuilders/ComponentApiBuilder.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/scripts/ApiBuilders/ComponentApiBuilder.ts b/docs/scripts/ApiBuilders/ComponentApiBuilder.ts index 041385563fa173..3341293d80fec3 100644 --- a/docs/scripts/ApiBuilders/ComponentApiBuilder.ts +++ b/docs/scripts/ApiBuilders/ComponentApiBuilder.ts @@ -7,7 +7,7 @@ import * as _ from 'lodash'; import kebabCase from 'lodash/kebabCase'; import * as prettier from 'prettier'; import remark from 'remark'; -import remarkVisit from 'unist-util-visit'; +import { visit as remarkVisit, Parent } from 'unist-util-visit'; import { defaultHandlers, parse as docgenParse, ReactDocgenApi } from 'react-docgen'; import muiDefaultPropsHandler from 'docs/src/modules/utils/defaultPropsHandler'; import { LANGUAGES } from 'docs/src/modules/constants'; @@ -85,6 +85,11 @@ export function writePrettifiedFile( }); } +interface LinkNode extends Parent { + type: 'link'; + url: string; +} + /** * Produces markdown of the description that can be hosted anywhere. * @@ -97,7 +102,7 @@ async function computeApiDescription(api: ReactApi, options: { host: string }): const file = await remark() .use(function docsLinksAttacher() { return function transformer(tree) { - remarkVisit(tree, 'link', (linkNode) => { + remarkVisit(tree as LinkNode, 'link', (linkNode) => { if ((linkNode.url as string).startsWith('/')) { linkNode.url = `${host}${linkNode.url}`; }