From 898f74330083e22658f49958f4e727e2fb486f9d Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Wed, 17 Jul 2024 22:10:09 +0800 Subject: [PATCH] must use `module-alias` to use fleetbase-s3 plugin as a runtime dependency when running as verdaccio plugin --- lib/index.js | 1 + package-lock.json | 12 +++++++++--- package.json | 8 ++++++-- src/index.ts | 2 ++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/lib/index.js b/lib/index.js index e98bdf0..624e8b4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); +require('module-alias/register'); const express_1 = require("express"); const verdaccio_fleetbase_s3_storage_1 = __importDefault(require("@fleetbase/verdaccio-fleetbase-s3-storage")); class FleetbaseExtensionsMiddleware { diff --git a/package-lock.json b/package-lock.json index 5d652c9..d1a174a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,18 @@ { "name": "@fleetbase/verdaccio-fleetbase-extensions-middleware", - "version": "0.0.2", + "version": "0.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@fleetbase/verdaccio-fleetbase-extensions-middleware", - "version": "0.0.2", + "version": "0.0.3", "license": "AGPL-3.0-or-later", "dependencies": { "@fleetbase/verdaccio-fleetbase-s3-storage": "0.0.1", "@verdaccio/commons-api": "10.2.0", - "express": "4.18.1" + "express": "4.18.1", + "module-alias": "^2.2.3" }, "devDependencies": { "@types/express": "4.17.13", @@ -4887,6 +4888,11 @@ "node": "*" } }, + "node_modules/module-alias": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/module-alias/-/module-alias-2.2.3.tgz", + "integrity": "sha512-23g5BFj4zdQL/b6tor7Ji+QY4pEfNH784BMslY9Qb0UnJWRAt+lQGLYmRaM0KDBwIG23ffEBELhZDP2rhi9f/Q==" + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", diff --git a/package.json b/package.json index b0ff120..064faf3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fleetbase/verdaccio-fleetbase-extensions-middleware", - "version": "0.0.2", + "version": "0.0.3", "description": "Middleware to handle querying and listing of published extensions.", "keywords": [ "verdaccio", @@ -32,7 +32,8 @@ "dependencies": { "express": "4.18.1", "@fleetbase/verdaccio-fleetbase-s3-storage": "0.0.1", - "@verdaccio/commons-api": "10.2.0" + "@verdaccio/commons-api": "10.2.0", + "module-alias": "^2.2.3" }, "devDependencies": { "@verdaccio/types": "10.5.2", @@ -45,5 +46,8 @@ "eslint": "8.21.0", "jest": "28.1.3", "typescript": "4.7.4" + }, + "_moduleAliases": { + "@fleetbase/verdaccio-fleetbase-s3-storage": "/verdaccio/plugins/verdaccio-fleetbase-s3-storage" } } diff --git a/src/index.ts b/src/index.ts index 7cedd53..b792ad3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,5 @@ +require('module-alias/register'); + import { Logger, IPluginMiddleware, IBasicAuth, IStorageManager, PluginOptions, Config } from '@verdaccio/types'; import { Router, Request, Response, NextFunction, Application } from 'express'; import { CustomConfig } from './types/index';