@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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { utils } from '../../utils';
|
|
4
|
+
import LinkExternal from '../LinkExternal';
|
|
5
|
+
|
|
6
|
+
const UpLinkLink: React.FC<{ packageName: string; uplinkName: string }> = ({
|
|
7
|
+
packageName,
|
|
8
|
+
uplinkName,
|
|
9
|
+
}) => {
|
|
10
|
+
const link = utils.getUplink(uplinkName, packageName);
|
|
11
|
+
return link ? (
|
|
12
|
+
<LinkExternal to={link} variant="outline">
|
|
13
|
+
{uplinkName}
|
|
14
|
+
</LinkExternal>
|
|
15
|
+
) : (
|
|
16
|
+
<>{uplinkName}</>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default UpLinkLink;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import Chip from '@mui/material/Chip';
|
|
1
2
|
import List from '@mui/material/List';
|
|
2
3
|
import ListItem from '@mui/material/ListItem';
|
|
4
|
+
import { useTheme } from '@mui/styles';
|
|
3
5
|
import React from 'react';
|
|
4
6
|
import { useTranslation } from 'react-i18next';
|
|
5
7
|
|
|
8
|
+
import { useConfig } from '../../providers';
|
|
6
9
|
import { Time, Versions } from '../../types/packageMeta';
|
|
7
|
-
import { utils } from '../../utils';
|
|
8
|
-
import
|
|
10
|
+
import { Route, utils } from '../../utils';
|
|
11
|
+
import Link from '../Link';
|
|
9
12
|
import { ListItemText, Spacer } from './styles';
|
|
10
13
|
|
|
11
14
|
interface Props {
|
|
@@ -14,20 +17,50 @@ interface Props {
|
|
|
14
17
|
time: Time;
|
|
15
18
|
}
|
|
16
19
|
|
|
20
|
+
export function filterDeprecated(versions: Versions) {
|
|
21
|
+
const versionsIds = Object.keys(versions);
|
|
22
|
+
return versionsIds.reduce((prev, current) => {
|
|
23
|
+
if (!versions[current].deprecated) {
|
|
24
|
+
prev[current] = versions[current];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return prev;
|
|
28
|
+
}, {});
|
|
29
|
+
}
|
|
30
|
+
|
|
17
31
|
const VersionsHistoryList: React.FC<Props> = ({ versions, packageName, time }) => {
|
|
18
32
|
const { t } = useTranslation();
|
|
33
|
+
const { configOptions } = useConfig();
|
|
34
|
+
const theme = useTheme();
|
|
35
|
+
const hideDeprecatedVersions = configOptions.hideDeprecatedVersions;
|
|
36
|
+
const listVersions = hideDeprecatedVersions ? filterDeprecated(versions) : versions;
|
|
19
37
|
|
|
20
38
|
return (
|
|
21
39
|
<List dense={true}>
|
|
22
|
-
{Object.keys(
|
|
40
|
+
{Object.keys(listVersions)
|
|
23
41
|
.reverse()
|
|
24
42
|
.map((version) => (
|
|
25
|
-
<ListItem
|
|
26
|
-
|
|
43
|
+
<ListItem
|
|
44
|
+
className="version-item"
|
|
45
|
+
data-testid={`version-${version}`}
|
|
46
|
+
key={version}
|
|
47
|
+
sx={{ pr: 0 }}
|
|
48
|
+
>
|
|
49
|
+
<Link to={`${Route.DETAIL}${packageName}/v/${version}`} variant="outline">
|
|
27
50
|
<ListItemText disableTypography={false} primary={version}></ListItemText>
|
|
28
51
|
</Link>
|
|
52
|
+
{typeof versions[version]?.deprecated === 'string' ? (
|
|
53
|
+
<Chip
|
|
54
|
+
color="warning"
|
|
55
|
+
data-testid="deprecated-badge"
|
|
56
|
+
label={t('versions.deprecated')}
|
|
57
|
+
size="small"
|
|
58
|
+
sx={{ marginLeft: theme.spacing(1) }}
|
|
59
|
+
variant="outlined"
|
|
60
|
+
/>
|
|
61
|
+
) : null}
|
|
29
62
|
<Spacer />
|
|
30
|
-
<ListItemText title={utils.formatDate(time[version])}>
|
|
63
|
+
<ListItemText data-testid={`version-list-text`} title={utils.formatDate(time[version])}>
|
|
31
64
|
{time[version]
|
|
32
65
|
? utils.formatDateDistance(time[version])
|
|
33
66
|
: t('versions.not-available')}
|
|
@@ -3,7 +3,8 @@ import ListItem from '@mui/material/ListItem';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
5
|
import { DistTags, Time } from '../../types/packageMeta';
|
|
6
|
-
import {
|
|
6
|
+
import { Route } from '../../utils';
|
|
7
|
+
import Link from '../Link';
|
|
7
8
|
import { ListItemText, Spacer } from './styles';
|
|
8
9
|
|
|
9
10
|
interface Props {
|
|
@@ -19,8 +20,8 @@ const VersionsTagList: React.FC<Props> = ({ tags, packageName, time }) => (
|
|
|
19
20
|
return time[tags[a]] < time[tags[b]] ? 1 : time[tags[a]] > time[tags[b]] ? -1 : 0;
|
|
20
21
|
})
|
|
21
22
|
.map((tag) => (
|
|
22
|
-
<ListItem className="version-item" data-testid={`tag-${tag}`} key={tag}>
|
|
23
|
-
<Link to={
|
|
23
|
+
<ListItem className="version-item" data-testid={`tag-${tag}`} key={tag} sx={{ pr: 0 }}>
|
|
24
|
+
<Link to={`${Route.DETAIL}${packageName}/v/${tags[tag]}`} variant="outline">
|
|
24
25
|
<ListItemText>{tag}</ListItemText>
|
|
25
26
|
</Link>
|
|
26
27
|
<Spacer />
|
|
@@ -2,23 +2,31 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { MemoryRouter } from 'react-router-dom';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { fireEvent, render, screen } from '../../test/test-react-testing-library';
|
|
6
6
|
import Versions, { Props } from './Versions';
|
|
7
7
|
import data from './__partials__/data.json';
|
|
8
|
+
import dataDeprecated from './__partials__/deprecated-versions.json';
|
|
8
9
|
|
|
9
|
-
const
|
|
10
|
+
const VersionsComponent: React.FC<Props> = (props) => (
|
|
10
11
|
<MemoryRouter>
|
|
11
12
|
<Versions {...props} />
|
|
12
13
|
</MemoryRouter>
|
|
13
14
|
);
|
|
14
15
|
|
|
16
|
+
jest.mock('lodash/debounce', () =>
|
|
17
|
+
jest.fn((fn) => {
|
|
18
|
+
fn.cancel = jest.fn();
|
|
19
|
+
return fn;
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
|
|
15
23
|
describe('<Version /> component', () => {
|
|
16
24
|
afterEach(() => {
|
|
17
|
-
|
|
25
|
+
jest.clearAllMocks();
|
|
18
26
|
});
|
|
19
27
|
|
|
20
28
|
test('should render versions', () => {
|
|
21
|
-
const { getByText } = render(<
|
|
29
|
+
const { getByText } = render(<VersionsComponent packageMeta={data} packageName={'foo'} />);
|
|
22
30
|
|
|
23
31
|
expect(getByText('versions.version-history')).toBeTruthy();
|
|
24
32
|
expect(getByText('versions.current-tags')).toBeTruthy();
|
|
@@ -26,13 +34,38 @@ describe('<Version /> component', () => {
|
|
|
26
34
|
// pick some versions
|
|
27
35
|
expect(getByText('2.3.0')).toBeTruthy();
|
|
28
36
|
expect(getByText('canary')).toBeTruthy();
|
|
37
|
+
// there is one deprecated version deprecated
|
|
38
|
+
expect(screen.queryByTestId('deprecated-badge')).toBeInTheDocument();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('should filter by version', () => {
|
|
42
|
+
render(<VersionsComponent packageMeta={data} packageName={'foo'} />);
|
|
43
|
+
expect(screen.getByText('versions.version-history')).toBeTruthy();
|
|
44
|
+
expect(screen.getByText('versions.current-tags')).toBeTruthy();
|
|
45
|
+
expect(screen.queryAllByTestId('version-list-text')).toHaveLength(65);
|
|
46
|
+
fireEvent.change(screen.getByRole('textbox'), { target: { value: '2.3.0' } });
|
|
47
|
+
expect(screen.queryAllByTestId('version-list-text')).toHaveLength(1);
|
|
48
|
+
fireEvent.change(screen.getByRole('textbox'), { target: { value: '' } });
|
|
49
|
+
expect(screen.queryAllByTestId('version-list-text')).toHaveLength(65);
|
|
29
50
|
});
|
|
30
51
|
|
|
31
52
|
test('should not render versions', () => {
|
|
32
|
-
|
|
53
|
+
render(<VersionsComponent packageMeta={{}} packageName={'foo'} />);
|
|
33
54
|
|
|
34
|
-
expect(queryByText('versions.version-history')).toBeFalsy();
|
|
35
|
-
expect(queryByText('versions.current-tags')).toBeFalsy();
|
|
55
|
+
expect(screen.queryByText('versions.version-history')).toBeFalsy();
|
|
56
|
+
expect(screen.queryByText('versions.current-tags')).toBeFalsy();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('should render versions deprecated settings', () => {
|
|
60
|
+
window.__VERDACCIO_BASENAME_UI_OPTIONS.hideDeprecatedVersions = true;
|
|
61
|
+
const { getByText } = render(
|
|
62
|
+
<VersionsComponent packageMeta={dataDeprecated} packageName={'foo'} />
|
|
63
|
+
);
|
|
64
|
+
expect(getByText('versions.hide-deprecated')).toBeTruthy();
|
|
65
|
+
|
|
66
|
+
// pick some versions
|
|
67
|
+
expect(screen.queryByText('0.0.2')).not.toBeInTheDocument();
|
|
68
|
+
expect(screen.getByText('0.0.1')).toBeInTheDocument();
|
|
36
69
|
});
|
|
37
70
|
|
|
38
71
|
test.todo('should click on version link');
|
|
@@ -1,39 +1,108 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import Alert from '@mui/material/Alert';
|
|
3
|
+
import Box from '@mui/material/Box';
|
|
4
|
+
import Card from '@mui/material/Card';
|
|
5
|
+
import CardContent from '@mui/material/CardContent';
|
|
6
|
+
import TextField from '@mui/material/TextField';
|
|
1
7
|
import Typography from '@mui/material/Typography';
|
|
2
|
-
import
|
|
8
|
+
import { useTheme } from '@mui/styles';
|
|
9
|
+
import debounce from 'lodash/debounce';
|
|
10
|
+
import React, { useState } from 'react';
|
|
3
11
|
import { useTranslation } from 'react-i18next';
|
|
12
|
+
import semver from 'semver';
|
|
4
13
|
|
|
14
|
+
import { Theme } from '../../Theme';
|
|
15
|
+
import { useConfig } from '../../providers';
|
|
5
16
|
import VersionsHistoryList from './HistoryList';
|
|
6
17
|
import VersionsTagList from './TagList';
|
|
7
18
|
|
|
8
19
|
export type Props = { packageMeta: any; packageName: string };
|
|
9
20
|
|
|
21
|
+
export const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({
|
|
22
|
+
fontWeight: props.theme && props.theme.fontWeight.bold,
|
|
23
|
+
textTransform: 'capitalize',
|
|
24
|
+
}));
|
|
25
|
+
|
|
10
26
|
const Versions: React.FC<Props> = ({ packageMeta, packageName }) => {
|
|
11
27
|
const { t } = useTranslation();
|
|
28
|
+
const { configOptions } = useConfig();
|
|
29
|
+
const theme = useTheme();
|
|
30
|
+
const { versions = {}, time = {}, ['dist-tags']: distTags = {} } = packageMeta;
|
|
12
31
|
|
|
13
|
-
|
|
32
|
+
const [packageVersions, setPackageVersions] = useState(versions);
|
|
33
|
+
if (!packageMeta || Object.keys(packageMeta).length === 0) {
|
|
14
34
|
return null;
|
|
15
35
|
}
|
|
36
|
+
const hideDeprecatedVersions = configOptions.hideDeprecatedVersions;
|
|
37
|
+
const hasDistTags = distTags && Object.keys(distTags).length > 0 && packageName;
|
|
38
|
+
const hasVersionHistory =
|
|
39
|
+
packageVersions && Object.keys(packageVersions).length > 0 && packageName;
|
|
16
40
|
|
|
17
|
-
const
|
|
41
|
+
const filterVersions = (textSearch) => {
|
|
42
|
+
const filteredVersions = Object.keys(versions).reduce((acc, version) => {
|
|
43
|
+
if (textSearch !== '') {
|
|
44
|
+
if (typeof versions[version] !== 'undefined') {
|
|
45
|
+
if (semver.satisfies(version, textSearch, { includePrerelease: true, loose: true })) {
|
|
46
|
+
acc[version] = versions[version];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
acc[version] = versions[version];
|
|
51
|
+
}
|
|
52
|
+
return acc;
|
|
53
|
+
}, {});
|
|
18
54
|
|
|
19
|
-
|
|
20
|
-
|
|
55
|
+
setPackageVersions(filteredVersions);
|
|
56
|
+
};
|
|
21
57
|
|
|
22
58
|
return (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
59
|
+
<Card sx={{ mb: 2 }}>
|
|
60
|
+
<CardContent>
|
|
61
|
+
<Box data-testid="versions" sx={{ m: 2 }}>
|
|
62
|
+
{hasDistTags ? (
|
|
63
|
+
<>
|
|
64
|
+
<StyledText variant="subtitle1">
|
|
65
|
+
{t('versions.current-tags')}
|
|
66
|
+
<span>{` (${Object.keys(distTags).length})`}</span>
|
|
67
|
+
</StyledText>
|
|
68
|
+
<VersionsTagList packageName={packageName} tags={distTags} time={time} />
|
|
69
|
+
</>
|
|
70
|
+
) : null}
|
|
71
|
+
<>
|
|
72
|
+
<StyledText variant="subtitle1">
|
|
73
|
+
{t('versions.version-history')}
|
|
74
|
+
<span>{` (${Object.keys(packageVersions).length})`}</span>
|
|
75
|
+
</StyledText>
|
|
76
|
+
<TextField
|
|
77
|
+
helperText={t('versions.search.placeholder')}
|
|
78
|
+
onChange={debounce((e) => {
|
|
79
|
+
filterVersions(e.target.value);
|
|
80
|
+
}, 200)}
|
|
81
|
+
size="small"
|
|
82
|
+
variant="standard"
|
|
83
|
+
width="50%"
|
|
84
|
+
/>
|
|
85
|
+
</>
|
|
86
|
+
{hasVersionHistory ? (
|
|
87
|
+
<>
|
|
88
|
+
{hideDeprecatedVersions === true && (
|
|
89
|
+
<Alert
|
|
90
|
+
severity="info"
|
|
91
|
+
sx={{ marginTop: theme.spacing(1), marginBottom: theme.spacing(1) }}
|
|
92
|
+
>
|
|
93
|
+
{t('versions.hide-deprecated')}
|
|
94
|
+
</Alert>
|
|
95
|
+
)}
|
|
96
|
+
<VersionsHistoryList
|
|
97
|
+
packageName={packageName}
|
|
98
|
+
time={time}
|
|
99
|
+
versions={packageVersions}
|
|
100
|
+
/>
|
|
101
|
+
</>
|
|
102
|
+
) : null}
|
|
103
|
+
</Box>
|
|
104
|
+
</CardContent>
|
|
105
|
+
</Card>
|
|
37
106
|
);
|
|
38
107
|
};
|
|
39
108
|
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
{
|
|
2
|
+
"versions": {
|
|
3
|
+
"0.0.1": {
|
|
4
|
+
"name": "@verdaccio/local-storage",
|
|
5
|
+
"version": "0.0.1",
|
|
6
|
+
"description": "local storage implementation",
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": "npm run lint && mocha --require babel-polyfill --compilers js:babel-core/register ./test/**/*.spec.js",
|
|
10
|
+
"lint": "eslint .",
|
|
11
|
+
"flow": "flow",
|
|
12
|
+
"build": "babel src/ --out-dir lib/ --copy-files",
|
|
13
|
+
"cover": "cross-env NODE_ENV=test nyc npm t"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@verdaccio/file-locking": "^0.0.3",
|
|
17
|
+
"@verdaccio/streams": "^0.0.2",
|
|
18
|
+
"async": "2.5.0",
|
|
19
|
+
"http-errors": "1.4.0",
|
|
20
|
+
"lodash": "4.17.4",
|
|
21
|
+
"mkdirp": "0.5.1"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@verdaccio/types": "0.0.2",
|
|
25
|
+
"babel-cli": "6.24.1",
|
|
26
|
+
"babel-core": "6.25.0",
|
|
27
|
+
"babel-eslint": "^7.2.3",
|
|
28
|
+
"babel-plugin-istanbul": "4.1.4",
|
|
29
|
+
"babel-polyfill": "6.23.0",
|
|
30
|
+
"babel-preset-es2015": "6.24.1",
|
|
31
|
+
"babel-preset-es2015-node4": "2.1.0",
|
|
32
|
+
"babel-preset-flow": "6.23.0",
|
|
33
|
+
"babel-plugin-transform-inline-imports-commonjs": "1.0.0",
|
|
34
|
+
"babel-plugin-array-includes": "2.0.3",
|
|
35
|
+
"babel-plugin-transform-runtime": "6.4.3",
|
|
36
|
+
"cross-env": "5.0.5",
|
|
37
|
+
"eslint": "4.4.1",
|
|
38
|
+
"eslint-config-google": "0.9.1",
|
|
39
|
+
"eslint-plugin-flowtype": "2.35.0",
|
|
40
|
+
"flow-bin": "0.52.0",
|
|
41
|
+
"mocha": "3.5.0",
|
|
42
|
+
"nyc": "11.1.0"
|
|
43
|
+
},
|
|
44
|
+
"nyc": {
|
|
45
|
+
"include": ["src/**/*.js"],
|
|
46
|
+
"all": true,
|
|
47
|
+
"cache": true,
|
|
48
|
+
"sourceMap": false,
|
|
49
|
+
"instrument": false,
|
|
50
|
+
"report-dir": "./tests-report",
|
|
51
|
+
"reporter": ["text", "html"]
|
|
52
|
+
},
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"registry": "https://registry.npmjs.org/"
|
|
55
|
+
},
|
|
56
|
+
"keywords": ["streams"],
|
|
57
|
+
"author": {
|
|
58
|
+
"name": "Juan Picado",
|
|
59
|
+
"email": "juanpicado19@gmail.com"
|
|
60
|
+
},
|
|
61
|
+
"private": false,
|
|
62
|
+
"license": "MIT",
|
|
63
|
+
"gitHead": "e7e4ea74f20331dfde0a7133a02b5b95d68696a9",
|
|
64
|
+
"_id": "@verdaccio/local-storage@0.0.1",
|
|
65
|
+
"_npmVersion": "5.3.0",
|
|
66
|
+
"_nodeVersion": "8.2.1",
|
|
67
|
+
"_npmUser": {
|
|
68
|
+
"name": "jotadeveloper",
|
|
69
|
+
"email": "juanpicado19@gmail.com"
|
|
70
|
+
},
|
|
71
|
+
"dist": {
|
|
72
|
+
"integrity": "sha512-J7qeK3r6jbaMOf4mBIqL1bAdb7Iwb+mC4ZaE9PUE2TctzXSkRRnk2M33zWGhZV0ziEPGAF40wC76wWex2GvXeA==",
|
|
73
|
+
"shasum": "9c71cbeeb922b35efc1b31949d0afa6aac97e9b6",
|
|
74
|
+
"tarball": "http://localhost:4872/@verdaccio%2flocal-storage/-/local-storage-0.0.1.tgz"
|
|
75
|
+
},
|
|
76
|
+
"maintainers": [
|
|
77
|
+
{
|
|
78
|
+
"name": "jotadeveloper",
|
|
79
|
+
"email": "juanpicado19@gmail.com"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"_npmOperationalInternal": {
|
|
83
|
+
"host": "s3://npm-registry-packages",
|
|
84
|
+
"tmp": "tmp/local-storage-0.0.1.tgz_1502536792670_0.3513342353980988"
|
|
85
|
+
},
|
|
86
|
+
"directories": {}
|
|
87
|
+
},
|
|
88
|
+
"0.0.2": {
|
|
89
|
+
"deprecated": "this package is deprecated",
|
|
90
|
+
"name": "@verdaccio/local-storage",
|
|
91
|
+
"version": "0.0.2",
|
|
92
|
+
"description": "local storage implementation",
|
|
93
|
+
"main": "lib/index.js",
|
|
94
|
+
"scripts": {
|
|
95
|
+
"test": "npm run lint && mocha --require babel-polyfill --compilers js:babel-core/register ./test/**/*.spec.js",
|
|
96
|
+
"lint": "eslint .",
|
|
97
|
+
"flow": "flow",
|
|
98
|
+
"build": "babel src/ --out-dir lib/ --copy-files",
|
|
99
|
+
"cover": "cross-env NODE_ENV=test nyc npm t"
|
|
100
|
+
},
|
|
101
|
+
"dependencies": {
|
|
102
|
+
"@verdaccio/file-locking": "^0.0.3",
|
|
103
|
+
"@verdaccio/streams": "^0.0.2",
|
|
104
|
+
"async": "2.5.0",
|
|
105
|
+
"http-errors": "1.4.0",
|
|
106
|
+
"lodash": "4.17.4",
|
|
107
|
+
"mkdirp": "0.5.1"
|
|
108
|
+
},
|
|
109
|
+
"devDependencies": {
|
|
110
|
+
"@verdaccio/types": "0.0.2",
|
|
111
|
+
"babel-cli": "6.24.1",
|
|
112
|
+
"babel-core": "6.25.0",
|
|
113
|
+
"babel-eslint": "^7.2.3",
|
|
114
|
+
"babel-plugin-istanbul": "4.1.4",
|
|
115
|
+
"babel-polyfill": "6.23.0",
|
|
116
|
+
"babel-preset-es2015": "6.24.1",
|
|
117
|
+
"babel-preset-es2015-node4": "2.1.0",
|
|
118
|
+
"babel-preset-flow": "6.23.0",
|
|
119
|
+
"babel-plugin-transform-inline-imports-commonjs": "1.0.0",
|
|
120
|
+
"babel-plugin-array-includes": "2.0.3",
|
|
121
|
+
"babel-plugin-transform-runtime": "6.4.3",
|
|
122
|
+
"cross-env": "5.0.5",
|
|
123
|
+
"eslint": "4.4.1",
|
|
124
|
+
"eslint-config-google": "0.9.1",
|
|
125
|
+
"eslint-plugin-flowtype": "2.35.0",
|
|
126
|
+
"flow-bin": "0.52.0",
|
|
127
|
+
"mocha": "3.5.0",
|
|
128
|
+
"nyc": "11.1.0"
|
|
129
|
+
},
|
|
130
|
+
"nyc": {
|
|
131
|
+
"include": ["src/**/*.js"],
|
|
132
|
+
"all": true,
|
|
133
|
+
"cache": true,
|
|
134
|
+
"sourceMap": false,
|
|
135
|
+
"instrument": false,
|
|
136
|
+
"report-dir": "./tests-report",
|
|
137
|
+
"reporter": ["text", "html"]
|
|
138
|
+
},
|
|
139
|
+
"publishConfig": {
|
|
140
|
+
"registry": "https://registry.npmjs.org/"
|
|
141
|
+
},
|
|
142
|
+
"keywords": ["streams"],
|
|
143
|
+
"author": {
|
|
144
|
+
"name": "Juan Picado",
|
|
145
|
+
"email": "juanpicado19@gmail.com"
|
|
146
|
+
},
|
|
147
|
+
"private": false,
|
|
148
|
+
"license": "MIT",
|
|
149
|
+
"gitHead": "626ea013ee810da9115550e0a60f44aa3d08e9a0",
|
|
150
|
+
"_id": "@verdaccio/local-storage@0.0.2",
|
|
151
|
+
"_npmVersion": "5.3.0",
|
|
152
|
+
"_nodeVersion": "8.2.1",
|
|
153
|
+
"_npmUser": {
|
|
154
|
+
"name": "jotadeveloper",
|
|
155
|
+
"email": "juanpicado19@gmail.com"
|
|
156
|
+
},
|
|
157
|
+
"dist": {
|
|
158
|
+
"integrity": "sha512-Su0cQpLAaBab3qekpcHO+J/JCfoznTuU0P7e5q9T7R2trGVobYXvsTiIB/usQNmDr2e+1N6iBhMst7Uy+231ag==",
|
|
159
|
+
"shasum": "fe79ad6f9ceb631857618038486f729098e7b31b",
|
|
160
|
+
"tarball": "http://localhost:4872/@verdaccio%2flocal-storage/-/local-storage-0.0.2.tgz"
|
|
161
|
+
},
|
|
162
|
+
"maintainers": [
|
|
163
|
+
{
|
|
164
|
+
"name": "jotadeveloper",
|
|
165
|
+
"email": "juanpicado19@gmail.com"
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"_npmOperationalInternal": {
|
|
169
|
+
"host": "s3://npm-registry-packages",
|
|
170
|
+
"tmp": "tmp/local-storage-0.0.2.tgz_1502611253150_0.21545960218645632"
|
|
171
|
+
},
|
|
172
|
+
"directories": {}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { default as CopyClipboard, copyToClipBoardUtility } from './components/CopyClipboard';
|
|
2
2
|
export * from './components/CopyClipboard';
|
|
3
|
-
export { Link } from './components/Link';
|
|
4
3
|
export { default as ActionBar } from './components/ActionBar';
|
|
5
4
|
export { default as Author } from './components/Author';
|
|
6
5
|
export { default as Dependencies } from './components/Dependencies';
|
|
@@ -12,9 +11,13 @@ export { default as FundButton } from './components/FundButton';
|
|
|
12
11
|
export { default as Heading } from './components/Heading';
|
|
13
12
|
export * as Icons from './components/Icons';
|
|
14
13
|
export { default as Install } from './components/Install';
|
|
14
|
+
export { default as Keywords } from './components/Keywords';
|
|
15
|
+
export { default as Link } from './components/Link';
|
|
16
|
+
export { default as LinkExternal } from './components/LinkExternal';
|
|
15
17
|
export { default as RawViewer } from './components/RawViewer';
|
|
18
|
+
export { default as Person } from './components/Person';
|
|
16
19
|
export { default as Readme } from './components/Readme';
|
|
17
|
-
export { default as SideBarTitle } from './components/
|
|
20
|
+
export { default as SideBarTitle } from './components/SideBarTitle';
|
|
18
21
|
export { default as UpLinks } from './components/UpLinks';
|
|
19
22
|
export { default as Versions } from './components/Versions';
|
|
20
23
|
export { default as TextField } from './components/TextField';
|
|
@@ -22,6 +25,7 @@ export { default as Label } from './components/Label';
|
|
|
22
25
|
export { default as Logo } from './components/Logo';
|
|
23
26
|
export { default as MenuItem } from './components/MenuItem';
|
|
24
27
|
export { default as NotFound } from './components/NotFound';
|
|
28
|
+
export { default as Forbidden } from './components/Forbidden';
|
|
25
29
|
export { default as LoginDialog } from './components/LoginDialog';
|
|
26
30
|
export { default as Search } from './components/Search';
|
|
27
31
|
export { default as HeaderInfoDialog } from './components/HeaderInfoDialog';
|
|
@@ -10,11 +10,15 @@ import React, {
|
|
|
10
10
|
import useLocalStorage from '../../hooks/useLocalStorage';
|
|
11
11
|
|
|
12
12
|
type PersistenceSettingsProps = {
|
|
13
|
+
isLatest?: boolean;
|
|
13
14
|
isGlobal?: boolean;
|
|
15
|
+
yarnModern: boolean;
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
const defaultValues: PersistenceSettingsProps = {
|
|
19
|
+
isLatest: false,
|
|
17
20
|
isGlobal: false,
|
|
21
|
+
yarnModern: false,
|
|
18
22
|
};
|
|
19
23
|
|
|
20
24
|
const PersistenceSettingContext = createContext<any>(defaultValues);
|
|
@@ -30,7 +30,7 @@ describe('<Header /> component with logged in state', () => {
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
test('should load data from the provider', async () => {
|
|
33
|
-
|
|
33
|
+
act(() =>
|
|
34
34
|
renderWithStore(
|
|
35
35
|
<MemoryRouter initialEntries={[`/-/web/detail/storybook`]}>
|
|
36
36
|
<Route path={Routes.PACKAGE}>
|
|
@@ -40,8 +40,8 @@ describe('<Header /> component with logged in state', () => {
|
|
|
40
40
|
</Route>
|
|
41
41
|
</MemoryRouter>,
|
|
42
42
|
store
|
|
43
|
-
)
|
|
44
|
-
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
45
|
await waitFor(() => screen.getByText('storybook'));
|
|
46
46
|
expect(screen.getByText('storybook')).toBeInTheDocument();
|
|
47
47
|
expect(screen.getByText('MIT')).toBeInTheDocument();
|
|
@@ -27,3 +27,13 @@ export const DetailJquery: any = () => (
|
|
|
27
27
|
</Route>
|
|
28
28
|
</MemoryRouter>
|
|
29
29
|
);
|
|
30
|
+
|
|
31
|
+
export const DetailForbidden: any = () => (
|
|
32
|
+
<MemoryRouter initialEntries={[`/-/web/detail/JSONStream`]}>
|
|
33
|
+
<Route exact={true} path="/-/web/detail/:package">
|
|
34
|
+
<VersionProvider>
|
|
35
|
+
<Detail />
|
|
36
|
+
</VersionProvider>
|
|
37
|
+
</Route>
|
|
38
|
+
</MemoryRouter>
|
|
39
|
+
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { render } from '../../test/test-react-testing-library';
|
|
3
|
+
import { render, screen } from '../../test/test-react-testing-library';
|
|
4
4
|
import DetailContainer from './Detail';
|
|
5
5
|
|
|
6
6
|
describe('DetailContainer', () => {
|
|
@@ -8,5 +8,12 @@ describe('DetailContainer', () => {
|
|
|
8
8
|
const { container } = render(<DetailContainer />);
|
|
9
9
|
expect(container.firstChild).toMatchSnapshot();
|
|
10
10
|
});
|
|
11
|
+
|
|
12
|
+
test('renders without uplinks', () => {
|
|
13
|
+
window.__VERDACCIO_BASENAME_UI_OPTIONS.showUplinks = false;
|
|
14
|
+
render(<DetailContainer />);
|
|
15
|
+
expect(screen.queryByTestId('uplinks-tab')).toBeFalsy();
|
|
16
|
+
});
|
|
17
|
+
|
|
11
18
|
test.todo('should test click on tabs');
|
|
12
19
|
});
|
|
@@ -2,7 +2,7 @@ import Box from '@mui/material/Box';
|
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
|
|
4
4
|
import Deprecated from '../../components/Deprecated';
|
|
5
|
-
import { useVersion } from '../../providers';
|
|
5
|
+
import { useConfig, useVersion } from '../../providers';
|
|
6
6
|
import ContainerContent from './ContainerContent';
|
|
7
7
|
import Tabs from './Tabs';
|
|
8
8
|
|
|
@@ -14,7 +14,10 @@ export enum TabPosition {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const DetailContainer: React.FC = () => {
|
|
17
|
-
const
|
|
17
|
+
const { configOptions } = useConfig();
|
|
18
|
+
const tabs = configOptions.showUplinks
|
|
19
|
+
? Object.values(TabPosition)
|
|
20
|
+
: Object.values(TabPosition).filter((tab) => tab !== TabPosition.UPLINKS);
|
|
18
21
|
const [tabPosition, setTabPosition] = useState(0);
|
|
19
22
|
const { readMe, packageMeta } = useVersion();
|
|
20
23
|
|
|
@@ -23,8 +26,12 @@ const DetailContainer: React.FC = () => {
|
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
return (
|
|
26
|
-
<Box component="div" display="flex" flexDirection="column" padding={
|
|
27
|
-
<Tabs
|
|
29
|
+
<Box component="div" display="flex" flexDirection="column" padding={0}>
|
|
30
|
+
<Tabs
|
|
31
|
+
onChange={handleChange}
|
|
32
|
+
showUplinks={configOptions.showUplinks}
|
|
33
|
+
tabPosition={tabPosition}
|
|
34
|
+
/>
|
|
28
35
|
{packageMeta?.latest?.deprecated && <Deprecated message={packageMeta?.latest?.deprecated} />}
|
|
29
36
|
<ContainerContent readDescription={readMe} tabPosition={tabs[tabPosition]} />
|
|
30
37
|
</Box>
|