@verdaccio/ui-theme 3.1.0 → 6.0.0-6-next.11
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/.babelrc +33 -0
- package/.eslintrc +115 -0
- package/.stylelintrc +40 -0
- package/CHANGELOG.md +152 -554
- package/LICENSE +1 -1
- package/README.md +22 -95
- package/config/env.js +9 -0
- package/jest/api/packages.json +42 -0
- package/jest/identity.js +29 -0
- package/jest/jest.config.js +39 -0
- package/jest/jestEnvironment.js +1 -0
- package/jest/server-handlers.ts +9 -0
- package/jest/server.ts +6 -0
- package/jest/setup-env.ts +15 -0
- package/jest/setup.ts +31 -0
- package/jest/unit/components/__mocks__/api.ts +47 -0
- package/jest/unit/components/__mocks__/token.ts +31 -0
- package/jest/unit/components/store/login.ts +23 -0
- package/jest/unit/components/store/logo.ts +7 -0
- package/jest/unit/components/store/package.ts +174 -0
- package/jest/unit/components/store/packageMeta.ts +592 -0
- package/jest/unit/empty.ts +1 -0
- package/lib/constants.ts +9 -0
- package/package.json +153 -228
- package/src/App/App.test.tsx +123 -0
- package/src/App/App.tsx +54 -0
- package/src/App/AppError.tsx +38 -0
- package/src/App/AppRoute.tsx +63 -0
- package/src/App/Footer/Footer.test.tsx +20 -0
- package/src/App/Footer/Footer.tsx +111 -0
- package/src/App/Footer/__snapshots__/Footer.test.tsx.snap +456 -0
- package/src/App/Footer/index.ts +1 -0
- package/src/App/Footer/styles.ts +44 -0
- package/src/App/Header/Header.test.tsx +152 -0
- package/src/App/Header/Header.tsx +74 -0
- package/src/App/Header/HeaderGreetings.tsx +22 -0
- package/src/App/Header/HeaderInfoDialog.tsx +19 -0
- package/src/App/Header/HeaderLeft.tsx +31 -0
- package/src/App/Header/HeaderMenu.tsx +65 -0
- package/src/App/Header/HeaderRight.tsx +118 -0
- package/src/App/Header/HeaderToolTip.tsx +19 -0
- package/src/App/Header/HeaderToolTipIcon.tsx +75 -0
- package/src/App/Header/LanguageSwitch.tsx +125 -0
- package/src/App/Header/LoginDialog/LoginDialog.test.tsx +112 -0
- package/src/App/Header/LoginDialog/LoginDialog.tsx +81 -0
- package/src/App/Header/LoginDialog/LoginDialogCloseButton.tsx +32 -0
- package/src/App/Header/LoginDialog/LoginDialogForm.tsx +97 -0
- package/src/App/Header/LoginDialog/LoginDialogFormError.tsx +43 -0
- package/src/App/Header/LoginDialog/LoginDialogHeader.tsx +48 -0
- package/src/App/Header/LoginDialog/__snapshots__/LoginDialog.test.tsx.snap +3 -0
- package/src/App/Header/LoginDialog/index.ts +1 -0
- package/src/App/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +27 -0
- package/src/App/Header/RegistryInfoContent/RegistryInfoContent.tsx +155 -0
- package/src/App/Header/RegistryInfoContent/index.ts +1 -0
- package/src/App/Header/RegistryInfoDialog/RegistryInfoDialog.tsx +30 -0
- package/src/App/Header/RegistryInfoDialog/index.ts +1 -0
- package/src/App/Header/RegistryInfoDialog/styles.ts +16 -0
- package/src/App/Header/RegistryInfoDialog/types.ts +7 -0
- package/src/App/Header/Search/Search.test.tsx +168 -0
- package/src/App/Header/Search/Search.tsx +127 -0
- package/src/App/Header/Search/SearchAdornment.tsx +18 -0
- package/src/App/Header/Search/__snapshots__/Search.test.tsx.snap +101 -0
- package/src/App/Header/Search/index.ts +1 -0
- package/src/App/Header/index.ts +1 -0
- package/src/App/Header/styles.ts +89 -0
- package/src/App/index.ts +1 -0
- package/src/App/utils/loadable.tsx +10 -0
- package/src/components/.eslintrc +7 -0
- package/src/components/ActionBar/ActionBar.test.tsx +91 -0
- package/src/components/ActionBar/ActionBar.tsx +45 -0
- package/src/components/ActionBar/ActionBarAction.tsx +75 -0
- package/src/components/ActionBar/__snapshots__/ActionBar.test.tsx.snap +122 -0
- package/src/components/ActionBar/index.ts +1 -0
- package/src/components/AppBar.tsx +10 -0
- package/src/components/Author/Author.test.tsx +75 -0
- package/src/components/Author/Author.tsx +47 -0
- package/src/components/Author/__snapshots__/Author.test.tsx.snap +353 -0
- package/src/components/Author/index.ts +1 -0
- package/src/components/Author/styles.ts +23 -0
- package/src/components/AutoComplete/AutoComplete.tsx +179 -0
- package/src/components/AutoComplete/AutoCompleteV2.tsx +296 -0
- package/src/components/AutoComplete/index.ts +1 -0
- package/src/components/AutoComplete/styles.tsx +58 -0
- package/src/components/AutoComplete/useAutoComplete.tsx +61 -0
- package/src/components/Avatar.tsx +3 -0
- package/src/components/Box.tsx +8 -0
- package/src/components/Button.tsx +10 -0
- package/src/components/Card.tsx +10 -0
- package/src/components/CardActions.tsx +13 -0
- package/src/components/CardContent.tsx +10 -0
- package/src/components/Chip.tsx +10 -0
- package/src/components/CircularProgress.tsx +15 -0
- package/src/components/CopyToClipBoard.tsx +45 -0
- package/src/components/Dialog.tsx +10 -0
- package/src/components/DialogActions.tsx +16 -0
- package/src/components/DialogContent.tsx +16 -0
- package/src/components/DialogTitle.tsx +10 -0
- package/src/components/Divider.tsx +10 -0
- package/src/components/FloatingActionButton.tsx +12 -0
- package/src/components/FormControl.tsx +10 -0
- package/src/components/FormHelperText.tsx +16 -0
- package/src/components/Grid.tsx +10 -0
- package/src/components/Heading.tsx +15 -0
- package/src/components/IconButton.tsx +10 -0
- package/src/components/Icons/.eslintrc +5 -0
- package/src/components/Icons/Earth.tsx +36 -0
- package/src/components/Icons/FileBinary.tsx +20 -0
- package/src/components/Icons/Law.tsx +20 -0
- package/src/components/Icons/License.tsx +18 -0
- package/src/components/Icons/Time.tsx +19 -0
- package/src/components/Icons/Version.tsx +20 -0
- package/src/components/Icons/index.ts +5 -0
- package/src/components/Input.tsx +10 -0
- package/src/components/InputAdornment/InputAdornment.tsx +16 -0
- package/src/components/InputAdornment/index.ts +1 -0
- package/src/components/InputLabel.tsx +10 -0
- package/src/components/Label/Label.test.tsx +15 -0
- package/src/components/Label/Label.tsx +35 -0
- package/src/components/Label/__snapshots__/Label.test.tsx.snap +14 -0
- package/src/components/Label/index.ts +1 -0
- package/src/components/Link.tsx +39 -0
- package/src/components/List.tsx +10 -0
- package/src/components/ListItem.tsx +23 -0
- package/src/components/ListItemText.tsx +16 -0
- package/src/components/Loading/Loading.test.tsx +12 -0
- package/src/components/Loading/Loading.tsx +17 -0
- package/src/components/Loading/Spinner/Spinner.test.tsx +14 -0
- package/src/components/Loading/Spinner/Spinner.tsx +35 -0
- package/src/components/Loading/Spinner/__snapshots__/Spinner.test.tsx.snap +148 -0
- package/src/components/Loading/Spinner/index.tsx +1 -0
- package/src/components/Loading/__snapshots__/Loading.test.tsx.snap +86 -0
- package/src/components/Loading/index.ts +1 -0
- package/src/components/Loading/styles.ts +17 -0
- package/src/components/Logo/Logo.test.tsx +12 -0
- package/src/components/Logo/Logo.tsx +55 -0
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +19 -0
- package/src/components/Logo/img/logo-black-and-white.svg +1 -0
- package/src/components/Logo/img/logo.svg +1 -0
- package/src/components/Logo/index.ts +1 -0
- package/src/components/Menu.tsx +10 -0
- package/src/components/MenuItem.tsx +25 -0
- package/src/components/NotFound/NotFound.tsx +52 -0
- package/src/components/NotFound/Notfound.test.tsx +37 -0
- package/src/components/NotFound/__snapshots__/Notfound.test.tsx.snap +44 -0
- package/src/components/NotFound/img/package.svg +1 -0
- package/src/components/NotFound/index.ts +1 -0
- package/src/components/NotFound/styles.ts +40 -0
- package/src/components/Paper.tsx +10 -0
- package/src/components/SnackbarContent.tsx +15 -0
- package/src/components/SvgIcon.tsx +38 -0
- package/src/components/Tab.tsx +10 -0
- package/src/components/Tabs.tsx +14 -0
- package/src/components/Text/Text.tsx +17 -0
- package/src/components/Text/TextConfig.ts +7 -0
- package/src/components/Text/index.ts +2 -0
- package/src/components/TextField/TextField.test.tsx +16 -0
- package/src/components/TextField/TextField.tsx +23 -0
- package/src/components/TextField/__snapshots__/TextField.test.tsx.snap +19 -0
- package/src/components/TextField/index.ts +1 -0
- package/src/components/Toolbar.tsx +10 -0
- package/src/components/Tooltip.tsx +25 -0
- package/src/design-tokens/ResetStyles.tsx +44 -0
- package/src/design-tokens/StyleBaseline.tsx +14 -0
- package/src/design-tokens/ThemeContext.ts +13 -0
- package/src/design-tokens/ThemeProvider.tsx +44 -0
- package/src/design-tokens/emotion.ts +5 -0
- package/src/design-tokens/load-dayjs-locale.ts +98 -0
- package/src/design-tokens/theme.ts +159 -0
- package/src/design-tokens/useLocalStorage.ts +40 -0
- package/src/design-tokens/useOnClickOutside.ts +28 -0
- package/src/design-tokens/useTheme.ts +7 -0
- package/src/i18n/ABOUT_TRANSLATIONS.md +13 -0
- package/src/i18n/config.ts +52 -0
- package/src/i18n/crowdin/ui.json +170 -0
- package/src/i18n/deprecated_translations_dont_use/cs-CZ.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/de-DE.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/en-US.json +170 -0
- package/src/i18n/deprecated_translations_dont_use/es-ES.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/fr-FR.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/ja-JP.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/km-KH.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/pt-BR.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/ru-RU.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/tr-TR.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/uk-UA.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/zh-CN.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/zh-TW.json +165 -0
- package/src/i18n/enabledLanguages.ts +35 -0
- package/src/index.tsx +36 -0
- package/src/lib/constants.ts +9 -0
- package/src/pages/Version/DetailContainer/Dependencies/Dependencies.test.tsx +93 -0
- package/src/pages/Version/DetailContainer/Dependencies/Dependencies.tsx +100 -0
- package/src/pages/Version/DetailContainer/Dependencies/index.ts +1 -0
- package/src/pages/Version/DetailContainer/Dependencies/styles.ts +26 -0
- package/src/pages/Version/DetailContainer/Dependencies/types.ts +7 -0
- package/src/pages/Version/DetailContainer/Deprecated/Deprecated.test.tsx +34 -0
- package/src/pages/Version/DetailContainer/Deprecated/Deprecated.tsx +31 -0
- package/src/pages/Version/DetailContainer/Deprecated/index.ts +1 -0
- package/src/pages/Version/DetailContainer/DetailContainer.test.tsx +13 -0
- package/src/pages/Version/DetailContainer/DetailContainer.tsx +37 -0
- package/src/pages/Version/DetailContainer/DetailContainerContent.tsx +41 -0
- package/src/pages/Version/DetailContainer/DetailContainerContentReadme.tsx +19 -0
- package/src/pages/Version/DetailContainer/DetailContainerTabs.tsx +36 -0
- package/src/pages/Version/DetailContainer/NoItems/NoItems.tsx +16 -0
- package/src/pages/Version/DetailContainer/NoItems/Noitems.test.tsx +16 -0
- package/src/pages/Version/DetailContainer/NoItems/__snapshots__/Noitems.test.tsx.snap +9 -0
- package/src/pages/Version/DetailContainer/NoItems/index.ts +1 -0
- package/src/pages/Version/DetailContainer/Readme/Readme.spec.tsx +19 -0
- package/src/pages/Version/DetailContainer/Readme/Readme.tsx +22 -0
- package/src/pages/Version/DetailContainer/Readme/__snapshots__/Readme.spec.tsx.snap +94 -0
- package/src/pages/Version/DetailContainer/Readme/index.ts +1 -0
- package/src/pages/Version/DetailContainer/Readme/types.ts +3 -0
- package/src/pages/Version/DetailContainer/UpLinks/UpLinks.test.tsx +58 -0
- package/src/pages/Version/DetailContainer/UpLinks/UpLinks.tsx +45 -0
- package/src/pages/Version/DetailContainer/UpLinks/__snapshots__/UpLinks.test.tsx.snap +247 -0
- package/src/pages/Version/DetailContainer/UpLinks/index.ts +1 -0
- package/src/pages/Version/DetailContainer/UpLinks/styles.ts +24 -0
- package/src/pages/Version/DetailContainer/Versions/Versions.test.tsx +60 -0
- package/src/pages/Version/DetailContainer/Versions/Versions.tsx +41 -0
- package/src/pages/Version/DetailContainer/Versions/VersionsHistoryList.tsx +40 -0
- package/src/pages/Version/DetailContainer/Versions/VersionsTagList.tsx +28 -0
- package/src/pages/Version/DetailContainer/Versions/__partials__/data.json +5984 -0
- package/src/pages/Version/DetailContainer/Versions/__snapshots__/Versions.test.tsx.snap +3 -0
- package/src/pages/Version/DetailContainer/Versions/index.ts +1 -0
- package/src/pages/Version/DetailContainer/Versions/styles.ts +30 -0
- package/src/pages/Version/DetailContainer/__snapshots__/DetailContainer.test.tsx.snap +103 -0
- package/src/pages/Version/DetailContainer/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/DetailSidebar.tsx +55 -0
- package/src/pages/Version/DetailSidebar/DetailSidebarFundButton.test.tsx +111 -0
- package/src/pages/Version/DetailSidebar/DetailSidebarFundButton.tsx +53 -0
- package/src/pages/Version/DetailSidebar/DetailSidebarTitle.tsx +40 -0
- package/src/pages/Version/DetailSidebar/Developers/Developers.test.tsx +117 -0
- package/src/pages/Version/DetailSidebar/Developers/Developers.tsx +90 -0
- package/src/pages/Version/DetailSidebar/Developers/DevelopersTitle.tsx +32 -0
- package/src/pages/Version/DetailSidebar/Developers/__snapshots__/Developers.test.tsx.snap +380 -0
- package/src/pages/Version/DetailSidebar/Developers/get-unique-developer-values.ts +16 -0
- package/src/pages/Version/DetailSidebar/Developers/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/Developers/styles.ts +31 -0
- package/src/pages/Version/DetailSidebar/Dist/Dist.test.tsx +78 -0
- package/src/pages/Version/DetailSidebar/Dist/Dist.tsx +49 -0
- package/src/pages/Version/DetailSidebar/Dist/__snapshots__/Dist.test.tsx.snap +602 -0
- package/src/pages/Version/DetailSidebar/Dist/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/Dist/styles.ts +27 -0
- package/src/pages/Version/DetailSidebar/Engines/Engines.test.tsx +71 -0
- package/src/pages/Version/DetailSidebar/Engines/Engines.tsx +58 -0
- package/src/pages/Version/DetailSidebar/Engines/img/node.png +0 -0
- package/src/pages/Version/DetailSidebar/Engines/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/Engines/styles.ts +14 -0
- package/src/pages/Version/DetailSidebar/Install/Install.test.tsx +64 -0
- package/src/pages/Version/DetailSidebar/Install/Install.tsx +52 -0
- package/src/pages/Version/DetailSidebar/Install/InstallListItem.tsx +97 -0
- package/src/pages/Version/DetailSidebar/Install/__partials__/data.json +5984 -0
- package/src/pages/Version/DetailSidebar/Install/img/npm.svg +15 -0
- package/src/pages/Version/DetailSidebar/Install/img/pnpm.svg +1 -0
- package/src/pages/Version/DetailSidebar/Install/img/yarn.svg +1 -0
- package/src/pages/Version/DetailSidebar/Install/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/Repository/Repository.test.tsx +78 -0
- package/src/pages/Version/DetailSidebar/Repository/Repository.tsx +93 -0
- package/src/pages/Version/DetailSidebar/Repository/__partials__/data.json +5984 -0
- package/src/pages/Version/DetailSidebar/Repository/__snapshots__/Repository.test.tsx.snap +3 -0
- package/src/pages/Version/DetailSidebar/Repository/img/git.png +0 -0
- package/src/pages/Version/DetailSidebar/Repository/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/index.ts +1 -0
- package/src/pages/Version/Version.test.tsx +68 -0
- package/src/pages/Version/Version.tsx +41 -0
- package/src/pages/Version/VersionContextProvider.tsx +43 -0
- package/src/pages/Version/VersionLayout.tsx +20 -0
- package/src/pages/Version/__partials__/data.json +5984 -0
- package/src/pages/Version/context.ts +10 -0
- package/src/pages/Version/get-route-package-name.ts +9 -0
- package/src/pages/Version/index.ts +4 -0
- package/src/pages/Version/version-config.ts +19 -0
- package/src/pages/home/Home.tsx +25 -0
- package/src/pages/home/PackageList/Help/Help.test.tsx +12 -0
- package/src/pages/home/PackageList/Help/Help.tsx +56 -0
- package/src/pages/home/PackageList/Help/__snapshots__/Help.test.tsx.snap +159 -0
- package/src/pages/home/PackageList/Help/index.ts +1 -0
- package/src/pages/home/PackageList/Help/styles.ts +13 -0
- package/src/pages/home/PackageList/Package/Package.test.tsx +56 -0
- package/src/pages/home/PackageList/Package/Package.tsx +253 -0
- package/src/pages/home/PackageList/Package/Tag/Tag.test.tsx +16 -0
- package/src/pages/home/PackageList/Package/Tag/Tag.tsx +11 -0
- package/src/pages/home/PackageList/Package/Tag/__snapshots__/Tag.test.tsx.snap +21 -0
- package/src/pages/home/PackageList/Package/Tag/index.ts +1 -0
- package/src/pages/home/PackageList/Package/Tag/styles.ts +11 -0
- package/src/pages/home/PackageList/Package/index.ts +1 -0
- package/src/pages/home/PackageList/Package/styles.ts +112 -0
- package/src/pages/home/PackageList/PackageList.tsx +81 -0
- package/src/pages/home/PackageList/Packagelist.test.tsx +60 -0
- package/src/pages/home/PackageList/index.ts +1 -0
- package/src/pages/home/index.ts +1 -0
- package/src/providers/API/api.test.ts +136 -0
- package/src/providers/API/api.ts +73 -0
- package/src/providers/API/storage.ts +12 -0
- package/src/providers/config/AppConfigurationProvider.tsx +57 -0
- package/src/providers/config/index.ts +1 -0
- package/src/store/index.ts +1 -0
- package/src/store/models/configuration.ts +42 -0
- package/src/store/models/download.ts +31 -0
- package/src/store/models/index.ts +17 -0
- package/src/store/models/login.ts +90 -0
- package/src/store/models/manifest.ts +91 -0
- package/src/store/models/packages.ts +36 -0
- package/src/store/models/search.ts +81 -0
- package/src/store/store.ts +15 -0
- package/src/template/favicon.ico +0 -0
- package/src/template/index.html +21 -0
- package/src/utils/.eslintrc +5 -0
- package/src/utils/cli-utils.test.ts +66 -0
- package/src/utils/cli-utils.ts +38 -0
- package/src/utils/colors.ts +1 -0
- package/src/utils/constants.ts +5 -0
- package/src/utils/file-size.ts +13 -0
- package/src/utils/i18nForTests.ts +25 -0
- package/src/utils/login.test.ts +71 -0
- package/src/utils/login.ts +44 -0
- package/src/utils/package.test.ts +101 -0
- package/src/utils/package.ts +105 -0
- package/src/utils/sec-utils.ts +15 -0
- package/src/utils/storage.ts +12 -0
- package/src/utils/test-react-testing-library.tsx +38 -0
- package/src/utils/url.test.ts +28 -0
- package/src/utils/url.ts +58 -0
- package/src/utils/windows.ts +3 -0
- package/static/favicon.ico +0 -0
- package/static/index.html +21 -0
- package/static/main.c57129036f278d0c7acf.js +2 -0
- package/static/main.c57129036f278d0c7acf.js.LICENSE.txt +1456 -0
- package/static/manifest.json +5 -17
- package/static/runtime.c57129036f278d0c7acf.js +2 -0
- package/static/{runtime.f6e570dfe38870a45bf5.js.LICENSE.txt → runtime.c57129036f278d0c7acf.js.LICENSE.txt} +2 -2
- package/static/vendors.c57129036f278d0c7acf.js +2 -0
- package/static/vendors.c57129036f278d0c7acf.js.LICENSE.txt +2932 -0
- package/tools/.eslintrc +14 -0
- package/tools/_verdaccio.config.yaml +59 -0
- package/tools/dev.server.js +48 -0
- package/tools/getPackageJson.js +25 -0
- package/tools/verdaccio.js +31 -0
- package/tools/webpack.config.js +82 -0
- package/tools/webpack.dev.config.babel.js +60 -0
- package/tools/webpack.prod.config.babel.js +81 -0
- package/tsconfig.build.json +24 -0
- package/tsconfig.json +27 -0
- package/types/custom.d.ts +9 -0
- package/types/files.d.ts +9 -0
- package/types/index.ts +12 -0
- package/types/jest-dom.d.ts +1 -0
- package/types/packageMeta.ts +82 -0
- package/static/238.f6e570dfe38870a45bf5.js +0 -2
- package/static/238.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/718.f6e570dfe38870a45bf5.js +0 -2
- package/static/718.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/73.f6e570dfe38870a45bf5.js +0 -2
- package/static/73.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Dependencies.f6e570dfe38870a45bf5.js +0 -2
- package/static/Dependencies.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Dist.f6e570dfe38870a45bf5.js +0 -2
- package/static/Dist.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Engines.f6e570dfe38870a45bf5.js +0 -2
- package/static/Engines.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Home.f6e570dfe38870a45bf5.js +0 -2
- package/static/Home.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Install.f6e570dfe38870a45bf5.js +0 -2
- package/static/Install.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/NotFound.f6e570dfe38870a45bf5.js +0 -2
- package/static/NotFound.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Provider.f6e570dfe38870a45bf5.js +0 -2
- package/static/Provider.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Repository.f6e570dfe38870a45bf5.js +0 -2
- package/static/Repository.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/UpLinks.f6e570dfe38870a45bf5.js +0 -2
- package/static/UpLinks.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Version.f6e570dfe38870a45bf5.js +0 -2
- package/static/Version.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Versions.f6e570dfe38870a45bf5.js +0 -2
- package/static/Versions.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/main.f6e570dfe38870a45bf5.js +0 -2
- package/static/main.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/runtime.f6e570dfe38870a45bf5.js +0 -2
- package/static/vendors.f6e570dfe38870a45bf5.js +0 -2
- package/static/vendors.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -98
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { packageMeta } from '../../jest/unit/components/store/packageMeta';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
formatLicense,
|
|
5
|
+
formatRepository,
|
|
6
|
+
formatDate,
|
|
7
|
+
formatDateDistance,
|
|
8
|
+
getLastUpdatedPackageTime,
|
|
9
|
+
getRecentReleases,
|
|
10
|
+
} from './package';
|
|
11
|
+
|
|
12
|
+
describe('formatLicense', (): void => {
|
|
13
|
+
test('should check license field different values', (): void => {
|
|
14
|
+
expect(formatLicense('MIT')).toEqual('MIT');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('should check license field for object value', (): void => {
|
|
18
|
+
const license = { type: 'ISC', url: 'https://opensource.org/licenses/ISC' };
|
|
19
|
+
expect(formatLicense(license)).toEqual('ISC');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('should check license field for other value', (): void => {
|
|
23
|
+
expect(formatLicense(null)).toBeUndefined();
|
|
24
|
+
expect(formatLicense({})).toBeUndefined();
|
|
25
|
+
expect(formatLicense([])).toBeUndefined();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe('formatRepository', (): void => {
|
|
30
|
+
test('should check repository field different values', (): void => {
|
|
31
|
+
const repository = 'https://github.com/verdaccio/verdaccio';
|
|
32
|
+
expect(formatRepository(repository)).toEqual(repository);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test('should check repository field for object value', (): void => {
|
|
36
|
+
const license = {
|
|
37
|
+
type: 'git',
|
|
38
|
+
url: 'https://github.com/verdaccio/verdaccio',
|
|
39
|
+
};
|
|
40
|
+
expect(formatRepository(license)).toEqual(license.url);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('should check repository field for other value', (): void => {
|
|
44
|
+
expect(formatRepository(null)).toBeNull();
|
|
45
|
+
expect(formatRepository({})).toBeNull();
|
|
46
|
+
expect(formatRepository([])).toBeNull();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe('formatDate', (): void => {
|
|
51
|
+
test('should format the date', (): void => {
|
|
52
|
+
const date = 1532211072138;
|
|
53
|
+
expect(formatDate(date)).toEqual('07/21/2018 10:11:12 PM');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('formatDateDistance', (): void => {
|
|
58
|
+
test('should calculate the distance', (): void => {
|
|
59
|
+
// const dateAboutTwoMonthsAgo = () => {
|
|
60
|
+
// const date = new Date();
|
|
61
|
+
// date.setMonth(date.getMonth() - 1);
|
|
62
|
+
// date.setDate(date.getDay() - 20);
|
|
63
|
+
// return date;
|
|
64
|
+
// };
|
|
65
|
+
const dateTwoMonthsAgo = (): Date => {
|
|
66
|
+
const date = new Date();
|
|
67
|
+
date.setMonth(date.getMonth() - 2);
|
|
68
|
+
return date;
|
|
69
|
+
};
|
|
70
|
+
// const date1 = dateAboutTwoMonthsAgo();
|
|
71
|
+
const date2 = dateTwoMonthsAgo();
|
|
72
|
+
// FIXME: we need to review this expect, fails every x time.
|
|
73
|
+
// expect(formatDateDistance(date1)).toEqual('about 2 months');
|
|
74
|
+
expect(formatDateDistance(date2)).toEqual('2 months ago');
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
describe('getLastUpdatedPackageTime', (): void => {
|
|
79
|
+
test('should get the last update time', (): void => {
|
|
80
|
+
const lastUpdated = packageMeta._uplinks;
|
|
81
|
+
expect(getLastUpdatedPackageTime(lastUpdated)).toEqual('07/22/2018 10:11:12 PM');
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
test('should get the last update time for blank uplink', (): void => {
|
|
85
|
+
const lastUpdated = {};
|
|
86
|
+
expect(getLastUpdatedPackageTime(lastUpdated)).toEqual('');
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
describe('getRecentReleases', (): void => {
|
|
91
|
+
test('should get the recent releases', (): void => {
|
|
92
|
+
const { time } = packageMeta;
|
|
93
|
+
const result = [
|
|
94
|
+
{ time: '12/14/2017 3:43:27 PM', version: '2.7.1' },
|
|
95
|
+
{ time: '12/05/2017 11:25:06 PM', version: '2.7.0' },
|
|
96
|
+
{ time: '11/08/2017 10:47:16 PM', version: '2.6.6' },
|
|
97
|
+
];
|
|
98
|
+
expect(getRecentReleases(time)).toEqual(result);
|
|
99
|
+
expect(getRecentReleases()).toEqual([]);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { UpLinks } from '@verdaccio/types';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import localizedFormat from 'dayjs/plugin/localizedFormat';
|
|
4
|
+
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
5
|
+
import i18next from 'i18next';
|
|
6
|
+
import isString from 'lodash/isString';
|
|
7
|
+
|
|
8
|
+
import { Time } from '../../types/packageMeta';
|
|
9
|
+
|
|
10
|
+
export const TIMEFORMAT = 'L LTS';
|
|
11
|
+
|
|
12
|
+
dayjs.extend(relativeTime);
|
|
13
|
+
dayjs.extend(localizedFormat);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Formats license field for webui.
|
|
17
|
+
* @see https://docs.npmjs.com/files/package.json#license
|
|
18
|
+
*/
|
|
19
|
+
// License should use type License defined above, but conflicts with the unit test that provide array or empty object
|
|
20
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
21
|
+
export function formatLicense(license: any): string | undefined {
|
|
22
|
+
if (isString(license)) {
|
|
23
|
+
return license;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (license?.type) {
|
|
27
|
+
return license.type;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface Repository {
|
|
34
|
+
type: string;
|
|
35
|
+
url: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Formats repository field for webui.
|
|
40
|
+
* @see https://docs.npmjs.com/files/package.json#repository
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
// Repository should use type Repository defined above, but conflicts with the unit test that provide array or empty object
|
|
44
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
45
|
+
export function formatRepository(repository: any): string | null {
|
|
46
|
+
if (isString(repository)) {
|
|
47
|
+
return repository;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (repository?.url) {
|
|
51
|
+
return repository.url;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function formatDate(lastUpdate: string | number): string {
|
|
58
|
+
return dayjs(new Date(lastUpdate)).format(TIMEFORMAT);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function formatDateDistance(lastUpdate: Date | string | number): string {
|
|
62
|
+
return dayjs(new Date(lastUpdate)).fromNow();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* For <LastSync /> component
|
|
67
|
+
* @param {array} uplinks
|
|
68
|
+
*/
|
|
69
|
+
export function getLastUpdatedPackageTime(uplinks: UpLinks = {}): string {
|
|
70
|
+
let lastUpdate = 0;
|
|
71
|
+
Object.keys(uplinks).forEach(function computeUplink(upLinkName): void {
|
|
72
|
+
const status = uplinks[upLinkName];
|
|
73
|
+
if (status.fetched > lastUpdate) {
|
|
74
|
+
lastUpdate = status.fetched;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
return lastUpdate ? formatDate(lastUpdate) : '';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* For <LastSync /> component
|
|
83
|
+
* @param {Object} time
|
|
84
|
+
* @returns {Array} last 3 releases
|
|
85
|
+
*/
|
|
86
|
+
export function getRecentReleases(time: Time = {}): Time[] {
|
|
87
|
+
const recent = Object.keys(time).map((version) => ({
|
|
88
|
+
version,
|
|
89
|
+
time: formatDate(time[version]),
|
|
90
|
+
}));
|
|
91
|
+
|
|
92
|
+
return recent.slice(recent.length - 3, recent.length).reverse();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function getAuthorName(authorName?: string): string {
|
|
96
|
+
if (!authorName) {
|
|
97
|
+
return i18next.t('author-unknown');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (authorName.toLowerCase() === 'anonymous') {
|
|
101
|
+
return i18next.t('author-anonymous');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return authorName;
|
|
105
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { filterXSS, escapeAttrValue } from 'xss';
|
|
2
|
+
|
|
3
|
+
const xssOpts = {
|
|
4
|
+
onIgnoreTagAttr: function (tag: string, name: string, value: string) {
|
|
5
|
+
if (tag.match(/^h[0-9]$/) && name === 'id') {
|
|
6
|
+
return name + '="' + escapeAttrValue(value) + '"';
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function preventXSS(text: string): string {
|
|
12
|
+
const encodedText = filterXSS(text, xssOpts);
|
|
13
|
+
|
|
14
|
+
return encodedText;
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import memoryStorage from 'localstorage-memory';
|
|
2
|
+
|
|
3
|
+
let storage: Storage;
|
|
4
|
+
try {
|
|
5
|
+
localStorage.setItem('__TEST__', '');
|
|
6
|
+
localStorage.removeItem('__TEST__');
|
|
7
|
+
storage = localStorage;
|
|
8
|
+
} catch (err: any) {
|
|
9
|
+
storage = memoryStorage;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default storage;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { I18nextProvider } from 'react-i18next';
|
|
4
|
+
import { Provider } from 'react-redux';
|
|
5
|
+
|
|
6
|
+
import ThemeProvider from 'verdaccio-ui/design-tokens/ThemeProvider';
|
|
7
|
+
import AppConfigurationProvider from 'verdaccio-ui/providers/config';
|
|
8
|
+
|
|
9
|
+
import i18nConfig from '../i18n/config';
|
|
10
|
+
|
|
11
|
+
const renderWithStore = (ui, store) =>
|
|
12
|
+
render(ui, {
|
|
13
|
+
wrapper: ({ children }) => (
|
|
14
|
+
<Provider store={store}>
|
|
15
|
+
<AppConfigurationProvider>
|
|
16
|
+
<ThemeProvider>
|
|
17
|
+
<I18nextProvider i18n={i18nConfig}>{children}</I18nextProvider>
|
|
18
|
+
</ThemeProvider>
|
|
19
|
+
</AppConfigurationProvider>
|
|
20
|
+
</Provider>
|
|
21
|
+
),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const customRender = (node: React.ReactElement, ...options: any) => {
|
|
25
|
+
return render(
|
|
26
|
+
<AppConfigurationProvider>
|
|
27
|
+
<ThemeProvider>
|
|
28
|
+
<I18nextProvider i18n={i18nConfig}>{node}</I18nextProvider>
|
|
29
|
+
</ThemeProvider>
|
|
30
|
+
</AppConfigurationProvider>,
|
|
31
|
+
...options
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export * from '@testing-library/react';
|
|
36
|
+
// FIXME: rename all references with customRemder
|
|
37
|
+
export { customRender as render };
|
|
38
|
+
export { customRender, renderWithStore };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isURL, isEmail, extractFileName } 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
|
+
|
|
21
|
+
describe('extractFileName', () => {
|
|
22
|
+
test('should return the file name', () => {
|
|
23
|
+
expect(extractFileName('http://localhost:4872/juan_test_webpack1/-/test-10.0.0.tgz')).toBe(
|
|
24
|
+
'test-10.0.0.tgz'
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
});
|
package/src/utils/url.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import isEmailValidator from 'validator/lib/isEmail';
|
|
2
|
+
import isURLValidator from 'validator/lib/isURL';
|
|
3
|
+
import '../../types';
|
|
4
|
+
|
|
5
|
+
export function isURL(url: string): boolean {
|
|
6
|
+
return isURLValidator(url || '', {
|
|
7
|
+
protocols: ['http', 'https', 'git+https'],
|
|
8
|
+
require_protocol: true,
|
|
9
|
+
require_tld: false,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function isEmail(email: string): boolean {
|
|
14
|
+
return isEmailValidator(email || '');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function extractFileName(url: string): string {
|
|
18
|
+
return url.substring(url.lastIndexOf('/') + 1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function blobToFile(blob: Blob, fileName: string): File {
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
+
const b: any = blob;
|
|
24
|
+
b.lastModified = Date.now();
|
|
25
|
+
b.name = fileName;
|
|
26
|
+
return b as File;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function downloadFile(fileStream: Blob, fileName: string): void {
|
|
30
|
+
let file: File;
|
|
31
|
+
// File constructor is not supported by Edge
|
|
32
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/File#Browser_compatibility
|
|
33
|
+
// @ts-ignore. Please see: https://github.com/microsoft/TypeScript/issues/33792
|
|
34
|
+
if (navigator.msSaveBlob) {
|
|
35
|
+
// Detect if Edge
|
|
36
|
+
file = blobToFile(new Blob([fileStream], { type: 'application/octet-stream' }), fileName);
|
|
37
|
+
} else {
|
|
38
|
+
file = new File([fileStream], fileName, {
|
|
39
|
+
type: 'application/octet-stream',
|
|
40
|
+
lastModified: Date.now(),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const objectURL = URL.createObjectURL(file);
|
|
45
|
+
const fileLink = document.createElement('a');
|
|
46
|
+
fileLink.href = objectURL;
|
|
47
|
+
fileLink.download = fileName;
|
|
48
|
+
|
|
49
|
+
// Without appending to an HTML Element, download dialog does not show up on Firefox
|
|
50
|
+
// https://github.com/verdaccio/ui/issues/119
|
|
51
|
+
document.documentElement.appendChild(fileLink);
|
|
52
|
+
fileLink.click();
|
|
53
|
+
// firefox requires remove the object url
|
|
54
|
+
setTimeout(() => {
|
|
55
|
+
URL.revokeObjectURL(objectURL);
|
|
56
|
+
document.documentElement.removeChild(fileLink);
|
|
57
|
+
}, 150);
|
|
58
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en-us">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>
|
|
7
|
+
ToReplaceByTitle
|
|
8
|
+
</title>
|
|
9
|
+
<base href="">
|
|
10
|
+
<link rel="icon" type="image/png" href="" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<script>
|
|
13
|
+
window.__VERDACCIO_BASENAME_UI_OPTIONS = JSON.parse('ToReplaceByVerdaccioUI');
|
|
14
|
+
</script>
|
|
15
|
+
<link rel="icon" href="-/static/favicon.ico"><script defer src="-/static/runtime.c57129036f278d0c7acf.js"></script><script defer src="-/static/vendors.c57129036f278d0c7acf.js"></script><script defer src="-/static/main.c57129036f278d0c7acf.js"></script></head>
|
|
16
|
+
|
|
17
|
+
<body class="body">
|
|
18
|
+
<div id="root"></div>
|
|
19
|
+
</body>
|
|
20
|
+
|
|
21
|
+
</html>
|