@verdaccio/ui-components 3.0.0-next.1 → 4.0.0-next-8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +1 -1
- package/CHANGELOG.md +108 -0
- package/build/AppTest/AppRoute.js +34 -0
- package/build/AppTest/pages/Front/Home.js +9 -0
- package/build/AppTest/pages/Front/index.js +14 -0
- package/build/AppTest/pages/Version/Version.js +34 -0
- package/build/AppTest/pages/Version/index.js +14 -0
- package/build/Theme/ResetStyles.js +2 -3
- package/build/Theme/StyleBaseline.js +2 -3
- package/build/Theme/ThemeProvider.js +3 -3
- package/build/Theme/colors.js +1 -2
- package/build/Theme/index.js +3 -3
- package/build/Theme/theme.js +17 -7
- package/build/__mocks__/react-markdown.js +1 -1
- package/build/components/ActionBar/ActionBar.js +13 -8
- package/build/components/ActionBar/ActionBarAction.js +26 -19
- package/build/components/ActionBar/index.js +1 -1
- package/build/components/Author/Author.js +12 -34
- package/build/components/Author/index.js +1 -1
- package/build/components/Author/styles.js +10 -28
- package/build/components/CopyClipboard/CopyToClipBoard.js +13 -13
- package/build/components/CopyClipboard/index.js +1 -1
- package/build/components/CopyClipboard/utils.js +3 -12
- package/build/components/Dependencies/Dependencies.js +31 -58
- package/build/components/Dependencies/DependencyBlock.js +102 -0
- package/build/components/Dependencies/index.js +1 -1
- package/build/components/Dependencies/utits.js +10 -0
- package/build/components/Deprecated/Deprecated.js +13 -22
- package/build/components/Deprecated/index.js +1 -1
- package/build/components/Developers/DeveloperType.js +12 -0
- package/build/components/Developers/Developers.js +26 -32
- package/build/components/Developers/Title.js +7 -13
- package/build/components/Developers/get-unique-developer-values.js +1 -2
- package/build/components/Developers/index.js +4 -4
- package/build/components/Distribution/Dist.js +3 -4
- package/build/components/Distribution/index.js +1 -1
- package/build/components/Distribution/styles.js +14 -31
- package/build/components/Engines/Engines.js +17 -12
- package/build/components/Engines/index.js +1 -1
- package/build/components/Engines/styles.js +9 -11
- package/build/components/ErrorBoundary/ErrorBoundary.js +2 -2
- package/build/components/ErrorBoundary/index.js +1 -1
- package/build/components/Forbidden/Forbidden.js +75 -0
- package/build/components/Forbidden/index.js +14 -0
- package/build/components/FundButton/FundButton.js +11 -13
- package/build/components/FundButton/index.js +1 -1
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.js +5 -5
- package/build/components/HeaderInfoDialog/index.js +1 -1
- package/build/components/Heading/Heading.js +5 -6
- package/build/components/Heading/index.js +1 -1
- package/build/components/Help/Help.js +4 -5
- package/build/components/Help/index.js +1 -1
- package/build/components/Help/styles.js +2 -3
- package/build/components/Icons/DevsIcons/CommonJS.js +2 -13
- package/build/components/Icons/DevsIcons/ES6Module.js +3 -14
- package/build/components/Icons/DevsIcons/Git.js +2 -13
- package/build/components/Icons/DevsIcons/NodeJS.js +2 -13
- package/build/components/Icons/DevsIcons/TypeScript.js +2 -13
- package/build/components/Icons/Earth.js +3 -4
- package/build/components/Icons/FileBinary.js +14 -9
- package/build/components/Icons/Law.js +15 -10
- package/build/components/Icons/License.js +3 -4
- package/build/components/Icons/License.js.map +1 -1
- package/build/components/Icons/Managers/Npm.js +2 -13
- package/build/components/Icons/Managers/Pnpm.js +2 -13
- package/build/components/Icons/Managers/Yarn.js +2 -13
- package/build/components/Icons/SvgIcon.js +3 -4
- package/build/components/Icons/Time.js +3 -4
- package/build/components/Icons/Version.js +3 -4
- package/build/components/Install/Install.js +36 -29
- package/build/components/Install/InstallListItem.js +35 -48
- package/build/components/Install/index.js +1 -1
- package/build/components/Keywords/KeywordListItems.js +34 -0
- package/build/components/Keywords/Keywords.js +39 -0
- package/build/components/Keywords/index.js +14 -0
- package/build/components/Label/Label.js +3 -4
- package/build/components/Label/index.js +1 -1
- package/build/components/Link/Link.js +5 -19
- package/build/components/Link/index.js +2 -2
- package/build/components/LinkExternal/LinkExternal.js +32 -0
- package/build/components/LinkExternal/index.js +14 -0
- package/build/components/Loading/Loading.js +2 -3
- package/build/components/Loading/Spinner/Spinner.js +2 -3
- package/build/components/Loading/Spinner/index.js +1 -1
- package/build/components/Loading/index.js +1 -1
- package/build/components/Loading/styles.js +6 -7
- package/build/components/LoginDialog/LoginDialog.js +16 -6
- package/build/components/LoginDialog/LoginDialogCloseButton.js +5 -5
- package/build/components/LoginDialog/LoginDialogForm.js +7 -20
- package/build/components/LoginDialog/LoginDialogFormError.js +7 -7
- package/build/components/LoginDialog/LoginDialogHeader.js +2 -3
- package/build/components/LoginDialog/index.js +1 -1
- package/build/components/Logo/Logo.js +15 -9
- package/build/components/Logo/index.js +1 -1
- package/build/components/MenuItem/MenuItem.js +5 -6
- package/build/components/MenuItem/index.js +1 -1
- package/build/components/NoItems/NoItems.js +2 -3
- package/build/components/NoItems/index.js +1 -1
- package/build/components/NotFound/NotFound.js +20 -19
- package/build/components/NotFound/index.js +1 -1
- package/build/components/Package/Package.js +56 -40
- package/build/components/Package/index.js +2 -2
- package/build/components/Package/styles.js +59 -84
- package/build/components/PackageList/PackageList.js +2 -3
- package/build/components/PackageList/index.js +1 -1
- package/build/components/Person/Person.js +48 -0
- package/build/components/Person/PersonTooltip.js +22 -0
- package/build/components/Person/index.js +14 -0
- package/build/components/Person/utils.js +17 -0
- package/build/components/RawViewer/RawViewer.js +13 -9
- package/build/components/RawViewer/index.js +1 -1
- package/build/components/Readme/Readme.js +41 -21
- package/build/components/Readme/Readme.js.map +1 -1
- package/build/components/Readme/Readme.spec.js +20 -1
- package/build/components/Readme/Readme.spec.js.map +1 -1
- package/build/components/Readme/github-markdown.css +1198 -0
- package/build/components/Readme/index.js +1 -1
- package/build/components/Readme/utils.js +14 -17
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js +2 -3
- package/build/components/RegistryInfoDialog/index.js +1 -1
- package/build/components/RegistryInfoDialog/styles.js +13 -17
- package/build/components/Repository/Repository.js +23 -36
- package/build/components/Repository/index.js +1 -1
- package/build/components/Search/AutoComplete/AutoComplete.js +4 -5
- package/build/components/Search/AutoComplete/index.js +1 -1
- package/build/components/Search/AutoComplete/styles.js +6 -45
- package/build/components/Search/Search.js +11 -10
- package/build/components/Search/SearchItem.js +56 -45
- package/build/components/Search/index.js +1 -1
- package/build/components/Search/styles.js +3 -5
- package/build/components/Search/utils.js +23 -0
- package/build/components/SettingsMenu/SettingsMenu.js +49 -11
- package/build/components/SettingsMenu/index.js +1 -1
- package/build/components/SideBarTitle/SideBarTitle.js +104 -0
- package/build/components/SideBarTitle/index.js +14 -0
- package/build/components/{SideBarTittle → SideBarTitle}/utils.js +2 -3
- package/build/components/TextField/TextField.js +5 -6
- package/build/components/TextField/index.js +1 -1
- package/build/components/UpLinks/UpLinks.js +37 -9
- package/build/components/UpLinks/UplinkLink.js +22 -0
- package/build/components/UpLinks/index.js +1 -1
- package/build/components/UpLinks/styles.js +9 -11
- package/build/components/Versions/HistoryList.js +52 -18
- package/build/components/Versions/TagList.js +10 -7
- package/build/components/Versions/Versions.js +82 -15
- package/build/components/Versions/__partials__/data.json +1 -0
- package/build/components/Versions/__partials__/deprecated-versions.json +175 -0
- package/build/components/Versions/index.js +1 -1
- package/build/components/Versions/styles.js +3 -5
- package/build/hooks/index.js +1 -1
- package/build/hooks/useLocalStorage.js +1 -2
- package/build/hooks/useOnClickOutside.js +1 -2
- package/build/index.js +40 -8
- package/build/layouts/Version/Version.js +2 -3
- package/build/layouts/Version/index.js +1 -1
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js +6 -5
- package/build/providers/AppConfigurationProvider/index.js +2 -2
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js +7 -6
- package/build/providers/PersistenceSettingProvider/index.js +2 -2
- package/build/providers/TranslatorProvider/TranslatorProvider.js +4 -5
- package/build/providers/TranslatorProvider/TranslatorProvider.spec.js +3 -3
- package/build/providers/TranslatorProvider/index.js +2 -2
- package/build/providers/VersionProvider/VersionProvider.js +5 -7
- package/build/providers/VersionProvider/index.js +2 -2
- package/build/sections/Detail/ContainerContent.js +5 -7
- package/build/sections/Detail/Detail.js +13 -11
- package/build/sections/Detail/ReadmeSection.js +2 -3
- package/build/sections/Detail/Tabs.js +6 -8
- package/build/sections/Detail/index.js +1 -1
- package/build/sections/Footer/Footer.js +39 -11
- package/build/sections/Footer/index.js +1 -1
- package/build/sections/Footer/styles.js +19 -21
- package/build/sections/Header/Header.js +4 -5
- package/build/sections/Header/HeaderGreetings.js +2 -3
- package/build/sections/Header/HeaderLeft.js +16 -20
- package/build/sections/Header/HeaderMenu.js +3 -4
- package/build/sections/Header/HeaderRight.js +16 -8
- package/build/sections/Header/HeaderSettingsDialog.js +6 -10
- package/build/sections/Header/HeaderToolTip.js +2 -3
- package/build/sections/Header/HeaderToolTipIcon.js +4 -5
- package/build/sections/Header/LanguageSwitch.js +10 -13
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +14 -24
- package/build/sections/Header/RegistryInfoContent/index.js +1 -1
- package/build/sections/Header/RegistryInfoContent/styles.js +3 -5
- package/build/sections/Header/index.js +1 -1
- package/build/sections/Header/styles.js +54 -106
- package/build/sections/Home/Home.js +4 -5
- package/build/sections/Home/index.js +1 -1
- package/build/sections/SideBar/Sidebar.js +23 -30
- package/build/sections/SideBar/index.js +1 -1
- package/build/sections/index.js +1 -1
- package/build/src/AppTest/App.stories.d.ts +8 -0
- package/build/src/AppTest/AppRoute.d.ts +3 -0
- package/build/src/AppTest/pages/Front/Home.d.ts +2 -0
- package/build/src/AppTest/pages/Front/index.d.ts +1 -0
- package/build/src/AppTest/pages/Version/Version.d.ts +3 -0
- package/build/src/AppTest/pages/Version/index.d.ts +1 -0
- package/build/src/Theme/ThemeProvider.test.d.ts +1 -0
- package/build/src/__mocks__/react-markdown.d.ts +2 -2
- package/build/src/components/Author/Author.d.ts +0 -5
- package/build/src/components/Author/styles.d.ts +0 -4
- package/build/src/components/CopyClipboard/CopyToClipBoard.d.ts +1 -1
- package/build/src/components/CopyClipboard/CopyToClipBoard.test.d.ts +1 -0
- package/build/src/components/Dependencies/DependencyBlock.d.ts +16 -0
- package/build/src/components/Dependencies/DependencyBlock.test.d.ts +1 -0
- package/build/src/components/Dependencies/utits.d.ts +3 -0
- package/build/src/components/Deprecated/Deprecated.d.ts +0 -1
- package/build/src/components/Developers/DeveloperType.d.ts +4 -0
- package/build/src/components/Developers/Developers.d.ts +1 -4
- package/build/src/components/Developers/Title.d.ts +1 -4
- package/build/src/components/Developers/index.d.ts +2 -1
- package/build/src/components/Distribution/styles.d.ts +0 -1
- package/build/src/components/ErrorBoundary/ErrorBoundary.test.d.ts +1 -0
- package/build/src/components/Forbidden/Forbidden.d.ts +3 -0
- package/build/src/components/Forbidden/Forbidden.test.d.ts +1 -0
- package/build/src/components/Forbidden/index.d.ts +1 -0
- package/build/src/components/HeaderInfoDialog/HeaderInfoDialog.test.d.ts +1 -0
- package/build/src/components/Heading/Heading.d.ts +1 -1
- package/build/src/components/Heading/Heading.test.d.ts +1 -0
- package/build/src/components/Icons/DevsIcons/CommonJS.d.ts +2 -2
- package/build/src/components/Icons/DevsIcons/ES6Module.d.ts +2 -2
- package/build/src/components/Icons/DevsIcons/Git.d.ts +2 -2
- package/build/src/components/Icons/DevsIcons/NodeJS.d.ts +2 -2
- package/build/src/components/Icons/DevsIcons/TypeScript.d.ts +2 -2
- package/build/src/components/Icons/Earth.d.ts +2 -2
- package/build/src/components/Icons/FileBinary.d.ts +2 -2
- package/build/src/components/Icons/Icons.test.d.ts +1 -0
- package/build/src/components/Icons/Law.d.ts +2 -2
- package/build/src/components/Icons/License.d.ts +2 -2
- package/build/src/components/Icons/Managers/Npm.d.ts +2 -2
- package/build/src/components/Icons/Managers/Pnpm.d.ts +2 -2
- package/build/src/components/Icons/Managers/Yarn.d.ts +2 -2
- package/build/src/components/Icons/SvgIcon.d.ts +1 -1
- package/build/src/components/Icons/Time.d.ts +2 -2
- package/build/src/components/Icons/Version.d.ts +2 -2
- package/build/src/components/Install/InstallListItem.d.ts +2 -0
- package/build/src/components/Keywords/KeywordListItems.d.ts +5 -0
- package/build/src/components/Keywords/Keywords.d.ts +6 -0
- package/build/src/components/Keywords/Keywords.stories.d.ts +5 -0
- package/build/src/components/Keywords/Keywords.test.d.ts +1 -0
- package/build/src/components/Keywords/index.d.ts +1 -0
- package/build/src/components/Link/Link.d.ts +1 -4
- package/build/src/components/Link/Link.test.d.ts +1 -0
- package/build/src/components/Link/index.d.ts +1 -1
- package/build/src/components/LinkExternal/LinkExternal.d.ts +3 -0
- package/build/src/components/LinkExternal/LinkExternal.test.d.ts +1 -0
- package/build/src/components/LinkExternal/index.d.ts +1 -0
- package/build/src/components/Loading/styles.d.ts +2 -2
- package/build/src/components/LoginDialog/LoginDialog.stories.d.ts +2 -2
- package/build/src/components/LoginDialog/LoginDialogForm.d.ts +1 -1
- package/build/src/components/LoginDialog/LoginDialogFormError.d.ts +1 -1
- package/build/src/components/Logo/Logo.d.ts +1 -0
- package/build/src/components/Logo/Logo.stories.d.ts +5 -0
- package/build/src/components/MenuItem/MenuItem.d.ts +1 -1
- package/build/src/components/Package/Package.d.ts +1 -1
- package/build/src/components/Package/styles.d.ts +7 -15
- package/build/src/components/Person/Person.d.ts +9 -0
- package/build/src/components/Person/Person.test.d.ts +1 -0
- package/build/src/components/Person/PersonTooltip.d.ts +6 -0
- package/build/src/components/Person/index.d.ts +1 -0
- package/build/src/components/Person/utils.d.ts +3 -0
- package/build/src/components/Readme/Readme.d.ts +1 -2
- package/build/src/components/RegistryInfoDialog/styles.d.ts +1 -1
- package/build/src/components/Search/AutoComplete/styles.d.ts +1 -9
- package/build/src/components/Search/Search.stories.d.ts +2 -2
- package/build/src/components/Search/SearchItem.d.ts +1 -1
- package/build/src/components/Search/styles.d.ts +1 -1
- package/build/src/components/Search/utils.d.ts +1 -0
- package/build/src/components/SettingsMenu/SettingsMenu.d.ts +2 -2
- package/build/src/components/SettingsMenu/SettingsMenu.test.d.ts +1 -0
- package/build/src/components/SideBarTitle/index.d.ts +1 -0
- package/build/src/components/TextField/TextField.d.ts +1 -1
- package/build/src/components/UpLinks/UplinkLink.d.ts +6 -0
- package/build/src/components/UpLinks/styles.d.ts +2 -2
- package/build/src/components/Versions/HistoryList.d.ts +1 -0
- package/build/src/components/Versions/Versions.d.ts +1 -0
- package/build/src/components/Versions/styles.d.ts +2 -2
- package/build/src/index.d.ts +6 -2
- package/build/src/sections/Detail/Detail.stories.d.ts +1 -0
- package/build/src/sections/Detail/Tabs.d.ts +1 -0
- package/build/src/sections/Footer/Footer.d.ts +2 -2
- package/build/src/sections/Footer/styles.d.ts +5 -5
- package/build/src/sections/Header/LanguageSwitch.d.ts +2 -2
- package/build/src/sections/Header/RegistryInfoContent/RegistryInfoContent.d.ts +3 -3
- package/build/src/sections/Header/RegistryInfoContent/styles.d.ts +2 -2
- package/build/src/sections/Header/styles.d.ts +4 -11
- package/build/src/sections/Home/Home.test.d.ts +1 -0
- package/build/src/store/models/manifest.d.ts +11 -0
- package/build/src/store/models/routes.d.ts +8 -0
- package/build/src/store/models/utils.d.ts +1 -0
- package/build/src/types/packageMeta.d.ts +8 -5
- package/build/src/utils/__partials__/packageMeta.d.ts +0 -1
- package/build/src/utils/loadable.d.ts +2 -2
- package/build/src/utils/routes.d.ts +1 -0
- package/build/src/utils/utils.d.ts +1 -0
- package/build/store/api.js +14 -9
- package/build/store/index.js +1 -1
- package/build/store/models/configuration.js +4 -4
- package/build/store/models/download.js +2 -4
- package/build/store/models/index.js +1 -2
- package/build/store/models/login.js +7 -7
- package/build/store/models/manifest.js +27 -8
- package/build/store/models/packages.js +6 -5
- package/build/store/models/routes.js +18 -0
- package/build/store/models/search.js +7 -6
- package/build/store/models/utils.js +10 -0
- package/build/store/storage.js +2 -3
- package/build/store/store.js +2 -3
- package/build/test/i18n-config.js +2 -3
- package/build/test/test-react-testing-library.js +1 -1
- package/build/utils/__partials__/packageMeta.js +1 -3
- package/build/utils/index.js +3 -3
- package/build/utils/loadable.js +2 -2
- package/build/utils/routes.js +2 -2
- package/build/utils/token.js +1 -1
- package/build/utils/url.js +1 -1
- package/build/utils/utils.js +22 -4
- package/package.json +34 -31
- package/src/AppTest/App.stories.tsx +32 -0
- package/src/AppTest/AppRoute.test.tsx +65 -0
- package/src/AppTest/AppRoute.tsx +42 -0
- package/src/AppTest/pages/Front/Home.ts +3 -0
- package/src/AppTest/pages/Front/index.ts +1 -0
- package/src/AppTest/pages/Version/Version.tsx +28 -0
- package/src/AppTest/pages/Version/index.ts +1 -0
- package/src/Theme/ThemeProvider.test.tsx +27 -0
- package/src/Theme/theme.ts +12 -5
- package/src/components/ActionBar/ActionBar.stories.tsx +1 -1
- package/src/components/ActionBar/ActionBar.test.tsx +44 -16
- package/src/components/ActionBar/ActionBar.tsx +17 -13
- package/src/components/ActionBar/ActionBarAction.tsx +22 -14
- package/src/components/Author/Author.test.tsx +7 -1
- package/src/components/Author/Author.tsx +4 -33
- package/src/components/Author/styles.ts +0 -6
- package/src/components/CopyClipboard/CopyToClipBoard.test.tsx +23 -0
- package/src/components/CopyClipboard/CopyToClipBoard.tsx +4 -3
- package/src/components/CopyClipboard/utils.ts +2 -13
- package/src/components/Dependencies/Dependencies.stories.tsx +11 -11
- package/src/components/Dependencies/Dependencies.test.tsx +1 -11
- package/src/components/Dependencies/Dependencies.tsx +30 -69
- package/src/components/Dependencies/DependencyBlock.test.tsx +46 -0
- package/src/components/Dependencies/DependencyBlock.tsx +83 -0
- package/src/components/Dependencies/utits.ts +3 -0
- package/src/components/Deprecated/Deprecated.tsx +6 -19
- package/src/components/Developers/DeveloperType.tsx +4 -0
- package/src/components/Developers/Developers.test.tsx +37 -10
- package/src/components/Developers/Developers.tsx +13 -13
- package/src/components/Developers/Title.tsx +1 -5
- package/src/components/Developers/index.ts +2 -1
- package/src/components/Distribution/Dist.test.tsx +1 -1
- package/src/components/Distribution/Dist.tsx +2 -4
- package/src/components/Distribution/styles.ts +0 -6
- package/src/components/Engines/Engines.tsx +10 -6
- package/src/components/Engines/styles.ts +1 -1
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +39 -0
- package/src/components/Forbidden/Forbidden.test.tsx +38 -0
- package/src/components/Forbidden/Forbidden.tsx +56 -0
- package/src/components/Forbidden/index.ts +1 -0
- package/src/components/FundButton/FundButton.tsx +5 -5
- package/src/components/HeaderInfoDialog/HeaderInfoDialog.test.tsx +51 -0
- package/src/components/HeaderInfoDialog/HeaderInfoDialog.tsx +2 -2
- package/src/components/Heading/Heading.test.tsx +20 -0
- package/src/components/Help/Help.test.tsx +10 -3
- package/src/components/Icons/DevsIcons/CommonJS.tsx +1 -7
- package/src/components/Icons/DevsIcons/ES6Module.tsx +2 -8
- package/src/components/Icons/DevsIcons/Git.tsx +1 -7
- package/src/components/Icons/DevsIcons/NodeJS.tsx +1 -7
- package/src/components/Icons/DevsIcons/TypeScript.tsx +1 -7
- package/src/components/Icons/FileBinary.tsx +2 -1
- package/src/components/Icons/Icons.stories.tsx +21 -5
- package/src/components/Icons/Icons.test.tsx +70 -0
- package/src/components/Icons/Law.tsx +2 -1
- package/src/components/Icons/Managers/Npm.tsx +1 -7
- package/src/components/Icons/Managers/Pnpm.tsx +1 -7
- package/src/components/Icons/Managers/Yarn.tsx +1 -7
- package/src/components/Install/Install.test.tsx +74 -41
- package/src/components/Install/Install.tsx +27 -15
- package/src/components/Install/InstallListItem.tsx +49 -31
- package/src/components/Keywords/KeywordListItems.tsx +22 -0
- package/src/components/Keywords/Keywords.stories.tsx +19 -0
- package/src/components/Keywords/Keywords.test.tsx +57 -0
- package/src/components/Keywords/Keywords.tsx +35 -0
- package/src/components/Keywords/index.ts +1 -0
- package/src/components/Link/Link.test.tsx +25 -0
- package/src/components/Link/Link.tsx +4 -18
- package/src/components/Link/index.ts +1 -1
- package/src/components/LinkExternal/LinkExternal.test.tsx +18 -0
- package/src/components/LinkExternal/LinkExternal.tsx +22 -0
- package/src/components/LinkExternal/index.ts +1 -0
- package/src/components/Loading/Loading.test.tsx +8 -4
- package/src/components/Loading/styles.ts +1 -0
- package/src/components/LoginDialog/LoginDialog.test.tsx +1 -1
- package/src/components/LoginDialog/LoginDialog.tsx +10 -1
- package/src/components/LoginDialog/LoginDialogCloseButton.tsx +1 -0
- package/src/components/LoginDialog/LoginDialogForm.tsx +0 -2
- package/src/components/LoginDialog/LoginDialogFormError.tsx +1 -1
- package/src/components/Logo/Logo.stories.tsx +16 -0
- package/src/components/Logo/Logo.test.tsx +8 -1
- package/src/components/Logo/Logo.tsx +19 -3
- package/src/components/NotFound/NotFound.tsx +6 -5
- package/src/components/NotFound/Notfound.test.tsx +6 -3
- package/src/components/Package/Package.test.tsx +47 -14
- package/src/components/Package/Package.tsx +51 -45
- package/src/components/Package/styles.ts +7 -17
- package/src/components/PackageList/Packagelist.test.tsx +1 -0
- package/src/components/Person/Person.test.tsx +50 -0
- package/src/components/Person/Person.tsx +45 -0
- package/src/components/Person/PersonTooltip.tsx +26 -0
- package/src/components/Person/index.ts +1 -0
- package/src/components/Person/utils.ts +20 -0
- package/src/components/RawViewer/RawViewer.tsx +9 -10
- package/src/components/Readme/Readme.spec.tsx +17 -0
- package/src/components/Readme/Readme.tsx +28 -12
- package/src/components/Readme/github-markdown.css +1198 -0
- package/src/components/Readme/utils.ts +15 -14
- package/src/components/RegistryInfoDialog/styles.ts +5 -4
- package/src/components/Repository/Repository.tsx +10 -17
- package/src/components/Search/AutoComplete/AutoComplete.tsx +1 -1
- package/src/components/Search/AutoComplete/styles.ts +7 -0
- package/src/components/Search/Search.test.tsx +38 -11
- package/src/components/Search/Search.tsx +4 -2
- package/src/components/Search/SearchItem.tsx +19 -8
- package/src/components/Search/utils.ts +17 -0
- package/src/components/SettingsMenu/SettingsMenu.test.tsx +41 -0
- package/src/components/SettingsMenu/SettingsMenu.tsx +64 -7
- package/src/components/{SideBarTittle/SideBarTittle.tsx → SideBarTitle/SideBarTitle.tsx} +20 -3
- package/src/components/SideBarTitle/index.ts +1 -0
- package/src/components/UpLinks/UpLinks.test.tsx +7 -0
- package/src/components/UpLinks/UpLinks.tsx +38 -15
- package/src/components/UpLinks/UplinkLink.tsx +20 -0
- package/src/components/UpLinks/styles.ts +1 -0
- package/src/components/Versions/HistoryList.tsx +39 -6
- package/src/components/Versions/TagList.tsx +4 -3
- package/src/components/Versions/Versions.test.tsx +40 -7
- package/src/components/Versions/Versions.tsx +88 -19
- package/src/components/Versions/__partials__/data.json +1 -0
- package/src/components/Versions/__partials__/deprecated-versions.json +175 -0
- package/src/index.ts +6 -2
- package/src/providers/AppConfigurationProvider/AppConfigurationProvider.tsx +2 -0
- package/src/providers/PersistenceSettingProvider/PersistenceSettingProvider.tsx +4 -0
- package/src/providers/VersionProvider/VersionProvider.test.tsx +3 -3
- package/src/sections/Detail/Detail.stories.tsx +10 -0
- package/src/sections/Detail/Detail.test.tsx +8 -1
- package/src/sections/Detail/Detail.tsx +11 -4
- package/src/sections/Detail/Tabs.tsx +6 -9
- package/src/sections/Footer/Footer.tsx +26 -12
- package/src/sections/Footer/styles.ts +4 -0
- package/src/sections/Header/Header.test.tsx +12 -10
- package/src/sections/Header/HeaderLeft.tsx +19 -11
- package/src/sections/Header/HeaderMenu.tsx +1 -1
- package/src/sections/Header/HeaderRight.tsx +14 -3
- package/src/sections/Header/HeaderSettingsDialog.tsx +2 -3
- package/src/sections/Header/LanguageSwitch.tsx +10 -7
- package/src/sections/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +1 -1
- package/src/sections/Header/RegistryInfoContent/RegistryInfoContent.tsx +2 -7
- package/src/sections/Header/styles.ts +4 -16
- package/src/sections/Home/Home.test.tsx +37 -0
- package/src/sections/Home/Home.tsx +0 -1
- package/src/sections/SideBar/Sidebar.test.tsx +52 -84
- package/src/sections/SideBar/Sidebar.tsx +11 -26
- package/src/store/api.test.ts +19 -2
- package/src/store/api.ts +13 -6
- package/src/store/models/configuration.ts +2 -1
- package/src/store/models/download.ts +0 -1
- package/src/store/models/login.ts +10 -12
- package/src/store/models/manifest.ts +25 -6
- package/src/store/models/packages.ts +4 -5
- package/src/store/models/routes.ts +10 -0
- package/src/store/models/search.ts +4 -2
- package/src/store/models/utils.ts +3 -0
- package/src/types/packageMeta.ts +8 -5
- package/src/utils/__partials__/packageMeta.ts +0 -1
- package/src/utils/routes.ts +1 -0
- package/src/utils/utils.test.ts +34 -0
- package/src/utils/utils.ts +20 -5
- package/tsconfig.json +1 -1
- package/build/components/Dependencies/styles.js +0 -68
- package/build/components/Developers/styles.js +0 -69
- package/build/components/Distribution/utils.js +0 -25
- package/build/components/Distribution/utilts.spec.js +0 -18
- package/build/components/Package/Tag/Tag.js +0 -15
- package/build/components/Package/Tag/index.js +0 -14
- package/build/components/Package/Tag/styles.js +0 -25
- package/build/components/SideBarTittle/SideBarTittle.js +0 -94
- package/build/components/SideBarTittle/index.js +0 -14
- package/build/sections/Header/RegistryInfoDialog/RegistryInfoDialog.js +0 -37
- package/build/sections/Header/RegistryInfoDialog/index.js +0 -14
- package/build/sections/Header/RegistryInfoDialog/styles.js +0 -49
- package/build/sections/Header/RegistryInfoDialog/types.js +0 -6
- package/build/src/components/Dependencies/styles.d.ts +0 -8
- package/build/src/components/Developers/styles.d.ts +0 -11
- package/build/src/components/Distribution/utils.d.ts +0 -7
- package/build/src/components/Package/Tag/Tag.d.ts +0 -6
- package/build/src/components/Package/Tag/index.d.ts +0 -1
- package/build/src/components/Package/Tag/styles.d.ts +0 -5
- package/build/src/components/SideBarTittle/index.d.ts +0 -1
- package/build/src/sections/Header/RegistryInfoDialog/RegistryInfoDialog.d.ts +0 -4
- package/build/src/sections/Header/RegistryInfoDialog/index.d.ts +0 -1
- package/build/src/sections/Header/RegistryInfoDialog/styles.d.ts +0 -13
- package/build/src/sections/Header/RegistryInfoDialog/types.d.ts +0 -7
- package/src/components/Dependencies/styles.ts +0 -26
- package/src/components/Developers/styles.ts +0 -31
- package/src/components/Distribution/utils.ts +0 -32
- package/src/components/Distribution/utilts.spec.ts +0 -17
- package/src/components/Package/Tag/Tag.test.tsx +0 -15
- package/src/components/Package/Tag/Tag.tsx +0 -11
- package/src/components/Package/Tag/index.ts +0 -1
- package/src/components/Package/Tag/styles.ts +0 -11
- package/src/components/Search/AutoComplete/styles.tsx +0 -42
- package/src/components/SideBarTittle/index.ts +0 -1
- package/src/sections/Header/RegistryInfoDialog/RegistryInfoDialog.tsx +0 -31
- package/src/sections/Header/RegistryInfoDialog/index.ts +0 -1
- package/src/sections/Header/RegistryInfoDialog/styles.ts +0 -21
- package/src/sections/Header/RegistryInfoDialog/types.ts +0 -8
- /package/build/components/Icons/DevsIcons/{es6modules.svg → es6module.svg} +0 -0
- /package/build/src/{components/Package/Tag/Tag.test.d.ts → AppTest/AppRoute.test.d.ts} +0 -0
- /package/build/src/components/{SideBarTittle/SideBarTittle.d.ts → SideBarTitle/SideBarTitle.d.ts} +0 -0
- /package/build/src/components/{SideBarTittle/SideBarTittle.stories.d.ts → SideBarTitle/SideBarTitle.stories.d.ts} +0 -0
- /package/build/src/components/{SideBarTittle → SideBarTitle}/utils.d.ts +0 -0
- /package/src/components/Icons/DevsIcons/{es6modules.svg → es6module.svg} +0 -0
- /package/src/components/{SideBarTittle/SideBarTittle.stories.tsx → SideBarTitle/SideBarTitle.stories.tsx} +0 -0
- /package/src/components/{SideBarTittle → SideBarTitle}/utils.ts +0 -0
|
@@ -5,23 +5,28 @@ import { PackageManagers } from '@verdaccio/types';
|
|
|
5
5
|
import { useConfig } from '../../providers';
|
|
6
6
|
import { render, screen } from '../../test/test-react-testing-library';
|
|
7
7
|
import Install from './Install';
|
|
8
|
+
import InstallListItem, { DependencyManager, getGlobalInstall } from './InstallListItem';
|
|
8
9
|
import data from './__partials__/data.json';
|
|
9
10
|
|
|
10
|
-
const ComponentToBeRendered: React.FC<{ pkgManagers?: PackageManagers[] }> = (
|
|
11
|
+
const ComponentToBeRendered: React.FC<{ name?: string; pkgManagers?: PackageManagers[] }> = ({
|
|
12
|
+
name = 'foo',
|
|
13
|
+
}) => {
|
|
11
14
|
const { configOptions } = useConfig();
|
|
12
|
-
return <Install configOptions={configOptions} packageMeta={data} packageName=
|
|
15
|
+
return <Install configOptions={configOptions} packageMeta={data} packageName={name} />;
|
|
13
16
|
};
|
|
14
17
|
|
|
15
18
|
/* eslint-disable react/jsx-no-bind*/
|
|
16
19
|
describe('<Install />', () => {
|
|
17
20
|
test('renders correctly', () => {
|
|
18
21
|
render(<ComponentToBeRendered />);
|
|
19
|
-
expect(screen.getByText('
|
|
20
|
-
expect(screen.getByText('
|
|
21
|
-
expect(screen.getByText('
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
expect(screen.getByText('yarn add foo@8.0.0')).toBeInTheDocument();
|
|
23
|
+
expect(screen.getByText('pnpm install foo@8.0.0')).toBeInTheDocument();
|
|
24
|
+
expect(screen.getByText('npm install foo@8.0.0')).toBeInTheDocument();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('should not render if name is missing', () => {
|
|
28
|
+
render(<ComponentToBeRendered name="" />);
|
|
29
|
+
expect(screen.queryByTestId('installList')).toBeNull();
|
|
25
30
|
});
|
|
26
31
|
|
|
27
32
|
test('should have 3 children', () => {
|
|
@@ -34,51 +39,79 @@ describe('<Install />', () => {
|
|
|
34
39
|
|
|
35
40
|
test('should have the element NPM', () => {
|
|
36
41
|
window.__VERDACCIO_BASENAME_UI_OPTIONS.pkgManagers = ['npm'];
|
|
37
|
-
|
|
38
42
|
render(<ComponentToBeRendered />);
|
|
39
|
-
|
|
40
43
|
expect(screen.getByText('sidebar.installation.title')).toBeTruthy();
|
|
41
|
-
expect(screen.queryByText('
|
|
42
|
-
expect(screen.queryByText('
|
|
43
|
-
expect(screen.getByText('
|
|
44
|
-
expect(screen.getByText('sidebar.installation.install-using-npm-command')).toBeInTheDocument();
|
|
45
|
-
expect(
|
|
46
|
-
screen.queryByText('sidebar.installation.install-using-yarn-command')
|
|
47
|
-
).not.toBeInTheDocument();
|
|
48
|
-
expect(
|
|
49
|
-
screen.queryByText('sidebar.installation.install-using-pnpm-command')
|
|
50
|
-
).not.toBeInTheDocument();
|
|
44
|
+
expect(screen.queryByText('pnpm')).not.toBeInTheDocument();
|
|
45
|
+
expect(screen.queryByText('yarn')).not.toBeInTheDocument();
|
|
46
|
+
expect(screen.getByText('npm install foo@8.0.0')).toBeInTheDocument();
|
|
51
47
|
});
|
|
52
48
|
|
|
53
49
|
test('should have the element YARN', () => {
|
|
54
50
|
window.__VERDACCIO_BASENAME_UI_OPTIONS.pkgManagers = ['yarn'];
|
|
55
51
|
render(<ComponentToBeRendered />);
|
|
56
52
|
expect(screen.getByText('sidebar.installation.title')).toBeTruthy();
|
|
57
|
-
expect(screen.queryByText('
|
|
58
|
-
expect(screen.
|
|
59
|
-
expect(screen.
|
|
60
|
-
expect(
|
|
61
|
-
screen.queryByText('sidebar.installation.install-using-npm-command')
|
|
62
|
-
).not.toBeInTheDocument();
|
|
63
|
-
expect(screen.getByText('sidebar.installation.install-using-yarn-command')).toBeInTheDocument();
|
|
64
|
-
expect(
|
|
65
|
-
screen.queryByText('sidebar.installation.install-using-pnpm-command')
|
|
66
|
-
).not.toBeInTheDocument();
|
|
53
|
+
expect(screen.queryByText('pnpm')).not.toBeInTheDocument();
|
|
54
|
+
expect(screen.queryByText('npm')).not.toBeInTheDocument();
|
|
55
|
+
expect(screen.getByText('yarn add foo@8.0.0')).toBeInTheDocument();
|
|
67
56
|
});
|
|
68
57
|
|
|
69
58
|
test('should have the element PNPM', () => {
|
|
70
59
|
window.__VERDACCIO_BASENAME_UI_OPTIONS.pkgManagers = ['pnpm'];
|
|
71
60
|
render(<ComponentToBeRendered />);
|
|
72
|
-
expect(screen.
|
|
73
|
-
expect(screen.
|
|
74
|
-
expect(screen.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
61
|
+
expect(screen.queryByText('pnpm')).not.toBeInTheDocument();
|
|
62
|
+
expect(screen.queryByText('yarn')).not.toBeInTheDocument();
|
|
63
|
+
expect(screen.getByText('pnpm install foo@8.0.0')).toBeInTheDocument();
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
describe('<InstallListItem />', () => {
|
|
68
|
+
test('renders correctly', () => {
|
|
69
|
+
render(
|
|
70
|
+
<InstallListItem
|
|
71
|
+
dependencyManager={DependencyManager.NPM}
|
|
72
|
+
packageName={'foo'}
|
|
73
|
+
packageVersion={'8.0.0'}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
expect(screen.queryByTestId('installListItem-npm')).toBeInTheDocument();
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test('should not render if name is missing', () => {
|
|
80
|
+
render(
|
|
81
|
+
// @ts-ignore - testing invalid value
|
|
82
|
+
<InstallListItem dependencyManager={'other'} packageName={'foo'} packageVersion={'8.0.0'} />
|
|
83
|
+
);
|
|
84
|
+
// expect nothing to be rendered
|
|
85
|
+
expect(screen.queryByTestId('installListItem-npm')).toBeNull();
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe('getGlobalInstall', () => {
|
|
90
|
+
test('version', () => {
|
|
91
|
+
expect(getGlobalInstall(false, false, '1.0.0', 'foo')).toEqual('foo@1.0.0');
|
|
92
|
+
});
|
|
93
|
+
test('latest', () => {
|
|
94
|
+
expect(getGlobalInstall(true, false, '1.0.0', 'foo')).toEqual('foo');
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
test('version global', () => {
|
|
98
|
+
expect(getGlobalInstall(false, true, '1.0.0', 'foo')).toEqual('-g foo@1.0.0');
|
|
99
|
+
});
|
|
100
|
+
test('latest global', () => {
|
|
101
|
+
expect(getGlobalInstall(true, true, '1.0.0', 'foo')).toEqual('-g foo');
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
test('yarn version', () => {
|
|
105
|
+
expect(getGlobalInstall(false, false, '1.0.0', 'foo', true)).toEqual('foo@1.0.0');
|
|
106
|
+
});
|
|
107
|
+
test('yarn latest', () => {
|
|
108
|
+
expect(getGlobalInstall(true, false, '1.0.0', 'foo', true)).toEqual('foo');
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test('yarn version global', () => {
|
|
112
|
+
expect(getGlobalInstall(false, true, '1.0.0', 'foo', true)).toEqual('foo@1.0.0');
|
|
113
|
+
});
|
|
114
|
+
test('yarn latest global', () => {
|
|
115
|
+
expect(getGlobalInstall(true, true, '1.0.0', 'foo', true)).toEqual('foo');
|
|
83
116
|
});
|
|
84
117
|
});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import { Typography } from '@mui/material';
|
|
3
|
-
import Grid from '@mui/material/Grid';
|
|
4
3
|
import List from '@mui/material/List';
|
|
5
|
-
import { useTheme } from '@mui/styles';
|
|
6
4
|
import React from 'react';
|
|
7
5
|
import { useTranslation } from 'react-i18next';
|
|
8
6
|
|
|
@@ -18,6 +16,12 @@ const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({
|
|
|
18
16
|
textTransform: 'capitalize',
|
|
19
17
|
}));
|
|
20
18
|
|
|
19
|
+
const Wrapper = styled('div')({
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
justifyContent: 'space-between',
|
|
23
|
+
});
|
|
24
|
+
|
|
21
25
|
export type Props = {
|
|
22
26
|
packageMeta: PackageMetaInterface;
|
|
23
27
|
packageName: string;
|
|
@@ -26,8 +30,6 @@ export type Props = {
|
|
|
26
30
|
|
|
27
31
|
const Install: React.FC<Props> = ({ packageMeta, packageName, configOptions }) => {
|
|
28
32
|
const { t } = useTranslation();
|
|
29
|
-
const theme = useTheme();
|
|
30
|
-
|
|
31
33
|
if (!packageMeta || !packageName) {
|
|
32
34
|
return null;
|
|
33
35
|
}
|
|
@@ -39,25 +41,35 @@ const Install: React.FC<Props> = ({ packageMeta, packageName, configOptions }) =
|
|
|
39
41
|
|
|
40
42
|
return hasPkgManagers ? (
|
|
41
43
|
<>
|
|
42
|
-
<Grid
|
|
43
|
-
container={true}
|
|
44
|
-
justifyContent="flex-end"
|
|
45
|
-
sx={{ marginRight: theme.spacing(10), alingText: 'right' }}
|
|
46
|
-
>
|
|
47
|
-
<SettingsMenu packageName={packageName} />
|
|
48
|
-
</Grid>
|
|
49
44
|
<List
|
|
50
45
|
data-testid={'installList'}
|
|
51
|
-
subheader={
|
|
46
|
+
subheader={
|
|
47
|
+
<Wrapper>
|
|
48
|
+
<StyledText variant={'subtitle1'}>{t('sidebar.installation.title')}</StyledText>
|
|
49
|
+
<SettingsMenu packageName={packageName} />
|
|
50
|
+
</Wrapper>
|
|
51
|
+
}
|
|
52
52
|
>
|
|
53
53
|
{hasNpm && (
|
|
54
|
-
<InstallListItem
|
|
54
|
+
<InstallListItem
|
|
55
|
+
dependencyManager={DependencyManager.NPM}
|
|
56
|
+
packageName={packageName}
|
|
57
|
+
packageVersion={packageMeta.latest.version}
|
|
58
|
+
/>
|
|
55
59
|
)}
|
|
56
60
|
{hasYarn && (
|
|
57
|
-
<InstallListItem
|
|
61
|
+
<InstallListItem
|
|
62
|
+
dependencyManager={DependencyManager.YARN}
|
|
63
|
+
packageName={packageName}
|
|
64
|
+
packageVersion={packageMeta.latest.version}
|
|
65
|
+
/>
|
|
58
66
|
)}
|
|
59
67
|
{hasPnpm && (
|
|
60
|
-
<InstallListItem
|
|
68
|
+
<InstallListItem
|
|
69
|
+
dependencyManager={DependencyManager.PNPM}
|
|
70
|
+
packageName={packageName}
|
|
71
|
+
packageVersion={packageMeta.latest.version}
|
|
72
|
+
/>
|
|
61
73
|
)}
|
|
62
74
|
</List>
|
|
63
75
|
</>
|
|
@@ -2,8 +2,8 @@ import styled from '@emotion/styled';
|
|
|
2
2
|
import Avatar from '@mui/material/Avatar';
|
|
3
3
|
import ListItem from '@mui/material/ListItem';
|
|
4
4
|
import ListItemText from '@mui/material/ListItemText';
|
|
5
|
+
import { useTheme } from '@mui/styles';
|
|
5
6
|
import React from 'react';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
7
|
|
|
8
8
|
import { useSettings } from '../../providers/PersistenceSettingProvider';
|
|
9
9
|
import CopyToClipBoard from '../CopyClipboard';
|
|
@@ -22,8 +22,9 @@ const InstallListItemText = styled(ListItemText)({
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
const PackageMangerAvatar = styled(Avatar)({
|
|
25
|
-
|
|
25
|
+
backgroundColor: 'transparent',
|
|
26
26
|
padding: 0,
|
|
27
|
+
marginLeft: 0,
|
|
27
28
|
});
|
|
28
29
|
|
|
29
30
|
export enum DependencyManager {
|
|
@@ -35,78 +36,95 @@ export enum DependencyManager {
|
|
|
35
36
|
interface Interface {
|
|
36
37
|
packageName: string;
|
|
37
38
|
dependencyManager: DependencyManager;
|
|
39
|
+
packageVersion?: string;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
+
export function getGlobalInstall(isLatest, isGlobal, packageVersion, packageName, isYarn = false) {
|
|
43
|
+
const name = isGlobal
|
|
44
|
+
? `${isYarn ? '' : '-g'} ${packageVersion && !isLatest ? `${packageName}@${packageVersion}` : packageName}`
|
|
45
|
+
: packageVersion && !isLatest
|
|
46
|
+
? `${packageName}@${packageVersion}`
|
|
47
|
+
: packageName;
|
|
48
|
+
|
|
49
|
+
return name.trim();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const InstallListItem: React.FC<Interface> = ({
|
|
53
|
+
packageName,
|
|
54
|
+
dependencyManager,
|
|
55
|
+
packageVersion,
|
|
56
|
+
}) => {
|
|
42
57
|
const { localSettings } = useSettings();
|
|
58
|
+
const theme = useTheme();
|
|
59
|
+
const isLatest = localSettings[packageName]?.latest ?? false;
|
|
43
60
|
const isGlobal = localSettings[packageName]?.global ?? false;
|
|
44
|
-
const pkgName = isGlobal ? `-g ${packageName}` : packageName;
|
|
45
|
-
|
|
46
61
|
switch (dependencyManager) {
|
|
47
62
|
case DependencyManager.NPM:
|
|
48
63
|
return (
|
|
49
64
|
<InstallItem data-testid={'installListItem-npm'}>
|
|
50
|
-
<PackageMangerAvatar alt="npm" sx={{ bgcolor:
|
|
65
|
+
<PackageMangerAvatar alt="npm" sx={{ bgcolor: theme.palette.white }}>
|
|
51
66
|
<Npm />
|
|
52
67
|
</PackageMangerAvatar>
|
|
53
68
|
<InstallListItemText
|
|
54
69
|
primary={
|
|
55
70
|
<CopyToClipBoard
|
|
56
|
-
dataTestId="
|
|
57
|
-
text={
|
|
58
|
-
|
|
59
|
-
})}
|
|
60
|
-
title={t('sidebar.installation.install-using-npm-command', {
|
|
61
|
-
packageName: pkgName,
|
|
62
|
-
})}
|
|
71
|
+
dataTestId="installNpm"
|
|
72
|
+
text={`npm install ${getGlobalInstall(isLatest, isGlobal, packageVersion, packageName)}`}
|
|
73
|
+
title={`npm install ${getGlobalInstall(isLatest, isGlobal, packageVersion, packageName)}`}
|
|
63
74
|
/>
|
|
64
75
|
}
|
|
65
|
-
secondary={t('sidebar.installation.install-using-npm')}
|
|
66
76
|
/>
|
|
67
77
|
</InstallItem>
|
|
68
78
|
);
|
|
69
79
|
case DependencyManager.YARN:
|
|
70
80
|
return (
|
|
71
81
|
<InstallItem data-testid={'installListItem-yarn'}>
|
|
72
|
-
<PackageMangerAvatar alt="yarn" sx={{ bgcolor:
|
|
82
|
+
<PackageMangerAvatar alt="yarn" sx={{ bgcolor: theme.palette.white }}>
|
|
73
83
|
<Yarn />
|
|
74
84
|
</PackageMangerAvatar>
|
|
75
85
|
<InstallListItemText
|
|
76
86
|
primary={
|
|
77
87
|
<CopyToClipBoard
|
|
78
88
|
dataTestId="installYarn"
|
|
79
|
-
text={
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
89
|
+
text={
|
|
90
|
+
isGlobal
|
|
91
|
+
? `yarn ${localSettings.yarnModern ? '' : 'global'} add ${getGlobalInstall(
|
|
92
|
+
isGlobal,
|
|
93
|
+
packageVersion,
|
|
94
|
+
packageName,
|
|
95
|
+
true
|
|
96
|
+
)}`
|
|
97
|
+
: `yarn add ${getGlobalInstall(isLatest, isGlobal, packageVersion, packageName, true)}`
|
|
98
|
+
}
|
|
99
|
+
title={
|
|
100
|
+
isGlobal
|
|
101
|
+
? `yarn global add ${getGlobalInstall(
|
|
102
|
+
isGlobal,
|
|
103
|
+
packageVersion,
|
|
104
|
+
packageName,
|
|
105
|
+
true
|
|
106
|
+
)}`
|
|
107
|
+
: `yarn add ${getGlobalInstall(isLatest, isGlobal, packageVersion, packageName, true)}`
|
|
108
|
+
}
|
|
85
109
|
/>
|
|
86
110
|
}
|
|
87
|
-
secondary={t('sidebar.installation.install-using-yarn')}
|
|
88
111
|
/>
|
|
89
112
|
</InstallItem>
|
|
90
113
|
);
|
|
91
114
|
case DependencyManager.PNPM:
|
|
92
115
|
return (
|
|
93
116
|
<InstallItem data-testid={'installListItem-pnpm'}>
|
|
94
|
-
<PackageMangerAvatar alt={'pnpm'} sx={{ bgcolor:
|
|
117
|
+
<PackageMangerAvatar alt={'pnpm'} sx={{ bgcolor: theme.palette.white }}>
|
|
95
118
|
<Pnpm />
|
|
96
119
|
</PackageMangerAvatar>
|
|
97
120
|
<InstallListItemText
|
|
98
121
|
primary={
|
|
99
122
|
<CopyToClipBoard
|
|
100
123
|
dataTestId="installPnpm"
|
|
101
|
-
text={
|
|
102
|
-
|
|
103
|
-
})}
|
|
104
|
-
title={t('sidebar.installation.install-using-pnpm-command', {
|
|
105
|
-
packageName: pkgName,
|
|
106
|
-
})}
|
|
124
|
+
text={`pnpm install ${getGlobalInstall(isLatest, isGlobal, packageVersion, packageName)}`}
|
|
125
|
+
title={`pnpm install ${getGlobalInstall(isLatest, isGlobal, packageVersion, packageName)}`}
|
|
107
126
|
/>
|
|
108
127
|
}
|
|
109
|
-
secondary={t('sidebar.installation.install-using-pnpm')}
|
|
110
128
|
/>
|
|
111
129
|
</InstallItem>
|
|
112
130
|
);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Chip from '@mui/material/Chip';
|
|
2
|
+
import ListItem from '@mui/material/ListItem';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
const KeywordListItems: React.FC<{ keywords: undefined | string | string[] }> = ({ keywords }) => {
|
|
6
|
+
const keywordList =
|
|
7
|
+
typeof keywords === 'string' ? keywords.replace(/,/g, ' ').split(' ') : keywords;
|
|
8
|
+
|
|
9
|
+
if (!keywordList) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<ListItem sx={{ px: 0, mt: 0, flexWrap: 'wrap' }}>
|
|
15
|
+
{keywordList.sort().map((keyword, index) => (
|
|
16
|
+
<Chip key={index} label={keyword} sx={{ mt: 1, mr: 1 }} />
|
|
17
|
+
))}
|
|
18
|
+
</ListItem>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default KeywordListItems;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { default as Keywords } from '.';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/Sidebar/Keywords',
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const AllProperties: any = () => (
|
|
10
|
+
<Keywords
|
|
11
|
+
packageMeta={{
|
|
12
|
+
latest: {
|
|
13
|
+
name: 'verdaccio1',
|
|
14
|
+
version: '4.0.0',
|
|
15
|
+
keywords: ['verdaccio', 'npm', 'yarn'],
|
|
16
|
+
},
|
|
17
|
+
}}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render, screen } from '../../test/test-react-testing-library';
|
|
4
|
+
import Keywords from './Keywords';
|
|
5
|
+
|
|
6
|
+
describe('<Keywords /> component', () => {
|
|
7
|
+
test('should render the component in default state', () => {
|
|
8
|
+
const packageMeta = {
|
|
9
|
+
latest: {
|
|
10
|
+
name: 'verdaccio1',
|
|
11
|
+
version: '4.0.0',
|
|
12
|
+
keywords: ['verdaccio', 'npm', 'yarn'],
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const container = render(<Keywords packageMeta={packageMeta} />);
|
|
17
|
+
|
|
18
|
+
expect(container.getByText('sidebar.keywords.title')).toBeInTheDocument();
|
|
19
|
+
expect(container.getByText('verdaccio')).toBeInTheDocument();
|
|
20
|
+
expect(container.getByText('npm')).toBeInTheDocument();
|
|
21
|
+
expect(container.getByText('yarn')).toBeInTheDocument();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('should not render if data is missing', () => {
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
render(<Keywords packageMeta={{}} />);
|
|
27
|
+
expect(screen.queryByTestId('keyword-list')).toBeNull();
|
|
28
|
+
|
|
29
|
+
const packageMeta = {
|
|
30
|
+
latest: {
|
|
31
|
+
name: 'verdaccio1',
|
|
32
|
+
version: '4.0.0',
|
|
33
|
+
keywords: '',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
render(<Keywords packageMeta={packageMeta} />);
|
|
38
|
+
expect(screen.queryByTestId('keyword-list')).toBeNull();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('should render keywords set in string', () => {
|
|
42
|
+
const packageMeta = {
|
|
43
|
+
latest: {
|
|
44
|
+
name: 'verdaccio1',
|
|
45
|
+
version: '4.0.0',
|
|
46
|
+
keywords: 'hello, world, verdaccio',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const container = render(<Keywords packageMeta={packageMeta} />);
|
|
51
|
+
|
|
52
|
+
expect(container.getByText('sidebar.keywords.title')).toBeInTheDocument();
|
|
53
|
+
expect(container.getByText('verdaccio')).toBeInTheDocument();
|
|
54
|
+
expect(container.getByText('hello')).toBeInTheDocument();
|
|
55
|
+
expect(container.getByText('world')).toBeInTheDocument();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import List from '@mui/material/List';
|
|
2
|
+
import Typography from '@mui/material/Typography';
|
|
3
|
+
import { useTheme } from '@mui/styles';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
|
|
7
|
+
import { PackageMetaInterface } from '../../types/packageMeta';
|
|
8
|
+
import KeywordListItems from './KeywordListItems';
|
|
9
|
+
|
|
10
|
+
const Keywords: React.FC<{ packageMeta: PackageMetaInterface }> = ({ packageMeta }) => {
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
|
|
14
|
+
if (!packageMeta?.latest?.keywords) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<List
|
|
20
|
+
data-testid="keyword-list"
|
|
21
|
+
subheader={
|
|
22
|
+
<Typography
|
|
23
|
+
sx={{ fontWeight: theme.fontWeight.bold, textTransform: 'capitalize' }}
|
|
24
|
+
variant="subtitle1"
|
|
25
|
+
>
|
|
26
|
+
{t('sidebar.keywords.title')}
|
|
27
|
+
</Typography>
|
|
28
|
+
}
|
|
29
|
+
>
|
|
30
|
+
<KeywordListItems keywords={packageMeta?.latest?.keywords} />
|
|
31
|
+
</List>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default Keywords;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Keywords';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BrowserRouter as Router } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
import { render } from '../../test/test-react-testing-library';
|
|
5
|
+
import Link from './Link';
|
|
6
|
+
|
|
7
|
+
describe('<Link /> component', () => {
|
|
8
|
+
test('should render the component in default state', () => {
|
|
9
|
+
const { container } = render(
|
|
10
|
+
<Router>
|
|
11
|
+
<Link to={'/'} />
|
|
12
|
+
</Router>
|
|
13
|
+
);
|
|
14
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('should render the component with link', () => {
|
|
18
|
+
const { container } = render(
|
|
19
|
+
<Router>
|
|
20
|
+
<Link to={'/'}>{'Home'}</Link>
|
|
21
|
+
</Router>
|
|
22
|
+
);
|
|
23
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -3,9 +3,7 @@ import Typography from '@mui/material/Typography';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Link as RouterLink } from 'react-router-dom';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export const CustomRouterLink = styled(RouterLink)`
|
|
6
|
+
const CustomRouterLink = styled(RouterLink)`
|
|
9
7
|
text-decoration: none;
|
|
10
8
|
&:hover,
|
|
11
9
|
&:focus {
|
|
@@ -13,23 +11,11 @@ export const CustomRouterLink = styled(RouterLink)`
|
|
|
13
11
|
}
|
|
14
12
|
`;
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{ external, to, children, variant, className, onClick },
|
|
14
|
+
const Link = React.forwardRef<HTMLAnchorElement, any>(function LinkFunction(
|
|
15
|
+
{ to, children, variant, className, onClick },
|
|
19
16
|
ref
|
|
20
17
|
) {
|
|
21
|
-
return
|
|
22
|
-
<a
|
|
23
|
-
className={className}
|
|
24
|
-
href={to}
|
|
25
|
-
onClick={onClick}
|
|
26
|
-
ref={ref}
|
|
27
|
-
rel="noopener noreferrer"
|
|
28
|
-
target="_blank"
|
|
29
|
-
>
|
|
30
|
-
<Typography variant={variant ?? 'caption'}>{children}</Typography>
|
|
31
|
-
</a>
|
|
32
|
-
) : (
|
|
18
|
+
return (
|
|
33
19
|
<CustomRouterLink className={className} innerRef={ref} onClick={onClick} to={to}>
|
|
34
20
|
<Typography variant={variant}>{children}</Typography>
|
|
35
21
|
</CustomRouterLink>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default
|
|
1
|
+
export { default } from './Link';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render } from '../../test/test-react-testing-library';
|
|
4
|
+
import LinkExternal from './LinkExternal';
|
|
5
|
+
|
|
6
|
+
describe('<LinkExternal /> component', () => {
|
|
7
|
+
test('should render the component in default state', () => {
|
|
8
|
+
const { container } = render(<LinkExternal to={'/'} />);
|
|
9
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('should render the component with external link', () => {
|
|
13
|
+
const { container } = render(
|
|
14
|
+
<LinkExternal to={'https://example.com'}>{'Example'}</LinkExternal>
|
|
15
|
+
);
|
|
16
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Link from '@mui/material/Link';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
const LinkExternal = React.forwardRef<HTMLAnchorElement, any>((props, ref) => {
|
|
5
|
+
const { to, children, variant, ...rest } = props;
|
|
6
|
+
return (
|
|
7
|
+
// eslint-disable-next-line verdaccio/jsx-spread
|
|
8
|
+
<Link
|
|
9
|
+
href={to}
|
|
10
|
+
ref={ref}
|
|
11
|
+
rel="noopener noreferrer"
|
|
12
|
+
target="_blank"
|
|
13
|
+
underline="hover"
|
|
14
|
+
variant={variant ?? 'caption'}
|
|
15
|
+
{...rest}
|
|
16
|
+
>
|
|
17
|
+
{children}
|
|
18
|
+
</Link>
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export default LinkExternal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './LinkExternal';
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { render } from '../../test/test-react-testing-library';
|
|
3
|
+
import { act, render, screen, waitFor } from '../../test/test-react-testing-library';
|
|
4
4
|
import Loading from './Loading';
|
|
5
5
|
|
|
6
6
|
describe('<Loading /> component', () => {
|
|
7
|
-
test('should render the component in default state', () => {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
test('should render the component in default state', async () => {
|
|
8
|
+
act(() => {
|
|
9
|
+
render(<Loading />);
|
|
10
|
+
});
|
|
11
|
+
await waitFor(() => {
|
|
12
|
+
expect(screen.getByTestId('loading')).toBeInTheDocument();
|
|
13
|
+
});
|
|
10
14
|
});
|
|
11
15
|
});
|
|
@@ -11,6 +11,7 @@ export const Wrapper = styled('div')({
|
|
|
11
11
|
|
|
12
12
|
export const Badge = styled('div')<{ theme?: Theme }>(({ theme }) => ({
|
|
13
13
|
margin: '0 0 30px 0',
|
|
14
|
+
padding: 5,
|
|
14
15
|
borderRadius: 25,
|
|
15
16
|
boxShadow: '0 10px 20px 0 rgba(69, 58, 100, 0.2)',
|
|
16
17
|
background: theme?.palette.mode === 'dark' ? theme?.palette.black : '#f7f8f6',
|