@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/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
1
|

|
|
3
2
|
|
|
4
|
-
#
|
|
3
|
+
# @verdaccio/ui-theme
|
|
5
4
|
|
|
6
5
|
[Verdaccio](https://verdaccio.org/) UI is a [theme plugin](https://verdaccio.org/docs/en/dev-plugins#theme-plugin) build in React, Typescript and Emotion. It uses Jest and Testing Library for Unit testing.
|
|
7
6
|
|
|
8
|
-
|
|
9
7
|
[](https://www.npmjs.com/package/@verdaccio/ui-theme)
|
|
10
8
|
[](https://verdaccio.org/docs/en/docker.html)
|
|
11
9
|
[](https://opencollective.com/verdaccio)
|
|
@@ -16,57 +14,9 @@
|
|
|
16
14
|
[](https://crowdin.com/project/verdaccio)
|
|
17
15
|
[](https://codecov.io/gh/verdaccio/ui)
|
|
18
16
|
|
|
19
|
-
|
|
20
17
|
[](https://twitter.com/verdaccio_npm)
|
|
21
18
|
[](https://github.com/verdaccio/verdaccio/stargazers)
|
|
22
19
|
|
|
23
|
-
## Contributing
|
|
24
|
-
|
|
25
|
-
> If you are willing to ship an improvement for Verdaccio 5.x, here is the repo where you must contribute, but remember, if you are willing your feature persist in next major releases, you also need to PR [here](https://github.com/verdaccio/verdaccio/tree/master/packages/plugins/ui-theme) since this repo is intended to be archived after Verdaccio 5 is being deprecated in the future.
|
|
26
|
-
|
|
27
|
-
We use `>=yarn`, keep in mind that we use lockfiles and use at least Node `v14` to be able to build the project.
|
|
28
|
-
|
|
29
|
-
Install dependencies
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
yarn
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
For development run the following command, it will execute `webpack` and `verdaccio` to
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
yarn dev
|
|
39
|
-
```
|
|
40
|
-
The configuration file is located on `tools/_config.yaml`.
|
|
41
|
-
|
|
42
|
-
Run linting tooling and test to check your code is clean before commit.
|
|
43
|
-
|
|
44
|
-
> ⚠️ The development mode just emulate interaction of the UI development with a real verdaccio server, but it is not the real integration. UI is just a theme plugin dependency in the [Verdaccio project](https://github.com/verdaccio/verdaccio).
|
|
45
|
-
|
|
46
|
-
### Before commit
|
|
47
|
-
|
|
48
|
-
Don't forget run the following commands before commit and push your code, it will save you time.
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
yarn lint && yarn test
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
#### Commits
|
|
55
|
-
|
|
56
|
-
Remember we follow the [the Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0-beta.4/).
|
|
57
|
-
|
|
58
|
-
🤓 Feel free to participate in code reviews, let us know if you want to participate in this plugin.
|
|
59
|
-
|
|
60
|
-
### End to End Testing
|
|
61
|
-
|
|
62
|
-
Additionally, we recommend run E2E testing before push and verify your changes do not break anything. These command will run in our CI anyway.
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
yarn build && yarn test:e2e
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
> `yarn build` will build with webpack the production files.
|
|
69
|
-
|
|
70
20
|
## Special Thanks
|
|
71
21
|
|
|
72
22
|
Thanks to the following companies to help us to achieve our goals providing free open source licenses.
|
|
@@ -106,64 +56,41 @@ This project exists thanks to all the people who contribute.
|
|
|
106
56
|
|
|
107
57
|
If you have any issue you can try the following options, do no desist to ask or check our issues database, perhaps someone has asked already what you are looking for.
|
|
108
58
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
59
|
+
- [Blog](https://medium.com/verdaccio)
|
|
60
|
+
- [Donations](https://opencollective.com/verdaccio)
|
|
61
|
+
- [Roadmaps](https://github.com/verdaccio/ui/projects)
|
|
62
|
+
- [Reporting an issue](https://github.com/verdaccio/verdaccio/blob/master/CONTRIBUTING.md#reporting-a-bug)
|
|
63
|
+
- [Running discussions](https://github.com/verdaccio/verdaccio/issues?q=is%3Aissue+is%3Aopen+label%3Adiscuss)
|
|
64
|
+
- [Chat](http://chat.verdaccio.org/)
|
|
65
|
+
- [Logos](https://verdaccio.org/docs/en/logo)
|
|
66
|
+
- [FAQ](https://github.com/verdaccio/verdaccio/issues?utf8=%E2%9C%93&q=is%3Aissue%20label%3Aquestion%20)
|
|
67
|
+
- [Docker Examples](https://github.com/verdaccio/docker-examples)
|
|
118
68
|
|
|
119
69
|
### Translations
|
|
120
70
|
|
|
121
|
-
Translations are handled locally. I18n files can be found in the folder
|
|
71
|
+
Translations are handled locally. I18n files can be found in the folder `i18n/translations/*` of this repository. We would love to provide translations from other languages, embracing all our users, but unfortunately we cannot do this without your help. Would you like to help us? Please feel **super welcome** to add a locale by opening a pull request.
|
|
122
72
|
|
|
123
73
|
Your PR should contain:
|
|
124
74
|
|
|
125
|
-
1 - A json file in the folder
|
|
75
|
+
1 - A json file in the folder `i18n/translations/*` with the translations. The file must be named according to the new added language
|
|
126
76
|
|
|
127
|
-
2 - The files
|
|
77
|
+
2 - The files `i18n/config.ts` and `LanguageSwitch.tsx` updated with the new language. Please see the current structure
|
|
128
78
|
|
|
129
79
|
3 - The other translations containing the new language in the language of the file. Example:
|
|
130
80
|
|
|
131
|
-
New language:
|
|
132
|
-
|
|
133
|
-
The file ```pt-BR ``` should contain:
|
|
134
|
-
```
|
|
135
|
-
"lng": {
|
|
136
|
-
...,
|
|
137
|
-
"czech": "Tcheco"
|
|
138
|
-
}
|
|
139
|
-
```
|
|
81
|
+
New language: `cs_CZ `
|
|
140
82
|
|
|
141
|
-
|
|
83
|
+
The file `pt-BR ` should contain:
|
|
142
84
|
|
|
85
|
+
```
|
|
86
|
+
"lng": {
|
|
87
|
+
...,
|
|
88
|
+
"czech": "Tcheco"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
143
91
|
|
|
92
|
+
4 - A SVG flag of the new translated language in the the folder `src/components/Icon/img/*`. You maybe want to compress the svg file using https://jakearchibald.github.io/svgomg/
|
|
144
93
|
|
|
145
94
|
### License
|
|
146
95
|
|
|
147
96
|
Verdaccio is [MIT licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
### Contributors
|
|
151
|
-
|
|
152
|
-
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
153
|
-
<!-- prettier-ignore-start -->
|
|
154
|
-
<!-- markdownlint-disable -->
|
|
155
|
-
<table>
|
|
156
|
-
<tr>
|
|
157
|
-
<td align="center"><a href="https://www.linkedin.com/in/jotadeveloper/"><img src="https://avatars0.githubusercontent.com/u/558752?v=4" width="100px;" alt=""/><br /><sub><b>Juan Picado</b></sub></a><br /><a href="https://github.com/verdaccio/ui/commits?author=juanpicado" title="Documentation">📖</a> <a href="https://github.com/verdaccio/ui/commits?author=juanpicado" title="Code">💻</a> <a href="#infra-juanpicado" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#eventOrganizing-juanpicado" title="Event Organizing">📋</a> <a href="#blog-juanpicado" title="Blogposts">📝</a> <a href="#maintenance-juanpicado" title="Maintenance">🚧</a></td>
|
|
158
|
-
<td align="center"><a href="https://github.com/sergiohgz"><img src="https://avatars3.githubusercontent.com/u/14012309?v=4" width="100px;" alt=""/><br /><sub><b>Sergio Herrera</b></sub></a><br /><a href="#infra-sergiohgz" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-sergiohgz" title="Maintenance">🚧</a></td>
|
|
159
|
-
<td align="center"><a href="https://daniel-ruf.de/"><img src="https://avatars1.githubusercontent.com/u/827205?v=4" width="100px;" alt=""/><br /><sub><b>Daniel Ruf</b></sub></a><br /><a href="#security-DanielRuf" title="Security">🛡️</a> <a href="#infra-DanielRuf" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-DanielRuf" title="Maintenance">🚧</a></td>
|
|
160
|
-
<td align="center"><a href="https://priscilawebdev.github.io/priscilaoliveira/"><img src="https://avatars1.githubusercontent.com/u/29228205?v=4" width="100px;" alt=""/><br /><sub><b>Priscila Oliveira</b></sub></a><br /><a href="#design-priscilawebdev" title="Design">🎨</a> <a href="https://github.com/verdaccio/ui/commits?author=priscilawebdev" title="Code">💻</a> <a href="#maintenance-priscilawebdev" title="Maintenance">🚧</a></td>
|
|
161
|
-
<td align="center"><a href="https://github.com/VentyCZ"><img src="https://avatars1.githubusercontent.com/u/3247664?v=4" width="100px;" alt=""/><br /><sub><b>Jiří Michel</b></sub></a><br /><a href="https://github.com/verdaccio/ui/commits?author=VentyCZ" title="Code">💻</a> <a href="#maintenance-VentyCZ" title="Maintenance">🚧</a></td>
|
|
162
|
-
<td align="center"><a href="https://github.com/tso1158687"><img src="https://avatars2.githubusercontent.com/u/9198263?v=4" width="100px;" alt=""/><br /><sub><b>jason</b></sub></a><br /><a href="#translation-tso1158687" title="Translation">🌍</a> <a href="https://github.com/verdaccio/ui/commits?author=tso1158687" title="Code">💻</a></td>
|
|
163
|
-
<td align="center"><a href="http://ayusharma.github.io"><img src="https://avatars0.githubusercontent.com/u/6918450?v=4" width="100px;" alt=""/><br /><sub><b>Ayush Sharma</b></sub></a><br /><a href="#maintenance-ayusharma" title="Maintenance">🚧</a> <a href="https://github.com/verdaccio/ui/commits?author=ayusharma" title="Code">💻</a></td>
|
|
164
|
-
</tr>
|
|
165
|
-
</table>
|
|
166
|
-
|
|
167
|
-
<!-- markdownlint-enable -->
|
|
168
|
-
<!-- prettier-ignore-end -->
|
|
169
|
-
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
package/config/env.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "test",
|
|
4
|
+
"version": "1.0.22",
|
|
5
|
+
"description": "test",
|
|
6
|
+
"main": "src/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "http",
|
|
12
|
+
"url": "git+https://github.com/test/test.git"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [],
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "",
|
|
17
|
+
"email": "",
|
|
18
|
+
"url": "",
|
|
19
|
+
"avatar": "data:image/svg+xml;utf8,%3Csvg%20height%3D%22100%22%20viewBox%3D%22-27%2024%20100%20100%22%20width%3D%22100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cdefs%3E%3Ccircle%20cx%3D%2223%22%20cy%3D%2274%22%20id%3D%22a%22%20r%3D%2250%22%2F%3E%3C%2Fdefs%3E%3Cuse%20fill%3D%22%23F5EEE5%22%20overflow%3D%22visible%22%20xlink%3Ahref%3D%22%23a%22%2F%3E%3CclipPath%20id%3D%22b%22%3E%3Cuse%20overflow%3D%22visible%22%20xlink%3Ahref%3D%22%23a%22%2F%3E%3C%2FclipPath%3E%3Cg%20clip-path%3D%22url(%23b)%22%3E%3Cdefs%3E%3Cpath%20d%3D%22M36%2095.9c0%204%204.7%205.2%207.1%205.8%207.6%202%2022.8%205.9%2022.8%205.9%203.2%201.1%205.7%203.5%207.1%206.6v9.8H-27v-9.8c1.3-3.1%203.9-5.5%207.1-6.6%200%200%2015.2-3.9%2022.8-5.9%202.4-.6%207.1-1.8%207.1-5.8V85h26v10.9z%22%20id%3D%22c%22%2F%3E%3C%2Fdefs%3E%3Cuse%20fill%3D%22%23E6C19C%22%20overflow%3D%22visible%22%20xlink%3Ahref%3D%22%23c%22%2F%3E%3CclipPath%20id%3D%22d%22%3E%3Cuse%20overflow%3D%22visible%22%20xlink%3Ahref%3D%22%23c%22%2F%3E%3C%2FclipPath%3E%3Cpath%20clip-path%3D%22url(%23d)%22%20d%3D%22M23.2%2035h.2c3.3%200%208.2.2%2011.4%202%203.3%201.9%207.3%205.6%208.5%2012.1%202.4%2013.7-2.1%2035.4-6.3%2042.4-4%206.7-9.8%209.2-13.5%209.4H23h-.1c-3.7-.2-9.5-2.7-13.5-9.4-4.2-7-8.7-28.7-6.3-42.4%201.2-6.5%205.2-10.2%208.5-12.1%203.2-1.8%208.1-2%2011.4-2h.2z%22%20fill%3D%22%23D4B08C%22%2F%3E%3C%2Fg%3E%3Cpath%20d%3D%22M22.6%2040c19.1%200%2020.7%2013.8%2020.8%2015.1%201.1%2011.9-3%2028.1-6.8%2033.7-4%205.9-9.8%208.1-13.5%208.3h-.5c-3.8-.3-9.6-2.5-13.6-8.4-3.8-5.6-7.9-21.8-6.8-33.8C2.3%2053.7%203.5%2040%2022.6%2040z%22%20fill%3D%22%23F2CEA5%22%2F%3E%3C%2Fsvg%3E"
|
|
20
|
+
},
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"lodash": "^4.17.21"
|
|
24
|
+
},
|
|
25
|
+
"readmeFilename": "README.md",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/test/test/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/test/test#readme",
|
|
30
|
+
"_id": "test@1.0.22",
|
|
31
|
+
"_nodeVersion": "14.17.4",
|
|
32
|
+
"_npmVersion": "7.20.5",
|
|
33
|
+
"dist": {
|
|
34
|
+
"integrity": "sha512-2IDD0lLzGUL7YJ+17Oh9VtbOwdKLqBLS+ZFATDXi5R22TL2hZ9LBFE10bzsDovNc4xtgwZAk1/K+5LHTye4ztg==",
|
|
35
|
+
"shasum": "c9152f57636bce762ccb5a83113c42a5831579bc",
|
|
36
|
+
"tarball": "http://localhost:4873/test/-/test-1.0.22.tgz"
|
|
37
|
+
},
|
|
38
|
+
"contributors": [],
|
|
39
|
+
"time": "2021-08-14T20:15:19.336Z",
|
|
40
|
+
"users": {}
|
|
41
|
+
}
|
|
42
|
+
]
|
package/jest/identity.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
let Reflect;
|
|
3
|
+
let idObj;
|
|
4
|
+
|
|
5
|
+
function checkIsNodeV6OrAbove() {
|
|
6
|
+
if (typeof process === 'undefined') {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return parseInt(process.versions.node.split('.')[0], 10) >= 6;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (!checkIsNodeV6OrAbove()) {
|
|
14
|
+
Reflect = require('harmony-reflect');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
idObj = new Proxy(
|
|
18
|
+
{},
|
|
19
|
+
{
|
|
20
|
+
get: function getter(target, key) {
|
|
21
|
+
if (key === '__esModule') {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
return key;
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
module.exports = idObj;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const config = require('../../../../jest/config');
|
|
2
|
+
|
|
3
|
+
module.exports = Object.assign({}, config, {
|
|
4
|
+
name: 'verdaccio-ui-jest',
|
|
5
|
+
verbose: true,
|
|
6
|
+
automock: false,
|
|
7
|
+
collectCoverage: true,
|
|
8
|
+
testEnvironment: 'jest-environment-jsdom-global',
|
|
9
|
+
transform: {
|
|
10
|
+
'^.+\\.(js|ts|tsx)$': 'babel-jest',
|
|
11
|
+
},
|
|
12
|
+
moduleFileExtensions: ['js', 'ts', 'tsx'],
|
|
13
|
+
testURL: 'http://localhost:9000/',
|
|
14
|
+
rootDir: '..',
|
|
15
|
+
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect', '<rootDir>/jest/setup-env.ts'],
|
|
16
|
+
setupFiles: ['<rootDir>/jest/setup.ts'],
|
|
17
|
+
transformIgnorePatterns: ['<rootDir>/node_modules/(?!react-syntax-highlighter)'],
|
|
18
|
+
modulePathIgnorePatterns: [
|
|
19
|
+
'<rootDir>/coverage',
|
|
20
|
+
'<rootDir>/scripts',
|
|
21
|
+
'<rootDir>/.circleci',
|
|
22
|
+
'<rootDir>/tools',
|
|
23
|
+
'<rootDir>/build',
|
|
24
|
+
'<rootDir>/.vscode/',
|
|
25
|
+
'<rootDir>/test/e2e/',
|
|
26
|
+
],
|
|
27
|
+
snapshotSerializers: ['@emotion/jest/serializer'],
|
|
28
|
+
moduleNameMapper: {
|
|
29
|
+
'\\.(s?css)$': '<rootDir>/jest/identity.js',
|
|
30
|
+
'\\.(png)$': '<rootDir>/jest/identity.js',
|
|
31
|
+
'\\.(svg)$': '<rootDir>/jest/unit/empty.ts',
|
|
32
|
+
'github-markdown-css': '<rootDir>/jest/identity.js',
|
|
33
|
+
// note: this section has to be on sync with webpack configuration
|
|
34
|
+
'verdaccio-ui/components/(.*)': '<rootDir>/src/components/$1',
|
|
35
|
+
'verdaccio-ui/utils/(.*)': '<rootDir>/src/utils/$1',
|
|
36
|
+
'verdaccio-ui/providers/(.*)': '<rootDir>/src/providers/$1',
|
|
37
|
+
'verdaccio-ui/design-tokens/(.*)': '<rootDir>/src/design-tokens/$1',
|
|
38
|
+
},
|
|
39
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
jest.requireActual('babel/polyfill');
|
package/jest/server.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
2
|
+
import 'whatwg-fetch';
|
|
3
|
+
import '@testing-library/jest-dom';
|
|
4
|
+
|
|
5
|
+
import { server } from './server';
|
|
6
|
+
|
|
7
|
+
beforeAll(() => {
|
|
8
|
+
server.listen({
|
|
9
|
+
onUnhandledRequest: 'warn',
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
afterEach(() => server.resetHandlers());
|
|
13
|
+
afterAll(() => {
|
|
14
|
+
server.close();
|
|
15
|
+
});
|
package/jest/setup.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup configuration for Jest
|
|
3
|
+
* This file includes global settings for the JEST environment.
|
|
4
|
+
*/
|
|
5
|
+
import 'mutationobserver-shim';
|
|
6
|
+
|
|
7
|
+
// @ts-ignore : Property '__VERDACCIO_BASENAME_UI_OPTIONS' does not exist on type 'Global'.
|
|
8
|
+
global.__VERDACCIO_BASENAME_UI_OPTIONS = {
|
|
9
|
+
base: 'http://localhost:9000/',
|
|
10
|
+
protocol: 'http',
|
|
11
|
+
host: 'localhost',
|
|
12
|
+
primaryColor: '#4b5e40',
|
|
13
|
+
url_prefix: '',
|
|
14
|
+
darkMode: false,
|
|
15
|
+
language: 'en-US',
|
|
16
|
+
uri: 'http://localhost:9000/',
|
|
17
|
+
pkgManagers: ['pnpm', 'yarn', 'npm'],
|
|
18
|
+
title: 'Verdaccio Dev UI',
|
|
19
|
+
scope: '',
|
|
20
|
+
version: 'v1.0.0',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// mocking few DOM methods
|
|
24
|
+
// @ts-ignore : Property 'document' does not exist on type 'Global'.
|
|
25
|
+
if (global.document) {
|
|
26
|
+
// @ts-ignore : Type 'Mock<{ selectNodeContents: () => void; }, []>' is not assignable to type '() => Range'.
|
|
27
|
+
document.createRange = jest.fn((): void => ({
|
|
28
|
+
selectNodeContents: (): void => {},
|
|
29
|
+
}));
|
|
30
|
+
document.execCommand = jest.fn();
|
|
31
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Mocks for WebUI
|
|
3
|
+
*/
|
|
4
|
+
import login from '../store/login';
|
|
5
|
+
import logo from '../store/logo';
|
|
6
|
+
import { packageInformation } from '../store/package';
|
|
7
|
+
import { packageMeta } from '../store/packageMeta';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Register mock api endpoints
|
|
11
|
+
* @param {string} endpoint
|
|
12
|
+
* @returns {Promise}
|
|
13
|
+
*/
|
|
14
|
+
const register = (url, method = 'get', options = {}) => {
|
|
15
|
+
if (url === 'login' && method.toLocaleLowerCase() === 'post') {
|
|
16
|
+
return login(options);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (url === 'logo' && method.toLocaleLowerCase() === 'get') {
|
|
20
|
+
return logo();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (url === 'sidebar/verdaccio' && method.toLocaleLowerCase() === 'get') {
|
|
24
|
+
return new Promise(function (resolve) {
|
|
25
|
+
resolve(packageMeta);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (url === 'packages' && method.toLocaleLowerCase() === 'get') {
|
|
30
|
+
return new Promise(function (resolve) {
|
|
31
|
+
resolve(packageInformation);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
throw Error(`URL not found: ${url}`);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Bind API methods
|
|
40
|
+
*/
|
|
41
|
+
class API {
|
|
42
|
+
public request(...rest) {
|
|
43
|
+
return register.call(null, ...rest);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default new API();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token Utility
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import dayjs from 'dayjs';
|
|
6
|
+
import { Base64 } from 'js-base64';
|
|
7
|
+
|
|
8
|
+
export function generateTokenWithTimeRange(amount = 0) {
|
|
9
|
+
const payload = {
|
|
10
|
+
username: 'verdaccio',
|
|
11
|
+
exp: Number.parseInt(String(dayjs(new Date()).add(amount, 'hour').valueOf() / 1000), 10),
|
|
12
|
+
};
|
|
13
|
+
return `xxxxxx.${Base64.encode(JSON.stringify(payload))}.xxxxxx`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function generateTokenWithExpirationAsString() {
|
|
17
|
+
const payload = { username: 'verdaccio', exp: 'I am not a number' };
|
|
18
|
+
return `xxxxxx.${Base64.encode(JSON.stringify(payload))}.xxxxxx`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function generateInvalidToken() {
|
|
22
|
+
const payload = `invalidtoken`;
|
|
23
|
+
return `xxxxxx.${Base64.encode(payload)}.xxxxxx`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function generateTokenWithOutExpiration() {
|
|
27
|
+
const payload = {
|
|
28
|
+
username: 'verdaccio',
|
|
29
|
+
};
|
|
30
|
+
return `xxxxxx.${Base64.encode(JSON.stringify(payload))}.xxxxxx`;
|
|
31
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { API_ERROR } from '../../../../lib/constants';
|
|
2
|
+
/**
|
|
3
|
+
* API mock for login endpoint
|
|
4
|
+
* @param {object} config configuration of api call
|
|
5
|
+
* @returns {promise}
|
|
6
|
+
*/
|
|
7
|
+
export default function login(config): Promise<unknown> {
|
|
8
|
+
return new Promise(function loginCallbackPromise(resolve, reject): void {
|
|
9
|
+
const body = JSON.parse(config.body);
|
|
10
|
+
if (body.username === 'sam' && body.password === '1234') {
|
|
11
|
+
resolve({
|
|
12
|
+
username: 'sam',
|
|
13
|
+
token: 'TEST_TOKEN',
|
|
14
|
+
});
|
|
15
|
+
} else {
|
|
16
|
+
// perhaps we should rethink this reject regarding the eslint rule
|
|
17
|
+
/* eslint-disable prefer-promise-reject-errors */
|
|
18
|
+
reject({
|
|
19
|
+
error: API_ERROR.BAD_USERNAME_PASSWORD,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
export const packageInformation = [
|
|
2
|
+
{
|
|
3
|
+
name: 'jquery',
|
|
4
|
+
title: 'jQuery',
|
|
5
|
+
description: 'JavaScript library for DOM operations',
|
|
6
|
+
version: '3.3.2-pre',
|
|
7
|
+
main: 'dist/jquery.js',
|
|
8
|
+
homepage: 'https://jquery.com',
|
|
9
|
+
author: {
|
|
10
|
+
name: 'JS Foundation and other contributors',
|
|
11
|
+
url: 'https://github.com/jquery/jquery/blob/master/AUTHORS.txt',
|
|
12
|
+
avatar: '',
|
|
13
|
+
},
|
|
14
|
+
repository: {
|
|
15
|
+
type: 'git',
|
|
16
|
+
url: 'https://github.com/jquery/jquery.git',
|
|
17
|
+
},
|
|
18
|
+
keywords: ['jquery', 'javascript', 'browser', 'library'],
|
|
19
|
+
bugs: {
|
|
20
|
+
url: 'https://github.com/jquery/jquery/issues',
|
|
21
|
+
},
|
|
22
|
+
license: 'MIT',
|
|
23
|
+
dependencies: {},
|
|
24
|
+
devDependencies: {
|
|
25
|
+
'babel-core': '7.0.0-beta.0',
|
|
26
|
+
'babel-plugin-transform-es2015-for-of': '7.0.0-beta.0',
|
|
27
|
+
commitplease: '3.2.0',
|
|
28
|
+
'core-js': '2.5.7',
|
|
29
|
+
'eslint-config-jquery': '1.0.1',
|
|
30
|
+
grunt: '1.0.3',
|
|
31
|
+
'grunt-babel': '7.0.0',
|
|
32
|
+
'grunt-cli': '1.2.0',
|
|
33
|
+
'grunt-compare-size': '0.4.2',
|
|
34
|
+
'grunt-contrib-uglify': '3.3.0',
|
|
35
|
+
'grunt-contrib-watch': '1.1.0',
|
|
36
|
+
'grunt-eslint': '20.2.0',
|
|
37
|
+
'grunt-git-authors': '3.2.0',
|
|
38
|
+
'grunt-jsonlint': '1.1.0',
|
|
39
|
+
'grunt-karma': '2.0.0',
|
|
40
|
+
'grunt-newer': '1.3.0',
|
|
41
|
+
'grunt-npmcopy': '0.1.0',
|
|
42
|
+
'gzip-js': '0.3.2',
|
|
43
|
+
husky: '0.14.3',
|
|
44
|
+
insight: '0.10.1',
|
|
45
|
+
jsdom: '5.6.1',
|
|
46
|
+
karma: '2.0.3',
|
|
47
|
+
'karma-browserstack-launcher': '1.3.0',
|
|
48
|
+
'karma-chrome-launcher': '2.2.0',
|
|
49
|
+
'karma-firefox-launcher': '1.1.0',
|
|
50
|
+
'karma-qunit': '1.2.1',
|
|
51
|
+
'load-grunt-tasks': '4.0.0',
|
|
52
|
+
'native-promise-only': '0.8.1',
|
|
53
|
+
'promises-aplus-tests': '2.1.2',
|
|
54
|
+
q: '1.5.1',
|
|
55
|
+
'qunit-assert-step': '1.1.1',
|
|
56
|
+
qunitjs: '1.23.1',
|
|
57
|
+
'raw-body': '2.3.3',
|
|
58
|
+
requirejs: '2.3.5',
|
|
59
|
+
sinon: '2.3.7',
|
|
60
|
+
sizzle: '2.3.3',
|
|
61
|
+
'strip-json-comments': '2.0.1',
|
|
62
|
+
testswarm: '1.1.0',
|
|
63
|
+
'uglify-js': '3.4.0',
|
|
64
|
+
},
|
|
65
|
+
scripts: {
|
|
66
|
+
build: 'npm install && grunt',
|
|
67
|
+
start: 'grunt watch',
|
|
68
|
+
'test:browserless': 'grunt && grunt test:slow',
|
|
69
|
+
'test:browser': 'grunt && grunt karma:main',
|
|
70
|
+
test: 'grunt && grunt test:slow && grunt karma:main',
|
|
71
|
+
jenkins: 'npm run test:browserless',
|
|
72
|
+
precommit: 'grunt lint:newer qunit_fixture',
|
|
73
|
+
commitmsg: 'node node_modules/commitplease',
|
|
74
|
+
},
|
|
75
|
+
commitplease: {
|
|
76
|
+
nohook: true,
|
|
77
|
+
components: [
|
|
78
|
+
'Docs',
|
|
79
|
+
'Tests',
|
|
80
|
+
'Build',
|
|
81
|
+
'Support',
|
|
82
|
+
'Release',
|
|
83
|
+
'Core',
|
|
84
|
+
'Ajax',
|
|
85
|
+
'Attributes',
|
|
86
|
+
'Callbacks',
|
|
87
|
+
'CSS',
|
|
88
|
+
'Data',
|
|
89
|
+
'Deferred',
|
|
90
|
+
'Deprecated',
|
|
91
|
+
'Dimensions',
|
|
92
|
+
'Effects',
|
|
93
|
+
'Event',
|
|
94
|
+
'Manipulation',
|
|
95
|
+
'Offset',
|
|
96
|
+
'Queue',
|
|
97
|
+
'Selector',
|
|
98
|
+
'Serialize',
|
|
99
|
+
'Traversing',
|
|
100
|
+
'Wrap',
|
|
101
|
+
],
|
|
102
|
+
markerPattern: '^((clos|fix|resolv)(e[sd]|ing))|^(refs?)',
|
|
103
|
+
ticketPattern: '^((Closes|Fixes) ([a-zA-Z]{2,}-)[0-9]+)|^(Refs? [^#])',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'lodash',
|
|
108
|
+
version: '4.17.4',
|
|
109
|
+
license: 'MIT',
|
|
110
|
+
private: true,
|
|
111
|
+
main: 'lodash.js',
|
|
112
|
+
author: {
|
|
113
|
+
name: 'John david dalton',
|
|
114
|
+
url: 'test url',
|
|
115
|
+
avatar: 'test avatar',
|
|
116
|
+
},
|
|
117
|
+
engines: {
|
|
118
|
+
node: '>=4.0.0',
|
|
119
|
+
},
|
|
120
|
+
sideEffects: false,
|
|
121
|
+
scripts: {
|
|
122
|
+
build: 'npm run build:main && npm run build:fp',
|
|
123
|
+
'build:fp': 'node lib/fp/build-dist.js',
|
|
124
|
+
'build:fp-modules': 'node lib/fp/build-modules.js',
|
|
125
|
+
'build:main': 'node lib/main/build-dist.js',
|
|
126
|
+
'build:main-modules': 'node lib/main/build-modules.js',
|
|
127
|
+
doc: 'node lib/main/build-doc github && npm run test:doc',
|
|
128
|
+
'doc:fp': 'node lib/fp/build-doc',
|
|
129
|
+
'doc:site': 'node lib/main/build-doc site',
|
|
130
|
+
'doc:sitehtml':
|
|
131
|
+
'optional-dev-dependency marky-markdown@^9.0.1 && npm run doc:site && node lib/main/build-site',
|
|
132
|
+
pretest: 'npm run build',
|
|
133
|
+
style: 'eslint *.js .internal/**/*.js',
|
|
134
|
+
test: 'npm run test:main && npm run test:fp',
|
|
135
|
+
'test:doc': 'markdown-doctest doc/*.md',
|
|
136
|
+
'test:fp': 'node test/test-fp',
|
|
137
|
+
'test:main': 'node test/test',
|
|
138
|
+
validate: 'npm run style && npm run test',
|
|
139
|
+
},
|
|
140
|
+
devDependencies: {
|
|
141
|
+
async: '^2.1.4',
|
|
142
|
+
benchmark: '^2.1.3',
|
|
143
|
+
chalk: '^1.1.3',
|
|
144
|
+
cheerio: '^0.22.0',
|
|
145
|
+
'codecov.io': '~0.1.6',
|
|
146
|
+
coveralls: '^2.11.15',
|
|
147
|
+
'curl-amd': '~0.8.12',
|
|
148
|
+
docdown: '~0.7.2',
|
|
149
|
+
dojo: '^1.12.1',
|
|
150
|
+
ecstatic: '^2.1.0',
|
|
151
|
+
eslint: '^3.15.0',
|
|
152
|
+
'eslint-plugin-import': '^2.2.0',
|
|
153
|
+
'fs-extra': '~1.0.0',
|
|
154
|
+
glob: '^7.1.1',
|
|
155
|
+
istanbul: '0.4.5',
|
|
156
|
+
jquery: '^3.1.1',
|
|
157
|
+
lodash: '4.17.3',
|
|
158
|
+
'lodash-doc-globals': '^0.1.1',
|
|
159
|
+
'markdown-doctest': '^0.9.1',
|
|
160
|
+
'optional-dev-dependency': '^2.0.0',
|
|
161
|
+
platform: '^1.3.3',
|
|
162
|
+
'qunit-extras': '^3.0.0',
|
|
163
|
+
qunitjs: '^2.1.0',
|
|
164
|
+
request: '^2.79.0',
|
|
165
|
+
requirejs: '^2.3.2',
|
|
166
|
+
'sauce-tunnel': '^2.5.0',
|
|
167
|
+
'uglify-js': '2.7.5',
|
|
168
|
+
webpack: '^1.14.0',
|
|
169
|
+
},
|
|
170
|
+
greenkeeper: {
|
|
171
|
+
ignore: ['lodash'],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
];
|