diff options
author | Philippe Perrin <philippe.perrin@sonarsource.com> | 2020-03-20 14:48:15 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-04-01 20:03:49 +0000 |
commit | 334d4b7065f34673cc3e857b634aca51570fe47c (patch) | |
tree | 4a978be3ebf6ed1475e237f3cc7072708c6a7ae0 /server | |
parent | 56466eff292acf020c53d7214a4a817781306c68 (diff) | |
download | sonarqube-334d4b7065f34673cc3e857b634aca51570fe47c.tar.gz sonarqube-334d4b7065f34673cc3e857b634aca51570fe47c.zip |
SONAR-12945 Display latest release's information for scanners in documentation
Diffstat (limited to 'server')
29 files changed, 668 insertions, 907 deletions
diff --git a/server/sonar-docs/README.md b/server/sonar-docs/README.md index ca57d22fbda..f0f21aff683 100644 --- a/server/sonar-docs/README.md +++ b/server/sonar-docs/README.md @@ -301,20 +301,35 @@ Note that an iframe is **not** a self-closing tag. This means that the following ``` -#### Dynamic Plugin Version Info +#### Dynamic Plugin/Scanner Version Info -_Note: at this time, this is only supported for the static documentation, and will be stripped from the embedded documentation._ +You can dynamically include a plugin/scanner version block to any page, using the following special tag: -You can dynamically include a plugin version block to any page, using the following special tag: +For static documentation, use: ```html -<!-- update_center:PLUGIN_KEY --> +<!-- update_center:{PLUGIN/SCANNER}_KEY --> +``` + +For embedded documentation, use: +```html +<update-center updatecenterkey="{PLUGIN/SCANNER}_KEY"></update-center> ``` For example, for Sonar Java, use: ```html <!-- update_center:java --> +or +<update-center updatecenterkey="java"></update-center> +``` + +For gradle's scanner, use: + +```html +<!-- update_center:sonargradle --> +or +<update-center updatecenterkey="sonargradle"></update-center> ``` You can include multiple boxes per page, if needed. diff --git a/server/sonar-docs/src/@types/types.d.ts b/server/sonar-docs/src/@types/types.d.ts index b27e9f9f029..a46e8fbe0ec 100644 --- a/server/sonar-docs/src/@types/types.d.ts +++ b/server/sonar-docs/src/@types/types.d.ts @@ -37,31 +37,6 @@ export interface DocsNavigationExternalLink { url: string; } -export type PluginMetaDataInfo = { - category?: string; - isSonarSourceCommercial: boolean; - issueTrackerURL?: string; - key?: string; - license?: string; - name: string; - organization?: { - name: string; - url?: string; - }; - sourcesURL?: string; - versions?: PluginVersionInfo[]; -}; - -export type PluginVersionInfo = { - archived?: boolean; - changeLogUrl?: string; - compatibility?: string; - date?: string; - description?: string; - downloadURL?: string; - version: string; -}; - export interface SearchResult { exactMatch?: boolean; highlights: { [field: string]: [number, number][] }; diff --git a/server/sonar-docs/src/components/PluginMetaData.tsx b/server/sonar-docs/src/components/PluginMetaData.tsx deleted file mode 100644 index b62678c26c8..00000000000 --- a/server/sonar-docs/src/components/PluginMetaData.tsx +++ /dev/null @@ -1,175 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { createPortal } from 'react-dom'; -import { Dict, PluginMetaDataInfo } from '../@types/types'; -import PluginVersionMetaData from './PluginVersionMetaData'; -import { getPluginMetaData } from './utils'; - -interface Props { - location: Pick<Location, 'pathname'>; -} - -interface State { - data: Dict<PluginMetaDataInfo>; - wrappers: Dict<HTMLDivElement>; -} - -export default class PluginMetaData extends React.Component<Props, State> { - state: State = { - data: {}, - wrappers: {} - }; - - componentDidMount() { - this.searchForCommentNodes(); - } - - componentDidUpdate({ location }: Props) { - if (location.pathname !== this.props.location.pathname) { - this.clearWrapperNodes(); - this.searchForCommentNodes(); - } - } - - clearWrapperNodes = () => { - const { wrappers } = this.state; - - Object.keys(wrappers).forEach(key => { - const node = wrappers[key]; - const { parentNode } = node; - if (parentNode) { - parentNode.removeChild(node); - } - - delete wrappers[key]; - }); - - this.setState({ data: {}, wrappers: {} }); - }; - - fetchAndRender = () => { - const { wrappers } = this.state; - - Object.keys(wrappers).forEach(key => { - getPluginMetaData(key).then( - (payload: PluginMetaDataInfo) => { - this.setState(({ data }) => ({ data: { ...data, [key]: payload } })); - }, - () => {} - ); - }); - }; - - searchForCommentNodes = () => { - const pageContainer = document.querySelector('.page-container'); - - if (pageContainer) { - // The following uses an older syntax for createNodeIterator() in order - // to support IE11 - // - IE doesn't support the new { acceptNode: (node: Node) => number } - // format for the 3rd parameter, and instead expects to get it passed - // the function directly. Modern browsers support both paradigms as a - // fallback, so we fallback to the old one. - // - IE11 requires the 4th argument. - // @ts-ignore: tsc requires an additional comment at the function call. - const iterator = document.createNodeIterator( - pageContainer, - NodeFilter.SHOW_COMMENT, - // @ts-ignore: IE11 doesn't support the { acceptNode: () => number } format. - (_: Node) => NodeFilter.FILTER_ACCEPT, - // @ts-ignore: IE11 requires the 4th argument. - false - ); - - let node; - const wrappers: Dict<HTMLDivElement> = {}; - while ((node = iterator.nextNode())) { - if (node.nodeValue && /update_center\s*:/.test(node.nodeValue)) { - let [, key] = node.nodeValue.split(':'); - key = key.trim(); - - const wrapper = document.createElement('div'); - wrapper.className = 'plugin-meta-data-wrapper'; - wrappers[key] = wrapper; - - node.parentNode!.insertBefore(wrapper, node); - } - } - this.setState({ wrappers }, this.fetchAndRender); - } - }; - - renderMetaData = ({ - isSonarSourceCommercial, - issueTrackerURL, - license, - organization, - versions - }: PluginMetaDataInfo) => { - let vendor; - if (organization) { - vendor = organization.name; - if (organization.url) { - vendor = ( - <a href={organization.url} rel="noopener noreferrer" target="_blank"> - {vendor} - </a> - ); - } - } - return ( - <div className="plugin-meta-data"> - <div className="plugin-meta-data-header"> - {vendor && <span className="plugin-meta-data-vendor">By {vendor}</span>} - {license && <span className="plugin-meta-data-license">{license}</span>} - {issueTrackerURL && ( - <span className="plugin-meta-data-issue-tracker"> - <a href={issueTrackerURL} rel="noopener noreferrer" target="_blank"> - Issue Tracker - </a> - </span> - )} - {isSonarSourceCommercial && ( - <span className="plugin-meta-data-supported">Supported by SonarSource</span> - )} - </div> - {versions && versions.length > 0 && <PluginVersionMetaData versions={versions} />} - </div> - ); - }; - - render() { - const { data, wrappers } = this.state; - const keys = Object.keys(data); - - if (keys.length === 0) { - return null; - } - - return keys.map(key => { - if (wrappers[key] !== undefined && data[key] !== undefined) { - return createPortal(this.renderMetaData(data[key]), wrappers[key]); - } else { - return null; - } - }); - } -} diff --git a/server/sonar-docs/src/components/PluginVersionMetaData.tsx b/server/sonar-docs/src/components/PluginVersionMetaData.tsx deleted file mode 100644 index 8d17ffe5e4f..00000000000 --- a/server/sonar-docs/src/components/PluginVersionMetaData.tsx +++ /dev/null @@ -1,118 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import classNames from 'classnames'; -import * as React from 'react'; -import { PluginVersionInfo } from '../@types/types'; - -interface Props { - versions: PluginVersionInfo[]; -} - -interface State { - collapsed: boolean; -} - -export default class PluginVersionMetaData extends React.Component<Props, State> { - state: State = { - collapsed: true - }; - - handleClick = (event: React.SyntheticEvent<HTMLButtonElement>) => { - event.preventDefault(); - event.currentTarget.blur(); - this.setState(({ collapsed }) => ({ collapsed: !collapsed })); - }; - - renderVersion = ({ - archived, - changeLogUrl, - compatibility, - date, - description, - downloadURL, - version - }: PluginVersionInfo) => { - return ( - <div - className={classNames('plugin-meta-data-version', { - 'plugin-meta-data-version-archived': archived - })} - key={version}> - <div className="plugin-meta-data-version-version">{version}</div> - - <div className="plugin-meta-data-version-release-info"> - {date && <time className="plugin-meta-data-version-release-date">{date}</time>} - - {compatibility && ( - <span className="plugin-meta-data-version-compatibility">{compatibility}</span> - )} - </div> - - {description && ( - <div className="plugin-meta-data-version-release-description">{description}</div> - )} - - {(downloadURL || changeLogUrl) && ( - <div className="plugin-meta-data-version-release-links"> - {downloadURL && ( - <span className="plugin-meta-data-version-download"> - <a href={downloadURL} rel="noopener noreferrer" target="_blank"> - Download - </a> - </span> - )} - - {changeLogUrl && ( - <span className="plugin-meta-data-version-release-notes"> - <a href={changeLogUrl} rel="noopener noreferrer" target="_blank"> - Release notes - </a> - </span> - )} - </div> - )} - </div> - ); - }; - - render() { - const { versions } = this.props; - const { collapsed } = this.state; - - const archivedVersions = versions.filter(version => version.archived); - const currentVersions = versions.filter(version => !version.archived); - return ( - <div className="plugin-meta-data-versions"> - {archivedVersions.length > 0 && ( - <button - className="plugin-meta-data-versions-show-more" - onClick={this.handleClick} - type="button"> - {collapsed ? 'Show more versions' : 'Show fewer version'} - </button> - )} - - {currentVersions.map(version => this.renderVersion(version))} - - {!collapsed && archivedVersions.map(version => this.renderVersion(version))} - </div> - ); - } -} diff --git a/server/sonar-docs/src/components/UpdateCenterMetaDataInjector.tsx b/server/sonar-docs/src/components/UpdateCenterMetaDataInjector.tsx new file mode 100644 index 00000000000..2593983a4f7 --- /dev/null +++ b/server/sonar-docs/src/components/UpdateCenterMetaDataInjector.tsx @@ -0,0 +1,132 @@ +/* + * SonarQube + * Copyright (C) 2009-2020 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { createPortal } from 'react-dom'; +import MetaData from 'sonar-ui-common/components/ui/update-center/MetaData'; +import { Dict } from '../@types/types'; + +interface Props { + location: Pick<Location, 'pathname'>; +} + +interface State { + wrappers: Dict<HTMLDivElement>; +} + +export default class UpdateCenterMetaDataInjector extends React.Component<Props, State> { + state: State = { + wrappers: {} + }; + + componentDidMount() { + this.searchForMetaData(); + } + + componentDidUpdate({ location }: Props) { + if (location.pathname !== this.props.location.pathname) { + this.clearMetaData(); + this.searchForMetaData(); + } + } + + componentWillUnmount() { + this.clearMetaData(); + } + + clearMetaData = () => { + const { wrappers } = this.state; + + Object.keys(wrappers).forEach(key => { + const node = wrappers[key]; + const { parentNode } = node; + if (parentNode) { + parentNode.removeChild(node); + } + + delete wrappers[key]; + }); + + this.setState({ wrappers: {} }); + }; + + searchForMetaData = () => { + const pageContainer = document.querySelector('.page-container'); + + if (!pageContainer) { + return; + } + + // The following uses an older syntax for createNodeIterator() in order + // to support IE11 + // - IE doesn't support the new { acceptNode: (node: Node) => number } + // format for the 3rd parameter, and instead expects to get it passed + // the function directly. Modern browsers support both paradigms as a + // fallback, so we fallback to the old one. + // - IE11 requires the 4th argument. + // @ts-ignore: tsc requires an additional comment at the function call. + const iterator = document.createNodeIterator( + pageContainer, + NodeFilter.SHOW_COMMENT, + // @ts-ignore: IE11 doesn't support the { acceptNode: () => number } format. + (_: Node) => NodeFilter.FILTER_ACCEPT, + // @ts-ignore: IE11 requires the 4th argument. + false + ); + + const wrappers: Dict<HTMLDivElement> = {}; + let node = iterator.nextNode(); + + while (node) { + if (node.nodeValue && node.parentNode && /update_center\s*:/.test(node.nodeValue)) { + let [, key] = node.nodeValue.split(':'); + key = key.trim(); + + const wrapper = document.createElement('div'); + wrappers[key] = wrapper; + node.parentNode.insertBefore(wrapper, node); + } + + node = iterator.nextNode(); + } + + this.setState({ wrappers }); + }; + + render() { + const { wrappers } = this.state; + const keys = Object.keys(wrappers); + + if (keys.length === 0) { + return null; + } + + return ( + <div> + {keys.map(key => { + if (wrappers[key]) { + return createPortal(<MetaData updateCenterKey={key} />, wrappers[key]); + } else { + return null; + } + })} + </div> + ); + } +} diff --git a/server/sonar-docs/src/components/__tests__/PluginMetaData-test.tsx b/server/sonar-docs/src/components/__tests__/PluginMetaData-test.tsx deleted file mode 100644 index 4039f1e389e..00000000000 --- a/server/sonar-docs/src/components/__tests__/PluginMetaData-test.tsx +++ /dev/null @@ -1,81 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { mount } from 'enzyme'; -import * as React from 'react'; -import PluginMetaData from '../PluginMetaData'; -import { getPluginMetaData } from '../utils'; - -jest.mock('../utils', () => ({ - getPluginMetaData: jest.fn().mockResolvedValue({ - name: 'SonarJava', - key: 'java', - isSonarSourceCommercial: true, - organization: { - name: 'SonarSource', - url: 'http://www.sonarsource.com/' - }, - category: 'Languages', - license: 'SonarSource', - issueTrackerURL: 'https://jira.sonarsource.com/browse/SONARJAVA', - sourcesURL: 'https://github.com/SonarSource/sonar-java', - versions: [ - { - version: '4.2', - compatibilityRange: { minimum: '6.0', maximum: '6.6' }, - archived: false, - downloadURL: 'https://example.com/sonar-java-plugin-5.13.0.18197.jar' - }, - { - version: '3.2', - date: '2015-04-30', - compatibilityRange: { maximum: '6.0' }, - archived: true, - changeLogUrl: 'https://example.com/sonar-java-plugin/release', - downloadURL: 'https://example.com/sonar-java-plugin-3.2.jar' - } - ] - }) -})); - -beforeAll(() => { - (global as any).document.body.innerHTML = ` -<div class="page-container"> - <p>Lorem ipsum</p> - <!-- update_center:java --> - <p>Dolor sit amet</p> - <!-- update_center : python --> - <p>Foo Bar</p> - <!--update_center : abap--> -</div> -`; -}); - -it('should render correctly', async () => { - const wrapper = shallowRender(); - await new Promise(setImmediate); - expect(wrapper).toMatchSnapshot(); - expect(getPluginMetaData).toBeCalledWith('java'); - expect(getPluginMetaData).toBeCalledWith('python'); - expect(getPluginMetaData).toBeCalledWith('abap'); -}); - -function shallowRender(props: Partial<PluginMetaData['props']> = {}) { - return mount(<PluginMetaData location={{ pathname: 'foo' }} {...props} />); -} diff --git a/server/sonar-docs/src/components/__tests__/PluginVersionMetaData-test.tsx b/server/sonar-docs/src/components/__tests__/PluginVersionMetaData-test.tsx deleted file mode 100644 index 3845b3a3e23..00000000000 --- a/server/sonar-docs/src/components/__tests__/PluginVersionMetaData-test.tsx +++ /dev/null @@ -1,77 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { shallow } from 'enzyme'; -import * as React from 'react'; -import PluginVersionMetaData from '../PluginVersionMetaData'; - -it('should render correctly', () => { - const wrapper = shallowRender(); - expect(wrapper).toMatchSnapshot(); -}); - -it('should correctly show all versions', () => { - const wrapper = shallowRender(); - expect(wrapper.find('.plugin-meta-data-version').length).toBe(2); - wrapper.instance().setState({ collapsed: false }); - expect(wrapper.find('.plugin-meta-data-version').length).toBe(5); -}); - -function shallowRender(props: Partial<PluginVersionMetaData['props']> = {}) { - return shallow( - <PluginVersionMetaData - versions={[ - { - version: '5.13', - date: '2019-05-31', - compatibility: '6.7', - archived: false, - downloadURL: 'https://example.com/sonar-java-plugin-5.13.0.18197.jar', - changeLogUrl: 'https://example.com/sonar-java-plugin/release' - }, - { - version: '4.2', - archived: false, - downloadURL: 'https://example.com/sonar-java-plugin-5.13.0.18197.jar' - }, - { - version: '3.2', - date: '2015-04-30', - compatibility: '6.0 to 7.1', - archived: true, - changeLogUrl: 'https://example.com/sonar-java-plugin/release', - downloadURL: 'https://example.com/sonar-java-plugin-3.2.jar' - }, - { - version: '3.1', - description: 'Lorem ipsum dolor sit amet', - archived: true, - changeLogUrl: 'https://example.com/sonar-java-plugin/release', - downloadURL: 'https://example.com/sonar-java-plugin-3.1.jar' - }, - { - version: '2.1', - archived: true, - downloadURL: 'https://example.com/sonar-java-plugin-2.1.jar' - } - ]} - {...props} - /> - ); -} diff --git a/server/sonar-docs/src/components/__tests__/UpdateCenterMetaDataInjector-test.tsx b/server/sonar-docs/src/components/__tests__/UpdateCenterMetaDataInjector-test.tsx new file mode 100644 index 00000000000..b12ea7e0e74 --- /dev/null +++ b/server/sonar-docs/src/components/__tests__/UpdateCenterMetaDataInjector-test.tsx @@ -0,0 +1,55 @@ +/* + * SonarQube + * Copyright (C) 2009-2020 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import UpdateCenterMetaDataInjector from '../UpdateCenterMetaDataInjector'; + +it('should render correctly', () => { + (global as any).document.body.innerHTML = ` +<div class="page-container"> + <p>Lorem ipsum</p> + <!-- update_center:java --> + <p>Dolor sit amet</p> + <!-- update_center : python --> + <p>Foo Bar</p> + <!--update_center : abap--> +</div> +`; + + const wrapper = shallowRender(); + expect(wrapper).toMatchSnapshot(); + + (global as any).document.body.innerHTML = ` +<div class="page-container"> + <p>Lorem ipsum</p> + <!-- update_center:csharp --> + <p>Foo Bar</p> +</div> +`; + + wrapper.setProps({ location: { pathname: 'foo2' } }); + expect(wrapper).toMatchSnapshot(); +}); + +function shallowRender(props: Partial<UpdateCenterMetaDataInjector['props']> = {}) { + return shallow<UpdateCenterMetaDataInjector>( + <UpdateCenterMetaDataInjector location={{ pathname: 'foo' }} {...props} /> + ); +} diff --git a/server/sonar-docs/src/components/__tests__/__snapshots__/PluginMetaData-test.tsx.snap b/server/sonar-docs/src/components/__tests__/__snapshots__/PluginMetaData-test.tsx.snap deleted file mode 100644 index e98eab29c96..00000000000 --- a/server/sonar-docs/src/components/__tests__/__snapshots__/PluginMetaData-test.tsx.snap +++ /dev/null @@ -1,11 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` -<PluginMetaData - location={ - Object { - "pathname": "foo", - } - } -/> -`; diff --git a/server/sonar-docs/src/components/__tests__/__snapshots__/PluginVersionMetaData-test.tsx.snap b/server/sonar-docs/src/components/__tests__/__snapshots__/PluginVersionMetaData-test.tsx.snap deleted file mode 100644 index e8c0a1238f8..00000000000 --- a/server/sonar-docs/src/components/__tests__/__snapshots__/PluginVersionMetaData-test.tsx.snap +++ /dev/null @@ -1,93 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` -<div - className="plugin-meta-data-versions" -> - <button - className="plugin-meta-data-versions-show-more" - onClick={[Function]} - type="button" - > - Show more versions - </button> - <div - className="plugin-meta-data-version" - key="5.13" - > - <div - className="plugin-meta-data-version-version" - > - 5.13 - </div> - <div - className="plugin-meta-data-version-release-info" - > - <time - className="plugin-meta-data-version-release-date" - > - 2019-05-31 - </time> - <span - className="plugin-meta-data-version-compatibility" - > - 6.7 - </span> - </div> - <div - className="plugin-meta-data-version-release-links" - > - <span - className="plugin-meta-data-version-download" - > - <a - href="https://example.com/sonar-java-plugin-5.13.0.18197.jar" - rel="noopener noreferrer" - target="_blank" - > - Download - </a> - </span> - <span - className="plugin-meta-data-version-release-notes" - > - <a - href="https://example.com/sonar-java-plugin/release" - rel="noopener noreferrer" - target="_blank" - > - Release notes - </a> - </span> - </div> - </div> - <div - className="plugin-meta-data-version" - key="4.2" - > - <div - className="plugin-meta-data-version-version" - > - 4.2 - </div> - <div - className="plugin-meta-data-version-release-info" - /> - <div - className="plugin-meta-data-version-release-links" - > - <span - className="plugin-meta-data-version-download" - > - <a - href="https://example.com/sonar-java-plugin-5.13.0.18197.jar" - rel="noopener noreferrer" - target="_blank" - > - Download - </a> - </span> - </div> - </div> -</div> -`; diff --git a/server/sonar-docs/src/components/__tests__/__snapshots__/UpdateCenterMetaDataInjector-test.tsx.snap b/server/sonar-docs/src/components/__tests__/__snapshots__/UpdateCenterMetaDataInjector-test.tsx.snap new file mode 100644 index 00000000000..7682b8ca34b --- /dev/null +++ b/server/sonar-docs/src/components/__tests__/__snapshots__/UpdateCenterMetaDataInjector-test.tsx.snap @@ -0,0 +1,39 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` +<div> + <Portal + containerInfo={<div />} + > + <MetaData + updateCenterKey="java" + /> + </Portal> + <Portal + containerInfo={<div />} + > + <MetaData + updateCenterKey="python" + /> + </Portal> + <Portal + containerInfo={<div />} + > + <MetaData + updateCenterKey="abap" + /> + </Portal> +</div> +`; + +exports[`should render correctly 2`] = ` +<div> + <Portal + containerInfo={<div />} + > + <MetaData + updateCenterKey="csharp" + /> + </Portal> +</div> +`; diff --git a/server/sonar-docs/src/components/utils.tsx b/server/sonar-docs/src/components/utils.tsx index 86ce88c2f84..ac3114e4d7d 100644 --- a/server/sonar-docs/src/components/utils.tsx +++ b/server/sonar-docs/src/components/utils.tsx @@ -19,7 +19,6 @@ */ import { sortBy } from 'lodash'; import { MarkdownRemark } from '../@types/graphql-types'; -import { PluginMetaDataInfo } from '../@types/types'; const WORDS = 6; @@ -127,18 +126,3 @@ export function highlightMarks(str: string, marks: Array<{ from: number; to: num export function isDefined<T>(x: T | undefined | null): x is T { return x !== undefined && x !== null; } - -export function getPluginMetaData(key: string): Promise<PluginMetaDataInfo> { - return ( - window - .fetch(`https://update.sonarsource.org/${key}.json`) - .then((response: Response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } - return Promise.reject(response); - }) - /* eslint-disable no-console */ - .catch(console.error) - ); -} diff --git a/server/sonar-docs/src/layouts/index.tsx b/server/sonar-docs/src/layouts/index.tsx index 2af5049d2be..5d1ef762124 100644 --- a/server/sonar-docs/src/layouts/index.tsx +++ b/server/sonar-docs/src/layouts/index.tsx @@ -23,8 +23,8 @@ import { MarkdownRemark, MarkdownRemarkConnection } from '../@types/graphql-type import Footer from '../components/Footer'; import HeaderListProvider from '../components/HeaderListProvider'; import HeadingsLink from '../components/HeadingsLink'; -import PluginMetaData from '../components/PluginMetaData'; import Sidebar from '../components/Sidebar'; +import UpdateCenterMetaDataInjector from '../components/UpdateCenterMetaDataInjector'; import './layout.css'; const version = process.env.GATSBY_DOCS_VERSION || '1.0'; @@ -95,7 +95,7 @@ export default function Layout({ children, location }: Props) { <div className="markdown-container">{children}</div> </div> <Footer /> - <PluginMetaData location={location} /> + <UpdateCenterMetaDataInjector location={location} /> </div> </div> )} diff --git a/server/sonar-docs/src/layouts/layout.css b/server/sonar-docs/src/layouts/layout.css index 6696f42a55d..13c02d01dac 100644 --- a/server/sonar-docs/src/layouts/layout.css +++ b/server/sonar-docs/src/layouts/layout.css @@ -718,86 +718,3 @@ img[src$='/images/info.svg'] { margin-bottom: 0; top: 0 !important; } - -.plugin-meta-data { - margin: 16px 0; - padding: 16px 16px 8px 16px; - background: #f9f9fb; - border: 1px solid #e6e6e6; - border-radius: 3px; -} - -.plugin-meta-data a svg { - margin-right: 8px; -} - -.plugin-meta-data-header { - border-bottom: 1px solid #cfd3d7; - padding-bottom: 16px; -} - -.plugin-meta-data-header, -.plugin-meta-data-version-release-info, -.plugin-meta-data-version-links { - display: flex; -} - -.plugin-meta-data-header > * + *, -.plugin-meta-data-version-release-info > * + *, -.plugin-meta-data-version-release-links > * + * { - margin-left: 16px; -} - -.plugin-meta-data-header > * + * { - padding-left: 16px; - border-left: 1px solid #cfd3d7; -} - -.plugin-meta-data-versions { - margin-top: 16px; -} - -.plugin-meta-data-versions-show-more { - font-size: 14px; - float: right; - color: #51575a; - border-color: #7b8184; - border-width: 0 0 1px 0; - padding-left: 0; - padding-right: 0; - background: transparent; - cursor: pointer; -} - -.plugin-meta-data-versions-show-more:hover { - color: #2d3032; - border-color: #2d3032; -} - -.plugin-meta-data-version { - margin-bottom: 16px; -} - -.plugin-meta-data-version + .plugin-meta-data-version { - padding-top: 8px; - padding-top: 8px; - border-top: 1px dashed #cfd3d7; -} - -.plugin-meta-data-version-version { - font-weight: bold; - font-size: 18px; -} - -.plugin-meta-data-version-release-info { - margin-top: 8px; - font-style: italic; -} - -.plugin-meta-data-version-release-description { - margin-top: 8px; -} - -.plugin-meta-data-version-release-links { - margin-top: 8px; -} diff --git a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-ant.md b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-ant.md index b1b7b20bd10..622c816bae6 100644 --- a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-ant.md +++ b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-ant.md @@ -3,11 +3,10 @@ title: SonarScanner for Ant url: /analysis/scan/sonarscanner-for-ant/ --- -[[info]] -| **Download SonarScanner for Ant 2.7** - Compatible with SonarQube 6.7+ (LTS) -| By [SonarSource](https://www.sonarsource.com/) – GNU LGPL 3 – [Issue Tracker](https://jira.sonarsource.com/browse/ANTTASK) – [Source](https://github.com/SonarSource/sonar-scanner-ant) -| -| [Download](https://binaries.sonarsource.com/Distribution/sonarqube-ant-task/sonarqube-ant-task-2.7.0.1612.jar) +<!-- static --> +<!-- update_center:scannerant --> +<!-- /static --> +<update-center updatecenterkey="scannerant"></update-center> The SonarScanner for Ant provides a `task` to allow integration of SonarQube analysis into an Apache Ant build script. diff --git a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-azure-devops.md b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-azure-devops.md index e1f050a5adb..da44a53b6d7 100644 --- a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-azure-devops.md +++ b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-azure-devops.md @@ -3,10 +3,10 @@ title: SonarScanner for Azure DevOps url: /analysis/scan/sonarscanner-for-azure-devops/ --- - -[[info]] -| By [SonarSource](https://www.sonarsource.com/) - GNU LGPL 3 - [Issue Tracker](https://jira.sonarsource.com/browse/VSTS) - [Source](https://github.com/SonarSource/sonar-scanner-vsts) -| Click [here](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarqube) for the latest version. +<!-- static --> +<!-- update_center:scannerazure --> +<!-- /static --> +<update-center updatecenterkey="scannerazure"></update-center> The <!-- sonarqube -->[SonarQube](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarqube)<!-- /sonarqube --> <!-- sonarcloud -->[SonarCloud](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarcloud)<!-- /sonarcloud --> extension for Azure DevOps <!-- sonarqube -->Server<!-- /sonarqube --> makes it easy to integrate analysis into your build pipeline. The extension allows the analysis of all languages supported by {instance}. diff --git a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-gradle.md b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-gradle.md index 7c5abda666c..d463c18a13a 100644 --- a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-gradle.md +++ b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-gradle.md @@ -3,11 +3,10 @@ title: SonarScanner for Gradle url: /analysis/scan/sonarscanner-for-gradle/ --- -[[info]] -| By [SonarSource](https://www.sonarsource.com/) – GNU LGPL 3 – [Issue Tracker](https://jira.sonarsource.com/browse/SONARGRADL) – [Source](https://github.com/SonarSource/sonar-scanner-gradle) -| Click [here](https://plugins.gradle.org/plugin/org.sonarqube) for the latest version. - - +<!-- static --> +<!-- update_center:scannergradle --> +<!-- /static --> +<update-center updatecenterkey="scannergradle"></update-center> The SonarScanner for Gradle provides an easy way to start SonarQube analysis of a Gradle project. diff --git a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-jenkins.md b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-jenkins.md index 1bbb40b1c7b..3fdea62f275 100644 --- a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-jenkins.md +++ b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-jenkins.md @@ -3,9 +3,10 @@ title: SonarScanner for Jenkins url: /analysis/scan/sonarscanner-for-jenkins/ --- -[[info]] -| By [SonarSource](https://www.sonarsource.com/) – GNU LGPL 3 – [Issue Tracker](https://jira.sonarsource.com/browse/SONARJNKNS) – [Source](https://github.com/SonarSource/sonar-scanner-jenkins) -| Click [here](https://plugins.jenkins.io/sonar) for the latest version. +<!-- static --> +<!-- update_center:scannerjenkins --> +<!-- /static --> +<update-center updatecenterkey="scannerjenkins"></update-center> This plugin lets you centralize the configuration of SonarQube server connection details in Jenkins global configuration. diff --git a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-maven.md b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-maven.md index 2d6e2dc884b..942b7444271 100644 --- a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-maven.md +++ b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-maven.md @@ -3,10 +3,10 @@ title: SonarScanner for Maven url: /analysis/scan/sonarscanner-for-maven/ --- -[[info]] -| By [SonarSource](https://www.sonarsource.com/) – GNU LGPL 3 – [Issue Tracker](https://jira.sonarsource.com/browse/MSONAR) – [Source](https://github.com/SonarSource/sonar-scanner-maven) -| Click [here](https://mvnrepository.com/artifact/org.sonarsource.scanner.maven/sonar-maven-plugin) for the latest version. - +<!-- static --> +<!-- update_center:scannermaven --> +<!-- /static --> +<update-center updatecenterkey="scannermaven"></update-center> The SonarScanner is recommended as the default analyzer for Maven projects. diff --git a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-msbuild.md b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-msbuild.md index 1b90179887a..cb9a8b0cbda 100644 --- a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-msbuild.md +++ b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-msbuild.md @@ -3,15 +3,10 @@ title: SonarScanner for MSBuild url: /analysis/scan/sonarscanner-for-msbuild/ --- -[[info]] -| **Download SonarScanner for MSBuild 4.8.0.12008** - Compatible with [SonarQube 7.9+ (LTS)](https://www.sonarqube.org/sonarqube-7-9-lts/) -| By [SonarSource](https://www.sonarsource.com/) – GNU LGPL 3 – [Issue Tracker](https://github.com/SonarSource/sonar-scanner-msbuild/issues) – [Source](https://github.com/SonarSource/sonar-scanner-msbuild) -| -| [.NET Framework 4.6+](https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.8.0.12008/sonar-scanner-msbuild-4.8.0.12008-net46.zip) | -| [.NET Core 2.0+](https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.8.0.12008/sonar-scanner-msbuild-4.8.0.12008-netcoreapp2.0.zip) | -| [.NET Core 3.0+](https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.8.0.12008/sonar-scanner-msbuild-4.8.0.12008-netcoreapp3.0.zip) | -| [.NET Core Global Tool](https://www.nuget.org/packages/dotnet-sonarscanner) - +<!-- static --> +<!-- update_center:scannermsbuild --> +<!-- /static --> +<update-center updatecenterkey="scannermsbuild"></update-center> The SonarScanner for MSBuild is the recommended way to launch an analysis for projects/solutions using MSBuild or dotnet command as a build tool. It is the result of a [collaboration between SonarSource and Microsoft](http://www.sonarqube.org/announcing-sonarqube-integration-with-msbuild-and-team-build/). diff --git a/server/sonar-docs/src/pages/analysis/scan/sonarscanner.md b/server/sonar-docs/src/pages/analysis/scan/sonarscanner.md index aec9ce3f8b1..e79e84c7fa5 100644 --- a/server/sonar-docs/src/pages/analysis/scan/sonarscanner.md +++ b/server/sonar-docs/src/pages/analysis/scan/sonarscanner.md @@ -3,16 +3,10 @@ title: SonarScanner url: /analysis/scan/sonarscanner/ --- -[[info]] -| **Download SonarScanner 4.2** - Compatible with SonarQube 6.7+ (LTS) -| By [SonarSource](https://www.sonarsource.com/) – GNU LGPL 3 – [Issue Tracker](https://jira.sonarsource.com/browse/SQSCANNER) – [Source](https://github.com/Sonarsource/sonar-scanner-cli) -| -| [Linux 64-bit](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.2.0.1873-linux.zip) | -| [Windowx 64-bit](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.2.0.1873-windows.zip) | -| [Mac OS X 64-bit](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.2.0.1873-macosx.zip) | -| [Any*](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.2.0.1873.zip) | -| [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) -| *Requires a pre-installed JVM - with the same requirements as the SonarQube server. +<!-- static --> +<!-- update_center:scannercli --> +<!-- /static --> +<update-center updatecenterkey="scannercli"></update-center> The SonarScanner is the scanner to use when there is no specific scanner for your build system. diff --git a/server/sonar-web/package.json b/server/sonar-web/package.json index b9864dfd86d..1b095e966ba 100644 --- a/server/sonar-web/package.json +++ b/server/sonar-web/package.json @@ -33,7 +33,10 @@ "redux": "4.0.5", "redux-thunk": "2.3.0", "regenerator-runtime": "0.13.5", + "rehype-raw": "4.0.2", + "rehype-react": "5.0.0", "remark-custom-blocks": "2.5.0", + "remark-rehype": "6.0.0", "remark-slug": "5.1.2", "sonar-ui-common": "0.0.57", "unist-util-visit": "2.0.2", diff --git a/server/sonar-web/src/main/js/@types/rehype-raw.d.ts b/server/sonar-web/src/main/js/@types/rehype-raw.d.ts new file mode 100644 index 00000000000..44788146aeb --- /dev/null +++ b/server/sonar-web/src/main/js/@types/rehype-raw.d.ts @@ -0,0 +1,23 @@ +/* + * SonarQube + * Copyright (C) 2009-2020 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +declare module 'rehype-raw' { + export default function rehypeRaw(): any; +} diff --git a/server/sonar-web/src/main/js/@types/rehype-react.d.ts b/server/sonar-web/src/main/js/@types/rehype-react.d.ts new file mode 100644 index 00000000000..52a5b81dc9e --- /dev/null +++ b/server/sonar-web/src/main/js/@types/rehype-react.d.ts @@ -0,0 +1,23 @@ +/* + * SonarQube + * Copyright (C) 2009-2020 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +declare module 'rehype-react' { + export default function rehypeReact(): any; +} diff --git a/server/sonar-web/src/main/js/@types/remark-rehype.d.ts b/server/sonar-web/src/main/js/@types/remark-rehype.d.ts new file mode 100644 index 00000000000..7671356275f --- /dev/null +++ b/server/sonar-web/src/main/js/@types/remark-rehype.d.ts @@ -0,0 +1,23 @@ +/* + * SonarQube + * Copyright (C) 2009-2020 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +declare module 'remark-rehype' { + export default function remarkRehype(): any; +} diff --git a/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx b/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx index c368fcc9826..63aa24978ad 100644 --- a/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx +++ b/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx @@ -19,10 +19,13 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; +import rehypeRaw from 'rehype-raw'; +import rehypeReact from 'rehype-react'; import remark from 'remark'; import remarkCustomBlocks from 'remark-custom-blocks'; -import reactRenderer from 'remark-react'; +import remarkRehype from 'remark-rehype'; import slug from 'remark-slug'; +import MetaData from 'sonar-ui-common/components/ui/update-center/MetaData'; import { scrollToElement } from 'sonar-ui-common/helpers/scrolling'; import DocCollapsibleBlock from './DocCollapsibleBlock'; import DocImg from './DocImg'; @@ -69,18 +72,22 @@ export default class DocMarkdownBlock extends React.PureComponent<Props> { success: { classes: 'alert alert-success' }, collapse: { classes: 'collapse' } }) - .use(reactRenderer, { - remarkReactComponents: { + .use(remarkRehype, { allowDangerousHTML: true }) + .use(rehypeRaw) + .use(rehypeReact, { + createElement: React.createElement, + components: { div: Block, // use custom link to render documentation anchors a: isTooltip ? withChildProps(DocTooltipLink, childProps) : withChildProps(DocLink, { onAnchorClick: this.handleAnchorClick }), // use custom img tag to render documentation images - img: DocImg - }, - toHast: {}, - sanitize: false + img: DocImg, + 'update-center': ({ updatecenterkey }: { updatecenterkey: string }) => ( + <MetaData updateCenterKey={updatecenterkey} /> + ) + } }) .use(slug); diff --git a/server/sonar-web/src/main/js/components/docs/__tests__/DocMarkdownBlock-test.tsx b/server/sonar-web/src/main/js/components/docs/__tests__/DocMarkdownBlock-test.tsx index 3295a9c6791..31baaaaae3d 100644 --- a/server/sonar-web/src/main/js/components/docs/__tests__/DocMarkdownBlock-test.tsx +++ b/server/sonar-web/src/main/js/components/docs/__tests__/DocMarkdownBlock-test.tsx @@ -17,8 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { shallow } from 'enzyme'; +import { mount, shallow } from 'enzyme'; import * as React from 'react'; +import MetaData from 'sonar-ui-common/components/ui/update-center/MetaData'; import DocMarkdownBlock from '../DocMarkdownBlock'; const CONTENT = ` @@ -42,20 +43,11 @@ Risus placerat, efficitur enim ut, pellentesque sem. Mauris non lorem auctor, co `; // mock `remark` & co to work around the issue with cjs imports -jest.mock('remark', () => { - const remark = require.requireActual('remark'); - return { default: remark }; -}); - -jest.mock('remark-react', () => { - const remarkReact = require.requireActual('remark-react'); - return { default: remarkReact }; -}); - -jest.mock('remark-slug', () => { - const remarkSlug = require.requireActual('remark-slug'); - return { default: remarkSlug }; -}); +jest.mock('remark', () => ({ default: jest.requireActual('remark') })); +jest.mock('remark-rehype', () => ({ default: jest.requireActual('remark-rehype') })); +jest.mock('rehype-raw', () => ({ default: jest.requireActual('rehype-raw') })); +jest.mock('rehype-react', () => ({ default: jest.requireActual('rehype-react') })); +jest.mock('remark-slug', () => ({ default: jest.requireActual('remark-slug') })); jest.mock('../../../helpers/system', () => ({ getInstance: jest.fn(), @@ -88,6 +80,13 @@ it('should render a sticky TOC if available', () => { expect(wrapper.find('DocToc').exists()).toBe(true); }); +it('should correctly render update-center tags', () => { + const wrapper = mount( + <DocMarkdownBlock content='<update-center updatecenterkey="abap"></update-center>' /> + ); + expect(wrapper.find(MetaData).length).toBe(1); +}); + function shallowRender(props: Partial<DocMarkdownBlock['props']> = {}) { return shallow(<DocMarkdownBlock content="" {...props} />); } diff --git a/server/sonar-web/src/main/js/components/docs/__tests__/__snapshots__/DocMarkdownBlock-test.tsx.snap b/server/sonar-web/src/main/js/components/docs/__tests__/__snapshots__/DocMarkdownBlock-test.tsx.snap index 66b9354e894..9a3ab825147 100644 --- a/server/sonar-web/src/main/js/components/docs/__tests__/__snapshots__/DocMarkdownBlock-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/docs/__tests__/__snapshots__/DocMarkdownBlock-test.tsx.snap @@ -7,76 +7,73 @@ exports[`should render a sticky TOC if available 1`] = ` <div className="markdown-content" > - <Block - key="h-1" - > - <h2 - id="lorem-ipsum" - key="h-2" + <div> + <Block + key="h-1" > - Lorem ipsum - </h2> - - - <p - key="h-3" - > - Quisque vitae tincidunt felis. Nam blandit risus placerat, efficitur enim ut, pellentesque sem. Mauris non lorem auctor, consequat neque eget, dignissim augue. - </p> - - - <h2 - id="sit-amet" - key="h-4" - > - Sit amet - </h2> - - - <h3 - id="maecenas-diam" - key="h-5" - > - Maecenas diam - </h3> - - - <p - key="h-6" - > - Velit, vestibulum nec ultrices id, mollis eget arcu. Sed dapibus, sapien ut auctor consectetur, mi tortor vestibulum ante, eget dapibus lacus risus. - </p> - - - <h3 - id="integer" - key="h-7" - > - Integer - </h3> - - - <p - key="h-8" - > - At cursus turpis. Aenean at elit fringilla, porttitor mi eget, dapibus nisi. Donec quis congue odio. - </p> - - - <h2 - id="nam-blandit" - key="h-9" - > - Nam blandit - </h2> - - - <p - key="h-10" - > - Risus placerat, efficitur enim ut, pellentesque sem. Mauris non lorem auctor, consequat neque eget, dignissim augue. - </p> - </Block> + <h2 + key="h-2" + > + Lorem ipsum + </h2> + + + <p + key="h-3" + > + Quisque vitae tincidunt felis. Nam blandit risus placerat, efficitur enim ut, pellentesque sem. Mauris non lorem auctor, consequat neque eget, dignissim augue. + </p> + + + <h2 + key="h-4" + > + Sit amet + </h2> + + + <h3 + key="h-5" + > + Maecenas diam + </h3> + + + <p + key="h-6" + > + Velit, vestibulum nec ultrices id, mollis eget arcu. Sed dapibus, sapien ut auctor consectetur, mi tortor vestibulum ante, eget dapibus lacus risus. + </p> + + + <h3 + key="h-7" + > + Integer + </h3> + + + <p + key="h-8" + > + At cursus turpis. Aenean at elit fringilla, porttitor mi eget, dapibus nisi. Donec quis congue odio. + </p> + + + <h2 + key="h-9" + > + Nam blandit + </h2> + + + <p + key="h-10" + > + Risus placerat, efficitur enim ut, pellentesque sem. Mauris non lorem auctor, consequat neque eget, dignissim augue. + </p> + </Block> + </div> </div> <DocToc content=" @@ -110,17 +107,19 @@ exports[`should render simple markdown 1`] = ` <div className="markdown-content" > - <p - key="h-1" - > - this is - <em - key="h-2" + <div> + <p + key="h-1" > - bold - </em> - text - </p> + this is + <em + key="h-2" + > + bold + </em> + text + </p> + </div> </div> </div> `; diff --git a/server/sonar-web/yarn.lock b/server/sonar-web/yarn.lock index 8b27cf94955..9fbabc5e395 100644 --- a/server/sonar-web/yarn.lock +++ b/server/sonar-web/yarn.lock @@ -2389,9 +2389,9 @@ babel-runtime@^6.26.0: regenerator-runtime "^0.11.0" bail@^1.0.0: - version "1.0.4" - resolved "https://repox.jfrog.io/repox/api/npm/npm/bail/-/bail-1.0.4.tgz#7181b66d508aa3055d3f6c13f0a0c720641dde9b" - integrity sha1-cYG2bVCKowVdP2wT8KDHIGQd3ps= + version "1.0.5" + resolved "https://repox.jfrog.io/repox/api/npm/npm/bail/-/bail-1.0.5.tgz#b6fa133404a392cbc1f8c4bf63f5953351e7a776" + integrity sha1-tvoTNASjksvB+MS/Y/WVM1Hnp3Y= balanced-match@^1.0.0: version "1.0.0" @@ -2779,10 +2779,10 @@ caseless@~0.12.0: resolved "https://repox.jfrog.io/repox/api/npm/npm/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -ccount@^1.0.0: - version "1.0.4" - resolved "https://repox.jfrog.io/repox/api/npm/npm/ccount/-/ccount-1.0.4.tgz#9cf2de494ca84060a2a8d2854edd6dfb0445f386" - integrity sha1-nPLeSUyoQGCiqNKFTt1t+wRF84Y= +ccount@^1.0.0, ccount@^1.0.3: + version "1.0.5" + resolved "https://repox.jfrog.io/repox/api/npm/npm/ccount/-/ccount-1.0.5.tgz#ac82a944905a65ce204eb03023157edf29425c17" + integrity sha1-rIKpRJBaZc4gTrAwIxV+3ylCXBc= chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.3: version "1.1.3" @@ -2813,24 +2813,24 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.4 supports-color "^5.3.0" character-entities-html4@^1.0.0: - version "1.1.3" - resolved "https://repox.jfrog.io/repox/api/npm/npm/character-entities-html4/-/character-entities-html4-1.1.3.tgz#5ce6e01618e47048ac22f34f7f39db5c6fd679ef" - integrity sha1-XObgFhjkcEisIvNPfznbXG/Wee8= + version "1.1.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/character-entities-html4/-/character-entities-html4-1.1.4.tgz#0e64b0a3753ddbf1fdc044c5fd01d0199a02e125" + integrity sha1-DmSwo3U92/H9wETF/QHQGZoC4SU= character-entities-legacy@^1.0.0: - version "1.1.3" - resolved "https://repox.jfrog.io/repox/api/npm/npm/character-entities-legacy/-/character-entities-legacy-1.1.3.tgz#3c729991d9293da0ede6dddcaf1f2ce1009ee8b4" - integrity sha1-PHKZkdkpPaDt5t3crx8s4QCe6LQ= + version "1.1.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz#94bc1845dce70a5bb9d2ecc748725661293d8fc1" + integrity sha1-lLwYRdznClu50uzHSHJWYSk9j8E= character-entities@^1.0.0: - version "1.2.3" - resolved "https://repox.jfrog.io/repox/api/npm/npm/character-entities/-/character-entities-1.2.3.tgz#bbed4a52fe7ef98cc713c6d80d9faa26916d54e6" - integrity sha1-u+1KUv5++YzHE8bYDZ+qJpFtVOY= + version "1.2.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/character-entities/-/character-entities-1.2.4.tgz#e12c3939b7eaf4e5b15e7ad4c5e28e1d48c5b16b" + integrity sha1-4Sw5Obfq9OWxXnrUxeKOHUjFsWs= character-reference-invalid@^1.0.0: - version "1.1.3" - resolved "https://repox.jfrog.io/repox/api/npm/npm/character-reference-invalid/-/character-reference-invalid-1.1.3.tgz#1647f4f726638d3ea4a750cf5d1975c1c7919a85" - integrity sha1-Fkf09yZjjT6kp1DPXRl1wceRmoU= + version "1.1.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560" + integrity sha1-CDMpzaDq4nKrPbvzfpo4LBOvFWA= chardet@^0.4.0: version "0.4.2" @@ -3029,11 +3029,16 @@ code-point-at@^1.0.0: resolved "https://repox.jfrog.io/repox/api/npm/npm/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= -collapse-white-space@^1.0.0, collapse-white-space@^1.0.2: +collapse-white-space@^1.0.0: version "1.0.5" resolved "https://repox.jfrog.io/repox/api/npm/npm/collapse-white-space/-/collapse-white-space-1.0.5.tgz#c2495b699ab1ed380d29a1091e01063e75dbbe3a" integrity sha1-wklbaZqx7TgNKaEJHgEGPnXbvjo= +collapse-white-space@^1.0.2: + version "1.0.6" + resolved "https://repox.jfrog.io/repox/api/npm/npm/collapse-white-space/-/collapse-white-space-1.0.6.tgz#e63629c0016665792060dbbeb79c42239d2c5287" + integrity sha1-5jYpwAFmZXkgYNu+t5xCI50sUoc= + collect-v8-coverage@^1.0.0: version "1.0.0" resolved "https://repox.jfrog.io/repox/api/npm/npm/collect-v8-coverage/-/collect-v8-coverage-1.0.0.tgz#150ee634ac3650b71d9c985eb7f608942334feb1" @@ -5462,6 +5467,48 @@ hast-to-hyperscript@^7.0.0: unist-util-is "^3.0.0" web-namespaces "^1.1.2" +hast-to-hyperscript@^8.0.0: + version "8.0.0" + resolved "https://repox.jfrog.io/repox/api/npm/npm/hast-to-hyperscript/-/hast-to-hyperscript-8.0.0.tgz#ad1182144366ed8d4f65f1a771c7f1da6f812648" + integrity sha1-rRGCFENm7Y1PZfGnccfx2m+BJkg= + dependencies: + comma-separated-tokens "^1.0.0" + property-information "^5.0.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@^5.0.0: + version "5.0.3" + resolved "https://repox.jfrog.io/repox/api/npm/npm/hast-util-from-parse5/-/hast-util-from-parse5-5.0.3.tgz#3089dc0ee2ccf6ec8bc416919b51a54a589e097c" + integrity sha1-MIncDuLM9uyLxBaRm1GlSlieCXw= + dependencies: + ccount "^1.0.3" + hastscript "^5.0.0" + property-information "^5.0.0" + web-namespaces "^1.1.2" + xtend "^4.0.1" + +hast-util-parse-selector@^2.0.0: + version "2.2.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/hast-util-parse-selector/-/hast-util-parse-selector-2.2.4.tgz#60c99d0b519e12ab4ed32e58f150ec3f61ed1974" + integrity sha1-YMmdC1GeEqtO0y5Y8VDsP2HtGXQ= + +hast-util-raw@^5.0.0: + version "5.0.2" + resolved "https://repox.jfrog.io/repox/api/npm/npm/hast-util-raw/-/hast-util-raw-5.0.2.tgz#62288f311ec2f35e066a30d5e0277f963ad43a67" + integrity sha1-YiiPMR7C814GajDV4Cd/ljrUOmc= + dependencies: + hast-util-from-parse5 "^5.0.0" + hast-util-to-parse5 "^5.0.0" + html-void-elements "^1.0.0" + parse5 "^5.0.0" + unist-util-position "^3.0.0" + web-namespaces "^1.0.0" + xtend "^4.0.0" + zwitch "^1.0.0" + hast-util-sanitize@^2.0.0: version "2.0.2" resolved "https://repox.jfrog.io/repox/api/npm/npm/hast-util-sanitize/-/hast-util-sanitize-2.0.2.tgz#8a4299bccba6cc8836284466d446060d2ecb2f5c" @@ -5469,6 +5516,27 @@ hast-util-sanitize@^2.0.0: dependencies: xtend "^4.0.0" +hast-util-to-parse5@^5.0.0: + version "5.1.2" + resolved "https://repox.jfrog.io/repox/api/npm/npm/hast-util-to-parse5/-/hast-util-to-parse5-5.1.2.tgz#09d27bee9ba9348ea05a6cfcc44e02f9083969b6" + integrity sha1-CdJ77pupNI6gWmz8xE4C+Qg5abY= + dependencies: + hast-to-hyperscript "^7.0.0" + property-information "^5.0.0" + web-namespaces "^1.0.0" + xtend "^4.0.0" + zwitch "^1.0.0" + +hastscript@^5.0.0: + version "5.1.2" + resolved "https://repox.jfrog.io/repox/api/npm/npm/hastscript/-/hastscript-5.1.2.tgz#bde2c2e56d04c62dd24e8c5df288d050a355fb8a" + integrity sha1-veLC5W0Exi3SToxd8ojQUKNV+4o= + dependencies: + 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.x: version "1.2.0" resolved "https://repox.jfrog.io/repox/api/npm/npm/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" @@ -5596,6 +5664,11 @@ html-minifier@^3.2.3: relateurl "0.2.x" uglify-js "3.4.x" +html-void-elements@^1.0.0: + version "1.0.5" + resolved "https://repox.jfrog.io/repox/api/npm/npm/html-void-elements/-/html-void-elements-1.0.5.tgz#ce9159494e86d95e45795b166c2021c2cfca4483" + integrity sha1-zpFZSU6G2V5FeVsWbCAhws/KRIM= + html-webpack-plugin@3.2.0: version "3.2.0" resolved "https://repox.jfrog.io/repox/api/npm/npm/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz#b01abbd723acaaa7b37b6af4492ebda03d9dd37b" @@ -5816,7 +5889,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.0, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: version "2.0.4" resolved "https://repox.jfrog.io/repox/api/npm/npm/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w= @@ -5998,9 +6071,9 @@ is-accessor-descriptor@^1.0.0: kind-of "^6.0.0" is-alphabetical@^1.0.0: - version "1.0.3" - resolved "https://repox.jfrog.io/repox/api/npm/npm/is-alphabetical/-/is-alphabetical-1.0.3.tgz#eb04cc47219a8895d8450ace4715abff2258a1f8" - integrity sha1-6wTMRyGaiJXYRQrORxWr/yJYofg= + version "1.0.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" + integrity sha1-nn1rlJFr4iFTdF0YTCmMv5hqaG0= is-alphanumeric@^1.0.0: version "1.0.0" @@ -6008,9 +6081,9 @@ is-alphanumeric@^1.0.0: integrity sha1-Spzvcdr0wAHB2B1j0UDPU/1oifQ= is-alphanumerical@^1.0.0: - version "1.0.3" - resolved "https://repox.jfrog.io/repox/api/npm/npm/is-alphanumerical/-/is-alphanumerical-1.0.3.tgz#57ae21c374277b3defe0274c640a5704b8f6657c" - integrity sha1-V64hw3Qnez3v4CdMZApXBLj2ZXw= + version "1.0.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz#7eb9a2431f855f6b1ef1a78e326df515696c4dbf" + integrity sha1-frmiQx+FX2se8aeOMm31FWlsTb8= dependencies: is-alphabetical "^1.0.0" is-decimal "^1.0.0" @@ -6095,12 +6168,7 @@ is-date-object@^1.0.1: resolved "https://repox.jfrog.io/repox/api/npm/npm/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= -is-decimal@^1.0.0: - version "1.0.3" - resolved "https://repox.jfrog.io/repox/api/npm/npm/is-decimal/-/is-decimal-1.0.3.tgz#381068759b9dc807d8c0dc0bfbae2b68e1da48b7" - integrity sha1-OBBodZudyAfYwNwL+64raOHaSLc= - -is-decimal@^1.0.2: +is-decimal@^1.0.0, is-decimal@^1.0.2: version "1.0.4" resolved "https://repox.jfrog.io/repox/api/npm/npm/is-decimal/-/is-decimal-1.0.4.tgz#65a3a5958a1c5b63a706e1b333d7cd9f630d3fa5" integrity sha1-ZaOllYocW2OnBuGzM9fNn2MNP6U= @@ -6182,9 +6250,9 @@ is-glob@^4.0.0, is-glob@^4.0.1: is-extglob "^2.1.1" is-hexadecimal@^1.0.0: - version "1.0.3" - resolved "https://repox.jfrog.io/repox/api/npm/npm/is-hexadecimal/-/is-hexadecimal-1.0.3.tgz#e8a426a69b6d31470d3a33a47bb825cda02506ee" - integrity sha1-6KQmppttMUcNOjOke7glzaAlBu4= + version "1.0.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz#cc35c97588da4bd49a8eedd6bc4082d44dcb23a7" + integrity sha1-zDXJdYjaS9Saju3WvECC1E3LI6c= is-number-object@^1.0.4: version "1.0.4" @@ -6332,9 +6400,9 @@ is-url-superb@^3.0.0: url-regex "^5.0.0" is-whitespace-character@^1.0.0: - version "1.0.3" - resolved "https://repox.jfrog.io/repox/api/npm/npm/is-whitespace-character/-/is-whitespace-character-1.0.3.tgz#b3ad9546d916d7d3ffa78204bca0c26b56257fac" - integrity sha1-s62VRtkW19P/p4IEvKDCa1Ylf6w= + version "1.0.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/is-whitespace-character/-/is-whitespace-character-1.0.4.tgz#0858edd94a95594c7c9dd0b5c174ec6e45ee4aa7" + integrity sha1-CFjt2UqVWUx8ndC1wXTsbkXuSqc= is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" @@ -6342,9 +6410,9 @@ is-windows@^1.0.1, is-windows@^1.0.2: integrity sha1-0YUOuXkezRjmGCzhKjDzlmNLsZ0= is-word-character@^1.0.0: - version "1.0.3" - resolved "https://repox.jfrog.io/repox/api/npm/npm/is-word-character/-/is-word-character-1.0.3.tgz#264d15541cbad0ba833d3992c34e6b40873b08aa" - integrity sha1-Jk0VVBy60LqDPTmSw05rQIc7CKo= + version "1.0.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/is-word-character/-/is-word-character-1.0.4.tgz#ce0e73216f98599060592f62ff31354ddbeb0230" + integrity sha1-zg5zIW+YWZBgWS9i/zE1TdvrAjA= is-wsl@^1.1.0: version "1.1.0" @@ -7223,9 +7291,9 @@ lolex@^5.0.0: "@sinonjs/commons" "^1.7.0" longest-streak@^2.0.1: - version "2.0.3" - resolved "https://repox.jfrog.io/repox/api/npm/npm/longest-streak/-/longest-streak-2.0.3.tgz#3de7a3f47ee18e9074ded8575b5c091f5d0a4105" - integrity sha1-Peej9H7hjpB03thXW1wJH10KQQU= + version "2.0.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/longest-streak/-/longest-streak-2.0.4.tgz#b8599957da5b5dab64dee3fe316fa774597d90e4" + integrity sha1-uFmZV9pbXatk3uP+MW+ndFl9kOQ= loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.0, loose-envify@^1.3.1, loose-envify@^1.4.0: version "1.4.0" @@ -7311,9 +7379,9 @@ map-visit@^1.0.0: object-visit "^1.0.0" markdown-escapes@^1.0.0: - version "1.0.3" - resolved "https://repox.jfrog.io/repox/api/npm/npm/markdown-escapes/-/markdown-escapes-1.0.3.tgz#6155e10416efaafab665d466ce598216375195f5" - integrity sha1-YVXhBBbvqvq2ZdRmzlmCFjdRlfU= + version "1.0.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" + integrity sha1-yVQV70UUmddgK5EJXzyOiXX3hTU= markdown-table@^1.1.0: version "1.1.3" @@ -7330,19 +7398,26 @@ md5.js@^1.3.4: safe-buffer "^5.1.2" mdast-util-compact@^1.0.0: - version "1.0.3" - resolved "https://repox.jfrog.io/repox/api/npm/npm/mdast-util-compact/-/mdast-util-compact-1.0.3.tgz#98a25cc8a7865761a41477b3a87d1dcef0b1e79d" - integrity sha1-mKJcyKeGV2GkFHezqH0dzvCx550= + version "1.0.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/mdast-util-compact/-/mdast-util-compact-1.0.4.tgz#d531bb7667b5123abf20859be086c4d06c894593" + integrity sha1-1TG7dme1Ejq/IIWb4IbE0GyJRZM= dependencies: unist-util-visit "^1.1.0" mdast-util-definitions@^1.2.0: - version "1.2.4" - resolved "https://repox.jfrog.io/repox/api/npm/npm/mdast-util-definitions/-/mdast-util-definitions-1.2.4.tgz#2b54ad4eecaff9d9fcb6bf6f9f6b68b232d77ca7" - integrity sha1-K1StTuyv+dn8tr9vn2tosjLXfKc= + version "1.2.5" + resolved "https://repox.jfrog.io/repox/api/npm/npm/mdast-util-definitions/-/mdast-util-definitions-1.2.5.tgz#3fe622a4171c774ebd06f11e9f8af7ec53ea5c74" + integrity sha1-P+YipBccd069BvEen4r37FPqXHQ= dependencies: unist-util-visit "^1.0.0" +mdast-util-definitions@^2.0.0: + version "2.0.1" + resolved "https://repox.jfrog.io/repox/api/npm/npm/mdast-util-definitions/-/mdast-util-definitions-2.0.1.tgz#2c931d8665a96670639f17f98e32c3afcfee25f3" + integrity sha1-LJMdhmWpZnBjnxf5jjLDr8/uJfM= + dependencies: + unist-util-visit "^2.0.0" + mdast-util-to-hast@^6.0.0: version "6.0.2" resolved "https://repox.jfrog.io/repox/api/npm/npm/mdast-util-to-hast/-/mdast-util-to-hast-6.0.2.tgz#24a8791b7c624118637d70f03a9d29116e4311cf" @@ -7360,6 +7435,21 @@ mdast-util-to-hast@^6.0.0: unist-util-visit "^1.1.0" xtend "^4.0.1" +mdast-util-to-hast@^8.0.0: + version "8.1.0" + resolved "https://repox.jfrog.io/repox/api/npm/npm/mdast-util-to-hast/-/mdast-util-to-hast-8.1.0.tgz#80998dada58ad4544336a328849ed01d96777011" + integrity sha1-gJmNraWK1FRDNqMohJ7QHZZ3cBE= + dependencies: + collapse-white-space "^1.0.0" + detab "^2.0.0" + mdast-util-definitions "^2.0.0" + mdurl "^1.0.0" + trim-lines "^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" + mdast-util-to-string@^1.0.0: version "1.0.6" resolved "https://repox.jfrog.io/repox/api/npm/npm/mdast-util-to-string/-/mdast-util-to-string-1.0.6.tgz#7d85421021343b33de1552fc71cb8e5b4ae7536d" @@ -7388,7 +7478,7 @@ mdn-data@~1.1.0: resolved "https://repox.jfrog.io/repox/api/npm/npm/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01" integrity sha1-ULXU/8RXUnZXPE7tuHgIEqhBnwE= -mdurl@^1.0.1: +mdurl@^1.0.0, mdurl@^1.0.1: version "1.0.1" resolved "https://repox.jfrog.io/repox/api/npm/npm/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= @@ -8355,6 +8445,11 @@ parse5@^3.0.1: dependencies: "@types/node" "*" +parse5@^5.0.0: + version "5.1.1" + resolved "https://repox.jfrog.io/repox/api/npm/npm/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" + integrity sha1-9o5OW6GFKsLK3AD0VV//bCq7YXg= + parseurl@~1.3.2, parseurl@~1.3.3: version "1.3.3" resolved "https://repox.jfrog.io/repox/api/npm/npm/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -9012,7 +9107,7 @@ prop-types@15.7.2, prop-types@^15.5.10, prop-types@^15.5.6, prop-types@^15.5.8, object-assign "^4.1.1" react-is "^16.8.1" -property-information@^5.3.0: +property-information@^5.0.0, property-information@^5.3.0: version "5.4.0" resolved "https://repox.jfrog.io/repox/api/npm/npm/property-information/-/property-information-5.4.0.tgz#16e08f13f4e5c4a7be2e4ec431c01c4f8dba869a" integrity sha1-FuCPE/TlxKe+Lk7EMcAcT426hpo= @@ -9639,6 +9734,21 @@ regjsparser@^0.6.4: dependencies: jsesc "~0.5.0" +rehype-raw@4.0.2: + version "4.0.2" + resolved "https://repox.jfrog.io/repox/api/npm/npm/rehype-raw/-/rehype-raw-4.0.2.tgz#5d3191689df96c8c651ce5f51a6c668d2c07b9c8" + integrity sha1-XTGRaJ35bIxlHOX1GmxmjSwHucg= + dependencies: + hast-util-raw "^5.0.0" + +rehype-react@5.0.0: + version "5.0.0" + resolved "https://repox.jfrog.io/repox/api/npm/npm/rehype-react/-/rehype-react-5.0.0.tgz#7c08017b125d86839a13577851512cb4e23a2be4" + integrity sha1-fAgBexJdhoOaE1d4UVEstOI6K+Q= + dependencies: + "@mapbox/hast-util-table-cell-style" "^0.1.3" + hast-to-hyperscript "^8.0.0" + relateurl@0.2.x: version "0.2.7" resolved "https://repox.jfrog.io/repox/api/npm/npm/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" @@ -9682,6 +9792,13 @@ remark-react@6: hast-util-sanitize "^2.0.0" mdast-util-to-hast "^6.0.0" +remark-rehype@6.0.0: + version "6.0.0" + resolved "https://repox.jfrog.io/repox/api/npm/npm/remark-rehype/-/remark-rehype-6.0.0.tgz#dcd340ebee412709a81b15a69f4ae474a38aa72a" + integrity sha1-3NNA6+5BJwmoGxWmn0rkdKOKpyo= + dependencies: + mdast-util-to-hast "^8.0.0" + remark-slug@5.1.2: version "5.1.2" resolved "https://repox.jfrog.io/repox/api/npm/npm/remark-slug/-/remark-slug-5.1.2.tgz#715ecdef8df1226786204b1887d31ab16aa24609" @@ -10569,9 +10686,9 @@ staged-git-files@1.1.1: integrity sha1-N8IhjvDW0mF4sTEHGTCaFqWfj3s= state-toggle@^1.0.0: - version "1.0.2" - resolved "https://repox.jfrog.io/repox/api/npm/npm/state-toggle/-/state-toggle-1.0.2.tgz#75e93a61944116b4959d665c8db2d243631d6ddc" - integrity sha1-dek6YZRBFrSVnWZcjbLSQ2Mdbdw= + version "1.0.3" + resolved "https://repox.jfrog.io/repox/api/npm/npm/state-toggle/-/state-toggle-1.0.3.tgz#e123b16a88e143139b09c6852221bc9815917dfe" + integrity sha1-4SOxaojhQxObCcaFIiG8mBWRff4= static-extend@^0.1.1: version "0.1.2" @@ -10820,6 +10937,13 @@ style-to-object@^0.2.1: dependencies: inline-style-parser "0.1.1" +style-to-object@^0.3.0: + version "0.3.0" + resolved "https://repox.jfrog.io/repox/api/npm/npm/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46" + integrity sha1-sbeQ0gWZHMeDgBlnIUl57hmnbkY= + dependencies: + inline-style-parser "0.1.1" + stylehacks@^4.0.0: version "4.0.3" resolved "https://repox.jfrog.io/repox/api/npm/npm/stylehacks/-/stylehacks-4.0.3.tgz#6718fcaf4d1e07d8a1318690881e8d96726a71d5" @@ -11111,9 +11235,9 @@ trim-right@^1.0.1: integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= trim-trailing-lines@^1.0.0: - version "1.1.2" - resolved "https://repox.jfrog.io/repox/api/npm/npm/trim-trailing-lines/-/trim-trailing-lines-1.1.2.tgz#d2f1e153161152e9f02fabc670fb40bec2ea2e3a" - integrity sha1-0vHhUxYRUunwL6vGcPtAvsLqLjo= + version "1.1.3" + resolved "https://repox.jfrog.io/repox/api/npm/npm/trim-trailing-lines/-/trim-trailing-lines-1.1.3.tgz#7f0739881ff76657b7776e10874128004b625a94" + integrity sha1-fwc5iB/3Zle3d24Qh0EoAEtiWpQ= trim@0.0.1: version "0.0.1" @@ -11121,9 +11245,9 @@ trim@0.0.1: integrity sha1-WFhUf2spB1fulczMZm+1AITEYN0= trough@^1.0.0: - version "1.0.4" - resolved "https://repox.jfrog.io/repox/api/npm/npm/trough/-/trough-1.0.4.tgz#3b52b1f13924f460c3fbfd0df69b587dbcbc762e" - integrity sha1-O1Kx8Tkk9GDD+/0N9ptYfby8di4= + version "1.0.5" + resolved "https://repox.jfrog.io/repox/api/npm/npm/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406" + integrity sha1-uLY5zvrX0LsqvTfUM/+Ck++l9AY= tryer@^1.0.1: version "1.0.1" @@ -11252,12 +11376,12 @@ uglify-js@3.4.x: source-map "~0.6.1" unherit@^1.0.4: - version "1.1.2" - resolved "https://repox.jfrog.io/repox/api/npm/npm/unherit/-/unherit-1.1.2.tgz#14f1f397253ee4ec95cec167762e77df83678449" - integrity sha1-FPHzlyU+5OyVzsFndi5334NnhEk= + version "1.1.3" + resolved "https://repox.jfrog.io/repox/api/npm/npm/unherit/-/unherit-1.1.3.tgz#6c9b503f2b41b262330c80e91c8614abdaa69c22" + integrity sha1-bJtQPytBsmIzDIDpHIYUq9qmnCI= dependencies: - inherits "^2.0.1" - xtend "^4.0.1" + inherits "^2.0.0" + xtend "^4.0.0" unicode-canonical-property-names-ecmascript@^1.0.4: version "1.0.4" @@ -11334,10 +11458,15 @@ unist-builder@^1.0.1: dependencies: object-assign "^4.1.0" -unist-util-generated@^1.1.0: - version "1.1.4" - resolved "https://repox.jfrog.io/repox/api/npm/npm/unist-util-generated/-/unist-util-generated-1.1.4.tgz#2261c033d9fc23fae41872cdb7663746e972c1a7" - integrity sha1-ImHAM9n8I/rkGHLNt2Y3Rulywac= +unist-builder@^2.0.0: + version "2.0.3" + resolved "https://repox.jfrog.io/repox/api/npm/npm/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436" + integrity sha1-d2SHEbXYavCULzNDl6M8XpFRZDY= + +unist-util-generated@^1.0.0, unist-util-generated@^1.1.0: + version "1.1.5" + resolved "https://repox.jfrog.io/repox/api/npm/npm/unist-util-generated/-/unist-util-generated-1.1.5.tgz#1e903e68467931ebfaea386dae9ea253628acd42" + integrity sha1-HpA+aEZ5Mev66jhtrp6iU2KKzUI= unist-util-is@^3.0.0: version "3.0.0" @@ -11355,9 +11484,9 @@ unist-util-position@^3.0.0: integrity sha1-//lCuHlTiyQglsFIFTgmZksco3M= unist-util-remove-position@^1.0.0: - version "1.1.3" - resolved "https://repox.jfrog.io/repox/api/npm/npm/unist-util-remove-position/-/unist-util-remove-position-1.1.3.tgz#d91aa8b89b30cb38bad2924da11072faa64fd972" - integrity sha1-2RqouJswyzi60pJNoRBy+qZP2XI= + version "1.1.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/unist-util-remove-position/-/unist-util-remove-position-1.1.4.tgz#ec037348b6102c897703eee6d0294ca4755a2020" + integrity sha1-7ANzSLYQLIl3A+7m0ClMpHVaICA= dependencies: unist-util-visit "^1.1.0" @@ -11557,9 +11686,9 @@ verror@1.10.0: extsprintf "^1.2.0" vfile-location@^2.0.0: - version "2.0.5" - resolved "https://repox.jfrog.io/repox/api/npm/npm/vfile-location/-/vfile-location-2.0.5.tgz#c83eb02f8040228a8d2b3f10e485be3e3433e0a2" - integrity sha1-yD6wL4BAIoqNKz8Q5IW+PjQz4KI= + version "2.0.6" + resolved "https://repox.jfrog.io/repox/api/npm/npm/vfile-location/-/vfile-location-2.0.6.tgz#8a274f39411b8719ea5728802e10d9e0dff1519e" + integrity sha1-iidPOUEbhxnqVyiALhDZ4N/xUZ4= vfile-message@^2.0.0: version "2.0.3" @@ -11638,7 +11767,7 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" -web-namespaces@^1.1.2: +web-namespaces@^1.0.0, web-namespaces@^1.1.2: version "1.1.4" resolved "https://repox.jfrog.io/repox/api/npm/npm/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec" integrity sha1-vJij3mDa3X+u/EA9EHbVKfXgMOw= @@ -12007,3 +12136,8 @@ yargs@^15.0.0: which-module "^2.0.0" y18n "^4.0.0" yargs-parser "^18.1.1" + +zwitch@^1.0.0: + version "1.0.5" + resolved "https://repox.jfrog.io/repox/api/npm/npm/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" + integrity sha1-0R1zgf/tFrdC9q97PyI9XNn+mSA= |