From d5b6ea8f01aa229b1d63ef20049da423f56ac641 Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Sun, 5 May 2024 15:24:49 -0700 Subject: [PATCH] add {@link $newName} to deprecation comments --- package-lock.json | 80 ------------------- packages/lexical-eslint-plugin/README.md | 2 +- .../__tests__/unit/rules-of-lexical.test.ts | 2 +- .../src/rules/rules-of-lexical.js | 2 +- .../lexical-link/flow/LexicalLink.js.flow | 2 +- packages/lexical-link/src/index.ts | 2 +- packages/lexical-offset/src/index.ts | 2 +- .../flow/LexicalSelection.js.flow | 2 +- packages/lexical-selection/src/index.ts | 2 +- packages/lexical-website/docusaurus.config.js | 3 +- packages/lexical-website/package.json | 1 - 11 files changed, 9 insertions(+), 91 deletions(-) diff --git a/package-lock.json b/package-lock.json index a89794d4958..3b371fcdaba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27093,28 +27093,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-import-partial": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/remark-import-partial/-/remark-import-partial-0.0.2.tgz", - "integrity": "sha512-HuIcpGITU/PK+fZvYYamayCH/jlsoB2Uxj1QaGBgTYtcpozvJQth+PKp9NUZpksUldGAmJf59IyMJgczMpbhwg==", - "dependencies": { - "unist-util-visit": "2.0.2" - } - }, - "node_modules/remark-import-partial/node_modules/unist-util-visit": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.2.tgz", - "integrity": "sha512-HoHNhGnKj6y+Sq+7ASo2zpVdfdRifhTgX2KTU3B/sO/TTlZchp7E3S4vjRzDJ7L60KmrCPsQkVK3lEF3cz36XQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0", - "unist-util-visit-parents": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/remark-mdx": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.0.1.tgz", @@ -30174,15 +30152,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/unist-util-is": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", - "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/unist-util-position": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", @@ -30266,19 +30235,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/unist-util-visit-parents": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", - "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/unist-util-visit/node_modules/@types/unist": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", @@ -33137,7 +33093,6 @@ "prism-react-renderer": "^2.3.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "remark-import-partial": "^0.0.2", "typedoc-plugin-markdown": "^3.17.1", "unist-util-visit": "^5.0.0" }, @@ -37828,7 +37783,6 @@ "prism-react-renderer": "^2.3.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "remark-import-partial": "^0.0.2", "tailwindcss": "^3.3.3", "typedoc-plugin-markdown": "^3.17.1", "unist-util-visit": "^5.0.0", @@ -52441,26 +52395,6 @@ "unified": "^11.0.0" } }, - "remark-import-partial": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/remark-import-partial/-/remark-import-partial-0.0.2.tgz", - "integrity": "sha512-HuIcpGITU/PK+fZvYYamayCH/jlsoB2Uxj1QaGBgTYtcpozvJQth+PKp9NUZpksUldGAmJf59IyMJgczMpbhwg==", - "requires": { - "unist-util-visit": "2.0.2" - }, - "dependencies": { - "unist-util-visit": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.2.tgz", - "integrity": "sha512-HoHNhGnKj6y+Sq+7ASo2zpVdfdRifhTgX2KTU3B/sO/TTlZchp7E3S4vjRzDJ7L60KmrCPsQkVK3lEF3cz36XQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0", - "unist-util-visit-parents": "^3.0.0" - } - } - } - }, "remark-mdx": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.0.1.tgz", @@ -54754,11 +54688,6 @@ "crypto-random-string": "^4.0.0" } }, - "unist-util-is": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", - "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==" - }, "unist-util-position": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", @@ -54854,15 +54783,6 @@ } } }, - "unist-util-visit-parents": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", - "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0" - } - }, "universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", diff --git a/packages/lexical-eslint-plugin/README.md b/packages/lexical-eslint-plugin/README.md index 7d895f0db3c..b2267fec79f 100644 --- a/packages/lexical-eslint-plugin/README.md +++ b/packages/lexical-eslint-plugin/README.md @@ -189,7 +189,7 @@ references to that name is limited to the module's scope. export function $exportedInvalidFunction() { return $getRoot(); } -/** @deprecated renamed to $exportedInvalidFunction by @lexical/eslint-plugin rules-of-lexical */ +/** @deprecated renamed to {@link $exportedInvalidFunction} by @lexical/eslint-plugin rules-of-lexical */ export const exportedInvalidFunction = $exportedInvalidFunction; ``` diff --git a/packages/lexical-eslint-plugin/src/__tests__/unit/rules-of-lexical.test.ts b/packages/lexical-eslint-plugin/src/__tests__/unit/rules-of-lexical.test.ts index 5960e2030ef..5845696dc83 100644 --- a/packages/lexical-eslint-plugin/src/__tests__/unit/rules-of-lexical.test.ts +++ b/packages/lexical-eslint-plugin/src/__tests__/unit/rules-of-lexical.test.ts @@ -24,7 +24,7 @@ const NAME_UNDERSCORE = (name: string) => !/^\$/.test(name) || /_$/.test(name) ? name : name + '_'; const REEXPORT = (name: string) => /^\$/.test(name) - ? `\n/** @deprecated renamed to ${name} by @lexical/eslint-plugin rules-of-lexical */\nexport const ${name.replace( + ? `\n/** @deprecated renamed to {@link ${name}} by @lexical/eslint-plugin rules-of-lexical */\nexport const ${name.replace( /^\$/, '', )} = ${name};\n` diff --git a/packages/lexical-eslint-plugin/src/rules/rules-of-lexical.js b/packages/lexical-eslint-plugin/src/rules/rules-of-lexical.js index d29ce8efc1f..494adecc0d8 100644 --- a/packages/lexical-eslint-plugin/src/rules/rules-of-lexical.js +++ b/packages/lexical-eslint-plugin/src/rules/rules-of-lexical.js @@ -222,7 +222,7 @@ function getExportDeclaration(variable) { * @param {Record<'caller'|'suggestName', string>} data */ function renameExportText({caller, suggestName}) { - return `\n/** @deprecated renamed to ${suggestName} by @lexical/eslint-plugin rules-of-lexical */\nexport const ${caller} = ${suggestName};`; + return `\n/** @deprecated renamed to {@link ${suggestName}} by @lexical/eslint-plugin rules-of-lexical */\nexport const ${caller} = ${suggestName};`; } /** diff --git a/packages/lexical-link/flow/LexicalLink.js.flow b/packages/lexical-link/flow/LexicalLink.js.flow index 5f44a3c450a..6c9a441f7ad 100644 --- a/packages/lexical-link/flow/LexicalLink.js.flow +++ b/packages/lexical-link/flow/LexicalLink.js.flow @@ -84,5 +84,5 @@ declare export function $toggleLink( url: null | string, attributes: LinkAttributes, ): void; -/** @deprecated renamed to $toggleLink by @lexical/eslint-plugin rules-of-lexical */ +/** @deprecated renamed to {@link $toggleLink} by @lexical/eslint-plugin rules-of-lexical */ declare const toggleLink: typeof $toggleLink; diff --git a/packages/lexical-link/src/index.ts b/packages/lexical-link/src/index.ts index 6425cef8cec..efa76583d4d 100644 --- a/packages/lexical-link/src/index.ts +++ b/packages/lexical-link/src/index.ts @@ -523,7 +523,7 @@ export function $toggleLink( }); } } -/** @deprecated renamed to $toggleLink by @lexical/eslint-plugin rules-of-lexical */ +/** @deprecated renamed to {@link $toggleLink} by @lexical/eslint-plugin rules-of-lexical */ export const toggleLink = $toggleLink; function $getAncestor( diff --git a/packages/lexical-offset/src/index.ts b/packages/lexical-offset/src/index.ts index 6cd03e0b1a7..db43070ba06 100644 --- a/packages/lexical-offset/src/index.ts +++ b/packages/lexical-offset/src/index.ts @@ -554,7 +554,7 @@ export function $createChildrenArray( } return children; } -/** @deprecated renamed to $createChildrenArray by @lexical/eslint-plugin rules-of-lexical */ +/** @deprecated renamed to {@link $createChildrenArray} by @lexical/eslint-plugin rules-of-lexical */ export const createChildrenArray = $createChildrenArray; export function $createOffsetView( diff --git a/packages/lexical-selection/flow/LexicalSelection.js.flow b/packages/lexical-selection/flow/LexicalSelection.js.flow index d09b8b28e76..7802dc55721 100644 --- a/packages/lexical-selection/flow/LexicalSelection.js.flow +++ b/packages/lexical-selection/flow/LexicalSelection.js.flow @@ -78,5 +78,5 @@ declare export function $trimTextContentFromAnchor( delCount: number, ): void; -/** @deprecated renamed to $trimTextContentFromAnchor by @lexical/eslint-plugin rules-of-lexical */ +/** @deprecated renamed to {@link $trimTextContentFromAnchor} by @lexical/eslint-plugin rules-of-lexical */ declare export const trimTextContentFromAnchor: typeof $trimTextContentFromAnchor; diff --git a/packages/lexical-selection/src/index.ts b/packages/lexical-selection/src/index.ts index a27a6115a3e..512310ca7a2 100644 --- a/packages/lexical-selection/src/index.ts +++ b/packages/lexical-selection/src/index.ts @@ -38,7 +38,7 @@ export { $sliceSelectedTextNodeContent, $trimTextContentFromAnchor, }; -/** @deprecated renamed to $trimTextContentFromAnchor by @lexical/eslint-plugin rules-of-lexical */ +/** @deprecated renamed to {@link $trimTextContentFromAnchor} by @lexical/eslint-plugin rules-of-lexical */ export const trimTextContentFromAnchor = $trimTextContentFromAnchor; export { diff --git a/packages/lexical-website/docusaurus.config.js b/packages/lexical-website/docusaurus.config.js index 411091477c2..749b637070b 100644 --- a/packages/lexical-website/docusaurus.config.js +++ b/packages/lexical-website/docusaurus.config.js @@ -12,7 +12,6 @@ const {github: lightCodeTheme, dracula: darkCodeTheme} = require('prism-react-renderer').themes; -const importPlugin = require('remark-import-partial'); const slugifyPlugin = require('./src/plugins/lexical-remark-slugify-anchors'); const {packagesManager} = require('../../scripts/shared/packagesManager'); const path = require('node:path'); @@ -245,7 +244,7 @@ const config = { showReadingTime: true, // TODO: Update when directory finalized }, docs: { - beforeDefaultRemarkPlugins: [importPlugin, slugifyPlugin], + beforeDefaultRemarkPlugins: [slugifyPlugin], editUrl: `${GITHUB_REPO_URL}/tree/main/packages/lexical-website/`, path: 'docs', sidebarItemsGenerator, diff --git a/packages/lexical-website/package.json b/packages/lexical-website/package.json index 214e110b1c3..a36710c4527 100644 --- a/packages/lexical-website/package.json +++ b/packages/lexical-website/package.json @@ -25,7 +25,6 @@ "prism-react-renderer": "^2.3.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "remark-import-partial": "^0.0.2", "typedoc-plugin-markdown": "^3.17.1", "unist-util-visit": "^5.0.0" },