@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
package/package.json
CHANGED
|
@@ -1,230 +1,155 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
"verdaccio-auth-memory": "9.7.2",
|
|
156
|
-
"verdaccio-memory": "9.7.2",
|
|
157
|
-
"wait-on": "5.2.0",
|
|
158
|
-
"webpack": "5.36.0",
|
|
159
|
-
"webpack-bundle-analyzer": "3.8.0",
|
|
160
|
-
"webpack-bundle-size-analyzer": "3.1.0",
|
|
161
|
-
"webpack-cli": "~4.5.0",
|
|
162
|
-
"webpack-dev-server": "^3.11.0",
|
|
163
|
-
"webpack-manifest-plugin": "^3.0.0",
|
|
164
|
-
"webpack-merge": "^5.6.1",
|
|
165
|
-
"whatwg-fetch": "^3.6.2",
|
|
166
|
-
"xss": "1.0.8"
|
|
167
|
-
},
|
|
168
|
-
"keywords": [
|
|
169
|
-
"verdaccio",
|
|
170
|
-
"verdaccio-plugin",
|
|
171
|
-
"verdaccio-theme"
|
|
172
|
-
],
|
|
173
|
-
"bundlesize": [
|
|
174
|
-
{
|
|
175
|
-
"path": "./static/vendors.*.js",
|
|
176
|
-
"maxSize": "900 kB"
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"path": "./static/main.*.js",
|
|
180
|
-
"maxSize": "400 kB"
|
|
181
|
-
}
|
|
182
|
-
],
|
|
183
|
-
"scripts": {
|
|
184
|
-
"type-check": "tsc --noEmit --pretty",
|
|
185
|
-
"type-check:watch": "yarn run type-check -- --watch",
|
|
186
|
-
"release": "standard-version -a",
|
|
187
|
-
"test:clean": "jest --clearCache",
|
|
188
|
-
"test:acceptance": "codeceptjs run --steps",
|
|
189
|
-
"test:acceptance:server": "concurrently --kill-others \"yarn run verdaccio:server\" \"yarn run test:acceptance\"",
|
|
190
|
-
"test:e2e": " jest --config ./test/jest.config.e2e.js --runInBand",
|
|
191
|
-
"test": "BABEL_ENV=test NODE_ENV=test TZ=UTC jest --config ./jest/jest.config.js --maxWorkers 2 --passWithNoTests",
|
|
192
|
-
"test:update-snapshot": "yarn run test -- -u",
|
|
193
|
-
"test:size": "bundlesize",
|
|
194
|
-
"lint": "yarn run lint:js && yarn run lint:css",
|
|
195
|
-
"lint:js": "yarn run type-check && eslint . --ext .js,.ts,.tsx",
|
|
196
|
-
"lint:css": "yarn stylelint \"src/**/styles.ts\"",
|
|
197
|
-
"coverage:publish": "codecov",
|
|
198
|
-
"dev:web": "babel-node tools/dev.server.js",
|
|
199
|
-
"verdaccio:server": "node tools/verdaccio.js",
|
|
200
|
-
"build": "webpack --config tools/webpack.prod.config.babel.js",
|
|
201
|
-
"build:stats": "webpack --config tools/webpack.prod.config.babel.js --json > stats.json",
|
|
202
|
-
"build:size": "webpack --config tools/webpack.prod.config.babel.js --json | webpack-bundle-size-analyzer",
|
|
203
|
-
"dev": "concurrently --kill-others \"yarn run dev:web\" \"yarn run verdaccio:server\""
|
|
204
|
-
},
|
|
205
|
-
"husky": {
|
|
206
|
-
"hooks": {
|
|
207
|
-
"pre-commit": "lint-staged --relative",
|
|
208
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
"lint-staged": {
|
|
212
|
-
"*.{js,tsx,ts}": [
|
|
213
|
-
"eslint . --ext .js,.ts,.tsx"
|
|
214
|
-
],
|
|
215
|
-
"*": [
|
|
216
|
-
"git add"
|
|
217
|
-
]
|
|
218
|
-
},
|
|
219
|
-
"license": "MIT",
|
|
220
|
-
"commitlint": {
|
|
221
|
-
"extends": [
|
|
222
|
-
"@commitlint/config-conventional"
|
|
223
|
-
]
|
|
224
|
-
},
|
|
225
|
-
"collective": {
|
|
226
|
-
"type": "opencollective",
|
|
227
|
-
"url": "https://opencollective.com/verdaccio",
|
|
228
|
-
"logo": "https://opencollective.com/verdaccio/logo.txt"
|
|
229
|
-
}
|
|
2
|
+
"name": "@verdaccio/ui-theme",
|
|
3
|
+
"version": "6.0.0-6-next.11",
|
|
4
|
+
"description": "Verdaccio User Interface",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Verdaccio Contributors",
|
|
7
|
+
"email": "verdaccio.npm@gmail.com"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "https",
|
|
11
|
+
"url": "https://github.com/verdaccio/verdaccio"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://verdaccio.org",
|
|
14
|
+
"main": "index.js",
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=10",
|
|
17
|
+
"npm": ">=6"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/react": "17.0.19",
|
|
21
|
+
"@types/react-autosuggest": "10.1.5",
|
|
22
|
+
"@types/react-dom": "17.0.9",
|
|
23
|
+
"@types/react-helmet": "6.1.2",
|
|
24
|
+
"@types/redux": "3.6.0",
|
|
25
|
+
"@types/react-router-dom": "5.1.8",
|
|
26
|
+
"@types/react-virtualized": "9.21.13",
|
|
27
|
+
"@emotion/core": "10.1.1",
|
|
28
|
+
"@emotion/jest": "11.3.0",
|
|
29
|
+
"@emotion/styled": "10.0.27",
|
|
30
|
+
"@emotion/styled-base": "^10.0.31",
|
|
31
|
+
"@material-ui/core": "4.11.4",
|
|
32
|
+
"@material-ui/icons": "4.11.2",
|
|
33
|
+
"@material-ui/styles": "4.11.4",
|
|
34
|
+
"@rematch/core": "2.1.0",
|
|
35
|
+
"@rematch/loading": "2.1.0",
|
|
36
|
+
"@testing-library/dom": "8.5.0",
|
|
37
|
+
"@testing-library/jest-dom": "5.14.1",
|
|
38
|
+
"@testing-library/react": "12.1.0",
|
|
39
|
+
"@verdaccio/node-api": "6.0.0-6-next.21",
|
|
40
|
+
"autosuggest-highlight": "3.1.1",
|
|
41
|
+
"babel-loader": "8.2.2",
|
|
42
|
+
"babel-plugin-dynamic-import-node": "2.3.3",
|
|
43
|
+
"babel-plugin-emotion": "10.2.2",
|
|
44
|
+
"bundlesize": "0.18.1",
|
|
45
|
+
"css-loader": "6.2.0",
|
|
46
|
+
"dayjs": "1.10.6",
|
|
47
|
+
"emotion": "10.0.27",
|
|
48
|
+
"emotion-theming": "10.0.27",
|
|
49
|
+
"friendly-errors-webpack-plugin": "1.7.0",
|
|
50
|
+
"github-markdown-css": "4.0.0",
|
|
51
|
+
"harmony-reflect": "1.6.2",
|
|
52
|
+
"history": "4.10.1",
|
|
53
|
+
"html-webpack-plugin": "5.3.2",
|
|
54
|
+
"i18next": "20.6.1",
|
|
55
|
+
"in-publish": "2.0.1",
|
|
56
|
+
"country-flag-icons": "1.4.10",
|
|
57
|
+
"js-base64": "3.6.1",
|
|
58
|
+
"js-yaml": "3.14.1",
|
|
59
|
+
"localstorage-memory": "1.0.3",
|
|
60
|
+
"lodash": "4.17.21",
|
|
61
|
+
"mini-css-extract-plugin": "2.2.2",
|
|
62
|
+
"mutationobserver-shim": "0.3.7",
|
|
63
|
+
"node-mocks-http": "1.10.1",
|
|
64
|
+
"normalize.css": "8.0.1",
|
|
65
|
+
"optimize-css-assets-webpack-plugin": "6.0.1",
|
|
66
|
+
"ora": "5.4.1",
|
|
67
|
+
"prop-types": "15.7.2",
|
|
68
|
+
"react": "17.0.2",
|
|
69
|
+
"react-autosuggest": "10.1.0",
|
|
70
|
+
"react-dom": "17.0.2",
|
|
71
|
+
"react-hook-form": "7.15.3",
|
|
72
|
+
"react-hot-loader": "4.13.0",
|
|
73
|
+
"react-i18next": "11.12.0",
|
|
74
|
+
"react-router": "5.2.1",
|
|
75
|
+
"react-router-dom": "5.3.0",
|
|
76
|
+
"react-virtualized": "9.22.3",
|
|
77
|
+
"react-redux": "7.2.1",
|
|
78
|
+
"redux": "4.1.1",
|
|
79
|
+
"rimraf": "3.0.2",
|
|
80
|
+
"msw": "0.35.0",
|
|
81
|
+
"standard-version": "9.3.1",
|
|
82
|
+
"style-loader": "3.2.1",
|
|
83
|
+
"stylelint": "13.13.1",
|
|
84
|
+
"stylelint-config-recommended": "5.0.0",
|
|
85
|
+
"stylelint-config-styled-components": "0.1.1",
|
|
86
|
+
"stylelint-processor-styled-components": "1.10.0",
|
|
87
|
+
"stylelint-webpack-plugin": "3.0.1",
|
|
88
|
+
"supertest": "6.1.6",
|
|
89
|
+
"terser-webpack-plugin": "5.2.3",
|
|
90
|
+
"url-loader": "4.1.1",
|
|
91
|
+
"validator": "13.6.0",
|
|
92
|
+
"webpack": "5.52.0",
|
|
93
|
+
"webpack-bundle-analyzer": "4.4.2",
|
|
94
|
+
"webpack-bundle-size-analyzer": "3.1.0",
|
|
95
|
+
"webpack-cli": "^4.7.2",
|
|
96
|
+
"webpack-dev-server": "3.11.2",
|
|
97
|
+
"webpack-manifest-plugin": "4.0.2",
|
|
98
|
+
"webpack-merge": "5.8.0",
|
|
99
|
+
"whatwg-fetch": "3.6.2",
|
|
100
|
+
"xss": "1.0.9"
|
|
101
|
+
},
|
|
102
|
+
"keywords": [
|
|
103
|
+
"private",
|
|
104
|
+
"package",
|
|
105
|
+
"repository",
|
|
106
|
+
"registry",
|
|
107
|
+
"enterprise",
|
|
108
|
+
"modules",
|
|
109
|
+
"proxy",
|
|
110
|
+
"server",
|
|
111
|
+
"verdaccio"
|
|
112
|
+
],
|
|
113
|
+
"bundlesize": [
|
|
114
|
+
{
|
|
115
|
+
"path": "./static/vendors.*.js",
|
|
116
|
+
"maxSize": "900 kB"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"path": "./static/main.*.js",
|
|
120
|
+
"maxSize": "400 kB"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"path": "./static/*.svg",
|
|
124
|
+
"maxSize": "1.3 kB"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"path": "./static/*.png",
|
|
128
|
+
"maxSize": "15 kB"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"path": "./static/fonts/*.{woff,woff2}",
|
|
132
|
+
"maxSize": "20 kB"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"license": "MIT",
|
|
136
|
+
"collective": {
|
|
137
|
+
"type": "opencollective",
|
|
138
|
+
"url": "https://opencollective.com/verdaccio",
|
|
139
|
+
"logo": "https://opencollective.com/verdaccio/logo.txt"
|
|
140
|
+
},
|
|
141
|
+
"scripts": {
|
|
142
|
+
"type-check": "tsc --noEmit -p tsconfig.build.json",
|
|
143
|
+
"start": "babel-node tools/dev.server.js",
|
|
144
|
+
"test:clean": "jest --clearCache",
|
|
145
|
+
"test": "cross-env BABEL_ENV=test cross-env NODE_ENV=test cross-env TZ=UTC jest --config ./jest/jest.config.js --runInBand",
|
|
146
|
+
"test:update-snapshot": "yarn run test -- -u",
|
|
147
|
+
"test:size": "bundlesize",
|
|
148
|
+
"lint": "pnpm lint:js && pnpm lint:css",
|
|
149
|
+
"lint:css": "yarn stylelint \"src/**/styles.ts\"",
|
|
150
|
+
"verdaccio:server": "node tools/verdaccio.js",
|
|
151
|
+
"build": "webpack --config tools/webpack.prod.config.babel.js",
|
|
152
|
+
"build:stats": "webpack --config tools/webpack.prod.config.babel.js --json > stats.json",
|
|
153
|
+
"build:size": "webpack --config tools/webpack.prod.config.babel.js --json | webpack-bundle-size-analyzer"
|
|
154
|
+
}
|
|
230
155
|
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
renderWithStore,
|
|
5
|
+
act,
|
|
6
|
+
waitFor,
|
|
7
|
+
fireEvent,
|
|
8
|
+
screen,
|
|
9
|
+
} from 'verdaccio-ui/utils/test-react-testing-library';
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line jest/no-mocks-import
|
|
12
|
+
import { generateTokenWithTimeRange } from '../../jest/unit/components/__mocks__/token';
|
|
13
|
+
import { store } from '../store';
|
|
14
|
+
|
|
15
|
+
import App from './App';
|
|
16
|
+
|
|
17
|
+
jest.mock('verdaccio-ui/utils/storage', () => {
|
|
18
|
+
class LocalStorageMock {
|
|
19
|
+
private store: Record<string, string>;
|
|
20
|
+
public constructor() {
|
|
21
|
+
this.store = {};
|
|
22
|
+
}
|
|
23
|
+
public clear(): void {
|
|
24
|
+
this.store = {};
|
|
25
|
+
}
|
|
26
|
+
public getItem(key: string): unknown {
|
|
27
|
+
return this.store[key] || null;
|
|
28
|
+
}
|
|
29
|
+
public setItem(key: string, value: string): void {
|
|
30
|
+
this.store[key] = value.toString();
|
|
31
|
+
}
|
|
32
|
+
public removeItem(key: string): void {
|
|
33
|
+
delete this.store[key];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return new LocalStorageMock();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// force the windows to expand to display items
|
|
40
|
+
// https://github.com/bvaughn/react-virtualized/issues/493#issuecomment-640084107
|
|
41
|
+
jest.spyOn(HTMLElement.prototype, 'offsetHeight', 'get').mockReturnValue(600);
|
|
42
|
+
jest.spyOn(HTMLElement.prototype, 'offsetWidth', 'get').mockReturnValue(600);
|
|
43
|
+
|
|
44
|
+
/* eslint-disable react/jsx-no-bind*/
|
|
45
|
+
describe('<App />', () => {
|
|
46
|
+
describe('login - log out', () => {
|
|
47
|
+
test('handleLogout - logouts the user and clear localstorage', async () => {
|
|
48
|
+
const { queryByTestId } = renderWithStore(<App />, store);
|
|
49
|
+
store.dispatch.login.logInUser({
|
|
50
|
+
username: 'verdaccio',
|
|
51
|
+
token: generateTokenWithTimeRange(24),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// wait for the Account's circle element component appearance and return the element
|
|
55
|
+
const accountCircleElement = await waitFor(() => queryByTestId('logInDialogIcon'));
|
|
56
|
+
expect(accountCircleElement).toBeTruthy();
|
|
57
|
+
|
|
58
|
+
if (accountCircleElement) {
|
|
59
|
+
fireEvent.click(accountCircleElement);
|
|
60
|
+
|
|
61
|
+
// wait for the Button's logout element component appearance and return the element
|
|
62
|
+
const buttonLogoutElement = await waitFor(() => queryByTestId('logOutDialogIcon'));
|
|
63
|
+
expect(buttonLogoutElement).toBeTruthy();
|
|
64
|
+
|
|
65
|
+
if (buttonLogoutElement) {
|
|
66
|
+
fireEvent.click(buttonLogoutElement);
|
|
67
|
+
|
|
68
|
+
expect(queryByTestId('greetings-label')).toBeFalsy();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test('isUserAlreadyLoggedIn: token already available in storage', async () => {
|
|
74
|
+
const { queryByTestId, queryAllByText } = renderWithStore(<App />, store);
|
|
75
|
+
store.dispatch.login.logInUser({
|
|
76
|
+
username: 'verdaccio',
|
|
77
|
+
token: generateTokenWithTimeRange(24),
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// wait for the Account's circle element component appearance and return the element
|
|
81
|
+
const accountCircleElement = await waitFor(() => queryByTestId('logInDialogIcon'));
|
|
82
|
+
expect(accountCircleElement).toBeTruthy();
|
|
83
|
+
|
|
84
|
+
if (accountCircleElement) {
|
|
85
|
+
fireEvent.click(accountCircleElement);
|
|
86
|
+
|
|
87
|
+
// wait for the Greeting's label element component appearance and return the element
|
|
88
|
+
const greetingsLabelElement = await waitFor(() => queryByTestId('greetings-label'));
|
|
89
|
+
expect(greetingsLabelElement).toBeTruthy();
|
|
90
|
+
|
|
91
|
+
if (greetingsLabelElement) {
|
|
92
|
+
expect(queryAllByText('verdaccio')).toBeTruthy();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
describe('list packages', () => {
|
|
99
|
+
test('should display the Header component', async () => {
|
|
100
|
+
renderWithStore(<App />, store);
|
|
101
|
+
|
|
102
|
+
await waitFor(() => {
|
|
103
|
+
expect(screen.queryByTestId('loading')).toBeTruthy();
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// wait for the Header component appearance and return the element
|
|
107
|
+
const headerElement = await waitFor(() => screen.queryByTestId('header'));
|
|
108
|
+
expect(headerElement).toBeTruthy();
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test('should display package lists', async () => {
|
|
112
|
+
act(() => {
|
|
113
|
+
renderWithStore(<App />, store);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
await waitFor(() => {
|
|
117
|
+
expect(screen.getByTestId('package-item-list')).toBeInTheDocument();
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
expect(store.getState().packages.response).toHaveLength(1);
|
|
121
|
+
}, 10000);
|
|
122
|
+
});
|
|
123
|
+
});
|
package/src/App/App.tsx
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-max-depth */
|
|
2
|
+
import styled from '@emotion/styled';
|
|
3
|
+
import React, { useEffect, Suspense } from 'react';
|
|
4
|
+
import { Router } from 'react-router-dom';
|
|
5
|
+
|
|
6
|
+
import Box from 'verdaccio-ui/components/Box';
|
|
7
|
+
import Loading from 'verdaccio-ui/components/Loading';
|
|
8
|
+
import loadDayJSLocale from 'verdaccio-ui/design-tokens/load-dayjs-locale';
|
|
9
|
+
import StyleBaseline from 'verdaccio-ui/design-tokens/StyleBaseline';
|
|
10
|
+
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
11
|
+
|
|
12
|
+
import AppRoute, { history } from './AppRoute';
|
|
13
|
+
import Footer from './Footer';
|
|
14
|
+
import Header from './Header';
|
|
15
|
+
|
|
16
|
+
import '../i18n/config';
|
|
17
|
+
|
|
18
|
+
const StyledBox = styled(Box)<{ theme?: Theme }>(({ theme }) => ({
|
|
19
|
+
backgroundColor: theme?.palette.background.default,
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
const StyledBoxContent = styled(Box)<{ theme?: Theme }>(({ theme }) => ({
|
|
23
|
+
[`@media screen and (min-width: ${theme?.breakPoints.container}px)`]: {
|
|
24
|
+
maxWidth: theme?.breakPoints.container,
|
|
25
|
+
width: '100%',
|
|
26
|
+
marginLeft: 'auto',
|
|
27
|
+
marginRight: 'auto',
|
|
28
|
+
},
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
const App: React.FC = () => {
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
loadDayJSLocale();
|
|
34
|
+
}, []);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Suspense fallback={<Loading />}>
|
|
38
|
+
<StyleBaseline />
|
|
39
|
+
<StyledBox display="flex" flexDirection="column" height="100%">
|
|
40
|
+
<>
|
|
41
|
+
<Router history={history}>
|
|
42
|
+
<Header />
|
|
43
|
+
<StyledBoxContent flexGrow={1}>
|
|
44
|
+
<AppRoute />
|
|
45
|
+
</StyledBoxContent>
|
|
46
|
+
</Router>
|
|
47
|
+
<Footer />
|
|
48
|
+
</>
|
|
49
|
+
</StyledBox>
|
|
50
|
+
</Suspense>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default App;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ErrorProps {
|
|
4
|
+
children: any;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ErrorAppState {
|
|
8
|
+
hasError: boolean;
|
|
9
|
+
error: Error | null;
|
|
10
|
+
info: object | null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default class ErrorBoundary extends Component<ErrorProps, ErrorAppState> {
|
|
14
|
+
constructor(props: ErrorProps) {
|
|
15
|
+
super(props);
|
|
16
|
+
this.state = { hasError: false, error: null, info: null };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public componentDidCatch(error: Error, info: object) {
|
|
20
|
+
this.setState({ hasError: true, error, info });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public render(): JSX.Element {
|
|
24
|
+
const { hasError, error, info } = this.state;
|
|
25
|
+
const { children } = this.props;
|
|
26
|
+
|
|
27
|
+
if (hasError) {
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
<h1>{'Something went wrong.'}</h1>
|
|
31
|
+
<p>{`error: ${error}`}</p>
|
|
32
|
+
<p>{`info: ${JSON.stringify(info)}`}</p>
|
|
33
|
+
</>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
return children;
|
|
37
|
+
}
|
|
38
|
+
}
|