@verdaccio/ui-components 4.0.0-next-8.5 → 4.0.0-next-8.7
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/CHANGELOG.md +23 -0
- package/LICENSE +21 -0
- package/README.md +80 -1
- package/build/{src/Theme → Theme}/index.d.ts +2 -1
- package/build/Theme/index.js +1 -1
- package/build/components/Package/index.d.ts +2 -0
- package/build/components/Package/index.js +1 -1
- package/build/components/Search/Search.d.ts +6 -0
- package/build/components/Search/Search.js +13 -2
- package/build/{src/index.d.ts → index.d.ts} +5 -3
- package/build/index.js +2 -3
- package/build/providers/TranslatorProvider/index.d.ts +2 -0
- package/build/providers/TranslatorProvider/index.js +1 -1
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +6 -4
- package/build/store/index.d.ts +4 -0
- package/build/store/index.js +1 -2
- package/build/utils/url.js +19 -9
- package/package.json +19 -17
- package/src/AppTest/App.stories.tsx +81 -24
- package/src/AppTest/AppRoute.test.tsx +6 -2
- package/src/Theme/index.ts +2 -1
- package/src/components/ActionBar/ActionBar.test.tsx +68 -29
- package/src/components/Package/Package.test.tsx +9 -0
- package/src/components/Package/index.ts +2 -1
- package/src/components/Search/Search.stories.tsx +24 -2
- package/src/components/Search/Search.tsx +7 -3
- package/src/index.ts +5 -3
- package/src/layouts/Version/Version.stories.tsx +26 -0
- package/src/providers/TranslatorProvider/index.ts +2 -1
- package/src/sections/Detail/Detail.stories.tsx +52 -21
- package/src/sections/Header/Header.stories.tsx +33 -10
- package/src/sections/Header/RegistryInfoContent/RegistryInfoContent.tsx +1 -1
- package/src/sections/Home/Home.stories.tsx +25 -8
- package/src/sections/SideBar/Sidebar.stories.tsx +53 -28
- package/src/store/index.ts +3 -2
- package/src/utils/url.ts +25 -9
- package/src/utils/utils.test.ts +12 -13
- package/tsconfig.build.json +5 -4
- package/tsconfig.json +5 -4
- package/vitest.config.mjs +2 -2
- package/build/components/Install/__partials__/data.json +0 -5984
- package/build/components/Install/img/npm.svg +0 -15
- package/build/components/Install/img/pnpm.svg +0 -1
- package/build/components/Install/img/yarn.svg +0 -1
- package/build/components/Readme/Readme.spec.js +0 -40
- package/build/components/Readme/Readme.spec.js.map +0 -1
- package/build/components/Repository/__partials__/data.json +0 -5984
- package/build/components/Repository/img/git.png +0 -0
- package/build/components/Versions/__partials__/data.json +0 -5985
- package/build/components/Versions/__partials__/deprecated-versions.json +0 -175
- package/build/components/Versions/__partials__/unsorted-versions.json +0 -37
- package/build/providers/TranslatorProvider/TranslatorProvider.spec.js +0 -51
- package/build/src/AppTest/App.stories.d.ts +0 -8
- package/build/src/AppTest/AppRoute.test.d.ts +0 -1
- package/build/src/Theme/ThemeProvider.test.d.ts +0 -1
- package/build/src/components/ActionBar/ActionBar.stories.d.ts +0 -11
- package/build/src/components/ActionBar/ActionBar.test.d.ts +0 -1
- package/build/src/components/Author/Author.stories.d.ts +0 -6
- package/build/src/components/Author/Author.test.d.ts +0 -1
- package/build/src/components/CopyClipboard/CopyToClipBoard.stories.d.ts +0 -12
- package/build/src/components/CopyClipboard/CopyToClipBoard.test.d.ts +0 -1
- package/build/src/components/Dependencies/Dependencies.stories.d.ts +0 -8
- package/build/src/components/Dependencies/Dependencies.test.d.ts +0 -1
- package/build/src/components/Dependencies/DependencyBlock.test.d.ts +0 -1
- package/build/src/components/Deprecated/Deprecated.stories.d.ts +0 -5
- package/build/src/components/Deprecated/Deprecated.test.d.ts +0 -1
- package/build/src/components/Developers/Developers.stories.d.ts +0 -6
- package/build/src/components/Developers/Developers.test.d.ts +0 -1
- package/build/src/components/Distribution/Dist.stories.d.ts +0 -8
- package/build/src/components/Distribution/Dist.test.d.ts +0 -1
- package/build/src/components/Engines/Engines.stories.d.ts +0 -9
- package/build/src/components/Engines/Engines.test.d.ts +0 -1
- package/build/src/components/ErrorBoundary/ErrorBoundary.test.d.ts +0 -1
- package/build/src/components/Forbidden/Forbidden.test.d.ts +0 -1
- package/build/src/components/FundButton/FundButton.stories.d.ts +0 -7
- package/build/src/components/FundButton/FundButton.test.d.ts +0 -1
- package/build/src/components/HeaderInfoDialog/HeaderInfoDialog.test.d.ts +0 -1
- package/build/src/components/Heading/Heading.test.d.ts +0 -1
- package/build/src/components/Help/Help.stories.d.ts +0 -5
- package/build/src/components/Help/Help.test.d.ts +0 -1
- package/build/src/components/Icons/Icons.stories.d.ts +0 -5
- package/build/src/components/Icons/Icons.test.d.ts +0 -1
- package/build/src/components/Install/Install.stories.d.ts +0 -9
- package/build/src/components/Install/Install.test.d.ts +0 -1
- package/build/src/components/Keywords/Keywords.stories.d.ts +0 -5
- package/build/src/components/Keywords/Keywords.test.d.ts +0 -1
- package/build/src/components/Label/Label.test.d.ts +0 -1
- package/build/src/components/Link/Link.test.d.ts +0 -1
- package/build/src/components/LinkExternal/LinkExternal.test.d.ts +0 -1
- package/build/src/components/Loading/Loading.stories.d.ts +0 -5
- package/build/src/components/Loading/Loading.test.d.ts +0 -1
- package/build/src/components/Loading/Spinner/Spinner.test.d.ts +0 -1
- package/build/src/components/LoginDialog/LoginDialog.stories.d.ts +0 -15
- package/build/src/components/LoginDialog/LoginDialog.test.d.ts +0 -1
- package/build/src/components/Logo/Logo.stories.d.ts +0 -5
- package/build/src/components/Logo/Logo.test.d.ts +0 -1
- package/build/src/components/NoItems/NoItems.stories.d.ts +0 -5
- package/build/src/components/NoItems/Noitems.test.d.ts +0 -1
- package/build/src/components/NotFound/Notfound.test.d.ts +0 -1
- package/build/src/components/Package/Package.test.d.ts +0 -1
- package/build/src/components/Package/index.d.ts +0 -1
- package/build/src/components/PackageList/Packagelist.test.d.ts +0 -1
- package/build/src/components/Person/Person.test.d.ts +0 -1
- package/build/src/components/Readme/Readme.spec.d.ts +0 -1
- package/build/src/components/Repository/Repository.stories.d.ts +0 -8
- package/build/src/components/Repository/Repository.test.d.ts +0 -1
- package/build/src/components/Search/Search.d.ts +0 -4
- package/build/src/components/Search/Search.stories.d.ts +0 -8
- package/build/src/components/Search/Search.test.d.ts +0 -1
- package/build/src/components/SettingsMenu/SettingsMenu.test.d.ts +0 -1
- package/build/src/components/SideBarTitle/SideBarTitle.stories.d.ts +0 -10
- package/build/src/components/TextField/TextField.test.d.ts +0 -1
- package/build/src/components/UpLinks/UpLinks.test.d.ts +0 -1
- package/build/src/components/UpLinks/Uplinks.stories.d.ts +0 -6
- package/build/src/components/Versions/Versions.test.d.ts +0 -1
- package/build/src/layouts/Version/Version.stories.d.ts +0 -7
- package/build/src/providers/TranslatorProvider/TranslatorProvider.spec.d.ts +0 -1
- package/build/src/providers/TranslatorProvider/index.d.ts +0 -1
- package/build/src/providers/VersionProvider/VersionProvider.test.d.ts +0 -1
- package/build/src/sections/Detail/Detail.stories.d.ts +0 -7
- package/build/src/sections/Detail/Detail.test.d.ts +0 -1
- package/build/src/sections/Footer/Footer.test.d.ts +0 -1
- package/build/src/sections/Header/Header.stories.d.ts +0 -5
- package/build/src/sections/Header/Header.test.d.ts +0 -1
- package/build/src/sections/Header/RegistryInfoContent/RegistryInfoContent.test.d.ts +0 -1
- package/build/src/sections/Home/Home.stories.d.ts +0 -5
- package/build/src/sections/Home/Home.test.d.ts +0 -1
- package/build/src/sections/SideBar/Sidebar.stories.d.ts +0 -7
- package/build/src/sections/SideBar/Sidebar.test.d.ts +0 -1
- package/build/src/store/index.d.ts +0 -3
- package/build/src/utils/__partials__/packageMeta.d.ts +0 -235
- package/build/utils/__partials__/packageMeta.js +0 -528
- package/src/components/Install/__partials__/data.json +0 -5984
- package/src/components/Install/img/npm.svg +0 -15
- package/src/components/Install/img/pnpm.svg +0 -1
- package/src/components/Install/img/yarn.svg +0 -1
- package/src/components/Repository/__partials__/data.json +0 -5984
- package/src/components/Repository/img/git.png +0 -0
- package/src/components/Versions/__partials__/data.json +0 -5985
- package/src/components/Versions/__partials__/deprecated-versions.json +0 -175
- package/src/components/Versions/__partials__/unsorted-versions.json +0 -37
- package/src/utils/__partials__/packageMeta.ts +0 -590
- /package/build/{src/AppTest → AppTest}/AppRoute.d.ts +0 -0
- /package/build/{src/AppTest → AppTest}/pages/Front/Home.d.ts +0 -0
- /package/build/{src/AppTest → AppTest}/pages/Front/index.d.ts +0 -0
- /package/build/{src/AppTest → AppTest}/pages/Version/Version.d.ts +0 -0
- /package/build/{src/AppTest → AppTest}/pages/Version/index.d.ts +0 -0
- /package/build/{src/Theme → Theme}/ResetStyles.d.ts +0 -0
- /package/build/{src/Theme → Theme}/StyleBaseline.d.ts +0 -0
- /package/build/{src/Theme → Theme}/ThemeProvider.d.ts +0 -0
- /package/build/{src/Theme → Theme}/colors.d.ts +0 -0
- /package/build/{src/Theme → Theme}/theme.d.ts +0 -0
- /package/build/{src/components → components}/ActionBar/ActionBar.d.ts +0 -0
- /package/build/{src/components → components}/ActionBar/ActionBarAction.d.ts +0 -0
- /package/build/{src/components → components}/ActionBar/index.d.ts +0 -0
- /package/build/{src/components → components}/Author/Author.d.ts +0 -0
- /package/build/{src/components → components}/Author/index.d.ts +0 -0
- /package/build/{src/components → components}/Author/styles.d.ts +0 -0
- /package/build/{src/components → components}/CopyClipboard/CopyToClipBoard.d.ts +0 -0
- /package/build/{src/components → components}/CopyClipboard/index.d.ts +0 -0
- /package/build/{src/components → components}/CopyClipboard/utils.d.ts +0 -0
- /package/build/{src/components → components}/Dependencies/Dependencies.d.ts +0 -0
- /package/build/{src/components → components}/Dependencies/DependencyBlock.d.ts +0 -0
- /package/build/{src/components → components}/Dependencies/index.d.ts +0 -0
- /package/build/{src/components → components}/Dependencies/types.d.ts +0 -0
- /package/build/{src/components → components}/Dependencies/utits.d.ts +0 -0
- /package/build/{src/components → components}/Deprecated/Deprecated.d.ts +0 -0
- /package/build/{src/components → components}/Deprecated/index.d.ts +0 -0
- /package/build/{src/components → components}/Developers/DeveloperType.d.ts +0 -0
- /package/build/{src/components → components}/Developers/Developers.d.ts +0 -0
- /package/build/{src/components → components}/Developers/Title.d.ts +0 -0
- /package/build/{src/components → components}/Developers/get-unique-developer-values.d.ts +0 -0
- /package/build/{src/components → components}/Developers/index.d.ts +0 -0
- /package/build/{src/components → components}/Distribution/Dist.d.ts +0 -0
- /package/build/{src/components → components}/Distribution/index.d.ts +0 -0
- /package/build/{src/components → components}/Distribution/styles.d.ts +0 -0
- /package/build/{src/components → components}/Engines/Engines.d.ts +0 -0
- /package/build/{src/components → components}/Engines/index.d.ts +0 -0
- /package/build/{src/components → components}/Engines/styles.d.ts +0 -0
- /package/build/{src/components → components}/ErrorBoundary/ErrorBoundary.d.ts +0 -0
- /package/build/{src/components → components}/ErrorBoundary/index.d.ts +0 -0
- /package/build/{src/components → components}/Forbidden/Forbidden.d.ts +0 -0
- /package/build/{src/components → components}/Forbidden/index.d.ts +0 -0
- /package/build/{src/components → components}/FundButton/FundButton.d.ts +0 -0
- /package/build/{src/components → components}/FundButton/index.d.ts +0 -0
- /package/build/{src/components → components}/HeaderInfoDialog/HeaderInfoDialog.d.ts +0 -0
- /package/build/{src/components → components}/HeaderInfoDialog/index.d.ts +0 -0
- /package/build/{src/components → components}/Heading/Heading.d.ts +0 -0
- /package/build/{src/components → components}/Heading/index.d.ts +0 -0
- /package/build/{src/components → components}/Help/Help.d.ts +0 -0
- /package/build/{src/components → components}/Help/index.d.ts +0 -0
- /package/build/{src/components → components}/Help/styles.d.ts +0 -0
- /package/build/{src/components → components}/Icons/DevsIcons/CommonJS.d.ts +0 -0
- /package/build/{src/components → components}/Icons/DevsIcons/ES6Module.d.ts +0 -0
- /package/build/{src/components → components}/Icons/DevsIcons/Git.d.ts +0 -0
- /package/build/{src/components → components}/Icons/DevsIcons/NodeJS.d.ts +0 -0
- /package/build/{src/components → components}/Icons/DevsIcons/TypeScript.d.ts +0 -0
- /package/build/{src/components → components}/Icons/DevsIcons/index.d.ts +0 -0
- /package/build/{src/components → components}/Icons/Earth.d.ts +0 -0
- /package/build/{src/components → components}/Icons/FileBinary.d.ts +0 -0
- /package/build/{src/components → components}/Icons/Law.d.ts +0 -0
- /package/build/{src/components → components}/Icons/License.d.ts +0 -0
- /package/build/{src/components → components}/Icons/Managers/Npm.d.ts +0 -0
- /package/build/{src/components → components}/Icons/Managers/Pnpm.d.ts +0 -0
- /package/build/{src/components → components}/Icons/Managers/Yarn.d.ts +0 -0
- /package/build/{src/components → components}/Icons/Managers/index.d.ts +0 -0
- /package/build/{src/components → components}/Icons/SvgIcon.d.ts +0 -0
- /package/build/{src/components → components}/Icons/Time.d.ts +0 -0
- /package/build/{src/components → components}/Icons/Version.d.ts +0 -0
- /package/build/{src/components → components}/Icons/index.d.ts +0 -0
- /package/build/{src/components → components}/Install/Install.d.ts +0 -0
- /package/build/{src/components → components}/Install/InstallListItem.d.ts +0 -0
- /package/build/{src/components → components}/Install/index.d.ts +0 -0
- /package/build/{src/components → components}/Keywords/KeywordListItems.d.ts +0 -0
- /package/build/{src/components → components}/Keywords/Keywords.d.ts +0 -0
- /package/build/{src/components → components}/Keywords/index.d.ts +0 -0
- /package/build/{src/components → components}/Label/Label.d.ts +0 -0
- /package/build/{src/components → components}/Label/index.d.ts +0 -0
- /package/build/{src/components → components}/Link/Link.d.ts +0 -0
- /package/build/{src/components → components}/Link/index.d.ts +0 -0
- /package/build/{src/components → components}/LinkExternal/LinkExternal.d.ts +0 -0
- /package/build/{src/components → components}/LinkExternal/index.d.ts +0 -0
- /package/build/{src/components → components}/Loading/Loading.d.ts +0 -0
- /package/build/{src/components → components}/Loading/Spinner/Spinner.d.ts +0 -0
- /package/build/{src/components → components}/Loading/Spinner/index.d.ts +0 -0
- /package/build/{src/components → components}/Loading/index.d.ts +0 -0
- /package/build/{src/components → components}/Loading/styles.d.ts +0 -0
- /package/build/{src/components → components}/LoginDialog/LoginDialog.d.ts +0 -0
- /package/build/{src/components → components}/LoginDialog/LoginDialogCloseButton.d.ts +0 -0
- /package/build/{src/components → components}/LoginDialog/LoginDialogForm.d.ts +0 -0
- /package/build/{src/components → components}/LoginDialog/LoginDialogFormError.d.ts +0 -0
- /package/build/{src/components → components}/LoginDialog/LoginDialogHeader.d.ts +0 -0
- /package/build/{src/components → components}/LoginDialog/index.d.ts +0 -0
- /package/build/{src/components → components}/Logo/Logo.d.ts +0 -0
- /package/build/{src/components → components}/Logo/index.d.ts +0 -0
- /package/build/{src/components → components}/MenuItem/MenuItem.d.ts +0 -0
- /package/build/{src/components → components}/MenuItem/index.d.ts +0 -0
- /package/build/{src/components → components}/NoItems/NoItems.d.ts +0 -0
- /package/build/{src/components → components}/NoItems/index.d.ts +0 -0
- /package/build/{src/components → components}/NotFound/NotFound.d.ts +0 -0
- /package/build/{src/components → components}/NotFound/index.d.ts +0 -0
- /package/build/{src/components → components}/Package/Package.d.ts +0 -0
- /package/build/{src/components → components}/Package/styles.d.ts +0 -0
- /package/build/{src/components → components}/PackageList/PackageList.d.ts +0 -0
- /package/build/{src/components → components}/PackageList/index.d.ts +0 -0
- /package/build/{src/components → components}/Person/Person.d.ts +0 -0
- /package/build/{src/components → components}/Person/PersonTooltip.d.ts +0 -0
- /package/build/{src/components → components}/Person/index.d.ts +0 -0
- /package/build/{src/components → components}/Person/utils.d.ts +0 -0
- /package/build/{src/components → components}/RawViewer/RawViewer.d.ts +0 -0
- /package/build/{src/components → components}/RawViewer/index.d.ts +0 -0
- /package/build/{src/components → components}/Readme/Readme.d.ts +0 -0
- /package/build/{src/components → components}/Readme/index.d.ts +0 -0
- /package/build/{src/components → components}/Readme/types.d.ts +0 -0
- /package/build/{src/components → components}/Readme/utils.d.ts +0 -0
- /package/build/{src/components → components}/RegistryInfoDialog/RegistryInfoDialog.d.ts +0 -0
- /package/build/{src/components → components}/RegistryInfoDialog/index.d.ts +0 -0
- /package/build/{src/components → components}/RegistryInfoDialog/styles.d.ts +0 -0
- /package/build/{src/components → components}/RegistryInfoDialog/types.d.ts +0 -0
- /package/build/{src/components → components}/Repository/Repository.d.ts +0 -0
- /package/build/{src/components → components}/Repository/index.d.ts +0 -0
- /package/build/{src/components → components}/Search/AutoComplete/AutoComplete.d.ts +0 -0
- /package/build/{src/components → components}/Search/AutoComplete/index.d.ts +0 -0
- /package/build/{src/components → components}/Search/AutoComplete/styles.d.ts +0 -0
- /package/build/{src/components → components}/Search/SearchItem.d.ts +0 -0
- /package/build/{src/components → components}/Search/index.d.ts +0 -0
- /package/build/{src/components → components}/Search/styles.d.ts +0 -0
- /package/build/{src/components → components}/Search/utils.d.ts +0 -0
- /package/build/{src/components → components}/SettingsMenu/SettingsMenu.d.ts +0 -0
- /package/build/{src/components → components}/SettingsMenu/index.d.ts +0 -0
- /package/build/{src/components → components}/SideBarTitle/SideBarTitle.d.ts +0 -0
- /package/build/{src/components → components}/SideBarTitle/index.d.ts +0 -0
- /package/build/{src/components → components}/SideBarTitle/utils.d.ts +0 -0
- /package/build/{src/components → components}/TextField/TextField.d.ts +0 -0
- /package/build/{src/components → components}/TextField/index.d.ts +0 -0
- /package/build/{src/components → components}/UpLinks/UpLinks.d.ts +0 -0
- /package/build/{src/components → components}/UpLinks/UplinkLink.d.ts +0 -0
- /package/build/{src/components → components}/UpLinks/index.d.ts +0 -0
- /package/build/{src/components → components}/UpLinks/styles.d.ts +0 -0
- /package/build/{src/components → components}/Versions/HistoryList.d.ts +0 -0
- /package/build/{src/components → components}/Versions/TagList.d.ts +0 -0
- /package/build/{src/components → components}/Versions/Versions.d.ts +0 -0
- /package/build/{src/components → components}/Versions/index.d.ts +0 -0
- /package/build/{src/components → components}/Versions/styles.d.ts +0 -0
- /package/build/{src/components → components}/Versions/types.d.ts +0 -0
- /package/build/{src/hooks → hooks}/index.d.ts +0 -0
- /package/build/{src/hooks → hooks}/useLocalStorage.d.ts +0 -0
- /package/build/{src/hooks → hooks}/useOnClickOutside.d.ts +0 -0
- /package/build/{src/layouts → layouts}/Version/Version.d.ts +0 -0
- /package/build/{src/layouts → layouts}/Version/index.d.ts +0 -0
- /package/build/{src/providers → providers}/AppConfigurationProvider/AppConfigurationProvider.d.ts +0 -0
- /package/build/{src/providers → providers}/AppConfigurationProvider/index.d.ts +0 -0
- /package/build/{src/providers → providers}/PersistenceSettingProvider/PersistenceSettingProvider.d.ts +0 -0
- /package/build/{src/providers → providers}/PersistenceSettingProvider/index.d.ts +0 -0
- /package/build/{src/providers → providers}/TranslatorProvider/TranslatorProvider.d.ts +0 -0
- /package/build/{src/providers → providers}/VersionProvider/VersionProvider.d.ts +0 -0
- /package/build/{src/providers → providers}/VersionProvider/index.d.ts +0 -0
- /package/build/{src/providers → providers}/index.d.ts +0 -0
- /package/build/{src/sections → sections}/Detail/ContainerContent.d.ts +0 -0
- /package/build/{src/sections → sections}/Detail/Detail.d.ts +0 -0
- /package/build/{src/sections → sections}/Detail/ReadmeSection.d.ts +0 -0
- /package/build/{src/sections → sections}/Detail/Tabs.d.ts +0 -0
- /package/build/{src/sections → sections}/Detail/index.d.ts +0 -0
- /package/build/{src/sections → sections}/Footer/Footer.d.ts +0 -0
- /package/build/{src/sections → sections}/Footer/index.d.ts +0 -0
- /package/build/{src/sections → sections}/Footer/styles.d.ts +0 -0
- /package/build/{src/sections → sections}/Header/Header.d.ts +0 -0
- /package/build/{src/sections → sections}/Header/HeaderGreetings.d.ts +0 -0
- /package/build/{src/sections → sections}/Header/HeaderLeft.d.ts +0 -0
- /package/build/{src/sections → sections}/Header/HeaderMenu.d.ts +0 -0
- /package/build/{src/sections → sections}/Header/HeaderRight.d.ts +0 -0
- /package/build/{src/sections → sections}/Header/HeaderSettingsDialog.d.ts +0 -0
- /package/build/{src/sections → sections}/Header/HeaderToolTip.d.ts +0 -0
- /package/build/{src/sections → sections}/Header/HeaderToolTipIcon.d.ts +0 -0
- /package/build/{src/sections → sections}/Header/LanguageSwitch.d.ts +0 -0
- /package/build/{src/sections → sections}/Header/RegistryInfoContent/RegistryInfoContent.d.ts +0 -0
- /package/build/{src/sections → sections}/Header/RegistryInfoContent/index.d.ts +0 -0
- /package/build/{src/sections → sections}/Header/RegistryInfoContent/styles.d.ts +0 -0
- /package/build/{src/sections → sections}/Header/index.d.ts +0 -0
- /package/build/{src/sections → sections}/Header/styles.d.ts +0 -0
- /package/build/{src/sections → sections}/Home/Home.d.ts +0 -0
- /package/build/{src/sections → sections}/Home/index.d.ts +0 -0
- /package/build/{src/sections → sections}/SideBar/Sidebar.d.ts +0 -0
- /package/build/{src/sections → sections}/SideBar/index.d.ts +0 -0
- /package/build/{src/sections → sections}/index.d.ts +0 -0
- /package/build/{src/store → store}/api.d.ts +0 -0
- /package/build/{src/store → store}/models/configuration.d.ts +0 -0
- /package/build/{src/store → store}/models/download.d.ts +0 -0
- /package/build/{src/store → store}/models/index.d.ts +0 -0
- /package/build/{src/store → store}/models/login.d.ts +0 -0
- /package/build/{src/store → store}/models/manifest.d.ts +0 -0
- /package/build/{src/store → store}/models/packages.d.ts +0 -0
- /package/build/{src/store → store}/models/routes.d.ts +0 -0
- /package/build/{src/store → store}/models/search.d.ts +0 -0
- /package/build/{src/store → store}/models/utils.d.ts +0 -0
- /package/build/{src/store → store}/storage.d.ts +0 -0
- /package/build/{src/store → store}/store.d.ts +0 -0
- /package/build/{src/test → test}/i18n-config.d.ts +0 -0
- /package/build/{src/test → test}/test-react-testing-library.d.ts +0 -0
- /package/build/{src/types → types}/index.d.ts +0 -0
- /package/build/{src/types → types}/packageMeta.d.ts +0 -0
- /package/build/{src/utils → utils}/cli-utils.d.ts +0 -0
- /package/build/{src/utils → utils}/index.d.ts +0 -0
- /package/build/{src/utils → utils}/loadable.d.ts +0 -0
- /package/build/{src/utils → utils}/routes.d.ts +0 -0
- /package/build/{src/utils → utils}/token-generate.d.ts +0 -0
- /package/build/{src/utils → utils}/token.d.ts +0 -0
- /package/build/{src/utils → utils}/url.d.ts +0 -0
- /package/build/{src/utils → utils}/utils.d.ts +0 -0
- /package/src/components/Readme/{Readme.spec.tsx → Readme.test.tsx} +0 -0
- /package/src/providers/TranslatorProvider/{TranslatorProvider.spec.tsx → TranslatorProvider.test.tsx} +0 -0
- /package/src/types/{index.d.ts → external-modules.d.ts} +0 -0
|
@@ -1,32 +1,89 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { HttpResponse, http } from 'msw';
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { MemoryRouter } from 'react-router';
|
|
3
5
|
|
|
4
6
|
import AppRoute from './AppRoute';
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
const meta: Meta<typeof AppRoute> = {
|
|
7
9
|
title: 'App/Main',
|
|
10
|
+
component: AppRoute,
|
|
8
11
|
};
|
|
9
12
|
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
export default meta;
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof AppRoute>;
|
|
16
|
+
|
|
17
|
+
export const ApplicationStoryBook: Story = {
|
|
18
|
+
render: () => (
|
|
19
|
+
<MemoryRouter initialEntries={[`/-/web/detail/storybook`]}>
|
|
20
|
+
<AppRoute />
|
|
21
|
+
</MemoryRouter>
|
|
22
|
+
),
|
|
23
|
+
parameters: {
|
|
24
|
+
msw: {
|
|
25
|
+
handlers: [
|
|
26
|
+
http.get('https://my-registry.org/-/verdaccio/data/sidebar/storybook', () => {
|
|
27
|
+
return HttpResponse.json(require('../../vitest/api/storybook-sidebar.json'));
|
|
28
|
+
}),
|
|
29
|
+
http.get('https://my-registry.org/-/verdaccio/data/package/readme/storybook', () => {
|
|
30
|
+
return HttpResponse.json(require('../../vitest/api/storybook-readme')());
|
|
31
|
+
}),
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const ApplicationJquery: Story = {
|
|
38
|
+
render: () => (
|
|
39
|
+
<MemoryRouter initialEntries={[`/-/web/detail/jquery`]}>
|
|
40
|
+
<AppRoute />
|
|
41
|
+
</MemoryRouter>
|
|
42
|
+
),
|
|
43
|
+
parameters: {
|
|
44
|
+
msw: {
|
|
45
|
+
handlers: [
|
|
46
|
+
http.get('https://my-registry.org/-/verdaccio/data/sidebar/jquery', () => {
|
|
47
|
+
return HttpResponse.json(require('../../vitest/api/jquery-sidebar.json'));
|
|
48
|
+
}),
|
|
49
|
+
http.get('https://my-registry.org/-/verdaccio/data/package/readme/jquery', () => {
|
|
50
|
+
return HttpResponse.json(require('../../vitest/api/jquery-readme')());
|
|
51
|
+
}),
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const ApplicationForbidden: Story = {
|
|
58
|
+
render: () => (
|
|
59
|
+
<MemoryRouter initialEntries={[`/-/web/detail/JSONStream`]}>
|
|
60
|
+
<AppRoute />
|
|
61
|
+
</MemoryRouter>
|
|
62
|
+
),
|
|
63
|
+
parameters: {
|
|
64
|
+
msw: {
|
|
65
|
+
handlers: [
|
|
66
|
+
http.get('https://my-registry.org/-/verdaccio/data/sidebar/JSONStream', () => {
|
|
67
|
+
return new HttpResponse('unauthorized', { status: 401 });
|
|
68
|
+
}),
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const ApplicationNotFound: Story = {
|
|
75
|
+
render: () => (
|
|
76
|
+
<MemoryRouter initialEntries={[`/-/web/detail/kleur`]}>
|
|
77
|
+
<AppRoute />
|
|
78
|
+
</MemoryRouter>
|
|
79
|
+
),
|
|
80
|
+
parameters: {
|
|
81
|
+
msw: {
|
|
82
|
+
handlers: [
|
|
83
|
+
http.get('https://my-registry.org/-/verdaccio/data/sidebar/kleur', () => {
|
|
84
|
+
return new HttpResponse('unauthorized', { status: 404 });
|
|
85
|
+
}),
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
};
|
|
@@ -34,13 +34,17 @@ describe('AppRoute', () => {
|
|
|
34
34
|
|
|
35
35
|
test('renders VersionPage component for PACKAGE path', async () => {
|
|
36
36
|
act(() => appTest('/-/web/detail/jquery'));
|
|
37
|
-
await waitFor(() => screen.getByTestId('readme-tab'))
|
|
37
|
+
await waitFor(() => expect(screen.getByTestId('readme-tab')).toBeInTheDocument(), {
|
|
38
|
+
timeout: 3000,
|
|
39
|
+
});
|
|
38
40
|
expect(screen.getByTestId('sidebar')).toBeInTheDocument();
|
|
39
41
|
});
|
|
40
42
|
|
|
41
43
|
test('renders VersionPage component for PACKAGE VERSION path', async () => {
|
|
42
44
|
act(() => appTest('/-/web/detail/jquery/v/3.6.3'));
|
|
43
|
-
await waitFor(() => screen.getByTestId('readme-tab'))
|
|
45
|
+
await waitFor(() => expect(screen.getByTestId('readme-tab')).toBeInTheDocument(), {
|
|
46
|
+
timeout: 3000,
|
|
47
|
+
});
|
|
44
48
|
expect(screen.getByTestId('sidebar')).toBeInTheDocument();
|
|
45
49
|
});
|
|
46
50
|
|
package/src/Theme/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * as colors from './colors';
|
|
2
2
|
export { ThemeProvider, useCustomTheme } from './ThemeProvider';
|
|
3
3
|
export { default as StyleBaseline } from './StyleBaseline';
|
|
4
|
-
export {
|
|
4
|
+
export { getTheme } from './theme';
|
|
5
|
+
export type { Theme, FontWeight } from './theme';
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
+
import { cleanupDownloadMocks, setupDownloadMocks } from '../../../vitest/vitestHelpers';
|
|
3
4
|
import { store } from '../../store/store';
|
|
4
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
cleanup,
|
|
7
|
+
fireEvent,
|
|
8
|
+
renderWithStore,
|
|
9
|
+
screen,
|
|
10
|
+
waitFor,
|
|
11
|
+
} from '../../test/test-react-testing-library';
|
|
5
12
|
import ActionBar from './ActionBar';
|
|
6
13
|
|
|
7
14
|
const defaultPackageMeta = {
|
|
@@ -21,25 +28,37 @@ const defaultPackageMeta = {
|
|
|
21
28
|
},
|
|
22
29
|
};
|
|
23
30
|
|
|
31
|
+
beforeAll(() => {
|
|
32
|
+
setupDownloadMocks();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
afterAll(() => {
|
|
36
|
+
cleanupDownloadMocks();
|
|
37
|
+
});
|
|
38
|
+
|
|
24
39
|
describe('<ActionBar /> component', () => {
|
|
25
40
|
afterEach(() => {
|
|
26
41
|
cleanup();
|
|
27
42
|
});
|
|
28
43
|
|
|
29
|
-
test('should render the component in default state', () => {
|
|
44
|
+
test('should render the component in default state', async () => {
|
|
30
45
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} />, store);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
46
|
+
await waitFor(() => {
|
|
47
|
+
expect(screen.getByTestId('download-tarball-btn')).toBeInTheDocument();
|
|
48
|
+
expect(screen.getByTestId('BugReportIcon')).toBeInTheDocument();
|
|
49
|
+
expect(screen.getByTestId('HomeIcon')).toBeInTheDocument();
|
|
50
|
+
});
|
|
34
51
|
});
|
|
35
52
|
|
|
36
|
-
test('should not render if data is missing', () => {
|
|
53
|
+
test('should not render if data is missing', async () => {
|
|
37
54
|
// @ts-ignore - testing with missing data
|
|
38
55
|
renderWithStore(<ActionBar packageMeta={undefined} />, store);
|
|
39
|
-
|
|
56
|
+
await waitFor(() => {
|
|
57
|
+
expect(screen.queryByTestId('HomeIcon')).toBeNull();
|
|
58
|
+
});
|
|
40
59
|
});
|
|
41
60
|
|
|
42
|
-
test('when there is no action bar data', () => {
|
|
61
|
+
test('when there is no action bar data', async () => {
|
|
43
62
|
const packageMeta = {
|
|
44
63
|
...defaultPackageMeta,
|
|
45
64
|
latest: {
|
|
@@ -54,60 +73,80 @@ describe('<ActionBar /> component', () => {
|
|
|
54
73
|
};
|
|
55
74
|
|
|
56
75
|
renderWithStore(<ActionBar packageMeta={packageMeta} />, store);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
76
|
+
await waitFor(() => {
|
|
77
|
+
expect(screen.queryByTestId('download-tarball-btn')).not.toBeInTheDocument();
|
|
78
|
+
expect(screen.queryByTestId('BugReportIcon')).not.toBeInTheDocument();
|
|
79
|
+
expect(screen.queryByTestId('HomeIcon')).not.toBeInTheDocument();
|
|
80
|
+
});
|
|
60
81
|
});
|
|
61
82
|
|
|
62
|
-
test('when there is a button to download a tarball', () => {
|
|
83
|
+
test('when there is a button to download a tarball', async () => {
|
|
63
84
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} />, store);
|
|
64
|
-
|
|
85
|
+
await waitFor(() => {
|
|
86
|
+
expect(screen.getByLabelText('action-bar-action.download-tarball')).toBeTruthy();
|
|
87
|
+
});
|
|
65
88
|
});
|
|
66
89
|
|
|
67
|
-
test('when button to download is disabled', () => {
|
|
90
|
+
test('when button to download is disabled', async () => {
|
|
68
91
|
renderWithStore(
|
|
69
92
|
<ActionBar packageMeta={defaultPackageMeta} showDownloadTarball={false} />,
|
|
70
93
|
store
|
|
71
94
|
);
|
|
72
|
-
|
|
95
|
+
await waitFor(() => {
|
|
96
|
+
expect(screen.queryByTestId('download-tarball-btn')).not.toBeInTheDocument();
|
|
97
|
+
});
|
|
73
98
|
});
|
|
74
99
|
|
|
75
|
-
test('when there is a button to raw manifest', () => {
|
|
100
|
+
test('when there is a button to raw manifest', async () => {
|
|
76
101
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={true} />, store);
|
|
77
|
-
|
|
102
|
+
await waitFor(() => {
|
|
103
|
+
expect(screen.getByLabelText('action-bar-action.raw')).toBeTruthy();
|
|
104
|
+
});
|
|
78
105
|
});
|
|
79
106
|
|
|
80
107
|
test('when click button to raw manifest open a dialog with viewer', async () => {
|
|
81
108
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={true} />, store);
|
|
82
|
-
|
|
109
|
+
await waitFor(() => {
|
|
110
|
+
expect(screen.queryByTestId('rawViewer--dialog')).toBeFalsy();
|
|
111
|
+
});
|
|
83
112
|
|
|
84
113
|
fireEvent.click(screen.getByLabelText('action-bar-action.raw'));
|
|
85
|
-
await
|
|
114
|
+
await waitFor(() => {
|
|
115
|
+
expect(screen.getByTestId('rawViewer--dialog')).toBeInTheDocument();
|
|
116
|
+
});
|
|
86
117
|
|
|
87
118
|
fireEvent.click(screen.getByTestId('close-raw-viewer'));
|
|
88
|
-
await
|
|
89
|
-
|
|
90
|
-
|
|
119
|
+
await waitFor(() => {
|
|
120
|
+
expect(screen.queryByTestId('rawViewer--dialog')).toBeFalsy();
|
|
121
|
+
});
|
|
91
122
|
});
|
|
92
123
|
|
|
93
|
-
test('should not display download tarball button', () => {
|
|
124
|
+
test('should not display download tarball button', async () => {
|
|
94
125
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={false} />, store);
|
|
95
|
-
|
|
126
|
+
await waitFor(() => {
|
|
127
|
+
expect(screen.queryByLabelText('Download tarball')).toBeFalsy();
|
|
128
|
+
});
|
|
96
129
|
});
|
|
97
130
|
|
|
98
131
|
test('when click button to download ', async () => {
|
|
99
132
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={false} />, store);
|
|
100
133
|
fireEvent.click(screen.getByTestId('download-tarball-btn'));
|
|
101
|
-
await
|
|
134
|
+
await waitFor(() => {
|
|
135
|
+
expect(store.getState().loading.models.download).toBe(true);
|
|
136
|
+
});
|
|
102
137
|
});
|
|
103
138
|
|
|
104
|
-
test('should not display show raw button', () => {
|
|
139
|
+
test('should not display show raw button', async () => {
|
|
105
140
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={false} />, store);
|
|
106
|
-
|
|
141
|
+
await waitFor(() => {
|
|
142
|
+
expect(screen.queryByLabelText('action-bar-action.raw')).toBeFalsy();
|
|
143
|
+
});
|
|
107
144
|
});
|
|
108
145
|
|
|
109
|
-
test('when there is a button to open an issue', () => {
|
|
146
|
+
test('when there is a button to open an issue', async () => {
|
|
110
147
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} />, store);
|
|
111
|
-
|
|
148
|
+
await waitFor(() => {
|
|
149
|
+
expect(screen.getByTestId('BugReportIcon')).toBeInTheDocument();
|
|
150
|
+
});
|
|
112
151
|
});
|
|
113
152
|
});
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { MemoryRouter } from 'react-router';
|
|
3
3
|
|
|
4
4
|
import { store } from '../../';
|
|
5
|
+
import { cleanupDownloadMocks, setupDownloadMocks } from '../../../vitest/vitestHelpers';
|
|
5
6
|
import {
|
|
6
7
|
cleanup,
|
|
7
8
|
fireEvent,
|
|
@@ -34,6 +35,14 @@ const props = {
|
|
|
34
35
|
keywords: ['verdaccio-core'],
|
|
35
36
|
};
|
|
36
37
|
|
|
38
|
+
beforeAll(() => {
|
|
39
|
+
setupDownloadMocks();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
afterAll(() => {
|
|
43
|
+
cleanupDownloadMocks();
|
|
44
|
+
});
|
|
45
|
+
|
|
37
46
|
describe('<Package /> component', () => {
|
|
38
47
|
afterEach(() => {
|
|
39
48
|
cleanup();
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default
|
|
1
|
+
export { default } from './Package';
|
|
2
|
+
export type { PackageInterface } from './Package';
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
/* eslint-disable verdaccio/jsx-spread */
|
|
2
2
|
import Box from '@mui/material/Box';
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
import { HttpResponse, http } from 'msw';
|
|
3
5
|
import React from 'react';
|
|
4
6
|
import { MemoryRouter } from 'react-router';
|
|
5
7
|
|
|
8
|
+
import Home from '../../sections/Home';
|
|
6
9
|
import Search from './Search';
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
type Story = StoryObj<typeof Search>;
|
|
12
|
+
const meta: Meta<typeof Search> = {
|
|
9
13
|
title: 'Components/Header/Search',
|
|
14
|
+
component: Home,
|
|
10
15
|
};
|
|
11
16
|
|
|
12
|
-
export
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
export const SearchByQuery: Story = {
|
|
13
20
|
render: (args) => (
|
|
14
21
|
<MemoryRouter initialEntries={[`/-/web/detail/storybook`]}>
|
|
15
22
|
<Box
|
|
@@ -27,4 +34,19 @@ export const SearchByQuery = {
|
|
|
27
34
|
</Box>
|
|
28
35
|
</MemoryRouter>
|
|
29
36
|
),
|
|
37
|
+
parameters: {
|
|
38
|
+
msw: {
|
|
39
|
+
handlers: [
|
|
40
|
+
http.get('https://my-registry.org/-/verdaccio/data/sidebar/storybook', () => {
|
|
41
|
+
return HttpResponse.json(require('../../../vitest/api/storybook-sidebar.json'));
|
|
42
|
+
}),
|
|
43
|
+
http.get('https://my-registry.org/-/verdaccio/data/package/readme/storybook', () => {
|
|
44
|
+
return HttpResponse.json(require('../../../vitest/api/storybook-readme')());
|
|
45
|
+
}),
|
|
46
|
+
http.get('https://my-registry.org/-/verdaccio/data/search/*', () => {
|
|
47
|
+
return HttpResponse.json(require('../../../vitest/api/search-verdaccio.json'));
|
|
48
|
+
}),
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
30
52
|
};
|
|
@@ -118,6 +118,8 @@ const Search: React.FC<RouteComponentProps> = ({ history }) => {
|
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
const renderOption = (props, option) => {
|
|
121
|
+
const { key, ...otherProps } = props;
|
|
122
|
+
|
|
121
123
|
if (searchRemote) {
|
|
122
124
|
const item: SearchResultWeb = option.package;
|
|
123
125
|
const isPrivate = option?.verdaccioPrivate;
|
|
@@ -125,7 +127,8 @@ const Search: React.FC<RouteComponentProps> = ({ history }) => {
|
|
|
125
127
|
const isRemote = !isCached && !isPrivate;
|
|
126
128
|
return (
|
|
127
129
|
<SearchItem
|
|
128
|
-
{
|
|
130
|
+
key={key}
|
|
131
|
+
{...otherProps}
|
|
129
132
|
description={item?.description}
|
|
130
133
|
isCached={isCached}
|
|
131
134
|
isPrivate={isPrivate}
|
|
@@ -137,7 +140,8 @@ const Search: React.FC<RouteComponentProps> = ({ history }) => {
|
|
|
137
140
|
} else {
|
|
138
141
|
return (
|
|
139
142
|
<SearchItem
|
|
140
|
-
{
|
|
143
|
+
key={key}
|
|
144
|
+
{...otherProps}
|
|
141
145
|
description={option?.description}
|
|
142
146
|
name={option?.name}
|
|
143
147
|
version={option?.version}
|
|
@@ -161,4 +165,4 @@ const Search: React.FC<RouteComponentProps> = ({ history }) => {
|
|
|
161
165
|
);
|
|
162
166
|
};
|
|
163
167
|
|
|
164
|
-
export default withRouter(Search);
|
|
168
|
+
export default withRouter(Search as any);
|
package/src/index.ts
CHANGED
|
@@ -49,8 +49,8 @@ export { default as AppConfigurationProvider } from './providers/AppConfiguratio
|
|
|
49
49
|
export { default as PersistenceSettingProvider } from './providers/PersistenceSettingProvider';
|
|
50
50
|
|
|
51
51
|
export * from './providers/AppConfigurationProvider';
|
|
52
|
-
export { TranslatorProvider, useLanguage
|
|
53
|
-
export
|
|
52
|
+
export { TranslatorProvider, useLanguage } from './providers/TranslatorProvider';
|
|
53
|
+
export type { LanguageItem } from './providers/TranslatorProvider';
|
|
54
54
|
export { VersionProvider } from './providers/VersionProvider';
|
|
55
55
|
export * from './providers/VersionProvider';
|
|
56
56
|
|
|
@@ -61,4 +61,6 @@ export { loadable, Route } from './utils';
|
|
|
61
61
|
export * from './hooks';
|
|
62
62
|
// others
|
|
63
63
|
export * from './Theme';
|
|
64
|
-
export { store, api
|
|
64
|
+
export { store, api } from './store';
|
|
65
|
+
export type { RootState, Dispatch } from './store';
|
|
66
|
+
export type { LoginError, LoginBody, LoginResponse } from './store/models/login';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { HttpResponse, http } from 'msw';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { MemoryRouter, Route } from 'react-router';
|
|
4
5
|
|
|
@@ -11,6 +12,7 @@ const meta: Meta<typeof VersionLayout> = {
|
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export default meta;
|
|
15
|
+
|
|
14
16
|
type Story = StoryObj<typeof VersionLayout>;
|
|
15
17
|
|
|
16
18
|
export const Primary: Story = {
|
|
@@ -26,6 +28,18 @@ export const Primary: Story = {
|
|
|
26
28
|
</MemoryRouter>
|
|
27
29
|
);
|
|
28
30
|
},
|
|
31
|
+
parameters: {
|
|
32
|
+
msw: {
|
|
33
|
+
handlers: [
|
|
34
|
+
http.get('https://my-registry.org/-/verdaccio/data/sidebar/storybook', () => {
|
|
35
|
+
return HttpResponse.json(require('../../../vitest/api/storybook-sidebar.json'));
|
|
36
|
+
}),
|
|
37
|
+
http.get('https://my-registry.org/-/verdaccio/data/package/readme/storybook', () => {
|
|
38
|
+
return HttpResponse.json(require('../../../vitest/api/storybook-readme')());
|
|
39
|
+
}),
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
29
43
|
};
|
|
30
44
|
|
|
31
45
|
export const jQuery: Story = {
|
|
@@ -41,4 +55,16 @@ export const jQuery: Story = {
|
|
|
41
55
|
</MemoryRouter>
|
|
42
56
|
);
|
|
43
57
|
},
|
|
58
|
+
parameters: {
|
|
59
|
+
msw: {
|
|
60
|
+
handlers: [
|
|
61
|
+
http.get('https://my-registry.org/-/verdaccio/data/sidebar/jquery', () => {
|
|
62
|
+
return HttpResponse.json(require('../../../vitest/api/jquery-sidebar.json'));
|
|
63
|
+
}),
|
|
64
|
+
http.get('https://my-registry.org/-/verdaccio/data/package/readme/jquery', () => {
|
|
65
|
+
return HttpResponse.json(require('../../../vitest/api/jquery-readme')());
|
|
66
|
+
}),
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
44
70
|
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default as TranslatorProvider, useLanguage
|
|
1
|
+
export { default as TranslatorProvider, useLanguage } from './TranslatorProvider';
|
|
2
|
+
export type { LanguageItem } from './TranslatorProvider';
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { HttpResponse, http } from 'msw';
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { MemoryRouter, Route } from 'react-router';
|
|
3
5
|
|
|
4
6
|
import { VersionProvider } from '../../providers';
|
|
5
7
|
import Detail from './Detail';
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
const meta: Meta<typeof Detail> = {
|
|
8
10
|
title: 'Sections/Detail',
|
|
11
|
+
component: Detail,
|
|
9
12
|
};
|
|
10
13
|
|
|
11
|
-
export
|
|
12
|
-
<MemoryRouter initialEntries={[`/-/web/detail/storybook`]}>
|
|
13
|
-
<Route exact={true} path="/-/web/detail/:package">
|
|
14
|
-
<VersionProvider>
|
|
15
|
-
<Detail />
|
|
16
|
-
</VersionProvider>
|
|
17
|
-
</Route>
|
|
18
|
-
</MemoryRouter>
|
|
19
|
-
);
|
|
14
|
+
export default meta;
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
type Story = StoryObj<typeof Detail>;
|
|
17
|
+
const getDetailApp = (url: string) => (
|
|
18
|
+
<MemoryRouter initialEntries={[url]}>
|
|
23
19
|
<Route exact={true} path="/-/web/detail/:package">
|
|
24
20
|
<VersionProvider>
|
|
25
21
|
<Detail />
|
|
@@ -28,12 +24,47 @@ export const DetailJquery: any = () => (
|
|
|
28
24
|
</MemoryRouter>
|
|
29
25
|
);
|
|
30
26
|
|
|
31
|
-
export const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
)
|
|
27
|
+
export const DetailStorybook: Story = {
|
|
28
|
+
render: () => getDetailApp(`/-/web/detail/storybook`),
|
|
29
|
+
parameters: {
|
|
30
|
+
msw: {
|
|
31
|
+
handlers: [
|
|
32
|
+
http.get('https://my-registry.org/-/verdaccio/data/sidebar/storybook', () => {
|
|
33
|
+
return HttpResponse.json(require('../../../vitest/api/storybook-sidebar.json'));
|
|
34
|
+
}),
|
|
35
|
+
http.get('https://my-registry.org/-/verdaccio/data/package/readme/storybook', () => {
|
|
36
|
+
return HttpResponse.json(require('../../../vitest/api/storybook-readme')());
|
|
37
|
+
}),
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const DetailJquery: Story = {
|
|
44
|
+
render: () => getDetailApp(`/-/web/detail/jquery`),
|
|
45
|
+
parameters: {
|
|
46
|
+
msw: {
|
|
47
|
+
handlers: [
|
|
48
|
+
http.get('https://my-registry.org/-/verdaccio/data/sidebar/jquery', () => {
|
|
49
|
+
return HttpResponse.json(require('../../../vitest/api/jquery-sidebar.json'));
|
|
50
|
+
}),
|
|
51
|
+
http.get('https://my-registry.org/-/verdaccio/data/package/readme/jquery', () => {
|
|
52
|
+
return HttpResponse.json(require('../../../vitest/api/jquery-readme')());
|
|
53
|
+
}),
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const DetailForbidden: Story = {
|
|
60
|
+
render: () => getDetailApp(`/-/web/detail/JSONStream`),
|
|
61
|
+
parameters: {
|
|
62
|
+
msw: {
|
|
63
|
+
handlers: [
|
|
64
|
+
http.get('https://my-registry.org/-/verdaccio/data/sidebar/JSONStream', () => {
|
|
65
|
+
return new HttpResponse('unauthorized', { status: 401 });
|
|
66
|
+
}),
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { HttpResponse, http } from 'msw';
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { MemoryRouter, Route } from 'react-router';
|
|
3
5
|
|
|
@@ -5,10 +7,14 @@ import { HeaderInfoDialog } from '../../';
|
|
|
5
7
|
import { VersionProvider } from '../../providers';
|
|
6
8
|
import Header from './Header';
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
type Story = StoryObj<typeof Header>;
|
|
11
|
+
const meta: Meta<typeof Header> = {
|
|
9
12
|
title: 'Sections/Header',
|
|
13
|
+
component: Header,
|
|
10
14
|
};
|
|
11
15
|
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
12
18
|
function CustomInfoDialog({ onCloseDialog, title, isOpen }) {
|
|
13
19
|
return (
|
|
14
20
|
<HeaderInfoDialog
|
|
@@ -25,12 +31,29 @@ function CustomInfoDialog({ onCloseDialog, title, isOpen }) {
|
|
|
25
31
|
);
|
|
26
32
|
}
|
|
27
33
|
|
|
28
|
-
export const HeaderAll:
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
export const HeaderAll: Story = {
|
|
35
|
+
render: () => (
|
|
36
|
+
<MemoryRouter initialEntries={[`/-/web/detail/storybook`]}>
|
|
37
|
+
<Route exact={true} path="/-/web/detail/:package">
|
|
38
|
+
<VersionProvider>
|
|
39
|
+
<Header HeaderInfoDialog={CustomInfoDialog} />
|
|
40
|
+
</VersionProvider>
|
|
41
|
+
</Route>
|
|
42
|
+
</MemoryRouter>
|
|
43
|
+
),
|
|
44
|
+
parameters: {
|
|
45
|
+
msw: {
|
|
46
|
+
handlers: [
|
|
47
|
+
http.get('https://my-registry.org/-/verdaccio/data/sidebar/storybook', () => {
|
|
48
|
+
return HttpResponse.json(require('../../../vitest/api/storybook-sidebar.json'));
|
|
49
|
+
}),
|
|
50
|
+
http.get('https://my-registry.org/-/verdaccio/data/package/readme/storybook', () => {
|
|
51
|
+
return HttpResponse.json(require('../../../vitest/api/storybook-readme')());
|
|
52
|
+
}),
|
|
53
|
+
http.get('https://my-registry.org/-/verdaccio/data/search/*', () => {
|
|
54
|
+
return HttpResponse.json(require('../../../vitest/api/search-verdaccio.json'));
|
|
55
|
+
}),
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
@@ -169,7 +169,7 @@ const RegistryInfoContent: FC<Props> = ({ scope, registryUrl }) => {
|
|
|
169
169
|
expandIcon={<ExpandMoreIcon />}
|
|
170
170
|
id="panel3a-header"
|
|
171
171
|
>
|
|
172
|
-
{'pnpm'}
|
|
172
|
+
<Typography className={classes.heading}>{'pnpm'}</Typography>
|
|
173
173
|
</AccordionSummary>
|
|
174
174
|
<AccordionDetails>
|
|
175
175
|
<CommandContainer data-testid={'tab-content'}>
|