@verdaccio/ui-components 4.0.0-next-8.7 → 4.0.0-next-8.8
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/README.md +1 -1
- package/build/AppTest/AppRoute.js.map +1 -0
- package/build/AppTest/pages/Front/Home.js.map +1 -0
- package/build/AppTest/pages/Front/index.js.map +1 -0
- package/build/AppTest/pages/Version/Version.js.map +1 -0
- package/build/AppTest/pages/Version/index.js.map +1 -0
- package/build/Theme/ResetStyles.js.map +1 -0
- package/build/Theme/StyleBaseline.js.map +1 -0
- package/build/Theme/ThemeProvider.js.map +1 -0
- package/build/Theme/colors.js.map +1 -0
- package/build/Theme/index.js.map +1 -0
- package/build/Theme/theme.d.ts +1 -1
- package/build/Theme/theme.js +1 -1
- package/build/Theme/theme.js.map +1 -0
- package/build/components/ActionBar/ActionBar.js.map +1 -0
- package/build/components/ActionBar/ActionBarAction.js.map +1 -0
- package/build/components/ActionBar/index.js.map +1 -0
- package/build/components/Author/Author.js.map +1 -0
- package/build/components/Author/__snapshots__/Author.test.tsx.snap +257 -0
- package/build/components/Author/index.js.map +1 -0
- package/build/components/Author/styles.js.map +1 -0
- package/build/components/CopyClipboard/CopyToClipBoard.js.map +1 -0
- package/build/components/CopyClipboard/index.js.map +1 -0
- package/build/components/CopyClipboard/utils.js.map +1 -0
- package/build/components/Dependencies/Dependencies.js.map +1 -0
- package/build/components/Dependencies/DependencyBlock.js.map +1 -0
- package/build/components/Dependencies/index.js.map +1 -0
- package/build/components/Dependencies/types.js.map +1 -0
- package/build/components/Dependencies/utits.js.map +1 -0
- package/build/components/Deprecated/Deprecated.js.map +1 -0
- package/build/components/Deprecated/index.js.map +1 -0
- package/build/components/Developers/DeveloperType.js.map +1 -0
- package/build/components/Developers/Developers.js.map +1 -0
- package/build/components/Developers/Title.js.map +1 -0
- package/build/components/Developers/__snapshots__/Developers.test.tsx.snap +416 -0
- package/build/components/Developers/get-unique-developer-values.js.map +1 -0
- package/build/components/Developers/index.js.map +1 -0
- package/build/components/Distribution/Dist.js.map +1 -0
- package/build/components/Distribution/index.js.map +1 -0
- package/build/components/Distribution/styles.js.map +1 -0
- package/build/components/Engines/Engines.js.map +1 -0
- package/build/components/Engines/index.js.map +1 -0
- package/build/components/Engines/styles.js.map +1 -0
- package/build/components/ErrorBoundary/ErrorBoundary.js.map +1 -0
- package/build/components/ErrorBoundary/index.js.map +1 -0
- package/build/components/Forbidden/Forbidden.js.map +1 -0
- package/build/components/Forbidden/index.js.map +1 -0
- package/build/components/FundButton/FundButton.js.map +1 -0
- package/build/components/FundButton/index.js.map +1 -0
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.js.map +1 -0
- package/build/components/HeaderInfoDialog/index.js.map +1 -0
- package/build/components/Heading/Heading.js.map +1 -0
- package/build/components/Heading/index.js.map +1 -0
- package/build/components/Help/Help.js.map +1 -0
- package/build/components/Help/index.js.map +1 -0
- package/build/components/Help/styles.js.map +1 -0
- package/build/components/Icons/DevsIcons/CommonJS.js.map +1 -0
- package/build/components/Icons/DevsIcons/ES6Module.js.map +1 -0
- package/build/components/Icons/DevsIcons/Git.js.map +1 -0
- package/build/components/Icons/DevsIcons/NodeJS.js.map +1 -0
- package/build/components/Icons/DevsIcons/TypeScript.js.map +1 -0
- package/build/components/Icons/DevsIcons/index.js.map +1 -0
- package/build/components/Icons/Earth.js.map +1 -0
- package/build/components/Icons/FileBinary.js.map +1 -0
- package/build/components/Icons/Law.js.map +1 -0
- package/build/components/Icons/Managers/Npm.js.map +1 -0
- package/build/components/Icons/Managers/Pnpm.js.map +1 -0
- package/build/components/Icons/Managers/Yarn.js.map +1 -0
- package/build/components/Icons/Managers/index.js.map +1 -0
- package/build/components/Icons/SvgIcon.js.map +1 -0
- package/build/components/Icons/Time.js.map +1 -0
- package/build/components/Icons/Version.js.map +1 -0
- package/build/components/Icons/index.js.map +1 -0
- package/build/components/Install/Install.js.map +1 -0
- package/build/components/Install/InstallListItem.js.map +1 -0
- package/build/components/Install/__partials__/data.json +5984 -0
- package/build/components/Install/index.js.map +1 -0
- package/build/components/Keywords/KeywordListItems.js.map +1 -0
- package/build/components/Keywords/Keywords.js.map +1 -0
- package/build/components/Keywords/index.js.map +1 -0
- package/build/components/Label/Label.js.map +1 -0
- package/build/components/Label/__snapshots__/Label.test.tsx.snap +9 -0
- package/build/components/Label/index.js.map +1 -0
- package/build/components/Link/Link.js.map +1 -0
- package/build/components/Link/__snapshots__/Link.test.tsx.snap +25 -0
- package/build/components/Link/index.js.map +1 -0
- package/build/components/LinkExternal/LinkExternal.js.map +1 -0
- package/build/components/LinkExternal/__snapshots__/LinkExternal.test.tsx.snap +21 -0
- package/build/components/LinkExternal/index.js.map +1 -0
- package/build/components/Loading/Loading.js.map +1 -0
- package/build/components/Loading/Spinner/Spinner.js.map +1 -0
- package/build/components/Loading/Spinner/__snapshots__/Spinner.test.tsx.snap +110 -0
- package/build/components/Loading/Spinner/index.js.map +1 -0
- package/build/components/Loading/index.js.map +1 -0
- package/build/components/Loading/styles.js.map +1 -0
- package/build/components/LoginDialog/LoginDialog.js.map +1 -0
- package/build/components/LoginDialog/LoginDialogCloseButton.js.map +1 -0
- package/build/components/LoginDialog/LoginDialogForm.js.map +1 -0
- package/build/components/LoginDialog/LoginDialogFormError.js.map +1 -0
- package/build/components/LoginDialog/LoginDialogHeader.js.map +1 -0
- package/build/components/LoginDialog/__snapshots__/LoginDialog.test.tsx.snap +3 -0
- package/build/components/LoginDialog/index.js.map +1 -0
- package/build/components/Logo/Logo.js.map +1 -0
- package/build/components/Logo/__snapshots__/Logo.test.tsx.snap +9 -0
- package/build/components/Logo/index.js.map +1 -0
- package/build/components/MenuItem/MenuItem.js.map +1 -0
- package/build/components/MenuItem/index.js.map +1 -0
- package/build/components/NoItems/NoItems.js.map +1 -0
- package/build/components/NoItems/__snapshots__/Noitems.test.tsx.snap +33 -0
- package/build/components/NoItems/index.js.map +1 -0
- package/build/components/NotFound/NotFound.js.map +1 -0
- package/build/components/NotFound/index.js.map +1 -0
- package/build/components/Package/Package.js.map +1 -0
- package/build/components/Package/index.js.map +1 -0
- package/build/components/Package/styles.js.map +1 -0
- package/build/components/PackageList/PackageList.js.map +1 -0
- package/build/components/PackageList/index.js.map +1 -0
- package/build/components/Person/Person.js.map +1 -0
- package/build/components/Person/PersonTooltip.js.map +1 -0
- package/build/components/Person/index.js.map +1 -0
- package/build/components/Person/utils.js.map +1 -0
- package/build/components/RawViewer/RawViewer.js.map +1 -0
- package/build/components/RawViewer/index.js.map +1 -0
- package/build/components/Readme/index.js.map +1 -0
- package/build/components/Readme/types.js.map +1 -0
- package/build/components/Readme/utils.js.map +1 -0
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js.map +1 -0
- package/build/components/RegistryInfoDialog/index.js.map +1 -0
- package/build/components/RegistryInfoDialog/styles.js.map +1 -0
- package/build/components/RegistryInfoDialog/types.js.map +1 -0
- package/build/components/Repository/Repository.js.map +1 -0
- package/build/components/Repository/__partials__/data.json +5984 -0
- package/build/components/Repository/__snapshots__/Repository.test.tsx.snap +3 -0
- package/build/components/Repository/index.js.map +1 -0
- package/build/components/Search/AutoComplete/AutoComplete.js.map +1 -0
- package/build/components/Search/AutoComplete/index.js.map +1 -0
- package/build/components/Search/AutoComplete/styles.js.map +1 -0
- package/build/components/Search/Search.js.map +1 -0
- package/build/components/Search/SearchItem.js.map +1 -0
- package/build/components/Search/index.js.map +1 -0
- package/build/components/Search/styles.js.map +1 -0
- package/build/components/Search/utils.js.map +1 -0
- package/build/components/SettingsMenu/SettingsMenu.js.map +1 -0
- package/build/components/SettingsMenu/index.js.map +1 -0
- package/build/components/SideBarTitle/SideBarTitle.js.map +1 -0
- package/build/components/SideBarTitle/index.js.map +1 -0
- package/build/components/SideBarTitle/utils.js.map +1 -0
- package/build/components/TextField/TextField.js.map +1 -0
- package/build/components/TextField/__snapshots__/TextField.test.tsx.snap +32 -0
- package/build/components/TextField/index.js.map +1 -0
- package/build/components/UpLinks/UpLinks.js.map +1 -0
- package/build/components/UpLinks/UplinkLink.js.map +1 -0
- package/build/components/UpLinks/__snapshots__/UpLinks.test.tsx.snap +315 -0
- package/build/components/UpLinks/index.js.map +1 -0
- package/build/components/UpLinks/styles.js.map +1 -0
- package/build/components/Versions/HistoryList.js.map +1 -0
- package/build/components/Versions/TagList.js.map +1 -0
- package/build/components/Versions/Versions.js.map +1 -0
- package/build/components/Versions/__partials__/data.json +5985 -0
- package/build/components/Versions/__partials__/deprecated-versions.json +175 -0
- package/build/components/Versions/__partials__/unsorted-versions.json +37 -0
- package/build/components/Versions/index.js.map +1 -0
- package/build/components/Versions/styles.js.map +1 -0
- package/build/components/Versions/types.js.map +1 -0
- package/build/hooks/index.js.map +1 -0
- package/build/hooks/useLocalStorage.js.map +1 -0
- package/build/hooks/useOnClickOutside.js.map +1 -0
- package/build/index.js.map +1 -0
- package/build/layouts/Version/Version.js.map +1 -0
- package/build/layouts/Version/index.js.map +1 -0
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js.map +1 -0
- package/build/providers/AppConfigurationProvider/index.js.map +1 -0
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js.map +1 -0
- package/build/providers/PersistenceSettingProvider/index.js.map +1 -0
- package/build/providers/TranslatorProvider/TranslatorProvider.js.map +1 -0
- package/build/providers/TranslatorProvider/index.js.map +1 -0
- package/build/providers/VersionProvider/VersionProvider.js.map +1 -0
- package/build/providers/VersionProvider/index.js.map +1 -0
- package/build/providers/index.js.map +1 -0
- package/build/sections/Detail/ContainerContent.js.map +1 -0
- package/build/sections/Detail/Detail.js.map +1 -0
- package/build/sections/Detail/ReadmeSection.js.map +1 -0
- package/build/sections/Detail/Tabs.js.map +1 -0
- package/build/sections/Detail/__snapshots__/Detail.test.tsx.snap +82 -0
- package/build/sections/Detail/index.js.map +1 -0
- package/build/sections/Footer/Footer.js.map +1 -0
- package/build/sections/Footer/index.js.map +1 -0
- package/build/sections/Footer/styles.js.map +1 -0
- package/build/sections/Header/Header.js.map +1 -0
- package/build/sections/Header/HeaderGreetings.js.map +1 -0
- package/build/sections/Header/HeaderLeft.js.map +1 -0
- package/build/sections/Header/HeaderMenu.js.map +1 -0
- package/build/sections/Header/HeaderRight.js.map +1 -0
- package/build/sections/Header/HeaderSettingsDialog.js.map +1 -0
- package/build/sections/Header/HeaderToolTip.js.map +1 -0
- package/build/sections/Header/HeaderToolTipIcon.js.map +1 -0
- package/build/sections/Header/LanguageSwitch.js.map +1 -0
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js.map +1 -0
- package/build/sections/Header/RegistryInfoContent/index.js.map +1 -0
- package/build/sections/Header/RegistryInfoContent/styles.js.map +1 -0
- package/build/sections/Header/index.js.map +1 -0
- package/build/sections/Header/styles.js.map +1 -0
- package/build/sections/Home/Home.js.map +1 -0
- package/build/sections/Home/index.js.map +1 -0
- package/build/sections/SideBar/Sidebar.js.map +1 -0
- package/build/sections/SideBar/index.js.map +1 -0
- package/build/sections/index.js.map +1 -0
- package/build/store/api.js.map +1 -0
- package/build/store/index.js.map +1 -0
- package/build/store/models/configuration.js.map +1 -0
- package/build/store/models/download.js.map +1 -0
- package/build/store/models/index.js.map +1 -0
- package/build/store/models/login.js.map +1 -0
- package/build/store/models/manifest.js.map +1 -0
- package/build/store/models/packages.js.map +1 -0
- package/build/store/models/routes.js.map +1 -0
- package/build/store/models/search.js.map +1 -0
- package/build/store/models/utils.js.map +1 -0
- package/build/store/storage.js.map +1 -0
- package/build/store/store.js.map +1 -0
- package/build/test/i18n-config.js.map +1 -0
- package/build/test/test-react-testing-library.js.map +1 -0
- package/build/types/index.js.map +1 -0
- package/build/types/packageMeta.js.map +1 -0
- package/build/utils/__partials__/packageMeta.d.ts +235 -0
- package/build/utils/__partials__/packageMeta.js +528 -0
- package/build/utils/__partials__/packageMeta.js.map +1 -0
- package/build/utils/cli-utils.js.map +1 -0
- package/build/utils/index.js.map +1 -0
- package/build/utils/loadable.js.map +1 -0
- package/build/utils/routes.js.map +1 -0
- package/build/utils/token-generate.js.map +1 -0
- package/build/utils/token.js.map +1 -0
- package/build/utils/url.js.map +1 -0
- package/build/utils/utils.js.map +1 -0
- package/package.json +2 -2
- package/.babelrc +0 -16
- package/.eslintrc +0 -100
- package/CHANGELOG.md +0 -48
- package/src/AppTest/App.stories.tsx +0 -89
- package/src/AppTest/AppRoute.test.tsx +0 -70
- package/src/AppTest/AppRoute.tsx +0 -42
- package/src/AppTest/pages/Front/Home.ts +0 -3
- package/src/AppTest/pages/Front/index.ts +0 -1
- package/src/AppTest/pages/Version/Version.tsx +0 -28
- package/src/AppTest/pages/Version/index.ts +0 -1
- package/src/Theme/ResetStyles.tsx +0 -44
- package/src/Theme/StyleBaseline.tsx +0 -14
- package/src/Theme/ThemeProvider.test.tsx +0 -27
- package/src/Theme/ThemeProvider.tsx +0 -44
- package/src/Theme/colors.ts +0 -1
- package/src/Theme/index.ts +0 -5
- package/src/Theme/theme.ts +0 -179
- package/src/components/ActionBar/ActionBar.stories.tsx +0 -64
- package/src/components/ActionBar/ActionBar.test.tsx +0 -152
- package/src/components/ActionBar/ActionBar.tsx +0 -63
- package/src/components/ActionBar/ActionBarAction.tsx +0 -92
- package/src/components/ActionBar/index.ts +0 -1
- package/src/components/Author/Author.stories.tsx +0 -53
- package/src/components/Author/Author.test.tsx +0 -76
- package/src/components/Author/Author.tsx +0 -30
- package/src/components/Author/index.ts +0 -1
- package/src/components/Author/styles.ts +0 -16
- package/src/components/CopyClipboard/CopyToClipBoard.stories.tsx +0 -20
- package/src/components/CopyClipboard/CopyToClipBoard.test.tsx +0 -24
- package/src/components/CopyClipboard/CopyToClipBoard.tsx +0 -51
- package/src/components/CopyClipboard/index.ts +0 -2
- package/src/components/CopyClipboard/utils.ts +0 -10
- package/src/components/Dependencies/Dependencies.stories.tsx +0 -158
- package/src/components/Dependencies/Dependencies.test.tsx +0 -76
- package/src/components/Dependencies/Dependencies.tsx +0 -72
- package/src/components/Dependencies/DependencyBlock.test.tsx +0 -47
- package/src/components/Dependencies/DependencyBlock.tsx +0 -83
- package/src/components/Dependencies/index.ts +0 -1
- package/src/components/Dependencies/types.ts +0 -7
- package/src/components/Dependencies/utits.ts +0 -3
- package/src/components/Deprecated/Deprecated.stories.tsx +0 -9
- package/src/components/Deprecated/Deprecated.test.tsx +0 -26
- package/src/components/Deprecated/Deprecated.tsx +0 -20
- package/src/components/Deprecated/index.ts +0 -1
- package/src/components/Developers/DeveloperType.tsx +0 -4
- package/src/components/Developers/Developers.stories.tsx +0 -60
- package/src/components/Developers/Developers.test.tsx +0 -129
- package/src/components/Developers/Developers.tsx +0 -82
- package/src/components/Developers/Title.tsx +0 -28
- package/src/components/Developers/get-unique-developer-values.ts +0 -16
- package/src/components/Developers/index.ts +0 -2
- package/src/components/Distribution/Dist.stories.tsx +0 -67
- package/src/components/Distribution/Dist.test.tsx +0 -99
- package/src/components/Distribution/Dist.tsx +0 -56
- package/src/components/Distribution/index.ts +0 -1
- package/src/components/Distribution/styles.ts +0 -23
- package/src/components/Engines/Engines.stories.tsx +0 -71
- package/src/components/Engines/Engines.test.tsx +0 -57
- package/src/components/Engines/Engines.tsx +0 -99
- package/src/components/Engines/index.ts +0 -1
- package/src/components/Engines/styles.ts +0 -14
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +0 -40
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +0 -38
- package/src/components/ErrorBoundary/index.ts +0 -1
- package/src/components/Forbidden/Forbidden.test.tsx +0 -39
- package/src/components/Forbidden/Forbidden.tsx +0 -56
- package/src/components/Forbidden/index.ts +0 -1
- package/src/components/FundButton/FundButton.stories.tsx +0 -56
- package/src/components/FundButton/FundButton.test.tsx +0 -84
- package/src/components/FundButton/FundButton.tsx +0 -48
- package/src/components/FundButton/index.ts +0 -1
- package/src/components/HeaderInfoDialog/HeaderInfoDialog.test.tsx +0 -52
- package/src/components/HeaderInfoDialog/HeaderInfoDialog.tsx +0 -82
- package/src/components/HeaderInfoDialog/index.ts +0 -1
- package/src/components/Heading/Heading.test.tsx +0 -20
- package/src/components/Heading/Heading.tsx +0 -16
- package/src/components/Heading/index.ts +0 -1
- package/src/components/Help/Help.stories.tsx +0 -9
- package/src/components/Help/Help.test.tsx +0 -18
- package/src/components/Help/Help.tsx +0 -54
- package/src/components/Help/index.ts +0 -1
- package/src/components/Help/styles.ts +0 -7
- package/src/components/Icons/.eslintrc +0 -5
- package/src/components/Icons/DevsIcons/CommonJS.tsx +0 -7
- package/src/components/Icons/DevsIcons/ES6Module.tsx +0 -7
- package/src/components/Icons/DevsIcons/Git.tsx +0 -7
- package/src/components/Icons/DevsIcons/NodeJS.tsx +0 -7
- package/src/components/Icons/DevsIcons/TypeScript.tsx +0 -7
- package/src/components/Icons/DevsIcons/commonjs.svg +0 -4
- package/src/components/Icons/DevsIcons/es6module.svg +0 -4
- package/src/components/Icons/DevsIcons/git.svg +0 -4
- package/src/components/Icons/DevsIcons/index.ts +0 -5
- package/src/components/Icons/DevsIcons/nodejs.svg +0 -6
- package/src/components/Icons/DevsIcons/typescript.svg +0 -4
- package/src/components/Icons/Earth.tsx +0 -36
- package/src/components/Icons/FileBinary.tsx +0 -21
- package/src/components/Icons/Icons.stories.tsx +0 -53
- package/src/components/Icons/Icons.test.tsx +0 -70
- package/src/components/Icons/Law.tsx +0 -21
- package/src/components/Icons/License.tsx +0 -18
- package/src/components/Icons/Managers/Npm.tsx +0 -7
- package/src/components/Icons/Managers/Pnpm.tsx +0 -7
- package/src/components/Icons/Managers/Yarn.tsx +0 -7
- package/src/components/Icons/Managers/index.ts +0 -3
- package/src/components/Icons/Managers/npm.svg +0 -15
- package/src/components/Icons/Managers/pnpm.svg +0 -1
- package/src/components/Icons/Managers/yarn.svg +0 -1
- package/src/components/Icons/SvgIcon.tsx +0 -39
- package/src/components/Icons/Time.tsx +0 -19
- package/src/components/Icons/Version.tsx +0 -20
- package/src/components/Icons/index.ts +0 -8
- package/src/components/Install/Install.stories.tsx +0 -87
- package/src/components/Install/Install.test.tsx +0 -117
- package/src/components/Install/Install.tsx +0 -79
- package/src/components/Install/InstallListItem.tsx +0 -137
- package/src/components/Install/index.ts +0 -1
- package/src/components/Keywords/KeywordListItems.tsx +0 -22
- package/src/components/Keywords/Keywords.stories.tsx +0 -19
- package/src/components/Keywords/Keywords.test.tsx +0 -57
- package/src/components/Keywords/Keywords.tsx +0 -36
- package/src/components/Keywords/index.ts +0 -1
- package/src/components/Label/Label.test.tsx +0 -14
- package/src/components/Label/Label.tsx +0 -36
- package/src/components/Label/index.ts +0 -1
- package/src/components/Link/Link.test.tsx +0 -25
- package/src/components/Link/Link.tsx +0 -25
- package/src/components/Link/index.ts +0 -1
- package/src/components/LinkExternal/LinkExternal.test.tsx +0 -18
- package/src/components/LinkExternal/LinkExternal.tsx +0 -22
- package/src/components/LinkExternal/index.ts +0 -1
- package/src/components/Loading/Loading.stories.tsx +0 -14
- package/src/components/Loading/Loading.test.tsx +0 -15
- package/src/components/Loading/Loading.tsx +0 -16
- package/src/components/Loading/Spinner/Spinner.test.tsx +0 -13
- package/src/components/Loading/Spinner/Spinner.tsx +0 -34
- package/src/components/Loading/Spinner/index.tsx +0 -1
- package/src/components/Loading/index.ts +0 -1
- package/src/components/Loading/styles.ts +0 -18
- package/src/components/LoginDialog/LoginDialog.stories.tsx +0 -20
- package/src/components/LoginDialog/LoginDialog.test.tsx +0 -109
- package/src/components/LoginDialog/LoginDialog.tsx +0 -88
- package/src/components/LoginDialog/LoginDialogCloseButton.tsx +0 -33
- package/src/components/LoginDialog/LoginDialogForm.tsx +0 -94
- package/src/components/LoginDialog/LoginDialogFormError.tsx +0 -42
- package/src/components/LoginDialog/LoginDialogHeader.tsx +0 -48
- package/src/components/LoginDialog/index.ts +0 -1
- package/src/components/Logo/Logo.stories.tsx +0 -16
- package/src/components/Logo/Logo.test.tsx +0 -18
- package/src/components/Logo/Logo.tsx +0 -71
- package/src/components/Logo/img/logo-black-and-white.svg +0 -1
- package/src/components/Logo/img/logo.svg +0 -1
- package/src/components/Logo/index.ts +0 -1
- package/src/components/MenuItem/MenuItem.tsx +0 -25
- package/src/components/MenuItem/index.ts +0 -1
- package/src/components/NoItems/NoItems.stories.tsx +0 -11
- package/src/components/NoItems/NoItems.tsx +0 -15
- package/src/components/NoItems/Noitems.test.tsx +0 -15
- package/src/components/NoItems/index.ts +0 -1
- package/src/components/NotFound/NotFound.tsx +0 -53
- package/src/components/NotFound/Notfound.test.tsx +0 -40
- package/src/components/NotFound/img/package.svg +0 -1
- package/src/components/NotFound/index.ts +0 -1
- package/src/components/Package/Package.test.tsx +0 -96
- package/src/components/Package/Package.tsx +0 -266
- package/src/components/Package/index.ts +0 -2
- package/src/components/Package/styles.ts +0 -93
- package/src/components/PackageList/PackageList.tsx +0 -81
- package/src/components/PackageList/Packagelist.test.tsx +0 -60
- package/src/components/PackageList/index.ts +0 -1
- package/src/components/Person/Person.test.tsx +0 -50
- package/src/components/Person/Person.tsx +0 -45
- package/src/components/Person/PersonTooltip.tsx +0 -26
- package/src/components/Person/index.ts +0 -1
- package/src/components/Person/utils.ts +0 -20
- package/src/components/RawViewer/RawViewer.tsx +0 -73
- package/src/components/RawViewer/index.ts +0 -1
- package/src/components/Readme/Readme.test.tsx +0 -35
- package/src/components/Readme/Readme.tsx +0 -46
- package/src/components/Readme/github-markdown.css +0 -1198
- package/src/components/Readme/index.ts +0 -1
- package/src/components/Readme/types.ts +0 -3
- package/src/components/Readme/utils.ts +0 -26
- package/src/components/RegistryInfoDialog/RegistryInfoDialog.tsx +0 -31
- package/src/components/RegistryInfoDialog/index.ts +0 -1
- package/src/components/RegistryInfoDialog/styles.ts +0 -22
- package/src/components/RegistryInfoDialog/types.ts +0 -8
- package/src/components/Repository/Repository.stories.tsx +0 -70
- package/src/components/Repository/Repository.test.tsx +0 -43
- package/src/components/Repository/Repository.tsx +0 -81
- package/src/components/Repository/index.ts +0 -1
- package/src/components/Search/AutoComplete/AutoComplete.tsx +0 -83
- package/src/components/Search/AutoComplete/index.ts +0 -1
- package/src/components/Search/AutoComplete/styles.ts +0 -7
- package/src/components/Search/Search.stories.tsx +0 -52
- package/src/components/Search/Search.test.tsx +0 -181
- package/src/components/Search/Search.tsx +0 -168
- package/src/components/Search/SearchItem.tsx +0 -125
- package/src/components/Search/index.ts +0 -1
- package/src/components/Search/styles.ts +0 -41
- package/src/components/Search/utils.ts +0 -17
- package/src/components/SettingsMenu/SettingsMenu.test.tsx +0 -41
- package/src/components/SettingsMenu/SettingsMenu.tsx +0 -124
- package/src/components/SettingsMenu/index.ts +0 -1
- package/src/components/SideBarTitle/SideBarTitle.stories.tsx +0 -81
- package/src/components/SideBarTitle/SideBarTitle.tsx +0 -100
- package/src/components/SideBarTitle/index.ts +0 -1
- package/src/components/SideBarTitle/utils.ts +0 -12
- package/src/components/TextField/TextField.test.tsx +0 -15
- package/src/components/TextField/TextField.tsx +0 -24
- package/src/components/TextField/index.ts +0 -1
- package/src/components/UpLinks/UpLinks.test.tsx +0 -54
- package/src/components/UpLinks/UpLinks.tsx +0 -64
- package/src/components/UpLinks/UplinkLink.tsx +0 -20
- package/src/components/UpLinks/Uplinks.stories.tsx +0 -47
- package/src/components/UpLinks/index.ts +0 -1
- package/src/components/UpLinks/styles.ts +0 -25
- package/src/components/Versions/HistoryList.tsx +0 -83
- package/src/components/Versions/TagList.tsx +0 -34
- package/src/components/Versions/Versions.test.tsx +0 -83
- package/src/components/Versions/Versions.tsx +0 -109
- package/src/components/Versions/index.ts +0 -1
- package/src/components/Versions/styles.ts +0 -20
- package/src/components/Versions/types.ts +0 -17
- package/src/hooks/index.ts +0 -2
- package/src/hooks/useLocalStorage.ts +0 -49
- package/src/hooks/useOnClickOutside.ts +0 -33
- package/src/index.ts +0 -66
- package/src/layouts/Version/Version.stories.tsx +0 -70
- package/src/layouts/Version/Version.tsx +0 -19
- package/src/layouts/Version/index.ts +0 -1
- package/src/providers/AppConfigurationProvider/AppConfigurationProvider.tsx +0 -75
- package/src/providers/AppConfigurationProvider/index.ts +0 -1
- package/src/providers/PersistenceSettingProvider/PersistenceSettingProvider.tsx +0 -61
- package/src/providers/PersistenceSettingProvider/index.ts +0 -1
- package/src/providers/TranslatorProvider/TranslatorProvider.test.tsx +0 -53
- package/src/providers/TranslatorProvider/TranslatorProvider.tsx +0 -54
- package/src/providers/TranslatorProvider/index.ts +0 -2
- package/src/providers/VersionProvider/README.md +0 -22
- package/src/providers/VersionProvider/VersionProvider.test.tsx +0 -49
- package/src/providers/VersionProvider/VersionProvider.tsx +0 -95
- package/src/providers/VersionProvider/index.ts +0 -1
- package/src/providers/index.ts +0 -3
- package/src/sections/Detail/ContainerContent.tsx +0 -46
- package/src/sections/Detail/Detail.stories.tsx +0 -70
- package/src/sections/Detail/Detail.test.tsx +0 -19
- package/src/sections/Detail/Detail.tsx +0 -41
- package/src/sections/Detail/ReadmeSection.tsx +0 -17
- package/src/sections/Detail/Tabs.tsx +0 -33
- package/src/sections/Detail/index.ts +0 -1
- package/src/sections/Footer/Footer.test.tsx +0 -20
- package/src/sections/Footer/Footer.tsx +0 -126
- package/src/sections/Footer/index.ts +0 -1
- package/src/sections/Footer/styles.ts +0 -48
- package/src/sections/Header/Header.stories.tsx +0 -59
- package/src/sections/Header/Header.test.tsx +0 -280
- package/src/sections/Header/Header.tsx +0 -79
- package/src/sections/Header/HeaderGreetings.tsx +0 -21
- package/src/sections/Header/HeaderLeft.tsx +0 -37
- package/src/sections/Header/HeaderMenu.tsx +0 -63
- package/src/sections/Header/HeaderRight.tsx +0 -142
- package/src/sections/Header/HeaderSettingsDialog.tsx +0 -80
- package/src/sections/Header/HeaderToolTip.tsx +0 -15
- package/src/sections/Header/HeaderToolTipIcon.tsx +0 -87
- package/src/sections/Header/LanguageSwitch.tsx +0 -99
- package/src/sections/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +0 -26
- package/src/sections/Header/RegistryInfoContent/RegistryInfoContent.tsx +0 -191
- package/src/sections/Header/RegistryInfoContent/index.ts +0 -1
- package/src/sections/Header/RegistryInfoContent/styles.ts +0 -13
- package/src/sections/Header/index.ts +0 -1
- package/src/sections/Header/styles.ts +0 -88
- package/src/sections/Home/Home.stories.tsx +0 -33
- package/src/sections/Home/Home.test.tsx +0 -41
- package/src/sections/Home/Home.tsx +0 -21
- package/src/sections/Home/index.ts +0 -1
- package/src/sections/SideBar/Sidebar.stories.tsx +0 -64
- package/src/sections/SideBar/Sidebar.test.tsx +0 -75
- package/src/sections/SideBar/Sidebar.tsx +0 -69
- package/src/sections/SideBar/index.ts +0 -1
- package/src/sections/index.ts +0 -2
- package/src/store/api.test.ts +0 -157
- package/src/store/api.ts +0 -80
- package/src/store/index.ts +0 -4
- package/src/store/models/configuration.ts +0 -47
- package/src/store/models/download.ts +0 -33
- package/src/store/models/index.ts +0 -18
- package/src/store/models/login.test.ts +0 -48
- package/src/store/models/login.ts +0 -104
- package/src/store/models/manifest.ts +0 -117
- package/src/store/models/packages.ts +0 -42
- package/src/store/models/routes.ts +0 -10
- package/src/store/models/search.ts +0 -88
- package/src/store/models/utils.ts +0 -3
- package/src/store/storage.ts +0 -12
- package/src/store/store.ts +0 -15
- package/src/test/i18n-config.ts +0 -19
- package/src/test/test-react-testing-library.tsx +0 -45
- package/src/types/external-modules.d.ts +0 -2
- package/src/types/index.ts +0 -11
- package/src/types/packageMeta.ts +0 -95
- package/src/utils/.eslintrc +0 -5
- package/src/utils/cli-utils.test.ts +0 -67
- package/src/utils/cli-utils.ts +0 -53
- package/src/utils/index.ts +0 -11
- package/src/utils/loadable.tsx +0 -20
- package/src/utils/routes.ts +0 -8
- package/src/utils/token-generate.ts +0 -33
- package/src/utils/token.test.ts +0 -55
- package/src/utils/token.ts +0 -33
- package/src/utils/url.test.ts +0 -32
- package/src/utils/url.ts +0 -73
- package/src/utils/utils.test.ts +0 -146
- package/src/utils/utils.ts +0 -135
- package/tsconfig.build.json +0 -23
- package/tsconfig.json +0 -22
- package/vitest.config.mjs +0 -40
package/src/utils/cli-utils.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { SyntheticEvent } from 'react';
|
|
2
|
-
|
|
3
|
-
export const copyToClipBoardUtility =
|
|
4
|
-
(str: string): ((e: SyntheticEvent<HTMLElement>) => void) =>
|
|
5
|
-
(event: SyntheticEvent<HTMLElement>): void => {
|
|
6
|
-
event.preventDefault();
|
|
7
|
-
|
|
8
|
-
const node = document.createElement('div');
|
|
9
|
-
node.innerText = str;
|
|
10
|
-
if (document.body) {
|
|
11
|
-
document.body.appendChild(node);
|
|
12
|
-
|
|
13
|
-
const range = document.createRange();
|
|
14
|
-
const selection = window.getSelection() as Selection;
|
|
15
|
-
range.selectNodeContents(node);
|
|
16
|
-
selection.removeAllRanges();
|
|
17
|
-
selection.addRange(range);
|
|
18
|
-
document.execCommand('copy');
|
|
19
|
-
document.body.removeChild(node);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export function getCLISetConfigRegistry(
|
|
24
|
-
command: string,
|
|
25
|
-
scope: string | undefined,
|
|
26
|
-
registryUrl: string
|
|
27
|
-
): string {
|
|
28
|
-
// if there is a scope defined there needs to be a ":" separator between the scope and the registry
|
|
29
|
-
return `${command} ${scope ? `${scope}:` : ''}registry ${registryUrl}`;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function getCLISetRegistry(command: string, registryUrl: string): string {
|
|
33
|
-
return `${command} --registry ${registryUrl}`;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function getCLIChangePassword(command: string, registryUrl: string): string {
|
|
37
|
-
return `${command} profile set password --registry ${registryUrl}`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function getCLISBerryYamlRegistry(scope: string | undefined, registryUrl: string): string {
|
|
41
|
-
return !scope
|
|
42
|
-
? `// .yarnrc.yml
|
|
43
|
-
npmRegistryServer: "${registryUrl}"
|
|
44
|
-
unsafeHttpWhitelist:
|
|
45
|
-
- ${new URL(registryUrl).host}`
|
|
46
|
-
: `
|
|
47
|
-
// .yarnrc.yml
|
|
48
|
-
npmRegistryServer: "${registryUrl}"
|
|
49
|
-
npmScopes:
|
|
50
|
-
${scope.replace('@', '')}:
|
|
51
|
-
npmRegistryServer: ${registryUrl}
|
|
52
|
-
npmPublishRegistry: ${registryUrl}`;
|
|
53
|
-
}
|
package/src/utils/index.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * as url from './url';
|
|
2
|
-
export * as utils from './utils';
|
|
3
|
-
export {
|
|
4
|
-
getCLIChangePassword,
|
|
5
|
-
getCLISBerryYamlRegistry,
|
|
6
|
-
getCLISetConfigRegistry,
|
|
7
|
-
getCLISetRegistry,
|
|
8
|
-
} from './cli-utils';
|
|
9
|
-
export { default as loadable } from './loadable';
|
|
10
|
-
export { Route } from './routes';
|
|
11
|
-
export * from './token';
|
package/src/utils/loadable.tsx
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* eslint-disable verdaccio/jsx-spread */
|
|
2
|
-
import React, { Suspense, lazy } from 'react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* With the combination of a bundler, enable to code split a package.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
```jsx
|
|
9
|
-
const VersionPage = loadable(() => import(/'../pages/Version'));
|
|
10
|
-
```
|
|
11
|
-
@category HOC
|
|
12
|
-
*/
|
|
13
|
-
export default (importCallback: any) => {
|
|
14
|
-
const TargetComponent = lazy(importCallback);
|
|
15
|
-
return (props: any) => (
|
|
16
|
-
<Suspense fallback={null}>
|
|
17
|
-
<TargetComponent {...props} />
|
|
18
|
-
</Suspense>
|
|
19
|
-
);
|
|
20
|
-
};
|
package/src/utils/routes.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export enum Route {
|
|
2
|
-
ROOT = '/',
|
|
3
|
-
DETAIL = '/-/web/detail/',
|
|
4
|
-
SCOPE_PACKAGE = '/-/web/detail/@:scope/:package',
|
|
5
|
-
SCOPE_PACKAGE_VERSION = '/-/web/detail/@:scope/:package/v/:version',
|
|
6
|
-
PACKAGE = '/-/web/detail/:package',
|
|
7
|
-
PACKAGE_VERSION = '/-/web/detail/:package/v/:version',
|
|
8
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Token Utility
|
|
3
|
-
*/
|
|
4
|
-
import dayjs from 'dayjs';
|
|
5
|
-
|
|
6
|
-
function encodeBase64(string: string) {
|
|
7
|
-
return Buffer.from(string).toString('base64');
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function generateTokenWithTimeRange(amount = 0) {
|
|
11
|
-
const payload = {
|
|
12
|
-
username: 'verdaccio',
|
|
13
|
-
exp: Number.parseInt(String(dayjs(new Date()).add(amount, 'hour').valueOf() / 1000), 10),
|
|
14
|
-
};
|
|
15
|
-
return `xxxxxx.${encodeBase64(JSON.stringify(payload))}.xxxxxx`;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function generateTokenWithExpirationAsString() {
|
|
19
|
-
const payload = { username: 'verdaccio', exp: 'I am not a number' };
|
|
20
|
-
return `xxxxxx.${encodeBase64(JSON.stringify(payload))}.xxxxxx`;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function generateInvalidToken() {
|
|
24
|
-
const payload = `invalidtoken`;
|
|
25
|
-
return `xxxxxx.${encodeBase64(payload)}.xxxxxx`;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function generateTokenWithOutExpiration() {
|
|
29
|
-
const payload = {
|
|
30
|
-
username: 'verdaccio',
|
|
31
|
-
};
|
|
32
|
-
return `xxxxxx.${encodeBase64(JSON.stringify(payload))}.xxxxxx`;
|
|
33
|
-
}
|
package/src/utils/token.test.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { vi } from 'vitest';
|
|
2
|
-
|
|
3
|
-
import { isTokenExpire } from './token';
|
|
4
|
-
import {
|
|
5
|
-
generateInvalidToken,
|
|
6
|
-
generateTokenWithExpirationAsString,
|
|
7
|
-
generateTokenWithOutExpiration,
|
|
8
|
-
generateTokenWithTimeRange,
|
|
9
|
-
} from './token-generate';
|
|
10
|
-
|
|
11
|
-
/* eslint-disable no-console */
|
|
12
|
-
console.error = vi.fn();
|
|
13
|
-
|
|
14
|
-
describe('isTokenExpire', (): void => {
|
|
15
|
-
test('isTokenExpire - null is not a valid payload', (): void => {
|
|
16
|
-
expect(isTokenExpire(null)).toBeTruthy();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
test('isTokenExpire - token is not a valid payload', (): void => {
|
|
20
|
-
expect(isTokenExpire('not_a_valid_token')).toBeTruthy();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
test('isTokenExpire - token should not expire in 24 hrs range', (): void => {
|
|
24
|
-
const token = generateTokenWithTimeRange(24);
|
|
25
|
-
expect(isTokenExpire(token)).toBeFalsy();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
test('isTokenExpire - token should expire for current time', (): void => {
|
|
29
|
-
const token = generateTokenWithTimeRange();
|
|
30
|
-
expect(isTokenExpire(token)).toBeTruthy();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
test('isTokenExpire - token expiration is not available', (): void => {
|
|
34
|
-
const token = generateTokenWithOutExpiration();
|
|
35
|
-
expect(isTokenExpire(token)).toBeTruthy();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
test('isTokenExpire - token is not a valid json token', (): void => {
|
|
39
|
-
const NODE_MAJOR_VERSION = +process.versions.node.split('.')[0];
|
|
40
|
-
const errorToken = new SyntaxError(
|
|
41
|
-
NODE_MAJOR_VERSION >= 20
|
|
42
|
-
? 'Unexpected token \'i\', "invalidtoken" is not valid JSON'
|
|
43
|
-
: 'Unexpected token i in JSON at position 0'
|
|
44
|
-
);
|
|
45
|
-
const token = generateInvalidToken();
|
|
46
|
-
const result = ['Invalid token:', errorToken, 'xxxxxx.aW52YWxpZHRva2Vu.xxxxxx'];
|
|
47
|
-
expect(isTokenExpire(token)).toBeTruthy();
|
|
48
|
-
expect(console.error).toHaveBeenCalledWith(...result);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test('isTokenExpire - token expiration is not a number', (): void => {
|
|
52
|
-
const token = generateTokenWithExpirationAsString();
|
|
53
|
-
expect(isTokenExpire(token)).toBeTruthy();
|
|
54
|
-
});
|
|
55
|
-
});
|
package/src/utils/token.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Base64 } from 'js-base64';
|
|
2
|
-
import isNumber from 'lodash/isNumber';
|
|
3
|
-
import isString from 'lodash/isString';
|
|
4
|
-
|
|
5
|
-
export function isTokenExpire(token: string | null): boolean {
|
|
6
|
-
if (!isString(token)) {
|
|
7
|
-
return true;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const [, payload] = token.split('.');
|
|
11
|
-
|
|
12
|
-
if (!payload) {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
let exp: number;
|
|
17
|
-
try {
|
|
18
|
-
exp = JSON.parse(Base64.decode(payload)).exp;
|
|
19
|
-
} catch (error: any) {
|
|
20
|
-
// eslint-disable-next-line no-console
|
|
21
|
-
console.error('Invalid token:', error, token);
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (!exp || !isNumber(exp)) {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
// Report as expire before (real expire time - 30s)
|
|
29
|
-
const jsTimestamp = exp * 1000 - 30000;
|
|
30
|
-
const expired = Date.now() >= jsTimestamp;
|
|
31
|
-
|
|
32
|
-
return expired;
|
|
33
|
-
}
|
package/src/utils/url.test.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { extractFileName, isEmail, isURL } from './url';
|
|
2
|
-
|
|
3
|
-
describe('utils', () => {
|
|
4
|
-
describe('url', () => {
|
|
5
|
-
test('isURL() - should return true for localhost', () => {
|
|
6
|
-
expect(isURL('http://localhost:8080/bootstrap/-/bootstrap-4.3.1.tgz')).toBeTruthy();
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
test('isURL() - should return false when protocol is missing', () => {
|
|
10
|
-
expect(isURL('localhost:8080/bootstrap/-/bootstrap-4.3.1.tgz')).toBeFalsy();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
test('isEmail() - should return true if valid', () => {
|
|
14
|
-
expect(isEmail('email@domain.com')).toBeTruthy();
|
|
15
|
-
});
|
|
16
|
-
test('isEmail() - should return false if invalid', () => {
|
|
17
|
-
expect(isEmail('')).toBeFalsy();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
test('git repo is valid', () => {
|
|
21
|
-
expect(isURL('git://github.com/verdaccio/ui.git')).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
describe('extractFileName', () => {
|
|
26
|
-
test('should return the file name', () => {
|
|
27
|
-
expect(extractFileName('http://localhost:4872/juan_test_webpack1/-/test-10.0.0.tgz')).toBe(
|
|
28
|
-
'test-10.0.0.tgz'
|
|
29
|
-
);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
});
|
package/src/utils/url.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import isEmailValidator from 'validator/lib/isEmail';
|
|
2
|
-
import isURLValidator from 'validator/lib/isURL';
|
|
3
|
-
|
|
4
|
-
export function isURL(url: string): boolean {
|
|
5
|
-
return isURLValidator(url || '', {
|
|
6
|
-
protocols: ['http', 'https', 'git+https', 'git'],
|
|
7
|
-
require_protocol: true,
|
|
8
|
-
require_tld: false,
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function isEmail(email: string): boolean {
|
|
13
|
-
return isEmailValidator(email || '');
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function extractFileName(url: string): string {
|
|
17
|
-
return url.substring(url.lastIndexOf('/') + 1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function blobToFile(blob: Blob, fileName: string): File {
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
const b: any = blob;
|
|
23
|
-
b.lastModified = Date.now();
|
|
24
|
-
b.name = fileName;
|
|
25
|
-
return b as File;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function downloadFile(fileStream: Blob, fileName: string): void {
|
|
29
|
-
let file: File;
|
|
30
|
-
// File constructor is not supported by Edge
|
|
31
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/File#Browser_compatibility
|
|
32
|
-
// @ts-ignore. Please see: https://github.com/microsoft/TypeScript/issues/33792
|
|
33
|
-
if (navigator.msSaveBlob) {
|
|
34
|
-
// Detect if Edge
|
|
35
|
-
file = blobToFile(new Blob([fileStream], { type: 'application/octet-stream' }), fileName);
|
|
36
|
-
} else {
|
|
37
|
-
file = new File([fileStream], fileName, {
|
|
38
|
-
type: 'application/octet-stream',
|
|
39
|
-
lastModified: Date.now(),
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const objectURL = URL.createObjectURL(file);
|
|
44
|
-
const fileLink = document.createElement('a');
|
|
45
|
-
fileLink.href = objectURL;
|
|
46
|
-
fileLink.download = fileName;
|
|
47
|
-
|
|
48
|
-
// Skip actual download in test environment to avoid JSDOM navigation error
|
|
49
|
-
// Check if we're in a test environment (JSDOM)
|
|
50
|
-
const isTestEnvironment =
|
|
51
|
-
(typeof window !== 'undefined' &&
|
|
52
|
-
window.navigator &&
|
|
53
|
-
window.navigator.userAgent &&
|
|
54
|
-
window.navigator.userAgent.includes('Node.js')) ||
|
|
55
|
-
window.navigator.userAgent.includes('jsdom');
|
|
56
|
-
|
|
57
|
-
if (!isTestEnvironment) {
|
|
58
|
-
// Without appending to an HTML Element, download dialog does not show up on Firefox
|
|
59
|
-
// https://github.com/verdaccio/ui/issues/119
|
|
60
|
-
document.documentElement.appendChild(fileLink);
|
|
61
|
-
fileLink.click();
|
|
62
|
-
// firefox requires remove the object url
|
|
63
|
-
setTimeout(() => {
|
|
64
|
-
URL.revokeObjectURL(objectURL);
|
|
65
|
-
document.documentElement.removeChild(fileLink);
|
|
66
|
-
}, 150);
|
|
67
|
-
} else {
|
|
68
|
-
// In test environment, just clean up without triggering navigation
|
|
69
|
-
setTimeout(() => {
|
|
70
|
-
URL.revokeObjectURL(objectURL);
|
|
71
|
-
}, 150);
|
|
72
|
-
}
|
|
73
|
-
}
|
package/src/utils/utils.test.ts
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import MockDate from 'mockdate';
|
|
2
|
-
|
|
3
|
-
import { packageMeta } from './__partials__/packageMeta';
|
|
4
|
-
import {
|
|
5
|
-
fileSizeSI,
|
|
6
|
-
formatDate,
|
|
7
|
-
formatDateDistance,
|
|
8
|
-
formatLicense,
|
|
9
|
-
formatRepository,
|
|
10
|
-
getLastUpdatedPackageTime,
|
|
11
|
-
getRecentReleases,
|
|
12
|
-
getUplink,
|
|
13
|
-
} from './utils';
|
|
14
|
-
|
|
15
|
-
describe('formatLicense', (): void => {
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
MockDate.set(new Date());
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
afterEach(() => {
|
|
21
|
-
MockDate.reset();
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
test('should check license field different values', (): void => {
|
|
25
|
-
expect(formatLicense('MIT')).toEqual('MIT');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
test('should check license field for object value', (): void => {
|
|
29
|
-
const license = { type: 'ISC', url: 'https://opensource.org/licenses/ISC' };
|
|
30
|
-
expect(formatLicense(license)).toEqual('ISC');
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
test('should check license field for other value', (): void => {
|
|
34
|
-
expect(formatLicense(null)).toBeUndefined();
|
|
35
|
-
expect(formatLicense({})).toBeUndefined();
|
|
36
|
-
expect(formatLicense([])).toBeUndefined();
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
describe('formatRepository', (): void => {
|
|
41
|
-
test('should check repository field different values', (): void => {
|
|
42
|
-
const repository = 'https://github.com/verdaccio/verdaccio';
|
|
43
|
-
expect(formatRepository(repository)).toEqual(repository);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
test('should check repository field for object value', (): void => {
|
|
47
|
-
const license = {
|
|
48
|
-
type: 'git',
|
|
49
|
-
url: 'https://github.com/verdaccio/verdaccio',
|
|
50
|
-
};
|
|
51
|
-
expect(formatRepository(license)).toEqual(license.url);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
test('should check repository field for other value', (): void => {
|
|
55
|
-
expect(formatRepository(null)).toBeNull();
|
|
56
|
-
expect(formatRepository({})).toBeNull();
|
|
57
|
-
expect(formatRepository([])).toBeNull();
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
describe('formatDate', (): void => {
|
|
62
|
-
test('should format the date', (): void => {
|
|
63
|
-
const date = 1532211072138;
|
|
64
|
-
expect(formatDate(date)).toEqual('07/21/2018 10:11:12 PM');
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
describe('formatDateDistance', (): void => {
|
|
69
|
-
test('should calculate the distance', (): void => {
|
|
70
|
-
// https://day.js.org/docs/en/display/from-now#list-of-breakdown-range
|
|
71
|
-
const dateYearAgo = () => {
|
|
72
|
-
const date = new Date();
|
|
73
|
-
date.setDate(date.getDate() - 365);
|
|
74
|
-
return date;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const dateTwoMonthsAgo = (): Date => {
|
|
78
|
-
const date = new Date();
|
|
79
|
-
date.setDate(date.getDate() - 60);
|
|
80
|
-
return date;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const date1 = dateYearAgo();
|
|
84
|
-
const date2 = dateTwoMonthsAgo();
|
|
85
|
-
|
|
86
|
-
expect(formatDateDistance(date1)).toEqual('a year ago');
|
|
87
|
-
expect(formatDateDistance(date2)).toEqual('2 months ago');
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
describe('getLastUpdatedPackageTime', (): void => {
|
|
92
|
-
test('should get the last update time', (): void => {
|
|
93
|
-
const lastUpdated = packageMeta._uplinks;
|
|
94
|
-
expect(getLastUpdatedPackageTime(lastUpdated)).toEqual('07/22/2018 10:11:12 PM');
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
test('should get the last update time for blank uplink', (): void => {
|
|
98
|
-
const lastUpdated = {};
|
|
99
|
-
expect(getLastUpdatedPackageTime(lastUpdated)).toEqual('');
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
describe('getRecentReleases', (): void => {
|
|
104
|
-
test('should get the recent releases', (): void => {
|
|
105
|
-
const { time } = packageMeta;
|
|
106
|
-
const result = [
|
|
107
|
-
{ time: '12/14/2017 3:43:27 PM', version: '2.7.1' },
|
|
108
|
-
{ time: '12/05/2017 11:25:06 PM', version: '2.7.0' },
|
|
109
|
-
{ time: '11/08/2017 10:47:16 PM', version: '2.6.6' },
|
|
110
|
-
];
|
|
111
|
-
expect(getRecentReleases(time)).toEqual(result);
|
|
112
|
-
expect(getRecentReleases()).toEqual([]);
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
describe('getUplink', (): void => {
|
|
117
|
-
test('getUplink for npmjs', () => {
|
|
118
|
-
expect(getUplink('npmjs', 'semver')).toEqual('https://www.npmjs.com/package/semver');
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
test('getUplink for server1', () => {
|
|
122
|
-
expect(getUplink('server1', 'semver')).toEqual(null);
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
describe('fileSizeSI', (): void => {
|
|
127
|
-
test('fileSizeSI as number 1234567', () => {
|
|
128
|
-
expect(fileSizeSI(1234567)).toEqual('1.2 MB');
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
test('fileSizeSI as number 9876', () => {
|
|
132
|
-
expect(fileSizeSI(9876)).toEqual('9.9 kB');
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
test('fileSizeSI as number 1000', () => {
|
|
136
|
-
expect(fileSizeSI(1000)).toEqual('1.0 kB');
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
test('fileSizeSI as number 123', () => {
|
|
140
|
-
expect(fileSizeSI(123)).toEqual('123 Bytes');
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
test('fileSizeSI as number 0', () => {
|
|
144
|
-
expect(fileSizeSI(0)).toEqual('0 Bytes');
|
|
145
|
-
});
|
|
146
|
-
});
|
package/src/utils/utils.ts
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
import localizedFormat from 'dayjs/plugin/localizedFormat';
|
|
3
|
-
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
4
|
-
import i18next from 'i18next';
|
|
5
|
-
import isString from 'lodash/isString';
|
|
6
|
-
|
|
7
|
-
import { UpLinks } from '@verdaccio/types';
|
|
8
|
-
|
|
9
|
-
import { Time } from '../types/packageMeta';
|
|
10
|
-
|
|
11
|
-
export const TIMEFORMAT = 'L LTS';
|
|
12
|
-
|
|
13
|
-
dayjs.extend(relativeTime);
|
|
14
|
-
dayjs.extend(localizedFormat);
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Formats license field for webui.
|
|
18
|
-
* @see https://docs.npmjs.com/files/package.json#license
|
|
19
|
-
*/
|
|
20
|
-
// License should use type License defined above, but conflicts with the unit test that provide array or empty object
|
|
21
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
22
|
-
export function formatLicense(license: any): string | undefined {
|
|
23
|
-
if (isString(license)) {
|
|
24
|
-
return license;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (license?.type) {
|
|
28
|
-
return license.type;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface Repository {
|
|
35
|
-
type: string;
|
|
36
|
-
url: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Formats repository field for webui.
|
|
41
|
-
* @see https://docs.npmjs.com/files/package.json#repository
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
// Repository should use type Repository defined above, but conflicts with the unit test that provide array or empty object
|
|
45
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
46
|
-
export function formatRepository(repository: any): string | null {
|
|
47
|
-
if (isString(repository)) {
|
|
48
|
-
return repository;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (repository?.url) {
|
|
52
|
-
return repository.url;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function formatDate(lastUpdate: string | number): string {
|
|
59
|
-
return dayjs(new Date(lastUpdate)).format(TIMEFORMAT);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function formatDateDistance(lastUpdate: Date | string | number): string {
|
|
63
|
-
return dayjs(new Date(lastUpdate)).fromNow();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* For <LastSync /> component
|
|
68
|
-
* @param {array} uplinks
|
|
69
|
-
*/
|
|
70
|
-
export function getLastUpdatedPackageTime(uplinks: UpLinks = {}): string {
|
|
71
|
-
let lastUpdate = 0;
|
|
72
|
-
Object.keys(uplinks).forEach(function computeUplink(upLinkName): void {
|
|
73
|
-
const status = uplinks[upLinkName];
|
|
74
|
-
if (status.fetched > lastUpdate) {
|
|
75
|
-
lastUpdate = status.fetched;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
return lastUpdate ? formatDate(lastUpdate) : '';
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* For <LastSync /> component
|
|
84
|
-
* @param {Object} time
|
|
85
|
-
* @returns {Array} last 3 releases
|
|
86
|
-
*/
|
|
87
|
-
export function getRecentReleases(time: Time = {}): Time[] {
|
|
88
|
-
const recent = Object.keys(time).map((version) => ({
|
|
89
|
-
version,
|
|
90
|
-
time: formatDate(time[version]),
|
|
91
|
-
}));
|
|
92
|
-
|
|
93
|
-
return recent.slice(recent.length - 3, recent.length).reverse();
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export function getAuthorName(authorName?: string): string {
|
|
97
|
-
if (!authorName) {
|
|
98
|
-
return i18next.t('author-unknown');
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (authorName.toLowerCase() === 'anonymous') {
|
|
102
|
-
return i18next.t('author-anonymous');
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return authorName;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function getUplink(upLinkName: string, packageName: string): string | null {
|
|
109
|
-
// TODO: make this a config like "uplinks: npmjs: web: https://www.npmjs.com/package/"
|
|
110
|
-
switch (upLinkName) {
|
|
111
|
-
case 'npmjs':
|
|
112
|
-
return `https://www.npmjs.com/package/${packageName}`;
|
|
113
|
-
}
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export function fileSizeSI(
|
|
118
|
-
a: number,
|
|
119
|
-
b?: typeof Math,
|
|
120
|
-
c?: (p: number) => number,
|
|
121
|
-
d?: number,
|
|
122
|
-
e?: number
|
|
123
|
-
): string {
|
|
124
|
-
b = Math;
|
|
125
|
-
c = b.log;
|
|
126
|
-
d = 1e3;
|
|
127
|
-
e = (c(a) / c(d)) | 0;
|
|
128
|
-
let size = a / b.pow(d, e);
|
|
129
|
-
// no decimals for Bytes
|
|
130
|
-
if (e === 0) {
|
|
131
|
-
return Math.floor(size) + ' Bytes';
|
|
132
|
-
} else {
|
|
133
|
-
return size.toFixed(1) + ' ' + 'kMGTPEZY'[--e] + 'B';
|
|
134
|
-
}
|
|
135
|
-
}
|
package/tsconfig.build.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"allowSyntheticDefaultImports": true,
|
|
7
|
-
"resolveJsonModule": true,
|
|
8
|
-
"sourceMap": true,
|
|
9
|
-
"preserveSymlinks": true,
|
|
10
|
-
"rootDir": "./src",
|
|
11
|
-
"outDir": "./build",
|
|
12
|
-
"skipLibCheck": true,
|
|
13
|
-
"jsx": "react",
|
|
14
|
-
"types": ["node", "@testing-library/jest-dom"]
|
|
15
|
-
},
|
|
16
|
-
"include": ["src/**/*"],
|
|
17
|
-
"exclude": ["src/**/*.stories.tsx", "src/**/*.test.tsx", "src/**/*.test.ts"],
|
|
18
|
-
"typedocOptions": {
|
|
19
|
-
"categoryOrder": ["Model", "Component", "Provider", "*"],
|
|
20
|
-
"defaultCategory": "Component",
|
|
21
|
-
"categorizeByGroup": "false"
|
|
22
|
-
}
|
|
23
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.reference.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"allowSyntheticDefaultImports": true,
|
|
7
|
-
"resolveJsonModule": true,
|
|
8
|
-
"sourceMap": true,
|
|
9
|
-
"rootDir": "./src",
|
|
10
|
-
"outDir": "./build",
|
|
11
|
-
"preserveSymlinks": true,
|
|
12
|
-
"jsx": "react",
|
|
13
|
-
"allowJs": true,
|
|
14
|
-
"types": ["node", "jest", "@testing-library/jest-dom"]
|
|
15
|
-
},
|
|
16
|
-
"include": ["src/**/*"],
|
|
17
|
-
"references": [
|
|
18
|
-
{
|
|
19
|
-
"path": "../core/types"
|
|
20
|
-
}
|
|
21
|
-
]
|
|
22
|
-
}
|