1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-02-21 07:29:37 +01:00

chore: update versions (#5094)

This commit is contained in:
Juan Picado 2025-02-16 20:28:02 +01:00 committed by GitHub
parent 22c3455918
commit 96e0011655
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 27 additions and 5 deletions

@ -0,0 +1,6 @@
---
'@verdaccio/middleware': patch
'@verdaccio/web': patch
---
chore: export and constant on middleware

@ -1,3 +1,6 @@
/**
* Enum for web urls, used on the web middleware
*/
export enum WebUrls { export enum WebUrls {
sidebar_scopped_package = '/sidebar/:scope/:package', sidebar_scopped_package = '/sidebar/:scope/:package',
sidebar_package = '/sidebar/:package', sidebar_package = '/sidebar/:package',
@ -8,3 +11,12 @@ export enum WebUrls {
search = '/search/:anything', search = '/search/:anything',
reset_password = '/reset_password', reset_password = '/reset_password',
} }
/**
* Enum for web urls namespace, used on the web middleware
*/
export enum WebUrlsNamespace {
root = '/-/verdaccio/',
data = '/data/',
sec = '/sec/',
}

@ -1 +1,2 @@
export { default } from './middleware'; export { default, PLUGIN_UI_PREFIX, DEFAULT_PLUGIN_UI_THEME } from './middleware';
export * from './web-utils';

@ -8,6 +8,9 @@ import { webMiddleware } from '@verdaccio/middleware';
import webEndpointsApi from './api'; import webEndpointsApi from './api';
export const PLUGIN_UI_PREFIX = 'verdaccio-theme';
export const DEFAULT_PLUGIN_UI_THEME = '@verdaccio/ui-theme';
export async function loadTheme(config: any) { export async function loadTheme(config: any) {
if (_.isNil(config.theme) === false) { if (_.isNil(config.theme) === false) {
const plugin = await asyncLoadPlugin( const plugin = await asyncLoadPlugin(
@ -23,7 +26,7 @@ export async function loadTheme(config: any) {
*/ */
return plugin.staticPath && plugin.manifest && plugin.manifestFiles; return plugin.staticPath && plugin.manifest && plugin.manifestFiles;
}, },
config?.serverSettings?.pluginPrefix ?? 'verdaccio-theme', config?.serverSettings?.pluginPrefix ?? PLUGIN_UI_PREFIX,
PLUGIN_CATEGORY.THEME PLUGIN_CATEGORY.THEME
); );
if (plugin.length > 1) { if (plugin.length > 1) {
@ -37,9 +40,9 @@ export async function loadTheme(config: any) {
export default async (config, auth, storage, logger) => { export default async (config, auth, storage, logger) => {
let pluginOptions = await loadTheme(config); let pluginOptions = await loadTheme(config);
if (!pluginOptions) { if (!pluginOptions) {
pluginOptions = require('@verdaccio/ui-theme')(config.web); pluginOptions = require(DEFAULT_PLUGIN_UI_THEME)(config.web);
logger.info( logger.info(
{ name: '@verdaccio/ui-theme', pluginCategory: PLUGIN_CATEGORY.THEME }, { name: DEFAULT_PLUGIN_UI_THEME, pluginCategory: PLUGIN_CATEGORY.THEME },
'plugin @{name} successfully loaded (@{pluginCategory})' 'plugin @{name} successfully loaded (@{pluginCategory})'
); );
} }