@verdaccio/ui-components 3.0.0-next-7.7 → 3.0.0-next-7.9
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 +14 -0
- package/build/AppTest/AppRoute.js +2 -2
- package/build/AppTest/pages/Front/index.js +1 -1
- package/build/AppTest/pages/Version/Version.js +2 -2
- package/build/AppTest/pages/Version/index.js +1 -1
- package/build/Theme/ResetStyles.js +1 -1
- package/build/Theme/StyleBaseline.js +1 -1
- package/build/Theme/ThemeProvider.js +2 -2
- package/build/Theme/index.js +2 -2
- package/build/Theme/theme.js +3 -3
- package/build/__mocks__/react-markdown.js +1 -1
- package/build/components/ActionBar/ActionBar.js +6 -4
- package/build/components/ActionBar/ActionBarAction.js +10 -9
- package/build/components/ActionBar/index.js +1 -1
- package/build/components/Author/Author.js +14 -43
- package/build/components/Author/index.js +1 -1
- package/build/components/Author/styles.js +1 -1
- package/build/components/CopyClipboard/CopyToClipBoard.js +1 -1
- package/build/components/CopyClipboard/index.js +1 -1
- package/build/components/CopyClipboard/utils.js +3 -12
- package/build/components/Dependencies/Dependencies.js +14 -15
- package/build/components/Dependencies/DependencyBlock.js +6 -5
- package/build/components/Dependencies/index.js +1 -1
- package/build/components/Deprecated/Deprecated.js +1 -1
- package/build/components/Deprecated/index.js +1 -1
- package/build/components/Developers/DeveloperType.js +12 -0
- package/build/components/Developers/Developers.js +22 -24
- package/build/components/Developers/Title.js +6 -10
- package/build/components/Developers/index.js +4 -4
- package/build/components/Distribution/Dist.js +2 -2
- package/build/components/Distribution/index.js +1 -1
- package/build/components/Distribution/styles.js +11 -24
- package/build/components/Engines/Engines.js +9 -3
- package/build/components/Engines/index.js +1 -1
- package/build/components/Engines/styles.js +7 -7
- package/build/components/ErrorBoundary/ErrorBoundary.js +1 -1
- package/build/components/ErrorBoundary/index.js +1 -1
- package/build/components/Forbidden/Forbidden.js +2 -2
- package/build/components/Forbidden/index.js +1 -1
- package/build/components/FundButton/FundButton.js +10 -11
- package/build/components/FundButton/index.js +1 -1
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.js +4 -3
- package/build/components/HeaderInfoDialog/index.js +1 -1
- package/build/components/Heading/Heading.js +3 -3
- package/build/components/Heading/index.js +1 -1
- package/build/components/Help/Help.js +2 -2
- package/build/components/Help/index.js +1 -1
- package/build/components/Help/styles.js +1 -1
- 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 +2 -2
- package/build/components/Icons/FileBinary.js +13 -7
- package/build/components/Icons/Law.js +14 -8
- package/build/components/Icons/License.js +2 -2
- 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 +2 -2
- package/build/components/Icons/Time.js +2 -2
- package/build/components/Icons/Version.js +2 -2
- package/build/components/Install/Install.js +28 -23
- package/build/components/Install/InstallListItem.js +20 -19
- 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 +2 -2
- package/build/components/Label/index.js +1 -1
- package/build/components/Link/Link.js +5 -17
- 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 +1 -1
- package/build/components/Loading/Spinner/Spinner.js +1 -1
- package/build/components/Loading/Spinner/index.js +1 -1
- package/build/components/Loading/index.js +1 -1
- package/build/components/Loading/styles.js +4 -3
- package/build/components/LoginDialog/LoginDialog.js +14 -3
- package/build/components/LoginDialog/LoginDialogCloseButton.js +4 -3
- package/build/components/LoginDialog/LoginDialogForm.js +5 -17
- package/build/components/LoginDialog/LoginDialogFormError.js +5 -4
- package/build/components/LoginDialog/LoginDialogHeader.js +1 -1
- package/build/components/LoginDialog/index.js +1 -1
- package/build/components/Logo/Logo.js +14 -7
- package/build/components/Logo/index.js +1 -1
- package/build/components/MenuItem/MenuItem.js +3 -3
- package/build/components/MenuItem/index.js +1 -1
- package/build/components/NoItems/NoItems.js +1 -1
- package/build/components/NoItems/index.js +1 -1
- package/build/components/NotFound/NotFound.js +2 -2
- package/build/components/NotFound/index.js +1 -1
- package/build/components/Package/Package.js +46 -37
- package/build/components/Package/index.js +1 -1
- package/build/components/Package/styles.js +47 -59
- package/build/components/PackageList/PackageList.js +1 -1
- 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 +12 -6
- package/build/components/RawViewer/index.js +1 -1
- package/build/components/Readme/Readme.js +16 -7
- 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/index.js +1 -1
- package/build/components/Readme/utils.js +3 -6
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js +1 -1
- package/build/components/RegistryInfoDialog/index.js +1 -1
- package/build/components/RegistryInfoDialog/styles.js +10 -11
- package/build/components/Repository/Repository.js +22 -34
- package/build/components/Repository/index.js +1 -1
- package/build/components/Search/AutoComplete/AutoComplete.js +2 -2
- package/build/components/Search/AutoComplete/index.js +1 -1
- package/build/components/Search/AutoComplete/styles.js +5 -42
- package/build/components/Search/Search.js +9 -7
- package/build/components/Search/SearchItem.js +54 -41
- package/build/components/Search/index.js +1 -1
- package/build/components/Search/styles.js +1 -1
- package/build/components/Search/utils.js +23 -0
- package/build/components/SettingsMenu/SettingsMenu.js +36 -10
- package/build/components/SettingsMenu/index.js +1 -1
- package/build/components/SideBarTitle/SideBarTitle.js +17 -7
- package/build/components/SideBarTitle/index.js +1 -1
- package/build/components/SideBarTitle/utils.js +1 -1
- package/build/components/TextField/TextField.js +3 -3
- package/build/components/TextField/index.js +1 -1
- package/build/components/UpLinks/UpLinks.js +36 -7
- package/build/components/UpLinks/UplinkLink.js +22 -0
- package/build/components/UpLinks/index.js +1 -1
- package/build/components/UpLinks/styles.js +6 -5
- package/build/components/Versions/HistoryList.js +9 -6
- package/build/components/Versions/TagList.js +9 -5
- package/build/components/Versions/Versions.js +32 -9
- package/build/components/Versions/index.js +1 -1
- package/build/components/Versions/styles.js +1 -1
- package/build/hooks/index.js +1 -1
- package/build/index.js +29 -5
- package/build/layouts/Version/Version.js +1 -1
- package/build/layouts/Version/index.js +1 -1
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js +3 -2
- package/build/providers/AppConfigurationProvider/index.js +1 -1
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js +3 -2
- package/build/providers/PersistenceSettingProvider/index.js +1 -1
- package/build/providers/TranslatorProvider/TranslatorProvider.js +2 -2
- package/build/providers/TranslatorProvider/TranslatorProvider.spec.js +2 -2
- package/build/providers/TranslatorProvider/index.js +1 -1
- package/build/providers/VersionProvider/VersionProvider.js +2 -2
- package/build/providers/VersionProvider/index.js +1 -1
- package/build/sections/Detail/ContainerContent.js +2 -2
- package/build/sections/Detail/Detail.js +10 -6
- package/build/sections/Detail/ReadmeSection.js +1 -1
- package/build/sections/Detail/Tabs.js +5 -4
- package/build/sections/Detail/index.js +1 -1
- package/build/sections/Footer/Footer.js +38 -9
- package/build/sections/Footer/index.js +1 -1
- package/build/sections/Footer/styles.js +14 -11
- package/build/sections/Header/Header.js +2 -2
- package/build/sections/Header/HeaderGreetings.js +1 -1
- package/build/sections/Header/HeaderLeft.js +15 -18
- package/build/sections/Header/HeaderMenu.js +2 -2
- package/build/sections/Header/HeaderRight.js +14 -5
- package/build/sections/Header/HeaderSettingsDialog.js +4 -4
- package/build/sections/Header/HeaderToolTip.js +1 -1
- package/build/sections/Header/HeaderToolTipIcon.js +2 -2
- package/build/sections/Header/LanguageSwitch.js +4 -4
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +4 -4
- package/build/sections/Header/RegistryInfoContent/index.js +1 -1
- package/build/sections/Header/RegistryInfoContent/styles.js +1 -1
- package/build/sections/Header/index.js +1 -1
- package/build/sections/Header/styles.js +44 -83
- package/build/sections/Home/Home.js +2 -2
- package/build/sections/Home/index.js +1 -1
- package/build/sections/SideBar/Sidebar.js +12 -17
- package/build/sections/SideBar/index.js +1 -1
- package/build/sections/index.js +1 -1
- package/build/src/Theme/ThemeProvider.test.d.ts +1 -0
- package/build/src/components/Author/Author.d.ts +0 -5
- package/build/src/components/CopyClipboard/CopyToClipBoard.test.d.ts +1 -0
- package/build/src/components/Dependencies/Dependencies.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/HeaderInfoDialog/HeaderInfoDialog.test.d.ts +1 -0
- package/build/src/components/Heading/Heading.test.d.ts +1 -0
- package/build/src/components/Icons/Icons.test.d.ts +1 -0
- package/build/src/components/Install/InstallListItem.d.ts +1 -1
- 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 +0 -3
- 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/Logo/Logo.d.ts +1 -0
- package/build/src/components/Logo/Logo.stories.d.ts +5 -0
- package/build/src/components/Package/Package.d.ts +1 -1
- package/build/src/components/Package/styles.d.ts +0 -8
- 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 +0 -1
- package/build/src/components/Search/AutoComplete/styles.d.ts +0 -8
- 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/UpLinks/UplinkLink.d.ts +6 -0
- package/build/src/components/Versions/Versions.d.ts +1 -0
- package/build/src/index.d.ts +4 -1
- package/build/src/sections/Detail/Tabs.d.ts +1 -0
- package/build/src/sections/Header/styles.d.ts +0 -7
- 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 +7 -5
- package/build/src/utils/routes.d.ts +1 -0
- package/build/src/utils/utils.d.ts +1 -0
- package/build/store/api.js +1 -1
- package/build/store/index.js +1 -1
- package/build/store/models/configuration.js +3 -2
- package/build/store/models/download.js +1 -1
- package/build/store/models/login.js +5 -3
- package/build/store/models/manifest.js +6 -4
- package/build/store/models/packages.js +5 -3
- package/build/store/models/routes.js +18 -0
- package/build/store/models/search.js +6 -4
- package/build/store/models/utils.js +10 -0
- package/build/store/storage.js +1 -1
- package/build/store/store.js +1 -1
- package/build/test/i18n-config.js +1 -1
- package/build/test/test-react-testing-library.js +1 -1
- package/build/utils/index.js +2 -2
- package/build/utils/loadable.js +1 -1
- package/build/utils/routes.js +1 -0
- package/build/utils/token.js +1 -1
- package/build/utils/url.js +1 -1
- package/build/utils/utils.js +21 -2
- package/package.json +8 -8
- package/src/AppTest/AppRoute.test.tsx +65 -0
- package/src/Theme/ThemeProvider.test.tsx +27 -0
- package/src/Theme/theme.ts +3 -3
- package/src/components/ActionBar/ActionBar.test.tsx +36 -15
- package/src/components/ActionBar/ActionBar.tsx +1 -1
- package/src/components/ActionBar/ActionBarAction.tsx +8 -5
- package/src/components/Author/Author.test.tsx +7 -1
- package/src/components/Author/Author.tsx +3 -41
- package/src/components/CopyClipboard/CopyToClipBoard.test.tsx +23 -0
- package/src/components/CopyClipboard/utils.ts +2 -13
- package/src/components/Dependencies/Dependencies.tsx +9 -9
- package/src/components/Dependencies/DependencyBlock.tsx +2 -1
- 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 +6 -2
- package/src/components/Engines/styles.ts +1 -1
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +39 -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/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 +54 -13
- package/src/components/Install/Install.tsx +12 -11
- package/src/components/Install/InstallListItem.tsx +12 -11
- 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 -5
- 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/Package/Package.test.tsx +47 -14
- package/src/components/Package/Package.tsx +41 -44
- 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 +8 -4
- package/src/components/Readme/Readme.spec.tsx +17 -0
- package/src/components/Readme/Readme.tsx +10 -5
- package/src/components/Readme/utils.ts +2 -5
- package/src/components/RegistryInfoDialog/styles.ts +5 -4
- package/src/components/Repository/Repository.tsx +9 -14
- package/src/components/Search/AutoComplete/styles.ts +7 -0
- package/src/components/Search/Search.test.tsx +36 -9
- 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 +48 -10
- package/src/components/SideBarTitle/SideBarTitle.tsx +19 -3
- 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 +9 -4
- package/src/components/Versions/TagList.tsx +4 -3
- package/src/components/Versions/Versions.test.tsx +2 -0
- package/src/components/Versions/Versions.tsx +57 -32
- package/src/index.ts +4 -1
- package/src/providers/AppConfigurationProvider/AppConfigurationProvider.tsx +1 -0
- package/src/providers/PersistenceSettingProvider/PersistenceSettingProvider.tsx +2 -0
- package/src/providers/VersionProvider/VersionProvider.test.tsx +3 -3
- package/src/sections/Detail/Detail.test.tsx +8 -1
- package/src/sections/Detail/Detail.tsx +11 -4
- package/src/sections/Detail/Tabs.tsx +5 -2
- 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 +1 -1
- package/src/sections/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +1 -1
- package/src/sections/Header/styles.ts +4 -16
- package/src/sections/Home/Home.test.tsx +12 -4
- package/src/sections/SideBar/Sidebar.test.tsx +20 -13
- package/src/sections/SideBar/Sidebar.tsx +5 -9
- package/src/store/api.test.ts +16 -0
- package/src/store/models/configuration.ts +2 -1
- package/src/store/models/login.ts +10 -12
- package/src/store/models/manifest.ts +6 -5
- 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 +7 -5
- 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/Developers/styles.js +0 -65
- 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 -14
- package/build/components/Package/Tag/index.js +0 -14
- package/build/components/Package/Tag/styles.js +0 -24
- package/build/sections/Header/RegistryInfoDialog/RegistryInfoDialog.js +0 -36
- package/build/sections/Header/RegistryInfoDialog/index.js +0 -14
- package/build/sections/Header/RegistryInfoDialog/styles.js +0 -46
- package/build/sections/Header/RegistryInfoDialog/types.js +0 -6
- 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/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/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/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/src/components/Icons/DevsIcons/{es6modules.svg → es6module.svg} +0 -0
|
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.manifest = void 0;
|
|
7
7
|
var _core = require("@rematch/core");
|
|
8
8
|
var _api = _interopRequireDefault(require("../api"));
|
|
9
|
-
|
|
9
|
+
var _routes = require("./routes");
|
|
10
|
+
var _utils = require("./utils");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
12
|
function isPackageVersionValid(packageMeta, packageVersion) {
|
|
11
13
|
if (!packageVersion || typeof packageVersion === 'undefined') {
|
|
12
14
|
// if is undefined, that means versions does not exist, we continue
|
|
@@ -87,16 +89,16 @@ const manifest = exports.manifest = (0, _core.createModel)()({
|
|
|
87
89
|
packageName,
|
|
88
90
|
packageVersion
|
|
89
91
|
}, state) {
|
|
90
|
-
const basePath = state.configuration.config.base;
|
|
92
|
+
const basePath = (0, _utils.stripTrailingSlash)(state.configuration.config.base);
|
|
91
93
|
try {
|
|
92
|
-
const manifest = await _api.default.request(`${basePath}
|
|
94
|
+
const manifest = await _api.default.request(`${basePath}${_routes.APIRoute.SIDEBAR}${packageName}${packageVersion ? `?v=${packageVersion}` : ''}`);
|
|
93
95
|
|
|
94
96
|
// FIXME: update types accordingly
|
|
95
97
|
// @ts-ignore
|
|
96
98
|
if (!isPackageVersionValid(manifest, packageVersion)) {
|
|
97
99
|
throw new Error('not found');
|
|
98
100
|
}
|
|
99
|
-
const readme = await _api.default.request(`${basePath}
|
|
101
|
+
const readme = await _api.default.request(`${basePath}${_routes.APIRoute.README}${packageName}${packageVersion ? `?v=${packageVersion}` : ''}`);
|
|
100
102
|
dispatch.manifest.saveManifest({
|
|
101
103
|
packageName,
|
|
102
104
|
packageVersion,
|
|
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.packages = void 0;
|
|
7
7
|
var _core = require("@rematch/core");
|
|
8
8
|
var _api = _interopRequireDefault(require("../api"));
|
|
9
|
-
|
|
9
|
+
var _routes = require("./routes");
|
|
10
|
+
var _utils = require("./utils");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
12
|
/**
|
|
11
13
|
*
|
|
12
14
|
* @category Model
|
|
@@ -25,9 +27,9 @@ const packages = exports.packages = (0, _core.createModel)()({
|
|
|
25
27
|
},
|
|
26
28
|
effects: dispatch => ({
|
|
27
29
|
async getPackages(_payload, state) {
|
|
28
|
-
const basePath = state.configuration.config.base;
|
|
30
|
+
const basePath = (0, _utils.stripTrailingSlash)(state.configuration.config.base);
|
|
29
31
|
try {
|
|
30
|
-
const payload = await _api.default.request(`${basePath}
|
|
32
|
+
const payload = await _api.default.request(`${basePath}${_routes.APIRoute.PACKAGES}`);
|
|
31
33
|
dispatch.packages.savePackages(payload);
|
|
32
34
|
} catch (error) {
|
|
33
35
|
// eslint-disable-next-line no-console
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.APIRoute = void 0;
|
|
7
|
+
// Example API request:
|
|
8
|
+
// http://localhost:8000/-/verdaccio/data/package/readme/jquery
|
|
9
|
+
let APIRoute = exports.APIRoute = /*#__PURE__*/function (APIRoute) {
|
|
10
|
+
APIRoute["LOGIN"] = "/-/verdaccio/sec/login";
|
|
11
|
+
APIRoute["CONFIG"] = "/-/verdaccio/packages";
|
|
12
|
+
APIRoute["PACKAGES"] = "/-/verdaccio/data/packages";
|
|
13
|
+
APIRoute["SEARCH"] = "/-/verdaccio/data/search/";
|
|
14
|
+
APIRoute["SIDEBAR"] = "/-/verdaccio/data/sidebar/";
|
|
15
|
+
APIRoute["README"] = "/-/verdaccio/data/package/readme/";
|
|
16
|
+
return APIRoute;
|
|
17
|
+
}({}); // :packageName?v=version
|
|
18
|
+
//# sourceMappingURL=routes.js.map
|
|
@@ -7,7 +7,9 @@ exports.search = void 0;
|
|
|
7
7
|
var _core = require("@rematch/core");
|
|
8
8
|
var _orderBy = _interopRequireDefault(require("lodash/orderBy"));
|
|
9
9
|
var _api = _interopRequireDefault(require("../api"));
|
|
10
|
-
|
|
10
|
+
var _routes = require("./routes");
|
|
11
|
+
var _utils = require("./utils");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
13
|
const CONSTANTS = {
|
|
12
14
|
API_DELAY: 300,
|
|
13
15
|
ABORT_ERROR: 'AbortError'
|
|
@@ -21,7 +23,7 @@ const search = exports.search = (0, _core.createModel)()({
|
|
|
21
23
|
clearRequestQueue(state) {
|
|
22
24
|
const controllers = state.controller;
|
|
23
25
|
controllers.forEach(request => {
|
|
24
|
-
request === null || request === void 0
|
|
26
|
+
request === null || request === void 0 || request.abort();
|
|
25
27
|
});
|
|
26
28
|
return {
|
|
27
29
|
...state,
|
|
@@ -57,7 +59,7 @@ const search = exports.search = (0, _core.createModel)()({
|
|
|
57
59
|
async getSuggestions({
|
|
58
60
|
value
|
|
59
61
|
}, state) {
|
|
60
|
-
const basePath = state.configuration.config.base;
|
|
62
|
+
const basePath = (0, _utils.stripTrailingSlash)(state.configuration.config.base);
|
|
61
63
|
try {
|
|
62
64
|
const controller = new window.AbortController();
|
|
63
65
|
dispatch.search.addControllerToQueue({
|
|
@@ -66,7 +68,7 @@ const search = exports.search = (0, _core.createModel)()({
|
|
|
66
68
|
const signal = controller.signal;
|
|
67
69
|
// https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#Browser_compatibility
|
|
68
70
|
// FUTURE: signal is not well supported for IE and Samsung Browser
|
|
69
|
-
const suggestions = await _api.default.request(`${basePath}
|
|
71
|
+
const suggestions = await _api.default.request(`${basePath}${_routes.APIRoute.SEARCH}${encodeURIComponent(value)}`, 'GET', {
|
|
70
72
|
signal,
|
|
71
73
|
headers: {}
|
|
72
74
|
});
|
package/build/store/storage.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _localstorageMemory = _interopRequireDefault(require("localstorage-memory"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
let storage;
|
|
10
10
|
try {
|
|
11
11
|
localStorage.setItem('__TEST__', '');
|
package/build/store/store.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.store = void 0;
|
|
|
7
7
|
var _core = require("@rematch/core");
|
|
8
8
|
var _loading = _interopRequireDefault(require("@rematch/loading"));
|
|
9
9
|
var _models = require("./models");
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
const store = exports.store = (0, _core.init)({
|
|
12
12
|
models: _models.models,
|
|
13
13
|
plugins: [(0, _loading.default)()]
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _i18next = _interopRequireDefault(require("i18next"));
|
|
8
8
|
var _reactI18next = require("react-i18next");
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
_i18next.default.use(_reactI18next.initReactI18next).init({
|
|
11
11
|
lng: 'en-US',
|
|
12
12
|
whitelist: ['en-US'],
|
|
@@ -29,7 +29,7 @@ var _Theme = require("../Theme");
|
|
|
29
29
|
var _AppConfigurationProvider = _interopRequireDefault(require("../providers/AppConfigurationProvider"));
|
|
30
30
|
var _PersistenceSettingProvider = _interopRequireDefault(require("../providers/PersistenceSettingProvider"));
|
|
31
31
|
var _i18nConfig = _interopRequireDefault(require("./i18n-config"));
|
|
32
|
-
function _interopRequireDefault(
|
|
32
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
33
33
|
const renderWithStore = (ui, store) => (0, _react.render)(ui, {
|
|
34
34
|
wrapper: ({
|
|
35
35
|
children
|
package/build/utils/index.js
CHANGED
|
@@ -69,7 +69,7 @@ Object.keys(_token).forEach(function (key) {
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
|
-
function _interopRequireDefault(
|
|
72
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
73
73
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
74
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
74
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
75
75
|
//# sourceMappingURL=index.js.map
|
package/build/utils/loadable.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
10
|
/* eslint-disable verdaccio/jsx-spread */
|
|
11
11
|
/**
|
|
12
12
|
* With the combination of a bundler, enable to code split a package.
|
package/build/utils/routes.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Route = void 0;
|
|
7
7
|
let Route = exports.Route = /*#__PURE__*/function (Route) {
|
|
8
8
|
Route["ROOT"] = "/";
|
|
9
|
+
Route["DETAIL"] = "/-/web/detail/";
|
|
9
10
|
Route["SCOPE_PACKAGE"] = "/-/web/detail/@:scope/:package";
|
|
10
11
|
Route["SCOPE_PACKAGE_VERSION"] = "/-/web/detail/@:scope/:package/v/:version";
|
|
11
12
|
Route["PACKAGE"] = "/-/web/detail/:package";
|
package/build/utils/token.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.isTokenExpire = isTokenExpire;
|
|
|
7
7
|
var _jsBase = require("js-base64");
|
|
8
8
|
var _isNumber = _interopRequireDefault(require("lodash/isNumber"));
|
|
9
9
|
var _isString = _interopRequireDefault(require("lodash/isString"));
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
function isTokenExpire(token) {
|
|
12
12
|
if (!(0, _isString.default)(token)) {
|
|
13
13
|
return true;
|
package/build/utils/url.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.isEmail = isEmail;
|
|
|
9
9
|
exports.isURL = isURL;
|
|
10
10
|
var _isEmail = _interopRequireDefault(require("validator/lib/isEmail"));
|
|
11
11
|
var _isURL = _interopRequireDefault(require("validator/lib/isURL"));
|
|
12
|
-
function _interopRequireDefault(
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
function isURL(url) {
|
|
14
14
|
return (0, _isURL.default)(url || '', {
|
|
15
15
|
protocols: ['http', 'https', 'git+https', 'git'],
|
package/build/utils/utils.js
CHANGED
|
@@ -12,12 +12,13 @@ exports.formatRepository = formatRepository;
|
|
|
12
12
|
exports.getAuthorName = getAuthorName;
|
|
13
13
|
exports.getLastUpdatedPackageTime = getLastUpdatedPackageTime;
|
|
14
14
|
exports.getRecentReleases = getRecentReleases;
|
|
15
|
+
exports.getUplink = getUplink;
|
|
15
16
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
16
17
|
var _localizedFormat = _interopRequireDefault(require("dayjs/plugin/localizedFormat"));
|
|
17
18
|
var _relativeTime = _interopRequireDefault(require("dayjs/plugin/relativeTime"));
|
|
18
19
|
var _i18next = _interopRequireDefault(require("i18next"));
|
|
19
20
|
var _isString = _interopRequireDefault(require("lodash/isString"));
|
|
20
|
-
function _interopRequireDefault(
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
22
|
const TIMEFORMAT = exports.TIMEFORMAT = 'L LTS';
|
|
22
23
|
_dayjs.default.extend(_relativeTime.default);
|
|
23
24
|
_dayjs.default.extend(_localizedFormat.default);
|
|
@@ -96,7 +97,25 @@ function getAuthorName(authorName) {
|
|
|
96
97
|
}
|
|
97
98
|
return authorName;
|
|
98
99
|
}
|
|
100
|
+
function getUplink(upLinkName, packageName) {
|
|
101
|
+
// TODO: make this a config like "uplinks: npmjs: web: https://www.npmjs.com/package/"
|
|
102
|
+
switch (upLinkName) {
|
|
103
|
+
case 'npmjs':
|
|
104
|
+
return `https://www.npmjs.com/package/${packageName}`;
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
99
108
|
function fileSizeSI(a, b, c, d, e) {
|
|
100
|
-
|
|
109
|
+
b = Math;
|
|
110
|
+
c = b.log;
|
|
111
|
+
d = 1e3;
|
|
112
|
+
e = c(a) / c(d) | 0;
|
|
113
|
+
let size = a / b.pow(d, e);
|
|
114
|
+
// no decimals for Bytes
|
|
115
|
+
if (e === 0) {
|
|
116
|
+
return Math.floor(size) + ' Bytes';
|
|
117
|
+
} else {
|
|
118
|
+
return size.toFixed(1) + ' ' + 'kMGTPEZY'[--e] + 'B';
|
|
119
|
+
}
|
|
101
120
|
}
|
|
102
121
|
//# sourceMappingURL=utils.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/ui-components",
|
|
3
|
-
"version": "3.0.0-next-7.
|
|
3
|
+
"version": "3.0.0-next-7.9",
|
|
4
4
|
"description": "theme ui component",
|
|
5
5
|
"author": "Juan Picado <juanpicado19@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"main": "./build/index.js",
|
|
9
9
|
"types": "build/index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@emotion/react": "
|
|
12
|
-
"@emotion/styled": "
|
|
11
|
+
"@emotion/react": "11.10.6",
|
|
12
|
+
"@emotion/styled": "11.10.6",
|
|
13
13
|
"@fontsource/material-icons": "^4.5.4",
|
|
14
14
|
"@fontsource/roboto": "^4.5.8",
|
|
15
15
|
"@mui/icons-material": "5.15.6",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"normalize.css": "8.0.1",
|
|
34
34
|
"react": "18.2.0",
|
|
35
35
|
"react-dom": "18.2.0",
|
|
36
|
-
"react-hook-form": "7.
|
|
36
|
+
"react-hook-form": "7.50.1",
|
|
37
37
|
"react-i18next": "13.5.0",
|
|
38
38
|
"react-json-view": "1.21.3",
|
|
39
39
|
"react-markdown": "9.0.1",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"validator": "13.11.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@babel/core": "
|
|
50
|
-
"@emotion/babel-plugin": "11.
|
|
49
|
+
"@babel/core": "7.24.9",
|
|
50
|
+
"@emotion/babel-plugin": "11.11.0",
|
|
51
51
|
"@emotion/jest": "11.11.0",
|
|
52
52
|
"@storybook/addon-actions": "^6.5.15",
|
|
53
53
|
"@storybook/addon-essentials": "^6.5.15",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"@types/hast": "^2.0.0",
|
|
64
64
|
"@types/react-router": "^5.1.20",
|
|
65
65
|
"@types/unist": "^2.0.0",
|
|
66
|
-
"@verdaccio/types": "12.0.0-next-7.
|
|
67
|
-
"babel-loader": "
|
|
66
|
+
"@verdaccio/types": "12.0.0-next-7.5",
|
|
67
|
+
"babel-loader": "8.3.0",
|
|
68
68
|
"mockdate": "3.0.5",
|
|
69
69
|
"msw": "0.49.3",
|
|
70
70
|
"typescript": "4.9.5"
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router';
|
|
3
|
+
|
|
4
|
+
import { store } from '../';
|
|
5
|
+
import { act, renderWithStore, screen, waitFor } from '../test/test-react-testing-library';
|
|
6
|
+
import AppRoute from './AppRoute';
|
|
7
|
+
|
|
8
|
+
// force the windows to expand to display items
|
|
9
|
+
// https://github.com/bvaughn/react-virtualized/issues/493#issuecomment-640084107
|
|
10
|
+
jest.spyOn(HTMLElement.prototype, 'offsetHeight', 'get').mockReturnValue(600);
|
|
11
|
+
jest.spyOn(HTMLElement.prototype, 'offsetWidth', 'get').mockReturnValue(600);
|
|
12
|
+
|
|
13
|
+
function appTest(path: string) {
|
|
14
|
+
renderWithStore(
|
|
15
|
+
<MemoryRouter initialEntries={[path]}>
|
|
16
|
+
<AppRoute />
|
|
17
|
+
</MemoryRouter>,
|
|
18
|
+
store
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// See jest/server-handlers.ts for test routes
|
|
23
|
+
describe('AppRoute', () => {
|
|
24
|
+
afterEach(() => {
|
|
25
|
+
jest.clearAllMocks();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('renders Front component for ROOT path', async () => {
|
|
29
|
+
act(() => appTest('/'));
|
|
30
|
+
await waitFor(() => expect(screen.getByTestId('loading')).toBeInTheDocument());
|
|
31
|
+
await waitFor(() => expect(screen.getAllByTestId('package-item-list')).toHaveLength(5));
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('renders VersionPage component for PACKAGE path', async () => {
|
|
35
|
+
act(() => appTest('/-/web/detail/jquery'));
|
|
36
|
+
await waitFor(() => screen.getByTestId('readme-tab'));
|
|
37
|
+
expect(screen.getByTestId('sidebar')).toBeInTheDocument();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('renders VersionPage component for PACKAGE VERSION path', async () => {
|
|
41
|
+
act(() => appTest('/-/web/detail/jquery/v/3.6.3'));
|
|
42
|
+
await waitFor(() => screen.getByTestId('readme-tab'));
|
|
43
|
+
expect(screen.getByTestId('sidebar')).toBeInTheDocument();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('renders Forbidden component for not allowed PACKAGE', async () => {
|
|
47
|
+
act(() => appTest('/-/web/detail/JSONstream'));
|
|
48
|
+
await waitFor(() => screen.getByTestId('not-found-go-to-home-button'));
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test('renders NotFound component for missing PACKAGE', async () => {
|
|
52
|
+
act(() => appTest('/-/web/detail/kleur'));
|
|
53
|
+
await waitFor(() => screen.getByTestId('not-found-go-to-home-button'));
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test('renders NotFound component for non-existing PACKAGE VERSION', async () => {
|
|
57
|
+
act(() => appTest('/-/web/detail/jquery/v/0.9.9'));
|
|
58
|
+
await waitFor(() => screen.getByTestId('not-found-go-to-home-button'));
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('renders NotFound component for non-matching path', async () => {
|
|
62
|
+
act(() => appTest('/oiccadrev'));
|
|
63
|
+
await waitFor(() => screen.getByTestId('not-found-go-to-home-button'));
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
AppConfigurationProvider,
|
|
6
|
+
PersistenceSettingProvider,
|
|
7
|
+
StyleBaseline,
|
|
8
|
+
ThemeProvider,
|
|
9
|
+
} from '../';
|
|
10
|
+
|
|
11
|
+
const AppContainer = () => (
|
|
12
|
+
<AppConfigurationProvider>
|
|
13
|
+
<ThemeProvider>
|
|
14
|
+
<StyleBaseline />
|
|
15
|
+
<PersistenceSettingProvider>
|
|
16
|
+
<div>{'Theme'}</div>
|
|
17
|
+
</PersistenceSettingProvider>
|
|
18
|
+
</ThemeProvider>
|
|
19
|
+
</AppConfigurationProvider>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
describe('ThemeProvider', () => {
|
|
23
|
+
test('should render with theme', async () => {
|
|
24
|
+
render(<AppContainer />);
|
|
25
|
+
await screen.findByText('Theme');
|
|
26
|
+
});
|
|
27
|
+
});
|
package/src/Theme/theme.ts
CHANGED
|
@@ -6,11 +6,11 @@ const colors = {
|
|
|
6
6
|
black: '#000',
|
|
7
7
|
white: '#fff',
|
|
8
8
|
red: '#d32f2f',
|
|
9
|
-
orange: '#
|
|
9
|
+
orange: '#cd4000',
|
|
10
10
|
greySuperLight: '#f5f5f5',
|
|
11
11
|
greyLight: '#d3d3d3',
|
|
12
12
|
greyLight2: '#908ba1',
|
|
13
|
-
greyLight3: '#
|
|
13
|
+
greyLight3: '#f3f4f2',
|
|
14
14
|
greyDark: '#a9a9a9',
|
|
15
15
|
greyDark2: '#586069',
|
|
16
16
|
greyChateau: '#95989a',
|
|
@@ -38,7 +38,7 @@ const themeModes = {
|
|
|
38
38
|
...colors,
|
|
39
39
|
primary: '#ffffff',
|
|
40
40
|
secondary: '#424242',
|
|
41
|
-
background: '#
|
|
41
|
+
background: '#1a202c',
|
|
42
42
|
},
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { store } from '../../store/store';
|
|
4
|
-
import {
|
|
5
|
-
cleanup,
|
|
6
|
-
fireEvent,
|
|
7
|
-
renderWithStore,
|
|
8
|
-
screen,
|
|
9
|
-
waitFor,
|
|
10
|
-
} from '../../test/test-react-testing-library';
|
|
4
|
+
import { cleanup, fireEvent, renderWithStore, screen } from '../../test/test-react-testing-library';
|
|
11
5
|
import ActionBar from './ActionBar';
|
|
12
6
|
|
|
13
7
|
const defaultPackageMeta = {
|
|
14
8
|
_uplinks: {},
|
|
15
9
|
latest: {
|
|
16
|
-
name: 'verdaccio
|
|
17
|
-
version: '
|
|
10
|
+
name: 'verdaccio',
|
|
11
|
+
version: '1.0.0',
|
|
18
12
|
dist: {
|
|
19
|
-
fileCount:
|
|
20
|
-
unpackedSize:
|
|
21
|
-
tarball: 'http://localhost:
|
|
13
|
+
fileCount: 1,
|
|
14
|
+
unpackedSize: 171,
|
|
15
|
+
tarball: 'http://localhost:9000/verdaccio/-/verdaccio-1.0.0.tgz',
|
|
22
16
|
},
|
|
23
17
|
homepage: 'https://verdaccio.org',
|
|
24
18
|
bugs: {
|
|
25
|
-
url: 'https://github.com/verdaccio/
|
|
19
|
+
url: 'https://github.com/verdaccio/verdaccio/issues',
|
|
26
20
|
},
|
|
27
21
|
},
|
|
28
22
|
};
|
|
@@ -39,6 +33,12 @@ describe('<ActionBar /> component', () => {
|
|
|
39
33
|
expect(screen.getByTestId('HomeIcon')).toBeInTheDocument();
|
|
40
34
|
});
|
|
41
35
|
|
|
36
|
+
test('should not render if data is missing', () => {
|
|
37
|
+
// @ts-ignore - testing with missing data
|
|
38
|
+
renderWithStore(<ActionBar packageMeta={undefined} />, store);
|
|
39
|
+
expect(screen.queryByTestId('HomeIcon')).toBeNull();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
42
|
test('when there is no action bar data', () => {
|
|
43
43
|
const packageMeta = {
|
|
44
44
|
...defaultPackageMeta,
|
|
@@ -64,6 +64,14 @@ describe('<ActionBar /> component', () => {
|
|
|
64
64
|
expect(screen.getByLabelText('action-bar-action.download-tarball')).toBeTruthy();
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
+
test('when button to download is disabled', () => {
|
|
68
|
+
renderWithStore(
|
|
69
|
+
<ActionBar packageMeta={defaultPackageMeta} showDownloadTarball={false} />,
|
|
70
|
+
store
|
|
71
|
+
);
|
|
72
|
+
expect(screen.queryByTestId('download-tarball-btn')).not.toBeInTheDocument();
|
|
73
|
+
});
|
|
74
|
+
|
|
67
75
|
test('when there is a button to raw manifest', () => {
|
|
68
76
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={true} />, store);
|
|
69
77
|
expect(screen.getByLabelText('action-bar-action.raw')).toBeTruthy();
|
|
@@ -71,15 +79,28 @@ describe('<ActionBar /> component', () => {
|
|
|
71
79
|
|
|
72
80
|
test('when click button to raw manifest open a dialog with viewer', async () => {
|
|
73
81
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={true} />, store);
|
|
82
|
+
expect(screen.queryByTestId('rawViewer--dialog')).toBeFalsy();
|
|
83
|
+
|
|
74
84
|
fireEvent.click(screen.getByLabelText('action-bar-action.raw'));
|
|
75
|
-
await
|
|
85
|
+
await screen.findByTestId('rawViewer--dialog');
|
|
86
|
+
|
|
87
|
+
fireEvent.click(screen.getByTestId('close-raw-viewer'));
|
|
88
|
+
await screen.getByLabelText('action-bar-action.raw');
|
|
89
|
+
|
|
90
|
+
expect(screen.queryByTestId('rawViewer--dialog')).toBeFalsy();
|
|
76
91
|
});
|
|
77
92
|
|
|
78
93
|
test('should not display download tarball button', () => {
|
|
79
|
-
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={
|
|
94
|
+
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={false} />, store);
|
|
80
95
|
expect(screen.queryByLabelText('Download tarball')).toBeFalsy();
|
|
81
96
|
});
|
|
82
97
|
|
|
98
|
+
test('when click button to download ', async () => {
|
|
99
|
+
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={false} />, store);
|
|
100
|
+
fireEvent.click(screen.getByTestId('download-tarball-btn'));
|
|
101
|
+
await store.getState().loading.models.download;
|
|
102
|
+
});
|
|
103
|
+
|
|
83
104
|
test('should not display show raw button', () => {
|
|
84
105
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={false} />, store);
|
|
85
106
|
expect(screen.queryByLabelText('action-bar-action.raw')).toBeFalsy();
|
|
@@ -41,7 +41,7 @@ const ActionBar: React.FC<Props> = ({ showRaw, showDownloadTarball = true, packa
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
return (
|
|
44
|
-
<Box alignItems="center" display="flex"
|
|
44
|
+
<Box alignItems="center" display="flex" sx={{ my: 2 }}>
|
|
45
45
|
<Stack direction="row" spacing={1}>
|
|
46
46
|
{actions.map((action) => (
|
|
47
47
|
<ActionBarAction key={action.type} {...action} />
|
|
@@ -12,11 +12,14 @@ import { useDispatch, useSelector } from 'react-redux';
|
|
|
12
12
|
|
|
13
13
|
import { Theme } from '../../Theme';
|
|
14
14
|
import { Dispatch, RootState } from '../../store/store';
|
|
15
|
-
import
|
|
15
|
+
import LinkExternal from '../LinkExternal';
|
|
16
16
|
|
|
17
17
|
export const Fab = styled(FabMUI)<{ theme?: Theme }>(({ theme }) => ({
|
|
18
18
|
backgroundColor:
|
|
19
19
|
theme?.palette.mode === 'light' ? theme?.palette.primary.main : theme?.palette.cyanBlue,
|
|
20
|
+
'&:hover': {
|
|
21
|
+
color: theme?.palette.mode === 'light' ? theme?.palette.primary.main : theme?.palette.cyanBlue,
|
|
22
|
+
},
|
|
20
23
|
color: theme?.palette.white,
|
|
21
24
|
}));
|
|
22
25
|
|
|
@@ -42,21 +45,21 @@ const ActionBarAction: React.FC<ActionBarActionProps> = ({ type, link, action })
|
|
|
42
45
|
case 'VISIT_HOMEPAGE':
|
|
43
46
|
return (
|
|
44
47
|
<Tooltip title={t('action-bar-action.visit-home-page') as string}>
|
|
45
|
-
<
|
|
48
|
+
<LinkExternal to={link} variant="button">
|
|
46
49
|
<Fab size="small">
|
|
47
50
|
<HomeIcon />
|
|
48
51
|
</Fab>
|
|
49
|
-
</
|
|
52
|
+
</LinkExternal>
|
|
50
53
|
</Tooltip>
|
|
51
54
|
);
|
|
52
55
|
case 'OPEN_AN_ISSUE':
|
|
53
56
|
return (
|
|
54
57
|
<Tooltip title={t('action-bar-action.open-an-issue') as string}>
|
|
55
|
-
<
|
|
58
|
+
<LinkExternal to={link} variant="button">
|
|
56
59
|
<Fab size="small">
|
|
57
60
|
<BugReportIcon />
|
|
58
61
|
</Fab>
|
|
59
|
-
</
|
|
62
|
+
</LinkExternal>
|
|
60
63
|
</Tooltip>
|
|
61
64
|
);
|
|
62
65
|
case 'DOWNLOAD_TARBALL':
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { cleanup, render } from '../../test/test-react-testing-library';
|
|
3
|
+
import { cleanup, render, screen } from '../../test/test-react-testing-library';
|
|
4
4
|
import { PackageMetaInterface } from '../../types/packageMeta';
|
|
5
5
|
import Authors from './Author';
|
|
6
6
|
|
|
@@ -66,4 +66,10 @@ describe('<Author /> component', () => {
|
|
|
66
66
|
const wrapper = render(withAuthorComponent(packageMeta));
|
|
67
67
|
expect(wrapper).toMatchSnapshot();
|
|
68
68
|
});
|
|
69
|
+
|
|
70
|
+
test('should not render if data is missing', () => {
|
|
71
|
+
// @ts-ignore - testing with missing data
|
|
72
|
+
render(withAuthorComponent(undefined));
|
|
73
|
+
expect(screen.queryByText('sidebar.author.title')).toBeNull();
|
|
74
|
+
});
|
|
69
75
|
});
|