@verdaccio/ui-components 2.0.0-6-next.10 → 3.0.0-next-7.3
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 +80 -0
- package/README.md +1 -1
- package/build/Theme/ResetStyles.js +1 -2
- package/build/Theme/StyleBaseline.js +1 -2
- package/build/Theme/ThemeProvider.js +2 -2
- package/build/Theme/colors.js +1 -2
- package/build/Theme/index.js +2 -2
- package/build/Theme/theme.js +13 -3
- package/build/components/ActionBar/ActionBar.js +9 -6
- package/build/components/ActionBar/ActionBarAction.js +19 -13
- package/build/components/Author/Author.js +16 -9
- package/build/components/Author/styles.js +9 -27
- package/build/components/CopyClipboard/CopyToClipBoard.js +13 -13
- package/build/components/Dependencies/Dependencies.js +1 -2
- package/build/components/Dependencies/styles.js +4 -8
- package/build/components/Deprecated/Deprecated.js +12 -21
- package/build/components/Developers/Developers.js +6 -10
- package/build/components/Developers/Title.js +2 -4
- package/build/components/Developers/get-unique-developer-values.js +1 -2
- package/build/components/Developers/index.js +2 -2
- package/build/components/Developers/styles.js +4 -8
- package/build/components/Distribution/Dist.js +1 -2
- package/build/components/Distribution/styles.js +4 -8
- package/build/components/Engines/Engines.js +8 -9
- package/build/components/Engines/styles.js +2 -4
- package/build/components/ErrorBoundary/ErrorBoundary.js +2 -2
- package/build/components/FundButton/FundButton.js +1 -2
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.js +1 -2
- package/build/components/Heading/Heading.js +3 -4
- package/build/components/Help/Help.js +3 -4
- package/build/components/Help/styles.js +1 -2
- package/build/components/Icons/Earth.js +1 -2
- package/build/components/Icons/FileBinary.js +1 -2
- package/build/components/Icons/Law.js +1 -2
- package/build/components/Icons/License.js +1 -2
- package/build/components/Icons/License.js.map +1 -1
- package/build/components/Icons/SvgIcon.js +1 -2
- package/build/components/Icons/Time.js +1 -2
- package/build/components/Icons/Version.js +1 -2
- package/build/components/Install/Install.js +12 -10
- package/build/components/Install/InstallListItem.js +29 -43
- package/build/components/Label/Label.js +1 -2
- package/build/components/Link/Link.js +8 -7
- package/build/components/Loading/Loading.js +1 -2
- package/build/components/Loading/Spinner/Spinner.js +1 -2
- package/build/components/Loading/styles.js +2 -4
- package/build/components/LoginDialog/LoginDialog.js +3 -4
- package/build/components/LoginDialog/LoginDialogCloseButton.js +1 -2
- package/build/components/LoginDialog/LoginDialogForm.js +3 -4
- package/build/components/LoginDialog/LoginDialogFormError.js +3 -4
- package/build/components/LoginDialog/LoginDialogHeader.js +1 -2
- package/build/components/Logo/Logo.js +1 -2
- package/build/components/MenuItem/MenuItem.js +3 -4
- package/build/components/NoItems/NoItems.js +1 -2
- package/build/components/NotFound/NotFound.js +3 -4
- package/build/components/Package/Package.js +17 -11
- package/build/components/Package/Tag/Tag.js +1 -2
- package/build/components/Package/Tag/styles.js +1 -2
- package/build/components/Package/index.js +2 -2
- package/build/components/Package/styles.js +13 -26
- package/build/components/PackageList/PackageList.js +1 -2
- package/build/components/RawViewer/RawViewer.js +1 -3
- package/build/components/Readme/Readme.js +30 -19
- package/build/components/Readme/Readme.js.map +1 -1
- package/build/components/Readme/github-markdown.css +1198 -0
- package/build/components/Readme/utils.js +12 -12
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js +1 -2
- package/build/components/RegistryInfoDialog/styles.js +3 -6
- package/build/components/Repository/Repository.js +1 -2
- package/build/components/Search/AutoComplete/AutoComplete.js +3 -4
- package/build/components/Search/AutoComplete/styles.js +2 -4
- package/build/components/Search/Search.js +5 -6
- package/build/components/Search/SearchItem.js +2 -4
- package/build/components/Search/styles.js +2 -4
- package/build/components/SettingsMenu/SettingsMenu.js +17 -5
- package/build/components/SideBarTittle/SideBarTittle.js +6 -6
- package/build/components/SideBarTittle/utils.js +1 -2
- package/build/components/TextField/TextField.js +3 -4
- package/build/components/UpLinks/UpLinks.js +1 -2
- package/build/components/UpLinks/styles.js +3 -6
- package/build/components/Versions/HistoryList.js +33 -6
- package/build/components/Versions/TagList.js +1 -2
- package/build/components/Versions/Versions.js +17 -4
- package/build/components/Versions/__partials__/data.json +1 -0
- package/build/components/Versions/__partials__/deprecated-versions.json +175 -0
- package/build/components/Versions/styles.js +2 -4
- package/build/hooks/useLocalStorage.js +1 -2
- package/build/hooks/useOnClickOutside.js +1 -2
- package/build/index.js +2 -2
- package/build/layouts/Version/Version.js +1 -2
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js +4 -4
- package/build/providers/AppConfigurationProvider/index.js +2 -2
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js +5 -5
- package/build/providers/PersistenceSettingProvider/index.js +2 -2
- package/build/providers/TranslatorProvider/TranslatorProvider.js +3 -4
- package/build/providers/TranslatorProvider/TranslatorProvider.spec.js +2 -2
- package/build/providers/TranslatorProvider/index.js +2 -2
- package/build/providers/VersionProvider/VersionProvider.js +4 -6
- package/build/providers/VersionProvider/index.js +2 -2
- package/build/sections/Detail/ContainerContent.js +4 -6
- package/build/sections/Detail/Detail.js +4 -6
- package/build/sections/Detail/ReadmeSection.js +1 -2
- package/build/sections/Detail/Tabs.js +1 -2
- package/build/sections/Footer/Footer.js +1 -2
- package/build/sections/Footer/styles.js +5 -10
- package/build/sections/Header/Header.js +3 -4
- package/build/sections/Header/HeaderGreetings.js +1 -2
- package/build/sections/Header/HeaderLeft.js +1 -2
- package/build/sections/Header/HeaderMenu.js +1 -2
- package/build/sections/Header/HeaderRight.js +3 -4
- package/build/sections/Header/HeaderSettingsDialog.js +1 -2
- package/build/sections/Header/HeaderToolTip.js +1 -2
- package/build/sections/Header/HeaderToolTipIcon.js +3 -4
- package/build/sections/Header/LanguageSwitch.js +7 -10
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +5 -10
- package/build/sections/Header/RegistryInfoContent/styles.js +2 -4
- package/build/sections/Header/RegistryInfoDialog/RegistryInfoDialog.js +1 -2
- package/build/sections/Header/RegistryInfoDialog/styles.js +3 -6
- package/build/sections/Header/styles.js +13 -26
- package/build/sections/Home/Home.js +3 -4
- package/build/sections/SideBar/Sidebar.js +3 -4
- package/build/src/__mocks__/react-markdown.d.ts +2 -2
- package/build/src/components/Author/styles.d.ts +0 -4
- package/build/src/components/CopyClipboard/CopyToClipBoard.d.ts +1 -1
- package/build/src/components/Deprecated/Deprecated.d.ts +0 -1
- package/build/src/components/Heading/Heading.d.ts +1 -1
- package/build/src/components/Icons/DevsIcons/CommonJS.d.ts +2 -2
- package/build/src/components/Icons/DevsIcons/ES6Module.d.ts +2 -2
- package/build/src/components/Icons/DevsIcons/Git.d.ts +2 -2
- package/build/src/components/Icons/DevsIcons/NodeJS.d.ts +2 -2
- package/build/src/components/Icons/DevsIcons/TypeScript.d.ts +2 -2
- package/build/src/components/Icons/Earth.d.ts +2 -2
- package/build/src/components/Icons/FileBinary.d.ts +2 -2
- package/build/src/components/Icons/Law.d.ts +2 -2
- package/build/src/components/Icons/License.d.ts +2 -2
- package/build/src/components/Icons/Managers/Npm.d.ts +2 -2
- package/build/src/components/Icons/Managers/Pnpm.d.ts +2 -2
- package/build/src/components/Icons/Managers/Yarn.d.ts +2 -2
- package/build/src/components/Icons/SvgIcon.d.ts +1 -1
- package/build/src/components/Icons/Time.d.ts +2 -2
- package/build/src/components/Icons/Version.d.ts +2 -2
- package/build/src/components/Install/InstallListItem.d.ts +2 -0
- package/build/src/components/Link/Link.d.ts +1 -1
- package/build/src/components/LoginDialog/LoginDialog.stories.d.ts +2 -2
- package/build/src/components/LoginDialog/LoginDialogForm.d.ts +1 -1
- package/build/src/components/LoginDialog/LoginDialogFormError.d.ts +1 -1
- package/build/src/components/MenuItem/MenuItem.d.ts +1 -1
- package/build/src/components/Readme/Readme.d.ts +1 -1
- package/build/src/components/Search/AutoComplete/styles.d.ts +1 -1
- package/build/src/components/Search/Search.stories.d.ts +2 -2
- package/build/src/components/Search/styles.d.ts +1 -1
- package/build/src/components/TextField/TextField.d.ts +1 -1
- package/build/src/components/Versions/HistoryList.d.ts +1 -0
- package/build/src/sections/Footer/Footer.d.ts +2 -2
- package/build/src/sections/Header/HeaderMenu.d.ts +1 -1
- package/build/src/sections/Header/LanguageSwitch.d.ts +2 -2
- package/build/src/sections/Header/styles.d.ts +1 -1
- package/build/src/store/models/login.d.ts +1 -0
- package/build/src/types/packageMeta.d.ts +1 -0
- package/build/src/utils/__partials__/packageMeta.d.ts +0 -1
- package/build/src/utils/index.d.ts +1 -0
- package/build/src/utils/loadable.d.ts +2 -2
- package/build/src/utils/token.d.ts +1 -0
- package/build/store/api.js +1 -2
- package/build/store/models/configuration.js +3 -4
- package/build/store/models/download.js +1 -3
- package/build/store/models/index.js +1 -2
- package/build/store/models/login.js +19 -11
- package/build/store/models/manifest.js +1 -2
- package/build/store/models/packages.js +1 -2
- package/build/store/models/search.js +1 -2
- package/build/store/storage.js +1 -2
- package/build/store/store.js +1 -2
- package/build/test/i18n-config.js +1 -2
- package/build/utils/__partials__/packageMeta.js +1 -3
- package/build/utils/index.js +24 -2
- package/build/utils/loadable.js +2 -2
- package/build/utils/routes.js +1 -2
- package/build/utils/token.js +35 -0
- package/build/utils/utils.js +1 -2
- package/package.json +28 -25
- package/src/Theme/theme.ts +8 -1
- package/src/components/ActionBar/ActionBar.stories.tsx +1 -1
- package/src/components/ActionBar/ActionBar.test.tsx +17 -10
- package/src/components/ActionBar/ActionBar.tsx +16 -12
- package/src/components/ActionBar/ActionBarAction.tsx +15 -10
- package/src/components/Author/Author.tsx +13 -4
- package/src/components/Author/styles.ts +0 -6
- package/src/components/CopyClipboard/CopyToClipBoard.tsx +4 -3
- package/src/components/Deprecated/Deprecated.tsx +6 -19
- package/src/components/Engines/Engines.tsx +5 -5
- package/src/components/Help/Help.test.tsx +10 -3
- package/src/components/Install/Install.test.tsx +29 -37
- package/src/components/Install/Install.tsx +15 -4
- package/src/components/Install/InstallListItem.tsx +46 -30
- package/src/components/Link/Link.tsx +10 -3
- package/src/components/Package/Package.tsx +10 -2
- package/src/components/RawViewer/RawViewer.tsx +1 -6
- package/src/components/Readme/Readme.tsx +22 -11
- package/src/components/Readme/github-markdown.css +1198 -0
- package/src/components/Readme/utils.ts +13 -9
- package/src/components/Search/Search.test.tsx +2 -2
- package/src/components/SettingsMenu/SettingsMenu.tsx +23 -4
- package/src/components/SideBarTittle/SideBarTittle.tsx +1 -0
- package/src/components/Versions/HistoryList.tsx +29 -1
- package/src/components/Versions/Versions.test.tsx +16 -1
- package/src/components/Versions/Versions.tsx +17 -1
- package/src/components/Versions/__partials__/data.json +1 -0
- package/src/components/Versions/__partials__/deprecated-versions.json +175 -0
- package/src/providers/AppConfigurationProvider/AppConfigurationProvider.tsx +1 -0
- package/src/providers/PersistenceSettingProvider/PersistenceSettingProvider.tsx +2 -0
- package/src/sections/Header/HeaderMenu.tsx +1 -1
- package/src/sections/Header/LanguageSwitch.tsx +10 -7
- package/src/sections/SideBar/Sidebar.test.tsx +7 -3
- package/src/store/models/download.ts +0 -1
- package/src/store/models/login.test.ts +38 -0
- package/src/store/models/login.ts +12 -6
- package/src/types/packageMeta.ts +1 -0
- package/src/utils/__partials__/packageMeta.ts +0 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/token.test.ts +54 -0
- package/src/utils/token.ts +33 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const Footer: () => JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const Footer: () => React.JSX.Element;
|
|
3
3
|
export default Footer;
|
|
@@ -2,7 +2,7 @@ import React, { MouseEvent } from 'react';
|
|
|
2
2
|
interface Props {
|
|
3
3
|
username: string;
|
|
4
4
|
isMenuOpen: boolean;
|
|
5
|
-
anchorEl?: Element |
|
|
5
|
+
anchorEl?: Element | null | undefined;
|
|
6
6
|
onLogout: () => void;
|
|
7
7
|
onLoggedInMenu: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
8
8
|
onLoggedInMenuClose: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export declare const CardSelected: import("@emotion/styled").StyledComponent<any, {}, {}>;
|
|
3
3
|
export declare const CardUnSelected: import("@emotion/styled").StyledComponent<any, {}, {}>;
|
|
4
|
-
declare const LanguageSwitch: () => JSX.Element;
|
|
4
|
+
declare const LanguageSwitch: () => React.JSX.Element;
|
|
5
5
|
export default LanguageSwitch;
|
|
@@ -27,7 +27,7 @@ export declare const SearchWrapper: import("@emotion/styled").StyledComponent<{
|
|
|
27
27
|
as?: import("react").ElementType<any> | undefined;
|
|
28
28
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
29
29
|
export declare const NavBar: import("@emotion/styled").StyledComponent<any, {}, {}>;
|
|
30
|
-
export declare const StyledLink: import("@emotion/styled").StyledComponent<
|
|
30
|
+
export declare const StyledLink: import("@emotion/styled").StyledComponent<Omit<any, "ref"> & import("react").RefAttributes<HTMLAnchorElement> & {
|
|
31
31
|
theme?: import("@emotion/react").Theme | undefined;
|
|
32
32
|
} & {
|
|
33
33
|
theme?: import("@mui/material").Theme | undefined;
|
|
@@ -154,7 +154,6 @@ export declare const packageMeta: {
|
|
|
154
154
|
'flow-runtime': string;
|
|
155
155
|
'friendly-errors-webpack-plugin': string;
|
|
156
156
|
'fs-extra': string;
|
|
157
|
-
'github-markdown-css': string;
|
|
158
157
|
'html-webpack-plugin': string;
|
|
159
158
|
'in-publish': string;
|
|
160
159
|
'localstorage-memory': string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* With the combination of a bundler, enable to code split a package.
|
|
4
4
|
*
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
```
|
|
9
9
|
@category HOC
|
|
10
10
|
*/
|
|
11
|
-
declare const _default: (importCallback: any) => (props: any) => JSX.Element;
|
|
11
|
+
declare const _default: (importCallback: any) => (props: any) => React.JSX.Element;
|
|
12
12
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isTokenExpire(token: string | null): boolean;
|
package/build/store/api.js
CHANGED
|
@@ -22,8 +22,8 @@ const defaultValues = {
|
|
|
22
22
|
title: 'Verdaccio'
|
|
23
23
|
};
|
|
24
24
|
function getConfiguration() {
|
|
25
|
-
var _window;
|
|
26
|
-
const uiConfiguration = ((_window = window) === null || _window === void 0 ? void 0 : _window.__VERDACCIO_BASENAME_UI_OPTIONS)
|
|
25
|
+
var _window$__VERDACCIO_B, _window;
|
|
26
|
+
const uiConfiguration = (_window$__VERDACCIO_B = (_window = window) === null || _window === void 0 ? void 0 : _window.__VERDACCIO_BASENAME_UI_OPTIONS) !== null && _window$__VERDACCIO_B !== void 0 ? _window$__VERDACCIO_B : defaultValues;
|
|
27
27
|
if ((0, _isNil.default)(uiConfiguration.primaryColor) || (0, _isEmpty.default)(uiConfiguration.primaryColor)) {
|
|
28
28
|
uiConfiguration.primaryColor = _Theme.colors.PRIMARY_COLOR;
|
|
29
29
|
}
|
|
@@ -34,7 +34,7 @@ function getConfiguration() {
|
|
|
34
34
|
*
|
|
35
35
|
* @category Model
|
|
36
36
|
*/
|
|
37
|
-
const configuration = (0, _core.createModel)()({
|
|
37
|
+
const configuration = exports.configuration = (0, _core.createModel)()({
|
|
38
38
|
state: {
|
|
39
39
|
config: getConfiguration()
|
|
40
40
|
},
|
|
@@ -45,5 +45,4 @@ const configuration = (0, _core.createModel)()({
|
|
|
45
45
|
}
|
|
46
46
|
})
|
|
47
47
|
});
|
|
48
|
-
exports.configuration = configuration;
|
|
49
48
|
//# sourceMappingURL=configuration.js.map
|
|
@@ -12,14 +12,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
12
12
|
*
|
|
13
13
|
* @category Model
|
|
14
14
|
*/
|
|
15
|
-
const download = (0, _core.createModel)()({
|
|
15
|
+
const download = exports.download = (0, _core.createModel)()({
|
|
16
16
|
state: {},
|
|
17
17
|
reducers: {},
|
|
18
18
|
effects: () => ({
|
|
19
19
|
async getTarball({
|
|
20
20
|
link
|
|
21
21
|
}) {
|
|
22
|
-
// const basePath = state.configuration.config.base;
|
|
23
22
|
try {
|
|
24
23
|
const fileStream = await _api.default.request(link, 'GET', {
|
|
25
24
|
headers: {
|
|
@@ -37,5 +36,4 @@ const download = (0, _core.createModel)()({
|
|
|
37
36
|
}
|
|
38
37
|
})
|
|
39
38
|
});
|
|
40
|
-
exports.download = download;
|
|
41
39
|
//# sourceMappingURL=download.js.map
|
|
@@ -10,7 +10,7 @@ var _login = require("./login");
|
|
|
10
10
|
var _manifest = require("./manifest");
|
|
11
11
|
var _packages = require("./packages");
|
|
12
12
|
var _search = require("./search");
|
|
13
|
-
const models = {
|
|
13
|
+
const models = exports.models = {
|
|
14
14
|
packages: _packages.packages,
|
|
15
15
|
configuration: _configuration.configuration,
|
|
16
16
|
search: _search.search,
|
|
@@ -18,5 +18,4 @@ const models = {
|
|
|
18
18
|
login: _login.login,
|
|
19
19
|
manifest: _manifest.manifest
|
|
20
20
|
};
|
|
21
|
-
exports.models = models;
|
|
22
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -3,28 +3,37 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.HEADERS = void 0;
|
|
7
|
+
exports.getDefaultUserState = getDefaultUserState;
|
|
8
|
+
exports.login = void 0;
|
|
7
9
|
var _core = require("@rematch/core");
|
|
8
10
|
var _i18next = _interopRequireDefault(require("i18next"));
|
|
11
|
+
var _utils = require("../../utils");
|
|
9
12
|
var _api = _interopRequireDefault(require("../api"));
|
|
10
13
|
var _storage = _interopRequireDefault(require("../storage"));
|
|
11
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
const HEADERS = {
|
|
15
|
+
const HEADERS = exports.HEADERS = {
|
|
13
16
|
JSON: 'application/json'
|
|
14
17
|
};
|
|
15
|
-
|
|
16
|
-
const token = _storage.default.getItem('token');
|
|
17
|
-
const username = _storage.default.getItem('username');
|
|
18
|
-
const defaultUserState = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
18
|
+
function getDefaultUserState() {
|
|
19
|
+
const token = _storage.default.getItem('token');
|
|
20
|
+
const username = _storage.default.getItem('username');
|
|
21
|
+
const defaultUserState = (0, _utils.isTokenExpire)(token) ? {
|
|
22
|
+
token: null,
|
|
23
|
+
username: null
|
|
24
|
+
} : {
|
|
25
|
+
token,
|
|
26
|
+
username
|
|
27
|
+
};
|
|
28
|
+
return defaultUserState;
|
|
29
|
+
}
|
|
30
|
+
const defaultUserState = getDefaultUserState();
|
|
22
31
|
|
|
23
32
|
/**
|
|
24
33
|
*
|
|
25
34
|
* @category Model
|
|
26
35
|
*/
|
|
27
|
-
const login = (0, _core.createModel)()({
|
|
36
|
+
const login = exports.login = (0, _core.createModel)()({
|
|
28
37
|
state: {
|
|
29
38
|
username: defaultUserState.username,
|
|
30
39
|
token: defaultUserState.token
|
|
@@ -90,5 +99,4 @@ const login = (0, _core.createModel)()({
|
|
|
90
99
|
}
|
|
91
100
|
})
|
|
92
101
|
});
|
|
93
|
-
exports.login = login;
|
|
94
102
|
//# sourceMappingURL=login.js.map
|
|
@@ -22,7 +22,7 @@ function isPackageVersionValid(packageMeta, packageVersion) {
|
|
|
22
22
|
*
|
|
23
23
|
* @category Model
|
|
24
24
|
*/
|
|
25
|
-
const manifest = (0, _core.createModel)()({
|
|
25
|
+
const manifest = exports.manifest = (0, _core.createModel)()({
|
|
26
26
|
state: {},
|
|
27
27
|
reducers: {
|
|
28
28
|
notFound(state) {
|
|
@@ -95,5 +95,4 @@ const manifest = (0, _core.createModel)()({
|
|
|
95
95
|
}
|
|
96
96
|
})
|
|
97
97
|
});
|
|
98
|
-
exports.manifest = manifest;
|
|
99
98
|
//# sourceMappingURL=manifest.js.map
|
|
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
11
11
|
*
|
|
12
12
|
* @category Model
|
|
13
13
|
*/
|
|
14
|
-
const packages = (0, _core.createModel)()({
|
|
14
|
+
const packages = exports.packages = (0, _core.createModel)()({
|
|
15
15
|
state: {
|
|
16
16
|
response: []
|
|
17
17
|
},
|
|
@@ -40,5 +40,4 @@ const packages = (0, _core.createModel)()({
|
|
|
40
40
|
}
|
|
41
41
|
})
|
|
42
42
|
});
|
|
43
|
-
exports.packages = packages;
|
|
44
43
|
//# sourceMappingURL=packages.js.map
|
|
@@ -12,7 +12,7 @@ const CONSTANTS = {
|
|
|
12
12
|
API_DELAY: 300,
|
|
13
13
|
ABORT_ERROR: 'AbortError'
|
|
14
14
|
};
|
|
15
|
-
const search = (0, _core.createModel)()({
|
|
15
|
+
const search = exports.search = (0, _core.createModel)()({
|
|
16
16
|
state: {
|
|
17
17
|
suggestions: [],
|
|
18
18
|
controller: []
|
|
@@ -86,5 +86,4 @@ const search = (0, _core.createModel)()({
|
|
|
86
86
|
}
|
|
87
87
|
})
|
|
88
88
|
});
|
|
89
|
-
exports.search = search;
|
|
90
89
|
//# sourceMappingURL=search.js.map
|
package/build/store/storage.js
CHANGED
package/build/store/store.js
CHANGED
|
@@ -8,9 +8,8 @@ var _core = require("@rematch/core");
|
|
|
8
8
|
var _loading = _interopRequireDefault(require("@rematch/loading"));
|
|
9
9
|
var _models = require("./models");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
const store = (0, _core.init)({
|
|
11
|
+
const store = exports.store = (0, _core.init)({
|
|
12
12
|
models: _models.models,
|
|
13
13
|
plugins: [(0, _loading.default)()]
|
|
14
14
|
});
|
|
15
|
-
exports.store = store;
|
|
16
15
|
//# sourceMappingURL=store.js.map
|
|
@@ -21,6 +21,5 @@ _i18next.default.use(_reactI18next.initReactI18next).init({
|
|
|
21
21
|
escapeValue: false // react already safes from xss
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
var _default = _i18next.default;
|
|
25
|
-
exports.default = _default;
|
|
24
|
+
var _default = exports.default = _i18next.default;
|
|
26
25
|
//# sourceMappingURL=i18n-config.js.map
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.packageMeta = void 0;
|
|
7
|
-
const packageMeta = {
|
|
7
|
+
const packageMeta = exports.packageMeta = {
|
|
8
8
|
name: 'verdaccio',
|
|
9
9
|
'dist-tags': {
|
|
10
10
|
latest: '2.7.1',
|
|
@@ -160,7 +160,6 @@ const packageMeta = {
|
|
|
160
160
|
'flow-runtime': '0.13.0',
|
|
161
161
|
'friendly-errors-webpack-plugin': '1.6.1',
|
|
162
162
|
'fs-extra': '4.0.1',
|
|
163
|
-
'github-markdown-css': '2.8.0',
|
|
164
163
|
'html-webpack-plugin': '2.29.0',
|
|
165
164
|
'in-publish': '2.0.0',
|
|
166
165
|
'localstorage-memory': '1.0.2',
|
|
@@ -532,5 +531,4 @@ const packageMeta = {
|
|
|
532
531
|
}
|
|
533
532
|
}
|
|
534
533
|
};
|
|
535
|
-
exports.packageMeta = packageMeta;
|
|
536
534
|
//# sourceMappingURL=packageMeta.js.map
|
package/build/utils/index.js
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
url: true,
|
|
8
|
+
utils: true,
|
|
9
|
+
getCLIChangePassword: true,
|
|
10
|
+
getCLISBerryYamlRegistry: true,
|
|
11
|
+
getCLISetConfigRegistry: true,
|
|
12
|
+
getCLISetRegistry: true,
|
|
13
|
+
loadable: true,
|
|
14
|
+
Route: true
|
|
15
|
+
};
|
|
6
16
|
Object.defineProperty(exports, "Route", {
|
|
7
17
|
enumerable: true,
|
|
8
18
|
get: function () {
|
|
@@ -47,7 +57,19 @@ exports.utils = _utils;
|
|
|
47
57
|
var _cliUtils = require("./cli-utils");
|
|
48
58
|
var _loadable = _interopRequireDefault(require("./loadable"));
|
|
49
59
|
var _routes = require("./routes");
|
|
60
|
+
var _token = require("./token");
|
|
61
|
+
Object.keys(_token).forEach(function (key) {
|
|
62
|
+
if (key === "default" || key === "__esModule") return;
|
|
63
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
64
|
+
if (key in exports && exports[key] === _token[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () {
|
|
68
|
+
return _token[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
50
72
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
51
|
-
function _getRequireWildcardCache(
|
|
52
|
-
function _interopRequireWildcard(
|
|
73
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
74
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
53
75
|
//# sourceMappingURL=index.js.map
|
package/build/utils/loadable.js
CHANGED
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
function _getRequireWildcardCache(
|
|
9
|
-
function _interopRequireWildcard(
|
|
8
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
10
|
/* eslint-disable verdaccio/jsx-spread */
|
|
11
11
|
/**
|
|
12
12
|
* With the combination of a bundler, enable to code split a package.
|
package/build/utils/routes.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Route = void 0;
|
|
7
|
-
let Route = /*#__PURE__*/function (Route) {
|
|
7
|
+
let Route = exports.Route = /*#__PURE__*/function (Route) {
|
|
8
8
|
Route["ROOT"] = "/";
|
|
9
9
|
Route["SCOPE_PACKAGE"] = "/-/web/detail/@:scope/:package";
|
|
10
10
|
Route["SCOPE_PACKAGE_VERSION"] = "/-/web/detail/@:scope/:package/v/:version";
|
|
@@ -12,5 +12,4 @@ let Route = /*#__PURE__*/function (Route) {
|
|
|
12
12
|
Route["PACKAGE_VERSION"] = "/-/web/detail/:package/v/:version";
|
|
13
13
|
return Route;
|
|
14
14
|
}({});
|
|
15
|
-
exports.Route = Route;
|
|
16
15
|
//# sourceMappingURL=routes.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isTokenExpire = isTokenExpire;
|
|
7
|
+
var _jsBase = require("js-base64");
|
|
8
|
+
var _isNumber = _interopRequireDefault(require("lodash/isNumber"));
|
|
9
|
+
var _isString = _interopRequireDefault(require("lodash/isString"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function isTokenExpire(token) {
|
|
12
|
+
if (!(0, _isString.default)(token)) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
const [, payload] = token.split('.');
|
|
16
|
+
if (!payload) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
let exp;
|
|
20
|
+
try {
|
|
21
|
+
exp = JSON.parse(_jsBase.Base64.decode(payload)).exp;
|
|
22
|
+
} catch (error) {
|
|
23
|
+
// eslint-disable-next-line no-console
|
|
24
|
+
console.error('Invalid token:', error, token);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
if (!exp || !(0, _isNumber.default)(exp)) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
// Report as expire before (real expire time - 30s)
|
|
31
|
+
const jsTimestamp = exp * 1000 - 30000;
|
|
32
|
+
const expired = Date.now() >= jsTimestamp;
|
|
33
|
+
return expired;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=token.js.map
|
package/build/utils/utils.js
CHANGED
|
@@ -18,8 +18,7 @@ var _relativeTime = _interopRequireDefault(require("dayjs/plugin/relativeTime"))
|
|
|
18
18
|
var _i18next = _interopRequireDefault(require("i18next"));
|
|
19
19
|
var _isString = _interopRequireDefault(require("lodash/isString"));
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
const TIMEFORMAT = 'L LTS';
|
|
22
|
-
exports.TIMEFORMAT = TIMEFORMAT;
|
|
21
|
+
const TIMEFORMAT = exports.TIMEFORMAT = 'L LTS';
|
|
23
22
|
_dayjs.default.extend(_relativeTime.default);
|
|
24
23
|
_dayjs.default.extend(_localizedFormat.default);
|
|
25
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/ui-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-next-7.3",
|
|
4
4
|
"description": "theme ui component",
|
|
5
5
|
"author": "Juan Picado <juanpicado19@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,42 +12,43 @@
|
|
|
12
12
|
"@emotion/styled": "^11.10.6",
|
|
13
13
|
"@fontsource/material-icons": "^4.5.4",
|
|
14
14
|
"@fontsource/roboto": "^4.5.8",
|
|
15
|
-
"@mui/icons-material": "5.
|
|
16
|
-
"@mui/material": "5.
|
|
17
|
-
"@mui/styles": "5.
|
|
18
|
-
"@mui/system": "5.
|
|
15
|
+
"@mui/icons-material": "5.15.6",
|
|
16
|
+
"@mui/material": "5.15.6",
|
|
17
|
+
"@mui/styles": "5.15.6",
|
|
18
|
+
"@mui/system": "5.15.6",
|
|
19
19
|
"@rematch/core": "2.2.0",
|
|
20
20
|
"@rematch/loading": "2.1.2",
|
|
21
21
|
"@rematch/persist": "2.1.2",
|
|
22
|
-
"country-flag-icons": "1.5.
|
|
23
|
-
"dayjs": "1.11.
|
|
24
|
-
"dompurify": "
|
|
25
|
-
"
|
|
26
|
-
"highlight.js": "11.7.0",
|
|
22
|
+
"country-flag-icons": "1.5.9",
|
|
23
|
+
"dayjs": "1.11.10",
|
|
24
|
+
"dompurify": "3.0.8",
|
|
25
|
+
"highlight.js": "11.9.0",
|
|
27
26
|
"history": "4.10.1",
|
|
28
27
|
"i18next": "20.6.1",
|
|
28
|
+
"js-base64": "3.7.6",
|
|
29
29
|
"localstorage-memory": "1.0.3",
|
|
30
30
|
"lodash": "4.17.21",
|
|
31
|
-
"marked": "
|
|
31
|
+
"marked": "11.1.1",
|
|
32
|
+
"marked-highlight": "2.1.0",
|
|
32
33
|
"normalize.css": "8.0.1",
|
|
33
34
|
"react": "18.2.0",
|
|
34
35
|
"react-dom": "18.2.0",
|
|
35
|
-
"react-hook-form": "7.
|
|
36
|
-
"react-i18next": "
|
|
36
|
+
"react-hook-form": "7.49.3",
|
|
37
|
+
"react-i18next": "13.5.0",
|
|
37
38
|
"react-json-view": "1.21.3",
|
|
38
|
-
"react-markdown": "
|
|
39
|
-
"react-redux": "
|
|
39
|
+
"react-markdown": "9.0.1",
|
|
40
|
+
"react-redux": "8.1.3",
|
|
40
41
|
"react-router": "5.3.4",
|
|
41
42
|
"react-router-dom": "5.3.4",
|
|
42
|
-
"react-virtualized": "9.22.
|
|
43
|
+
"react-virtualized": "9.22.5",
|
|
43
44
|
"redux": "4.2.1",
|
|
44
45
|
"remark-gfm": "3.0.1",
|
|
45
|
-
"validator": "13.
|
|
46
|
+
"validator": "13.11.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@babel/core": "^7.
|
|
49
|
+
"@babel/core": "^7.23.0",
|
|
49
50
|
"@emotion/babel-plugin": "11.10.6",
|
|
50
|
-
"@emotion/jest": "11.
|
|
51
|
+
"@emotion/jest": "11.11.0",
|
|
51
52
|
"@storybook/addon-actions": "^6.5.15",
|
|
52
53
|
"@storybook/addon-essentials": "^6.5.15",
|
|
53
54
|
"@storybook/addon-interactions": "^6.5.15",
|
|
@@ -55,17 +56,18 @@
|
|
|
55
56
|
"@storybook/builder-webpack5": "^6.5.15",
|
|
56
57
|
"@storybook/manager-webpack5": "^6.5.15",
|
|
57
58
|
"@storybook/react": "^6.5.15",
|
|
58
|
-
"@storybook/testing-library": "^0.0
|
|
59
|
-
"@testing-library/dom": "
|
|
60
|
-
"@testing-library/jest-dom": "
|
|
61
|
-
"@testing-library/react": "
|
|
59
|
+
"@storybook/testing-library": "^0.2.0",
|
|
60
|
+
"@testing-library/dom": "9.3.4",
|
|
61
|
+
"@testing-library/jest-dom": "6.3.0",
|
|
62
|
+
"@testing-library/react": "14.1.2",
|
|
62
63
|
"@types/hast": "^2.0.0",
|
|
63
64
|
"@types/react-router": "^5.1.20",
|
|
64
65
|
"@types/unist": "^2.0.0",
|
|
65
|
-
"@verdaccio/types": "
|
|
66
|
+
"@verdaccio/types": "12.0.0-next.2",
|
|
66
67
|
"babel-loader": "^8.3.0",
|
|
67
68
|
"mockdate": "3.0.5",
|
|
68
|
-
"msw": "0.49.
|
|
69
|
+
"msw": "0.49.3",
|
|
70
|
+
"typescript": "4.9.5"
|
|
69
71
|
},
|
|
70
72
|
"msw": {
|
|
71
73
|
"workerDirectory": "public"
|
|
@@ -77,6 +79,7 @@
|
|
|
77
79
|
"type-check": "tsc --noEmit -p tsconfig.build.json",
|
|
78
80
|
"build:types": "tsc --emitDeclarationOnly -p tsconfig.build.json",
|
|
79
81
|
"build:js": "babel src/ --out-dir build/ --copy-files --no-copy-ignored --extensions \".ts,.tsx\" --source-maps --ignore \"src/**/*.stories.tsx\" --ignore \"src/**/*.test.tsx\" --ignore \"src/**/*.test.ts\"",
|
|
82
|
+
"watch": "babel src/ --out-dir build/ --watch --copy-files --no-copy-ignored --extensions \".ts,.tsx\" --source-maps --ignore \"src/**/*.stories.tsx\" --ignore \"src/**/*.test.tsx\" --ignore \"src/**/*.test.ts\"",
|
|
80
83
|
"build": "pnpm run build:js && pnpm run build:types",
|
|
81
84
|
"start": "start-storybook -p 6006 -s ./public",
|
|
82
85
|
"build-storybook": "build-storybook"
|
package/src/Theme/theme.ts
CHANGED
|
@@ -25,7 +25,7 @@ const colors = {
|
|
|
25
25
|
nobel02: '#9f9f9f',
|
|
26
26
|
primary: PRIMARY_COLOR,
|
|
27
27
|
secondary: '#20232a',
|
|
28
|
-
background: '#
|
|
28
|
+
background: '#f4f4f4',
|
|
29
29
|
dodgerBlue: '#1ba1f2',
|
|
30
30
|
cyanBlue: '#253341',
|
|
31
31
|
};
|
|
@@ -114,6 +114,13 @@ export const getTheme = (themeMode: ThemeMode, primaryColor: string) => {
|
|
|
114
114
|
default: palette.background,
|
|
115
115
|
},
|
|
116
116
|
},
|
|
117
|
+
// Looks better in darkmode without background opacity
|
|
118
|
+
// https://mui.com/material-ui/migration/v5-component-changes/#change-dark-mode-background-opacity
|
|
119
|
+
components: {
|
|
120
|
+
MuiPaper: {
|
|
121
|
+
styleOverrides: { root: { backgroundImage: 'unset' } },
|
|
122
|
+
},
|
|
123
|
+
},
|
|
117
124
|
...customizedTheme,
|
|
118
125
|
});
|
|
119
126
|
};
|
|
@@ -20,7 +20,7 @@ const packageMeta = {
|
|
|
20
20
|
dist: {
|
|
21
21
|
fileCount: 0,
|
|
22
22
|
unpackedSize: 0,
|
|
23
|
-
tarball: 'https://registry.
|
|
23
|
+
tarball: 'https://registry.npmjs.org/verdaccio/-/verdaccio-5.26.0.tgz',
|
|
24
24
|
},
|
|
25
25
|
homepage: 'https://verdaccio.org',
|
|
26
26
|
bugs: {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { store } from '../../store/store';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
cleanup,
|
|
6
|
+
fireEvent,
|
|
7
|
+
renderWithStore,
|
|
8
|
+
screen,
|
|
9
|
+
waitFor,
|
|
10
|
+
} from '../../test/test-react-testing-library';
|
|
5
11
|
import ActionBar from './ActionBar';
|
|
6
12
|
|
|
7
13
|
const defaultPackageMeta = {
|
|
@@ -27,8 +33,10 @@ describe('<ActionBar /> component', () => {
|
|
|
27
33
|
});
|
|
28
34
|
|
|
29
35
|
test('should render the component in default state', () => {
|
|
30
|
-
|
|
31
|
-
expect(
|
|
36
|
+
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} />, store);
|
|
37
|
+
expect(screen.getByTestId('download-tarball-btn')).toBeInTheDocument();
|
|
38
|
+
expect(screen.getByTestId('BugReportIcon')).toBeInTheDocument();
|
|
39
|
+
expect(screen.getByTestId('HomeIcon')).toBeInTheDocument();
|
|
32
40
|
});
|
|
33
41
|
|
|
34
42
|
test('when there is no action bar data', () => {
|
|
@@ -45,8 +53,10 @@ describe('<ActionBar /> component', () => {
|
|
|
45
53
|
},
|
|
46
54
|
};
|
|
47
55
|
|
|
48
|
-
|
|
49
|
-
expect(
|
|
56
|
+
renderWithStore(<ActionBar packageMeta={packageMeta} />, store);
|
|
57
|
+
expect(screen.queryByTestId('download-tarball-btn')).not.toBeInTheDocument();
|
|
58
|
+
expect(screen.queryByTestId('BugReportIcon')).not.toBeInTheDocument();
|
|
59
|
+
expect(screen.queryByTestId('HomeIcon')).not.toBeInTheDocument();
|
|
50
60
|
});
|
|
51
61
|
|
|
52
62
|
test('when there is a button to download a tarball', () => {
|
|
@@ -59,11 +69,10 @@ describe('<ActionBar /> component', () => {
|
|
|
59
69
|
expect(screen.getByLabelText('action-bar-action.raw')).toBeTruthy();
|
|
60
70
|
});
|
|
61
71
|
|
|
62
|
-
test('when click button to raw manifest open a dialog with
|
|
72
|
+
test('when click button to raw manifest open a dialog with viewer', async () => {
|
|
63
73
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} showRaw={true} />, store);
|
|
64
74
|
fireEvent.click(screen.getByLabelText('action-bar-action.raw'));
|
|
65
|
-
|
|
66
|
-
// expect(screen.getByTestId('raw-viewver-dialog')).toBeInTheDocument();
|
|
75
|
+
await waitFor(() => expect(screen.getByTestId('rawViewer--dialog')).toBeInTheDocument());
|
|
67
76
|
});
|
|
68
77
|
|
|
69
78
|
test('should not display download tarball button', () => {
|
|
@@ -78,8 +87,6 @@ describe('<ActionBar /> component', () => {
|
|
|
78
87
|
|
|
79
88
|
test('when there is a button to open an issue', () => {
|
|
80
89
|
renderWithStore(<ActionBar packageMeta={defaultPackageMeta} />, store);
|
|
81
|
-
// TODO: should be visible by text
|
|
82
|
-
// expect(screen.getByLabelText('action-bar-action.open-an-issue')).toBeTruthy();
|
|
83
90
|
expect(screen.getByTestId('BugReportIcon')).toBeInTheDocument();
|
|
84
91
|
});
|
|
85
92
|
});
|